From b77cb967a3ae670fead19a461daa127a8a4647b2 Mon Sep 17 00:00:00 2001
From: chenrui <1187576398@qq.com>
Date: 星期一, 09 六月 2025 16:05:15 +0800
Subject: [PATCH] 回款登记记录修改
---
src/views/salesManagement/receiptPayment/index.vue | 94 +++++++++++++++++++++++++++++++++++++++-------
src/views/salesManagement/invoiceRegistration/index.vue | 3 +
2 files changed, 81 insertions(+), 16 deletions(-)
diff --git a/src/views/salesManagement/invoiceRegistration/index.vue b/src/views/salesManagement/invoiceRegistration/index.vue
index 4995938..fa91776 100644
--- a/src/views/salesManagement/invoiceRegistration/index.vue
+++ b/src/views/salesManagement/invoiceRegistration/index.vue
@@ -55,6 +55,7 @@
<el-table-column label="涓氬姟鍛�" prop="salesman" show-overflow-tooltip/>
<el-table-column label="椤圭洰鍚嶇О" prop="projectName" show-overflow-tooltip/>
<el-table-column label="鍚堝悓閲戦(鍏�)" prop="contractAmount" show-overflow-tooltip :formatter="formattedNumber"/>
+ <el-table-column label="宸插紑绁ㄩ噾棰�(鍏�)" prop="invoiceTotal" show-overflow-tooltip :formatter="formattedNumber"/>
<el-table-column label="鏈紑绁ㄩ噾棰�(鍏�)" prop="noInvoiceAmountTotal" show-overflow-tooltip :formatter="formattedNumber"/>
</el-table>
<pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper" :page="page.current"
@@ -231,7 +232,7 @@
}
// 涓昏〃鍚堣鏂规硶
const summarizeMainTable = (param) => {
- return proxy.summarizeTable(param, ['contractAmount','noInvoiceAmountTotal']);
+ return proxy.summarizeTable(param, ['contractAmount','noInvoiceAmountTotal','invoiceTotal']);
};
// 瀛愯〃鍚堣鏂规硶
const summarizeChildrenTable = (param) => {
diff --git a/src/views/salesManagement/receiptPayment/index.vue b/src/views/salesManagement/receiptPayment/index.vue
index c86117e..b8eedd2 100644
--- a/src/views/salesManagement/receiptPayment/index.vue
+++ b/src/views/salesManagement/receiptPayment/index.vue
@@ -33,18 +33,28 @@
show-summary
:summary-method="summarizeChildrenTable">
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column label="浜у搧澶х被" prop="productCategory" />
- <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" />
- <el-table-column label="鍗曚綅" prop="unit" width="70"/>
- <el-table-column label="鏁伴噺" prop="quantity" width="70"/>
- <el-table-column label="绋庣巼" prop="taxRate" width="70" />
- <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" />
- <el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" />
- <el-table-column label="涓嶅惈绋庢�讳环(鍏�)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" />
- <el-table-column label="寮�绁ㄦ暟" prop="invoiceNum" />
- <el-table-column label="寮�绁ㄩ噾棰�(鍏�)" prop="invoiceAmount" :formatter="formattedNumber" />
- <el-table-column label="鏈紑绁ㄦ暟" prop="noInvoiceNum" />
- <el-table-column label="鏈紑绁ㄩ噾棰�(鍏�)" prop="noInvoiceAmount" :formatter="formattedNumber"/>
+ <el-table-column label="鍥炴鏃ユ湡" prop="receiptPaymentDate" />
+ <el-table-column label="鍥炴閲戦" prop="receiptPaymentAmount">
+ <template #default="scope">
+ <el-input v-model="scope.row.receiptPaymentAmount" :disabled="!scope.row.editType"></el-input>
+ </template>
+ </el-table-column>
+ <el-table-column label="鍥炴鏂瑰紡" prop="receiptPaymentType" >
+ <template #default="scope">
+ <el-select v-model="scope.row.receiptPaymentType" placeholder="璇烽�夋嫨" clearable :disabled="!scope.row.editType">
+ <el-option v-for="item in receipt_payment_type" :key="item.value" :label="item.label" :value="item.value"/>
+ </el-select>
+ </template>
+ </el-table-column>
+ <el-table-column label="鐧昏浜�" prop="registrant" />
+ <el-table-column label="鐧昏鏃ユ湡" prop="createTime" />
+ <el-table-column label="鎿嶄綔" width="150">
+ <template #default="scope">
+ <el-button link type="primary" size="small" @click="changeEditType(scope.row)" v-if="!scope.row.editType">缂栬緫</el-button>
+ <el-button link type="primary" size="small" @click="saveReceiptPayment(scope.row)" v-if="scope.row.editType">淇濆瓨</el-button>
+ <el-button link type="primary" size="small" @click="delReceiptRecord(scope.row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
</el-table>
</template>
</el-table-column>
@@ -146,9 +156,12 @@
import {
receiptPaymentSaveOrUpdate,
bindInvoiceNoRegPage,
- invoiceInfo, receiptPaymentHistoryListNoPage
+ invoiceInfo,
+ receiptPaymentHistoryListNoPage,
+ receiptPaymentDel
} from "../../../api/salesManagement/receiptPayment.js";
import useUserStore from '@/store/modules/user'
+import { ElMessage,ElMessageBox } from 'element-plus'
const userStore = useUserStore()
const { proxy } = getCurrentInstance()
const tableData = ref([])
@@ -208,6 +221,7 @@
getList()
}
const getList = () => {
+ expandedRowKeys.value = []
tableLoading.value = true
bindInvoiceNoRegPage({...searchForm.value, ...page}).then(res => {
tableLoading.value = false
@@ -226,6 +240,11 @@
type: 1 }).then(res => {
const index = tableData.value.findIndex(item => item.id === row.id);
if (index > -1) {
+ if(res?.length > 0) {
+ res.forEach(item => {
+ item.editType = false
+ })
+ }
tableData.value[index].children = res;
}
expandedRowKeys.value.push(row.id)
@@ -239,7 +258,8 @@
}
// 琛ㄦ牸閫夋嫨鏁版嵁
const handleSelectionChange = (selection) => {
- selectedRows.value = selection
+ console.log('selection', selection)
+ selectedRows.value = selection.filter(item => item.children !== undefined);
}
// 涓昏〃鍚堣鏂规硶
const summarizeMainTable = (param) => {
@@ -250,7 +270,7 @@
};
// 瀛愯〃鍚堣鏂规硶
const summarizeChildrenTable = (param) => {
- return proxy.summarizeTable(param, ['taxInclusiveUnitPrice', 'taxInclusiveTotalPrice', 'taxExclusiveTotalPrice','invoiceNum','invoiceAmount','noInvoiceNum','noInvoiceAmount']);
+ return proxy.summarizeTable(param, ['receiptPaymentAmount']);
}
// 鎵撳紑寮规
const openForm = () => {
@@ -290,6 +310,50 @@
proxy.resetForm("formRef")
dialogFormVisible.value = false
}
+
+// 鍒犻櫎鍥炴璁板綍
+const delReceiptRecord = (row) => {
+ console.log('row',row)
+ ElMessageBox.confirm("纭鍒犻櫎璇ヨ褰曞悧锛�", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(async () => {
+ try {
+ let ids = []
+ ids.push(row.id)
+ await receiptPaymentDel(ids);
+ ElMessage.success("鍒犻櫎鎴愬姛");
+ getList();
+ } catch (error) {
+ console.error("鍒犻櫎澶辫触:", error);
+ ElMessage.error("鍒犻櫎澶辫触");
+ }
+ })
+ .catch(() => {
+ ElMessage.info("宸插彇娑堝垹闄�");
+ });
+
+}
+
+// 缂栬緫淇敼鐘舵��
+const changeEditType = (row) => {
+ row.editType = !row.editType
+}
+
+// 淇濆瓨鍥炴璁板綍
+const saveReceiptPayment = (row) => {
+ let updateData = {
+ id:row.id,
+ receiptPaymentType: row.receiptPaymentType,
+ receiptPaymentAmount: row.receiptPaymentAmount
+ }
+ receiptPaymentSaveOrUpdate(updateData).then(res => {
+ row.editType = !row.editType
+ })
+}
+
getList()
</script>
--
Gitblit v1.9.3