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/paymentTmsFinance/index.vue | 220 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 212 insertions(+), 8 deletions(-)
diff --git a/ui/admin-ui3/src/views/tms/paymentTmsFinance/index.vue b/ui/admin-ui3/src/views/tms/paymentTmsFinance/index.vue
index eab9298..a5f8c78 100644
--- a/ui/admin-ui3/src/views/tms/paymentTmsFinance/index.vue
+++ b/ui/admin-ui3/src/views/tms/paymentTmsFinance/index.vue
@@ -45,7 +45,35 @@
>瀵煎嚭
</el-button>
</template>
+ <template #menu-before="{row}">
+ <el-link size="small" type="primary" v-if="row.status == 0" @click="handleConfirm(row)" class="link-btn"
+ :underline="false" icon="el-icon-pointer">纭
+ </el-link>
+ <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="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>
@@ -57,13 +85,19 @@
exportTmsFinance,
getTmsFinance,
listTmsFinance,
- updateTmsFinance
+ 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";
import {usePagePlus} from "@/hooks/usePagePlus";
import {hasPermission} from "@/utils/permissionUtils";
+import {ElMessage, ElMessageBox} from "element-plus";
+import {confirmOrder} from "@/api/tms/tmsDispatchOrder";
const {proxy} = useCurrentInstance();
const crudRef = ref();
@@ -77,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>{},
@@ -86,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',
@@ -99,15 +143,19 @@
systemCode: {
label: '绯荤粺缂栧彿',
- hide: false,minWidth: 150,
+ hide: false,minWidth: 180,
search: true,
},
dispatchNo: {
label: '璋冨害鍗曞彿',minWidth: 150,
search: true,
},
- customerCode: {
- label: '瀹㈡埛缂栫爜',minWidth: 150,
+ planName: {
+ label: '搴斾粯鏂规鍚嶇О',minWidth: 150,
+ search: true,
+ },
+ customerName: {
+ label: '瀹㈡埛',minWidth: 150,
search: true,
},
projectName: {
@@ -121,12 +169,15 @@
requiredVehicleTypes: {
label: '瑕佹眰杞﹀瀷',minWidth: 150,
search: false,
+ display: true, type: 'select', dicUrl: '/system/dict/data/type/license_type', dataType: 'string',
+
},
actualVehicleType: {
label: '瀹為檯杞﹀瀷',minWidth: 150,
search: false,
+ display: true, type: 'select', dicUrl: '/system/dict/data/type/license_type', dataType: 'string',
},
- mainDriver: {
+ mainDriverName: {
label: '涓婚┚椹跺憳',minWidth: 150,
search: false,
},
@@ -136,8 +187,8 @@
search: false,
},
- transportRoute: {
- label: '杩愯緭绾胯矾',minWidth: 150,
+ transportLine: {
+ label: '杩愯緭绾胯矾',minWidth: 150, overHidden: true,
search: false,
},
@@ -173,6 +224,8 @@
status: {
label: '鐘舵��',minWidth: 150,
search: false,fixed: 'right',
+ display: true, type: 'select', dicUrl: '/system/dict/data/type/finance_status', dataType: 'string',
+
},
updateBy: {
label: '鏇存柊浜�',
@@ -184,6 +237,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,
@@ -219,8 +333,98 @@
},
handleSelectionChangeFunc: (selection: any) => {
selectionList.value = selection;
+ },
+ getBeginListFunc:()=>{
+ queryParams.value.type = 1;
}
})
+const handleConfirm = (row: any) => {
+ ElMessageBox.confirm("鏄惁瀵硅皟搴﹀崟鍙�" + row.dispatchNo + "鐨勫簲浠樻柟妗堣繘琛岀‘璁� 锛�", '绯荤粺鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ return confirmFinance(row.id);
+ }).then(() => {
+ onLoad(page.value);
+ ElMessage({
+ message: "鎿嶄綔鎴愬姛锛�",
+ type: 'success'
+ })
+ });
+}
+const handleCancel = (row: any) => {
+ ElMessageBox.confirm("鏄惁瀵硅皟搴﹀崟鍙�" + row.dispatchNo + "鐨勫簲浠樻柟妗堣繘琛屼綔搴燂紵", '绯荤粺鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ return cancelFinance(row.id);
+ }).then(() => {
+ onLoad(page.value);
+ ElMessage({
+ message: "鎿嶄綔鎴愬姛锛�",
+ type: 'success'
+ })
+ });
+}
+
+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