From de1a42d853176d83805c1290d7381235a9780a2d Mon Sep 17 00:00:00 2001
From: zhangback <zhangback@163.com>
Date: 星期二, 18 十一月 2025 11:58:57 +0800
Subject: [PATCH] 提交
---
ui/admin-ui3/src/views/tms/collectionTmsFinance/index.vue | 153 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 151 insertions(+), 2 deletions(-)
diff --git a/ui/admin-ui3/src/views/tms/collectionTmsFinance/index.vue b/ui/admin-ui3/src/views/tms/collectionTmsFinance/index.vue
index 6c807a8..a9db3e4 100644
--- a/ui/admin-ui3/src/views/tms/collectionTmsFinance/index.vue
+++ b/ui/admin-ui3/src/views/tms/collectionTmsFinance/index.vue
@@ -52,11 +52,28 @@
<el-link size="small" type="primary" v-if="[0,1].includes(row.status)" @click="handleCancel(row)" class="link-btn" :underline="false"
icon="el-icon-connection">浣滃簾
</el-link>
- <el-link size="small" type="primary" v-if="[0,1].includes(row.status)" @click="handleAddFinance(row)" class="link-btn"
+ <el-link size="small" type="primary" v-if="[0,1].includes(row.status)" @click="handleAddFinanceDetail(row)" class="link-btn"
:underline="false" icon="el-icon-edit-pen">璐圭敤鏄庣粏
</el-link>
</template>
</avue-crud>
+ <el-dialog :title="pageF.title" v-model="pageF.open" class="avue-dialog avue-dialog--top" width="80%">
+ 鎬昏垂鐢� <el-input-number v-model="form.totalAmount" disabled readonly></el-input-number>
+ <avue-crud style="margin-top: 10px "
+ :option="financeTableOption"
+ :data="boxTableData"
+ :permission="permissionList2"
+ @row-update="rowDetailUpdate"
+ @row-save="rowDetailSave"
+ >
+ <template #menu="{row}">
+ <el-link size="small" type="primary" v-if="[0].includes(row.status)" @click="handleCancelDetail(row)" class="link-btn" :underline="false"
+ icon="el-icon-connection">浣滃簾
+ </el-link>
+ </template>
+ </avue-crud>
+ </el-dialog>
+
</basicContainer>
</template>
@@ -70,6 +87,10 @@
listTmsFinance,
updateTmsFinance,confirmFinance,cancelFinance
} from "@/api/tms/tmsFinance";
+import {addTmsFinanceDetail, listTmsFinanceDetail,
+ cancelFinanceDetail,
+ updateTmsFinanceDetail} from "@/api/tms/tmsFinanceDetail"
+
import useCurrentInstance from "@/utils/useCurrentInstance";
import {computed, reactive, ref, toRefs} from "vue";
import {PagesInterface, PageQueryInterface} from "@/utils/globalInterface";
@@ -90,6 +111,15 @@
}
})
+const permissionList2 = (key: any, row: any, index: any) => {
+ if (key == 'addBtn') {
+ return true
+ }else if (key == 'editBtn') {
+ return [0].includes(row?.status)
+ } else {
+ return true;
+ }
+};
const data = reactive({
form: <TmsFinanceI>{},
queryParams: <TmsFinanceI & PageQueryInterface>{},
@@ -99,8 +129,9 @@
currentPage: 1,
},
selectionList: [],
+ boxTableData: []
})
-const {queryParams, form, page, selectionList} = toRefs(data);
+const {queryParams, form, page, selectionList,boxTableData} = toRefs(data);
const option = ref({
pageKey: 'TmsFinance',
rowKey: 'id',
@@ -207,6 +238,67 @@
}
})
+
+const financeTableOption = ref({
+ menu: true,
+ addBtn: true,
+ header: true, selection: false,
+ viewBtn: false,
+ delBtn: false,labelWidth:150,
+ column: {
+ feeType: {
+ label: '璐圭敤鍚嶇О',minWidth: 150,
+ display: true,disabled: true,
+ value: "99",
+ type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/fee_type',
+ },
+ initialFeeAmount: {
+ label: '鍒濆鐧昏璐圭敤閲戦',minWidth: 150,
+ display: true,disabled: true,type: 'number',
+ },
+ actualFeeAmount: {
+ label: '瀹為檯璐圭敤閲戦',minWidth: 150, type: 'number',
+ display: true,
+ rules: [
+ {
+ required: true,
+ message: "瀹為檯璐圭敤閲戦涓嶈兘涓虹┖", trigger: "change"
+ }
+ ],
+ },
+ feeVoucherUrl: {
+ label: '璐圭敤鍑瘉',
+ display: true, hide:true,
+ accept:'string',dataType: 'string',
+ type: 'upload',
+ action: '/common/upload2',
+ propsHttp:{
+ home:'url',
+ name:'newFileName',
+ },
+ },
+ feeCreateTime: {
+ label: '璐圭敤鍒涘缓鏃堕棿',minWidth: 180,
+ display: false,
+ },
+ updateBy: {
+ label: '鏇存柊浜�',minWidth: 150,
+ display: false,
+ },
+ updateTime: {
+ label: '鏇存柊鏃堕棿',minWidth: 180,
+ display: false,
+
+ },
+ status: {
+ label: '鐘舵��',minWidth: 150, fixed: 'right',
+ display: false,
+ type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/finance_detail_status',
+ },
+ }
+})
+
+
const {
tableData,
pageF,
@@ -278,4 +370,61 @@
});
}
+const handleAddFinanceDetail = (row:any) => {
+
+ listTmsFinanceDetail({financeId:row.id,pageNum:1,pageSize: 9999}).then(res=>{
+ boxTableData.value = res.rows || [];
+ pageF.title = '璐圭敤鏄庣粏';
+ pageF.open = true;
+ form.value = row;
+ })
+}
+
+const rowDetailUpdate = (row:any,index:any,done:any, loading:any) => {
+ updateTmsFinanceDetail( row).then(res=>{
+ ElMessage({
+ message: "淇敼鎴愬姛锛�",
+ type: 'success'
+ })
+ handleAddFinanceDetail(res.data);
+ onLoad(page.value);
+ done();
+ }).catch(()=>{
+ loading()
+ })
+}
+const rowDetailSave = (row:any, done:any, loading:any) => {
+row.financeId = form.value.id;
+addTmsFinanceDetail({...row,dispatchOrderId:form.value.dispatchId,
+ type: form.value.type,financeType:form.value.type
+}).then(res=>{
+ ElMessage({
+ message: "鏂板鎴愬姛锛�",
+ type: 'success'
+ })
+ handleAddFinanceDetail(res.data);
+ onLoad(page.value);
+ done();
+}).catch(()=>{
+ loading()
+})
+}
+
+const handleCancelDetail = (row: any) => {
+ ElMessageBox.confirm("鏄惁浣滃簾鎺� " + row.$feeType + "纭畾 锛�", '绯荤粺鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ return cancelFinanceDetail(row.id);
+ }).then(() => {
+ handleAddFinanceDetail(form.value);
+ onLoad(page.value);
+ ElMessage({
+ message: "鎿嶄綔鎴愬姛锛�",
+ type: 'success'
+ })
+ });
+}
+
</script>
--
Gitblit v1.8.0