diff --git a/src/views/PurchasingCenter/FundApproval1/index.vue b/src/views/PurchasingCenter/FundApproval1/index.vue
index e36f59c0..9171bc17 100644
--- a/src/views/PurchasingCenter/FundApproval1/index.vue
+++ b/src/views/PurchasingCenter/FundApproval1/index.vue
@@ -59,7 +59,7 @@
合同明细
-
+
{{ scope.row.合同类型 === 1 ? scope.row.采购合同编号 : scope.row.离线合同编号 }}
@@ -80,19 +80,19 @@
{{ scope.row.物料型号 }}
-
+
{{ scope.row.数量 }}
-
+
- {{ scope.row.单价 }}
+ {{ parseFloat(scope.row.单价||0).toFixed(2) }}
-
+
- {{ parseFloat(scope.row.单价||0) * parseInt(scope.row.数量||0) }}
+ {{ (parseFloat(scope.row.单价||0) * parseInt(scope.row.数量||0)).toFixed(2) }}
@@ -100,11 +100,16 @@
{{ scope.row.合同类型 === 1 ? scope.row.交货期.split(' ')[0] === '1900-01-01' ? '-' : scope.row.交货期.split(' ')[0] : scope.row.交货期要求 }}
-
+
{{ scope.row.备注 }}
+
+
+ {{ scope.row.合同类型 === 1 ? scope.row.已到货数量 : scope.row.到货数量 }}
+
+
@@ -162,7 +167,7 @@ export default {
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总价'
- } else if (index === 7) {
+ } else if (index === 6) {
const values = data.map(item => Number(parseFloat(item['单价']) * parseInt(item['数量'])))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
@@ -173,7 +178,7 @@ export default {
return prev
}
}, 0)
- sums[index] += ' 元'
+ sums[index] = sums[index].toFixed(2) + ' 元'
} else {
sums[index] = 'N/A'
}
diff --git a/src/views/PurchasingCenter/FundApproval2/index.vue b/src/views/PurchasingCenter/FundApproval2/index.vue
index 7224ca88..59ad373e 100644
--- a/src/views/PurchasingCenter/FundApproval2/index.vue
+++ b/src/views/PurchasingCenter/FundApproval2/index.vue
@@ -26,11 +26,11 @@
-
+
- {{ scope.row.采购合同编号 }}
+ {{ scope.row.采购合同编号 ? scope.row.采购合同编号 : scope.row.离线合同编号 }}
@@ -58,106 +58,59 @@
@current-change="handleCurrentChange1"/>
-
-
- 离线合同
-
-
-
- {{ scope.row.供应商名称 }}
-
-
-
-
- {{ scope.row.请款时间 }}
-
-
-
-
- {{ scope.row.姓名 }}
-
-
-
-
- {{ scope.row.请款金额 }}
-
-
-
-
-
-
-
-
-
- {{ scope.row.离线合同编号 }}
-
-
-
-
- {{ scope.row.请款金额 }}
-
-
-
- 查看详情
-
- 通过
- 不通过
-
-
-
-
-
-
-
- 采购合同
-
- 离线合同
-
-
-
- 离线合同 |
-
-
- | GAOJING |
- 合同名称 |
- |
- 供应商 |
- |
- |
-
-
- | 合同编号 |
- |
- 采购员 |
- |
-
-
- | 序号 |
- 名称 |
- 规格 |
- 型号 |
- 数量 |
- 单价 |
- 合计 |
- 交货期 |
- 备注 |
-
-
- | 总计 |
-
- |
- |
-
-
-
+ 合同明细
+
+
+
+ {{ scope.row.合同类型 === 1 ? scope.row.采购合同编号 : scope.row.离线合同编号 }}
+
+
+
+
+ {{ scope.row.物料名称 }}
+
+
+
+
+ {{ scope.row.物料规格 }}
+
+
+
+
+ {{ scope.row.物料型号 }}
+
+
+
+
+ {{ scope.row.数量 }}
+
+
+
+
+ {{ parseFloat(scope.row.单价||0).toFixed(2) }}
+
+
+
+
+ {{ (parseFloat(scope.row.单价||0) * parseInt(scope.row.数量||0)).toFixed(2) }}
+
+
+
+
+ {{ scope.row.合同类型 === 1 ? scope.row.交货期.split(' ')[0] === '1900-01-01' ? '-' : scope.row.交货期.split(' ')[0] : scope.row.交货期要求 }}
+
+
+
+
+ {{ scope.row.备注 }}
+
+
+
+
+ {{ scope.row.合同类型 === 1 ? scope.row.已到货数量 : scope.row.到货数量 }}
+
+
+
@@ -196,8 +149,33 @@ export default {
this.fetchData()
},
methods: {
+ getSummaries2(param) { // 合计
+ const { columns, data } = param
+ const sums = []
+ columns.forEach((column, index) => {
+ if (index === 0) {
+ sums[index] = '总价'
+ return
+ } else if (index === 2 || index === 3) {
+ const values = data.map(item => Number(item[column.property]))
+ if (!values.every(value => isNaN(value))) {
+ sums[index] = values.reduce((prev, curr) => {
+ const value = Number(curr)
+ if (!isNaN(value)) {
+ return prev + curr
+ } else {
+ return prev
+ }
+ }, 0)
+ sums[index] = sums[index].toFixed(2) + ' 元'
+ } else {
+ sums[index] = 'N/A'
+ }
+ }
+ })
+ return sums
+ },
showOffline(row) {
- console.log(row, 222)
const children = document.getElementsByClassName('tableData')
const parent = document.getElementsByClassName('offlineContract')[0]
if (children.length !== 0) {
@@ -236,13 +214,13 @@ export default {
document.getElementById('remark').innerHTML = row.离线合同备注
},
searchContactDetail(row) {
- document.documentElement.scrollTop = this.$el.querySelector('#firstAnchor').offsetTop
- searchContactDetail(row.采购合同流水号).then(response => {
- this.contractDetail1 = response.data[0].合同内容
+ var check
+ row.采购合同流水号 ? check = 1 : check = 2
+ searchContactDetail(check, row.采购合同流水号, row.离线合同流水号).then(response => {
+ this.contractDetail2 = response.data
})
},
searchOfflineContactDetail(row) { // 查询离线合同明细
- document.documentElement.scrollTop = this.$el.querySelector('#secondAnchor').offsetTop
searchMateriel(row.离线合同流水号).then(response => {
this.contractDetail2 = response.data
this.showOffline(row)
@@ -254,7 +232,7 @@ export default {
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总价'
- } else if (index === 7) {
+ } else if (index === 6) {
const values = data.map(item => Number(parseFloat(item['单价']) * parseInt(item['数量'])))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
@@ -265,7 +243,7 @@ export default {
return prev
}
}, 0)
- sums[index] += ' 元'
+ sums[index] = sums[index].toFixed(2) + ' 元'
} else {
sums[index] = 'N/A'
}
diff --git a/src/views/PurchasingCenter/FundApproval3/index.vue b/src/views/PurchasingCenter/FundApproval3/index.vue
index 2396f385..7d8861ce 100644
--- a/src/views/PurchasingCenter/FundApproval3/index.vue
+++ b/src/views/PurchasingCenter/FundApproval3/index.vue
@@ -26,11 +26,11 @@
-
@@ -203,9 +148,37 @@ export default {
this.fetchData()
},
methods: {
+ getSummaries2(param) { // 合计
+ const { columns, data } = param
+ const sums = []
+ columns.forEach((column, index) => {
+ if (index === 0) {
+ sums[index] = '总价'
+ return
+ } else if (index === 2 || index === 3) {
+ const values = data.map(item => Number(item[column.property]))
+ if (!values.every(value => isNaN(value))) {
+ sums[index] = values.reduce((prev, curr) => {
+ const value = Number(curr)
+ if (!isNaN(value)) {
+ return prev + curr
+ } else {
+ return prev
+ }
+ }, 0)
+ sums[index] = sums[index].toFixed(2) + ' 元'
+ } else {
+ sums[index] = 'N/A'
+ }
+ }
+ })
+ return sums
+ },
searchContactDetail(row) {
- searchContactDetail(row.采购合同流水号).then(response => {
- this.contractDetail1 = response.data[0].合同内容
+ var check
+ row.采购合同流水号 ? check = 1 : check = 2
+ searchContactDetail(check, row.采购合同流水号, row.离线合同流水号).then(response => {
+ this.contractDetail2 = response.data
})
},
searchOfflineContactDetail(row) { // 查询离线合同明细
@@ -219,7 +192,7 @@ export default {
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总价'
- } else if (index === 7) {
+ } else if (index === 6) {
const values = data.map(item => Number(parseFloat(item['单价']) * parseInt(item['数量'])))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
@@ -230,7 +203,7 @@ export default {
return prev
}
}, 0)
- sums[index] += ' 元'
+ sums[index] = sums[index].toFixed(2) + ' 元'
} else {
sums[index] = 'N/A'
}