diff --git a/jnpf-java-boot/jnpf-scm/jnpf-scm-biz/src/main/java/jnpf/service/impl/VoucherServiceImpl.java b/jnpf-java-boot/jnpf-scm/jnpf-scm-biz/src/main/java/jnpf/service/impl/VoucherServiceImpl.java index 9f652fed..a2641f8a 100644 --- a/jnpf-java-boot/jnpf-scm/jnpf-scm-biz/src/main/java/jnpf/service/impl/VoucherServiceImpl.java +++ b/jnpf-java-boot/jnpf-scm/jnpf-scm-biz/src/main/java/jnpf/service/impl/VoucherServiceImpl.java @@ -257,6 +257,24 @@ public class VoucherServiceImpl extends ServiceImpl + + + + width="200"> - - + 、 diff --git a/jnpf-java-boot/jnpf-web/src/views/extend/cwaccount/form.vue b/jnpf-java-boot/jnpf-web/src/views/extend/cwaccount/form.vue index 8256c43d..9799fb4f 100644 --- a/jnpf-java-boot/jnpf-web/src/views/extend/cwaccount/form.vue +++ b/jnpf-java-boot/jnpf-web/src/views/extend/cwaccount/form.vue @@ -1367,7 +1367,8 @@ - + border> @@ -1929,6 +1930,9 @@ export default { }, { "label": "归属人员", "value": "belongPeopleName" + }, { + "label": "所属部门", + "value": "fFullName" }], cwaccountcontractcontractIdcolumnOptions: [{ "label": "合同编码", @@ -2244,6 +2248,40 @@ export default { }, mounted() { }, methods: { + getSummaries(param) { + const summaryField = ["settlementTotal"]; + const { columns, data } = param; + const sums = []; + columns.forEach((column, index) => { + if (index === 0) { + sums[index] = '合计'; + return; + } + if (!summaryField.includes(column.property)) { + sums[index] = ''; + return; + } + 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 this.jnpf.floatAdd(prev, curr); + } else { + return prev; + } + }, 0); + const thousandsField = []; + if (thousandsField.includes(column.property)) { + sums[index] = thousandsFormat(sums[index]); + } + } else { + sums[index] = ''; + } + }); + return sums; + }, + initList(list) { for (let i = 0; i < list.length; i++) { const e = list[i]; @@ -2988,7 +3026,7 @@ export default { found.otherExpenses = this.jnpf.floatSub(Number(found.otherExpenses), Number(cur.otherExpenses)).toFixed(2); } } else { - acc.push({ productId: cur.productId, productName: cur.productName, spec: cur.spec, rate: cur.rate, settlementSum: cur.settlementSum, settlementTotal: cur.settlementTotal, settlementUnit: cur.unit, settlementPrice: cur.settlementPrice, settlementSubtotal: cur.settlementSubtotal, settlementPriceNo: cur.settlementPriceNo, settlementSubtotalNo: cur.settlementSubtotalNo, otherType: cur.otherType, otherExpenses: cur.otherExpenses, settlementTotal: cur.settlementTotal, settlementTotalNo: cur.settlementTotalNo, businessOrderId: cur.businessOrderId, orderNo: cur.orderNo}) + acc.push({ productId: cur.productId, productName: cur.productName, spec: cur.spec, rate: cur.rate, settlementSum: cur.settlementSum, settlementTotal: cur.settlementTotal, settlementUnit: cur.unit, settlementPrice: cur.settlementPrice, settlementSubtotal: cur.settlementSubtotal, settlementPriceNo: cur.settlementPriceNo, settlementSubtotalNo: cur.settlementSubtotalNo, otherType: cur.otherType, otherExpenses: cur.otherExpenses, settlementTotal: cur.settlementTotal, settlementTotalNo: cur.settlementTotalNo, businessOrderId: cur.businessOrderId, orderNo: cur.orderNo }) } return acc }, []) diff --git a/jnpf-java-boot/jnpf-web/src/views/scm/purchaseCenter/receiptVoucher/index.vue b/jnpf-java-boot/jnpf-web/src/views/scm/purchaseCenter/receiptVoucher/index.vue index 57a77fd7..10c8595c 100644 --- a/jnpf-java-boot/jnpf-web/src/views/scm/purchaseCenter/receiptVoucher/index.vue +++ b/jnpf-java-boot/jnpf-web/src/views/scm/purchaseCenter/receiptVoucher/index.vue @@ -44,6 +44,19 @@ + + + + + + + + + + + + + @@ -72,9 +85,7 @@ 导入 - + 生成采购单 @@ -84,6 +95,9 @@ 生成销售发货凭证 + 批量删除 +
@@ -98,7 +112,7 @@
+ show-summary :summary-method="getTableSummaries" border> @@ -334,6 +348,8 @@ export default { voucherType: undefined, preparationTime: undefined, poundCode: undefined, + supplierName: undefined, + netWeight: undefined, businessType: "1", documentType: "1" }, @@ -742,6 +758,44 @@ export default { }) } }, + getTableSummaries(param) { + const { + columns, + data + } = param; + const sums = []; + columns.forEach((column, index) => { + if (index === 0) { + sums[index] = '合计'; + return; + } else if (["netWeight"].includes(column.property)) { + const values = data.map(item => { + if (column.property.includes('.')) { + const [attr1, attr2] = column.property.split('.') + return Number(item[attr1][attr2]) + } + return 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).toFixed(2); + if ([].includes(column.property)) { + sums[index] = thousandsFormat(sums[index]); + } + } else { + sums[index] = ''; + } + } + }) + return sums; + }, + getColumnList() { // 没有开启权限 this.columnOptions = this.transformColumnList(this.columnList) @@ -922,6 +976,22 @@ export default { }) return } + const selectData = this.multipleSelectionItem + let isSaleFlag = true + debugger + selectData.forEach(function (item) { + if (item.isTransfer == '2') { + isSaleFlag = false + } + }); + if (!isSaleFlag) { + this.$message({ + type: 'error', + message: '凭证已生成销售单', + duration: 1500, + }) + return + } const ids = this.multipleSelection this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', { type: 'warning' diff --git a/jnpf-java-boot/jnpf-web/src/views/scm/saleCenter/deliveryVoucher/index.vue b/jnpf-java-boot/jnpf-web/src/views/scm/saleCenter/deliveryVoucher/index.vue index 13f45970..1a5ad9e9 100644 --- a/jnpf-java-boot/jnpf-web/src/views/scm/saleCenter/deliveryVoucher/index.vue +++ b/jnpf-java-boot/jnpf-web/src/views/scm/saleCenter/deliveryVoucher/index.vue @@ -28,6 +28,36 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -53,9 +83,7 @@ 导出 - + 生成销售单 @@ -65,6 +93,9 @@ 生成采购收货凭证 + 批量删除 +
@@ -79,7 +110,7 @@
+ show-summary :summary-method="getTableSummaries" border> --> - + - + @@ -281,10 +310,14 @@ export default { uploadBoxVisible: false, detailVisible: false, query: { + purchaseContractNo: undefined, + saleContractNo: undefined, voucherCode: undefined, voucherType: undefined, preparationTime: undefined, poundCode: undefined, + customerName: undefined, + netWeight: undefined, businessType: "2", documentType: "2" }, @@ -645,6 +678,43 @@ export default { }) } }, + getTableSummaries(param) { + const { + columns, + data + } = param; + const sums = []; + columns.forEach((column, index) => { + if (index === 0) { + sums[index] = '合计'; + return; + } else if (["netWeight"].includes(column.property)) { + const values = data.map(item => { + if (column.property.includes('.')) { + const [attr1, attr2] = column.property.split('.') + return Number(item[attr1][attr2]) + } + return 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).toFixed(2); + if ([].includes(column.property)) { + sums[index] = thousandsFormat(sums[index]); + } + } else { + sums[index] = ''; + } + } + }) + return sums; + }, getColumnList() { // 没有开启权限 this.columnOptions = this.transformColumnList(this.columnList) @@ -822,6 +892,22 @@ export default { }) return } + const selectData = this.multipleSelectionItem + let isSaleFlag = true + debugger + selectData.forEach(function (item) { + if (item.isTransfer == '2') { + isSaleFlag = false + } + }); + if (!isSaleFlag) { + this.$message({ + type: 'error', + message: '凭证已生成销售单', + duration: 1500, + }) + return + } const ids = this.multipleSelection this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', { type: 'warning'