From 7ed2a032d0724e68aec8af940f2ce0023a9f0eb7 Mon Sep 17 00:00:00 2001
From: sen <sen@qq.com>
Date: 星期三, 15 四月 2026 09:27:51 +0800
Subject: [PATCH] 修改调度单年月日

---
 ui/admin-ui3/src/views/tms/tmsArBill/index.vue |  393 +++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 259 insertions(+), 134 deletions(-)

diff --git a/ui/admin-ui3/src/views/tms/tmsArBill/index.vue b/ui/admin-ui3/src/views/tms/tmsArBill/index.vue
index 021b8f2..b18dc16 100644
--- a/ui/admin-ui3/src/views/tms/tmsArBill/index.vue
+++ b/ui/admin-ui3/src/views/tms/tmsArBill/index.vue
@@ -1,63 +1,63 @@
 <template>
   <basicContainer>
-    <avue-crud
-        :option="option"
-        :table-loading="pageF.loading"
-        :data="tableData"
-        :page="page"
-        :permission="permissionList"
-        :before-open="beforeOpen"
-        v-model="form" v-model:search="queryParams"
-        ref="crudRef"
-        @row-update="rowUpdate"
-        @row-save="rowSave"
-        @refresh-change="refreshChange"
-        @row-del="rowDel"
-        @search-change="searchChange"
-        @search-reset="searchReset"
-        @selection-change="selectionChange"
-        @current-change="currentChange"
-        @size-change="sizeChange"
-        @on-load="onLoad"
-    >
-<!--      <template #menu-left>-->
-<!--        <el-button-->
-<!--            type="success"-->
-<!--            icon="Edit"-->
-<!--            :disabled="pageF.single"-->
-<!--            v-hasPermi="['tms:tmsArBill:edit']"-->
-<!--            @click="handleUpdate">淇敼-->
-<!--        </el-button>-->
-<!--        <el-button-->
-<!--            type="danger"-->
-<!--            icon="Delete"-->
-<!--            :disabled="pageF.multiple"-->
-<!--            @click="handleDelete"-->
-<!--            v-hasPermi="['tms:tmsArBill:remove']"-->
-<!--        >鍒犻櫎-->
-<!--        </el-button>-->
-<!--        <el-button-->
-<!--            type="warning"-->
-<!--            plain-->
-<!--            icon="Download"-->
-<!--            @click="handleExport"-->
-<!--            v-hasPermi="['tms:tmsArBill:export']"-->
-<!--        >瀵煎嚭-->
-<!--        </el-button>-->
-<!--      </template>-->
-      <template #menu="{row}">
-        <el-link size="small" type="primary" v-if="row.status != 2"
-                 @click="handleJs(row)" class="link-btn" :underline="false"
-                 icon="el-icon-tickets">缁撶畻
+    <avue-crud :option="option" :table-loading="pageF.loading" :data="tableData" :page="page"
+      :permission="permissionList" :before-open="beforeOpen" v-model="form" v-model:search="queryParams" ref="crudRef"
+      @row-update="rowUpdate" @row-save="rowSave" @refresh-change="refreshChange" @row-del="rowDel"
+      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
+      @current-change="currentChange" @size-change="sizeChange" @on-load="onLoad">
+      <template #menu-left>
+        <!-- <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['tms:tmsArBill:export']">瀵煎嚭
+        </el-button> -->
+      </template>
+      <!--      <template #menu-left>-->
+      <!--        <el-button-->
+      <!--            type="success"-->
+      <!--            icon="Edit"-->
+      <!--            :disabled="pageF.single"-->
+      <!--            v-hasPermi="['tms:tmsArBill:edit']"-->
+      <!--            @click="handleUpdate">淇敼-->
+      <!--        </el-button>-->
+      <!--        <el-button-->
+      <!--            type="danger"-->
+      <!--            icon="Delete"-->
+      <!--            :disabled="pageF.multiple"-->
+      <!--            @click="handleDelete"-->
+      <!--            v-hasPermi="['tms:tmsArBill:remove']"-->
+      <!--        >鍒犻櫎-->
+      <!--        </el-button>-->
+      <!--        <el-button-->
+      <!--            type="warning"-->
+      <!--            plain-->
+      <!--            icon="Download"-->
+      <!--            @click="handleExport"-->
+      <!--            v-hasPermi="['tms:tmsArBill:export']"-->
+      <!--        >瀵煎嚭-->
+      <!--        </el-button>-->
+      <!--      </template>-->
+      <template #menu="{ row }">
+        <el-link size="small" type="primary" v-if="row.status != 2" @click="handleJs(row)" class="link-btn"
+          underline="never" icon="el-icon-tickets">缁撶畻
         </el-link>
-        <el-link size="small" type="primary"
-                           @click="handleEdit(row)" class="link-btn" :underline="false"
-                           icon="el-icon-edit">淇敼
-      </el-link>
-        <el-link size="small" type="primary"
-                           @click="handleLog(row)" class="link-btn" :underline="false"
-                           icon="el-icon-tickets">鏃ュ織
-      </el-link>
+        <el-link size="small" type="primary" v-if="row.pushStatus == 3 || row.pushStatus == 4|| row.pushStatus == 0"
+          @click="handleManualPush(row)" class="link-btn" underline="never" icon="el-icon-upload">鎵嬪姩鎺ㄩ��
+        </el-link>
+        <el-link size="small" type="primary" @click="handleDerive(row)" class="link-btn" underline="never"
+          icon="Download">瀵煎嚭
+        </el-link>
+        <el-link size="small" type="primary" @click="handleEdit(row)" class="link-btn" underline="never"
+          icon="el-icon-edit">淇敼
+        </el-link>
+           <el-link size="small" type="primary" v-if="[0, 2].includes(row.status)" @click="handleClose(row)"
+            class="link-btn" v-hasPermi="['tms:tmsArBill:closeOrder']" underline="never" icon="el-icon-close">
+            浣滃簾
+          </el-link>
+        <el-link size="small" type="primary" @click="handleLog(row)" class="link-btn" underline="never"
+          icon="el-icon-tickets">鏃ュ織
+        </el-link>
+         <el-link size="small" type="primary" @click="handleFlow(row)" class="link-btn" underline="never"
+          icon="el-icon-document">
+          瀹℃牳鏃ュ織
+        </el-link>
       </template>
     </avue-crud>
 
@@ -65,28 +65,49 @@
 
     <el-dialog :title="pageF.title" v-model="pageF.open" class="avue-dialog avue-dialog--top" width="80%">
 
-      <avue-form v-if="opt == 'js'"  v-model="boxForm" ref="boxFormRef"
-                  :option="boxFormOption">
+      <avue-form v-if="opt == 'js'" v-model="boxForm" ref="boxFormRef" :option="boxFormOption">
+        <template #settleAmount>
+          <avue-input-number :min="0" :max="form.actualSettlementAmount" v-model="boxForm.settleAmount"
+            placeholder="璇疯緭鍏ョ粨绠楅噾棰�"></avue-input-number>
 
+        </template>
       </avue-form>
-      <el-descriptions :column="3" title="璐﹀崟鍩烘湰淇℃伅"  border>
-        <el-descriptions-item label="璐﹀崟绯荤粺缂栧彿">{{form.systemNo}}</el-descriptions-item>
+      <el-descriptions :column="3" title="璐﹀崟鍩烘湰淇℃伅" border>
+        <el-descriptions-item label="璐﹀崟绯荤粺缂栧彿">{{ form.systemNo }}</el-descriptions-item>
         <el-descriptions-item label="璐﹀崟鍚嶇О">
           <div v-if="opt === 'edit'">
             <el-input v-model="form.billName" placeholder="璇疯緭鍏ヨ处鍗曞悕绉�" />
           </div>
-          <div v-else>{{form.billName}}</div>
+          <div v-else>{{ form.billName }}</div>
         </el-descriptions-item>
-        <el-descriptions-item label="瀹㈡埛鍚嶇О">{{form.customerName}}</el-descriptions-item>
-        <el-descriptions-item label="搴旂粨绠楅噾棰�">{{form.settleAmount}}</el-descriptions-item>
-        <el-descriptions-item label="宸茬粨绠楅噾棰�" v-if="opt == 'js'">{{form.settledAmount}}</el-descriptions-item>
-        <el-descriptions-item label="寰呯粨绠楅噾棰�" v-if="opt == 'js'">{{Number(form.settleAmount) - Number(form.settledAmount)}}</el-descriptions-item>
+        <el-descriptions-item label="瀹㈡埛鍚嶇О">{{ form.customerName }}</el-descriptions-item>
+        <el-descriptions-item label="搴旂粨绠楅噾棰�">{{ form.settleAmount }}</el-descriptions-item>
+        <el-descriptions-item label="鍑忓厤閲戦">
+          <div v-if="opt === 'edit'">
+            <el-input-number :min="0" :max="form.settleAmount" v-model="form.deductionAmount" placeholder="璇疯緭鍏ュ噺鍏嶉噾棰�"
+              @change="deductionAmountChange" />
+          </div>
+          <div v-else>{{ form.deductionAmount }}</div>
+        </el-descriptions-item>
+        <el-descriptions-item label="瀹為檯缁撶畻閲戦" v-if="opt == 'edit'">{{ form.actualSettlementAmount
+          }}</el-descriptions-item>
+        <el-descriptions-item label="鍑忓厤鍘熷洜" v-if="opt == 'edit'">
+          <div v-if="opt === 'edit'">
+            <el-input v-model="form.reasonReduction" placeholder="璇疯緭鍏ュ噺鍏嶅師鍥�" />
+          </div>
+          <div v-else>{{ form.reasonReduction }}</div>
+        </el-descriptions-item>
+        <el-descriptions-item label="宸茬粨绠楅噾棰�" v-if="opt == 'js'">{{ form.settledAmount }}</el-descriptions-item>
+        <el-descriptions-item label="寰呯粨绠楅噾棰�" v-if="opt == 'js'">{{ Number(form.settleAmount) -
+          Number(form.settledAmount) }}</el-descriptions-item>
       </el-descriptions>
       <h3>鍏宠仈鏄庣粏</h3>
-      <avue-crud
-          :option="YSGenerateTableOption" ref="itemsTableRef"
-          :data="form.items"
-      >
+      <avue-crud :option="YSGenerateTableOption" ref="itemsTableRef" :data="form.items">
+        <template #menu="{ row }">
+          <el-link size="small" type="primary" @click="handleCancel(row)" class="link-btn" :underline="false"
+            icon="el-icon-close">鍙栨秷鍏宠仈
+          </el-link>
+        </template>
 
       </avue-crud>
 
@@ -101,23 +122,21 @@
     </el-dialog>
     <el-dialog :title="pageF.title" v-model="open2" class="avue-dialog avue-dialog--top" width="80%">
 
-      <avue-crud
-          :option="logTableOption" ref="itemsTableRef2"
-          :data="logTable"
-      >
+      <avue-crud :option="logTableOption" ref="itemsTableRef2" :data="logTable">
 
       </avue-crud>
 
 
-    <template #footer>
-      <div class="dialog-footer">
-        <el-button @click="open2 = false">鍙� 娑�</el-button>
-      </div>
-    </template>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="open2 = false">鍙� 娑�</el-button>
+        </div>
+      </template>
     </el-dialog>
 
 
   </basicContainer>
+      <flowLogA ref="flowLogIshow" :isShow="false" title="瀹℃牳鏃ュ織" :flowParams="flowParams"></flowLogA>
 </template>
 
 <script setup name="tmsArBill" lang="ts">
@@ -128,16 +147,20 @@
   exportTmsArBill,
   getTmsArBill,
   listTmsArBill,
-  updateTmsArBill
+  updateTmsArBill, cancelArBill,
+  exportArBillFormat,manualPushTmsArBill,listReceivableAuditLog,tmsArBillCancelPush
 } from "@/api/tms/tmsArBill";
 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 {addTmsArSettlement, listTmsArSettlement} from "@/api/tms/tmsArSettlement";
+import { computed, reactive, ref, toRefs } from "vue";
+import { PagesInterface, PageQueryInterface } from "@/utils/globalInterface";
+import { usePagePlus } from "@/hooks/usePagePlus";
+import { hasPermission } from "@/utils/permissionUtils";
+import { addTmsArSettlement, listTmsArSettlement } from "@/api/tms/tmsArSettlement";
+import { ElMessage, ElMessageBox } from "element-plus";
+import { confirmFinance } from "@/api/tms/tmsFinance";
+import { download } from "@/utils/request";
 
-const {proxy} = useCurrentInstance();
+const { proxy } = useCurrentInstance();
 const crudRef = ref();
 
 const permissionList = computed(() => {
@@ -159,10 +182,10 @@
   },
   selectionList: [],
   opt: '',
-  boxForm:<any> {},
+  boxForm: <any>{},
   open2: false
 })
-const {queryParams, form, page, selectionList,opt,boxForm,open2} = toRefs(data);
+const { queryParams, form, page, selectionList, opt, boxForm, open2 } = toRefs(data);
 const option = ref({
   pageKey: 'TmsArBill',
   rowKey: 'id',
@@ -183,36 +206,52 @@
       label: '绯荤粺缂栧彿',
       addDisplay: true,
       editDisplay: true,
-      viewDisplay: true,minWidth:150,
+      viewDisplay: true, minWidth: 150,
       hide: false,
       search: true,
     },
     billName: {
       label: '璐﹀崟鍚嶇О',
-      addDisplay: true,minWidth:200,
+      addDisplay: true, minWidth: 220,
       editDisplay: true,
       viewDisplay: true,
       hide: false,
       search: true,
+      showOverflowTooltip: true
     },
     customerName: {
       label: '瀹㈡埛鍚嶇О',
-      addDisplay: true,minWidth:200,
+      addDisplay: true, minWidth: 220,
       editDisplay: true,
       viewDisplay: true,
       hide: false,
       search: true,
+      showOverflowTooltip: true
     },
     dispatchCount: {
       label: '璋冨害鍗曟暟閲�',
-      addDisplay: true,minWidth:120,
+      addDisplay: true, minWidth: 120,
       editDisplay: true,
       viewDisplay: true,
       hide: false,
     },
     settleAmount: {
       label: '搴旂粨绠楅噾棰�',
-      addDisplay: true,minWidth:120,
+      addDisplay: true, minWidth: 120,
+      editDisplay: true,
+      viewDisplay: true,
+      hide: false,
+    },
+    deductionAmount: {
+      label: '鍑忓厤閲戦',
+      addDisplay: true, minWidth: 120,
+      editDisplay: true,
+      viewDisplay: true,
+      hide: false,
+    },
+    actualSettlementAmount: {
+      label: '瀹為檯缁撶畻閲戦',
+      addDisplay: true, minWidth: 120,
       editDisplay: true,
       viewDisplay: true,
       hide: false,
@@ -220,28 +259,41 @@
     settledAmount: {
       label: '宸茬粨绠楅噾棰�',
       addDisplay: true,
-      editDisplay: true,minWidth:120,
+      editDisplay: true, minWidth: 120,
       viewDisplay: true,
       hide: false,
+    },
+    pushTime: {
+      label: '鎺ㄩ�佹椂闂�', display: false, search: true, searchRange: true, type: 'date',
+      format: 'YYYY-MM-DD', hide: false, searchSpan: 6, minWidth: 150,
+      valueFormat: 'YYYY-MM-DD',
     },
     invoiceStatus: {
       label: '寮�绁ㄧ姸鎬�',
       addDisplay: true,
-      editDisplay: true,minWidth:120,
+      editDisplay: true, minWidth: 120,
       type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/invoice_status',
-
       hide: false,
       search: true,
+      fixed: 'right'
     },
     status: {
       label: '鐘舵��',
-      addDisplay: true,minWidth:120,
+      addDisplay: true, minWidth: 120,
       editDisplay: true,
       viewDisplay: true,
       type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/ar_bill_status',
-
       hide: false,
       search: true,
+      fixed: 'right'
+    },
+    pushStatus: {
+      label: '鎺ㄩ�佺姸鎬�',
+      minWidth: 120,
+      type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/sys_push_status',
+      hide: false,
+      search: true,
+      fixed: 'right'
     }
   }
 })
@@ -259,9 +311,9 @@
   onLoad,
   currentChange,
   sizeChange,
-  handleDelete,
+  // handleDelete,
   handleExport,
-  handleUpdate,
+  // handleUpdate,
   refreshChange
 } = usePagePlus({
   form: form,
@@ -271,7 +323,7 @@
   page: page.value,
   getListApi: listTmsArBill,
   getDetailApi: getTmsArBill,
-  exportApi: exportTmsArBill,
+  exportApi: exportArBillFormat,
   deleteApi: delTmsArBill,
   addApi: addTmsArBill,
   updateApi: updateTmsArBill,
@@ -282,29 +334,31 @@
     selectionList.value = selection;
   }
 })
-const YSGenerateTableOption= ref({
-  menu: false,
+const YSGenerateTableOption = ref({
+  menu: true,
   add: false,
-  header:false,
+  header: false,
   selection: false,
-  rowKey:'id',
+  rowKey: 'id',
+  editBtn: false,
+  viewBtn: false,
+  delBtn: false,
+  column: {
 
-  column:{
-
-    projectName:{
+    projectName: {
       label: '椤圭洰鍚嶇О',
     },
-    dispatchNo:{
+    dispatchNo: {
       label: '璋冨害鍗曞彿',
     },
-    orderTime:{
+    orderTime: {
       label: '涓嬪崟鏃堕棿',
     },
 
-    estimateAmount:{
+    estimateAmount: {
       label: '棰勪及搴旀敹閲戦',
     },
-    currency:{
+    currency: {
       label: '甯佸埗',
     }
   }
@@ -344,21 +398,21 @@
 })
 const boxFormRef = ref();
 
-const handleJs = (row:any) => {
+const handleJs = (row: any) => {
   form.value.items = [];
-  getTmsArBill(row.id).then((res:any) => {
-    form.value = res.data ||[];
+  getTmsArBill(row.id).then((res: any) => {
+    form.value = res.data || [];
     pageF.open = true;
     pageF.title = '搴旀敹璐﹀崟缁撶畻';
     boxForm.value = {}
     opt.value = 'js'
   })
 }
-const handleEdit = (row:any) => {
+const handleEdit = (row: any) => {
 
   form.value.items = [];
-  getTmsArBill(row.id).then((res:any) => {
-    form.value = res.data ||[];
+  getTmsArBill(row.id).then((res: any) => {
+    form.value = res.data || [];
     pageF.open = true;
     pageF.title = '搴旀敹璐﹀崟淇敼';
     opt.value = 'edit'
@@ -367,7 +421,7 @@
 
 const editSubmit = () => {
   pageF.isUploading = true;
-  updateTmsArBill(form.value).then(res=>{
+  updateTmsArBill(form.value).then(res => {
     pageF.isUploading = false;
     pageF.open = false;
     proxy.$message.success('淇敼鎴愬姛');
@@ -375,8 +429,8 @@
   })
 }
 const jsSubmit = () => {
-  boxFormRef.value.validate((callback:any,done:any)=>{
-    if( callback){
+  boxFormRef.value.validate((callback: any, done: any) => {
+    if (callback) {
       boxForm.value.billId = form.value.id;
       addTmsArSettlement(boxForm.value).then((res) => {
         pageF.open = false;
@@ -389,44 +443,115 @@
     }
   })
 }
-const logTableOption= ref({
+const logTableOption = ref({
   menu: false,
   add: false,
-  header:false,
+  header: false,
   selection: false,
-  rowKey:'id',
+  rowKey: 'id',
 
-  column:{
+  column: {
 
-    settleAmount:{
+    settleAmount: {
       label: '缁撶畻閲戦',
     },
-    createBy:{
+    createBy: {
       label: '澶勭悊浜哄憳',
     },
-    attachment:{
+    attachment: {
       label: '闄勪欢涓嬭浇',
       dataType: 'string',
       type: 'img'
     },
 
-    remark:{
+    remark: {
       label: '澶囨敞',
     },
-    createTime:{
+    createTime: {
       label: '鎻愪氦鏃堕棿',
     },
   }
 })
 const logTable = ref<any>()
 
-const handleLog = (row:any)=>{
-  listTmsArSettlement({billId:row.id}).then(res=>{
-    logTable.value =  res.rows||[];
+const handleLog = (row: any) => {
+  listTmsArSettlement({ billId: row.id }).then(res => {
+    logTable.value = res.rows || [];
     open2.value = true;
     pageF.title = '缁撶畻鏃ュ織';
   })
-
 }
 
+
+
+const deductionAmountChange = (e: any) => {
+  form.value.actualSettlementAmount = (Number(form.value.settleAmount) || 0) - (Number(form.value.deductionAmount) || 0);
+}
+
+const handleCancel = (row: any) => {
+  ElMessageBox.confirm("鏄惁瀵硅皟搴﹀崟鍙�" + row.dispatchNo + "鐨勫簲鏀惰垂鐢ㄥ彇娑堝叧鑱旓紵", '绯荤粺鎻愮ず', {
+    confirmButtonText: '纭畾',
+    cancelButtonText: '鍙栨秷',
+    type: 'warning'
+  }).then(() => {
+    return cancelArBill(row.id);
+  }).then(() => {
+    onLoad(page.value);
+    ElMessage({
+      message: "鎿嶄綔鎴愬姛锛�",
+      type: 'success'
+    })
+  });
+}
+const handleDerive = (row: any) => {
+  // 鏋勯�犱笅杞藉弬鏁帮紝閫氬父闇�瑕佷紶鍏ュ綋鍓嶈鐨� ID 鎴栫浉鍏虫煡璇㈡潯浠�
+  const downloadParams = {
+    id: row.id, // 鍋囪鍚庡彴闇�瑕侀�氳繃璐﹀崟ID瀵煎嚭
+    // 濡傛灉鏈夊叾浠栨悳绱㈡潯浠讹紝涔熷彲浠ュ悎骞惰繘鍘�
+  };
+  download('tms/tmsArBill/exportArBillFormat', downloadParams);
+};
+const handleManualPush = (row: any) => {
+  ElMessageBox.confirm(`纭畾瑕佸皢璐﹀崟銆�${row.billName}銆戞墜鍔ㄦ帹閫佸埌璐㈠姟绯荤粺鍚楋紵`, '绯荤粺鎻愮ず', {
+    confirmButtonText: '纭畾',
+    cancelButtonText: '鍙栨秷',
+    type: 'info'
+  }).then(() => {
+    // 璋冪敤鎺ㄩ�佹帴鍙�
+    return manualPushTmsArBill(row.id); 
+  }).then((res) => {
+    proxy.$message.success(res.msg);
+    onLoad(page.value); // 鍒锋柊鍒楄〃
+  }).catch(() => {
+    // 鍙栨秷鎿嶄綔
+  });
+}
+const flowLogIshow = ref()
+const flowParams = ref([])
+
+const handleFlow = (row: any) => {
+  let data = {
+    headId: row.id,
+  }
+  listReceivableAuditLog(data).then((res) => {
+    flowParams.value = res.rows
+    flowLogIshow.value.openModel()
+
+  })
+}
+const handleClose = (row: any) => {
+  ElMessageBox.confirm("鏄惁瀵瑰簲鏀惰处鍗�" + row.systemNo + "杩涜浣滃簾锛�", '绯荤粺鎻愮ず', {
+    confirmButtonText: '纭畾',
+    cancelButtonText: '鍙栨秷',
+    type: 'warning'
+  }).then(() => {
+    return tmsArBillCancelPush(row.id);
+  }).then(() => {
+    onLoad(page.value);
+    ElMessage({
+      message: "鎿嶄綔鎴愬姛锛�",
+      type: 'success'
+    })
+  });
+}
 </script>

--
Gitblit v1.8.0