From bf6d13fdf5ba7dd4dd2533e62f95f529b272a31e Mon Sep 17 00:00:00 2001 From: chenrui <1187576398@qq.com> Date: 星期一, 09 六月 2025 13:25:58 +0800 Subject: [PATCH] 文件上传弹窗大小修改 --- src/views/procurementManagement/invoiceEntry/index.vue | 109 ++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 72 insertions(+), 37 deletions(-) diff --git a/src/views/procurementManagement/invoiceEntry/index.vue b/src/views/procurementManagement/invoiceEntry/index.vue index 070b7ce..88ff50c 100644 --- a/src/views/procurementManagement/invoiceEntry/index.vue +++ b/src/views/procurementManagement/invoiceEntry/index.vue @@ -107,26 +107,30 @@ <el-form-item label="浜у搧淇℃伅锛�" prop="entryDate"> </el-form-item> </el-row> - <el-table :data="productData" border @selection-change="productSelected" show-summary - :summary-method="summarizeChildrenTable"> + <el-table :data="productData" border @selection-change="productSelected" show-summary style="width: 100%" :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" /> - <el-table-column label="鏁伴噺" prop="quantity" /> - <el-table-column label="绋庣巼(%)" prop="taxRate" /> - <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="unit" width="70" /> + <el-table-column label="鏁伴噺" prop="quantity" width="70"/> + <el-table-column label="绋庣巼(%)" prop="taxRate" width="80" /> + <el-table-column label="鍚◣鍗曚环(鍏�)" width="150" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" /> + <el-table-column label="鍚◣鎬讳环(鍏�)" width="150" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" /> + <el-table-column label="涓嶅惈绋庢�讳环(鍏�)" width="150" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" /> <el-table-column label="鏈鏉ョエ鏁�" prop="ticketsNum" width="170"> <template #default="scope"> - <el-input-number v-model="scope.row.ticketsNum" :precision="0" :step="1" clearable style="width: 100%" - @blur="invoiceNumBlur(scope.row)" /> + <el-input-number v-model="scope.row.ticketsNum" placeholder="璇烽�夋嫨" :min="0" :step="0.1" clearable style="width: 100%" + @change="invoiceNumBlur(scope.row)" /> </template> </el-table-column> - <el-table-column label="鏈鏉ョエ閲戦(鍏�)" prop="ticketsAmount" :formatter="formattedNumber"></el-table-column> + <el-table-column label="鏈鏉ョエ閲戦(鍏�)" prop="ticketsAmount" :min="0" :step="0.1" :formatter="formattedNumber" @change="invoiceAmountBlur" width="170"> + <template #default="scope"> + <el-input-number v-model="scope.row.ticketsAmount" placeholder="璇烽�夋嫨" :min="0" :step="0.1" clearable style="width: 100%" + @change="invoiceAmountBlur(scope.row)" /> + </template> + </el-table-column> <el-table-column label="鏈潵绁ㄦ暟" prop="futureTickets" - :formatter="(row) => row.futureTickets == null || row.futureTickets === '' ? row.quantity : row.futureTickets"> + : ="(row) => row.futureTickets == null || row.futureTickets === '' ? row.quantity : row.futureTickets"> </el-table-column> <el-table-column label="鏈潵绁ㄩ噾棰�(鍏�)" prop="futureTicketsAmount" :formatter="(row) => (row.futureTicketsAmount !== undefined && row.futureTicketsAmount !== null && row.futureTicketsAmount !== '' ? row.futureTicketsAmount : row.taxExclusiveTotalPrice)"> @@ -161,14 +165,14 @@ const tableLoading = ref(false) const page = reactive({ current: 1, - size: 10, + size: 100, }) const total = ref(0) const fileList = ref([]) import { addOrUpdateRegistration, delRegistration, - gePurchaseList, + gePurchaseListPage, getInfo, getProduct, getPurchaseNoById, @@ -188,9 +192,13 @@ purchaseLedgerNo: '', issUerId: '', // 寮�绁ㄤ汉id issUer: '' ,// 寮�绁ㄤ汉濮撳悕 + invoiceNumber:"", // 鍙戠エ鍙� + invoiceAmount:"", // 鍙戠エ閲戦 }, rules: { - purchaseLedgerId: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }], + invoiceNumber: [{ required: true, message: '璇疯緭鍏ュ彂绁ㄥ彿' , trigger: 'blur' },{type:"string"}], + invoiceAmount: [{ required: true, message: '璇疯緭鍏ュ彂绁ㄩ噾棰�' , trigger: 'blur'}], + } }) const { searchForm, form, rules } = toRefs(data) @@ -205,16 +213,16 @@ page.current = 1 getList() } -const paginationChange = ({ current, limit }) => { - page.current = current; - page.size = limit; +const paginationChange = (obj) => { + page.current = obj.page; + page.size = obj.limit; getList() } const getList = () => { tableLoading.value = true - gePurchaseList({ ...searchForm.value, ...page }).then(res => { + gePurchaseListPage({ ...searchForm.value, ...page }).then(res => { tableLoading.value = false - tableData.value = res.rows + tableData.value = res.records; tableData.value.map(item => { item.children = [] }) @@ -279,6 +287,7 @@ // 鎵撳紑寮规 const openForm = (type, row) => { + invoiceNumBlur(row) operationType.value = type form.value = {} productData.value = [] @@ -347,13 +356,6 @@ proxy.resetForm("formRef") dialogFormVisible.value = false } -// 濉啓鏁版嵁 -const openProductEdit = (row) => { - const index = productData.value.findIndex(item => item.id === row.id); - if (index > -1) { - productData.value[index].editFlag = !productData.value[index].editFlag - } -} // 瀵煎嚭 const handleOut = () => { ElMessageBox.confirm( @@ -394,22 +396,41 @@ proxy.$modal.msg("宸插彇娑�") }) } -//鏈寮�绁ㄥけ鐒︽搷浣� +//鏈鏉ョエ鏁板け鐒︽搷浣� const invoiceNumBlur = (row) => { - if (!row.ticketsNum) { - row.ticketsNum = 0 + if (!row.ticketsNum || row.ticketsNum === '') { + row.ticketsNum = 0 } - if (Number(row.ticketsNum) > Number(row.futureTickets)) { + if (Number(row.ticketsNum) > Number(row.tempFutureTickets)) { proxy.$modal.msgWarning('鏈寮�绁ㄦ暟涓嶅緱澶т簬鏈紑绁ㄦ暟') row.ticketsNum = 0 return } - // 璁$畻鏈寮�绁ㄩ噾棰� + // 璁$畻鏈鏉ョエ閲戦 row.ticketsAmount = row.ticketsNum * row.taxInclusiveUnitPrice - // 璁$畻鏈紑绁ㄦ暟 - row.futureTickets = row.futureTickets - row.ticketsNum - // 璁$畻鏈紑绁ㄩ噾棰� - row.futureTicketsAmount = row.futureTickets * row.taxInclusiveUnitPrice + // 璁$畻鏈潵绁ㄦ暟 + row.futureTickets = row.tempFutureTickets - row.ticketsNum + // 璁$畻鏈潵绁ㄩ噾棰� + row.futureTicketsAmount = row.tempFutureTicketsAmount - row.ticketsAmount + calculateinvoiceAmount() +} +// 鏈鏉ョエ閲戦澶辩劍鎿嶄綔 +const invoiceAmountBlur = (row) => { + if(!row.ticketsAmount){ + row.ticketsAmount = 0 + } + // 璁$畻鏄惁瓒呰繃鏉ョエ鎬婚噾棰� + if(row.ticketsAmount > row.tempFutureTicketsAmount){ + proxy.$modal.msgWarning('鏈鏉ョエ閲戦涓嶅緱澶т簬鏈潵绁ㄩ噾棰�') + row.ticketsAmount = 0 + } + // 璁$畻鏈鏉ョエ鏁� + row.ticketsNum = (row.ticketsAmount / row.taxInclusiveUnitPrice).toFixed(2) + // 璁$畻鏈潵绁ㄦ暟 + row.futureTickets = row.tempFutureTickets - row.ticketsNum + // 璁$畻鏈潵绁ㄩ噾棰� + row.futureTicketsAmount = row.tempFutureTicketsAmount - row.ticketsAmount + calculateinvoiceAmount() } // 鑾峰彇褰撳墠鏃ユ湡鍑芥暟 @@ -422,7 +443,21 @@ if (strDate < 10) strDate = `0${strDate}` // 濡傛灉鏃ユ槸涓綅鏁帮紝鍦ㄥ墠闈㈣ˉ0 return `${year}-${month}-${strDate}` } + + +function calculateinvoiceAmount() { + console.log('productData',productData.value) + var invoiceAmountTotal = 0 + productData.value.forEach(item => { + if(item.ticketsAmount){ + invoiceAmountTotal += item.ticketsAmount + } + }) + form.value.invoiceAmount = invoiceAmountTotal.toFixed(2) + +} + getList() </script> -<style scoped lang="scss"></style> \ No newline at end of file +<style scoped lang="scss"></style> -- Gitblit v1.9.3