Browse Source

Merge branch 'develop'

ly 1 năm trước cách đây
mục cha
commit
f62b3646f8
63 tập tin đã thay đổi với 7853 bổ sung8741 xóa
  1. 1 0
      package.json
  2. 3 1
      src/api/business/entrust/deduct.js
  3. 10 0
      src/api/business/financial/collection.js
  4. 8 0
      src/api/business/financial/payment.js
  5. 51 0
      src/api/business/info.js
  6. 72 0
      src/api/business/invoice.js
  7. 19 0
      src/api/business/production/deduction.js
  8. 19 16
      src/views/business/collect/count/index.vue
  9. 141 138
      src/views/business/contracts/simpleCompany/index.vue
  10. 259 396
      src/views/business/contracts/standardCpmpany/index.vue
  11. 125 176
      src/views/business/crm/bin/index.vue
  12. 6 3
      src/views/business/crm/company/index.vue
  13. 169 164
      src/views/business/crm/dict/index.vue
  14. 198 276
      src/views/business/crm/noContractWorkOrder/index.vue
  15. 24 22
      src/views/business/crm/order/index.vue
  16. 237 386
      src/views/business/crm/workorder/index.vue
  17. 180 0
      src/views/business/deduction/fileDialog.vue
  18. 11 6
      src/views/business/deduction/index.vue
  19. 142 189
      src/views/business/entrust/deduct/index.vue
  20. 154 212
      src/views/business/entrust/deductOfFactory/index.vue
  21. 316 494
      src/views/business/entrust/deposit/index.vue
  22. 316 457
      src/views/business/entrust/depositOfFactory/index.vue
  23. 177 294
      src/views/business/entrust/entrustOrder/index.vue
  24. 210 282
      src/views/business/entrust/statementAccount/index.vue
  25. 11 8
      src/views/business/entrust/workOrder/currentMonth/index.vue
  26. 20 15
      src/views/business/entrust/workOrder/historyMonth/index.vue
  27. 195 282
      src/views/business/entrust/workOrder/nextMonth/index.vue
  28. 161 223
      src/views/business/entrust/workOrder/once/index.vue
  29. 8 5
      src/views/business/entrust/workOrderForFactory/currentMonth/index.vue
  30. 349 344
      src/views/business/entrust/workOrderForFactory/history/index.vue
  31. 165 215
      src/views/business/entrust/workOrderForFactory/nextMonth/index.vue
  32. 140 180
      src/views/business/entrust/workOrderForFactory/once/index.vue
  33. 465 738
      src/views/business/financial/collection/form.vue
  34. 252 362
      src/views/business/financial/collection/index.vue
  35. 5 2
      src/views/business/financial/contract/index.vue
  36. 16 2
      src/views/business/financial/payment/form.vue
  37. 205 335
      src/views/business/financial/payment/index.vue
  38. 9 4
      src/views/business/housingFund/confirm/index.vue
  39. 9 6
      src/views/business/housingFund/declare/index.vue
  40. 196 0
      src/views/business/invoice/ContractChoice.vue
  41. 628 0
      src/views/business/invoice/form.vue
  42. 230 0
      src/views/business/invoice/index.vue
  43. 300 438
      src/views/business/paymentEntry/type/index.vue
  44. 8 4
      src/views/business/production/IndividualIncomeTaxIs/index.vue
  45. 9 4
      src/views/business/production/IndividualIncomeTaxIsZero/index.vue
  46. 305 449
      src/views/business/production/accountAdjustment/index.vue
  47. 9 4
      src/views/business/production/archiveTicket/index.vue
  48. 232 357
      src/views/business/production/deduction/index.vue
  49. 0 1
      src/views/business/production/financialReportTax/FormDialog.vue
  50. 137 130
      src/views/business/production/financialReportTax/index.vue
  51. 260 390
      src/views/business/production/financialReportTaxIsZero/index.vue
  52. 9 4
      src/views/business/production/keepAccount/index.vue
  53. 7 4
      src/views/business/production/onceWork/index.vue
  54. 170 167
      src/views/business/production/productionCompany/index.vue
  55. 10 4
      src/views/business/production/receiveTicket/index.vue
  56. 10 4
      src/views/business/production/receiveTicketFeedback/index.vue
  57. 9 3
      src/views/business/production/salary/index.vue
  58. 10 4
      src/views/business/production/salaryZero/index.vue
  59. 421 517
      src/views/business/service/loop/index.vue
  60. 1 1
      src/views/business/service/once/index.vue
  61. 8 3
      src/views/business/socialSecurity/confirm/index.vue
  62. 25 19
      src/views/business/socialSecurity/declare/index.vue
  63. 1 1
      src/views/business/source/index.vue

+ 1 - 0
package.json

@@ -16,6 +16,7 @@
   },
   "dependencies": {
     "@element-plus/icons-vue": "^2.0.10",
+    "@vue-office/pdf": "^2.0.2",
     "@vueuse/core": "9.5.0",
     "@wangeditor/editor": "^5.1.1",
     "@wangeditor/editor-for-vue": "^5.1.12",

+ 3 - 1
src/api/business/entrust/deduct.js

@@ -117,4 +117,6 @@ export function exportAccountStatement(query) {
  
     `对账单导出_${query.title}.xlsx`
   )
-}
+}
+
+

+ 10 - 0
src/api/business/financial/collection.js

@@ -77,6 +77,16 @@ export function delCollection(id) {
   })
 }
 
+export function setCollectionZero(id) {
+  request.defaults.baseURL = '/ezhizao-yzbh-financial'
+  return request({
+    url: '/business/collection/setCollectionZero/' + id,
+    method: 'get'
+  })
+}
+
+
+
 export function getCreditTermByCompId(query) {
   request.defaults.baseURL = '/ezhizao-yzbh-financial'
   return request({

+ 8 - 0
src/api/business/financial/payment.js

@@ -143,3 +143,11 @@ export function verifyPayment(data) {
   })
 }
 
+export function setPaymentZero(id) {
+  request.defaults.baseURL = '/ezhizao-yzbh-financial'
+  return request({
+    url: '/business/payment/setPaymentZero/'+ id,
+    method: 'get',
+  })
+}
+

+ 51 - 0
src/api/business/info.js

@@ -0,0 +1,51 @@
+import request from '@/utils/request'
+
+// 查询企业租户列表
+export function listInfo(query) {
+  request.defaults.baseURL = '/ezhizao-yzbh-financial'
+  return request({
+    url: '/business/info/list',
+    method: 'get',
+    params: query
+  })
+}
+
+export function getInfo(id) {
+  request.defaults.baseURL = '/ezhizao-yzbh-financial'
+  return request({
+    url: '/business/info/' + id,
+    method: 'get'
+  })
+}
+export function getInfoByTenantId() {
+  request.defaults.baseURL = '/ezhizao-yzbh-financial'
+  return request({
+    url: '/business/info/tenantId',
+    method: 'get'
+  })
+}
+export function addInfo(data) {
+  request.defaults.baseURL = '/ezhizao-yzbh-nancial'
+  return request({
+    url: '/business/info',
+    method: 'post',
+    data: data
+  })
+}
+
+export function updateInfo(data) {
+  request.defaults.baseURL = '/ezhizao-yzbh-financial'
+  return request({
+    url: '/business/info',
+    method: 'put',
+    data: data
+  })
+}
+
+export function delInfo(id) {
+  request.defaults.baseURL = '/ezhizao-yzbh-financial'
+  return request({
+    url: '/business/info/' + id,
+    method: 'delete'
+  })
+}

+ 72 - 0
src/api/business/invoice.js

@@ -0,0 +1,72 @@
+import request from '@/utils/request'
+import { download } from '@/utils/request'
+export function listInvoice(query) {
+  request.defaults.baseURL = '/ezhizao-yzbh-financial'
+  return request({
+    url: '/business/invoice/list',
+    method: 'get',
+    params: query
+  })
+}
+
+export function getInvoice(id) {
+  request.defaults.baseURL = '/ezhizao-yzbh-financial'
+  return request({
+    url: '/business/invoice/' + id,
+    method: 'get'
+  })
+}
+
+export function addInvoice(data) {
+  request.defaults.baseURL = '/ezhizao-yzbh-financial'
+  return request({
+    url: '/business/invoice',
+    method: 'post',
+    data: data
+  })
+}
+
+export function updateInvoice(data) {
+  request.defaults.baseURL = '/ezhizao-yzbh-financial'
+  return request({
+    url: '/business/invoice',
+    method: 'put',
+    data: data
+  })
+}
+
+export function delInvoice(id) {
+  request.defaults.baseURL = '/ezhizao-yzbh-sys'
+  return request({
+    url: '/business/invoice/' + id,
+    method: 'delete'
+  })
+}
+export function getCollectionToAmount(id) {
+  request.defaults.baseURL = '/ezhizao-yzbh-financial'
+  return request({
+    url: '/business/invoice/getCollectionToAmount/' + id,
+    method: 'get'
+  })
+}
+
+
+export function getInfoByName(name) {
+  request.defaults.baseURL = '/ezhizao-yzbh-financial'
+  return request({
+    url: '/business/invoice/getInfoByName/' + name,
+    method: 'get'
+  })
+}
+
+
+export function exportInfo(query) {
+  request.defaults.baseURL = '/ezhizao-yzbh-financial'
+  download(
+    "business/invoice/export",
+    {
+      ...query,
+    },
+    `发票数据导出_${new Date().getTime()}.xlsx`
+  )
+}

+ 19 - 0
src/api/business/production/deduction.js

@@ -78,3 +78,22 @@ export function getAmountView(data) {
     data: data
   })
 }
+export function saveFiles(data) {
+  request.defaults.baseURL = '/ezhizao-yzbh-production'
+  return request({
+    url: '/business/deduction/saveFiles',
+    method: 'post',
+    data: data
+  })
+
+}
+
+export function remove(data) {
+  request.defaults.baseURL = '/ezhizao-yzbh-production'
+  return request({
+    url: '/business/deduction/delFile',
+      method: 'post',
+      data: data
+  })
+
+}

+ 19 - 16
src/views/business/collect/count/index.vue

@@ -5,29 +5,28 @@
             <el-button type="primary" size="small" icon="Download" @click="handleExport">导出</el-button>
         </div>
         <!-- 搜索区 -->
-        <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true"
-            label-width="68px">
+        <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true" label-width="68px">
             <el-form-item label="客户名称:" prop="companyName">
-                <el-input v-model="queryParams.companyName"  size="small"  placeholder="请输入客户名称:" style="width: 150px" clearable
-                    @keyup.enter="handleQuery" />
+                <el-input v-model="queryParams.companyName" size="small" placeholder="请输入客户名称:" style="width: 150px"
+                    clearable @keyup.enter="handleQuery" />
             </el-form-item>
             <el-form-item label="合同编号:" prop="contractNo">
-                <el-input v-model="queryParams.contractNo"  size="small" placeholder="请输入合同编号" style="width: 150px" clearable
-                    @keyup.enter="handleQuery" />
+                <el-input v-model="queryParams.contractNo" size="small" placeholder="请输入合同编号" style="width: 150px"
+                    clearable @keyup.enter="handleQuery" />
             </el-form-item>
             <el-form-item label="产品:">
-                <el-select size="small"  v-model="queryParams.taskTypeIds"   placeholder="产品" clearable
+                <el-select size="small" v-model="queryParams.taskTypeIds" placeholder="产品" clearable
                     style="width: 150px" multiple>
                     <el-option v-for="item in taskType " :key="item.id" :label="item.name" :value="item.id" />
                 </el-select>
             </el-form-item>
             <el-form-item prop="receiptDateFilter" label="到账时间:">
-                <el-date-picker v-model="queryParams.receiptDateFilter" type="daterange" clearable  size="small"
+                <el-date-picker v-model="queryParams.receiptDateFilter" type="daterange" clearable size="small"
                     format="YYYY - MM - DD " value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期"
                     end-placeholder="业务日期" style="width: 100%;"></el-date-picker>
             </el-form-item>
             <el-form-item prop="examineTimeFilter" label="审核时间:">
-                <el-date-picker v-model="queryParams.examineTimeFilter"   size="small" type="daterange" clearable
+                <el-date-picker v-model="queryParams.examineTimeFilter" size="small" type="daterange" clearable
                     format="YYYY - MM - DD " value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期"
                     end-placeholder="业务日期" style="width: 100%;"></el-date-picker>
             </el-form-item>
@@ -47,8 +46,8 @@
                     </el-select>
                 </el-form-item>
                 <el-form-item style="margin-left: 40px;">
-                    <el-button type="primary" icon="Search" @click="handleQuery"  size="small">搜索</el-button>
-                    <el-button icon="Refresh" @click="resetQuery"  size="small">重置</el-button>
+                    <el-button type="primary" icon="Search" @click="handleQuery" size="small">搜索</el-button>
+                    <el-button icon="Refresh" @click="resetQuery" size="small">重置</el-button>
                 </el-form-item>
             </div>
 
@@ -119,10 +118,10 @@
                     <el-table-column label="是否是项目" align="center" prop="isProject" />
                     <el-table-column label="服务金额" align="center" prop="detailAllAmount" />
                     <el-table-column label="实收" align="center" prop="reallyDetailAmount" />
-                    <el-table-column label="审核时间" align="center" prop="examineTime" >
+                    <el-table-column label="审核时间" align="center" prop="examineTime">
                         <template #default="scope">
-                            {{(scope.row.examineTime === '0000-00-00 00:00:00') ? '' : scope.row.examineTime}} 
-                          </template>
+                            {{(scope.row.examineTime === '0000-00-00 00:00:00') ? '' : scope.row.examineTime}}
+                        </template>
                     </el-table-column>
                 </el-table>
             </div>
@@ -144,7 +143,7 @@
                     <!-- <el-table-column label="审核时间" align="center" prop="examineTime"/> -->
                     <el-table-column label="审核时间" align="center" prop="examineTime">
                         <template #default="scope">
-                          {{(scope.row.examineTime === '0000-00-00 00:00:00') ? '' : scope.row.examineTime}} 
+                            {{(scope.row.examineTime === '0000-00-00 00:00:00') ? '' : scope.row.examineTime}}
                         </template>
                     </el-table-column>
                 </el-table>
@@ -159,7 +158,7 @@
     </div>
 </template>
 
-<script setup name="collectCount">
+<script setup name="Collectcount">
     // import {
     //     statistics
     // } from "@/api/business/account";
@@ -209,6 +208,10 @@
         },
 
     ]);
+    onActivated(() => {
+        // 你的逻辑
+        getList();
+    });
     /***********************  方法区  ****************************/
     listTasks()
     /** 查询报表列表 */

+ 141 - 138
src/views/business/contracts/simpleCompany/index.vue

@@ -97,144 +97,147 @@
     </div>
 </template>
 
-<script setup name="Company">
-import { listCompany, delCompany } from "@/api/business/crm/company";
-import companyForm from "./form"
-const { proxy } = getCurrentInstance()
-/** 字典数组区 */
-/** 查询 对象 */
-
-const companyList = ref([]);
-const loading = ref(true);
-const ids = ref([])
-const single = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-/** 查询对象 */
-const queryParams = ref({
-    pageNum: 1,
-    pageSize: 20,
-    category: null,
-    code: null,
-    name: null,
-    shortName: null,
-    oldName: null,
-    owner: null,
-    phone: null,
-    email: null,
-    contactAddress: null,
-    source: null,
-    type: null,
-    socialCreditCode: null,
-    mainBusiness: null,
-    legalRepresentative: null,
-    foundationDate: null,
-    licenceDate: null,
-    businessStartDate: null,
-    businessEndDate: null,
-    isPermanentlyEffective: null,
-    registerMoney: null,
-    registerMoneyUnit: null,
-    provinceCode: null,
-    province: null,
-    cityCode: null,
-    city: null,
-    districtCode: null,
-    district: null,
-    address: null,
-    businessField: null,
-    taxType: null,
-    isZero: null,
-    competentTaxAuthority: null,
-    taxCollectorName: null,
-    taxCollectorPhone: null,
-    taxMonth: null,
-    openingBank: null,
-    bankAccount: null,
-    annualIncome: null,
-    governmentAccountNo: null,
-    governmentPassword: null,
-    socialSecurityAccountNo: null,
-    socialSecurityPassword: null,
-    employeePassword: null,
-    housingFundPassword: null,
-    housingFundUnitAccount: null,
-    housingFundDeductionPassword: null,
-    collectionMethod: null,
-    quotaAmount: null,
-    isPayOnWindow: null,
-    isFirstSocialSecurity: null,
-    isFirstHousingFund: null,
-    leaderId: null,
-    adviserId: null,
-    leaderName: null,
-    adviserName: null,
-})
-
-/***********************  方法区  ****************************/
-
-/** 查询company列表 */
-function getList() {
-    loading.value = true;
-    listCompany(queryParams.value).then(response => {
-        companyList.value = response.rows;
-        total.value = response.total;
-        loading.value = false;
-        console.log(companyList.value)
+<script setup name="SimpleCompany">
+    import { listCompany, delCompany } from "@/api/business/crm/company";
+    import companyForm from "./form"
+    const { proxy } = getCurrentInstance()
+    /** 字典数组区 */
+    /** 查询 对象 */
+
+    const companyList = ref([]);
+    const loading = ref(true);
+    const ids = ref([])
+    const single = ref(true);
+    const multiple = ref(true);
+    const total = ref(0);
+    /** 查询对象 */
+    const queryParams = ref({
+        pageNum: 1,
+        pageSize: 20,
+        category: null,
+        code: null,
+        name: null,
+        shortName: null,
+        oldName: null,
+        owner: null,
+        phone: null,
+        email: null,
+        contactAddress: null,
+        source: null,
+        type: null,
+        socialCreditCode: null,
+        mainBusiness: null,
+        legalRepresentative: null,
+        foundationDate: null,
+        licenceDate: null,
+        businessStartDate: null,
+        businessEndDate: null,
+        isPermanentlyEffective: null,
+        registerMoney: null,
+        registerMoneyUnit: null,
+        provinceCode: null,
+        province: null,
+        cityCode: null,
+        city: null,
+        districtCode: null,
+        district: null,
+        address: null,
+        businessField: null,
+        taxType: null,
+        isZero: null,
+        competentTaxAuthority: null,
+        taxCollectorName: null,
+        taxCollectorPhone: null,
+        taxMonth: null,
+        openingBank: null,
+        bankAccount: null,
+        annualIncome: null,
+        governmentAccountNo: null,
+        governmentPassword: null,
+        socialSecurityAccountNo: null,
+        socialSecurityPassword: null,
+        employeePassword: null,
+        housingFundPassword: null,
+        housingFundUnitAccount: null,
+        housingFundDeductionPassword: null,
+        collectionMethod: null,
+        quotaAmount: null,
+        isPayOnWindow: null,
+        isFirstSocialSecurity: null,
+        isFirstHousingFund: null,
+        leaderId: null,
+        adviserId: null,
+        leaderName: null,
+        adviserName: null,
+    })
+
+    /***********************  方法区  ****************************/
+    onActivated(() => {
+        // 你的逻辑
+        getList();
     });
-}
+    /** 查询company列表 */
+    function getList() {
+        loading.value = true;
+        listCompany(queryParams.value).then(response => {
+            companyList.value = response.rows;
+            total.value = response.total;
+            loading.value = false;
+            console.log(companyList.value)
+        });
+    }
+
+    /** 搜索按钮操作 */
+    function handleQuery() {
+        queryParams.value.pageNum = 1;
+        getList();
+    }
+
+    /** 重置按钮操作 */
+    function resetQuery() {
+        proxy.resetForm("queryRef");
+        queryParams.value.name = "";
+        queryParams.value.socialCreditCode = "";
+        queryParams.value.leaderName = "";
+        handleQuery();
+    }
+
+    // 多选框选中数据
+    function handleSelectionChange(selection) {
+        ids.value = selection.map(item => item.id);
+        single.value = selection.length != 1;
+        multiple.value = !selection.length;
+    }
+
+    /** 新增按钮操作 */
+    function handleAdd() {
+        proxy.$refs.companyRef.open()
+    }
+
+    /** 修改按钮操作 */
+    function handleUpdate(row) {
+        const id = row.id || ids.value
+        proxy.$refs.companyRef.open(id)
+    }
+
+
+    /** 删除按钮操作 */
+    function handleDelete(row) {
+        const _ids = row.id || ids.value;
+        proxy.$modal.confirm('是否确认删除选中的数据项?').then(function () {
+            return delCompany(_ids);
+        }).then(() => {
+            getList();
+            proxy.$modal.msgSuccess("删除成功!");
+        }).catch(() => { });
+    }
+
+    /** 导出按钮操作 */
+    function handleExport() {
+        proxy.download('business/company/export', {
+            ...queryParams.value
+        }, `company_${new Date().getTime()}.xlsx`)
+    }
 
-/** 搜索按钮操作 */
-function handleQuery() {
-    queryParams.value.pageNum = 1;
     getList();
-}
-
-/** 重置按钮操作 */
-function resetQuery() {
-    proxy.resetForm("queryRef");
-    queryParams.value.name = "";
-    queryParams.value.socialCreditCode = "";
-    queryParams.value.leaderName = "";
-    handleQuery();
-}
-
-// 多选框选中数据
-function handleSelectionChange(selection) {
-    ids.value = selection.map(item => item.id);
-    single.value = selection.length != 1;
-    multiple.value = !selection.length;
-}
-
-/** 新增按钮操作 */
-function handleAdd() {
-    proxy.$refs.companyRef.open()
-}
-
-/** 修改按钮操作 */
-function handleUpdate(row) {
-    const id = row.id || ids.value
-    proxy.$refs.companyRef.open(id)
-}
-
-
-/** 删除按钮操作 */
-function handleDelete(row) {
-    const _ids = row.id || ids.value;
-    proxy.$modal.confirm('是否确认删除选中的数据项?').then(function () {
-        return delCompany(_ids);
-    }).then(() => {
-        getList();
-        proxy.$modal.msgSuccess("删除成功!");
-    }).catch(() => { });
-}
-
-/** 导出按钮操作 */
-function handleExport() {
-    proxy.download('business/company/export', {
-        ...queryParams.value
-    }, `company_${new Date().getTime()}.xlsx`)
-}
-
-getList();
-</script>
+</script>

+ 259 - 396
src/views/business/contracts/standardCpmpany/index.vue

@@ -2,212 +2,90 @@
   <div class="page-container list-container">
     <!-- 功能按钮区 -->
     <div class="list-btns-container">
-      <el-button
-        type="primary"
-        size="small"
-        icon="Plus"
-        @click="handleAdd"
-        v-hasPermi="['business:company:add']"
-        >新增</el-button
-      >
-
-      <el-button
-        type="danger"
-        size="small"
-        icon="Delete"
-        :disabled="multiple"
-        @click="handleDelete"
-        v-hasPermi="['business:standardCompany:remove']"
-        >删除</el-button
-      >
-      <el-button
-        type="success"
-        icon="Edit"
-        size="small"
-        :disabled="multiple"
-        @click="setEntrustHandle"
-        v-hasPermi="['business:standardCompany:setLoopEntrust']"
-        >生成循环委托</el-button
-      >
+      <el-button type="primary" size="small" icon="Plus" @click="handleAdd"
+        v-hasPermi="['business:company:add']">新增</el-button>
+
+      <el-button type="danger" size="small" icon="Delete" :disabled="multiple" @click="handleDelete"
+        v-hasPermi="['business:standardCompany:remove']">删除</el-button>
+      <el-button type="success" icon="Edit" size="small" :disabled="multiple" @click="setEntrustHandle"
+        v-hasPermi="['business:standardCompany:setLoopEntrust']">生成循环委托</el-button>
       <el-dropdown trigger="click">
         <el-button type="primary" size="small">
           其它<el-icon class="el-icon--right"><arrow-down /></el-icon>
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
-            <el-dropdown-item
-              @click="handleCommand(true)"
-              icon="Operation"
-              v-if="viewAdviser('business:standardCompany:Adviser')"
-              >设置客服</el-dropdown-item
-            >
-            <el-dropdown-item
-              @click="handleCommand(false)"
-              icon="Operation"
-              v-if="viewAdviser('business:standardCompany:Leader')"
-              >设置负责人</el-dropdown-item
-            >
-            <el-dropdown-item
-              type="warning"
-              size="small"
-              icon="Download"
-              @click="handleExport"
-              v-if="viewAdviser('business:standardCompany:export')"
-              >导出</el-dropdown-item
-            >
+            <el-dropdown-item @click="handleCommand(true)" icon="Operation"
+              v-if="viewAdviser('business:standardCompany:Adviser')">设置客服</el-dropdown-item>
+            <el-dropdown-item @click="handleCommand(false)" icon="Operation"
+              v-if="viewAdviser('business:standardCompany:Leader')">设置负责人</el-dropdown-item>
+            <el-dropdown-item type="warning" size="small" icon="Download" @click="handleExport"
+              v-if="viewAdviser('business:standardCompany:export')">导出</el-dropdown-item>
           </el-dropdown-menu>
         </template>
       </el-dropdown>
     </div>
     <!-- 搜索区 -->
-    <el-form
-      class="list-search-container"
-      size="small"
-      :model="queryParams"
-      ref="queryRef"
-      :inline="true"
-    >
-      <el-form
-        class="list-search-container"
-        size="small"
-        :model="queryParams"
-        ref="queryRef"
-        :inline="true"
-      >
+    <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true">
+      <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true">
         <el-form-item label="客户名称:" prop="name">
-          <el-input
-            v-model="queryParams.name"
-            style="width: 180px"
-            placeholder="请输入客户名称"
-            clearable
-            @keyup.enter="handleQuery"
-          />
+          <el-input v-model="queryParams.name" style="width: 180px" placeholder="请输入客户名称" clearable
+            @keyup.enter="handleQuery" />
         </el-form-item>
         <el-form-item label="税号:" prop="socialCreditCode">
-          <el-input
-            style="width: 180px"
-            v-model="queryParams.socialCreditCode"
-            placeholder="请输入税号"
-            clearable
-            @keyup.enter="handleQuery"
-          />
+          <el-input style="width: 180px" v-model="queryParams.socialCreditCode" placeholder="请输入税号" clearable
+            @keyup.enter="handleQuery" />
         </el-form-item>
         <el-form-item label="客户负责人:" prop="leaderName">
-          <el-input
-            style="width: 180px"
-            v-model="queryParams.leaderName"
-            placeholder="请输入客户负责人"
-            clearable
-            @keyup.enter="handleQuery"
-          />
+          <el-input style="width: 180px" v-model="queryParams.leaderName" placeholder="请输入客户负责人" clearable
+            @keyup.enter="handleQuery" />
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" icon="Search" @click="handleQuery"
-            >搜索</el-button
-          >
+          <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
           <el-button icon="Refresh" @click="resetQuery">重置</el-button>
         </el-form-item>
       </el-form>
     </el-form>
 
     <!-- 列表区 -->
-    <el-table
-      v-loading="loading"
-      :data="companyList"
-      size="small"
-      border
-      height="100%"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="companyList" size="small" border height="100%"
+      @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column
-        label="客户名称"
-        width="230"
-        align="center"
-        prop="name"
-      />
-      <el-table-column
-        label="税号"
-        width="180"
-        align="center"
-        prop="socialCreditCode"
-      />
-      <el-table-column
-        label="注册省-市-区"
-        width="180"
-        align="center"
-        prop="province"
-      >
+      <el-table-column label="客户名称" width="230" align="center" prop="name" />
+      <el-table-column label="税号" width="180" align="center" prop="socialCreditCode" />
+      <el-table-column label="注册省-市-区" width="180" align="center" prop="province">
         <template #default="scope">
           <span>{{
             scope.row.province + "-" + scope.row.city + "-" + scope.row.district
-          }}</span>
+            }}</span>
         </template>
       </el-table-column>
-      <el-table-column
-        label="年收入"
-        align="center"
-        width="100"
-        prop="annualIncome"
-      />
-      <el-table-column
-        label="纳税类型"
-        align="center"
-        width="130"
-        prop="taxType"
-      />
-      <el-table-column
-        label="是否零申报"
-        width="100"
-        align="center"
-        prop="isZero"
-      >
+      <el-table-column label="年收入" align="center" width="100" prop="annualIncome" />
+      <el-table-column label="纳税类型" align="center" width="130" prop="taxType" />
+      <el-table-column label="是否零申报" width="100" align="center" prop="isZero">
         <template #default="scope">
           <span>{{
             scope.row.isZero === 1 ? "是" : scope.row.isZero === 0 ? "否" : ""
-          }}</span>
+            }}</span>
         </template>
       </el-table-column>
       <el-table-column label="客服" align="center" prop="adviserName" />
       <el-table-column label="负责人" align="center" prop="leaderName" />
 
-      <el-table-column
-        label="操作"
-        width="180"
-        align="center"
-        class-name="small-padding fixed-width"
-        :resizable="false"
-        fixed="right"
-      >
+      <el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width" :resizable="false"
+        fixed="right">
         <template #default="scope">
-          <el-button
-            link
-            type="primary"
-            size="small"
-            @click="handleOneEnrust(scope.row)"
-            v-hasPermi="['business:standardCompany:setOneEntrust']"
-            >单次委托</el-button
-          >
-          <el-button
-            link
-            type="primary"
-            size="small"
-            @click="handleInfo(scope.row)"
-            v-hasPermi="['business:standardCompany:query']"
-            >详细信息</el-button
-          >
+          <el-button link type="primary" size="small" @click="handleOneEnrust(scope.row)"
+            v-hasPermi="['business:standardCompany:setOneEntrust']">单次委托</el-button>
+          <el-button link type="primary" size="small" @click="handleInfo(scope.row)"
+            v-hasPermi="['business:standardCompany:query']">详细信息</el-button>
         </template>
       </el-table-column>
     </el-table>
 
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
 
     <!-- 表单 -->
     <company-form ref="companyRef" :get-list="getList"></company-form>
@@ -215,32 +93,15 @@
     <set-one-entrust-dialog ref="setOneEntrustDialogRef" :get-list="getList" />
     <add ref="addRef" :get-list="getList"></add>
 
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
 
     <!-- 设置客服和负责人对话框 -->
-    <el-dialog
-      :title="title"
-      v-model="open"
-      width="500px"
-      append-to-body
-      draggable
-      :close-on-click-modal = "false"
-    >
+    <el-dialog :title="title" v-model="open" width="500px" append-to-body draggable :close-on-click-modal="false">
       <el-form ref="dictRef" :model="form" :rules="rules" label-width="100">
         <el-form-item :label="title" :prop="content">
-          <el-autocomplete
-            :fetch-suggestions="querySearchAsync"
-            :trigger-on-focus="true"
-            v-model="creatorName"
-            :placeholder="content"
-            @select="handleSelect"
-          />
+          <el-autocomplete :fetch-suggestions="querySearchAsync" :trigger-on-focus="true" v-model="creatorName"
+            :placeholder="content" @select="handleSelect" />
         </el-form-item>
       </el-form>
       <template #footer>
@@ -252,229 +113,231 @@
     </el-dialog>
   </div>
 </template>
-  
+
 <script setup name="Company">
-import { listUser } from "@/api/system/user";
-import SetEntrustDialog from "./setEntrustDialog";
-import useUserStore from "@/store/modules/user";
-import SetOneEntrustDialog from "./setOneEntrustDialog";
-import {
-  listStandardCompany,
-  delStandardCompany,
-  updateStandardCompanyName,
-  updateStandardCompanyAdviser,
-  exportCompany,
-} from "@/api/business/standardCompany";
-import companyForm from "./form";
-import add from "./add.vue";
-const { proxy } = getCurrentInstance();
-
-// /** 字典数组区 */
-// /** 查询 对象 */
-
-const companyList = ref([]);
-const loading = ref(true);
-const ids = ref([]);
-const single = ref(true);
-const multiple = ref(true);
-const selections = ref([]);
-const title = ref("");
-const content = ref("");
-const creatorName = ref("");
-const total = ref(0);
-const userList = ref([]);
-const open = ref(false);
-const dateRange = ref([]);
-const permissions = useUserStore().permissions;
-const all_permission = "*:*:*";
-const links = ref([]);
-const adviserOpen = ref(true);
-const userId = ref();
-const setEntrustDialogRef = ref(null);
-const setOneEntrustDialogRef = ref(null);
-
-/** 查询对象 */
-const queryParams = ref({
-  pageNum: 1,
-  pageSize: 20,
-  orderByColumn: "create_time",
-});
-
-/** 用户对象 */
-const queryUser = {
-  pageNum: 1,
-  pageSize: 20,
-  userName: null,
-  phonenumber: null,
-  status: null,
-  deptId: null,
-  userId: null,
-  nickName: null,
-};
-
-/***********************  方法区  ****************************/
-
-/** 查询company列表 */
-function getList() {
-  links.value.length = 0;
-  loading.value = true;
-
-  Promise.all([
-    listStandardCompany(queryParams.value),
-    listUser(proxy.addDateRange(queryUser, dateRange.value)),
-  ]).then((result) => {
-    companyList.value = result[0].rows;
-    total.value = result[0].total;
-    userList.value = result[1].rows;
-    loading.value = false;
-    linkList();
-  }).catch;
-}
-
-function linkList() {
-  userList.value.forEach((item) => {
-    links.value.push({ value: item.nickName });
+  import { listUser } from "@/api/system/user";
+  import SetEntrustDialog from "./setEntrustDialog";
+  import useUserStore from "@/store/modules/user";
+  import SetOneEntrustDialog from "./setOneEntrustDialog";
+  import {
+    listStandardCompany,
+    delStandardCompany,
+    updateStandardCompanyName,
+    updateStandardCompanyAdviser,
+    exportCompany,
+  } from "@/api/business/standardCompany";
+  import companyForm from "./form";
+  import add from "./add.vue";
+  const { proxy } = getCurrentInstance();
+
+  // /** 字典数组区 */
+  // /** 查询 对象 */
+
+  const companyList = ref([]);
+  const loading = ref(true);
+  const ids = ref([]);
+  const single = ref(true);
+  const multiple = ref(true);
+  const selections = ref([]);
+  const title = ref("");
+  const content = ref("");
+  const creatorName = ref("");
+  const total = ref(0);
+  const userList = ref([]);
+  const open = ref(false);
+  const dateRange = ref([]);
+  const permissions = useUserStore().permissions;
+  const all_permission = "*:*:*";
+  const links = ref([]);
+  const adviserOpen = ref(true);
+  const userId = ref();
+  const setEntrustDialogRef = ref(null);
+  const setOneEntrustDialogRef = ref(null);
+
+  /** 查询对象 */
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    orderByColumn: "create_time",
   });
-}
-
-/** 输入框输出建议 */
-const querySearchAsync = (queryString, cb) => {
-  console.log(links);
-  const results = queryString
-    ? links.value.filter(createFilter(queryString))
-    : links.value;
-  cb(results);
-};
-
-function createFilter(queryString) {
-  return (restaurant) => {
-    return (
-      restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
-    );
+
+  /** 用户对象 */
+  const queryUser = {
+    pageNum: 1,
+    pageSize: 20,
+    userName: null,
+    phonenumber: null,
+    status: null,
+    deptId: null,
+    userId: null,
+    nickName: null,
   };
-}
 
-function setEntrustHandle() {
-  setEntrustDialogRef.value.open({
-    selections: selections.value,
+  /***********************  方法区  ****************************/
+  onActivated(() => {
+    // 你的逻辑
+    getList();
   });
-}
-
-function handleOneEnrust(row) {
-  setOneEntrustDialogRef.value.open(row);
-}
-
-/** 对话框确定按钮操作 */
-function submitForm() {
-  const id = ids.value;
-  const index = userList.value.findIndex(
-    (item) => item.nickName == creatorName.value
-  );
-
-  if (index != -1) userId.value = userList.value[index].userId;
-  else {
-    proxy.$modal.msgError("请选择人员");
-    return;
+  /** 查询company列表 */
+  function getList() {
+    links.value.length = 0;
+    loading.value = true;
+
+    Promise.all([
+      listStandardCompany(queryParams.value),
+      listUser(proxy.addDateRange(queryUser, dateRange.value)),
+    ]).then((result) => {
+      companyList.value = result[0].rows;
+      total.value = result[0].total;
+      userList.value = result[1].rows;
+      loading.value = false;
+      linkList();
+    }).catch;
   }
-  if (adviserOpen.value) {
-    updateStandardCompanyAdviser(id, userId.value).then((response) => {
-      proxy.$modal.msgSuccess("设置完成!");
-      creatorName.value = "";
-      open.value = false;
-      getList();
+
+  function linkList() {
+    userList.value.forEach((item) => {
+      links.value.push({ value: item.nickName });
     });
-  } else {
-    updateStandardCompanyName(id, userId.value).then((response) => {
-      proxy.$modal.msgSuccess("设置完成!");
-      creatorName.value = "";
-      open.value = false;
-      getList();
+  }
+
+  /** 输入框输出建议 */
+  const querySearchAsync = (queryString, cb) => {
+    console.log(links);
+    const results = queryString
+      ? links.value.filter(createFilter(queryString))
+      : links.value;
+    cb(results);
+  };
+
+  function createFilter(queryString) {
+    return (restaurant) => {
+      return (
+        restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
+      );
+    };
+  }
+
+  function setEntrustHandle() {
+    setEntrustDialogRef.value.open({
+      selections: selections.value,
     });
   }
-}
 
-function viewAdviser(quer) {
-  return permissions.includes(all_permission) || permissions.includes(quer);
-}
+  function handleOneEnrust(row) {
+    setOneEntrustDialogRef.value.open(row);
+  }
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
-
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm("queryRef");
-  queryParams.value.name = "";
-  queryParams.value.socialCreditCode = "";
-  queryParams.value.leaderName = "";
-  handleQuery();
-}
-
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  selections.value = selection;
-  single.value = selection.length != 1;
-  multiple.value = !selection.length;
-}
-
-/** 打开修改客服、负责人对话框 */
-function handleCommand(com) {
-  adviserOpen.value = com;
-  const updateIds = ids.value;
-  if (updateIds.length == 0) {
-    proxy.$modal.msgError("请至少选择一条数据!");
-    return;
+  /** 对话框确定按钮操作 */
+  function submitForm() {
+    const id = ids.value;
+    const index = userList.value.findIndex(
+      (item) => item.nickName == creatorName.value
+    );
+
+    if (index != -1) userId.value = userList.value[index].userId;
+    else {
+      proxy.$modal.msgError("请选择人员");
+      return;
+    }
+    if (adviserOpen.value) {
+      updateStandardCompanyAdviser(id, userId.value).then((response) => {
+        proxy.$modal.msgSuccess("设置完成!");
+        creatorName.value = "";
+        open.value = false;
+        getList();
+      });
+    } else {
+      updateStandardCompanyName(id, userId.value).then((response) => {
+        proxy.$modal.msgSuccess("设置完成!");
+        creatorName.value = "";
+        open.value = false;
+        getList();
+      });
+    }
+  }
+
+  function viewAdviser(quer) {
+    return permissions.includes(all_permission) || permissions.includes(quer);
   }
 
-  if (com) {
-    open.value = true;
-    title.value = "设置客服";
-    content.value = "输入客服名称";
-  } else {
-    open.value = true;
-    title.value = "设置负责人";
-    content.value = "输入负责人名称";
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
   }
-}
-
-/** 关闭对话框 */
-function cancel() {
-  open.value = false;
-  creatorName.value = "";
-}
-
-/** 新增按钮操作 */
-function handleAdd() {
-  proxy.$refs.addRef.open();
-}
-
-/** 删除按钮操作 */
-function handleDelete(row) {
-  const _ids = row.id || ids.value;
-  proxy.$modal
-    .confirm("是否确认删除选中的数据项?")
-    .then(function () {
-      return delStandardCompany(_ids);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("删除成功!");
-    })
-    .catch(() => {});
-}
-
-/** 导出按钮操作 */
-function handleExport() {
-  exportCompany(queryParams.value);
-}
-
-function handleInfo(row) {
-  proxy.$refs.companyRef.open(row.id);
-}
-
-getList();
-</script>
-  
+
+  /** 重置按钮操作 */
+  function resetQuery() {
+    proxy.resetForm("queryRef");
+    queryParams.value.name = "";
+    queryParams.value.socialCreditCode = "";
+    queryParams.value.leaderName = "";
+    handleQuery();
+  }
+
+  // 多选框选中数据
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    selections.value = selection;
+    single.value = selection.length != 1;
+    multiple.value = !selection.length;
+  }
+
+  /** 打开修改客服、负责人对话框 */
+  function handleCommand(com) {
+    adviserOpen.value = com;
+    const updateIds = ids.value;
+    if (updateIds.length == 0) {
+      proxy.$modal.msgError("请至少选择一条数据!");
+      return;
+    }
+
+    if (com) {
+      open.value = true;
+      title.value = "设置客服";
+      content.value = "输入客服名称";
+    } else {
+      open.value = true;
+      title.value = "设置负责人";
+      content.value = "输入负责人名称";
+    }
+  }
+
+  /** 关闭对话框 */
+  function cancel() {
+    open.value = false;
+    creatorName.value = "";
+  }
+
+  /** 新增按钮操作 */
+  function handleAdd() {
+    proxy.$refs.addRef.open();
+  }
+
+  /** 删除按钮操作 */
+  function handleDelete(row) {
+    const _ids = row.id || ids.value;
+    proxy.$modal
+      .confirm("是否确认删除选中的数据项?")
+      .then(function () {
+        return delStandardCompany(_ids);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功!");
+      })
+      .catch(() => { });
+  }
+
+  /** 导出按钮操作 */
+  function handleExport() {
+    exportCompany(queryParams.value);
+  }
+
+  function handleInfo(row) {
+    proxy.$refs.companyRef.open(row.id);
+  }
+
+  getList();
+</script>

+ 125 - 176
src/views/business/crm/bin/index.vue

@@ -2,25 +2,11 @@
   <div class="page-container list-container">
     <!-- 功能按钮区 -->
     <div class="list-btns-container">
-      <el-button
-        type="primary"
-        size="small"
-        icon="Finished"
-        :disabled="multiple"
-        @click="handleUpdate"
-        v-hasPermi="['business:bin:restore']"
-        >还原</el-button
-      >
-
-      <el-button
-        type="danger"
-        size="small"
-        icon="Delete"
-        :disabled="multiple"
-        @click="handleDelete"
-        v-hasPermi="['business:bin:remove']"
-        >删除</el-button
-      >
+      <el-button type="primary" size="small" icon="Finished" :disabled="multiple" @click="handleUpdate"
+        v-hasPermi="['business:bin:restore']">还原</el-button>
+
+      <el-button type="danger" size="small" icon="Delete" :disabled="multiple" @click="handleDelete"
+        v-hasPermi="['business:bin:remove']">删除</el-button>
 
       <!-- <el-button
         type="info"
@@ -33,187 +19,150 @@
       <!--<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>-->
     </div>
     <!-- 搜索区 -->
-    <el-form
-      class="list-search-container"
-      size="small"
-      :model="queryParams"
-      ref="queryRef"
-      :inline="true"
-      label-width="68px"
-    >
+    <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
+      label-width="68px">
       <el-form-item label="客户名称:" prop="sourceTableName">
-        <el-input
-          v-model="queryParams.sourceValue"
-          placeholder="请输入客户名称"
-          style="width: 150px"
-          clearable
-          @keyup.enter="handleQuery"
-        />
+        <el-input v-model="queryParams.sourceValue" placeholder="请输入客户名称" style="width: 150px" clearable
+          @keyup.enter="handleQuery" />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="Search" @click="handleQuery"
-          >搜索</el-button
-        >
+        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
         <el-button icon="Refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
 
     <!-- 列表区 -->
-    <el-table
-      v-loading="loading"
-      :data="binList"
-      size="small"
-      border
-      height="100%"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="binList" size="small" border height="100%"
+      @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="客户名称" align="center" prop="sourceValue" />
       <el-table-column label="合同编号" align="center" prop="archiveCode" />
       <!-- <el-table-column label="来源表" align="center" prop="sourceTableName" /> -->
-      <el-table-column
-        label="操作"
-        align="center"
-        class-name="small-padding fixed-width"
-      >
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template #default="scope">
-          <el-button
-            link
-            type="primary"
-            size="small"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['business:bin:restore']"
-            >还原</el-button
-          >
-          <el-button
-            link
-            type="danger"
-            size="small"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['business:bin:remove']"
-            >删除</el-button
-          >
+          <el-button link type="primary" size="small" @click="handleUpdate(scope.row)"
+            v-hasPermi="['business:bin:restore']">还原</el-button>
+          <el-button link type="danger" size="small" @click="handleDelete(scope.row)"
+            v-hasPermi="['business:bin:remove']">删除</el-button>
         </template>
       </el-table-column>
     </el-table>
 
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
 
     <!-- 表单 -->
     <bin-form ref="binRef" :get-list="getList"></bin-form>
   </div>
 </template>
 
-<script setup name="Bin">
-import { listBin, delBin, restoreArchiveBin } from "@/api/business/bin";
-import binForm from "./form";
-
-const { proxy } = getCurrentInstance();
-/** 字典数组区 */
-/** 查询 对象 */
-
-const binList = ref([]);
-const loading = ref(true);
-const ids = ref([]);
-const single = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-
-/** 查询对象 */
-const queryParams = ref({
-  pageNum: 1,
-  pageSize: 20,
-  orderByColumn: "create_time",
-  sourceTableName: "biz_archive_input",
-  sourceValue: null,
-  isClean: null,
-  isReturn: null,
-});
-
-/***********************  方法区  ****************************/
-
-/** 查询回收站列表 */
-function getList() {
-  loading.value = true;
-  listBin(queryParams.value).then((response) => {
-    binList.value = response.rows;
-    total.value = response.total;
-    loading.value = false;
+<script setup name="OrderBin">
+  import { listBin, delBin, restoreArchiveBin } from "@/api/business/bin";
+  import binForm from "./form";
+
+  const { proxy } = getCurrentInstance();
+  /** 字典数组区 */
+  /** 查询 对象 */
+
+  const binList = ref([]);
+  const loading = ref(true);
+  const ids = ref([]);
+  const single = ref(true);
+  const multiple = ref(true);
+  const total = ref(0);
+
+  /** 查询对象 */
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    orderByColumn: "create_time",
+    sourceTableName: "biz_archive_input",
+    sourceValue: null,
+    isClean: null,
+    isReturn: null,
+  });
+
+  /***********************  方法区  ****************************/
+  onActivated(() => {
+    // 你的逻辑
+    getList();
   });
-}
+  /** 查询回收站列表 */
+  function getList() {
+    loading.value = true;
+    listBin(queryParams.value).then((response) => {
+      binList.value = response.rows;
+      total.value = response.total;
+      loading.value = false;
+    });
+  }
+
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
+  }
+
+  /** 重置按钮操作 */
+  function resetQuery() {
+    proxy.resetForm("queryRef");
+    handleQuery();
+  }
+
+  // 多选框选中数据
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    single.value = selection.length != 1;
+    multiple.value = !selection.length;
+  }
+
+  /** 新增按钮操作 */
+  function handleAdd() {
+    proxy.$refs.binRef.open();
+  }
+
+  /** 修改按钮操作 */
+  function handleUpdate(row) {
+    const _ids = row.id || ids.value;
+    proxy.$modal
+      .confirm("是否确认还原选中的数据项?")
+      .then(function () {
+        loading.value = true;
+        return restoreArchiveBin(_ids);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("还原成功!");
+      })
+      .catch(() => { });
+  }
+
+  /** 删除按钮操作 */
+  function handleDelete(row) {
+    const _ids = row.id || ids.value;
+    proxy.$modal
+      .confirm("删除数据项后不可恢复,是否确认删除选中的数据项?")
+      .then(function () {
+        return delBin(_ids);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功!");
+      })
+      .catch(() => { });
+  }
+
+  /** 导出按钮操作 */
+  function handleExport() {
+    proxy.download(
+      "business/bin/export",
+      {
+        ...queryParams.value,
+      },
+      `bin_${new Date().getTime()}.xlsx`
+    );
+  }
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
   getList();
-}
-
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm("queryRef");
-  handleQuery();
-}
-
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  single.value = selection.length != 1;
-  multiple.value = !selection.length;
-}
-
-/** 新增按钮操作 */
-function handleAdd() {
-  proxy.$refs.binRef.open();
-}
-
-/** 修改按钮操作 */
-function handleUpdate(row) {
-  const _ids = row.id || ids.value;
-  proxy.$modal
-    .confirm("是否确认还原选中的数据项?")
-    .then(function () {
-      loading.value = true;
-      return restoreArchiveBin(_ids);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("还原成功!");
-    })
-    .catch(() => {});
-}
-
-/** 删除按钮操作 */
-function handleDelete(row) {
-  const _ids = row.id || ids.value;
-  proxy.$modal
-    .confirm("删除数据项后不可恢复,是否确认删除选中的数据项?")
-    .then(function () {
-      return delBin(_ids);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("删除成功!");
-    })
-    .catch(() => {});
-}
-
-/** 导出按钮操作 */
-function handleExport() {
-  proxy.download(
-    "business/bin/export",
-    {
-      ...queryParams.value,
-    },
-    `bin_${new Date().getTime()}.xlsx`
-  );
-}
-
-getList();
-</script>
+</script>

+ 6 - 3
src/views/business/crm/company/index.vue

@@ -46,8 +46,8 @@
       </el-form-item>
     </el-form>
     <div v-if="flag && flag2 && tenant.versionId !== '4'">
-      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" >
-      <el-tab-pane label=" 全部" name="first">
+      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
+        <el-tab-pane label=" 全部" name="first">
         </el-tab-pane>
         <el-tab-pane label="我的" name="second">
         </el-tab-pane>
@@ -195,7 +195,10 @@
   });
 
   /***********************  列表页方法 ****************************/
-
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
   /** 查询项目信息列表 */
   function getList() {
     loading.value = true;

+ 169 - 164
src/views/business/crm/dict/index.vue

@@ -10,7 +10,7 @@
         v-hasPermi="['business:crm:dict:remove']">删除</el-button>
     </div>
 
-    <el-form class="list-search-container"  :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"
+    <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"
       label-width="68px">
       <el-form-item label="字典名称:" prop="dictName" style="width: 220px">
         <el-input size="small" v-model="queryParams.dictName" placeholder="请输入字典名称" clearable
@@ -69,11 +69,11 @@
       </el-table-column>
     </el-table>
 
-    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
-      @pagination="getList" />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
 
     <!-- 添加或修改参数配置对话框 -->
-    <el-dialog :title="title" v-model="open" width="500px" append-to-body draggable :close-on-click-modal = "false">
+    <el-dialog :title="title" v-model="open" width="500px" append-to-body draggable :close-on-click-modal="false">
       <el-form ref="dictRef" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="字典名称" prop="dictName">
           <el-input v-model="form.dictName" placeholder="请输入字典名称" />
@@ -83,11 +83,13 @@
         </el-form-item>
         <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
-            <el-radio v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio>
+            <el-radio v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label
+              }}</el-radio>
           </el-radio-group>
         </el-form-item>
         <el-form-item label="备注" prop="remark">
-          <el-input v-model="form.remark" type="textarea" maxlength="200" show-word-limit placeholder="请输入内容"></el-input>
+          <el-input v-model="form.remark" type="textarea" maxlength="200" show-word-limit
+            placeholder="请输入内容"></el-input>
         </el-form-item>
       </el-form>
       <template #footer>
@@ -100,168 +102,171 @@
   </div>
 </template>
 
-<script setup name="Dict">
-import useDictStore from "@/store/modules/dict";
-import {
-  listType,
-  getType,
-  delType,
-  addType,
-  updateType,
-  refreshCache,
-} from "@/api/system/dict/type";
-import { customRef } from "vue";
+<script setup name="CustomerDict">
+  import useDictStore from "@/store/modules/dict";
+  import {
+    listType,
+    getType,
+    delType,
+    addType,
+    updateType,
+    refreshCache,
+  } from "@/api/system/dict/type";
+  import { customRef } from "vue";
 
-const { proxy } = getCurrentInstance();
-const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
+  const { proxy } = getCurrentInstance();
+  const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
 
-const typeList = ref([]);
-const open = ref(false);
-const loading = ref(true);
-const showSearch = ref(true);
-const ids = ref([]);
-const single = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-const title = ref("");
-const dateRange = ref([]);
-const webHost = import.meta.env.VITE_APP_BASE_API;
+  const typeList = ref([]);
+  const open = ref(false);
+  const loading = ref(true);
+  const showSearch = ref(true);
+  const ids = ref([]);
+  const single = ref(true);
+  const multiple = ref(true);
+  const total = ref(0);
+  const title = ref("");
+  const dateRange = ref([]);
+  const webHost = import.meta.env.VITE_APP_BASE_API;
 
-const data = reactive({
-  form: {},
-  queryParams: {
-    pageNum: 1,
-    pageSize: 20,
-    dictName: undefined,
-    dictType: undefined,
-    module: "customer",
-    status: undefined,
-  },
-  rules: {
-    dictName: [
-      { required: true, message: "字典名称不能为空", trigger: "blur" },
-    ],
-    dictType: [
-      { required: true, message: "字典类型不能为空", trigger: "blur" },
-    ],
-  },
-});
-
-const { queryParams, form, rules } = toRefs(data);
+  const data = reactive({
+    form: {},
+    queryParams: {
+      pageNum: 1,
+      pageSize: 20,
+      dictName: undefined,
+      dictType: undefined,
+      module: "customer",
+      status: undefined,
+    },
+    rules: {
+      dictName: [
+        { required: true, message: "字典名称不能为空", trigger: "blur" },
+      ],
+      dictType: [
+        { required: true, message: "字典类型不能为空", trigger: "blur" },
+      ],
+    },
+  });
 
-/** 查询字典类型列表 */
-function getList() {
-  loading.value = true;
-  listType(proxy.addDateRange(queryParams.value, dateRange.value)).then(
-    (response) => {
-      typeList.value = response.rows;
-      total.value = response.total;
-      loading.value = false;
-    }
-  );
-}
-/** 取消按钮 */
-function cancel() {
-  open.value = false;
-  reset();
-}
-/** 表单重置 */
-function reset() {
-  form.value = {
-    dictId: undefined,
-    dictName: undefined,
-    dictType: undefined,
-    status: "0",
-    remark: undefined,
-    module: 'customer'
-  };
-  proxy.resetForm("dictRef");
-}
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
-/** 重置按钮操作 */
-function resetQuery() {
-  dateRange.value = [];
-  proxy.resetForm("queryRef");
-  handleQuery();
-}
-/** 新增按钮操作 */
-function handleAdd() {
-  reset();
-  open.value = true;
-  title.value = "添加字典类型";
-}
-/** 多选框选中数据 */
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.dictId);
-  single.value = selection.length != 1;
-  multiple.value = !selection.length;
-}
-/** 修改按钮操作 */
-function handleUpdate(row) {
-  reset();
-  const dictId = row.dictId || ids.value;
-  getType(dictId).then((response) => {
-    form.value = response.data;
-    open.value = true;
-    title.value = "修改字典类型";
+  const { queryParams, form, rules } = toRefs(data);
+  onActivated(() => {
+    // 你的逻辑
+    getList();
   });
-}
-/** 提交按钮 */
-function submitForm() {
-  proxy.$refs["dictRef"].validate((valid) => {
-    if (valid) {
-      if (form.value.dictId != undefined) {
-        updateType(form.value).then((response) => {
-          proxy.$modal.msgSuccess("修改成功");
-          open.value = false;
-          getList();
-        });
-      } else {
-        addType(form.value).then((response) => {
-          proxy.$modal.msgSuccess("新增成功");
-          open.value = false;
-          getList();
-        });
+  /** 查询字典类型列表 */
+  function getList() {
+    loading.value = true;
+    listType(proxy.addDateRange(queryParams.value, dateRange.value)).then(
+      (response) => {
+        typeList.value = response.rows;
+        total.value = response.total;
+        loading.value = false;
       }
-    }
-  });
-}
-/** 删除按钮操作 */
-function handleDelete(row) {
-  const dictIds = row.dictId || ids.value;
-  proxy.$modal
-    .confirm("是否确认删除?")
-    .then(function () {
-      return delType(dictIds);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("删除成功");
-    })
-    .catch(() => { });
-}
-/** 导出按钮操作 */
-function handleExport() {
-  queryParams.value.ids = ids.value;
-  proxy.download(
-    "system/dict/type/export",
-    {
-      ...queryParams.value,
-    },
-    `dict_${new Date().getTime()}.xlsx`
-  );
-}
-/** 刷新缓存按钮操作 */
-function handleRefreshCache() {
-  refreshCache().then(() => {
-    proxy.$modal.msgSuccess("刷新成功");
-    useDictStore().cleanDict();
-  });
-}
+    );
+  }
+  /** 取消按钮 */
+  function cancel() {
+    open.value = false;
+    reset();
+  }
+  /** 表单重置 */
+  function reset() {
+    form.value = {
+      dictId: undefined,
+      dictName: undefined,
+      dictType: undefined,
+      status: "0",
+      remark: undefined,
+      module: 'customer'
+    };
+    proxy.resetForm("dictRef");
+  }
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
+  }
+  /** 重置按钮操作 */
+  function resetQuery() {
+    dateRange.value = [];
+    proxy.resetForm("queryRef");
+    handleQuery();
+  }
+  /** 新增按钮操作 */
+  function handleAdd() {
+    reset();
+    open.value = true;
+    title.value = "添加字典类型";
+  }
+  /** 多选框选中数据 */
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.dictId);
+    single.value = selection.length != 1;
+    multiple.value = !selection.length;
+  }
+  /** 修改按钮操作 */
+  function handleUpdate(row) {
+    reset();
+    const dictId = row.dictId || ids.value;
+    getType(dictId).then((response) => {
+      form.value = response.data;
+      open.value = true;
+      title.value = "修改字典类型";
+    });
+  }
+  /** 提交按钮 */
+  function submitForm() {
+    proxy.$refs["dictRef"].validate((valid) => {
+      if (valid) {
+        if (form.value.dictId != undefined) {
+          updateType(form.value).then((response) => {
+            proxy.$modal.msgSuccess("修改成功");
+            open.value = false;
+            getList();
+          });
+        } else {
+          addType(form.value).then((response) => {
+            proxy.$modal.msgSuccess("新增成功");
+            open.value = false;
+            getList();
+          });
+        }
+      }
+    });
+  }
+  /** 删除按钮操作 */
+  function handleDelete(row) {
+    const dictIds = row.dictId || ids.value;
+    proxy.$modal
+      .confirm("是否确认删除?")
+      .then(function () {
+        return delType(dictIds);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功");
+      })
+      .catch(() => { });
+  }
+  /** 导出按钮操作 */
+  function handleExport() {
+    queryParams.value.ids = ids.value;
+    proxy.download(
+      "system/dict/type/export",
+      {
+        ...queryParams.value,
+      },
+      `dict_${new Date().getTime()}.xlsx`
+    );
+  }
+  /** 刷新缓存按钮操作 */
+  function handleRefreshCache() {
+    refreshCache().then(() => {
+      proxy.$modal.msgSuccess("刷新成功");
+      useDictStore().cleanDict();
+    });
+  }
 
-getList();
-</script>
+  getList();
+</script>

+ 198 - 276
src/views/business/crm/noContractWorkOrder/index.vue

@@ -2,14 +2,8 @@
   <div class="page-container list-container">
     <!-- 功能按钮区 -->
     <div class="list-btns-container">
-      <el-button
-        type="primary"
-        size="small"
-        icon="Plus"
-        @click="handleAdd"
-        v-hasPermi="['business:workOrder:add']"
-        >新增</el-button
-      >
+      <el-button type="primary" size="small" icon="Plus" @click="handleAdd"
+        v-hasPermi="['business:workOrder:add']">新增</el-button>
 
       <el-button type="danger" size="small" icon="Delete" :disabled="multiple" @click="handleDelete"
         v-hasPermi="['business:workOrder:remove']">删除</el-button>
@@ -19,71 +13,32 @@
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
-            <el-dropdown-item
-              icon="Download"
-              @click="handleExport"
-              v-hasPermi="['business:workOrder:export']"
-            >
-              导出</el-dropdown-item
-            >
+            <el-dropdown-item icon="Download" @click="handleExport" v-hasPermi="['business:workOrder:export']">
+              导出</el-dropdown-item>
           </el-dropdown-menu>
         </template>
       </el-dropdown>
     </div>
     <!-- 搜索区 -->
-    <el-form
-      class="list-search-container"
-      size="small"
-      :model="queryParams"
-      ref="queryRef"
-      :inline="true"
-      label-width="68px"
-    >
+    <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
+      label-width="68px">
       <el-form-item label="客户名称:" prop="companyName">
-        <el-input
-          v-model="queryParams.companyName"
-          placeholder="请输入客户名称"
-          style="width: 150px"
-          clearable
-          @keyup.enter="handleQuery"
-        />
+        <el-input v-model="queryParams.companyName" placeholder="请输入客户名称" style="width: 150px" clearable
+          @keyup.enter="handleQuery" />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="Search" @click="handleQuery"
-          >搜索</el-button
-        >
+        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
         <el-button icon="Refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
 
     <!-- 列表区 -->
-    <el-table
-      v-loading="loading"
-      :data="orderList"
-      size="small"
-      border
-      height="100%"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="orderList" size="small" border height="100%"
+      @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column
-        label="客户名称"
-        align="center"
-        min-width="250"
-        prop="companyName"
-      />
-      <el-table-column
-        label="税号"
-        align="center"
-        min-width="180"
-        prop="socialCreditCode"
-      />
-      <el-table-column
-        label="服务内容"
-        align="center"
-        min-width="650"
-        prop="remark"
-      >
+      <el-table-column label="客户名称" align="center" min-width="250" prop="companyName" />
+      <el-table-column label="税号" align="center" min-width="180" prop="socialCreditCode" />
+      <el-table-column label="服务内容" align="center" min-width="650" prop="remark">
         <template #default="scope">
           <div>{{ scope.row.remark }}</div>
         </template>
@@ -92,39 +47,24 @@
         <template #default="scope">{{ getTransactor(scope.row) }}</template>
       </el-table-column>
     </el-table>
-    <el-dialog
-      title="新增工单"
-      v-model="formOpen"
-      width="500px"
-      append-to-body
-      draggable
-    >
+    <el-dialog title="新增工单" v-model="formOpen" width="500px" append-to-body draggable>
       <el-form ref="dictRef" :model="form" label-width="100" size="small">
         <el-row :gutter="30">
           <el-col :span="24">
             <el-form-item label="客户名称:" prop="companyName">
-              <el-autocomplete
-                style="width: 100%"
-                fit-input-width="300px"
-                size="small"
-                :fetch-suggestions="querySearchCompanyAsync"
-                :trigger-on-focus="true"
-                v-model="form.companyName"
-                placeholder="请输入客户名称"
-                @select="handleSelectCompany"
-              >
+              <el-autocomplete style="width: 100%" fit-input-width="300px" size="small"
+                :fetch-suggestions="querySearchCompanyAsync" :trigger-on-focus="true" v-model="form.companyName"
+                placeholder="请输入客户名称" @select="handleSelectCompany">
                 <template #append>
                   <el-button icon="Plus" @click="showAddCompanyDialog">
                   </el-button>
                 </template>
                 <template #default="{ item }">
-                  <div
-                    style="
+                  <div style="
                       display: flex;
                       flex-direction: row;
                       justify-content: space-between;
-                    "
-                  >
+                    ">
                     <div class="name" style="font-size: 12px">
                       {{ item.name }}
                     </div>
@@ -134,16 +74,8 @@
               </el-autocomplete>
             </el-form-item>
             <el-form-item label="服务内容:">
-              <el-input
-                v-model.trim="form.remark"
-                type="textarea"
-                size="small"
-                :rows="4"
-                maxlength="200"
-                show-word-limit
-                placeholder="服务内容"
-                :clearable="true"
-              />
+              <el-input v-model.trim="form.remark" type="textarea" size="small" :rows="4" maxlength="200"
+                show-word-limit placeholder="服务内容" :clearable="true" />
             </el-form-item>
           </el-col>
 
@@ -152,228 +84,218 @@
       </el-form>
       <template #footer>
         <div class="dialog-footer">
-          <el-button
-            type="primary"
-            icon="Finished"
-            size="small"
-            @click="saveHandler"
-            >确 定</el-button
-          >
-          <el-button @click="formCancel" icon="close" size="small"
-            >取 消</el-button
-          >
+          <el-button type="primary" icon="Finished" size="small" @click="saveHandler">确 定</el-button>
+          <el-button @click="formCancel" icon="close" size="small">取 消</el-button>
         </div>
       </template>
     </el-dialog>
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
     <AddCompanyDialog ref="addCompanyDialogRef" />
   </div>
 </template>
 
-<script setup name="Company">
-// import contractForm from "./form";
-import {
-  listWorkOrder,
-  delWorkOrder,
-  exportWorkOrder,
-  addWorkOrder,
-  exportNoContract,
-} from "@/api/business/crm/workOrder";
-import { listCompany } from "@/api/business/crm/company";
-import AddCompanyDialog from "../AddCompanyDialog.vue";
-import { ref } from "vue";
-// import workorderForm from "./form"
-const { proxy } = getCurrentInstance();
-/** 字典数组区 */
-/** 查询 对象 */
+<script setup name="WorkOrder">
+  // import contractForm from "./form";
+  import {
+    listWorkOrder,
+    delWorkOrder,
+    exportWorkOrder,
+    addWorkOrder,
+    exportNoContract,
+  } from "@/api/business/crm/workOrder";
+  import { listCompany } from "@/api/business/crm/company";
+  import AddCompanyDialog from "../AddCompanyDialog.vue";
+  import { ref } from "vue";
+  // import workorderForm from "./form"
+  const { proxy } = getCurrentInstance();
+  /** 字典数组区 */
+  /** 查询 对象 */
 
-const orderList = ref([]);
-const loading = ref(true);
-const ids = ref([]);
-const single = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-const prev = ref([]);
-const addCompanyDialogRef = ref(null);
+  const orderList = ref([]);
+  const loading = ref(true);
+  const ids = ref([]);
+  const single = ref(true);
+  const multiple = ref(true);
+  const total = ref(0);
+  const prev = ref([]);
+  const addCompanyDialogRef = ref(null);
 
-const formOpen = ref(false);
+  const formOpen = ref(false);
 
-const form = ref({
-  id: null,
-  companyName: "",
-  companyId: null,
-  remark: "",
-  type: 2,
-  noContract: 1,
-});
-
-const emptyForm = {
-  id: null,
-  companyName: "",
-  companyId: null,
-  type: 2,
-  remark: "",
-  noContract: 1,
-};
+  const form = ref({
+    id: null,
+    companyName: "",
+    companyId: null,
+    remark: "",
+    type: 2,
+    noContract: 1,
+  });
 
-const { contract_verify_status } = proxy.useDict("contract_verify_status");
-const { contract_status } = proxy.useDict("contract_status");
-/** 查询对象 */
-const queryParams = ref({
-  pageNum: 1,
-  pageSize: 20,
-  orderByColumn: "create_time",
-  companyName: "",
-  noContract: 1,
-});
+  const emptyForm = {
+    id: null,
+    companyName: "",
+    companyId: null,
+    type: 2,
+    remark: "",
+    noContract: 1,
+  };
 
-const editStatus = {
-  startMonth: false,
-};
+  const { contract_verify_status } = proxy.useDict("contract_verify_status");
+  const { contract_status } = proxy.useDict("contract_status");
+  /** 查询对象 */
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    orderByColumn: "create_time",
+    companyName: "",
+    noContract: 1,
+  });
 
-/***********************  方法区  ****************************/
+  const editStatus = {
+    startMonth: false,
+  };
 
-/** 查询company列表 */
-function getList() {
-  loading.value = true;
-  listWorkOrder(queryParams.value).then((response) => {
-    orderList.value = response.rows.map((l) => ({
-      ...l,
-      editStatus: proxy.deepClone(editStatus),
-    }));
-    prev.value = proxy.deepClone(response.rows);
-    total.value = response.total;
-    loading.value = false;
+  /***********************  方法区  ****************************/
+  onActivated(() => {
+    // 你的逻辑
+    getList();
   });
-}
+  /** 查询company列表 */
+  function getList() {
+    loading.value = true;
+    listWorkOrder(queryParams.value).then((response) => {
+      orderList.value = response.rows.map((l) => ({
+        ...l,
+        editStatus: proxy.deepClone(editStatus),
+      }));
+      prev.value = proxy.deepClone(response.rows);
+      total.value = response.total;
+      loading.value = false;
+    });
+  }
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
+  }
 
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm("queryRef");
-  handleQuery();
-}
+  /** 重置按钮操作 */
+  function resetQuery() {
+    proxy.resetForm("queryRef");
+    handleQuery();
+  }
 
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  single.value = selection.length != 1;
-  multiple.value = !selection.length;
-}
+  // 多选框选中数据
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    single.value = selection.length != 1;
+    multiple.value = !selection.length;
+  }
 
-/** 新增按钮操作 */
-function handleAdd() {
-  // proxy.$refs.workOrderRef.open();
-  formOpen.value = true;
-}
+  /** 新增按钮操作 */
+  function handleAdd() {
+    // proxy.$refs.workOrderRef.open();
+    formOpen.value = true;
+  }
 
-function formCancel() {
-  formOpen.value = false;
-  reset();
-}
+  function formCancel() {
+    formOpen.value = false;
+    reset();
+  }
 
-function reset() {
-  form.value = proxy.deepClone(emptyForm);
-}
+  function reset() {
+    form.value = proxy.deepClone(emptyForm);
+  }
 
-/** 修改按钮操作 */
-function handleUpdate(row) {
-  // const id = row.id || ids.value;
-  // proxy.$refs.workOrderRef.open(id);
-}
+  /** 修改按钮操作 */
+  function handleUpdate(row) {
+    // const id = row.id || ids.value;
+    // proxy.$refs.workOrderRef.open(id);
+  }
 
-/** 删除按钮操作 */
-function handleDelete(row) {
-  const _ids = row.id || ids.value;
-  proxy.$modal
-    .confirm("是否确认删除选中的数据项?")
-    .then(function () {
-      return delWorkOrder(_ids);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("删除成功!");
-    })
-    .catch(() => {});
-}
+  /** 删除按钮操作 */
+  function handleDelete(row) {
+    const _ids = row.id || ids.value;
+    proxy.$modal
+      .confirm("是否确认删除选中的数据项?")
+      .then(function () {
+        return delWorkOrder(_ids);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功!");
+      })
+      .catch(() => { });
+  }
 
-/** 导出按钮操作 */
-function handleExport() {
-  exportNoContract(queryParams.value);
-}
+  /** 导出按钮操作 */
+  function handleExport() {
+    exportNoContract(queryParams.value);
+  }
 
-function startDateChangeHandler(row, startDate) {
-  if (startDate) {
-    // console.log(startDate)
-    row.endMonth = proxy
-      .moment(startDate)
-      .add(row.monthNum - 1, "M")
-      .format("YYYY-MM-DD");
-  } else row.endMonth = null;
-  console.log(row);
-}
+  function startDateChangeHandler(row, startDate) {
+    if (startDate) {
+      // console.log(startDate)
+      row.endMonth = proxy
+        .moment(startDate)
+        .add(row.monthNum - 1, "M")
+        .format("YYYY-MM-DD");
+    } else row.endMonth = null;
+    console.log(row);
+  }
 
-function querySearchCompanyAsync(queryString, cb) {
-  const query =
-    queryString.length > 0
-      ? {
+  function querySearchCompanyAsync(queryString, cb) {
+    const query =
+      queryString.length > 0
+        ? {
           keyword: queryString,
           pageSize: 20,
           pageNum: 1,
           orderByColumn: "create_time",
         }
-      : { pageSize: 20, pageNum: 1, orderByColumn: "create_time" };
-  listCompany(query).then((res) => {
-    cb(res.rows);
-  });
-}
-
-function handleSelectCompany(item) {
-  form.value.companyName = item.name;
-  form.value.companyId = item.id;
-}
-
-function saveHandler() {
-  if (form.value.companyId == null) {
-    proxy.$modal.msgError("请选择公司");
-    return;
+        : { pageSize: 20, pageNum: 1, orderByColumn: "create_time" };
+    listCompany(query).then((res) => {
+      cb(res.rows);
+    });
   }
-  if (form.value.remark == null || form.value.remark === "") {
-    proxy.$modal.msgError("请输入备注");
-    return;
+
+  function handleSelectCompany(item) {
+    form.value.companyName = item.name;
+    form.value.companyId = item.id;
   }
-  if (form.value.id == null) {
-    addWorkOrder(form.value).then((res) => {
-      formCancel();
-      getList();
-    });
+
+  function saveHandler() {
+    if (form.value.companyId == null) {
+      proxy.$modal.msgError("请选择公司");
+      return;
+    }
+    if (form.value.remark == null || form.value.remark === "") {
+      proxy.$modal.msgError("请输入备注");
+      return;
+    }
+    if (form.value.id == null) {
+      addWorkOrder(form.value).then((res) => {
+        formCancel();
+        getList();
+      });
+    }
   }
-}
 
-function getTransactor(row) {
-  if (row.entrusts != null && row.entrusts.length > 0) {
-    const names = Array.from(new Set(row.entrusts.map((v) => v.toAccountName)));
-    return names.join(",");
-  } else {
-    return row.serviceName;
+  function getTransactor(row) {
+    if (row.entrusts != null && row.entrusts.length > 0) {
+      const names = Array.from(new Set(row.entrusts.map((v) => v.toAccountName)));
+      return names.join(",");
+    } else {
+      return row.serviceName;
+    }
   }
-}
 
-function showAddCompanyDialog() {
-  addCompanyDialogRef.value.open();
-}
+  function showAddCompanyDialog() {
+    addCompanyDialogRef.value.open();
+  }
 
-getList();
-</script>
+  getList();
+</script>

+ 24 - 22
src/views/business/crm/order/index.vue

@@ -36,32 +36,31 @@
       <!--<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>-->
     </div>
     <!-- 搜索区 -->
-    <el-form class="list-search-container"  :model="queryParams" ref="queryRef" :inline="true"
-      label-width="68px">
+    <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true" label-width="68px">
       <el-form-item label="客户名称:" prop="companyName">
         <el-input v-model="queryParams.companyName" size="small" placeholder="请输入客户名称" clearable style="width: 120px"
           @keyup.enter="handleQuery" />
       </el-form-item>
       <el-form-item label="合同编号:" prop="contractNo">
-        <el-input v-model="queryParams.contractNo" size="small" placeholder="请输入合同编号" clearable style="width: 120px"
+        <el-input v-model="queryParams.contractNo" size="small" placeholder="请输入合同编号" clearable style="width: 120px"
           @keyup.enter="handleQuery" />
       </el-form-item>
-      <el-form-item label="客户标签:" >
-        <el-select v-model="queryParams.customerLabelId" size="small" style="width: 120px" multiple   >
+      <el-form-item label="客户标签:">
+        <el-select v-model="queryParams.customerLabelId" size="small" style="width: 120px" multiple>
           <el-option v-for="item in options" :key="item.id" :label="item.lable" :value="item.id" />
         </el-select>
       </el-form-item>
-      <el-form-item label="甲方:" >
-          <el-input v-model="queryParams.boss" size="small" placeholder="请输入甲方名称" clearable style="width: 120px"
+      <el-form-item label="甲方:">
+        <el-input v-model="queryParams.boss" size="small" placeholder="请输入甲方名称" clearable style="width: 120px"
           @keyup.enter="handleQuery" />
       </el-form-item>
       <el-form-item label="合同类型:" prop="contractType">
-        <el-select size="small" v-model="queryParams.contractType" placeholder="服务类型" clearable style="width: 120px">
+        <el-select size="small" v-model="queryParams.contractType" placeholder="合同类型" clearable style="width: 120px">
           <el-option v-for="item in contractTypes" :key="item.value" :label="item.label" :value="item.value" />
         </el-select>
       </el-form-item>
       <el-form-item label="服务类型:" prop="serviceType">
-        <el-select size="small" v-model="queryParams.serviceType" placeholder="合同类型" clearable style="width: 120px">
+        <el-select size="small" v-model="queryParams.serviceType" placeholder="服务类型" clearable style="width: 120px">
           <el-option v-for="item in serviceTypes" :key="item.value" :label="item.label" :value="item.value" />
         </el-select>
       </el-form-item>
@@ -92,7 +91,7 @@
       <el-table-column label="签单人" align="center" prop="signerName" min-width="120" />
       <el-table-column label="合同来源" align="center" prop="sourceCategoryName" min-width="120" />
       <el-table-column label="客户标签" align="center" prop="customerLabelName" min-width="120" />
-   
+
       <el-table-column label="甲方" align="center" prop="boss" min-width="120" />
       <el-table-column label="审核状态" align="center" prop="verifyStatus" width="110">
         <template #default="scope">
@@ -169,9 +168,9 @@
               </el-select>
             </el-form-item>
             <el-form-item label="签约日期:" prop="formDate">
-                <el-date-picker v-model="queryParams.formDate" type="daterange" clearable
-                format="YYYY - MM - DD " value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期"
-                end-placeholder="业务日期" style="width: 100%;"></el-date-picker>
+              <el-date-picker v-model="queryParams.formDate" type="daterange" clearable format="YYYY - MM - DD "
+                value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期" end-placeholder="业务日期"
+                style="width: 100%;"></el-date-picker>
             </el-form-item>
             <el-form-item label="社保代缴:" prop="isSocialSecurity">
               <el-select size="small" v-model="queryParams.isSocialSecurity" placeholder="是否代缴社保" clearable
@@ -313,10 +312,13 @@
     isPayOnWindow: null,
     isFirstSocialSecurity: null,
     isFirstHousingFund: null,
-    customerLabelId:[],
-    boss:null
+    customerLabelId: [],
+    boss: null
+  });
+  onActivated(() => {
+    // 你的逻辑
+    getList();
   });
-
   /***********************  方法区  ****************************/
 
   /** 查询company列表 */
@@ -342,11 +344,11 @@
       permissions.includes("business:archive:order:dissolution")
     );
   }
-  function getOption(){
-  listLableNoPage().then(res =>{
-     options.value = res.data
-  })
-}
+  function getOption() {
+    listLableNoPage().then(res => {
+      options.value = res.data
+    })
+  }
   function viewDelete() {
     return (
       permissions.includes(all_permission) ||
@@ -377,7 +379,7 @@
   function resetQuery() {
     proxy.resetForm("queryRef");
     queryParams.value.customerLabelId = [];
-    queryParams.value.formDate= [];
+    queryParams.value.formDate = [];
     queryParams.value.boss = null
     handleQuery();
   }

+ 237 - 386
src/views/business/crm/workorder/index.vue

@@ -8,507 +8,358 @@
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
-            <el-dropdown-item
-              icon="Download"
-              @click="handleExport"
-              v-if="viewAdviser('business:workOrder:export')"
-            >
-              导出</el-dropdown-item
-            >
-            <el-dropdown-item
-              icon="Edit"
-              @click="handleSetContinue"
-              v-if="viewAdviser('business:workOrder:continue')"
-            >
-              延续设置</el-dropdown-item
-            >
+            <el-dropdown-item icon="Download" @click="handleExport" v-if="viewAdviser('business:workOrder:export')">
+              导出</el-dropdown-item>
+            <el-dropdown-item icon="Edit" @click="handleSetContinue" v-if="viewAdviser('business:workOrder:continue')">
+              延续设置</el-dropdown-item>
           </el-dropdown-menu>
         </template>
       </el-dropdown>
     </div>
     <!-- 搜索区 -->
-    <el-form
-      class="list-search-container"
-      size="small"
-      :model="queryParams"
-      ref="queryRef"
-      :inline="true"
-      label-width="68px"
-    >
+    <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
+      label-width="68px">
       <el-form-item label="客户名称:" prop="companyName">
-        <el-input
-          v-model="queryParams.companyName"
-          style="width: 150px"
-          placeholder="请输入客户名称"
-          clearable
-          @keyup.enter="handleQuery"
-        />
+        <el-input v-model="queryParams.companyName" style="width: 150px" placeholder="请输入客户名称" clearable
+          @keyup.enter="handleQuery" />
       </el-form-item>
       <el-form-item label="工单类型:" prop="type">
-        <el-select
-          size="small"
-          v-model="queryParams.type"
-          placeholder="工单类型"
-          clearable
-        >
-          <el-option
-            v-for="item in types"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          />
+        <el-select size="small" v-model="queryParams.type" placeholder="工单类型" clearable>
+          <el-option v-for="item in types" :key="item.value" :label="item.label" :value="item.value" />
         </el-select>
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="Search" @click="handleQuery"
-          >搜索</el-button
-        >
+        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
         <el-button icon="Refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
 
     <!-- 列表区 -->
-    <el-table
-      v-loading="loading"
-      :data="orderList"
-      size="small"
-      border
-      height="100%"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="orderList" size="small" border height="100%"
+      @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column
-        label="客户名称"
-        align="center"
-        min-width="250"
-        prop="companyName"
-        :resizable="false"
-      />
-      <el-table-column
-        label="税号"
-        align="center"
-        min-width="200"
-        prop="socialCreditCode"
-        :resizable="false"
-      />
-      <el-table-column
-        label="工单类型"
-        align="center"
-        prop="amount"
-        min-width="80"
-        :resizable="false"
-      >
+      <el-table-column label="客户名称" align="center" min-width="250" prop="companyName" :resizable="false" />
+      <el-table-column label="税号" align="center" min-width="200" prop="socialCreditCode" :resizable="false" />
+      <el-table-column label="工单类型" align="center" prop="amount" min-width="80" :resizable="false">
         <template #default="scope">
           {{ scope.row.type === 1 ? "循环工单" : "代办工单" }}
         </template>
       </el-table-column>
-      <el-table-column
-        label="项目"
-        align="center"
-        prop="taskTypeName"
-        :resizable="false"
-        min-width="110"
-      >
+      <el-table-column label="项目" align="center" prop="taskTypeName" :resizable="false" min-width="110">
         <template #default="scope">
           {{ scope.row.taskTypeName }}
           {{
-            scope.row.taskTypeDetailName
-              ? `-${scope.row.taskTypeDetailName}`
-              : ""
+          scope.row.taskTypeDetailName
+          ? `-${scope.row.taskTypeDetailName}`
+          : ""
           }}
         </template>
       </el-table-column>
-      <el-table-column
-        label="是否延续"
-        align="center"
-        prop="isContinue"
-        :resizable="false"
-      >
+      <el-table-column label="是否延续" align="center" prop="isContinue" :resizable="false">
         <template #default="scope">
           {{ scope.row.isContinue === 0 ? "否" : "是" }}
         </template>
       </el-table-column>
-      <el-table-column
-        label="合同状态"
-        align="center"
-        width="150"
-        prop="socialCreditCode"
-        :resizable="false"
-      >
+      <el-table-column label="合同状态" align="center" width="150" prop="socialCreditCode" :resizable="false">
         <template #default="scope">
           <span v-if="scope.row.type === 1">{{ scope.row.closingMonth }}</span>
           <span v-else>{{ scope.row.onceContractStatus }}</span>
         </template>
       </el-table-column>
-      <el-table-column
-        label="起始月"
-        align="center"
-        min-width="120"
-        prop="startMonth"
-        :resizable="false"
-      >
+      <el-table-column label="起始月" align="center" min-width="120" prop="startMonth" :resizable="false">
         <template #default="scope">
           <div v-if="scope.row.type === 1">
-            <div
-              v-if="scope.row.editStatus.startMonth"
-              style="
+            <div v-if="scope.row.editStatus.startMonth" style="
                 display: flex;
                 flex-direction: row;
                 justify-content: center;
-              "
-            >
-              <el-date-picker
-                v-model="scope.row.startMonth"
-                size="small"
-                placeholder="起始月"
-                :clearable="true"
-                value-format="YYYY-MM-DD"
-                format="YYYY年MM月"
-                type="month"
-                @change="(arg) => startDateChangeHandler(scope.row, arg)"
-              />
-              <el-button
-                link
-                type="primary"
-                icon="Check"
-                size="small"
-                style="padding: 0"
-                @click="saveHandler(scope.row, 'startMonth')"
-              />
+              ">
+              <el-date-picker v-model="scope.row.startMonth" size="small" placeholder="起始月" :clearable="true"
+                value-format="YYYY-MM-DD" format="YYYY年MM月" type="month"
+                @change="(arg) => startDateChangeHandler(scope.row, arg)" />
+              <el-button link type="primary" icon="Check" size="small" style="padding: 0"
+                @click="saveHandler(scope.row, 'startMonth')" />
             </div>
-            <div
-              v-else
-              style="
+            <div v-else style="
                 display: flex;
                 flex-direction: row;
                 justify-content: center;
-              "
-            >
+              ">
               <div style="width: auto">
                 {{
-                  scope.row.startMonth
-                    ? moment(scope.row.startMonth).format("YYYY年MM月")
-                    : ""
+                scope.row.startMonth
+                ? moment(scope.row.startMonth).format("YYYY年MM月")
+                : ""
                 }}
               </div>
-              <el-button
-                v-show="
+              <el-button v-show="
                   scope.row.isStop === 0 && scope.row.records.length === 0
-                "
-                link
-                type="primary"
-                icon="Edit"
-                size="small"
-                style="padding: 0"
-                v-hasPermi="['business:workOrder:edit']"
-                @click="
+                " link type="primary" icon="Edit" size="small" style="padding: 0"
+                v-hasPermi="['business:workOrder:edit']" @click="
                   () => {
                     scope.row.editStatus.startMonth =
                       !scope.row.editStatus.startMonth;
                   }
-                "
-              />
+                " />
             </div>
           </div>
           <div v-else>-</div>
         </template>
       </el-table-column>
-      <el-table-column
-        label="结束月"
-        align="center"
-        min-width="90"
-        :resizable="false"
-      >
+      <el-table-column label="结束月" align="center" min-width="90" :resizable="false">
         <template #default="scope">
           <div v-if="scope.row.monthNum > 0">
             {{
-              scope.row.type === 1
-                ? scope.row.endMonth
-                  ? moment(scope.row.endMonth).format("YYYY年MM月")
-                  : ""
-                : "-"
+            scope.row.type === 1
+            ? scope.row.endMonth
+            ? moment(scope.row.endMonth).format("YYYY年MM月")
+            : ""
+            : "-"
             }}
           </div>
         </template>
       </el-table-column>
-      <el-table-column
-        label="工单月数"
-        align="center"
-        :resizable="false"
-        width="80"
-        prop="monthNum"
-      >
+      <el-table-column label="工单月数" align="center" :resizable="false" width="80" prop="monthNum">
         <template #default="scope">
           {{ scope.row.type === 1 ? scope.row.monthNum : "-" }}
         </template>
       </el-table-column>
-      <el-table-column
-        label="工单执行人"
-        align="center"
-        :resizable="false"
-        min-width="100"
-      >
+      <el-table-column label="工单执行人" align="center" :resizable="false" min-width="100">
         <template #default="scope">{{ getTransactor(scope.row) }}</template>
       </el-table-column>
     </el-table>
     <!-- <contract-form ref="contractRef" :get-list="getList" /> -->
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
     <ZeroChangeDialog ref="zeroChangeDialogRef" :save-call-back="thenSave" />
-    <el-dialog
-      title="延续设置"
-      v-model="continueOpen"
-      width="500px"
-      append-to-body
-      draggable
-      @close="close"
-      :close-on-click-modal = "false"
-    >
+    <el-dialog title="延续设置" v-model="continueOpen" width="500px" append-to-body draggable @close="close"
+      :close-on-click-modal="false">
       <div style="padding: 8px 24px 16px 24px">
         <el-form size="small" label-width="100px">
           <el-form-item label="是否延续">
             <el-select v-model="cont" placeholder="请选择" style="width: 100%">
-              <el-option
-                v-for="item in yesOrNo"
-                :key="item.label"
-                :label="item.label"
-                :value="item.value"
-              />
+              <el-option v-for="item in yesOrNo" :key="item.label" :label="item.label" :value="item.value" />
             </el-select>
           </el-form-item>
         </el-form>
       </div>
       <div class="form-btns-container" style="height: 40px">
-        <el-button
-          size="small"
-          style="float: right"
-          @click="close"
-          icon="close"
-        >
-          取消</el-button
-        >
-        <el-button
-          type="primary"
-          icon="Finished"
-          size="small"
-          style="float: right; margin-left: 12px; margin-right: 12px"
-          @click="handleSave"
-          >保存</el-button
-        >
+        <el-button size="small" style="float: right" @click="close" icon="close">
+          取消</el-button>
+        <el-button type="primary" icon="Finished" size="small"
+          style="float: right; margin-left: 12px; margin-right: 12px" @click="handleSave">保存</el-button>
       </div>
     </el-dialog>
   </div>
 </template>
 
-<script setup name="Company">
-import {
-  listWorkOrder,
-  delWorkOrder,
-  exportWorkOrder,
-  updateWorkOrder,
-  setContract,
-} from "@/api/business/crm/workOrder";
-import useUserStore from "@/store/modules/user";
-import { yesOrNo } from "@/utils/default";
-import { get } from "@vueuse/core";
-import { ref } from "vue";
-import ZeroChangeDialog from "../ZeroChangeDialog";
-const { proxy } = getCurrentInstance();
-/** 字典数组区 */
-/** 查询 对象 */
+<script setup name="ContractWorkOrder">
+  import {
+    listWorkOrder,
+    delWorkOrder,
+    exportWorkOrder,
+    updateWorkOrder,
+    setContract,
+  } from "@/api/business/crm/workOrder";
+  import useUserStore from "@/store/modules/user";
+  import { yesOrNo } from "@/utils/default";
+  import { get } from "@vueuse/core";
+  import { ref } from "vue";
+  import ZeroChangeDialog from "../ZeroChangeDialog";
+  const { proxy } = getCurrentInstance();
+  /** 字典数组区 */
+  /** 查询 对象 */
 
-const orderList = ref([]);
-const permissions = useUserStore().permissions;
-const all_permission = "*:*:*";
-const continueOpen = ref(false);
-const loading = ref(true);
-const ids = ref([]);
-const single = ref(true);
-const cont = ref(1);
-const setContinue = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-const prev = ref([]);
-const zeroChangeDialogRef = ref(null);
+  const orderList = ref([]);
+  const permissions = useUserStore().permissions;
+  const all_permission = "*:*:*";
+  const continueOpen = ref(false);
+  const loading = ref(true);
+  const ids = ref([]);
+  const single = ref(true);
+  const cont = ref(1);
+  const setContinue = ref(true);
+  const multiple = ref(true);
+  const total = ref(0);
+  const prev = ref([]);
+  const zeroChangeDialogRef = ref(null);
 
-const { contract_verify_status } = proxy.useDict("contract_verify_status");
-const { contract_status } = proxy.useDict("contract_status");
-/** 查询对象 */
-const queryParams = ref({
-  pageNum: 1,
-  pageSize: 20,
-  companyName: "",
-  orderByColumn: "create_time",
-  noContract: 0,
-});
-
-const types = ref([
-  {
-    value: 1,
-    label: "循环工单",
-  },
-  {
-    value: 2,
-    label: "代办工单",
-  },
-]);
+  const { contract_verify_status } = proxy.useDict("contract_verify_status");
+  const { contract_status } = proxy.useDict("contract_status");
+  /** 查询对象 */
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    companyName: "",
+    orderByColumn: "create_time",
+    noContract: 0,
+  });
 
-const editStatus = {
-  startMonth: false,
-};
+  const types = ref([
+    {
+      value: 1,
+      label: "循环工单",
+    },
+    {
+      value: 2,
+      label: "代办工单",
+    },
+  ]);
 
-/***********************  方法区  ****************************/
+  const editStatus = {
+    startMonth: false,
+  };
 
-/** 查询company列表 */
-function getList() {
-  loading.value = true;
-  listWorkOrder(queryParams.value).then((response) => {
-    orderList.value = response.rows.map((l) => ({
-      ...l,
-      editStatus: proxy.deepClone(editStatus),
-    }));
-    prev.value = proxy.deepClone(response.rows);
-    total.value = response.total;
-    loading.value = false;
-    console.log("查询", orderList);
+  /***********************  方法区  ****************************/
+  onActivated(() => {
+    // 你的逻辑
+    getList();
   });
-}
+  /** 查询company列表 */
+  function getList() {
+    loading.value = true;
+    listWorkOrder(queryParams.value).then((response) => {
+      orderList.value = response.rows.map((l) => ({
+        ...l,
+        editStatus: proxy.deepClone(editStatus),
+      }));
+      prev.value = proxy.deepClone(response.rows);
+      total.value = response.total;
+      loading.value = false;
+      console.log("查询", orderList);
+    });
+  }
 
-/** 搜索按钮操作 */
-function handleSetContinue() {
-  if (ids.value.length < 1) {
-    proxy.$modal.msgError("至少选择一条数据");
-  } else {
-    if (setContinue) {
-      proxy.$modal.msgError("只能修改循环工单");
+  /** 搜索按钮操作 */
+  function handleSetContinue() {
+    if (ids.value.length < 1) {
+      proxy.$modal.msgError("至少选择一条数据");
     } else {
-      continueOpen.value = true;
+      if (setContinue) {
+        proxy.$modal.msgError("只能修改循环工单");
+      } else {
+        continueOpen.value = true;
+      }
     }
   }
-}
 
-/** 延续设置保存操作 */
-function handleSave() {
-  setContract(ids.value, cont.value).then((response) => {
-    proxy.$modal.msgSuccess("保存成功");
-    continueOpen.value = false;
-    getList();
-  });
-}
+  /** 延续设置保存操作 */
+  function handleSave() {
+    setContract(ids.value, cont.value).then((response) => {
+      proxy.$modal.msgSuccess("保存成功");
+      continueOpen.value = false;
+      getList();
+    });
+  }
 
-//判断是否有权限
-function viewAdviser(quer) {
-  return permissions.includes(all_permission) || permissions.includes(quer);
-}
+  //判断是否有权限
+  function viewAdviser(quer) {
+    return permissions.includes(all_permission) || permissions.includes(quer);
+  }
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
+  }
 
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm("queryRef");
-  handleQuery();
-}
+  /** 重置按钮操作 */
+  function resetQuery() {
+    proxy.resetForm("queryRef");
+    handleQuery();
+  }
 
-function close() {
-  continueOpen.value = false;
-  cont.value = 1;
-}
+  function close() {
+    continueOpen.value = false;
+    cont.value = 1;
+  }
 
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  setContinue.value = selection.map((item) => item.type === 2);
-}
+  // 多选框选中数据
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    setContinue.value = selection.map((item) => item.type === 2);
+  }
 
-/** 新增按钮操作 */
-function handleAdd() {
-  proxy.$refs.contractRef.open();
-}
+  /** 新增按钮操作 */
+  function handleAdd() {
+    proxy.$refs.contractRef.open();
+  }
 
-/** 修改按钮操作 */
-function handleUpdate(row) {
-  const id = row.id || ids.value;
-  proxy.$refs.contractRef.open(id);
-}
+  /** 修改按钮操作 */
+  function handleUpdate(row) {
+    const id = row.id || ids.value;
+    proxy.$refs.contractRef.open(id);
+  }
 
-/** 删除按钮操作 */
-function handleDelete(row) {
-  const _ids = row.id || ids.value;
-  proxy.$modal
-    .confirm("是否确认删除选中的数据项?")
-    .then(function () {
-      return delWorkOrder(_ids);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("删除成功!");
-    })
-    .catch(() => {});
-}
+  /** 删除按钮操作 */
+  function handleDelete(row) {
+    const _ids = row.id || ids.value;
+    proxy.$modal
+      .confirm("是否确认删除选中的数据项?")
+      .then(function () {
+        return delWorkOrder(_ids);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功!");
+      })
+      .catch(() => { });
+  }
 
-/** 导出按钮操作 */
-function handleExport() {
-  exportWorkOrder(queryParams.value);
-}
+  /** 导出按钮操作 */
+  function handleExport() {
+    exportWorkOrder(queryParams.value);
+  }
 
-function startDateChangeHandler(row, startDate) {
-  if (startDate) {
-    row.endMonth = proxy
-      .moment(startDate)
-      .add(row.monthNum - 1, "M")
-      .format("YYYY-MM-DD");
-  } else row.endMonth = null;
-  console.log(row);
-}
+  function startDateChangeHandler(row, startDate) {
+    if (startDate) {
+      row.endMonth = proxy
+        .moment(startDate)
+        .add(row.monthNum - 1, "M")
+        .format("YYYY-MM-DD");
+    } else row.endMonth = null;
+    console.log(row);
+  }
 
-function saveHandler(row, field) {
-  const index = prev.value.findIndex((l) => l.id === row.id);
-  if (prev.value[index][field] === row[field]) {
-    row.editStatus[field] = !row.editStatus[field];
-  } else {
-    if (row.isZero == null) {
-      zeroChangeDialogRef.value.open(row.companyId, row);
+  function saveHandler(row, field) {
+    const index = prev.value.findIndex((l) => l.id === row.id);
+    if (prev.value[index][field] === row[field]) {
+      row.editStatus[field] = !row.editStatus[field];
     } else {
-      proxy.$modal
-        .confirm("确定修改起始月么?")
-        .then((_) => {
-          updateWorkOrder(row).then((res) => {
-            getList();
-          });
-        })
-        .catch((_) => {});
+      if (row.isZero == null) {
+        zeroChangeDialogRef.value.open(row.companyId, row);
+      } else {
+        proxy.$modal
+          .confirm("确定修改起始月么?")
+          .then((_) => {
+            updateWorkOrder(row).then((res) => {
+              getList();
+            });
+          })
+          .catch((_) => { });
+      }
     }
   }
-}
 
-function thenSave(row) {
-  proxy.$modal
-    .confirm("确定修改起始月么?")
-    .then((_) => {
-      updateWorkOrder(row).then((res) => {
-        getList();
-      });
-    })
-    .catch((_) => {});
-}
+  function thenSave(row) {
+    proxy.$modal
+      .confirm("确定修改起始月么?")
+      .then((_) => {
+        updateWorkOrder(row).then((res) => {
+          getList();
+        });
+      })
+      .catch((_) => { });
+  }
 
-function getTransactor(row) {
-  if (row.entrusts != null && row.entrusts.length > 0) {
-    const names = Array.from(new Set(row.entrusts.map((v) => v.toAccountName)));
-    return names.join(",");
-  } else {
-    return row.serviceName;
+  function getTransactor(row) {
+    if (row.entrusts != null && row.entrusts.length > 0) {
+      const names = Array.from(new Set(row.entrusts.map((v) => v.toAccountName)));
+      return names.join(",");
+    } else {
+      return row.serviceName;
+    }
   }
-}
-getList();
-</script>
+  getList();
+</script>

+ 180 - 0
src/views/business/deduction/fileDialog.vue

@@ -0,0 +1,180 @@
+<template>
+    <el-dialog v-model="visible" :width="width" append-to-body draggable show-close :close-on-click-modal="false">
+        <template #header>
+            <div class="dialog-title-container">
+                <span class="title-label" style="color: #fff;">
+                    <el-icon>
+                        <Document />
+                    </el-icon> 附件信息</span>
+                <!-- <el-icon @click="close">
+            <Close />
+          </el-icon> -->
+            </div>
+        </template>
+        <div class="dialog-list-container">
+            <el-table ref="dbTable" :data="list" size="small" border header-row-class-name="list-header-row"
+                row-class-name="list-row" @selection-change="handleSelectionChange">
+                <el-table-column type="selection" width="40" align="center" />
+                <el-table-column type="index" label="序号" width="46" align="center" />
+                <el-table-column label="文件名" prop="originalFileName" align="center" show-overflow-tooltip>
+                    <template #default="scope">
+                        <el-button size="small" type="primary" link @click="openFile(scope.row)">{{
+                            scope.row.originalFileName
+                            }}</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+
+
+
+
+            <div  style="display: flex; justify-content: space-between; margin-top: 10px;margin-bottom: 10px;">
+                <div>
+                    补传文件
+                </div>
+                <div>
+                    <el-upload action="#" :http-request="upload" :with-credentials="true" :show-file-list="false"
+                        multiple>
+                        <el-button size="small" type="primary" icon="Upload">点击上传</el-button>
+                    </el-upload>
+                </div>
+
+            </div>
+            <el-table ref="filesTable" :data="supplementList" size="small" border
+                header-row-class-name="list-header-row">
+                <el-table-column type="index" label="序号" width="47" align="center" />
+                <el-table-column label="文件名" prop="originalFileName" align="center">
+                    <template #default="scope">
+                        <el-link :href="`${baseUrl}${scope.row.fileUrl}`" :underline="false" target="_blank"
+                            type="primary">
+                            {{ scope.row.originalFileName }}
+                        </el-link>
+                    </template>
+                </el-table-column>
+                <el-table-column label="操作" width="47" align="center">
+                    <template #default="scope">
+                        <el-button link size="small" type="danger"
+                            @click="handleDelFile(scope.row.id,scope.$index)">删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </div>
+
+        <div style="height: 100px;">
+
+        </div>
+        <!-- <pagination v-show="total > 0" :total="total" v-model:page="query.pageNum" v-model:limit="query.pageSize"
+            @pagination="loadData" style="background-color: rgba(0, 0, 0, 0);" /> -->
+    </el-dialog>
+</template>
+<script setup>
+    import { reactive } from 'vue';
+    import { listFile } from '@/api/system/file'
+    import { saveFiles, remove } from "@/api/business/production/deduction";
+    import { uploadFile } from "@/api/tool/file";
+    const props = defineProps(
+        {
+            width: {
+                type: String,
+                default: '800px'
+            }
+        }
+    )
+
+    // import api from '@/api/biz/fileStorage'
+    const data = reactive({
+        visible: false,
+        list: [],
+        total: 0,
+        query: {
+            name: '',
+            total: 0,
+            pageSize: 15,
+            pageNum: 1
+        },
+        selection: [],
+        baseUrl: import.meta.env.VITE_APP_BASE_API,
+        options: {}
+    })
+    const { visible, list, query, selection, baseUrl, options, total } = toRefs(data)
+    const supplementList = ref([])
+    function open(arg) {
+        visible.value = true
+        options.value = arg
+        loadData()
+    }
+    /**
+     * 对话框关闭 事件
+     */
+    function close() {
+        visible.value = false
+    }
+    /**
+     * 加载数据
+     */
+    const loadData = async () => {
+        const res = await listFile({ ...query.value, ...options.value })
+        list.value = res.rows
+        total.value = res.total
+        list.value = list.value.filter(item => {
+            return item.supplement != 1
+        })
+        supplementList.value = res.rows.filter(item => {
+            return item.supplement === 1
+        })
+
+    }
+
+    function upload(param) {
+        const formData = new FormData();
+        formData.append("file", param.file);
+        uploadFile(formData).then((res) => {
+            if (res.code === 200) {
+                const file = {};
+                file.fileName = res.newFileName;
+                file.url = res.url;
+                file.originalFileName = res.originalFilename;
+                file.fileUrl = res.fileName;
+                file.masterId = options.value.masterId;
+                file.supplement = 1;
+                file.masterTableName = "biz_deduction";
+                saveFiles(file)
+                supplementList.value.push(file);
+
+            }
+        });
+    }
+    /**
+     * 列表checkbox列选择 事件
+     */
+    function handleSelectionChange(selection) {
+        selection.value = selection
+    }
+    function handleDelFile(id, index) {
+        console.log(id, index);
+        if (id == undefined) {
+            supplementList.value.splice(index, 1);
+        } else {
+            let data = { id: id }
+            remove(data).then(res => {
+                if (res.code === 200) {
+                    supplementList.value.splice(index, 1);
+                }
+            })
+        }
+
+    }
+    /**
+     * 搜索 事件
+     */
+    function handleSearch() {
+        loadData()
+    }
+    function openFile(attach) {
+        window.open(`${baseUrl.value}/${attach.fileUrl}`, attach.fileName)
+    }
+
+    defineExpose({
+        open
+    })
+</script>

+ 11 - 6
src/views/business/deduction/index.vue

@@ -60,8 +60,10 @@
     <el-table v-loading="loading" :data="list" size="small" border height="100%"
       @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="客户名" prop="companyName" min-width="250" align="center" />
-      <el-table-column label="来源" min-width="100" align="center" prop="fromCompanyName" />
+      <el-table-column label="客户名" prop="companyName" min-width="250" align="center" fixed="left" />
+      <el-table-column label="来源" align="center" prop="fromCompanyName" v-if="tenant.versionId === '4'" />
+      <el-table-column label="受委托方" align="center" prop="toTenantName" min-width="130"
+        v-if="tenant.versionId !== '4'" />
       <el-table-column label="纳税性质" prop="taxType" width="100" align="center" />
       <el-table-column label="扣款期" prop="currentMonth" min-width="100" align="center">
         <template #default="scope">
@@ -98,7 +100,7 @@
           <span v-if="scope.row.status === 5">已申报</span>
         </template>
       </el-table-column>
-      <el-table-column label="操作" fixed="right" width="220" align="center">
+      <el-table-column label="操作" fixed="right" width="150" align="center">
         <template #default="scope">
           <div v-if="scope.row.deductible === 1">
             <div v-if="(scope.row.status === 0 || scope.row.status === 4) &&
@@ -234,7 +236,7 @@
   </div>
 </template>
 
-<script setup name="Company">
+<script setup name="Deduction">
   import {
     listDeduction,
     exportDeposition,
@@ -249,7 +251,7 @@
   import useUserStore from "@/store/modules/user";
   import { getTenant } from "@/utils/auth";
   import { ref } from "vue";
-  import FileDialog from "../../dialog/fileDialog.vue";
+  import FileDialog from "./fileDialog.vue";
   import HousingFundViewDialog from "./HousingFundViewDialog";
   import SocialSecurityViewDialog from "./SocialSecurityViewDialog";
 
@@ -323,7 +325,10 @@
   });
 
   /***********************  方法区  ****************************/
-
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
   /** 查询company列表 */
   function getList() {
     loading.value = true;

+ 142 - 189
src/views/business/entrust/deduct/index.vue

@@ -28,240 +28,193 @@
     </el-row>
     <!-- 功能按钮区 -->
     <div class="list-btns-container">
-      <el-button type="success" size="small" icon="Refresh" @click="getList"
-        >刷新</el-button
-      >
+      <el-button type="success" size="small" icon="Refresh" @click="getList">刷新</el-button>
       <el-dropdown trigger="click">
         <el-button type="primary" size="small">
           其它<el-icon class="el-icon--right"><arrow-down /></el-icon>
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
-            <el-dropdown-item
-              icon="Download"
-              @click="handleExport"
-              v-hasPermi="['business:deduct:export']"
-            >
-              导出</el-dropdown-item
-            >
+            <el-dropdown-item icon="Download" @click="handleExport" v-hasPermi="['business:deduct:export']">
+              导出</el-dropdown-item>
           </el-dropdown-menu>
         </template>
       </el-dropdown>
     </div>
     <!-- 列表区 -->
-    <el-table
-      v-loading="loading"
-      :data="orderList"
-      size="small"
-      border
-      height="100%"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="orderList" size="small" border height="100%"
+      @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column
-        label="委托单号"
-        align="center"
-        prop="formNo"
-        min-width="140"
-      />
-      <el-table-column
-        label="扣款单位"
-        align="center"
-        prop="contactCompany"
-        min-width="150"
-      />
+      <el-table-column label="委托单号" align="center" prop="formNo" min-width="140" />
+      <el-table-column label="扣款单位" align="center" prop="contactCompany" min-width="150" />
       <el-table-column label="扣款信息" align="center">
         <template #default="scope">
           {{ scope.row.year }}年{{ scope.row.month }}月扣款
         </template>
       </el-table-column>
-      <el-table-column
-        label="扣款时间"
-        align="center"
-        prop="deductDate"
-        min-width="120"
-      />
-      <el-table-column
-        label="扣款金额"
-        header-align="center"
-        align="right"
-        prop="amount"
-        min-width="80"
-      >
+      <el-table-column label="扣款时间" align="center" prop="deductDate" min-width="120" />
+      <el-table-column label="扣款金额" header-align="center" align="right" prop="amount" min-width="80">
         <template #default="scope">
           <span> {{ rowNum(scope.row.amount) }}</span>
         </template>
       </el-table-column>
-      <el-table-column
-        label="扣款明细"
-        align="center"
-        prop="amount"
-        min-width="80"
-      >
+      <el-table-column label="扣款明细" align="center" prop="amount" min-width="80">
         <template #default="scope">
           <!-- <el-button link size="small" type="primary" @click="handleDetail(scope.row)">查看明细</el-button> -->
-          <el-button
-            link
-            size="small"
-            type="primary"
-            v-hasPermi="['business:deduct:info']"
-            @click="handleStatementAccount(scope.row)"
-            >跳转对账单</el-button
-          >
+          <el-button link size="small" type="primary" v-hasPermi="['business:deduct:info']"
+            @click="handleStatementAccount(scope.row)">跳转对账单</el-button>
         </template>
       </el-table-column>
     </el-table>
     <statementAccountForm ref="statementAccountFormRef" :get-list="getList" />
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
   </div>
 </template>
 
-<script setup name="Company">
-// import contractForm from "./form";
-import {
-  listDeduct,
-  delDeduct,
-  exportDeduct,
-} from "@/api/business/entrust/deduct";
-import { rowNum } from "@/utils/index";
-import statementAccountForm from "./form.vue";
-import { getRemain } from "@/api/business/entrust/deposit";
-// import companyForm from "./form"
-const { proxy } = getCurrentInstance();
-/** 字典数组区 */
-/** 查询 对象 */
-
-const orderList = ref([]);
-const loading = ref(true);
-const ids = ref([]);
-const single = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-const prev = ref([]);
-const statementAccountFormRef = ref(null);
-
-const totalRemain = ref(0);
-const donateRemain = ref(0);
-
-const { contract_verify_status } = proxy.useDict("contract_verify_status");
-const { contract_status } = proxy.useDict("contract_status");
-/** 查询对象 */
-const queryParams = ref({
-  pageNum: 1,
-  pageSize: 20,
-  orderByColumn: "create_time",
-  companyName: "",
-  noContract: 0,
-});
-
-const editStatus = {
-  startMonth: false,
-};
+<script setup name="Deduct">
+  // import contractForm from "./form";
+  import {
+    listDeduct,
+    delDeduct,
+    exportDeduct,
+  } from "@/api/business/entrust/deduct";
+  import { rowNum } from "@/utils/index";
+  import statementAccountForm from "./form.vue";
+  import { getRemain } from "@/api/business/entrust/deposit";
+  // import companyForm from "./form"
+  const { proxy } = getCurrentInstance();
+  /** 字典数组区 */
+  /** 查询 对象 */
+
+  const orderList = ref([]);
+  const loading = ref(true);
+  const ids = ref([]);
+  const single = ref(true);
+  const multiple = ref(true);
+  const total = ref(0);
+  const prev = ref([]);
+  const statementAccountFormRef = ref(null);
+
+  const totalRemain = ref(0);
+  const donateRemain = ref(0);
+
+  const { contract_verify_status } = proxy.useDict("contract_verify_status");
+  const { contract_status } = proxy.useDict("contract_status");
+  /** 查询对象 */
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    orderByColumn: "create_time",
+    companyName: "",
+    noContract: 0,
+  });
 
-/***********************  方法区  ****************************/
+  const editStatus = {
+    startMonth: false,
+  };
 
-/** 查询company列表 */
-function getList() {
-  loading.value = true;
-  Promise.all([listDeduct(queryParams.value), getRemain()]).then((res) => {
-    orderList.value = res[0].rows.map((l) => ({ ...l }));
-    prev.value = proxy.deepClone(res[0].rows);
-    total.value = res[0].total;
-    totalRemain.value = res[1].data.totalRemain;
-    donateRemain.value = res[1].data.donateRemain;
-    loading.value = false;
+  /***********************  方法区  ****************************/
+  onActivated(() => {
+    // 你的逻辑
+    getList();
   });
-}
+  /** 查询company列表 */
+  function getList() {
+    loading.value = true;
+    Promise.all([listDeduct(queryParams.value), getRemain()]).then((res) => {
+      orderList.value = res[0].rows.map((l) => ({ ...l }));
+      prev.value = proxy.deepClone(res[0].rows);
+      total.value = res[0].total;
+      totalRemain.value = res[1].data.totalRemain;
+      donateRemain.value = res[1].data.donateRemain;
+      loading.value = false;
+    });
+  }
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
+  }
 
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm("queryRef");
-  handleQuery();
-}
+  /** 重置按钮操作 */
+  function resetQuery() {
+    proxy.resetForm("queryRef");
+    handleQuery();
+  }
 
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  single.value = selection.length != 1;
-  multiple.value = !selection.length;
-}
+  // 多选框选中数据
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    single.value = selection.length != 1;
+    multiple.value = !selection.length;
+  }
 
-/** 删除按钮操作 */
-function handleDelete(row) {
-  const _ids = row.id || ids.value;
-  proxy.$modal
-    .confirm("是否确认删除选中的数据项?")
-    .then(function () {
-      return delDeduct(_ids);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("删除成功!");
-    })
-    .catch(() => {});
-}
+  /** 删除按钮操作 */
+  function handleDelete(row) {
+    const _ids = row.id || ids.value;
+    proxy.$modal
+      .confirm("是否确认删除选中的数据项?")
+      .then(function () {
+        return delDeduct(_ids);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功!");
+      })
+      .catch(() => { });
+  }
 
-/** 导出按钮操作 */
-function handleExport() {
-  exportDeduct(queryParams.value);
-}
+  /** 导出按钮操作 */
+  function handleExport() {
+    exportDeduct(queryParams.value);
+  }
 
-function startDateChangeHandler(row, startDate) {
-  if (startDate) {
-    // console.log(startDate)
-    row.endMonth = proxy
-      .moment(startDate)
-      .add(row.monthNum - 1, "M")
-      .format("YYYY-MM-DD");
-  } else row.endMonth = null;
-  console.log(row);
-}
+  function startDateChangeHandler(row, startDate) {
+    if (startDate) {
+      // console.log(startDate)
+      row.endMonth = proxy
+        .moment(startDate)
+        .add(row.monthNum - 1, "M")
+        .format("YYYY-MM-DD");
+    } else row.endMonth = null;
+    console.log(row);
+  }
 
-function saveHandler(row, field) {
-  const index = prev.value.findIndex((l) => l.id === row.id);
-  if (prev.value[index][field] === row[field]) {
-    row.editStatus[field] = !row.editStatus[field];
-  } else {
-    proxy.$modal
-      .confirm("确定修改起始月么?")
-      .then((_) => {
-        updateDeduct(row).then((res) => {
-          getList();
-        });
-      })
-      .catch((_) => {});
+  function saveHandler(row, field) {
+    const index = prev.value.findIndex((l) => l.id === row.id);
+    if (prev.value[index][field] === row[field]) {
+      row.editStatus[field] = !row.editStatus[field];
+    } else {
+      proxy.$modal
+        .confirm("确定修改起始月么?")
+        .then((_) => {
+          updateDeduct(row).then((res) => {
+            getList();
+          });
+        })
+        .catch((_) => { });
+    }
   }
-}
 
-function handleDetail(row) {}
+  function handleDetail(row) { }
 
-function handleStatementAccount(row) {
-  statementAccountFormRef.value.open(row.id);
-}
+  function handleStatementAccount(row) {
+    statementAccountFormRef.value.open(row.id);
+  }
 
-getList();
+  getList();
 </script>
 <style>
-.dashboard-total-item {
-  display: flex;
-  align-items: center;
-  padding: 0 24px;
-  height: 80px;
-  background-color: #fff;
-  font-size: 16px;
-  justify-content: space-between;
-}
+  .dashboard-total-item {
+    display: flex;
+    align-items: center;
+    padding: 0 24px;
+    height: 80px;
+    background-color: #fff;
+    font-size: 16px;
+    justify-content: space-between;
+  }
 </style>

+ 154 - 212
src/views/business/entrust/deductOfFactory/index.vue

@@ -2,104 +2,48 @@
   <div class="page-container list-container">
     <!-- 功能按钮区 -->
     <div class="list-btns-container">
-      <el-button
-        type="success"
-        size="small"
-        icon="Refresh"
-        @click="getList"
-        v-hasPermi="['business:entrustOrder:remove']"
-        >刷新</el-button
-      >
+      <el-button type="success" size="small" icon="Refresh" @click="getList"
+        v-hasPermi="['business:entrustOrder:remove']">刷新</el-button>
       <el-dropdown trigger="click">
         <el-button type="primary" size="small">
           其它<el-icon class="el-icon--right"><arrow-down /></el-icon>
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
-            <el-dropdown-item
-              icon="Download"
-              @click="handleExport"
-              v-if="viewAdviser('business:entrustOrder:export')"
-            >
-              导出</el-dropdown-item
-            >
+            <el-dropdown-item icon="Download" @click="handleExport" v-if="viewAdviser('business:entrustOrder:export')">
+              导出</el-dropdown-item>
           </el-dropdown-menu>
         </template>
       </el-dropdown>
     </div>
     <!-- 搜索区 -->
-    <el-form
-      class="list-search-container"
-      size="small"
-      :model="queryParams"
-      ref="queryRef"
-      :inline="true"
-      label-width="68px"
-      @submit.native.prevent
-    >
+    <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
+      label-width="68px" @submit.native.prevent>
       <el-form-item label="往来单位:" prop="contactCompany">
-        <el-input
-          v-model="queryParams.contactCompany"
-          placeholder="请输入往来单位"
-          clearable
-          @keyup.enter="handleQuery"
-          style="width: 150px"
-        />
+        <el-input v-model="queryParams.contactCompany" placeholder="请输入往来单位" clearable @keyup.enter="handleQuery"
+          style="width: 150px" />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="Search" @click="handleQuery"
-          >搜索</el-button
-        >
+        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
         <el-button icon="Refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
 
     <!-- 列表区 -->
-    <el-table
-      v-loading="loading"
-      :data="list"
-      size="small"
-      border
-      height="100%"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="list" size="small" border height="100%"
+      @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column
-        label="签约日期"
-        align="center"
-        prop="formDate"
-        width="150"
-      />
-      <el-table-column
-        label="合同编号"
-        align="center"
-        prop="formNo"
-        width="120"
-      >
+      <el-table-column label="签约日期" align="center" prop="formDate" width="150" />
+      <el-table-column label="合同编号" align="center" prop="formNo" width="120">
       </el-table-column>
-      <el-table-column
-        label="往来单位"
-        align="center"
-        prop="contactCompany"
-        width="140"
-      >
+      <el-table-column label="往来单位" align="center" prop="contactCompany" width="140">
       </el-table-column>
-      <el-table-column
-        label="预存金额"
-        prop="depositAmount"
-        align="center"
-        width="100"
-      >
+      <el-table-column label="预存金额" prop="depositAmount" align="center" width="100">
         <template #default="scope">
           <span>{{ rowNum(scope.row.depositAmount) }}</span>
         </template>
       </el-table-column>
-      <el-table-column
-        label="结余金额"
-        prop="remainAmount"
-        align="center"
-        width="100"
-      >
+      <el-table-column label="结余金额" prop="remainAmount" align="center" width="100">
         <template #default="scope">
           <span>{{ rowNum(scope.row.remainAmount) }}</span>
         </template>
@@ -114,151 +58,149 @@
     </el-table>
     <entrust-order-form ref="entrustOrderFormRef" :getList="getList" />
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
   </div>
 </template>
 
-<script setup name="Company">
-import {
-  listEntrustOrder,
-  exportEntrustOrder,
-  delEntrustOrder,
-  confirmEntrustOrder,
-  finishedEntrustOrder,
-} from "@/api/business/entrust/entrustOrder";
-import { rowNum } from "@/utils/index";
-import useUserStore from "@/store/modules/user";
-import entrustOrderForm from "./form";
-const { proxy } = getCurrentInstance();
-/** 字典数组区 */
-/** 查询 对象 */
-
-const list = ref([]);
-const loading = ref(true);
-const ids = ref([]);
-const selections = ref([]);
-const single = ref(false);
-const multiple = ref(false);
-const permissions = useUserStore().permissions;
-const all_permission = "*:*:*";
-const total = ref(0);
-const prev = ref([]);
-const entrustOrderFormRef = ref(null);
-
-const setEntrustDialogRef = ref(null);
-
-const { entrust_order_status } = proxy.useDict("entrust_order_status");
-/** 查询对象 */
-const queryParams = ref({
-  pageNum: 1,
-  pageSize: 20,
-  contactCompany: "",
-  type: 2,
-});
-
-const editStatus = {
-  startMonth: false,
-};
-
-/***********************  方法区  ****************************/
-
-/** 查询company列表 */
-function getList() {
-  loading.value = true;
-  listEntrustOrder(queryParams.value).then((response) => {
-    list.value = response.rows;
-    total.value = response.total;
-    loading.value = false;
+<script setup name="General">
+  import {
+    listEntrustOrder,
+    exportEntrustOrder,
+    delEntrustOrder,
+    confirmEntrustOrder,
+    finishedEntrustOrder,
+  } from "@/api/business/entrust/entrustOrder";
+  import { rowNum } from "@/utils/index";
+  import useUserStore from "@/store/modules/user";
+  import entrustOrderForm from "./form";
+  const { proxy } = getCurrentInstance();
+  /** 字典数组区 */
+  /** 查询 对象 */
+
+  const list = ref([]);
+  const loading = ref(true);
+  const ids = ref([]);
+  const selections = ref([]);
+  const single = ref(false);
+  const multiple = ref(false);
+  const permissions = useUserStore().permissions;
+  const all_permission = "*:*:*";
+  const total = ref(0);
+  const prev = ref([]);
+  const entrustOrderFormRef = ref(null);
+
+  const setEntrustDialogRef = ref(null);
+
+  const { entrust_order_status } = proxy.useDict("entrust_order_status");
+  /** 查询对象 */
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    contactCompany: "",
+    type: 2,
   });
-}
-
-//判断是否有权限
-function viewAdviser(quer) {
-  return permissions.includes(all_permission) || permissions.includes(quer);
-}
-
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
-
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm("queryRef");
-  handleQuery();
-}
 
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  selections.value = selection;
-  single.value = selection.length != 1;
-  multiple.value = selection.length > 0;
-}
+  const editStatus = {
+    startMonth: false,
+  };
 
-/** 导出按钮操作 */
-function handleExport() {
-  exportEntrustOrder(queryParams.value);
-}
-
-/** 新增按钮操作 */
-function handleAdd() {
-  entrustOrderFormRef.value.open();
-}
-
-function handleUpdate(id) {
-  entrustOrderFormRef.value.open(id);
-}
-
-/** 删除按钮操作 */
-function handleDelete(row) {
-  const _ids = row.id || ids.value;
-  proxy.$modal
-    .confirm("是否确认删除选中的数据项?")
-    .then(function () {
-      return delEntrustOrder(_ids);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("删除成功!");
-    })
-    .catch(() => {});
-}
-
-function handleConfirm(row) {
-  proxy.$modal
-    .confirm("确认启用该合同?")
-    .then((_) => {
-      return confirmEntrustOrder(row);
-    })
-    .then((res) => {
-      console.log(res);
-      getList();
-      proxy.$modal.msgSuccess("确认成功");
-    });
-}
-
-function handleFinished(row) {
-  proxy.$modal
-    .confirm("确认完结该合同?")
-    .then((_) => {
-      return finishedEntrustOrder(row);
-    })
-    .then((res) => {
-      console.log(res);
-      getList();
-      proxy.$modal.msgSuccess("完结成功");
+  /***********************  方法区  ****************************/
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
+  /** 查询company列表 */
+  function getList() {
+    loading.value = true;
+    listEntrustOrder(queryParams.value).then((response) => {
+      list.value = response.rows;
+      total.value = response.total;
+      loading.value = false;
     });
-}
+  }
+
+  //判断是否有权限
+  function viewAdviser(quer) {
+    return permissions.includes(all_permission) || permissions.includes(quer);
+  }
+
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
+  }
+
+  /** 重置按钮操作 */
+  function resetQuery() {
+    proxy.resetForm("queryRef");
+    handleQuery();
+  }
+
+  // 多选框选中数据
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    selections.value = selection;
+    single.value = selection.length != 1;
+    multiple.value = selection.length > 0;
+  }
+
+  /** 导出按钮操作 */
+  function handleExport() {
+    exportEntrustOrder(queryParams.value);
+  }
+
+  /** 新增按钮操作 */
+  function handleAdd() {
+    entrustOrderFormRef.value.open();
+  }
+
+  function handleUpdate(id) {
+    entrustOrderFormRef.value.open(id);
+  }
+
+  /** 删除按钮操作 */
+  function handleDelete(row) {
+    const _ids = row.id || ids.value;
+    proxy.$modal
+      .confirm("是否确认删除选中的数据项?")
+      .then(function () {
+        return delEntrustOrder(_ids);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功!");
+      })
+      .catch(() => { });
+  }
+
+  function handleConfirm(row) {
+    proxy.$modal
+      .confirm("确认启用该合同?")
+      .then((_) => {
+        return confirmEntrustOrder(row);
+      })
+      .then((res) => {
+        console.log(res);
+        getList();
+        proxy.$modal.msgSuccess("确认成功");
+      });
+  }
+
+  function handleFinished(row) {
+    proxy.$modal
+      .confirm("确认完结该合同?")
+      .then((_) => {
+        return finishedEntrustOrder(row);
+      })
+      .then((res) => {
+        console.log(res);
+        getList();
+        proxy.$modal.msgSuccess("完结成功");
+      });
+  }
+
+  function handleViewAccountment(row) { }
 
-function handleViewAccountment(row) {}
-
-getList();
-</script>
+  getList();
+</script>

+ 316 - 494
src/views/business/entrust/deposit/index.vue

@@ -2,192 +2,75 @@
   <div class="page-container list-container">
     <!-- 功能按钮区 -->
     <div class="list-btns-container">
-      <el-button
-        type="primary"
-        size="small"
-        icon="Plus"
-        @click="handleAdd"
-        v-hasPermi="['business:deposit:add']"
-        >新增</el-button
-      >
-      <el-button
-        type="danger"
-        size="small"
-        icon="Delete"
-        :disabled="multiple"
-        @click="handleDelete"
-        v-hasPermi="['business:deposit:remove']"
-        >删除</el-button
-      >
-      <el-button
-        type="success"
-        size="small"
-        icon="Refresh"
-        @click="getList"
-        v-hasPermi="['business:deposit:list']"
-        >刷新</el-button
-      >
+      <el-button type="primary" size="small" icon="Plus" @click="handleAdd"
+        v-hasPermi="['business:deposit:add']">新增</el-button>
+      <el-button type="danger" size="small" icon="Delete" :disabled="multiple" @click="handleDelete"
+        v-hasPermi="['business:deposit:remove']">删除</el-button>
+      <el-button type="success" size="small" icon="Refresh" @click="getList"
+        v-hasPermi="['business:deposit:list']">刷新</el-button>
       <el-dropdown trigger="click">
         <el-button type="primary" size="small">
           其它<el-icon class="el-icon--right"><arrow-down /></el-icon>
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
-            <el-dropdown-item
-              icon="Download"
-              @click="handleExport"
-              v-if="viewAdviser('business:deposit:export')"
-            >
-              导出</el-dropdown-item
-            >
+            <el-dropdown-item icon="Download" @click="handleExport" v-if="viewAdviser('business:deposit:export')">
+              导出</el-dropdown-item>
           </el-dropdown-menu>
         </template>
       </el-dropdown>
     </div>
 
     <!-- 列表区 -->
-    <el-table
-      v-loading="loading"
-      :data="orderList"
-      size="small"
-      border
-      height="100%"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="orderList" size="small" border height="100%"
+      @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column
-        label="日期"
-        align="center"
-        prop="depositDate"
-        min-width="200"
-      />
-      <el-table-column
-        label="委托单号"
-        align="center"
-        prop="formNo"
-        min-width="120"
-      />
-      <el-table-column
-        label="预存单位"
-        align="center"
-        prop="contactCompany"
-        min-width="150"
-      />
-      <el-table-column
-        label="签约主体"
-        align="center"
-        prop="signingSubject"
-        min-width="150"
-      />
-      <el-table-column
-        label="金额"
-        header-align="center"
-        align="right"
-        prop="amount"
-        width="120"
-      >
+      <el-table-column label="日期" align="center" prop="depositDate" min-width="200" />
+      <el-table-column label="委托单号" align="center" prop="formNo" min-width="120" />
+      <el-table-column label="预存单位" align="center" prop="contactCompany" min-width="150" />
+      <el-table-column label="签约主体" align="center" prop="signingSubject" min-width="150" />
+      <el-table-column label="金额" header-align="center" align="right" prop="amount" width="120">
         <template #default="scope">
           <span>{{ rowNum(scope.row.amount) }}</span>
         </template>
       </el-table-column>
 
-      <el-table-column
-        label="审核状态"
-        align="center"
-        min-width="80"
-        prop="remark"
-      >
+      <el-table-column label="审核状态" align="center" min-width="80" prop="remark">
         <template #default="scope">
           <dict-tag :options="verify_status" :value="scope.row.status" />
         </template>
       </el-table-column>
-      <el-table-column
-        label="操作"
-        align="center"
-        prop="verifyStatus"
-        min-width="200"
-      >
+      <el-table-column label="操作" align="center" prop="verifyStatus" min-width="200">
         <template #default="scope">
-          <el-button
-            v-show="scope.row.status === 0"
-            link
-            type="warning"
-            size="small"
-            @click="handleInfo(scope.row)"
-            v-hasPermi="['business:deposit:edit']"
-            >修改</el-button
-          >
-          <el-button
-            v-show="scope.row.status === 0"
-            link
-            type="danger"
-            size="small"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['business:deposit:remove']"
-            >删除</el-button
-          >
-          <el-button
-            v-show="scope.row.status === 0"
-            link
-            type="success"
-            size="small"
-            @click="handleVerify(scope.row, 1)"
-            v-hasPermi="['business:deposit:verify']"
-            >审核通过</el-button
-          >
-          <el-button
-            v-show="scope.row.status === 0"
-            link
-            type="danger"
-            size="small"
-            @click="handleVerify(scope.row, 4)"
-            v-hasPermi="['business:deposit:verify']"
-            >驳回</el-button
-          >
-          <el-button
-            v-show="scope.row.status !== 0"
-            link
-            type="primary"
-            size="small"
-            @click="handleInfo(scope.row)"
-            v-hasPermi="['business:deposit:query']"
-            >查看</el-button
-          >
+          <el-button v-show="scope.row.status === 0" link type="warning" size="small" @click="handleInfo(scope.row)"
+            v-hasPermi="['business:deposit:edit']">修改</el-button>
+          <el-button v-show="scope.row.status === 0" link type="danger" size="small" @click="handleDelete(scope.row)"
+            v-hasPermi="['business:deposit:remove']">删除</el-button>
+          <el-button v-show="scope.row.status === 0" link type="success" size="small"
+            @click="handleVerify(scope.row, 1)" v-hasPermi="['business:deposit:verify']">审核通过</el-button>
+          <el-button v-show="scope.row.status === 0" link type="danger" size="small" @click="handleVerify(scope.row, 4)"
+            v-hasPermi="['business:deposit:verify']">驳回</el-button>
+          <el-button v-show="scope.row.status !== 0" link type="primary" size="small" @click="handleInfo(scope.row)"
+            v-hasPermi="['business:deposit:query']">查看</el-button>
         </template>
       </el-table-column>
     </el-table>
     <!-- <Deposit-form ref="DepositRef" :get-list="getList" /> -->
-    <el-dialog
-      title="存款信息"
-      v-model="formOpen"
-      width="500px"
-      append-to-body
-      draggable
-      @close="formCancel"
-      :close-on-click-modal = "false"
-    >
+    <el-dialog title="存款信息" v-model="formOpen" width="500px" append-to-body draggable @close="formCancel"
+      :close-on-click-modal="false">
       <el-form ref="dictRef" :model="form" label-width="100" size="small">
         <el-row :gutter="30">
           <el-col :span="24">
             <el-form-item label="预存合同:">
-              <el-autocomplete
-                v-if="form.status == 0"
-                style="width: 60%"
-                :fetch-suggestions="querySearchEntrustOrderAsync"
-                :trigger-on-focus="true"
-                v-model="form.formNo"
-                placeholder="请输入客户名称"
-                popper-class="my-autocomplete"
-                @select="handleSelectEntrustOrder"
-              >
+              <el-autocomplete v-if="form.status == 0" style="width: 60%"
+                :fetch-suggestions="querySearchEntrustOrderAsync" :trigger-on-focus="true" v-model="form.formNo"
+                placeholder="请输入客户名称" popper-class="my-autocomplete" @select="handleSelectEntrustOrder">
                 <template #default="{ item }">
-                  <div
-                    style="
+                  <div style="
                       display: flex;
                       flex-direction: row;
                       justify-content: space-between;
-                    "
-                  >
+                    ">
                     <div class="name" style="font-size: 12px">
                       {{ item.formNo }}-{{ item.signingSubject }}
                     </div>
@@ -209,78 +92,32 @@
           </el-col>
           <el-col :span="24">
             <el-form-item label="存款金额:">
-              <el-input-number
-                style="width: 60%"
-                v-if="form.status == 0"
-                v-model="form.amount"
-                :precision="2"
-                :step="0.1"
-                :min="0"
-                :controls="false"
-              />
+              <el-input-number style="width: 60%" v-if="form.status == 0" v-model="form.amount" :precision="2"
+                :step="0.1" :min="0" :controls="false" />
               <div v-else>{{ rowNum(form.amount) }}</div>
             </el-form-item>
           </el-col>
           <el-col :span="24">
             <el-form-item label="凭证附件:">
               <div class="details-btns-container" style="display: flex">
-                <el-upload
-                  v-if="form.status == 0"
-                  action="#"
-                  :http-request="upload"
-                  :with-credentials="true"
-                  :show-file-list="false"
-                  multiple
-                >
-                  <el-button size="small" type="primary" icon="Upload"
-                    >点击上传</el-button
-                  >
+                <el-upload v-if="form.status == 0" action="#" :http-request="upload" :with-credentials="true"
+                  :show-file-list="false" multiple>
+                  <el-button size="small" type="primary" icon="Upload">点击上传</el-button>
                 </el-upload>
               </div>
-              <el-table
-                ref="filesTable"
-                :data="form.files"
-                size="small"
-                height="200px"
-                border
-                header-row-class-name="list-header-row"
-              >
-                <el-table-column
-                  type="index"
-                  label="序号"
-                  width="47"
-                  align="center"
-                />
-                <el-table-column
-                  label="文件名"
-                  prop="originalFileName"
-                  align="center"
-                >
+              <el-table ref="filesTable" :data="form.files" size="small" height="200px" border
+                header-row-class-name="list-header-row">
+                <el-table-column type="index" label="序号" width="47" align="center" />
+                <el-table-column label="文件名" prop="originalFileName" align="center">
                   <template #default="scope">
-                    <el-link
-                      :href="`${baseUrl}${scope.row.fileUrl}`"
-                      :underline="false"
-                      target="_blank"
-                      type="primary"
-                    >
+                    <el-link :href="`${baseUrl}${scope.row.fileUrl}`" :underline="false" target="_blank" type="primary">
                       {{ scope.row.originalFileName }}
                     </el-link>
                   </template>
                 </el-table-column>
-                <el-table-column
-                  v-if="form.status == 0"
-                  label="操作"
-                  width="47"
-                  align="center"
-                >
+                <el-table-column v-if="form.status == 0" label="操作" width="47" align="center">
                   <template #default="scope">
-                    <el-button
-                      link
-                      size="small"
-                      type="danger"
-                      @click="handleDelFile(scope.$index)"
-                      >删除</el-button
-                    >
+                    <el-button link size="small" type="danger" @click="handleDelFile(scope.$index)">删除</el-button>
                   </template>
                 </el-table-column>
               </el-table>
@@ -290,314 +127,299 @@
       </el-form>
       <template #footer>
         <div v-if="form.status == 0" class="dialog-footer">
-          <el-button
-            type="primary"
-            icon="Finished"
-            size="small"
-            @click="saveHandler"
-            >确 定</el-button
-          >
-          <el-button @click="formCancel" icon="close" size="small"
-            >取 消</el-button
-          >
+          <el-button type="primary" icon="Finished" size="small" @click="saveHandler">确 定</el-button>
+          <el-button @click="formCancel" icon="close" size="small">取 消</el-button>
         </div>
       </template>
     </el-dialog>
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
-    <el-image-viewer
-      v-if="showViewer"
-      :url-list="currentFileList"
-      @close="closeImages"
-      :initial-index="showIndex"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
+    <el-image-viewer v-if="showViewer" :url-list="currentFileList" @close="closeImages" :initial-index="showIndex" />
   </div>
 </template>
 
-<script setup name="Company">
-import {
-  listDeposit,
-  delDeposit,
-  exportDeposit,
-  addDeposit,
-  getDeposit,
-  updateDeposit,
-  listEntrustOrder,
-  verifyDeposit,
-} from "@/api/business/entrust/deposit";
-import { rowNum } from "@/utils/index";
-import { uploadFile } from "@/api/tool/file";
-import { listCompany } from "@/api/business/crm/company";
-import useUserStore from "@/store/modules/user";
-import { ref } from "vue";
-// import DepositForm from "./form"
-const { proxy } = getCurrentInstance();
-/** 字典数组区 */
-/** 查询 对象 */
-
-const orderList = ref([]);
-const loading = ref(true);
-const ids = ref([]);
-const single = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-const prev = ref([]);
-const baseUrl = ref(import.meta.env.VITE_APP_BASE_API);
-const showViewer = ref(false);
-const currentFileList = ref([]);
-const showIndex = ref(0);
-const permissions = useUserStore().permissions;
-const all_permission = "*:*:*";
-const formOpen = ref(false);
-
-const form = ref({
-  id: null,
-  companyName: "",
-  companyId: null,
-  remark: "",
-  status: 0,
-  type: 1,
-  files: [],
-});
-
-const emptyForm = {
-  status: 0,
-  id: null,
-  companyName: "",
-  companyId: null,
-  type: 1,
-  remark: "",
-  files: [],
-};
-
-const { verify_status } = proxy.useDict("verify_status");
-/** 查询对象 */
-const queryParams = ref({
-  pageNum: 1,
-  pageSize: 20,
-  companyName: "",
-  orderByColumn: "create_time",
-  noContract: 1,
-});
-
-/***********************  方法区  ****************************/
-
-/** 查询company列表 */
-function getList() {
-  loading.value = true;
-  listDeposit(queryParams.value).then((response) => {
-    orderList.value = response.rows.map((l) => ({ ...l }));
-    prev.value = proxy.deepClone(response.rows);
-    total.value = response.total;
-    loading.value = false;
+<script setup name="Deposit">
+  import {
+    listDeposit,
+    delDeposit,
+    exportDeposit,
+    addDeposit,
+    getDeposit,
+    updateDeposit,
+    listEntrustOrder,
+    verifyDeposit,
+  } from "@/api/business/entrust/deposit";
+  import { rowNum } from "@/utils/index";
+  import { uploadFile } from "@/api/tool/file";
+  import { listCompany } from "@/api/business/crm/company";
+  import useUserStore from "@/store/modules/user";
+  import { ref } from "vue";
+  // import DepositForm from "./form"
+  const { proxy } = getCurrentInstance();
+  /** 字典数组区 */
+  /** 查询 对象 */
+
+  const orderList = ref([]);
+  const loading = ref(true);
+  const ids = ref([]);
+  const single = ref(true);
+  const multiple = ref(true);
+  const total = ref(0);
+  const prev = ref([]);
+  const baseUrl = ref(import.meta.env.VITE_APP_BASE_API);
+  const showViewer = ref(false);
+  const currentFileList = ref([]);
+  const showIndex = ref(0);
+  const permissions = useUserStore().permissions;
+  const all_permission = "*:*:*";
+  const formOpen = ref(false);
+
+  const form = ref({
+    id: null,
+    companyName: "",
+    companyId: null,
+    remark: "",
+    status: 0,
+    type: 1,
+    files: [],
   });
-}
 
-//判断是否有权限
-function viewAdviser(quer) {
-  return permissions.includes(all_permission) || permissions.includes(quer);
-}
+  const emptyForm = {
+    status: 0,
+    id: null,
+    companyName: "",
+    companyId: null,
+    type: 1,
+    remark: "",
+    files: [],
+  };
+
+  const { verify_status } = proxy.useDict("verify_status");
+  /** 查询对象 */
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    companyName: "",
+    orderByColumn: "create_time",
+    noContract: 1,
+  });
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
-
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm("queryRef");
-  handleQuery();
-}
-
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  single.value = selection.length != 1;
-  multiple.value = !selection.length;
-}
-
-/** 新增按钮操作 */
-function handleAdd() {
-  // proxy.$refs.DepositRef.open();
-  formOpen.value = true;
-}
-
-function formCancel() {
-  formOpen.value = false;
-  reset();
-}
-
-function reset() {
-  form.value = proxy.deepClone(emptyForm);
-}
-
-/** 修改按钮操作 */
-function handleUpdate(row) {
-  // const id = row.id || ids.value;
-  // proxy.$refs.DepositRef.open(id);
-}
-
-/** 删除按钮操作 */
-function handleDelete(row) {
-  const _ids = row.id || ids.value;
-  proxy.$modal
-    .confirm("是否确认删除选中的数据项?")
-    .then(function () {
-      return delDeposit(_ids);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("删除成功!");
-    })
-    .catch(() => {});
-}
-
-/** 导出按钮操作 */
-function handleExport() {
-  exportDeposit(queryParams.value);
-}
-
-function startDateChangeHandler(row, startDate) {
-  if (startDate) {
-    // console.log(startDate)
-    row.endMonth = proxy
-      .moment(startDate)
-      .add(row.monthNum - 1, "M")
-      .format("YYYY-MM-DD");
-  } else row.endMonth = null;
-  console.log(row);
-}
-
-function handleSelectCompany(item) {
-  form.value.companyName = item.name;
-  form.value.companyId = item.id;
-}
-
-function saveHandler() {
-  if (
-    form.value.entrustOrderId == null ||
-    form.value.entrustOrderId === 0 ||
-    form.value.entrustOrderId === ""
-  ) {
-    proxy.$modal.msgError("请选择存款委托合同");
-    return;
+  /***********************  方法区  ****************************/
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
+  /** 查询company列表 */
+  function getList() {
+    loading.value = true;
+    listDeposit(queryParams.value).then((response) => {
+      orderList.value = response.rows.map((l) => ({ ...l }));
+      prev.value = proxy.deepClone(response.rows);
+      total.value = response.total;
+      loading.value = false;
+    });
   }
-  if (form.value.amount == null || form.value.amount === 0) {
-    proxy.$modal.msgError("请输入存款金额");
-    return;
+
+  //判断是否有权限
+  function viewAdviser(quer) {
+    return permissions.includes(all_permission) || permissions.includes(quer);
   }
-  if (form.value.files.length === 0) {
-    proxy.$modal.msgError("请上传凭证附件");
-    return;
+
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
   }
-  if (form.value.id == null) {
-    addDeposit(form.value).then((res) => {
-      formCancel();
-      getList();
-    });
-  } else {
-    updateDeposit(form.value).then((res) => {
-      console.log("新增", form.value);
 
-      formCancel();
-      getList();
-    });
+  /** 重置按钮操作 */
+  function resetQuery() {
+    proxy.resetForm("queryRef");
+    handleQuery();
   }
-}
-
-function upload(param) {
-  const formData = new FormData();
-  formData.append("file", param.file);
-  uploadFile(formData).then((res) => {
-    if (res.code === 200) {
-      const file = {};
-      file.fileName = res.newFileName;
-      file.url = res.url;
-      file.originalFileName = res.originalFilename;
-      file.fileUrl = res.fileName;
-      form.value.files.push(file);
+
+  // 多选框选中数据
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    single.value = selection.length != 1;
+    multiple.value = !selection.length;
+  }
+
+  /** 新增按钮操作 */
+  function handleAdd() {
+    // proxy.$refs.DepositRef.open();
+    formOpen.value = true;
+  }
+
+  function formCancel() {
+    formOpen.value = false;
+    reset();
+  }
+
+  function reset() {
+    form.value = proxy.deepClone(emptyForm);
+  }
+
+  /** 修改按钮操作 */
+  function handleUpdate(row) {
+    // const id = row.id || ids.value;
+    // proxy.$refs.DepositRef.open(id);
+  }
+
+  /** 删除按钮操作 */
+  function handleDelete(row) {
+    const _ids = row.id || ids.value;
+    proxy.$modal
+      .confirm("是否确认删除选中的数据项?")
+      .then(function () {
+        return delDeposit(_ids);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功!");
+      })
+      .catch(() => { });
+  }
+
+  /** 导出按钮操作 */
+  function handleExport() {
+    exportDeposit(queryParams.value);
+  }
+
+  function startDateChangeHandler(row, startDate) {
+    if (startDate) {
+      // console.log(startDate)
+      row.endMonth = proxy
+        .moment(startDate)
+        .add(row.monthNum - 1, "M")
+        .format("YYYY-MM-DD");
+    } else row.endMonth = null;
+    console.log(row);
+  }
+
+  function handleSelectCompany(item) {
+    form.value.companyName = item.name;
+    form.value.companyId = item.id;
+  }
+
+  function saveHandler() {
+    if (
+      form.value.entrustOrderId == null ||
+      form.value.entrustOrderId === 0 ||
+      form.value.entrustOrderId === ""
+    ) {
+      proxy.$modal.msgError("请选择存款委托合同");
+      return;
     }
-  });
-}
-
-function openFollowFile(arg) {
-  // console.log(arg)
-  const attach = arg;
-  window.open(`${arg.url}`, arg.fileName);
-}
-
-function showFileList(row) {
-  currentFileList.value = row.files.map((l) => `${baseUrl.value}${l.fileUrl}`);
-  showViewer.value = true;
-}
-
-function closeImages() {
-  showViewer.value = false;
-}
-
-function querySearchEntrustOrderAsync(queryString, cb) {
-  const query =
-    queryString.length > 0
-      ? {
+    if (form.value.amount == null || form.value.amount === 0) {
+      proxy.$modal.msgError("请输入存款金额");
+      return;
+    }
+    if (form.value.files.length === 0) {
+      proxy.$modal.msgError("请上传凭证附件");
+      return;
+    }
+    if (form.value.id == null) {
+      addDeposit(form.value).then((res) => {
+        formCancel();
+        getList();
+      });
+    } else {
+      updateDeposit(form.value).then((res) => {
+        console.log("新增", form.value);
+
+        formCancel();
+        getList();
+      });
+    }
+  }
+
+  function upload(param) {
+    const formData = new FormData();
+    formData.append("file", param.file);
+    uploadFile(formData).then((res) => {
+      if (res.code === 200) {
+        const file = {};
+        file.fileName = res.newFileName;
+        file.url = res.url;
+        file.originalFileName = res.originalFilename;
+        file.fileUrl = res.fileName;
+        form.value.files.push(file);
+      }
+    });
+  }
+
+  function openFollowFile(arg) {
+    // console.log(arg)
+    const attach = arg;
+    window.open(`${arg.url}`, arg.fileName);
+  }
+
+  function showFileList(row) {
+    currentFileList.value = row.files.map((l) => `${baseUrl.value}${l.fileUrl}`);
+    showViewer.value = true;
+  }
+
+  function closeImages() {
+    showViewer.value = false;
+  }
+
+  function querySearchEntrustOrderAsync(queryString, cb) {
+    const query =
+      queryString.length > 0
+        ? {
           keyword: queryString,
           pageSize: 20,
           pageNum: 1,
           status: 1,
           orderByColumn: "create_time",
         }
-      : { pageSize: 20, pageNum: 1, status: 1, orderByColumn: "create_time" };
-  listEntrustOrder(query).then((res) => {
-    cb(res.rows);
-  });
-}
-
-function handleSelectEntrustOrder(item) {
-  form.value.formNo = item.formNo;
-  form.value.tenantId = item.tenantId;
-  form.value.fromTenantId = item.fromTenantId;
-  form.value.entrustOrderId = item.id;
-  form.value.signingSubject = item.signingSubject;
-  form.value.contactCompany = item.contactCompany;
-}
-
-function handleInfo(row) {
-  formOpen.value = true;
-  getForm(row.id);
-}
-
-function getForm(id) {
-  getDeposit(id).then((res) => {
-    form.value = res.data;
-    if (form.value == null) {
-      reset();
-    }
-  });
-}
-
-function handleVerify(row, status) {
-  proxy.$modal
-    .confirm(`确认${status === 1 ? "审核通过" : "驳回"}么?`)
-    .then((_) => {
-      const saveValue = proxy.deepClone(row);
-      saveValue.status = status;
-      return verifyDeposit(saveValue);
-    })
-    .then((res) => {
-      getList();
+        : { pageSize: 20, pageNum: 1, status: 1, orderByColumn: "create_time" };
+    listEntrustOrder(query).then((res) => {
+      cb(res.rows);
+    });
+  }
+
+  function handleSelectEntrustOrder(item) {
+    form.value.formNo = item.formNo;
+    form.value.tenantId = item.tenantId;
+    form.value.fromTenantId = item.fromTenantId;
+    form.value.entrustOrderId = item.id;
+    form.value.signingSubject = item.signingSubject;
+    form.value.contactCompany = item.contactCompany;
+  }
+
+  function handleInfo(row) {
+    formOpen.value = true;
+    getForm(row.id);
+  }
+
+  function getForm(id) {
+    getDeposit(id).then((res) => {
+      form.value = res.data;
+      if (form.value == null) {
+        reset();
+      }
     });
-}
+  }
 
-function handleDelFile(index) {
-  form.value.files.splice(index, 1);
-}
+  function handleVerify(row, status) {
+    proxy.$modal
+      .confirm(`确认${status === 1 ? "审核通过" : "驳回"}么?`)
+      .then((_) => {
+        const saveValue = proxy.deepClone(row);
+        saveValue.status = status;
+        return verifyDeposit(saveValue);
+      })
+      .then((res) => {
+        getList();
+      });
+  }
 
-getList();
+  function handleDelFile(index) {
+    form.value.files.splice(index, 1);
+  }
+
+  getList();
 </script>
-<style></style>
+<style></style>

+ 316 - 457
src/views/business/entrust/depositOfFactory/index.vue

@@ -2,72 +2,30 @@
   <div class="page-container list-container">
     <!-- 功能按钮区 -->
     <div class="list-btns-container">
-      <el-button
-        type="success"
-        size="small"
-        icon="Refresh"
-        @click="getList"
-        v-hasPermi="['business:entrustOrder:remove']"
-        >刷新</el-button
-      >
+      <el-button type="success" size="small" icon="Refresh" @click="getList"
+        v-hasPermi="['business:entrustOrder:remove']">刷新</el-button>
       <el-dropdown trigger="click">
         <el-button type="primary" size="small">
           其它<el-icon class="el-icon--right"><arrow-down /></el-icon>
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
-            <el-dropdown-item
-              icon="Download"
-              @click="handleExport"
-              v-if="viewAdviser('business:deposit:export')"
-            >
-              导出</el-dropdown-item
-            >
+            <el-dropdown-item icon="Download" @click="handleExport" v-if="viewAdviser('business:deposit:export')">
+              导出</el-dropdown-item>
           </el-dropdown-menu>
         </template>
       </el-dropdown>
     </div>
 
     <!-- 列表区 -->
-    <el-table
-      v-loading="loading"
-      :data="orderList"
-      size="small"
-      border
-      height="100%"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="orderList" size="small" border height="100%"
+      @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column
-        align="center"
-        type="index"
-        label="序号"
-        width="50"
-      ></el-table-column>
-      <el-table-column
-        label="日期"
-        align="center"
-        prop="depositDate"
-        width="200"
-      />
-      <el-table-column
-        label="委托单号"
-        align="center"
-        prop="formNo"
-        width="120"
-      />
-      <el-table-column
-        label="预存单位"
-        align="center"
-        prop="contactCompany"
-        width="120"
-      />
-      <el-table-column
-        label="签约主体"
-        align="center"
-        prop="signingSubject"
-        width="120"
-      />
+      <el-table-column align="center" type="index" label="序号" width="50"></el-table-column>
+      <el-table-column label="日期" align="center" prop="depositDate" width="200" />
+      <el-table-column label="委托单号" align="center" prop="formNo" width="120" />
+      <el-table-column label="预存单位" align="center" prop="contactCompany" width="120" />
+      <el-table-column label="签约主体" align="center" prop="signingSubject" width="120" />
       <el-table-column label="金额" align="center" prop="amount" width="120">
         <template #default="scope">
           <span>{{ rowNum(scope.row.amount) }}</span>
@@ -75,13 +33,7 @@
       </el-table-column>
       <el-table-column label="附件" align="center" prop="files">
         <template #default="scope">
-          <el-button
-            link
-            type="primary"
-            size="small"
-            @click="showFileList(scope.row)"
-            >查看</el-button
-          >
+          <el-button link type="primary" size="small" @click="showFileList(scope.row)">查看</el-button>
         </template>
       </el-table-column>
       <el-table-column label="审核状态" align="center" width="80" prop="remark">
@@ -89,74 +41,33 @@
           <dict-tag :options="verify_status" :value="scope.row.status" />
         </template>
       </el-table-column>
-      <el-table-column
-        label="操作"
-        align="center"
-        prop="verifyStatus"
-        width="200"
-      >
+      <el-table-column label="操作" align="center" prop="verifyStatus" width="200">
         <template #default="scope">
-          <el-button
-            v-show="scope.row.status === 0"
-            link
-            type="warning"
-            size="small"
-            @click="handleVerify(scope.row, 1)"
-            v-hasPermi="['business:deposit:verify']"
-            >审核通过</el-button
-          >
-          <el-button
-            v-show="scope.row.status === 0"
-            link
-            type="danger"
-            size="small"
-            @click="handleVerify(scope.row, 4)"
-            v-hasPermi="['business:deposit:verify']"
-            >驳回</el-button
-          >
-          <el-button
-            v-show="scope.row.status !== 0"
-            link
-            type="success"
-            size="small"
-            @click="handleInfo(scope.row)"
-            v-hasPermi="['business:deposit:info']"
-            >查看</el-button
-          >
+          <el-button v-show="scope.row.status === 0" link type="warning" size="small"
+            @click="handleVerify(scope.row, 1)" v-hasPermi="['business:deposit:verify']">审核通过</el-button>
+          <el-button v-show="scope.row.status === 0" link type="danger" size="small" @click="handleVerify(scope.row, 4)"
+            v-hasPermi="['business:deposit:verify']">驳回</el-button>
+          <el-button v-show="scope.row.status !== 0" link type="success" size="small" @click="handleInfo(scope.row)"
+            v-hasPermi="['business:deposit:info']">查看</el-button>
         </template>
       </el-table-column>
     </el-table>
     <!-- <Deposit-form ref="DepositRef" :get-list="getList" /> -->
-    <el-dialog
-      title="存款信息"
-      v-model="formOpen"
-      width="500px"
-      append-to-body
-      draggable
-      @close="formCancel"
-      :close-on-click-modal = "false"
-    >
+    <el-dialog title="存款信息" v-model="formOpen" width="500px" append-to-body draggable @close="formCancel"
+      :close-on-click-modal="false">
       <el-form ref="dictRef" :model="form" label-width="100" size="small">
         <el-row :gutter="30">
           <el-col :span="24">
             <el-form-item label="预存合同:">
-              <el-autocomplete
-                v-if="form.status !== 1"
-                :fetch-suggestions="querySearchEntrustOrderAsync"
-                :trigger-on-focus="true"
-                v-model="form.formNo"
-                placeholder="请输入客户名称"
-                popper-class="my-autocomplete"
-                @select="handleSelectEntrustOrder"
-              >
+              <el-autocomplete v-if="form.status !== 1" :fetch-suggestions="querySearchEntrustOrderAsync"
+                :trigger-on-focus="true" v-model="form.formNo" placeholder="请输入客户名称" popper-class="my-autocomplete"
+                @select="handleSelectEntrustOrder">
                 <template #default="{ item }">
-                  <div
-                    style="
+                  <div style="
                       display: flex;
                       flex-direction: row;
                       justify-content: space-between;
-                    "
-                  >
+                    ">
                     <div class="name" style="font-size: 12px">
                       {{ item.formNo }}-{{ item.signingSubject }}
                     </div>
@@ -178,75 +89,30 @@
           </el-col>
           <el-col :span="24">
             <el-form-item label="存款金额:">
-              <el-input-number
-                v-if="form.status !== 1"
-                v-model="form.amount"
-                :precision="2"
-                :step="0.1"
-                :min="0"
-                :controls="false"
-              />
+              <el-input-number v-if="form.status !== 1" v-model="form.amount" :precision="2" :step="0.1" :min="0"
+                :controls="false" />
               <div v-else>{{ form.amount }}</div>
             </el-form-item>
           </el-col>
           <el-col :span="24">
             <el-form-item label="凭证附件:">
               <div class="details-btns-container" style="display: flex">
-                <el-upload
-                  v-if="form.status !== 1"
-                  action="#"
-                  :http-request="upload"
-                  :with-credentials="true"
-                  :show-file-list="false"
-                  multiple
-                >
-                  <el-button size="small" type="primary" icon="Upload"
-                    >点击上传</el-button
-                  >
+                <el-upload v-if="form.status !== 1" action="#" :http-request="upload" :with-credentials="true"
+                  :show-file-list="false" multiple>
+                  <el-button size="small" type="primary" icon="Upload">点击上传</el-button>
                 </el-upload>
               </div>
-              <el-table
-                ref="filesTable"
-                :data="form.files"
-                size="small"
-                height="200px"
-                border
-                header-row-class-name="list-header-row"
-              >
-                <el-table-column
-                  v-if="form.status !== 1"
-                  label="操作"
-                  width="47"
-                  align="center"
-                >
+              <el-table ref="filesTable" :data="form.files" size="small" height="200px" border
+                header-row-class-name="list-header-row">
+                <el-table-column v-if="form.status !== 1" label="操作" width="47" align="center">
                   <template #default="scope">
-                    <el-button
-                      icon="Minus"
-                      size="small"
-                      circle
-                      type="danger"
-                      @click="handleDelFile(scope.$index)"
-                    />
+                    <el-button icon="Minus" size="small" circle type="danger" @click="handleDelFile(scope.$index)" />
                   </template>
                 </el-table-column>
-                <el-table-column
-                  type="index"
-                  label="序号"
-                  width="47"
-                  align="center"
-                />
-                <el-table-column
-                  label="文件名"
-                  prop="originalFileName"
-                  align="center"
-                >
+                <el-table-column type="index" label="序号" width="47" align="center" />
+                <el-table-column label="文件名" prop="originalFileName" align="center">
                   <template #default="scope">
-                    <el-link
-                      :href="`${baseUrl}${scope.row.fileUrl}`"
-                      :underline="false"
-                      target="_blank"
-                      type="primary"
-                    >
+                    <el-link :href="`${baseUrl}${scope.row.fileUrl}`" :underline="false" target="_blank" type="primary">
                       {{ scope.row.originalFileName }}
                     </el-link>
                   </template>
@@ -264,307 +130,300 @@
       </template>
     </el-dialog>
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
     <free-amount-dialog ref="freeAmountDialogRef" :get-list="getList" />
-    <el-image-viewer
-      v-if="showViewer"
-      :url-list="currentFileList"
-      @close="closeImages"
-      :initial-index="showIndex"
-    />
+    <el-image-viewer v-if="showViewer" :url-list="currentFileList" @close="closeImages" :initial-index="showIndex" />
   </div>
 </template>
 
-<script setup name="Company">
-// import contractForm from "./form";
-import {
-  listDeposit,
-  delDeposit,
-  exportDeposit,
-  addDeposit,
-  getDeposit,
-  updateDeposit,
-  listEntrustOrder,
-  verifyDeposit,
-} from "@/api/business/entrust/deposit";
-// import ElImageViewer from 'element-plus/lib/components/image-viewer';
-import freeAmountDialog from "./freeAmountDialog.vue";
-import { uploadFile } from "@/api/tool/file";
-import { rowNum } from "@/utils/index";
-import { listCompany } from "@/api/business/crm/company";
-import useUserStore from "@/store/modules/user";
-import { ref } from "vue";
-// import DepositForm from "./form"
-const { proxy } = getCurrentInstance();
-/** 字典数组区 */
-/** 查询 对象 */
-
-const orderList = ref([]);
-const loading = ref(true);
-const ids = ref([]);
-const single = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-const permissions = useUserStore().permissions;
-const all_permission = "*:*:*";
-const prev = ref([]);
-const baseUrl = ref(import.meta.env.VITE_APP_BASE_API);
-const showViewer = ref(false);
-const currentFileList = ref([]);
-const showIndex = ref(0);
-const freeAmountDialogRef = ref(null);
-
-const formOpen = ref(false);
-
-const form = ref({
-  id: null,
-  companyName: "",
-  companyId: null,
-  remark: "",
-  type: 1,
-  files: [],
-});
-
-const emptyForm = {
-  id: null,
-  companyName: "",
-  companyId: null,
-  type: 1,
-  remark: "",
-  files: [],
-};
-
-const { verify_status } = proxy.useDict("verify_status");
-/** 查询对象 */
-const queryParams = ref({
-  pageNum: 1,
-  pageSize: 20,
-  companyName: "",
-  noContract: 1,
-});
-
-/***********************  方法区  ****************************/
-
-/** 查询company列表 */
-function getList() {
-  loading.value = true;
-  listDeposit(queryParams.value).then((response) => {
-    orderList.value = response.rows.map((l) => ({ ...l }));
-    prev.value = proxy.deepClone(response.rows);
-    total.value = response.total;
-    loading.value = false;
+<script setup name="PrevDeposit">
+  // import contractForm from "./form";
+  import {
+    listDeposit,
+    delDeposit,
+    exportDeposit,
+    addDeposit,
+    getDeposit,
+    updateDeposit,
+    listEntrustOrder,
+    verifyDeposit,
+  } from "@/api/business/entrust/deposit";
+  // import ElImageViewer from 'element-plus/lib/components/image-viewer';
+  import freeAmountDialog from "./freeAmountDialog.vue";
+  import { uploadFile } from "@/api/tool/file";
+  import { rowNum } from "@/utils/index";
+  import { listCompany } from "@/api/business/crm/company";
+  import useUserStore from "@/store/modules/user";
+  import { ref } from "vue";
+  // import DepositForm from "./form"
+  const { proxy } = getCurrentInstance();
+  /** 字典数组区 */
+  /** 查询 对象 */
+
+  const orderList = ref([]);
+  const loading = ref(true);
+  const ids = ref([]);
+  const single = ref(true);
+  const multiple = ref(true);
+  const total = ref(0);
+  const permissions = useUserStore().permissions;
+  const all_permission = "*:*:*";
+  const prev = ref([]);
+  const baseUrl = ref(import.meta.env.VITE_APP_BASE_API);
+  const showViewer = ref(false);
+  const currentFileList = ref([]);
+  const showIndex = ref(0);
+  const freeAmountDialogRef = ref(null);
+
+  const formOpen = ref(false);
+
+  const form = ref({
+    id: null,
+    companyName: "",
+    companyId: null,
+    remark: "",
+    type: 1,
+    files: [],
   });
-}
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
-
-//判断是否有权限
-function viewAdviser(quer) {
-  return permissions.includes(all_permission) || permissions.includes(quer);
-}
-
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm("queryRef");
-  handleQuery();
-}
-
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  single.value = selection.length != 1;
-  multiple.value = !selection.length;
-}
-
-/** 新增按钮操作 */
-function handleAdd() {
-  // proxy.$refs.DepositRef.open();
-  formOpen.value = true;
-}
-
-function formCancel() {
-  formOpen.value = false;
-  reset();
-}
-
-function reset() {
-  form.value = proxy.deepClone(emptyForm);
-}
-
-/** 修改按钮操作 */
-function handleUpdate(row) {
-  // const id = row.id || ids.value;
-  // proxy.$refs.DepositRef.open(id);
-}
-
-/** 删除按钮操作 */
-function handleDelete(row) {
-  const _ids = row.id || ids.value;
-  proxy.$modal
-    .confirm("是否确认删除选中的数据项?")
-    .then(function () {
-      return delDeposit(_ids);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("删除成功!");
-    })
-    .catch(() => {});
-}
-
-/** 导出按钮操作 */
-function handleExport() {
-  // proxy.download(
-  //   "business/archive/order/export",
-  //   {
-  //     ...queryParams.value,
-  //   },
-  //   `合同导出_${new Date().getTime()}.xlsx`
-  // );
-  exportDeposit(queryParams.value);
-}
-
-function startDateChangeHandler(row, startDate) {
-  if (startDate) {
-    // console.log(startDate)
-    row.endMonth = proxy
-      .moment(startDate)
-      .add(row.monthNum - 1, "M")
-      .format("YYYY-MM-DD");
-  } else row.endMonth = null;
-  console.log(row);
-}
-
-function handleSelectCompany(item) {
-  form.value.companyName = item.name;
-  form.value.companyId = item.id;
-}
-
-function saveHandler() {
-  if (
-    form.value.entrustOrderId == null ||
-    form.value.entrustOrderId === 0 ||
-    form.value.entrustOrderId === ""
-  ) {
-    proxy.$modal.msgError("请选择存款委托合同");
-    return;
+  const emptyForm = {
+    id: null,
+    companyName: "",
+    companyId: null,
+    type: 1,
+    remark: "",
+    files: [],
+  };
+
+  const { verify_status } = proxy.useDict("verify_status");
+  /** 查询对象 */
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    companyName: "",
+    noContract: 1,
+  });
+
+  /***********************  方法区  ****************************/
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
+  /** 查询company列表 */
+  function getList() {
+    loading.value = true;
+    listDeposit(queryParams.value).then((response) => {
+      orderList.value = response.rows.map((l) => ({ ...l }));
+      prev.value = proxy.deepClone(response.rows);
+      total.value = response.total;
+      loading.value = false;
+    });
   }
-  if (form.value.amount == null || form.value.amount === 0) {
-    proxy.$modal.msgError("请输入存款金额");
-    return;
+
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
   }
-  if (form.value.files.length === 0) {
-    proxy.$modal.msgError("请上传凭证附件");
-    return;
+
+  //判断是否有权限
+  function viewAdviser(quer) {
+    return permissions.includes(all_permission) || permissions.includes(quer);
   }
-  if (form.value.id == null) {
-    addDeposit(form.value).then((res) => {
-      formCancel();
-      getList();
-    });
-  } else {
-    updateDeposit(form.value).then((res) => {
-      console.log("新增", form.value);
 
-      formCancel();
-      getList();
-    });
+  /** 重置按钮操作 */
+  function resetQuery() {
+    proxy.resetForm("queryRef");
+    handleQuery();
+  }
+
+  // 多选框选中数据
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    single.value = selection.length != 1;
+    multiple.value = !selection.length;
   }
-}
-
-function upload(param) {
-  const formData = new FormData();
-  formData.append("file", param.file);
-  uploadFile(formData).then((res) => {
-    if (res.code === 200) {
-      const file = {};
-      file.fileName = res.newFileName;
-      file.url = res.url;
-      file.originalFileName = res.originalFilename;
-      file.fileUrl = res.fileName;
-      form.value.files.push(file);
-    }
-  });
-}
-
-function openFollowFile(arg) {
-  // console.log(arg)
-  const attach = arg;
-  window.open(`${arg.url}`, arg.fileName);
-}
-
-function showFileList(row) {
-  currentFileList.value = row.files.map((l) => `${baseUrl.value}${l.fileUrl}`);
-  showViewer.value = true;
-}
-
-function closeImages() {
-  showViewer.value = false;
-}
-
-function querySearchEntrustOrderAsync(queryString, cb) {
-  const query =
-    queryString.length > 0
-      ? { keyword: queryString, pageSize: 20, pageNum: 1, status: 1 }
-      : { pageSize: 20, pageNum: 1, status: 1 };
-  listEntrustOrder(query).then((res) => {
-    cb(res.rows);
-  });
-}
-
-function handleSelectEntrustOrder(item) {
-  form.value.formNo = item.formNo;
-  form.value.tenantId = item.tenantId;
-  form.value.fromTenantId = item.fromTenantId;
-  form.value.entrustOrderId = item.id;
-  form.value.signingSubject = item.signingSubject;
-  form.value.contactCompany = item.contactCompany;
-}
-
-function handleInfo(row) {
-  formOpen.value = true;
-  getForm(row.id);
-}
-
-function getForm(id) {
-  getDeposit(id).then((res) => {
-    form.value = res.data;
-    if (form.value == null) {
-      reset();
-    }
-  });
-}
 
-function handleVerify(row, status) {
-  if (status === 1) {
-    freeAmountDialogRef.value.open(row);
-  } else {
+  /** 新增按钮操作 */
+  function handleAdd() {
+    // proxy.$refs.DepositRef.open();
+    formOpen.value = true;
+  }
+
+  function formCancel() {
+    formOpen.value = false;
+    reset();
+  }
+
+  function reset() {
+    form.value = proxy.deepClone(emptyForm);
+  }
+
+  /** 修改按钮操作 */
+  function handleUpdate(row) {
+    // const id = row.id || ids.value;
+    // proxy.$refs.DepositRef.open(id);
+  }
+
+  /** 删除按钮操作 */
+  function handleDelete(row) {
+    const _ids = row.id || ids.value;
     proxy.$modal
-      .confirm(`确认${status === 1 ? "审核通过" : "驳回"}么?`)
-      .then((_) => {
-        const saveValue = proxy.deepClone(row);
-        saveValue.status = status;
-        return verifyDeposit(saveValue);
+      .confirm("是否确认删除选中的数据项?")
+      .then(function () {
+        return delDeposit(_ids);
       })
-      .then((res) => {
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功!");
+      })
+      .catch(() => { });
+  }
+
+  /** 导出按钮操作 */
+  function handleExport() {
+    // proxy.download(
+    //   "business/archive/order/export",
+    //   {
+    //     ...queryParams.value,
+    //   },
+    //   `合同导出_${new Date().getTime()}.xlsx`
+    // );
+    exportDeposit(queryParams.value);
+  }
+
+  function startDateChangeHandler(row, startDate) {
+    if (startDate) {
+      // console.log(startDate)
+      row.endMonth = proxy
+        .moment(startDate)
+        .add(row.monthNum - 1, "M")
+        .format("YYYY-MM-DD");
+    } else row.endMonth = null;
+    console.log(row);
+  }
+
+  function handleSelectCompany(item) {
+    form.value.companyName = item.name;
+    form.value.companyId = item.id;
+  }
+
+  function saveHandler() {
+    if (
+      form.value.entrustOrderId == null ||
+      form.value.entrustOrderId === 0 ||
+      form.value.entrustOrderId === ""
+    ) {
+      proxy.$modal.msgError("请选择存款委托合同");
+      return;
+    }
+    if (form.value.amount == null || form.value.amount === 0) {
+      proxy.$modal.msgError("请输入存款金额");
+      return;
+    }
+    if (form.value.files.length === 0) {
+      proxy.$modal.msgError("请上传凭证附件");
+      return;
+    }
+    if (form.value.id == null) {
+      addDeposit(form.value).then((res) => {
+        formCancel();
         getList();
       });
+    } else {
+      updateDeposit(form.value).then((res) => {
+        console.log("新增", form.value);
+
+        formCancel();
+        getList();
+      });
+    }
+  }
+
+  function upload(param) {
+    const formData = new FormData();
+    formData.append("file", param.file);
+    uploadFile(formData).then((res) => {
+      if (res.code === 200) {
+        const file = {};
+        file.fileName = res.newFileName;
+        file.url = res.url;
+        file.originalFileName = res.originalFilename;
+        file.fileUrl = res.fileName;
+        form.value.files.push(file);
+      }
+    });
+  }
+
+  function openFollowFile(arg) {
+    // console.log(arg)
+    const attach = arg;
+    window.open(`${arg.url}`, arg.fileName);
+  }
+
+  function showFileList(row) {
+    currentFileList.value = row.files.map((l) => `${baseUrl.value}${l.fileUrl}`);
+    showViewer.value = true;
+  }
+
+  function closeImages() {
+    showViewer.value = false;
+  }
+
+  function querySearchEntrustOrderAsync(queryString, cb) {
+    const query =
+      queryString.length > 0
+        ? { keyword: queryString, pageSize: 20, pageNum: 1, status: 1 }
+        : { pageSize: 20, pageNum: 1, status: 1 };
+    listEntrustOrder(query).then((res) => {
+      cb(res.rows);
+    });
+  }
+
+  function handleSelectEntrustOrder(item) {
+    form.value.formNo = item.formNo;
+    form.value.tenantId = item.tenantId;
+    form.value.fromTenantId = item.fromTenantId;
+    form.value.entrustOrderId = item.id;
+    form.value.signingSubject = item.signingSubject;
+    form.value.contactCompany = item.contactCompany;
+  }
+
+  function handleInfo(row) {
+    formOpen.value = true;
+    getForm(row.id);
   }
-}
 
-function handleDelFile(index) {
-  form.value.files.splice(index, 1);
-}
+  function getForm(id) {
+    getDeposit(id).then((res) => {
+      form.value = res.data;
+      if (form.value == null) {
+        reset();
+      }
+    });
+  }
+
+  function handleVerify(row, status) {
+    if (status === 1) {
+      freeAmountDialogRef.value.open(row);
+    } else {
+      proxy.$modal
+        .confirm(`确认${status === 1 ? "审核通过" : "驳回"}么?`)
+        .then((_) => {
+          const saveValue = proxy.deepClone(row);
+          saveValue.status = status;
+          return verifyDeposit(saveValue);
+        })
+        .then((res) => {
+          getList();
+        });
+    }
+  }
+
+  function handleDelFile(index) {
+    form.value.files.splice(index, 1);
+  }
 
-getList();
-</script>
+  getList();
+</script>

+ 177 - 294
src/views/business/entrust/entrustOrder/index.vue

@@ -2,345 +2,228 @@
   <div class="page-container list-container">
     <!-- 功能按钮区 -->
     <div class="list-btns-container">
-      <el-button
-        type="primary"
-        size="small"
-        icon="Plus"
-        @click="handleAdd"
-        v-show="handleVerifi()"
-        v-hasPermi="['business:entrustOrder:add']"
-        >新增</el-button
-      >
-      <el-button
-        type="danger"
-        size="small"
-        icon="Delete"
-        :disabled="!multiple"
-        @click="handleDelete"
-        v-hasPermi="['business:entrustOrder:remove']"
-        >删除</el-button
-      >
-      <el-button
-        type="success"
-        size="small"
-        icon="Refresh"
-        @click="getList"
-        v-hasPermi="['business:entrustOrder:remove']"
-        >刷新</el-button
-      >
+      <el-button type="primary" size="small" icon="Plus" @click="handleAdd" v-show="handleVerifi()"
+        v-hasPermi="['business:entrustOrder:add']">新增</el-button>
+      <el-button type="danger" size="small" icon="Delete" :disabled="!multiple" @click="handleDelete"
+        v-hasPermi="['business:entrustOrder:remove']">删除</el-button>
+      <el-button type="success" size="small" icon="Refresh" @click="getList"
+        v-hasPermi="['business:entrustOrder:remove']">刷新</el-button>
       <el-dropdown trigger="click">
         <el-button type="primary" size="small">
           其它<el-icon class="el-icon--right"><arrow-down /></el-icon>
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
-            <el-dropdown-item
-              icon="Download"
-              @click="handleExport"
-              v-hasPermi="['business:entrustOrder:export']"
-            >
-              导出</el-dropdown-item
-            >
+            <el-dropdown-item icon="Download" @click="handleExport" v-hasPermi="['business:entrustOrder:export']">
+              导出</el-dropdown-item>
           </el-dropdown-menu>
         </template>
       </el-dropdown>
     </div>
     <!-- 搜索区 -->
-    <el-form
-      class="list-search-container"
-      size="small"
-      :model="queryParams"
-      ref="queryRef"
-      :inline="true"
-      label-width="68px"
-      @submit.native.prevent
-    >
+    <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
+      label-width="68px" @submit.native.prevent>
       <el-form-item label="往来单位:" prop="contactCompany">
-        <el-input
-          v-model="queryParams.contactCompany"
-          placeholder="请输入往来单位"
-          style="width: 150px"
-          clearable
-          @keyup.enter="handleQuery"
-        />
+        <el-input v-model="queryParams.contactCompany" placeholder="请输入往来单位" style="width: 150px" clearable
+          @keyup.enter="handleQuery" />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="Search" @click="handleQuery"
-          >搜索</el-button
-        >
+        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
         <el-button icon="Refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
 
     <!-- 列表区 -->
-    <el-table
-      v-loading="loading"
-      :data="list"
-      size="small"
-      border
-      height="100%"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="list" size="small" border height="100%"
+      @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column
-        label="签约主体"
-        align="center"
-        min-width="150"
-        prop="signingSubject"
-      />
-      <el-table-column
-        label="签约日期"
-        align="center"
-        prop="formDate"
-        min-width="80"
-      />
-      <el-table-column
-        label="合同编号"
-        align="center"
-        prop="formNo"
-        min-width="150"
-      >
+      <el-table-column label="签约主体" align="center" min-width="150" prop="signingSubject" />
+      <el-table-column label="签约日期" align="center" prop="formDate" min-width="80" />
+      <el-table-column label="合同编号" align="center" prop="formNo" min-width="150">
       </el-table-column>
-      <el-table-column
-        label="往来单位"
-        align="center"
-        prop="contactCompany"
-        min-width="150"
-      >
+      <el-table-column label="往来单位" align="center" prop="contactCompany" min-width="150">
       </el-table-column>
-      <el-table-column
-        label="预存金额"
-        prop="depositAmount"
-        header-align="center"
-        align="right"
-        min-width="80"
-      >
+      <el-table-column label="预存金额" prop="depositAmount" header-align="center" align="right" min-width="80">
         <template #default="scope">
           <span>{{ rowNum(scope.row.depositAmount) }}</span>
         </template>
       </el-table-column>
-      <el-table-column
-        label="结余金额"
-        prop="remainAmount"
-        header-align="center"
-        align="right"
-        min-width="80"
-        ><template #default="scope">
+      <el-table-column label="结余金额" prop="remainAmount" header-align="center" align="right" min-width="80"><template
+          #default="scope">
           <span>{{ rowNum(scope.row.remainAmount) }}</span>
         </template>
       </el-table-column>
-      <el-table-column
-        label="状态"
-        prop="status"
-        align="center"
-        minm-width="100"
-      >
+      <el-table-column label="状态" prop="status" align="center" minm-width="100">
         <template #default="scope">
           <dict-tag :options="entrust_order_status" :value="scope.row.status" />
         </template>
       </el-table-column>
-      <el-table-column
-        label="操作"
-        align="center"
-        min-width="150"
-        class-name="small-padding fixed-width"
-      >
+      <el-table-column label="操作" align="center" min-width="150" class-name="small-padding fixed-width">
         <template #default="scope">
-          <el-button
-            link
-            type="primary"
-            size="small"
-            @click="handleUpdate(scope.row.id)"
-            v-hasPermi="['business:entrustOrder:query']"
-            >详情</el-button
-          >
-          <el-button
-            v-show="scope.row.status === 0"
-            link
-            type="primary"
-            size="small"
-            @click="handleConfirm(scope.row)"
-            v-hasPermi="['business:entrustOrder:confirm']"
-            >确认订单</el-button
-          >
-          <el-button
-            v-show="scope.row.status === 1"
-            link
-            type="primary"
-            size="small"
-            @click="handleFinished(scope.row)"
-            v-hasPermi="['business:entrustOrder:finished']"
-            >确认完结</el-button
-          >
-
-          <router-link
-            v-if="scope.row.status !== 0"
-            :to="'/entrust/statusment/order/' + scope.row.id"
-            class="link-type"
-          >
-            <el-button
-              link
-              size="small"
-              style="margin-left: 10px"
-              type="primary"
-              v-hasPermi="['business:entrustOrder:statement:list']"
-              >对账单列表</el-button
-            >
+          <el-button link type="primary" size="small" @click="handleUpdate(scope.row.id)"
+            v-hasPermi="['business:entrustOrder:query']">详情</el-button>
+          <el-button v-show="scope.row.status === 0" link type="primary" size="small" @click="handleConfirm(scope.row)"
+            v-hasPermi="['business:entrustOrder:confirm']">确认订单</el-button>
+          <el-button v-show="scope.row.status === 1" link type="primary" size="small" @click="handleFinished(scope.row)"
+            v-hasPermi="['business:entrustOrder:finished']">确认完结</el-button>
+
+          <router-link v-if="scope.row.status !== 0" :to="'/entrust/statusment/order/' + scope.row.id"
+            class="link-type">
+            <el-button link size="small" style="margin-left: 10px" type="primary"
+              v-hasPermi="['business:entrustOrder:statement:list']">对账单列表</el-button>
           </router-link>
         </template>
       </el-table-column>
     </el-table>
     <entrust-order-form ref="entrustOrderFormRef" :getList="getList" />
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
   </div>
 </template>
 
-<script setup name="Company">
-import {
-  listEntrustOrder,
-  exportEntrustOrder,
-  delEntrustOrder,
-  confirmEntrustOrder,
-  finishedEntrustOrder,
-} from "@/api/business/entrust/entrustOrder";
-import entrustOrderForm from "./form";
-import useUserStore from "@/store/modules/user";
-import { rowNum } from "@/utils/index";
-const permissions = useUserStore().permissions;
-const all_permission = "*:*:*";
-const { proxy } = getCurrentInstance();
-/** 字典数组区 */
-/** 查询 对象 */
-
-const list = ref([]);
-const loading = ref(true);
-const ids = ref([]);
-const selections = ref([]);
-const single = ref(false);
-const multiple = ref(false);
-const total = ref(0);
-const prev = ref([]);
-const entrustOrderFormRef = ref(null);
-
-const setEntrustDialogRef = ref(null);
-
-const { entrust_order_status } = proxy.useDict("entrust_order_status");
-/** 查询对象 */
-const queryParams = ref({
-  pageNum: 1,
-  pageSize: 20,
-  contactCompany: "",
-  orderByColumn: "create_time",
-  type: 2,
-});
-
-const editStatus = {
-  startMonth: false,
-};
-
-/***********************  方法区  ****************************/
-
-/** 查询company列表 */
-function getList() {
-  loading.value = true;
-  listEntrustOrder(queryParams.value).then((response) => {
-    list.value = response.rows;
-    total.value = response.total;
-    loading.value = false;
+<script setup name="EntrustOrder">
+  import {
+    listEntrustOrder,
+    exportEntrustOrder,
+    delEntrustOrder,
+    confirmEntrustOrder,
+    finishedEntrustOrder,
+  } from "@/api/business/entrust/entrustOrder";
+  import entrustOrderForm from "./form";
+  import useUserStore from "@/store/modules/user";
+  import { rowNum } from "@/utils/index";
+  const permissions = useUserStore().permissions;
+  const all_permission = "*:*:*";
+  const { proxy } = getCurrentInstance();
+  /** 字典数组区 */
+  /** 查询 对象 */
+
+  const list = ref([]);
+  const loading = ref(true);
+  const ids = ref([]);
+  const selections = ref([]);
+  const single = ref(false);
+  const multiple = ref(false);
+  const total = ref(0);
+  const prev = ref([]);
+  const entrustOrderFormRef = ref(null);
+
+  const setEntrustDialogRef = ref(null);
+
+  const { entrust_order_status } = proxy.useDict("entrust_order_status");
+  /** 查询对象 */
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    contactCompany: "",
+    orderByColumn: "create_time",
+    type: 2,
   });
-}
-
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
-
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm("queryRef");
-  handleQuery();
-}
 
-//验证当前版本
-function handleVerifi() {
-  return (
-    permissions.includes(all_permission) ||
-    useUserStore().tenant.versionId == "4"
-  );
-}
+  const editStatus = {
+    startMonth: false,
+  };
 
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  selections.value = selection;
-  single.value = selection.length != 1;
-  multiple.value = selection.length > 0;
-}
-
-/** 导出按钮操作 */
-function handleExport() {
-  exportEntrustOrder(queryParams.value);
-}
-
-/** 新增按钮操作 */
-function handleAdd() {
-  entrustOrderFormRef.value.open();
-}
-
-function handleUpdate(id) {
-  entrustOrderFormRef.value.open(id);
-}
-
-/** 删除按钮操作 */
-function handleDelete(row) {
-  const _ids = row.id || ids.value;
-  proxy.$modal
-    .confirm("是否确认删除选中的数据项?")
-    .then(function () {
-      return delEntrustOrder(_ids);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("删除成功!");
-    })
-    .catch(() => {});
-}
-
-function handleConfirm(row) {
-  proxy.$modal
-    .confirm("确认启用该合同?")
-    .then((_) => {
-      return confirmEntrustOrder(row);
-    })
-    .then((res) => {
-      console.log(res);
-      getList();
-      proxy.$modal.msgSuccess("确认成功");
-    });
-}
-
-function handleFinished(row) {
-  proxy.$modal
-    .confirm("确认完结该合同?")
-    .then((_) => {
-      return finishedEntrustOrder(row);
-    })
-    .then((res) => {
-      console.log(res);
-      getList();
-      proxy.$modal.msgSuccess("完结成功");
+  /***********************  方法区  ****************************/
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
+  /** 查询company列表 */
+  function getList() {
+    loading.value = true;
+    listEntrustOrder(queryParams.value).then((response) => {
+      list.value = response.rows;
+      total.value = response.total;
+      loading.value = false;
     });
-}
+  }
+
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
+  }
+
+  /** 重置按钮操作 */
+  function resetQuery() {
+    proxy.resetForm("queryRef");
+    handleQuery();
+  }
+
+  //验证当前版本
+  function handleVerifi() {
+    return (
+      permissions.includes(all_permission) ||
+      useUserStore().tenant.versionId == "4"
+    );
+  }
+
+  // 多选框选中数据
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    selections.value = selection;
+    single.value = selection.length != 1;
+    multiple.value = selection.length > 0;
+  }
+
+  /** 导出按钮操作 */
+  function handleExport() {
+    exportEntrustOrder(queryParams.value);
+  }
+
+  /** 新增按钮操作 */
+  function handleAdd() {
+    entrustOrderFormRef.value.open();
+  }
+
+  function handleUpdate(id) {
+    entrustOrderFormRef.value.open(id);
+  }
+
+  /** 删除按钮操作 */
+  function handleDelete(row) {
+    const _ids = row.id || ids.value;
+    proxy.$modal
+      .confirm("是否确认删除选中的数据项?")
+      .then(function () {
+        return delEntrustOrder(_ids);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功!");
+      })
+      .catch(() => { });
+  }
+
+  function handleConfirm(row) {
+    proxy.$modal
+      .confirm("确认启用该合同?")
+      .then((_) => {
+        return confirmEntrustOrder(row);
+      })
+      .then((res) => {
+        console.log(res);
+        getList();
+        proxy.$modal.msgSuccess("确认成功");
+      });
+  }
+
+  function handleFinished(row) {
+    proxy.$modal
+      .confirm("确认完结该合同?")
+      .then((_) => {
+        return finishedEntrustOrder(row);
+      })
+      .then((res) => {
+        console.log(res);
+        getList();
+        proxy.$modal.msgSuccess("完结成功");
+      });
+  }
+
+  function handleViewAccountment(row) { }
 
-function handleViewAccountment(row) {}
-
-getList();
-</script>
+  getList();
+</script>

+ 210 - 282
src/views/business/entrust/statementAccount/index.vue

@@ -1,59 +1,26 @@
 <template>
   <div class="page-container list-container">
     <div class="list-btns-container">
-      <el-button
-        v-show="info.status !== 2"
-        type="primary"
-        size="small"
-        icon="Plus"
-        @click="handleAdd"
-        v-hasPermi="['business:deduct:add']"
-        >生成新对账单</el-button
-      >
+      <el-button v-show="info.status !== 2" type="primary" size="small" icon="Plus" @click="handleAdd"
+        v-hasPermi="['business:deduct:add']">生成新对账单</el-button>
 
       <el-button size="small" icon="Close" @click="handleClose">关闭</el-button>
     </div>
 
     <!-- 搜索区 -->
-    <el-form
-      class="list-search-container"
-      size="small"
-      :model="queryParams"
-      ref="queryRef"
-      :inline="true"
-      label-width="68px"
-    >
+    <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
+      label-width="68px">
       <el-form-item label="对账日期:" size="small" prop="dictLabel">
-        <el-date-picker
-          clearable
-          size="small"
-          v-model="queryParams.formDate"
-          type="date"
-          value-format="YYYY-MM-DD"
-          placeholder="请选择签约日期"
-        ></el-date-picker>
+        <el-date-picker clearable size="small" v-model="queryParams.formDate" type="date" value-format="YYYY-MM-DD"
+          placeholder="请选择签约日期"></el-date-picker>
       </el-form-item>
       <el-form-item>
-        <el-button
-          type="primary"
-          size="small"
-          icon="Search"
-          @click="handleQuery"
-          >搜索</el-button
-        >
-        <el-button icon="Refresh" size="small" @click="resetQuery"
-          >重置</el-button
-        >
+        <el-button type="primary" size="small" icon="Search" @click="handleQuery">搜索</el-button>
+        <el-button icon="Refresh" size="small" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
-    <el-table
-      v-loading="loading"
-      :data="dataList"
-      height="100%"
-      size="small"
-      border
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="dataList" height="100%" size="small" border
+      @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="对账日期" align="center" prop="statementDate" />
       <el-table-column label="委托单号" align="center" prop="formNo">
@@ -66,272 +33,233 @@
       </el-table-column>
       <el-table-column label="状态" align="center" prop="status">
         <template #default="scope">
-          <dict-tag
-            :options="entrust_deduct_status"
-            :value="scope.row.status"
-          />
+          <dict-tag :options="entrust_deduct_status" :value="scope.row.status" />
         </template>
       </el-table-column>
-      <el-table-column
-        label="备注"
-        align="center"
-        prop="remark"
-        :show-overflow-tooltip="true"
-      />
-      <el-table-column
-        label="操作"
-        align="center"
-        width="160"
-        class-name="small-padding fixed-width"
-      >
+      <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
+      <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
         <template #default="scope">
-          <el-button
-            v-show="scope.row.status !== 2"
-            link
-            size="small"
-            type="warning"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['business:deduct:edit']"
-            >查看</el-button
-          >
-          <el-button
-            v-show="scope.row.status !== 2"
-            link
-            size="small"
-            type="danger"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['business:deduct:remove']"
-            >删除</el-button
-          >
-          <el-button
-            v-show="scope.row.status === 2"
-            link
-            size="small"
-            type="primary"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['business:deduct:info']"
-            >查看</el-button
-          >
+          <el-button v-show="scope.row.status !== 2" link size="small" type="warning" @click="handleUpdate(scope.row)"
+            v-hasPermi="['business:deduct:edit']">查看</el-button>
+          <el-button v-show="scope.row.status !== 2" link size="small" type="danger" @click="handleDelete(scope.row)"
+            v-hasPermi="['business:deduct:remove']">删除</el-button>
+          <el-button v-show="scope.row.status === 2" link size="small" type="primary" @click="handleUpdate(scope.row)"
+            v-hasPermi="['business:deduct:info']">查看</el-button>
         </template>
       </el-table-column>
     </el-table>
     <statement-account-form ref="statementAccountFormRef" :get-list="getList" />
-    <choice-month-dialog
-      ref="choiceMonthDialogRef"
-      @confirm="monthConfirmHandler"
-    />
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <choice-month-dialog ref="choiceMonthDialogRef" @confirm="monthConfirmHandler" />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
   </div>
 </template>
 
 <script setup name="Data">
-import {
-  listDeduct,
-  delDeduct,
-  exportDeduct,
-  checkStatementAccount,
-  getEntrustOrder,
-} from "@/api/business/entrust/deduct";
-import statementAccountForm from "./form.vue";
-import ChoiceMonthDialog from "./ChoiceMonthDialog.vue";
+  import {
+    listDeduct,
+    delDeduct,
+    exportDeduct,
+    checkStatementAccount,
+    getEntrustOrder,
+  } from "@/api/business/entrust/deduct";
+  import statementAccountForm from "./form.vue";
+  import ChoiceMonthDialog from "./ChoiceMonthDialog.vue";
 
-const { proxy } = getCurrentInstance();
-const { entrust_deduct_status } = proxy.useDict("entrust_deduct_status");
-const info = ref({});
+  const { proxy } = getCurrentInstance();
+  const { entrust_deduct_status } = proxy.useDict("entrust_deduct_status");
+  const info = ref({});
 
-const dataList = ref([]);
-const open = ref(false);
-const loading = ref(true);
-const showSearch = ref(true);
-const ids = ref([]);
-const single = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-const title = ref("");
-const defaultDictType = ref("");
-const typeOptions = ref([]);
+  const dataList = ref([]);
+  const open = ref(false);
+  const loading = ref(true);
+  const showSearch = ref(true);
+  const ids = ref([]);
+  const single = ref(true);
+  const multiple = ref(true);
+  const total = ref(0);
+  const title = ref("");
+  const defaultDictType = ref("");
+  const typeOptions = ref([]);
 
-const statementAccountFormRef = ref(null);
-const choiceMonthDialogRef = ref(null);
+  const statementAccountFormRef = ref(null);
+  const choiceMonthDialogRef = ref(null);
 
-const route = useRoute();
-const webHost = import.meta.env.VITE_APP_BASE_API;
+  const route = useRoute();
+  const webHost = import.meta.env.VITE_APP_BASE_API;
 
-// 数据标签回显样式
-const listClassOptions = ref([
-  { value: "default", label: "默认" },
-  { value: "primary", label: "主要" },
-  { value: "success", label: "成功" },
-  { value: "info", label: "信息" },
-  { value: "warning", label: "警告" },
-  { value: "danger", label: "危险" },
-]);
+  // 数据标签回显样式
+  const listClassOptions = ref([
+    { value: "default", label: "默认" },
+    { value: "primary", label: "主要" },
+    { value: "success", label: "成功" },
+    { value: "info", label: "信息" },
+    { value: "warning", label: "警告" },
+    { value: "danger", label: "危险" },
+  ]);
 
-const data = reactive({
-  form: {},
-  queryParams: {
-    pageNum: 1,
-    orderByColumn: "create_time",
-    pageSize: 20,
-    entrustOrderId: null,
-  },
-  rules: {
-    dictLabel: [
-      { required: true, message: "数据标签不能为空", trigger: "blur" },
-    ],
-    dictValue: [
-      { required: true, message: "数据键值不能为空", trigger: "blur" },
-    ],
-    dictSort: [
-      { required: true, message: "数据顺序不能为空", trigger: "blur" },
-    ],
-  },
-});
-
-const { queryParams, form, rules } = toRefs(data);
-
-/** 查询字典类型详细 */
-function setEntrustOrder(id) {
-  queryParams.value.entrustOrderId = id;
-  getInfo(id);
-  getList();
-}
-
-function getInfo(id) {
-  getEntrustOrder(id).then((res) => {
-    info.value = res.data;
+  const data = reactive({
+    form: {},
+    queryParams: {
+      pageNum: 1,
+      orderByColumn: "create_time",
+      pageSize: 20,
+      entrustOrderId: null,
+    },
+    rules: {
+      dictLabel: [
+        { required: true, message: "数据标签不能为空", trigger: "blur" },
+      ],
+      dictValue: [
+        { required: true, message: "数据键值不能为空", trigger: "blur" },
+      ],
+      dictSort: [
+        { required: true, message: "数据顺序不能为空", trigger: "blur" },
+      ],
+    },
   });
-}
 
-/** 查询字典数据列表 */
-function getList() {
-  loading.value = true;
-  listDeduct(queryParams.value).then((response) => {
-    dataList.value = response.rows;
-    total.value = response.total;
-    loading.value = false;
+  const { queryParams, form, rules } = toRefs(data);
+  onActivated(() => {
+    // 你的逻辑
+    getList();
   });
-}
-/** 取消按钮 */
-function cancel() {
-  open.value = false;
-  reset();
-}
-/** 表单重置 */
-function reset() {
-  form.value = {
-    dictCode: undefined,
-    dictLabel: undefined,
-    dictValue: undefined,
-    cssClass: undefined,
-    listClass: "default",
-    dictSort: 0,
-    status: "0",
-    remark: undefined,
-  };
-  proxy.resetForm("dataRef");
-}
+  /** 查询字典类型详细 */
+  function setEntrustOrder(id) {
+    queryParams.value.entrustOrderId = id;
+    getInfo(id);
+    getList();
+  }
+
+  function getInfo(id) {
+    getEntrustOrder(id).then((res) => {
+      info.value = res.data;
+    });
+  }
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
+  /** 查询字典数据列表 */
+  function getList() {
+    loading.value = true;
+    listDeduct(queryParams.value).then((response) => {
+      dataList.value = response.rows;
+      total.value = response.total;
+      loading.value = false;
+    });
+  }
+  /** 取消按钮 */
+  function cancel() {
+    open.value = false;
+    reset();
+  }
+  /** 表单重置 */
+  function reset() {
+    form.value = {
+      dictCode: undefined,
+      dictLabel: undefined,
+      dictValue: undefined,
+      cssClass: undefined,
+      listClass: "default",
+      dictSort: 0,
+      status: "0",
+      remark: undefined,
+    };
+    proxy.resetForm("dataRef");
+  }
 
-/** 返回按钮操作 */
-function handleClose() {
-  const obj = { path: "/contracts/entrustOrder" };
-  proxy.$tab.closeOpenPage(obj);
-}
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
+  }
 
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm("queryRef");
-  queryParams.value.dictType = defaultDictType;
-  handleQuery();
-}
+  /** 返回按钮操作 */
+  function handleClose() {
+    const obj = { path: "/contracts/entrustOrder" };
+    proxy.$tab.closeOpenPage(obj);
+  }
 
-/** 新增按钮操作 */
-function handleAdd() {
-  // 判断是否有上月委托
-  // 判断上月委托是否已做对账单
-  // 假设已做对账单 则询问是否做本月对账单
-  // 假设做本月对账单 传入本月信息到dialog
-  choiceMonthDialogRef.value.open(queryParams.value.entrustOrderId);
-  // checkStatementAccount(queryParams.value.entrustOrderId).then((res) => {
-  //   const currentDate = res.msg;
-  //   statementAccountFormRef.value.add({
-  //     entrustOrderId: queryParams.value.entrustOrderId,
-  //     currentDate: currentDate,
-  //   });
-  //   // console.log(res)
-  // });
-}
+  /** 重置按钮操作 */
+  function resetQuery() {
+    proxy.resetForm("queryRef");
+    queryParams.value.dictType = defaultDictType;
+    handleQuery();
+  }
 
-/** 多选框选中数据 */
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.dictCode);
-  single.value = selection.length != 1;
-  multiple.value = !selection.length;
-}
+  /** 新增按钮操作 */
+  function handleAdd() {
+    // 判断是否有上月委托
+    // 判断上月委托是否已做对账单
+    // 假设已做对账单 则询问是否做本月对账单
+    // 假设做本月对账单 传入本月信息到dialog
+    choiceMonthDialogRef.value.open(queryParams.value.entrustOrderId);
+    // checkStatementAccount(queryParams.value.entrustOrderId).then((res) => {
+    //   const currentDate = res.msg;
+    //   statementAccountFormRef.value.add({
+    //     entrustOrderId: queryParams.value.entrustOrderId,
+    //     currentDate: currentDate,
+    //   });
+    //   // console.log(res)
+    // });
+  }
 
-/** 修改按钮操作 */
-function handleUpdate(row) {
-  statementAccountFormRef.value.open(row.id);
-}
+  /** 多选框选中数据 */
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.dictCode);
+    single.value = selection.length != 1;
+    multiple.value = !selection.length;
+  }
 
-/** 提交按钮 */
-function submitForm() {
-  proxy.$refs["dataRef"].validate((valid) => {
-    if (valid) {
-      if (form.value.dictCode != undefined) {
-        updateData(form.value).then((response) => {
-          useDictStore().removeDict(queryParams.value.dictType);
-          proxy.$modal.msgSuccess("修改成功");
-          open.value = false;
-          getList();
-        });
-      } else {
-        addData(form.value).then((response) => {
-          useDictStore().removeDict(queryParams.value.dictType);
-          proxy.$modal.msgSuccess("新增成功");
-          open.value = false;
-          getList();
-        });
+  /** 修改按钮操作 */
+  function handleUpdate(row) {
+    statementAccountFormRef.value.open(row.id);
+  }
+
+  /** 提交按钮 */
+  function submitForm() {
+    proxy.$refs["dataRef"].validate((valid) => {
+      if (valid) {
+        if (form.value.dictCode != undefined) {
+          updateData(form.value).then((response) => {
+            useDictStore().removeDict(queryParams.value.dictType);
+            proxy.$modal.msgSuccess("修改成功");
+            open.value = false;
+            getList();
+          });
+        } else {
+          addData(form.value).then((response) => {
+            useDictStore().removeDict(queryParams.value.dictType);
+            proxy.$modal.msgSuccess("新增成功");
+            open.value = false;
+            getList();
+          });
+        }
       }
-    }
-  });
-}
-/** 删除按钮操作 */
-function handleDelete(row) {
-  const ids = row.id || ids.value;
-  proxy.$modal
-    .confirm("是否确认删除?")
-    .then(function () {
-      return delDeduct(ids);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("删除成功");
-    })
-    .catch(() => {});
-}
+    });
+  }
+  /** 删除按钮操作 */
+  function handleDelete(row) {
+    const ids = row.id || ids.value;
+    proxy.$modal
+      .confirm("是否确认删除?")
+      .then(function () {
+        return delDeduct(ids);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功");
+      })
+      .catch(() => { });
+  }
 
-function monthConfirmHandler(daterange) {
-  const startMonth = daterange[0];
-  const endMonth = daterange[1];
-  statementAccountFormRef.value.add({
-    entrustOrderId: queryParams.value.entrustOrderId,
-    startMonth: startMonth,
-    endMonth: endMonth,
-  });
-}
+  function monthConfirmHandler(daterange) {
+    const startMonth = daterange[0];
+    const endMonth = daterange[1];
+    statementAccountFormRef.value.add({
+      entrustOrderId: queryParams.value.entrustOrderId,
+      startMonth: startMonth,
+      endMonth: endMonth,
+    });
+  }
 
-setEntrustOrder(route.params && route.params.orderId);
-</script>
+  setEntrustOrder(route.params && route.params.orderId);
+</script>

+ 11 - 8
src/views/business/entrust/workOrder/currentMonth/index.vue

@@ -116,7 +116,7 @@
   </div>
 </template>
 
-<script setup name="Company">
+<script setup name="CurrentMonthWorkOrder">
   import InitMonthDialog from "../initMonthDialog";
   import exports from "./export.vue"
   import { getToken, getTenant } from "@/utils/auth";
@@ -126,7 +126,7 @@
     exportCurrentWorkOrder,
     delEntrust,
     transNext,
-    addEntrust,exportStore
+    addEntrust, exportStore
   } from "@/api/business/entrust/currentWorkOrder";
   import SetEntrustDialog from "../setEntrustDialog";
   import useUserStore from "@/store/modules/user";
@@ -198,7 +198,10 @@
       loading.value = false;
     });
   }
-
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
   //判断是否有权限
   function viewAdviser(quer) {
     return permissions.includes(all_permission) || permissions.includes(quer);
@@ -263,7 +266,7 @@
 
   function setCurrentMonth(month) {
     // currentMonth.value = month;
-    currentMonth.value = proxy.moment().format("YYYY-MM")+"-01";
+    currentMonth.value = proxy.moment().format("YYYY-MM") + "-01";
   }
 
   function setEntrustHandle() {
@@ -288,11 +291,11 @@
 
   function transEntrustHandler() {
     proxy.$modal.confirm("确定流转到下一月?").then(() => {
-        transNext().then((res) => {
-          proxy.$modal.msgSuccess("流转成功");
-          checkCurrentMonthHandle();
-        });
+      transNext().then((res) => {
+        proxy.$modal.msgSuccess("流转成功");
+        checkCurrentMonthHandle();
       });
+    });
     // let currentDate = new Date().getMonth() + 1;
     // let formattedMonth = currentDate.toString().padStart(2, '0');
     // let month = currentMonth.value.split('-')[1];

+ 20 - 15
src/views/business/entrust/workOrder/historyMonth/index.vue

@@ -8,10 +8,9 @@
         <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
             label-width="68px">
             <el-form-item label="工作月:">
-                <el-date-picker v-model="queryParams.date" 
-                    format="YYYY-MM" value-format="YYYY-MM-DD" type="month" placeholder="请选择工作月"
-                    style="width: 150px"  :disabled-date="disabledDate"/>
-  
+                <el-date-picker v-model="queryParams.date" format="YYYY-MM" value-format="YYYY-MM-DD" type="month"
+                    placeholder="请选择工作月" style="width: 150px" :disabled-date="disabledDate" />
+
             </el-form-item>
             <el-form-item label="客户名称:" prop="companyName">
                 <el-input v-model="queryParams.companyName" style="width: 150px" placeholder="请输入客户名称" clearable
@@ -96,7 +95,7 @@
     </div>
 </template>
 
-<script setup name="Company">
+<script setup name="HistoryWorkOrder">
     import InitMonthDialog from "../initMonthDialog";
     import { getToken, getTenant } from "@/utils/auth";
     import {
@@ -135,15 +134,18 @@
 
     const { contract_verify_status } = proxy.useDict("contract_verify_status");
     const { contract_status } = proxy.useDict("contract_status");
-  /** 查询对象 */
-  const queryParams = ref({
-    pageNum: 1,
-    pageSize: 20,
-    companyName: "",
-    noContract: 0,
-    type: 1,
-  });
-
+    /** 查询对象 */
+    const queryParams = ref({
+        pageNum: 1,
+        pageSize: 20,
+        companyName: "",
+        noContract: 0,
+        type: 1,
+    });
+    onActivated(() => {
+        // 你的逻辑
+        getList();
+    });
     const editStatus = {
         startMonth: false,
     };
@@ -161,7 +163,10 @@
         // 如果选择的是当前年份,只能选择当前月份之前的月份
         return selectedYear === currentYear && selectedMonth >= currentMonth;
     }
-
+    onActivated(() => {
+        // 你的逻辑
+        getList();
+    });
     function checkCurrentMonthHandle() {
         checkCurrent().then((res) => {
             if (res.data.checkResult === true) {

+ 195 - 282
src/views/business/entrust/workOrder/nextMonth/index.vue

@@ -2,165 +2,88 @@
   <div class="page-container list-container">
     <!-- 功能按钮区 -->
     <div class="list-btns-container">
-      <el-button
-        type="primary"
-        size="small"
-        :disabled="multiple"
-        icon="Plus"
-        @click="setEntrustHandle"
-        v-hasPermi="['business:entrust:workOrder:next:edit']"
-        >设置委托</el-button
-      >
-      <el-button
-        type="danger"
-        size="small"
-        :disabled="cancel"
-        icon="delete"
-        @click="delEntrustHandle"
-        v-hasPermi="['business:entrust:workOrder:next:edit']"
-        >取消委托</el-button
-      >
+      <el-button type="primary" size="small" :disabled="multiple" icon="Plus" @click="setEntrustHandle"
+        v-hasPermi="['business:entrust:workOrder:next:edit']">设置委托</el-button>
+      <el-button type="danger" size="small" :disabled="cancel" icon="delete" @click="delEntrustHandle"
+        v-hasPermi="['business:entrust:workOrder:next:edit']">取消委托</el-button>
       <el-dropdown trigger="click">
         <el-button type="primary" size="small">
           其它<el-icon class="el-icon--right"><arrow-down /></el-icon>
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
-            <el-dropdown-item
-              icon="Download"
-              @click="handleExport"
-              v-if="viewAdviser('business:entrust:workOrder:next:export')"
-            >
-              导出</el-dropdown-item
-            >
+            <el-dropdown-item icon="Download" @click="handleExport"
+              v-if="viewAdviser('business:entrust:workOrder:next:export')">
+              导出</el-dropdown-item>
           </el-dropdown-menu>
         </template>
       </el-dropdown>
       <el-button style="margin-left: 5px;" type="primary" size="small" icon="Plus" @click="exportZero">导入委托</el-button>
     </div>
     <!-- 搜索区 -->
-    <el-form
-      class="list-search-container"
-      size="small"
-      :model="queryParams"
-      ref="queryRef"
-      :inline="true"
-      label-width="68px"
-    >
+    <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
+      label-width="68px">
       <el-form-item label="当前月:">{{
-       moment().add(1, 'month').format("YYYY年MM月")
-      }}</el-form-item>
+        moment().add(1, 'month').format("YYYY年MM月")
+        }}</el-form-item>
       <el-form-item label="客户名称:" prop="companyName">
-        <el-input
-          v-model="queryParams.companyName"
-          placeholder="请输入客户名称"
-          style="width: 150px"
-          clearable
-          @keyup.enter="handleQuery"
-        />
+        <el-input v-model="queryParams.companyName" placeholder="请输入客户名称" style="width: 150px" clearable
+          @keyup.enter="handleQuery" />
       </el-form-item>
       <el-form-item label="执行人:" prop="toAccountName">
-        <el-input
-          v-model="queryParams.toAccountName"
-          placeholder="请输入客户名称"
-          clearable
-          @keyup.enter="handleQuery"
-        />
+        <el-input v-model="queryParams.toAccountName" placeholder="请输入客户名称" clearable @keyup.enter="handleQuery" />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="Search" @click="handleQuery"
-          >搜索</el-button
-        >
+        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
         <el-button icon="Refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
 
     <!-- 列表区 -->
-    <el-table
-      v-loading="loading"
-      :data="list"
-      size="small"
-      border
-      height="100%"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="list" size="small" border height="100%"
+      @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <!-- <el-table-column label="工单号" align="center" prop="workOrderNo" width="200" /> -->
-      <el-table-column
-        label="客户名称"
-        align="center"
-        min-width="250"
-        prop="companyName"
-      />
-      <el-table-column
-        label="税号"
-        align="center"
-        prop="socialCreditCode"
-        min-width="200"
-      />
-      <el-table-column
-        label="工单类型"
-        align="center"
-        prop="amount"
-        min-width="90"
-      >
+      <el-table-column label="客户名称" align="center" min-width="250" prop="companyName" />
+      <el-table-column label="税号" align="center" prop="socialCreditCode" min-width="200" />
+      <el-table-column label="工单类型" align="center" prop="amount" min-width="90">
         <template #default="scope">
           {{ scope.row.type === 1 ? "循环工单" : "代办工单" }}
         </template>
       </el-table-column>
-      <el-table-column
-        label="项目"
-        align="center"
-        prop="taskTypeName"
-        min-width="130"
-      >
+      <el-table-column label="项目" align="center" prop="taskTypeName" min-width="130">
         <template #default="scope">
           {{ scope.row.taskTypeName }}
           {{
-            scope.row.taskTypeDetailName
-              ? `-${scope.row.taskTypeDetailName}`
-              : ""
+          scope.row.taskTypeDetailName
+          ? `-${scope.row.taskTypeDetailName}`
+          : ""
           }}
         </template>
       </el-table-column>
-      <el-table-column
-        label="起始月"
-        align="center"
-        min-width="90"
-        prop="startMonth"
-      >
+      <el-table-column label="起始月" align="center" min-width="90" prop="startMonth">
         <template #default="scope">
           {{
-            scope.row.type === 1
-              ? scope.row.startMonth
-                ? moment(scope.row.startMonth).format("YYYY年MM月")
-                : ""
-              : "-"
+          scope.row.type === 1
+          ? scope.row.startMonth
+          ? moment(scope.row.startMonth).format("YYYY年MM月")
+          : ""
+          : "-"
           }}
         </template>
       </el-table-column>
-      <el-table-column
-        label="结束月"
-        align="center"
-        min-width="90"
-        prop="endMonth"
-      >
+      <el-table-column label="结束月" align="center" min-width="90" prop="endMonth">
         <template #default="scope">
           {{
-            scope.row.type === 1
-              ? scope.row.endMonth
-                ? moment(scope.row.endMonth).format("YYYY年MM月")
-                : ""
-              : "-"
+          scope.row.type === 1
+          ? scope.row.endMonth
+          ? moment(scope.row.endMonth).format("YYYY年MM月")
+          : ""
+          : "-"
           }}
         </template>
       </el-table-column>
-      <el-table-column
-        label="工单月数"
-        align="center"
-        min-width="80"
-        prop="monthNum"
-      >
+      <el-table-column label="工单月数" align="center" min-width="80" prop="monthNum">
         <template #default="scope">
           {{ scope.row.type === 1 ? scope.row.monthNum : "-" }}
         </template>
@@ -168,208 +91,198 @@
       <el-table-column label="工单执行人" align="center" min-width="120">
         <template #default="scope">
           {{
-            scope.row.entrust != null
-              ? scope.row.entrust.toAccountName
-              : scope.row.serviceName
+          scope.row.entrust != null
+          ? scope.row.entrust.toAccountName
+          : scope.row.serviceName
           }}
         </template>
       </el-table-column>
     </el-table>
     <exports ref="exportRef" :get-list="getList"></exports>
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
-    <init-month-dialog
-      ref="initMonthDialogRef"
-      :get-list="getList"
-      :setCurrentMonth="setCurrentMonth"
-    />
-    <set-entrust-dialog
-      ref="setEntrustDialogRef"
-      :get-list="getList"
-      @submit="handleAddEntrust"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
+    <init-month-dialog ref="initMonthDialogRef" :get-list="getList" :setCurrentMonth="setCurrentMonth" />
+    <set-entrust-dialog ref="setEntrustDialogRef" :get-list="getList" @submit="handleAddEntrust" />
   </div>
 </template>
 
-<script setup name="Company">
-import InitMonthDialog from "../initMonthDialog";
-import exports from "./export.vue"
-import {
-  listNextWorkORder,
-  checkCurrent,
-  exportNextWorkOrder,
-  delEntrust,
-  addEntrust,
-} from "@/api/business/entrust/nextWorkOrder";
-import{exportNextStore}   from "@/api/business/entrust/currentWorkOrder";
-import SetEntrustDialog from "../setEntrustDialog";
-import useUserStore from "@/store/modules/user";
-const { proxy } = getCurrentInstance();
-const currentMonth = ref(null);
-/** 字典数组区 */
-/** 查询 对象 */
+<script setup name="NextMonthWorkOrder">
+  import InitMonthDialog from "../initMonthDialog";
+  import exports from "./export.vue"
+  import {
+    listNextWorkORder,
+    checkCurrent,
+    exportNextWorkOrder,
+    delEntrust,
+    addEntrust,
+  } from "@/api/business/entrust/nextWorkOrder";
+  import { exportNextStore } from "@/api/business/entrust/currentWorkOrder";
+  import SetEntrustDialog from "../setEntrustDialog";
+  import useUserStore from "@/store/modules/user";
+  const { proxy } = getCurrentInstance();
+  const currentMonth = ref(null);
+  /** 字典数组区 */
+  /** 查询 对象 */
 
-const list = ref([]);
-const loading = ref(true);
-const ids = ref([]);
-const selections = ref([]);
-const single = ref(false);
-const cancel = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-const prev = ref([]);
-const permissions = useUserStore().permissions;
-const all_permission = "*:*:*";
+  const list = ref([]);
+  const loading = ref(true);
+  const ids = ref([]);
+  const selections = ref([]);
+  const single = ref(false);
+  const cancel = ref(true);
+  const multiple = ref(true);
+  const total = ref(0);
+  const prev = ref([]);
+  const permissions = useUserStore().permissions;
+  const all_permission = "*:*:*";
 
-const initMonthDialogRef = ref(null);
-const setEntrustDialogRef = ref(null);
+  const initMonthDialogRef = ref(null);
+  const setEntrustDialogRef = ref(null);
 
-const showInitMonth = ref(false);
+  const showInitMonth = ref(false);
 
-const { contract_verify_status } = proxy.useDict("contract_verify_status");
-const { contract_status } = proxy.useDict("contract_status");
-/** 查询对象 */
-const queryParams = ref({
-  pageNum: 1,
-  pageSize: 20,
-  companyName: "",
-  orderByColumn: "create_time",
-  noContract: 0,
-  type: 1,
-});
-
-const editStatus = {
-  startMonth: false,
-};
+  const { contract_verify_status } = proxy.useDict("contract_verify_status");
+  const { contract_status } = proxy.useDict("contract_status");
+  /** 查询对象 */
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    companyName: "",
+    orderByColumn: "create_time",
+    noContract: 0,
+    type: 1,
+  });
 
-function checkCurrentMonthHandle() {
-  checkCurrent().then((res) => {
-    if (res.data.checkResult === true) {
-      setCurrentMonth(res.data.currentMonth);
-      getList();
-    } else {
-      proxy.$modal.msgError("未设置当前月,请设置本月");
-    }
+  const editStatus = {
+    startMonth: false,
+  };
+  onActivated(() => {
+    // 你的逻辑
+    getList();
   });
-}
+  function checkCurrentMonthHandle() {
+    checkCurrent().then((res) => {
+      if (res.data.checkResult === true) {
+        setCurrentMonth(res.data.currentMonth);
+        getList();
+      } else {
+        proxy.$modal.msgError("未设置当前月,请设置本月");
+      }
+    });
+  }
 
-//判断是否有权限
-function viewAdviser(quer) {
-  return permissions.includes(all_permission) || permissions.includes(quer);
-}
+  //判断是否有权限
+  function viewAdviser(quer) {
+    return permissions.includes(all_permission) || permissions.includes(quer);
+  }
   /** 新增导入操作 */
   function exportZero() {
     proxy.$refs.exportRef.open();
   }
-function showInitMonthDialog() {
-  initMonthDialogRef.value.open();
-}
+  function showInitMonthDialog() {
+    initMonthDialogRef.value.open();
+  }
 
-/***********************  方法区  ****************************/
+  /***********************  方法区  ****************************/
 
-/** 查询company列表 */
-function getList() {
-  loading.value = true;
-  queryParams.value.currentMonth = currentMonth.value;
-  listNextWorkORder(queryParams.value).then((response) => {
-    list.value = response.rows;
-    total.value = response.total;
-    loading.value = false;
-  });
-}
+  /** 查询company列表 */
+  function getList() {
+    loading.value = true;
+    queryParams.value.currentMonth = currentMonth.value;
+    listNextWorkORder(queryParams.value).then((response) => {
+      list.value = response.rows;
+      total.value = response.total;
+      loading.value = false;
+    });
+  }
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
+  }
 
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm("queryRef");
-  handleQuery();
-}
+  /** 重置按钮操作 */
+  function resetQuery() {
+    proxy.resetForm("queryRef");
+    handleQuery();
+  }
 
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  selections.value = selection;
+  // 多选框选中数据
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    selections.value = selection;
 
-  //取消委托计数
-  let cancelNum = 0;
-  //设置委托计数
-  let multipleNum = 0;
-  //判断是否有执行人
-  selections.value.forEach((item) => {
-    if (item.entrust) {
-      //有执行人
-      if (item.entrust.toAccountName) {
-        cancelNum++;
+    //取消委托计数
+    let cancelNum = 0;
+    //设置委托计数
+    let multipleNum = 0;
+    //判断是否有执行人
+    selections.value.forEach((item) => {
+      if (item.entrust) {
+        //有执行人
+        if (item.entrust.toAccountName) {
+          cancelNum++;
+        }
       }
+      //没有执行人
+      if (!item.entrust) {
+        multipleNum++;
+      }
+    });
+
+    //判断是否有选中数据
+    if (!selections.value.length > 0) {
+      multiple.value = true;
+      cancel.value = true;
+    } //判断是否设置执行人和设置委托选中
+    else if (cancelNum > 0 && multipleNum > 0) {
+      cancel.value = cancelNum > 0;
+      multiple.value = multipleNum > 0;
+    } else {
+      cancel.value = !cancelNum > 0;
+      multiple.value = !multipleNum > 0;
     }
-    //没有执行人
-    if (!item.entrust) {
-      multipleNum++;
-    }
-  });
+  }
 
-  //判断是否有选中数据
-  if (!selections.value.length > 0) {
-    multiple.value = true;
-    cancel.value = true;
-  } //判断是否设置执行人和设置委托选中
-  else if (cancelNum > 0 && multipleNum > 0) {
-    cancel.value = cancelNum > 0;
-    multiple.value = multipleNum > 0;
-  } else {
-    cancel.value = !cancelNum > 0;
-    multiple.value = !multipleNum > 0;
+  /** 导出按钮操作 */
+  function handleExport() {
+    exportNextStore(queryParams.value);
   }
-}
 
-/** 导出按钮操作 */
-function handleExport() {
-  exportNextStore(queryParams.value);
-}
+  function setCurrentMonth(month) {
+    // currentMonth.value = month;
+    currentMonth.value = proxy.moment().add(1, 'month').format("YYYY-MM") + "-01";
+  }
 
-function setCurrentMonth(month) {
-  // currentMonth.value = month;
-  currentMonth.value = proxy.moment().add(1, 'month').format("YYYY-MM")+"-01";
-}
+  function setEntrustHandle() {
+    setEntrustDialogRef.value.open({
+      selections: selections.value,
+      optionCurrentMonth: currentMonth.value,
+    });
+  }
 
-function setEntrustHandle() {
-  setEntrustDialogRef.value.open({
-    selections: selections.value,
-    optionCurrentMonth: currentMonth.value,
-  });
-}
+  function delEntrustHandle() {
+    const entrust = {
+      workMonth: currentMonth.value,
+      workOrderIds: ids.value,
+    };
+    proxy.$modal.confirm("是否确认取消委托?").then(() => {
+      delEntrust(entrust).then((res) => {
+        proxy.$modal.msgSuccess("取消成功");
+        getList();
+      });
+    });
+  }
 
-function delEntrustHandle() {
-  const entrust = {
-    workMonth: currentMonth.value,
-    workOrderIds: ids.value,
-  };
-  proxy.$modal.confirm("是否确认取消委托?").then(() => {
-    delEntrust(entrust).then((res) => {
-      proxy.$modal.msgSuccess("取消成功");
+  function handleAddEntrust(data) {
+    addEntrust(data).then((response) => {
+      proxy.$modal.msgSuccess("设置完成!");
+      setEntrustDialogRef.value.cancel();
       getList();
     });
-  });
-}
-
-function handleAddEntrust(data) {
-  addEntrust(data).then((response) => {
-    proxy.$modal.msgSuccess("设置完成!");
-    setEntrustDialogRef.value.cancel();
-    getList();
-  });
-}
+  }
 
-checkCurrentMonthHandle();
-</script>
+  checkCurrentMonthHandle();
+</script>

+ 161 - 223
src/views/business/entrust/workOrder/once/index.vue

@@ -2,298 +2,236 @@
   <div class="page-container list-container">
     <!-- 功能按钮区 -->
     <div class="list-btns-container">
-      <el-button
-        type="primary"
-        size="small"
-        icon="Plus"
-        :disabled="multiple"
-        @click="setEntrustHandle"
-        v-hasPermi="['business:entrust:workOrder:current:edit']"
-        >设置委托</el-button
-      >
-      <el-button
-        type="danger"
-        size="small"
-        icon="Delete"
-        :disabled="cancel"
-        @click="delEntrustHandle"
-        v-hasPermi="['business:entrust:workOrder:current:edit']"
-        >取消委托</el-button
-      >
+      <el-button type="primary" size="small" icon="Plus" :disabled="multiple" @click="setEntrustHandle"
+        v-hasPermi="['business:entrust:workOrder:current:edit']">设置委托</el-button>
+      <el-button type="danger" size="small" icon="Delete" :disabled="cancel" @click="delEntrustHandle"
+        v-hasPermi="['business:entrust:workOrder:current:edit']">取消委托</el-button>
       <el-dropdown trigger="click">
         <el-button type="primary" size="small">
           其它<el-icon class="el-icon--right"><arrow-down /></el-icon>
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
-            <el-dropdown-item
-              icon="Download"
-              @click="handleExport"
-              v-if="viewAdviser('business:entrust:workOrder:once:export')"
-            >
-              导出</el-dropdown-item
-            >
+            <el-dropdown-item icon="Download" @click="handleExport"
+              v-if="viewAdviser('business:entrust:workOrder:once:export')">
+              导出</el-dropdown-item>
           </el-dropdown-menu>
         </template>
       </el-dropdown>
     </div>
     <!-- 搜索区 -->
-    <el-form
-      class="list-search-container"
-      size="small"
-      :model="queryParams"
-      ref="queryRef"
-      :inline="true"
-      label-width="68px"
-    >
+    <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
+      label-width="68px">
       <el-form-item label="客户名称:" prop="companyName">
-        <el-input
-          v-model="queryParams.companyName"
-          placeholder="请输入客户名称"
-          clearable
-          style="width: 150px"
-          @keyup.enter="handleQuery"
-        />
+        <el-input v-model="queryParams.companyName" placeholder="请输入客户名称" clearable style="width: 150px"
+          @keyup.enter="handleQuery" />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="Search" @click="handleQuery"
-          >搜索</el-button
-        >
+        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
         <el-button icon="Refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
 
     <!-- 列表区 -->
-    <el-table
-      v-loading="loading"
-      :data="list"
-      size="small"
-      border
-      height="100%"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="list" size="small" border height="100%"
+      @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <!-- <el-table-column label="工单号" align="center" prop="workOrderNo" width="200" /> -->
-      <el-table-column
-        label="客户名称"
-        align="center"
-        min-width="250"
-        prop="companyName"
-      />
+      <el-table-column label="客户名称" align="center" min-width="250" prop="companyName" />
       <!-- <el-table-column
         label="税号"
         align="center"
         prop="socialCreditCode"
         min-width="160"
       /> -->
-      <el-table-column
-        label="工单类型"
-        align="center"
-        prop="amount"
-        min-width="80"
-      >
+      <el-table-column label="工单类型" align="center" prop="amount" min-width="80">
         <template #default="scope">
           {{ scope.row.type === 1 ? "循环工单" : "代办工单" }}
         </template>
       </el-table-column>
-         <!-- <el-table-column
+      <!-- <el-table-column
         label="说明"
         align="center"
         prop="explain"
         min-width="180"
       /> -->
-      <el-table-column
-        label="项目"
-        align="center"
-        prop="taskTypeName"
-        min-width="600"
-      >
+      <el-table-column label="项目" align="center" prop="taskTypeName" min-width="600">
         <template #default="scope">
           {{
-            scope.row.noContract === 1? scope.row.remark: `${scope.row.taskTypeName}${scope.row.alterType ?`-${scope.row.alterType}` : ""}${scope.row.taskTypeDetailName? `-${scope.row.taskTypeDetailName}` : ""}`
+          scope.row.noContract === 1? scope.row.remark: `${scope.row.taskTypeName}${scope.row.alterType
+          ?`-${scope.row.alterType}` : ""}${scope.row.taskTypeDetailName? `-${scope.row.taskTypeDetailName}` : ""}`
           }}
         </template>
       </el-table-column>
-      <el-table-column
-      label="说明"
-      align="center"
-      prop="explain"
-      min-width="180"
-    />
+      <el-table-column label="说明" align="center" prop="explain" min-width="180" />
       <el-table-column label="工单执行人" align="center" min-width="120">
         <template #default="scope">
           {{
-            scope.row.entrust != null
-              ? scope.row.entrust.toAccountName
-              : scope.row.serviceName
+          scope.row.entrust != null
+          ? scope.row.entrust.toAccountName
+          : scope.row.serviceName
           }}
         </template>
       </el-table-column>
     </el-table>
     <!-- <contract-form ref="contractRef" :get-list="getList" /> -->
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
-    <set-entrust-dialog
-      ref="setEntrustDialogRef"
-      :get-list="getList"
-      @submit="handleAddEntrust"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
+    <set-entrust-dialog ref="setEntrustDialogRef" :get-list="getList" @submit="handleAddEntrust" />
   </div>
 </template>
 
-<script setup name="Company">
-import {
-  listOnceWorkOrder,
-  checkCurrent,
-  exportOnceWorkOrder,
-  delEntrust,
-  transNext,
-  addEntrust,
-} from "@/api/business/entrust/onceWorkOrder";
-import SetEntrustDialog from "../setEntrustDialog";
-import useUserStore from "@/store/modules/user";
-const { proxy } = getCurrentInstance();
-/** 字典数组区 */
-/** 查询 对象 */
-
-const list = ref([]);
-const loading = ref(true);
-const ids = ref([]);
-const selections = ref([]);
-const single = ref(false);
-const cancel = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-const permissions = useUserStore().permissions;
-const all_permission = "*:*:*";
-const prev = ref([]);
-
-const setEntrustDialogRef = ref(null);
-
-const { contract_verify_status } = proxy.useDict("contract_verify_status");
-const { contract_status } = proxy.useDict("contract_status");
-/** 查询对象 */
-const queryParams = ref({
-  pageNum: 1,
-  pageSize: 20,
-  companyName: "",
-  orderByColumn: "create_time",
-  type: 2,
-});
-
-const editStatus = {
-  startMonth: false,
-};
+<script setup name="OnceWorkOrder">
+  import {
+    listOnceWorkOrder,
+    checkCurrent,
+    exportOnceWorkOrder,
+    delEntrust,
+    transNext,
+    addEntrust,
+  } from "@/api/business/entrust/onceWorkOrder";
+  import SetEntrustDialog from "../setEntrustDialog";
+  import useUserStore from "@/store/modules/user";
+  const { proxy } = getCurrentInstance();
+  /** 字典数组区 */
+  /** 查询 对象 */
+
+  const list = ref([]);
+  const loading = ref(true);
+  const ids = ref([]);
+  const selections = ref([]);
+  const single = ref(false);
+  const cancel = ref(true);
+  const multiple = ref(true);
+  const total = ref(0);
+  const permissions = useUserStore().permissions;
+  const all_permission = "*:*:*";
+  const prev = ref([]);
+
+  const setEntrustDialogRef = ref(null);
+
+  const { contract_verify_status } = proxy.useDict("contract_verify_status");
+  const { contract_status } = proxy.useDict("contract_status");
+  /** 查询对象 */
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    companyName: "",
+    orderByColumn: "create_time",
+    type: 2,
+  });
 
-/***********************  方法区  ****************************/
+  const editStatus = {
+    startMonth: false,
+  };
 
-/** 查询company列表 */
-function getList() {
-  loading.value = true;
-  listOnceWorkOrder(queryParams.value).then((response) => {
-    list.value = response.rows;
-    total.value = response.total;
-    loading.value = false;
+  /***********************  方法区  ****************************/
+  onActivated(() => {
+    // 你的逻辑
+    getList();
   });
-}
-
-//判断是否有权限
-function viewAdviser(quer) {
-  return permissions.includes(all_permission) || permissions.includes(quer);
-}
+  /** 查询company列表 */
+  function getList() {
+    loading.value = true;
+    listOnceWorkOrder(queryParams.value).then((response) => {
+      list.value = response.rows;
+      total.value = response.total;
+      loading.value = false;
+    });
+  }
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
+  //判断是否有权限
+  function viewAdviser(quer) {
+    return permissions.includes(all_permission) || permissions.includes(quer);
+  }
 
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm("queryRef");
-  handleQuery();
-}
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
+  }
 
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  selections.value = selection;
+  /** 重置按钮操作 */
+  function resetQuery() {
+    proxy.resetForm("queryRef");
+    handleQuery();
+  }
 
-  //取消委托计数
-  let cancelNum = 0;
-  //设置委托计数
-  let multipleNum = 0;
-  //判断是否有执行人
-  selections.value.forEach((item) => {
-    if (item.entrust) {
-      //有执行人
-      if (item.entrust.toAccountName) {
-        cancelNum++;
+  // 多选框选中数据
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    selections.value = selection;
+
+    //取消委托计数
+    let cancelNum = 0;
+    //设置委托计数
+    let multipleNum = 0;
+    //判断是否有执行人
+    selections.value.forEach((item) => {
+      if (item.entrust) {
+        //有执行人
+        if (item.entrust.toAccountName) {
+          cancelNum++;
+        }
       }
+      //没有执行人
+      if (!item.entrust) {
+        multipleNum++;
+      }
+    });
+
+    //判断是否有选中数据
+    if (!selections.value.length > 0) {
+      multiple.value = true;
+      cancel.value = true;
+    } //判断是否设置执行人和设置委托选中
+    else if (cancelNum > 0 && multipleNum > 0) {
+      cancel.value = cancelNum > 0;
+      multiple.value = multipleNum > 0;
+    } else {
+      cancel.value = !cancelNum > 0;
+      multiple.value = !multipleNum > 0;
     }
-    //没有执行人
-    if (!item.entrust) {
-      multipleNum++;
-    }
-  });
+  }
 
-  //判断是否有选中数据
-  if (!selections.value.length > 0) {
-    multiple.value = true;
-    cancel.value = true;
-  } //判断是否设置执行人和设置委托选中
-  else if (cancelNum > 0 && multipleNum > 0) {
-    cancel.value = cancelNum > 0;
-    multiple.value = multipleNum > 0;
-  } else {
-    cancel.value = !cancelNum > 0;
-    multiple.value = !multipleNum > 0;
+  /** 导出按钮操作 */
+  function handleExport() {
+    exportOnceWorkOrder(queryParams.value);
   }
-}
 
-/** 导出按钮操作 */
-function handleExport() {
-  exportOnceWorkOrder(queryParams.value);
-}
+  function setEntrustHandle() {
+    setEntrustDialogRef.value.open({ selections: selections.value });
+  }
 
-function setEntrustHandle() {
-  setEntrustDialogRef.value.open({ selections: selections.value });
-}
+  function delEntrustHandle() {
+    const entrust = {
+      workOrderIds: ids.value,
+    };
+    proxy.$modal.confirm("是否确认取消委托?").then(() => {
+      delEntrust(entrust).then((res) => {
+        proxy.$modal.msgSuccess("取消成功");
+        getList();
+      });
+    });
+  }
 
-function delEntrustHandle() {
-  const entrust = {
-    workOrderIds: ids.value,
-  };
-  proxy.$modal.confirm("是否确认取消委托?").then(() => {
-    delEntrust(entrust).then((res) => {
-      proxy.$modal.msgSuccess("取消成功");
+  function handleAddEntrust(data) {
+    addEntrust(data).then((response) => {
+      proxy.$modal.msgSuccess("设置完成!");
+      setEntrustDialogRef.value.cancel();
       getList();
     });
-  });
-}
-
-function handleAddEntrust(data) {
-  addEntrust(data).then((response) => {
-    proxy.$modal.msgSuccess("设置完成!");
-    setEntrustDialogRef.value.cancel();
-    getList();
-  });
-}
+  }
 
-function transEntrustHandler() {
-  proxy.$modal.confirm("确定流转到下一月?").then(() => {
-    transNext().then((res) => {
-      proxy.$modal.msgSuccess("流转成功");
-      checkCurrentMonthHandle();
+  function transEntrustHandler() {
+    proxy.$modal.confirm("确定流转到下一月?").then(() => {
+      transNext().then((res) => {
+        proxy.$modal.msgSuccess("流转成功");
+        checkCurrentMonthHandle();
+      });
     });
-  });
-}
+  }
 
-getList();
-</script>
+  getList();
+</script>

+ 8 - 5
src/views/business/entrust/workOrderForFactory/currentMonth/index.vue

@@ -21,7 +21,7 @@
     <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
       label-width="68px">
       <el-form-item label="当前月:">{{
-       moment().format("YYYY年MM月")
+        moment().format("YYYY年MM月")
         }}</el-form-item>
       <el-form-item label="客户名称:" prop="companyName">
         <el-input v-model="queryParams.companyName" placeholder="请输入客户名称" clearable @keyup.enter="handleQuery" />
@@ -103,7 +103,7 @@
   </div>
 </template>
 
-<script setup name="Company">
+<script setup name="CurrentWorkOrderForFactory">
   import { getToken, getTenant } from "@/utils/auth";
   import {
     listFactoryCurrentWorkOrder,
@@ -114,7 +114,7 @@
   } from "@/api/business/entrust/currentWorkOrder";
   import InitMonthDialog from "../initMonthDialog";
   import useUserStore from "@/store/modules/user";
-  import{exportFactory}   from "@/api/business/entrust/currentWorkOrder";
+  import { exportFactory } from "@/api/business/entrust/currentWorkOrder";
   const { proxy } = getCurrentInstance();
   const currentMonth = ref(null);
   /** 字典数组区 */
@@ -151,7 +151,10 @@
   const editStatus = {
     startMonth: false,
   };
-
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
   function checkCurrentMonthHandle() {
     checkCurrent().then((res) => {
       if (res.data.checkResult === true) {
@@ -211,7 +214,7 @@
   }
 
   function setCurrentMonth(month) {
-    currentMonth.value = proxy.moment().format("YYYY-MM")+"-01";
+    currentMonth.value = proxy.moment().format("YYYY-MM") + "-01";
   }
 
   function setEntrustHandle() {

+ 349 - 344
src/views/business/entrust/workOrderForFactory/history/index.vue

@@ -1,348 +1,353 @@
 <template>
-  <div class="page-container list-container">
-      <!-- 功能按钮区 -->
-      <div class="list-btns-container">
-
-      </div>
-      <!-- 搜索区 -->
-      <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
-          label-width="68px">
-          <el-form-item label="工作月:">
-              <el-date-picker v-model="queryParams.date" format="YYYY-MM" value-format="YYYY-MM-DD" type="month"
-                  placeholder="请选择工作月" :disabled-date="disabledDate"></el-date-picker>
-          </el-form-item>
-          <el-form-item label="客户名称:" prop="companyName">
-              <el-input v-model="queryParams.companyName" style="width: 150px" placeholder="请输入客户名称" clearable
-                  @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="来源:" prop="fromCompanyName">
-            <el-input v-model="queryParams.fromCompanyName" placeholder="请输入来源" clearable @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item>
-              <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
-              <el-button icon="Refresh" @click="resetQuery">重置</el-button>
-          </el-form-item>
-      </el-form>
-
-      <!-- 列表区 -->
-      <el-table v-loading="loading" :data="list" size="small" border height="100%"
-          @selection-change="handleSelectionChange">
-          <el-table-column type="selection" width="55" align="center" />
-          <!-- <el-table-column label="工单号" align="center" prop="workOrderNo" width="200" /> -->
-          <el-table-column label="客户名称" align="center" min-width="250" prop="companyName" />
-          <el-table-column label="税号" align="center" prop="socialCreditCode" min-width="200" />
-          <el-table-column label="来源" align="center" width="100" prop="fromCompanyName" />
-          <el-table-column label="工单类型" align="center" prop="amount" min-width="80">
-              <template #default="scope">
-                  {{ scope.row.type === 1 ? "循环工单" : "代办工单" }}
-              </template>
-          </el-table-column>
-          <el-table-column label="项目" align="center" prop="taskTypeName" min-width="140">
-              <template #default="scope">
-                  {{ scope.row.taskTypeName }}
-                  {{
-                  scope.row.taskTypeDetailName
-                  ? `-${scope.row.taskTypeDetailName}`
-                  : ""
-                  }}
-              </template>
-          </el-table-column>
-          <el-table-column label="起始月" align="center" width="90" min-prop="startMonth">
-              <template #default="scope">
-                  {{
-                  scope.row.type === 1
-                  ? scope.row.startMonth !="0000-00-00"
-                  ? moment(scope.row.startMonth).format("YYYY年MM月")
-                  : ""
-                  : "-"
-                  }}
-              </template>
-          </el-table-column>
-          <el-table-column label="结束月" align="center" min-width="90" prop="endMonth">
-              <template #default="scope">
-                  {{
-                  scope.row.type === 1
-                  ? scope.row.endMonth !="0000-00-00"
-                  ? moment(scope.row.endMonth).format("YYYY年MM月")
-                  : ""
-                  : "-"
-                  }}
-              </template>
-          </el-table-column>
-          <el-table-column label="工单月数" align="center" min-width="80" prop="monthNum">
-              <template #default="scope">
-                  {{ scope.row.type === 1 ? scope.row.monthNum : "-" }}
-              </template>
-          </el-table-column>
-          <el-table-column label="工单执行人" align="center" min-width="100">
-              <template #default="scope">
-                  {{
-                  scope.row.toAccountName
-                  }}
-              </template>
-          </el-table-column>
-      </el-table>
-      <!-- <contract-form ref="contractRef" :get-list="getList" /> -->
-      <!-- 分页 -->
-      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
-          v-model:limit="queryParams.pageSize" @pagination="getList" />
-      <init-month-dialog ref="initMonthDialogRef" :get-list="checkCurrentMonthHandle"
-          :setCurrentMonth="setCurrentMonth" />
-
-      <set-entrust-dialog ref="setEntrustDialogRef" :get-list="getList" @submit="handleAddEntrust" />
-
-  </div>
+    <div class="page-container list-container">
+        <!-- 功能按钮区 -->
+        <div class="list-btns-container">
+
+        </div>
+        <!-- 搜索区 -->
+        <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
+            label-width="68px">
+            <el-form-item label="工作月:">
+                <el-date-picker v-model="queryParams.date" format="YYYY-MM" value-format="YYYY-MM-DD" type="month"
+                    placeholder="请选择工作月" :disabled-date="disabledDate"></el-date-picker>
+            </el-form-item>
+            <el-form-item label="客户名称:" prop="companyName">
+                <el-input v-model="queryParams.companyName" style="width: 150px" placeholder="请输入客户名称" clearable
+                    @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="来源:" prop="fromCompanyName">
+                <el-input v-model="queryParams.fromCompanyName" placeholder="请输入来源" clearable
+                    @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item>
+                <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+                <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+            </el-form-item>
+        </el-form>
+
+        <!-- 列表区 -->
+        <el-table v-loading="loading" :data="list" size="small" border height="100%"
+            @selection-change="handleSelectionChange">
+            <el-table-column type="selection" width="55" align="center" />
+            <!-- <el-table-column label="工单号" align="center" prop="workOrderNo" width="200" /> -->
+            <el-table-column label="客户名称" align="center" min-width="250" prop="companyName" />
+            <el-table-column label="税号" align="center" prop="socialCreditCode" min-width="200" />
+            <el-table-column label="来源" align="center" width="100" prop="fromCompanyName" />
+            <el-table-column label="工单类型" align="center" prop="amount" min-width="80">
+                <template #default="scope">
+                    {{ scope.row.type === 1 ? "循环工单" : "代办工单" }}
+                </template>
+            </el-table-column>
+            <el-table-column label="项目" align="center" prop="taskTypeName" min-width="140">
+                <template #default="scope">
+                    {{ scope.row.taskTypeName }}
+                    {{
+                    scope.row.taskTypeDetailName
+                    ? `-${scope.row.taskTypeDetailName}`
+                    : ""
+                    }}
+                </template>
+            </el-table-column>
+            <el-table-column label="起始月" align="center" width="90" min-prop="startMonth">
+                <template #default="scope">
+                    {{
+                    scope.row.type === 1
+                    ? scope.row.startMonth !="0000-00-00"
+                    ? moment(scope.row.startMonth).format("YYYY年MM月")
+                    : ""
+                    : "-"
+                    }}
+                </template>
+            </el-table-column>
+            <el-table-column label="结束月" align="center" min-width="90" prop="endMonth">
+                <template #default="scope">
+                    {{
+                    scope.row.type === 1
+                    ? scope.row.endMonth !="0000-00-00"
+                    ? moment(scope.row.endMonth).format("YYYY年MM月")
+                    : ""
+                    : "-"
+                    }}
+                </template>
+            </el-table-column>
+            <el-table-column label="工单月数" align="center" min-width="80" prop="monthNum">
+                <template #default="scope">
+                    {{ scope.row.type === 1 ? scope.row.monthNum : "-" }}
+                </template>
+            </el-table-column>
+            <el-table-column label="工单执行人" align="center" min-width="100">
+                <template #default="scope">
+                    {{
+                    scope.row.toAccountName
+                    }}
+                </template>
+            </el-table-column>
+        </el-table>
+        <!-- <contract-form ref="contractRef" :get-list="getList" /> -->
+        <!-- 分页 -->
+        <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+            v-model:limit="queryParams.pageSize" @pagination="getList" />
+        <init-month-dialog ref="initMonthDialogRef" :get-list="checkCurrentMonthHandle"
+            :setCurrentMonth="setCurrentMonth" />
+
+        <set-entrust-dialog ref="setEntrustDialogRef" :get-list="getList" @submit="handleAddEntrust" />
+
+    </div>
 </template>
 
-<script setup name="Company">
-  import InitMonthDialog from "../initMonthDialog";
-  import { getToken, getTenant } from "@/utils/auth";
-  import {
-      listCurrentWorkOrder,
-      checkCurrent,
-      exportCurrentWorkOrder,
-      delEntrust,
-      transNext,
-      addEntrust, listHistory
-  } from "@/api/business/entrust/currentWorkOrder";
-  import SetEntrustDialog from "../setEntrustDialog";
-  import useUserStore from "@/store/modules/user";
-  // import { ca } from "element-plus/es/locale";
-  const { proxy } = getCurrentInstance();
-  const currentMonth = ref(null);
-  /** 字典数组区 */
-  /** 查询 对象 */
-
-  const list = ref([]);
-  const loading = ref(true);
-  const cancel = ref(true);
-  const multiple = ref(true);
-  const ids = ref([]);
-  const selections = ref([]);
-  const single = ref(false);
-  const total = ref(0);
-  const prev = ref([]);
-  const tenantId = ref(getTenant());
-  const permissions = useUserStore().permissions;
-  const all_permission = "*:*:*";
-
-  const initMonthDialogRef = ref(null);
-  const setEntrustDialogRef = ref(null);
-
-  const showInitMonth = ref(false);
-
-  const { contract_verify_status } = proxy.useDict("contract_verify_status");
-  const { contract_status } = proxy.useDict("contract_status");
-  /** 查询对象 */
-  const queryParams = ref({
-      pageNum: 1,
-      pageSize: 20,
-
-  });
-
-  const editStatus = {
-      startMonth: false,
-  };
-  function disabledDate(time) {
-      const currentMonth = new Date().getMonth();
-      const selectedMonth = time.getMonth();
-      const currentYear = new Date().getFullYear();
-      const selectedYear = time.getFullYear();
-
-      // 禁用当前年份之后的所有月份
-      if (selectedYear > currentYear) {
-          return true;
-      }
-
-      // 如果选择的是当前年份,只能选择当前月份之前的月份
-      return selectedYear === currentYear && selectedMonth >= currentMonth;
-  }
-
-  function checkCurrentMonthHandle() {
-      checkCurrent().then((res) => {
-          if (res.data.checkResult === true) {
-              setCurrentMonth(res.data.currentMonth);
-              getList();
-          } else {
-              showInitMonthDialog();
-          }
-      });
-  }
-
-  function showInitMonthDialog() {
-      initMonthDialogRef.value.open();
-  }
-
-  /***********************  方法区  ****************************/
-  // 禁用当前月及之后的月份
-  const beforeCurrentMonth = (time) => {
-      const currentMonth = new Date().getMonth();
-      const selectedMonth = time.getMonth();
-      return selectedMonth >= currentMonth;
-  };
-  /** 查询company列表 */
-  function getList() {
-      loading.value = true;
-      console.log(queryParams.value);
-
-      queryParams.value.currentMonth = currentMonth.value;
-      listHistory(queryParams.value).then((response) => {
-          list.value = response.rows;
-          console.log(response);
-          total.value = response.total;
-      }).finally(() => {
-          loading.value = false;
-      });
-  }
-
-  /** 取消委托按钮操作 */
-  function cancelEntrust() {
-      if (selections.value.length === 0) {
-          proxy.$modal.msgError("请选择要取消委托的数据");
-          return;
-      }
-      proxy.$modal
-          .confirm("是否确认取消委托?")
-          .then(function () {
-
-          });
-  }
-
-  //判断是否有权限
-  function viewAdviser(quer) {
-      return permissions.includes(all_permission) || permissions.includes(quer);
-  }
-
-  /** 搜索按钮操作 */
-  function handleQuery() {
-      queryParams.value.pageNum = 1;
-      getList();
-  }
-
-  /** 重置按钮操作 */
-  function resetQuery() {
-      proxy.resetForm("queryRef");
-      handleQuery();
-  }
-  /** 新增导入操作 */
-  function exportZero() {
-      proxy.$refs.exportRef.open();
-  }
-  // 多选框选中数据
-  function handleSelectionChange(selection) {
-      ids.value = selection.map((item) => item.id);
-      selections.value = selection;
-
-      //取消委托计数
-      let cancelNum = 0;
-      //设置委托计数
-      let multipleNum = 0;
-      //判断是否有执行人
-      selections.value.forEach((item) => {
-          if (item.entrust) {
-              //有执行人
-              if (item.entrust.toAccountName) {
-                  cancelNum++;
-              }
-          }
-          //没有执行人
-          if (!item.entrust) {
-              multipleNum++;
-          }
-      });
-
-      //判断是否有选中数据
-      if (!selections.value.length > 0) {
-          multiple.value = true;
-          cancel.value = true;
-      } //判断是否设置执行人和设置委托选中
-      else if (cancelNum > 0 && multipleNum > 0) {
-          cancel.value = cancelNum > 0;
-          multiple.value = multipleNum > 0;
-      } else {
-          cancel.value = !cancelNum > 0;
-          multiple.value = !multipleNum > 0;
-      }
-  }
-
-  /** 导出按钮操作 */
-  function handleExport() {
-      exportCurrentWorkOrder(queryParams.value);
-  }
-
-  function setCurrentMonth(month) {
-      currentMonth.value = month;
-  }
-
-  function setEntrustHandle() {
-      setEntrustDialogRef.value.open({
-          selections: selections.value,
-          optionCurrentMonth: currentMonth.value,
-      });
-  }
-
-  function delEntrustHandle() {
-      const entrust = {
-          workMonth: currentMonth.value,
-          workOrderIds: ids.value,
-      };
-      proxy.$modal.confirm("是否确认取消委托?").then(() => {
-          delEntrust(entrust).then((res) => {
-              proxy.$modal.msgSuccess("取消成功");
-              getList();
-          });
-      });
-  }
-
-  function transEntrustHandler() {
-      // proxy.$modal.confirm("确定流转到下一月?").then(() => {
-      //     transNext().then((res) => {
-      //       proxy.$modal.msgSuccess("流转成功");
-      //       checkCurrentMonthHandle();
-      //     });
-      //   });
-      let currentDate = new Date().getMonth() + 1;
-      let formattedMonth = currentDate.toString().padStart(2, '0');
-      let month = currentMonth.value.split('-')[1];
-      console.log(formattedMonth);
-      if (month < formattedMonth) {
-          proxy.$modal.confirm("确定流转到下一月?").then(() => {
-              transNext().then((res) => {
-                  proxy.$modal.msgSuccess("流转成功");
-                  checkCurrentMonthHandle();
-              });
-          });
-      } else {
-          // //真实月 != 当前月 
-          if (month != formattedMonth) {
-              proxy.$modal.msgError("每月只可流转一次");
-          } else {
-              let currentDay = new Date().getDate()
-              let cutoffDay = 20;
-              //如果当前月时间小于20号
-              if (currentDay < cutoffDay) {
-                  proxy.$modal.msgError("每月20号后才能流转");
-              } else {
-                  proxy.$modal.confirm("确定流转到下一月?").then(() => {
-                      transNext().then((res) => {
-                          proxy.$modal.msgSuccess("流转成功");
-                          checkCurrentMonthHandle();
-                      });
-                  });
-              }
-
-          }
-      }
-
-  }
-
-  function handleAddEntrust(data) {
-      addEntrust(data).then((response) => {
-          proxy.$modal.msgSuccess("设置完成!");
-          setEntrustDialogRef.value.cancel();
-          getList();
-      });
-  }
-
-  checkCurrentMonthHandle();
+<script setup name="HistoryWorkOrderForFactory">
+    import InitMonthDialog from "../initMonthDialog";
+    import { getToken, getTenant } from "@/utils/auth";
+    import {
+        listCurrentWorkOrder,
+        checkCurrent,
+        exportCurrentWorkOrder,
+        delEntrust,
+        transNext,
+        addEntrust, listHistory
+    } from "@/api/business/entrust/currentWorkOrder";
+    import SetEntrustDialog from "../setEntrustDialog";
+    import useUserStore from "@/store/modules/user";
+    // import { ca } from "element-plus/es/locale";
+    const { proxy } = getCurrentInstance();
+    const currentMonth = ref(null);
+    /** 字典数组区 */
+    /** 查询 对象 */
+
+    const list = ref([]);
+    const loading = ref(true);
+    const cancel = ref(true);
+    const multiple = ref(true);
+    const ids = ref([]);
+    const selections = ref([]);
+    const single = ref(false);
+    const total = ref(0);
+    const prev = ref([]);
+    const tenantId = ref(getTenant());
+    const permissions = useUserStore().permissions;
+    const all_permission = "*:*:*";
+
+    const initMonthDialogRef = ref(null);
+    const setEntrustDialogRef = ref(null);
+
+    const showInitMonth = ref(false);
+
+    const { contract_verify_status } = proxy.useDict("contract_verify_status");
+    const { contract_status } = proxy.useDict("contract_status");
+    onActivated(() => {
+        // 你的逻辑
+        getList();
+    });
+    /** 查询对象 */
+    const queryParams = ref({
+        pageNum: 1,
+        pageSize: 20,
+
+    });
+
+    const editStatus = {
+        startMonth: false,
+    };
+    function disabledDate(time) {
+        const currentMonth = new Date().getMonth();
+        const selectedMonth = time.getMonth();
+        const currentYear = new Date().getFullYear();
+        const selectedYear = time.getFullYear();
+
+        // 禁用当前年份之后的所有月份
+        if (selectedYear > currentYear) {
+            return true;
+        }
+
+        // 如果选择的是当前年份,只能选择当前月份之前的月份
+        return selectedYear === currentYear && selectedMonth >= currentMonth;
+    }
+
+    function checkCurrentMonthHandle() {
+        checkCurrent().then((res) => {
+            if (res.data.checkResult === true) {
+                setCurrentMonth(res.data.currentMonth);
+                getList();
+            } else {
+                showInitMonthDialog();
+            }
+        });
+    }
+
+    function showInitMonthDialog() {
+        initMonthDialogRef.value.open();
+    }
+
+    /***********************  方法区  ****************************/
+    // 禁用当前月及之后的月份
+    const beforeCurrentMonth = (time) => {
+        const currentMonth = new Date().getMonth();
+        const selectedMonth = time.getMonth();
+        return selectedMonth >= currentMonth;
+    };
+    /** 查询company列表 */
+    function getList() {
+        loading.value = true;
+        console.log(queryParams.value);
+
+        queryParams.value.currentMonth = currentMonth.value;
+        listHistory(queryParams.value).then((response) => {
+            list.value = response.rows;
+            console.log(response);
+            total.value = response.total;
+        }).finally(() => {
+            loading.value = false;
+        });
+    }
+
+    /** 取消委托按钮操作 */
+    function cancelEntrust() {
+        if (selections.value.length === 0) {
+            proxy.$modal.msgError("请选择要取消委托的数据");
+            return;
+        }
+        proxy.$modal
+            .confirm("是否确认取消委托?")
+            .then(function () {
+
+            });
+    }
+
+    //判断是否有权限
+    function viewAdviser(quer) {
+        return permissions.includes(all_permission) || permissions.includes(quer);
+    }
+
+    /** 搜索按钮操作 */
+    function handleQuery() {
+        queryParams.value.pageNum = 1;
+        getList();
+    }
+
+    /** 重置按钮操作 */
+    function resetQuery() {
+        proxy.resetForm("queryRef");
+        handleQuery();
+    }
+    /** 新增导入操作 */
+    function exportZero() {
+        proxy.$refs.exportRef.open();
+    }
+    // 多选框选中数据
+    function handleSelectionChange(selection) {
+        ids.value = selection.map((item) => item.id);
+        selections.value = selection;
+
+        //取消委托计数
+        let cancelNum = 0;
+        //设置委托计数
+        let multipleNum = 0;
+        //判断是否有执行人
+        selections.value.forEach((item) => {
+            if (item.entrust) {
+                //有执行人
+                if (item.entrust.toAccountName) {
+                    cancelNum++;
+                }
+            }
+            //没有执行人
+            if (!item.entrust) {
+                multipleNum++;
+            }
+        });
+
+        //判断是否有选中数据
+        if (!selections.value.length > 0) {
+            multiple.value = true;
+            cancel.value = true;
+        } //判断是否设置执行人和设置委托选中
+        else if (cancelNum > 0 && multipleNum > 0) {
+            cancel.value = cancelNum > 0;
+            multiple.value = multipleNum > 0;
+        } else {
+            cancel.value = !cancelNum > 0;
+            multiple.value = !multipleNum > 0;
+        }
+    }
+
+    /** 导出按钮操作 */
+    function handleExport() {
+        exportCurrentWorkOrder(queryParams.value);
+    }
+
+    function setCurrentMonth(month) {
+        currentMonth.value = month;
+    }
+
+    function setEntrustHandle() {
+        setEntrustDialogRef.value.open({
+            selections: selections.value,
+            optionCurrentMonth: currentMonth.value,
+        });
+    }
+
+    function delEntrustHandle() {
+        const entrust = {
+            workMonth: currentMonth.value,
+            workOrderIds: ids.value,
+        };
+        proxy.$modal.confirm("是否确认取消委托?").then(() => {
+            delEntrust(entrust).then((res) => {
+                proxy.$modal.msgSuccess("取消成功");
+                getList();
+            });
+        });
+    }
+
+    function transEntrustHandler() {
+        // proxy.$modal.confirm("确定流转到下一月?").then(() => {
+        //     transNext().then((res) => {
+        //       proxy.$modal.msgSuccess("流转成功");
+        //       checkCurrentMonthHandle();
+        //     });
+        //   });
+        let currentDate = new Date().getMonth() + 1;
+        let formattedMonth = currentDate.toString().padStart(2, '0');
+        let month = currentMonth.value.split('-')[1];
+        console.log(formattedMonth);
+        if (month < formattedMonth) {
+            proxy.$modal.confirm("确定流转到下一月?").then(() => {
+                transNext().then((res) => {
+                    proxy.$modal.msgSuccess("流转成功");
+                    checkCurrentMonthHandle();
+                });
+            });
+        } else {
+            // //真实月 != 当前月 
+            if (month != formattedMonth) {
+                proxy.$modal.msgError("每月只可流转一次");
+            } else {
+                let currentDay = new Date().getDate()
+                let cutoffDay = 20;
+                //如果当前月时间小于20号
+                if (currentDay < cutoffDay) {
+                    proxy.$modal.msgError("每月20号后才能流转");
+                } else {
+                    proxy.$modal.confirm("确定流转到下一月?").then(() => {
+                        transNext().then((res) => {
+                            proxy.$modal.msgSuccess("流转成功");
+                            checkCurrentMonthHandle();
+                        });
+                    });
+                }
+
+            }
+        }
+
+    }
+
+    function handleAddEntrust(data) {
+        addEntrust(data).then((response) => {
+            proxy.$modal.msgSuccess("设置完成!");
+            setEntrustDialogRef.value.cancel();
+            getList();
+        });
+    }
+
+    checkCurrentMonthHandle();
 </script>

+ 165 - 215
src/views/business/entrust/workOrderForFactory/nextMonth/index.vue

@@ -8,125 +8,77 @@
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
-            <el-dropdown-item
-              icon="Download"
-              @click="handleExport"
-              v-if="viewAdviser('business:entrust:workOrder:next:export')"
-            >
-              导出</el-dropdown-item
-            >
+            <el-dropdown-item icon="Download" @click="handleExport"
+              v-if="viewAdviser('business:entrust:workOrder:next:export')">
+              导出</el-dropdown-item>
           </el-dropdown-menu>
         </template>
       </el-dropdown>
     </div>
     <!-- 搜索区 -->
-    <el-form
-      class="list-search-container"
-      size="small"
-      :model="queryParams"
-      ref="queryRef"
-      :inline="true"
-      label-width="68px"
-    >
+    <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
+      label-width="68px">
       <el-form-item label="当前月:">{{
-     moment().add(1, 'month').format("YYYY年MM月")
-      }}</el-form-item>
+        moment().add(1, 'month').format("YYYY年MM月")
+        }}</el-form-item>
       <el-form-item label="客户名称:" prop="companyName">
-        <el-input
-          v-model="queryParams.companyName"
-          placeholder="请输入客户名称"
-          clearable
-          @keyup.enter="handleQuery"
-        />
+        <el-input v-model="queryParams.companyName" placeholder="请输入客户名称" clearable @keyup.enter="handleQuery" />
       </el-form-item>
       <el-form-item label="来源:" prop="fromCompanyName">
         <el-input v-model="queryParams.fromCompanyName" placeholder="请输入来源" clearable @keyup.enter="handleQuery" />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="Search" @click="handleQuery"
-          >搜索</el-button
-        >
+        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
         <el-button icon="Refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
 
     <!-- 列表区 -->
-    <el-table
-      v-loading="loading"
-      :data="list"
-      size="small"
-      border
-      height="100%"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="list" size="small" border height="100%"
+      @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <!-- <el-table-column label="工单号" align="center" prop="workOrderNo" width="200" /> -->
       <el-table-column label="客户名称" align="center" prop="companyName" />
-      <el-table-column
-        label="来源"
-        width="100"
-        align="center"
-        prop="fromCompanyName"
-      />
-      <el-table-column
-        label="税号"
-        align="center"
-        prop="socialCreditCode"
-        width="200"
-      />
+      <el-table-column label="来源" width="100" align="center" prop="fromCompanyName" />
+      <el-table-column label="税号" align="center" prop="socialCreditCode" width="200" />
       <el-table-column label="工单类型" align="center" prop="amount" width="80">
         <template #default="scope">
           {{ scope.row.type === 1 ? "循环工单" : "代办工单" }}
         </template>
       </el-table-column>
-      <el-table-column
-        label="项目"
-        align="center"
-        prop="taskTypeName"
-        width="140"
-      >
+      <el-table-column label="项目" align="center" prop="taskTypeName" width="140">
         <template #default="scope">
           {{ scope.row.taskTypeName }}
           {{
-            scope.row.taskTypeDetailName
-              ? `-${scope.row.taskTypeDetailName}`
-              : ""
+          scope.row.taskTypeDetailName
+          ? `-${scope.row.taskTypeDetailName}`
+          : ""
           }}
         </template>
       </el-table-column>
-      <el-table-column
-        label="起始月"
-        align="center"
-        width="90"
-        prop="startMonth"
-      >
+      <el-table-column label="起始月" align="center" width="90" prop="startMonth">
         <template #default="scope">
           {{
-            scope.row.type === 1
-              ? scope.row.startMonth
-                ? moment(scope.row.startMonth).format("YYYY年MM月")
-                : ""
-              : "-"
+          scope.row.type === 1
+          ? scope.row.startMonth
+          ? moment(scope.row.startMonth).format("YYYY年MM月")
+          : ""
+          : "-"
           }}
         </template>
       </el-table-column>
       <el-table-column label="结束月" align="center" width="90" prop="endMonth">
         <template #default="scope">
           {{
-            scope.row.type === 1
-              ? scope.row.endMonth
-                ? moment(scope.row.endMonth).format("YYYY年MM月")
-                : ""
-              : "-"
+          scope.row.type === 1
+          ? scope.row.endMonth
+          ? moment(scope.row.endMonth).format("YYYY年MM月")
+          : ""
+          : "-"
           }}
         </template>
       </el-table-column>
-      <el-table-column
-        label="工单月数"
-        align="center"
-        width="80"
-        prop="monthNum"
-      >
+      <el-table-column label="工单月数" align="center" width="80" prop="monthNum">
         <template #default="scope">
           {{ scope.row.type === 1 ? scope.row.monthNum : "-" }}
         </template>
@@ -134,176 +86,174 @@
       <el-table-column label="工单执行人" align="center" width="150">
         <template #default="scope">
           {{
-            scope.row.entrust != null
-              ? scope.row.entrust.toAccountName
-              : scope.row.serviceName
+          scope.row.entrust != null
+          ? scope.row.entrust.toAccountName
+          : scope.row.serviceName
           }}
         </template>
       </el-table-column>
     </el-table>
     <exports ref="exportRef" :get-list="getList"></exports>
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
   </div>
 </template>
 
-<script setup name="Company">
-import { getToken, getTenant } from "@/utils/auth";
-import useUserStore from "@/store/modules/user";
+<script setup name="NextWorkOrderForFactory">
+  import { getToken, getTenant } from "@/utils/auth";
+  import useUserStore from "@/store/modules/user";
 
-import {
-  listFactoryNextWorkOrder,
-  checkCurrent,
-  exportNextWorkOrder,
-  delEntrust,
-  addEntrust,
-} from "@/api/business/entrust/nextWorkOrder";
+  import {
+    listFactoryNextWorkOrder,
+    checkCurrent,
+    exportNextWorkOrder,
+    delEntrust,
+    addEntrust,
+  } from "@/api/business/entrust/nextWorkOrder";
 
-import{exportNextFactory} from  "@/api/business/entrust/currentWorkOrder";
-const { proxy } = getCurrentInstance();
+  import { exportNextFactory } from "@/api/business/entrust/currentWorkOrder";
+  const { proxy } = getCurrentInstance();
 
-const currentMonth = ref(null);
-/** 字典数组区 */
-/** 查询 对象 */
+  const currentMonth = ref(null);
+  /** 字典数组区 */
+  /** 查询 对象 */
 
-const list = ref([]);
-const loading = ref(true);
-const ids = ref([]);
-const selections = ref([]);
-const single = ref(false);
-const multiple = ref(false);
-const permissions = useUserStore().permissions;
-const all_permission = "*:*:*";
-const total = ref(0);
-const prev = ref([]);
+  const list = ref([]);
+  const loading = ref(true);
+  const ids = ref([]);
+  const selections = ref([]);
+  const single = ref(false);
+  const multiple = ref(false);
+  const permissions = useUserStore().permissions;
+  const all_permission = "*:*:*";
+  const total = ref(0);
+  const prev = ref([]);
 
-const initMonthDialogRef = ref(null);
-const setEntrustDialogRef = ref(null);
+  const initMonthDialogRef = ref(null);
+  const setEntrustDialogRef = ref(null);
 
-const showInitMonth = ref(false);
+  const showInitMonth = ref(false);
 
-const { contract_verify_status } = proxy.useDict("contract_verify_status");
-const { contract_status } = proxy.useDict("contract_status");
-/** 查询对象 */
-const queryParams = ref({
-  pageNum: 1,
-  pageSize: 20,
-  companyName: "",
-  noContract: 0,
-  toTenantId: getTenant(),
-  type: 1,
-});
-
-const editStatus = {
-  startMonth: false,
-};
+  const { contract_verify_status } = proxy.useDict("contract_verify_status");
+  const { contract_status } = proxy.useDict("contract_status");
+  /** 查询对象 */
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    companyName: "",
+    noContract: 0,
+    toTenantId: getTenant(),
+    type: 1,
+  });
 
-function checkCurrentMonthHandle() {
-  checkCurrent().then((res) => {
-    if (res.data.checkResult === true) {
-      setCurrentMonth(res.data.currentMonth);
-      
-      getList();
-    } else {
-      proxy.$modal.msgError("未设置当前月,请设置本月");
-    }
+  const editStatus = {
+    startMonth: false,
+  };
+  onActivated(() => {
+    // 你的逻辑
+    getList();
   });
-}
+  function checkCurrentMonthHandle() {
+    checkCurrent().then((res) => {
+      if (res.data.checkResult === true) {
+        setCurrentMonth(res.data.currentMonth);
 
-function showInitMonthDialog() {
-  initMonthDialogRef.value.open();
-}
+        getList();
+      } else {
+        proxy.$modal.msgError("未设置当前月,请设置本月");
+      }
+    });
+  }
 
-/***********************  方法区  ****************************/
+  function showInitMonthDialog() {
+    initMonthDialogRef.value.open();
+  }
 
-/** 查询company列表 */
-function getList() {
-  loading.value = true;
-  queryParams.value.currentMonth = currentMonth.value;
-  listFactoryNextWorkOrder(queryParams.value).then((response) => {
-    list.value = response.rows;
-    total.value = response.total;
-    loading.value = false;
-  });
-}
+  /***********************  方法区  ****************************/
 
-//判断是否有权限
-function viewAdviser(quer) {
-  return permissions.includes(all_permission) || permissions.includes(quer);
-}
+  /** 查询company列表 */
+  function getList() {
+    loading.value = true;
+    queryParams.value.currentMonth = currentMonth.value;
+    listFactoryNextWorkOrder(queryParams.value).then((response) => {
+      list.value = response.rows;
+      total.value = response.total;
+      loading.value = false;
+    });
+  }
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
+  //判断是否有权限
+  function viewAdviser(quer) {
+    return permissions.includes(all_permission) || permissions.includes(quer);
+  }
 
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm("queryRef");
-  handleQuery();
-}
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
+  }
 
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  selections.value = selection;
-  single.value = selection.length != 1;
-  multiple.value = selection.length > 0;
-}
+  /** 重置按钮操作 */
+  function resetQuery() {
+    proxy.resetForm("queryRef");
+    handleQuery();
+  }
 
-/** 导出按钮操作 */
-function handleExport() {
-  exportNextFactory(queryParams.value);
-}
+  // 多选框选中数据
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    selections.value = selection;
+    single.value = selection.length != 1;
+    multiple.value = selection.length > 0;
+  }
 
-function setCurrentMonth(month) {
+  /** 导出按钮操作 */
+  function handleExport() {
+    exportNextFactory(queryParams.value);
+  }
+
+  function setCurrentMonth(month) {
 
-  
-  currentMonth.value = proxy.moment().add(1, 'month').format("YYYY-MM")+"-01";
-}
 
-function setEntrustHandle() {
-  if (!multiple.value) {
-    proxy.$modal.msgError("请选择一条记录!");
-    return;
+    currentMonth.value = proxy.moment().add(1, 'month').format("YYYY-MM") + "-01";
   }
-  setEntrustDialogRef.value.open({
-    selections: selections.value,
-    optionCurrentMonth: currentMonth.value,
-  });
-}
 
-function delEntrustHandle() {
-  if (!multiple.value) {
-    proxy.$modal.msgError("请选择一条记录!");
-    return;
+  function setEntrustHandle() {
+    if (!multiple.value) {
+      proxy.$modal.msgError("请选择一条记录!");
+      return;
+    }
+    setEntrustDialogRef.value.open({
+      selections: selections.value,
+      optionCurrentMonth: currentMonth.value,
+    });
   }
-  const entrust = {
-    workMonth: currentMonth.value,
-    workOrderIds: ids.value,
-  };
-  proxy.$modal.confirm("是否确认取消委托?").then(() => {
-    delEntrust(entrust).then((res) => {
-      proxy.$modal.msgSuccess("取消成功");
-      getList();
+
+  function delEntrustHandle() {
+    if (!multiple.value) {
+      proxy.$modal.msgError("请选择一条记录!");
+      return;
+    }
+    const entrust = {
+      workMonth: currentMonth.value,
+      workOrderIds: ids.value,
+    };
+    proxy.$modal.confirm("是否确认取消委托?").then(() => {
+      delEntrust(entrust).then((res) => {
+        proxy.$modal.msgSuccess("取消成功");
+        getList();
+      });
     });
-  });
-}
+  }
 
-function handleAddEntrust(data) {
-  addEntrust(data).then((response) => {
-    proxy.$modal.msgSuccess("设置完成!");
-    setEntrustDialogRef.value.cancel();
-    getList();
-  });
-}
+  function handleAddEntrust(data) {
+    addEntrust(data).then((response) => {
+      proxy.$modal.msgSuccess("设置完成!");
+      setEntrustDialogRef.value.cancel();
+      getList();
+    });
+  }
 
-checkCurrentMonthHandle();
-</script>
+  checkCurrentMonthHandle();
+</script>

+ 140 - 180
src/views/business/entrust/workOrderForFactory/once/index.vue

@@ -8,235 +8,195 @@
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
-            <el-dropdown-item
-              icon="Download"
-              @click="handleExport"
-              v-if="viewAdviser('business:entrust:workOrder:once:export')"
-            >
-              导出</el-dropdown-item
-            >
+            <el-dropdown-item icon="Download" @click="handleExport"
+              v-if="viewAdviser('business:entrust:workOrder:once:export')">
+              导出</el-dropdown-item>
           </el-dropdown-menu>
         </template>
       </el-dropdown>
     </div>
     <!-- 搜索区 -->
-    <el-form
-      class="list-search-container"
-      size="small"
-      :model="queryParams"
-      ref="queryRef"
-      :inline="true"
-      label-width="68px"
-    >
+    <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
+      label-width="68px">
       <el-form-item label="客户名称:" prop="companyName">
-        <el-input
-          v-model="queryParams.companyName"
-          placeholder="请输入客户名称"
-          clearable
-          @keyup.enter="handleQuery"
-        />
+        <el-input v-model="queryParams.companyName" placeholder="请输入客户名称" clearable @keyup.enter="handleQuery" />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="Search" @click="handleQuery"
-          >搜索</el-button
-        >
+        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
         <el-button icon="Refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
 
     <!-- 列表区 -->
-    <el-table
-      v-loading="loading"
-      :data="list"
-      size="small"
-      border
-      height="100%"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="list" size="small" border height="100%"
+      @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <!-- <el-table-column label="工单号" align="center" prop="workOrderNo" width="200" /> -->
       <el-table-column label="客户名称" align="center" prop="companyName" />
-      <el-table-column
-        label="税号"
-        align="center"
-        prop="socialCreditCode"
-        width="200"
-      />
-      <el-table-column
-        label="来源"
-        align="center"
-        width="100"
-        prop="fromCompanyName"
-      />
+      <el-table-column label="税号" align="center" prop="socialCreditCode" width="200" />
+      <el-table-column label="来源" align="center" width="100" prop="fromCompanyName" />
       <el-table-column label="工单类型" align="center" prop="amount" width="80">
         <template #default="scope">
           {{ scope.row.type === 1 ? "循环工单" : "代办工单" }}
         </template>
       </el-table-column>
-      <el-table-column
-        label="项目"
-        align="center"
-        prop="taskTypeName"
-        width="140"
-      >
+      <el-table-column label="项目" align="center" prop="taskTypeName" width="140">
         <template #default="scope">
           {{ scope.row.noContract === 1 ? scope.row.remark : "" }}
           {{ scope.row.taskTypeName }}
           {{
-            scope.row.taskTypeDetailName
-              ? `-${scope.row.taskTypeDetailName}`
-              : ""
+          scope.row.taskTypeDetailName
+          ? `-${scope.row.taskTypeDetailName}`
+          : ""
           }}
         </template>
       </el-table-column>
       <el-table-column label="工单执行人" align="center" width="100">
         <template #default="scope">
           {{
-            scope.row.entrust != null
-              ? scope.row.entrust.toAccountName
-              : scope.row.serviceName
+          scope.row.entrust != null
+          ? scope.row.entrust.toAccountName
+          : scope.row.serviceName
           }}
         </template>
       </el-table-column>
     </el-table>
     <!-- <contract-form ref="contractRef" :get-list="getList" /> -->
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
   </div>
 </template>
 
 <script setup name="Company">
-import { getTenant } from "@/utils/auth";
-import useUserStore from "@/store/modules/user";
-
-import {
-  listFactoryOnceWorkOrder,
-  checkCurrent,
-  exportOnceWorkOrder,
-  delEntrust,
-  transNext,
-  addEntrust,
-} from "@/api/business/entrust/onceWorkOrder";
-const { proxy } = getCurrentInstance();
-/** 字典数组区 */
-/** 查询 对象 */
-
-const list = ref([]);
-const loading = ref(true);
-const ids = ref([]);
-const selections = ref([]);
-const single = ref(false);
-const permissions = useUserStore().permissions;
-const all_permission = "*:*:*";
-const multiple = ref(false);
-const total = ref(0);
-const prev = ref([]);
-
-const setEntrustDialogRef = ref(null);
-
-const { contract_verify_status } = proxy.useDict("contract_verify_status");
-const { contract_status } = proxy.useDict("contract_status");
-/** 查询对象 */
-const queryParams = ref({
-  pageNum: 1,
-  pageSize: 20,
-  companyName: "",
-  toTenantId: getTenant(),
-  type: 2,
-});
-
-const editStatus = {
-  startMonth: false,
-};
-
-/***********************  方法区  ****************************/
-
-/** 查询company列表 */
-function getList() {
-  loading.value = true;
-  listFactoryOnceWorkOrder(queryParams.value).then((response) => {
-    list.value = response.rows;
-    total.value = response.total;
-    loading.value = false;
+  import { getTenant } from "@/utils/auth";
+  import useUserStore from "@/store/modules/user";
+
+  import {
+    listFactoryOnceWorkOrder,
+    checkCurrent,
+    exportOnceWorkOrder,
+    delEntrust,
+    transNext,
+    addEntrust,
+  } from "@/api/business/entrust/onceWorkOrder";
+  const { proxy } = getCurrentInstance();
+  /** 字典数组区 */
+  /** 查询 对象 */
+
+  const list = ref([]);
+  const loading = ref(true);
+  const ids = ref([]);
+  const selections = ref([]);
+  const single = ref(false);
+  const permissions = useUserStore().permissions;
+  const all_permission = "*:*:*";
+  const multiple = ref(false);
+  const total = ref(0);
+  const prev = ref([]);
+
+  const setEntrustDialogRef = ref(null);
+
+  const { contract_verify_status } = proxy.useDict("contract_verify_status");
+  const { contract_status } = proxy.useDict("contract_status");
+  /** 查询对象 */
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    companyName: "",
+    toTenantId: getTenant(),
+    type: 2,
   });
-}
 
-//判断是否有权限
-function viewAdviser(quer) {
-  return permissions.includes(all_permission) || permissions.includes(quer);
-}
+  const editStatus = {
+    startMonth: false,
+  };
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
+  /***********************  方法区  ****************************/
+
+  /** 查询company列表 */
+  function getList() {
+    loading.value = true;
+    listFactoryOnceWorkOrder(queryParams.value).then((response) => {
+      list.value = response.rows;
+      total.value = response.total;
+      loading.value = false;
+    });
+  }
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
-
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm("queryRef");
-  handleQuery();
-}
-
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  selections.value = selection;
-  single.value = selection.length != 1;
-  multiple.value = selection.length > 0;
-}
-
-/** 导出按钮操作 */
-function handleExport() {
-  exportOnceWorkOrder(queryParams.value);
-}
-
-function setEntrustHandle() {
-  if (!multiple.value) {
-    proxy.$modal.msgError("请选择一条记录!");
-    return;
+  //判断是否有权限
+  function viewAdviser(quer) {
+    return permissions.includes(all_permission) || permissions.includes(quer);
+  }
+
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
   }
-  setEntrustDialogRef.value.open({ selections: selections.value });
-}
 
-function delEntrustHandle() {
-  if (!multiple.value) {
-    proxy.$modal.msgError("请选择一条记录!");
-    return;
+  /** 重置按钮操作 */
+  function resetQuery() {
+    proxy.resetForm("queryRef");
+    handleQuery();
   }
-  const entrust = {
-    workOrderIds: ids.value,
-  };
-  proxy.$modal.confirm("是否确认取消委托?").then(() => {
-    delEntrust(entrust).then((res) => {
-      proxy.$modal.msgSuccess("取消成功");
-      getList();
+
+  // 多选框选中数据
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    selections.value = selection;
+    single.value = selection.length != 1;
+    multiple.value = selection.length > 0;
+  }
+
+  /** 导出按钮操作 */
+  function handleExport() {
+    exportOnceWorkOrder(queryParams.value);
+  }
+
+  function setEntrustHandle() {
+    if (!multiple.value) {
+      proxy.$modal.msgError("请选择一条记录!");
+      return;
+    }
+    setEntrustDialogRef.value.open({ selections: selections.value });
+  }
+
+  function delEntrustHandle() {
+    if (!multiple.value) {
+      proxy.$modal.msgError("请选择一条记录!");
+      return;
+    }
+    const entrust = {
+      workOrderIds: ids.value,
+    };
+    proxy.$modal.confirm("是否确认取消委托?").then(() => {
+      delEntrust(entrust).then((res) => {
+        proxy.$modal.msgSuccess("取消成功");
+        getList();
+      });
     });
-  });
-}
+  }
 
-function handleAddEntrust(data) {
-  addEntrust(data).then((response) => {
-    proxy.$modal.msgSuccess("设置完成!");
-    setEntrustDialogRef.value.cancel();
-    getList();
-  });
-}
+  function handleAddEntrust(data) {
+    addEntrust(data).then((response) => {
+      proxy.$modal.msgSuccess("设置完成!");
+      setEntrustDialogRef.value.cancel();
+      getList();
+    });
+  }
 
-function transEntrustHandler() {
-  proxy.$modal.confirm("确定流转到下一月?").then(() => {
-    transNext().then((res) => {
-      proxy.$modal.msgSuccess("流转成功");
-      checkCurrentMonthHandle();
+  function transEntrustHandler() {
+    proxy.$modal.confirm("确定流转到下一月?").then(() => {
+      transNext().then((res) => {
+        proxy.$modal.msgSuccess("流转成功");
+        checkCurrentMonthHandle();
+      });
     });
-  });
-}
+  }
 
-getList();
-</script>
+  getList();
+</script>

+ 465 - 738
src/views/business/financial/collection/form.vue

@@ -4,47 +4,21 @@
     <el-drawer :title="title" v-model="visible" direction="rtl" size="100%">
       <div class="page-container form-container">
         <div class="form-btns-container">
-          <span class="title-label"
-            ><el-icon>
+          <span class="title-label"><el-icon>
               <Document />
             </el-icon>
-            付款信息</span
-          >
+            付款信息</span>
 
-          <el-button
-            v-if="editStatus"
-            type="primary"
-            size="small"
-            icon="Finished"
-            @click="submitForm"
-            >保存</el-button
-          >
-          <el-button
-            v-show="!editStatus && form.verifyDate == null"
-            type="warning"
-            size="small"
-            icon="Edit"
-            v-hasPermi="['business:collection:edit']"
-            @click="editStatus = true"
-            >修改</el-button
-          >
-          <el-button
-            v-if="form.id && editStatus"
-            type="info"
-            size="small"
-            icon="Close"
-            @click="editStatus = false"
-            >取消修改</el-button
-          >
-          <el-button
-            v-show="form.id && !editStatus && form.verifyDate == null"
-            v-hasPermi="['business:collection:verify']"
-            type="primary"
-            size="small"
-            icon="Check"
-            @click="verifyHandler"
-            >收款审核</el-button
-          >
+          <el-button v-if="editStatus" type="primary" size="small" icon="Finished" @click="submitForm">保存</el-button>
+          <el-button v-show="form.status == 1 " type="warning" size="small" icon="Finished"
+            @click="returnZero"  v-hasPermi="['business:collection:return']">退回</el-button> 
+          <el-button v-show="!editStatus && form.verifyDate == null " type="warning" size="small" icon="Edit"
+            v-hasPermi="['business:collection:edit']" @click="editStatus = true">修改</el-button>
+          <el-button v-if="form.id && editStatus" type="info" size="small" icon="Close"
+            @click="editStatus = false">取消修改</el-button>
+          <el-button v-show="form.id && !editStatus && form.verifyDate == null"
+            v-hasPermi="['business:collection:verify']" type="primary" size="small" icon="Check"
+            @click="verifyHandler">收款审核</el-button>
 
           <div class="screen-btn" @click="handleScreen">
             <template v-if="!isFullscreen">
@@ -61,67 +35,37 @@
             <!-- <span>关闭</span> -->
           </div>
         </div>
-        <div
-          class="Y-scrollbar"
-          style="
+        <div class="Y-scrollbar" style="
             position: absolute;
             top: 32px;
             bottom: 0;
             width: 100%;
             overflow: auto;
-          "
-        ></div>
-        <el-form
-          ref="orderRef"
-          class="master-container"
-          size="small"
-          :model="form"
-          :rules="rules"
-          label-width="100px"
-        >
+          "></div>
+        <el-form ref="orderRef" class="master-container" size="small" :model="form" :rules="rules" label-width="100px">
           <el-row :gutter="30">
             <el-col :span="6">
               <el-form-item label="收款流水号:">
-                <el-input
-                  v-if="editStatus"
-                  v-model.trim="form.flowNo"
-                  readonly
-                  size="small"
-                  type="text"
-                  placeholder="收款流水号"
-                  :clearable="true"
-                />
+                <el-input v-if="editStatus" v-model.trim="form.flowNo" readonly size="small" type="text"
+                  placeholder="收款流水号" :clearable="true" />
                 <span v-else>{{ form.flowNo }}</span>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="收款账户:" prop="subsidiaryName">
-                <el-autocomplete
-                  v-if="editStatus"
-                  :fetch-suggestions="querySearchAccountAsync"
-                  :trigger-on-focus="true"
-                  v-model="form.subsidiaryName"
-                  placeholder="请输入收款账户"
-                  style="width: 100%"
-                  popper-class="my-autocomplete"
-                  @select="handleSelectAccount"
-                >
+                <el-autocomplete v-if="editStatus" :fetch-suggestions="querySearchAccountAsync" :trigger-on-focus="true"
+                  v-model="form.subsidiaryName" placeholder="请输入收款账户" style="width: 100%" popper-class="my-autocomplete"
+                  @select="handleSelectAccount">
                   <template #default="{ item }">
-                    <div
-                      style="
+                    <div style="
                         display: flex;
                         flex-direction: row;
                         justify-content: space-between;
-                      "
-                    >
+                      ">
                       <div class="name" style="font-size: 12px">
                         {{ item.name }}
                       </div>
-                      <span
-                        class="code"
-                        style="font-size: 10px; color: darkgrey"
-                        >{{ item.code }}</span
-                      >
+                      <span class="code" style="font-size: 10px; color: darkgrey">{{ item.code }}</span>
                     </div>
                   </template>
                 </el-autocomplete>
@@ -130,95 +74,55 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="收款开户行:" prop="subsidiaryBankName">
-                <el-input
-                  v-if="editStatus"
-                  v-model.trim="form.subsidiaryBankName"
-                  size="small"
-                  type="text"
-                  placeholder="开户行"
-                  :clearable="true"
-                  :readonly="true"
-                />
+                <el-input v-if="editStatus" v-model.trim="form.subsidiaryBankName" size="small" type="text"
+                  placeholder="开户行" :clearable="true" :readonly="true" />
                 <span v-else>{{ form.subsidiaryBankName }}</span>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="收款账号:" prop="subsidiaryBankAccount">
-                <el-input
-                  v-if="editStatus"
-                  v-model.trim="form.subsidiaryBankAccount"
-                  size="small"
-                  type="text"
-                  placeholder="账号"
-                  :clearable="true"
-                  :readonly="true"
-                />
+                <el-input v-if="editStatus" v-model.trim="form.subsidiaryBankAccount" size="small" type="text"
+                  placeholder="账号" :clearable="true" :readonly="true" />
                 <span v-else>{{ form.subsidiaryBankAccount }}</span>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="付款名称:" prop="applyName">
-                <el-input
-                  v-if="editStatus"
-                  v-model.trim="form.applyName"
-                  size="small"
-                  type="text"
-                  placeholder="付款名称"
-                  :clearable="true"
-                />
+                <el-input v-if="editStatus" v-model.trim="form.applyName" size="small" type="text" placeholder="付款名称"
+                  :clearable="true" />
                 <span v-else>{{ form.applyName }}</span>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="付款账号:" prop="appyAccount">
-                <el-input
-                  v-if="editStatus"
-                  v-model.trim="form.appyAccount"
-                  size="small"
-                  type="text"
-                  placeholder="付款账号"
-                  :clearable="true"
-                />
+                <el-input v-if="editStatus" v-model.trim="form.appyAccount" size="small" type="text" placeholder="付款账号"
+                  :clearable="true" />
                 <span v-else>{{ form.appyAccount }}</span>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="到账日期:" prop="arriveDate">
-                <el-date-picker
-                  v-if="editStatus"
-                  v-model.trim="form.arriveDate"
-                  size="small"
-                  :clearable="true"
-                  style="width: 100%"
-                  format="YYYY-MM-DD"
-                  value-format="YYYY-MM-DD HH:mm:ss"
-                  align="center"
-                  type="date"
-                  placeholder="到账日期"
-                />
+                <el-date-picker v-if="editStatus" v-model.trim="form.arriveDate" size="small" :clearable="true"
+                  style="width: 100%" format="YYYY-MM-DD" value-format="YYYY-MM-DD HH:mm:ss" align="center" type="date"
+                  placeholder="到账日期" />
                 <span v-else>{{ form.arriveDate }}</span>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="到账时间:" prop="arriveTime">
-                <el-time-select
-                  v-if="editStatus"
-                  style="width: 100%"
-                  v-model.trim="form.arriveTime"
-                  :picker-options="timeOptions"
-                  placeholder="选择时间"
-                />
+                <el-time-select v-if="editStatus" style="width: 100%" v-model.trim="form.arriveTime"
+                  :picker-options="timeOptions" placeholder="选择时间" />
                 <span v-else>{{ form.arriveTime }}</span>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="客户名称:" prop="companyName">
-                <el-link :underline="false" type="primary" @click="handleInfo(form)" >{{ form.companyName }}</el-link>
+                <el-link :underline="false" type="primary" @click="handleInfo(form)">{{ form.companyName }}</el-link>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="合同编号:" prop="remark">
-                <el-link :underline="false" type="primary" @click="handleContract(form)" >{{ form.contractNo }}</el-link>
+                <el-link :underline="false" type="primary" @click="handleContract(form)">{{ form.contractNo }}</el-link>
               </el-form-item>
             </el-col>
             <el-col :span="6">
@@ -233,17 +137,8 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="收款金额:" required>
-                <el-input-number
-                  v-if="editStatus"
-                  v-model.trim="form.arriveAmount"
-                  size="small"
-                  placeholder="收款金额"
-                  :clearable="true"
-                  :precision="2"
-                  controls-position="right"
-                  :controls="false"
-                  @change="amountChange"
-                />
+                <el-input-number v-if="editStatus" v-model.trim="form.arriveAmount" size="small" placeholder="收款金额"
+                  :clearable="true" :precision="2" controls-position="right" :controls="false" @change="amountChange" />
                 <span>{{ rowNum(form.arriveAmount) }}</span>
               </el-form-item>
             </el-col>
@@ -251,7 +146,7 @@
               <el-form-item label="订单备注:">
                 <span style="word-break: break-all">{{
                   form.orderRemark
-                }}</span>
+                  }}</span>
               </el-form-item>
             </el-col>
             <el-col v-if="form.status === 1" :span="6">
@@ -266,22 +161,16 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="收款备注:">
-                <el-input
-                  v-if="editStatus"
-                  v-model.trim="form.remark"
-                  size="small"
-                  type="text"
-                  placeholder="收款备注"
-                  :clearable="true"
-                />
+                <el-input v-if="editStatus" v-model.trim="form.remark" size="small" type="text" placeholder="收款备注"
+                  :clearable="true" />
                 <span v-else style="word-break: break-all">{{
                   form.remark
-                }}</span>
+                  }}</span>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="签单类型:" prop="isNew">
-                <el-radio-group v-model="form.isNew" disabled  v-if="editStatus">
+                <el-radio-group v-model="form.isNew" disabled v-if="editStatus">
                   <el-radio :label="0">新签</el-radio>
                   <el-radio :label="1">续签</el-radio>
                 </el-radio-group>
@@ -289,8 +178,8 @@
               </el-form-item>
             </el-col>
             <el-col :span="6">
-              <el-form-item label="是否为项目:" prop="isProject" >
-                <el-radio-group v-model="form.isProject" disabled  v-if="editStatus">
+              <el-form-item label="是否为项目:" prop="isProject">
+                <el-radio-group v-model="form.isProject" disabled v-if="editStatus">
                   <el-radio :label="0">项目</el-radio>
                   <el-radio :label="1">非项目</el-radio>
                 </el-radio-group>
@@ -299,51 +188,33 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="项目编号:" prop="projectNo">
-                <el-input
-                v-if="editStatus"
-                v-model.trim="form.projectNo"
-                size="small"
-                type="text"
-                placeholder="项目编号"
-                :clearable="true"
-              />
-                  <span v-else>{{ form.projectNo }}</span>
+                <el-input v-if="editStatus" v-model.trim="form.projectNo" size="small" type="text" placeholder="项目编号"
+                  :clearable="true" />
+                <span v-else>{{ form.projectNo }}</span>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="项目名称:" prop="projectName">
-                <el-input
-                v-if="editStatus"
-                v-model.trim="form.projectName"
-                size="small"
-                type="text"
-                placeholder="项目名称"
-                :clearable="true"
-              />
-              <span v-else>{{ form.projectName }}</span>
+                <el-input v-if="editStatus" v-model.trim="form.projectName" size="small" type="text" placeholder="项目名称"
+                  :clearable="true" />
+                <span v-else>{{ form.projectName }}</span>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="项目主体名称:" prop="projectMainName">
-                    <el-input
-                      v-if="editStatus"
-                      v-model.trim="form.projectMainName"
-                      size="small"
-                      type="text"
-                      placeholder="项目主体名称"
-                      :clearable="true"
-                    />
-                    <span v-else>{{ form.projectMainName }}</span>
+                <el-input v-if="editStatus" v-model.trim="form.projectMainName" size="small" type="text"
+                  placeholder="项目主体名称" :clearable="true" />
+                <span v-else>{{ form.projectMainName }}</span>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="审核时间" prop="verifyDate">
-                  <span>{{ form.verifyDate }}</span>
+                <span>{{ form.verifyDate }}</span>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="制表时间" prop="createTime">
-                  <span>{{ form.createTime }}</span>
+                <span>{{ form.createTime }}</span>
               </el-form-item>
             </el-col>
             <el-col :span="6">
@@ -362,87 +233,39 @@
                 </div>
               </div>
               <div class="details-body">
-                <el-table
-                  ref="filesTable"
-                  :data="form.details"
-                  size="small"
-                  height="100%"
-                  border
-                  header-row-class-name="list-header-row"
-                  highlight-current-row
-                >
-                  <el-table-column
-                    type="index"
-                    label="序号"
-                    width="47"
-                    align="center"
-                  />
-                  <el-table-column
-                    label="任务名称"
-                    prop="taskTypeName"
-                    align="center"
-                    show-overflow-tooltip
-                  >
-                  
+                <el-table ref="filesTable" :data="form.details" size="small" height="100%" border
+                  header-row-class-name="list-header-row" highlight-current-row>
+                  <el-table-column type="index" label="序号" width="47" align="center" />
+                  <el-table-column label="任务名称" prop="taskTypeName" align="center" show-overflow-tooltip>
+
                   </el-table-column>
-                  <el-table-column
-                  label="说明"
-                  prop="explain"
-                  align="center"
-                  show-overflow-tooltip
-                />
-                
-               
-                  <el-table-column
-                    label="任务金额"
-                    prop="amount"
-                    width="150"
-                    header-align="center"
-                    align="right"
-                  >
+                  <el-table-column label="说明" prop="explain" align="center" show-overflow-tooltip />
+
+
+                  <el-table-column label="任务金额" prop="amount" width="150" header-align="center" align="right">
                     <template #default="scope">
                       <span>{{ rowNum(scope.row.amount) }}</span>
                     </template>
                   </el-table-column>
-                  <el-table-column
-                    label="本次收款金额"
-                    prop="arriveAmount"
-                    width="150"
-                    header-align="center"
-                    align="right"
-                  >
+                  <el-table-column label="本次收款金额" prop="arriveAmount" width="150" header-align="center" align="right">
                     <template #default="scope">
                       <template v-if="editStatus">
-                        <el-input-number
-                          v-model="scope.row.arriveAmount"
-                          size="small"
-                          :min="0.0"
-                          placeholder="本次收款金额"
-                          :precision="2"
-                          :controls="false"
-                          style="width: 100%"
-                          @change="
+                        <el-input-number v-model="scope.row.arriveAmount" size="small" :min="0.0" placeholder="本次收款金额"
+                          :precision="2" :controls="false" style="width: 100%" @change="
                             (arg) =>
                               amountChangeHandler(
                                 arg,
                                 scope.row,
                                 'arriveAmount'
                               )
-                          "
-                        />
+                          " />
                       </template>
                       <template v-else>{{
                         rowNum(scope.row.arriveAmount)
-                      }}</template>
+                        }}</template>
                     </template>
                   </el-table-column>
-                  <el-table-column
-                    label="已收款金额"
-                    prop="arrived"
-                    width="150"
-                    align="right"
-                    header-align="center"
-                  >
+                  <el-table-column label="已收款金额" prop="arrived" width="150" align="right" header-align="center">
                     <template #default="scope">
                       <span>{{ rowNum(scope.row.arrived) }}</span>
                     </template>
@@ -461,65 +284,30 @@
             <el-col :span="6">
               <div class="details-head">
                 <div class="title">
-                  <i class="fa fa-th-list" aria-hidden="true" /> 
+                  <i class="fa fa-th-list" aria-hidden="true" />
                   <span style="color: red"><i style="color: red" /> *</span>
                 </div>
-                <el-upload
-                  v-if="editStatus"
-                  action="#"
-                  :http-request="upload"
-                  :with-credentials="true"
-                  :show-file-list="false"
-                  multiple
-                >
-                  <el-button size="small" type="primary" icon="Upload"
-                    >点击上传</el-button
-                  >
+                <el-upload v-if="editStatus" action="#" :http-request="upload" :with-credentials="true"
+                  :show-file-list="false" multiple>
+                  <el-button size="small" type="primary" icon="Upload">点击上传</el-button>
                 </el-upload>
               </div>
               <div class="details-body">
-                <el-table
-                  ref="filesTable"
-                  :data="form.files"
-                  size="small"
-                  height="100%"
-                  border
-                  header-row-class-name="list-header-row"
-                  highlight-current-row
-                >
-                  <el-table-column
-                    type="index"
-                    label="序号"
-                    width="47"
-                    align="center"
-                  />
-                  <el-table-column
-                    label="文件名"
-                    prop="originalFileName"
-                    align="center"
-                    min-width="200"
-                    show-overflow-tooltip
-                  >
+                <el-table ref="filesTable" :data="form.files" size="small" height="100%" border
+                  header-row-class-name="list-header-row" highlight-current-row>
+                  <el-table-column type="index" label="序号" width="47" align="center" />
+                  <el-table-column label="文件名" prop="originalFileName" align="center" min-width="200"
+                    show-overflow-tooltip>
                     <template #default="scope">
-                      <el-button
-                        size="small"
-                        type="primary"
-                        link
-                        @click="openFile(scope.row)"
-                        >{{ scope.row.originalFileName }}</el-button
-                      >
+                      <el-button size="small" type="primary" link @click="openFile(scope.row)">{{
+                        scope.row.originalFileName }}</el-button>
                     </template>
                   </el-table-column>
                   <el-table-column label="操作" min-width="60" align="center">
                     <template #default="scope">
                       <div v-if="editStatus">
-                        <el-button
-                          size="small"
-                          link
-                          type="danger"
-                          @click="handlerDelAttach(scope.row, scope.$index)"
-                          >删除</el-button
-                        >
+                        <el-button size="small" link type="danger"
+                          @click="handlerDelAttach(scope.row, scope.$index)">删除</el-button>
                       </div>
                     </template>
                   </el-table-column>
@@ -530,94 +318,36 @@
         </div>
       </div>
     </el-drawer>
-    <el-dialog
-      title="审核详情"
-      v-model="rejectOpen"
-      width="500px"
-      append-to-body
-      draggable
-      :close-on-click-modal = "false"
-    >
+    <el-dialog title="审核详情" v-model="rejectOpen" width="500px" append-to-body draggable :close-on-click-modal="false">
       <el-form ref="dictRef" :model="form" label-width="100" size="small">
         <el-form-item label="审核状态">
-          <el-select
-            style="width: 100%"
-            v-model.trim="form.status"
-            placeholder="请选择"
-            size="small"
-          >
-            <el-option
-              v-for="i in verified"
-              :key="i.value"
-              :label="i.label"
-              :value="i.value"
-            />
+          <el-select style="width: 100%" v-model.trim="form.status" placeholder="请选择" size="small">
+            <el-option v-for="i in verified" :key="i.value" :label="i.label" :value="i.value" />
           </el-select>
         </el-form-item>
         <el-form-item label="实际付款时间" required>
-          <el-date-picker
-            style="width: 100%"
-            v-model.trim="form.actuallyDate"
-            size="small"
-            :clearable="true"
-            format="YYYY-MM-DD HH:mm:ss"
-            value-format="YYYY-MM-DD HH:mm:ss"
-            align="center"
-            type="datetime"
-            placeholder="实际付款时间"
-          />
+          <el-date-picker style="width: 100%" v-model.trim="form.actuallyDate" size="small" :clearable="true"
+            format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" align="center" type="datetime"
+            placeholder="实际付款时间" />
         </el-form-item>
-        <el-form-item
-          :label="form.status == 2 ? '驳回原因' : '审核意见'"
-          :prop="verifyComment"
-        >
-          <el-input
-            type="textarea"
-            maxlength="200"
-            show-word-limit
-            v-model.trim="form.verifyComment"
-            :rows="3"
-            placeholder="请输入审核意见"
-          />
+        <el-form-item :label="form.status == 2 ? '驳回原因' : '审核意见'" :prop="verifyComment">
+          <el-input type="textarea" maxlength="200" show-word-limit v-model.trim="form.verifyComment" :rows="3"
+            placeholder="请输入审核意见" />
         </el-form-item>
-        <el-form-item label="附件" >
-          <el-upload
-            action="#"
-            :http-request="upload2"
-            :with-credentials="true"
-            :show-file-list="false"
-            multiple
-            :limit="5"
-          >
-            <el-button size="small" type="primary" icon="Upload"
-              >点击上传</el-button
-            >
+        <el-form-item label="附件">
+          <el-upload action="#" :http-request="upload2" :with-credentials="true" :show-file-list="false" multiple
+            :limit="5">
+            <el-button size="small" type="primary" icon="Upload">点击上传</el-button>
           </el-upload>
-          <el-table
-            ref="dbTable"
-            :data="form.evidenceFiles"
-            size="small"
-            border
-            header-row-class-name="list-header-row"
-            row-class-name="list-row"
-          >
-            <el-table-column
-              label="文件名"
-              prop="originalFileName"
-              align="center"
-              show-overflow-tooltip
-            >
+          <el-table ref="dbTable" :data="form.evidenceFiles" size="small" border header-row-class-name="list-header-row"
+            row-class-name="list-row">
+            <el-table-column label="文件名" prop="originalFileName" align="center" show-overflow-tooltip>
               <template #default="scope">
-                <el-button
-                  size="small"
-                  type="text"
-                  @click="openFile(scope.row)"
-                  >{{
-                    scope.row.originalFileName == ""
-                      ? "打开文件"
-                      : scope.row.originalFileName
-                  }}</el-button
-                >
+                <el-button size="small" type="text" @click="openFile(scope.row)">{{
+                  scope.row.originalFileName == ""
+                  ? "打开文件"
+                  : scope.row.originalFileName
+                  }}</el-button>
               </template>
             </el-table-column>
             <!-- <el-table-column
@@ -626,20 +356,10 @@
               prop="fileType"
               align="center"
             /> -->
-            <el-table-column
-              label="操作"
-              width="80"
-              prop="fileType"
-              align="center"
-            >
+            <el-table-column label="操作" width="80" prop="fileType" align="center">
               <template #default="scope">
-                <el-button
-                  size="small"
-                  link
-                  type="danger"
-                  @click="handlerEportFilesDel(scope.row, scope.$index)"
-                  >删除</el-button
-                >
+                <el-button size="small" link type="danger"
+                  @click="handlerEportFilesDel(scope.row, scope.$index)">删除</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -647,16 +367,8 @@
       </el-form>
       <template #footer>
         <div class="dialog-footer">
-          <el-button
-            type="primary"
-            icon="Finished"
-            size="small"
-            @click="verifyUpload()"
-            >确 定</el-button
-          >
-          <el-button icon="Close" size="small" @click="rejectCancel"
-            >取 消</el-button
-          >
+          <el-button type="primary" icon="Finished" size="small" @click="verifyUpload()">确 定</el-button>
+          <el-button icon="Close" size="small" @click="rejectCancel">取 消</el-button>
         </div>
       </template>
     </el-dialog>
@@ -665,380 +377,395 @@
   </div>
 </template>
 <script setup>
-import { uploadFile } from "@/api/tool/file";
-// import {
-//   getOrder,
-//   initTaskTypes,
-//   addOrder,
-//   updateOrder,
-//   verifyOrder,
-//   alterOrder,
-//   dissolutionOrder,
-// } from "@/api/business/crm/contract";
-import {
-  listContract,
-  listAccount,
-  getCollection,
-  getCollectionByContract,
-  saveCollection,
-  verifyCollection,
-} from "@/api/business/financial/collection";
-import { listSource } from "@/api/settings/source";
-import { listCompany } from "@/api/business/crm/company";
-import { listUser } from "@/api/system/user";
-import CustomerFormCom from "@/components/CustomerFormCom";
-import { formatDate } from "@/utils/index";
-import companyForm from "@/views/business/crm/company/formView.vue";
-import contractForm from "@/views/business/crm/order/form.vue";
-import { ref } from "vue";
+  import { uploadFile } from "@/api/tool/file";
+  // import {
+  //   getOrder,
+  //   initTaskTypes,
+  //   addOrder,
+  //   updateOrder,
+  //   verifyOrder,
+  //   alterOrder,
+  //   dissolutionOrder,
+  // } from "@/api/business/crm/contract";
+  import {
+    listContract,
+    listAccount,
+    getCollection,
+    getCollectionByContract,
+    saveCollection,
+    verifyCollection, setCollectionZero,
+  } from "@/api/business/financial/collection";
+  import { listSource } from "@/api/settings/source";
+  import { listCompany } from "@/api/business/crm/company";
+  import { listUser } from "@/api/system/user";
+  import CustomerFormCom from "@/components/CustomerFormCom";
+  import { formatDate } from "@/utils/index";
+  import companyForm from "@/views/business/crm/company/formView.vue";
+  import contractForm from "@/views/business/crm/order/form.vue";
+  import { ref } from "vue";
 
-import useUserStore from "@/store/modules/user";
-const { proxy } = getCurrentInstance();
-const baseUrl = import.meta.env.VITE_APP_BASE_API;
+  import useUserStore from "@/store/modules/user";
+  const { proxy } = getCurrentInstance();
+  const baseUrl = import.meta.env.VITE_APP_BASE_API;
 
-/** 父组件传参 */
-const props = defineProps({
-  getList: {
-    type: Function,
-    default: () => {},
-  },
-});
-const { getList } = toRefs(props);
-/** 字典数组区 */
-const { virtual_address } = proxy.useDict("virtual_address");
-/** 表单抽屉 页变量 */
-const title = ref("");
-const loading = ref(false);
-const multiple = ref(true);
-const visible = ref(false);
-const editStatus = ref(false);
-const sourceCategories = ref([]);
-const type = ref("");
+  /** 父组件传参 */
+  const props = defineProps({
+    getList: {
+      type: Function,
+      default: () => { },
+    },
+  });
+  const { getList } = toRefs(props);
+  /** 字典数组区 */
+  const { virtual_address } = proxy.useDict("virtual_address");
+  /** 表单抽屉 页变量 */
+  const title = ref("");
+  const loading = ref(false);
+  const multiple = ref(true);
+  const visible = ref(false);
+  const editStatus = ref(false);
+  const sourceCategories = ref([]);
+  const type = ref("");
 
-const rejectOpen = ref(false);
+  const rejectOpen = ref(false);
 
-const detailEmpty = {
-  id: null,
-  taskTypeName: "",
-  taskTypeId: null,
-  serviceNum: undefined,
-  freeNum: undefined,
-  price: undefined,
-  amount: undefined,
-  addressStyle: undefined,
-  address: undefined,
-  fictionAddressId: undefined,
-  tenantId: undefined,
-  province: "",
-  city: "",
-  district: "",
-  addressStyle: 1,
-  provinceId: undefined,
-  processes: [],
-  defaultProcesses: [],
-};
-const provinces = ref(proxy.region.getProvinces());
-provinces.value.unshift({ code: "", name: "全部" });
-const cities = ref([]);
-const districts = ref([]);
+  const detailEmpty = {
+    id: null,
+    taskTypeName: "",
+    taskTypeId: null,
+    serviceNum: undefined,
+    freeNum: undefined,
+    price: undefined,
+    amount: undefined,
+    addressStyle: undefined,
+    address: undefined,
+    fictionAddressId: undefined,
+    tenantId: undefined,
+    province: "",
+    city: "",
+    district: "",
+    addressStyle: 1,
+    provinceId: undefined,
+    processes: [],
+    defaultProcesses: [],
+  };
+  const provinces = ref(proxy.region.getProvinces());
+  provinces.value.unshift({ code: "", name: "全部" });
+  const cities = ref([]);
+  const districts = ref([]);
 
-const contractEmpty = {
-  serviceType: 1,
-  contractType: 0,
-  formDate: formatDate(new Date(), "YYYY-MM-DD"),
-  signerId: useUserStore().user.userId,
-  signerName: useUserStore().user.nickName,
-  files: [],
-};
-const isFullscreen = ref(false);
-const webHost = import.meta.env.VITE_APP_BASE_API;
-const data = reactive({
-  form: {},
-  rules: {},
-  timeOptions: { start: "08:30", step: "00:15", end: "18:30" },
-  verified: [
-    {
-      value: 0,
-      label: "未审核",
-    },
-    {
-      value: 1,
-      label: "通过",
-    },
-    {
-      value: 2,
-      label: "不通过",
-    },
-  ],
-});
-const { form, rules, timeOptions, verified } = toRefs(data);
-/***********************  方法区  ****************************/
-/** 打开抽屉 */
-function open(id) {
-  reset();
-  visible.value = true;
-  editStatus.value = true;
-  getCollection(id).then((res) => {
-    form.value = res.data;
-    console.log("form", form.value);
-    editStatus.value = false;
+  const contractEmpty = {
+    serviceType: 1,
+    contractType: 0,
+    formDate: formatDate(new Date(), "YYYY-MM-DD"),
+    signerId: useUserStore().user.userId,
+    signerName: useUserStore().user.nickName,
+    files: [],
+  };
+  const isFullscreen = ref(false);
+  const webHost = import.meta.env.VITE_APP_BASE_API;
+  const data = reactive({
+    form: {},
+    rules: {},
+    timeOptions: { start: "08:30", step: "00:15", end: "18:30" },
+    verified: [
+      {
+        value: 0,
+        label: "未审核",
+      },
+      {
+        value: 1,
+        label: "通过",
+      },
+      {
+        value: 2,
+        label: "不通过",
+      },
+    ],
   });
-}
+  const { form, rules, timeOptions, verified } = toRefs(data);
+  /***********************  方法区  ****************************/
+  /** 打开抽屉 */
+  function open(id) {
+    reset();
+    visible.value = true;
+    editStatus.value = true;
+    getCollection(id).then((res) => {
+      form.value = res.data;
+      console.log("form23", form.value);
+      editStatus.value = false;
+    });
+  }
 
-/** 取消按钮 */
-function cancel() {
-  visible.value = false;
-  reset();
-}
-function handleInfo(row) {
+  /** 取消按钮 */
+  function cancel() {
+    visible.value = false;
+    reset();
+  }
+  function handleInfo(row) {
     proxy.$refs.companyRef.open(row.companyId);
-}
-function handleContract(){
+  }
+  function handleContract() {
     proxy.$refs.contractRef.open(form.value.contractId);
-}
-// 数字格式化
-function rowNum(num) {
-  if (!num) {
-    return;
   }
-  num = num.toLocaleString(); // 3,000
-  if (num.indexOf(".") == -1) {
-    num = num + ".00"; //3,000.00
-  } else if (num.charAt(num.indexOf(".") == num.length - 2)) {
-    num = num + "0";
+  // 数字格式化
+  function rowNum(num) {
+    if (!num) {
+      return;
+    }
+    num = num.toLocaleString(); // 3,000
+    if (num.indexOf(".") == -1) {
+      num = num + ".00"; //3,000.00
+    } else if (num.charAt(num.indexOf(".") == num.length - 2)) {
+      num = num + "0";
+    }
+    return num;
   }
-  return num;
-}
 
-/** 表单重置 */
-function reset() {
-  form.value = JSON.parse(JSON.stringify(contractEmpty));
-  console.log("重置表单", form.value);
-  type.value = "";
-  // console.log(form)
-  // proxy.resetForm("orderRef");
-}
-
-/** 全屏缩放 */
-function handleScreen() {
-  const dom = document.querySelector(
-    ".list-container > .el-drawer__wrapper > .el-overlay"
-  );
-  isFullscreen.value = !isFullscreen.value;
-  dom.style.position = isFullscreen.value ? "fixed" : "absolute";
-}
+  /** 表单重置 */
+  function reset() {
+    form.value = JSON.parse(JSON.stringify(contractEmpty));
+    console.log("重置表单", form.value);
+    type.value = "";
+    // console.log(form)
+    // proxy.resetForm("orderRef");
+  }
 
-/** 提交按钮 */
-function submitForm() {
-  proxy.$refs["orderRef"].validate((valid) => {
-    if (valid && detailValid()) {
-      const formValue = form.value;
-      saveCollection(formValue).then((res) => {
-        open(form.value.id);
+  function returnZero() {
+    form.value.status = 0;
+    proxy.$modal
+      .confirm("是否确认退回")
+      .then(function () {
+        setCollectionZero(form.value.id)
+      })
+      .then(() => {
+        visible.value = false;
         getList.value();
-        proxy.$modal.msgSuccess("保存成功");
-      });
-    }
-  });
-}
-
-function detailValid() {
-  // 20240109 暂时附件非必填。
-  // if (form.value.files.length === 0) {
-  //   proxy.$modal.msgError("收款附件为空");
-  //   return false;
-  // }
-  return true;
-}
-
-/** 查询表单信息  */
-function getForm() {
-  loading.value = true;
-  getOrder(form.value.id).then((response) => {
-    loading.value = false;
-    form.value = response.data;
-  });
-}
-function handleServiceTypeClick(tab) {
-  computedService();
-}
+        proxy.$modal.msgSuccess("退回成功");
+      })
+      .catch(() => { });
+  }
 
-function verifyHandler() {
-  // proxy.$modal
-  //   .confirm("是否确认审核?")
-  //   .then((_) => {
-  //     verifyUpload(1);
-  //   })
-  //   .catch((_) => {
-  //     proxy.$modal.msg("取消审核");
-  //   });
-  rejectOpen.value = true;
-}
+  /** 全屏缩放 */
+  function handleScreen() {
+    const dom = document.querySelector(
+      ".list-container > .el-drawer__wrapper > .el-overlay"
+    );
+    isFullscreen.value = !isFullscreen.value;
+    dom.style.position = isFullscreen.value ? "fixed" : "absolute";
+  }
 
-function rejectHandler() {
-  rejectOpen.value = true;
-}
+  /** 提交按钮 */
+  function submitForm() {
+    proxy.$refs["orderRef"].validate((valid) => {
+      if (valid && detailValid()) {
+        const formValue = form.value;
+        saveCollection(formValue).then((res) => {
+          open(form.value.id);
+          getList.value();
+          proxy.$modal.msgSuccess("保存成功");
+        });
+      }
+    });
+  }
 
-function rejectCancel() {
-  rejectOpen.value = false;
-  rejectReset();
-}
+  function detailValid() {
+    // 20240109 暂时附件非必填。
+    // if (form.value.files.length === 0) {
+    //   proxy.$modal.msgError("收款附件为空");
+    //   return false;
+    // }
+    return true;
+  }
 
-function rejectReset() {}
+  /** 查询表单信息  */
+  function getForm() {
+    loading.value = true;
+    getOrder(form.value.id).then((response) => {
+      loading.value = false;
+      form.value = response.data;
+    });
+  }
+  function handleServiceTypeClick(tab) {
+    computedService();
+  }
 
-function rejectSubmitHandler() {
-  if (form.value.verifyRemark === "" || form.value.verifyRemark == null) {
-    proxy.$modal.msgError("请填写驳回原因");
-    return;
+  function verifyHandler() {
+    // proxy.$modal
+    //   .confirm("是否确认审核?")
+    //   .then((_) => {
+    //     verifyUpload(1);
+    //   })
+    //   .catch((_) => {
+    //     proxy.$modal.msg("取消审核");
+    //   });
+    rejectOpen.value = true;
   }
-}
 
-function verifyUpload() {
-  // const formValue = proxy.deepClone(form.value);
-  // formValue.verifyStatus = status;
-  // formValue.status = status;
-  if (form.value.status === 0) {
-    proxy.$modal.msgError("请选择审核结果");
-    return;
+  function rejectHandler() {
+    rejectOpen.value = true;
   }
-  if (form.value.actuallyDate == null || form.value.actuallyDate === "") {
-    proxy.$modal.msgError("请输入实际付款时间");
-    return;
+
+  function rejectCancel() {
+    rejectOpen.value = false;
+    rejectReset();
   }
-  if (
-    form.value.status === 2 &&
-    (form.value.verifyComment == null || form.value.verifyComment === "")
-  ) {
-    proxy.$modal.msgError("请输入审核意见");
-    return;
+
+  function rejectReset() { }
+
+  function rejectSubmitHandler() {
+    if (form.value.verifyRemark === "" || form.value.verifyRemark == null) {
+      proxy.$modal.msgError("请填写驳回原因");
+      return;
+    }
   }
-  // if (
-  //   form.value.evidenceFiles == null ||
-  //   form.value.evidenceFiles.length === 0 || form.value.evidenceFiles.length>5
-  // ) {
-  //   proxy.$modal.msgError("请上传凭证并至多上传5个");
-  //   return;
-  // }
-  form.value.arriveStatus = form.value.status === 1 ? 1 : 0;
-  verifyCollection(form.value).then((res) => {
-    open(form.value.id);
-    getList.value();
-    rejectCancel();
-    proxy.$modal.mseSuccess("保存成功");
-  });
-}
 
-/** 文件上传 */
-function upload(param) {
-  const fileForm = new FormData();
-  fileForm.append("file", param.file);
-  uploadFile(fileForm).then((res) => {
-    if (res.code === 200) {
-      const file = {};
-      file.fileName = res.newFileName;
-      file.url = res.url;
-      file.originalFileName = res.originalFilename;
-      file.fileUrl = res.fileName;
-      console.log(11212,form.value.files);
-      form.value.files.push(file);
+  function verifyUpload() {
+    // const formValue = proxy.deepClone(form.value);
+    // formValue.verifyStatus = status;
+    // formValue.status = status;
+    if (form.value.status === 0) {
+      proxy.$modal.msgError("请选择审核结果");
+      return;
     }
-  });
-}
-function upload2(param) {
-  const formData = new FormData();
-  formData.append("file", param.file);
-  uploadFile(formData).then((res) => {
-    if (res.code === 200) {
-      const file = {};
-      file.fileName = res.newFileName;
-      file.url = res.url;
-      file.fileType =
-        res.newFileName.split(".")[res.newFileName.split(".").length - 1];
-      file.originalFileName = res.originalFilename;
-      file.fileUrl = res.fileName;
-      console.log(11212,file);
-      if(form.value.evidenceFiles == null){
-        form.value.evidenceFiles = [];
-      }
-      form.value.evidenceFiles.push(file);
+    if (form.value.actuallyDate == null || form.value.actuallyDate === "") {
+      proxy.$modal.msgError("请输入实际付款时间");
+      return;
     }
-  });
-}
-
-function handleDelFile(index) {
-  form.value.files.splice(index, 1);
-}
+    if (
+      form.value.status === 2 &&
+      (form.value.verifyComment == null || form.value.verifyComment === "")
+    ) {
+      proxy.$modal.msgError("请输入审核意见");
+      return;
+    }
+    // if (
+    //   form.value.evidenceFiles == null ||
+    //   form.value.evidenceFiles.length === 0 || form.value.evidenceFiles.length>5
+    // ) {
+    //   proxy.$modal.msgError("请上传凭证并至多上传5个");
+    //   return;
+    // }
+    form.value.arriveStatus = form.value.status === 1 ? 1 : 0;
+    verifyCollection(form.value).then((res) => {
+      open(form.value.id);
+      getList.value();
+      rejectCancel();
+      proxy.$modal.mseSuccess("保存成功");
+    });
+  }
 
-function amountChangeHandler(arg, row, field) {
-  computeTotalAmount();
-}
-function handlerEportFilesDel(row, index) {
-  proxy.$modal
-    .confirm("确定删除吗?")
-    .then((_) => {
-      form.value.evidenceFiles.splice(index, 1);
-    })
-    .catch((_) => {
-      proxy.$modal.msg("已取消删除");
+  /** 文件上传 */
+  function upload(param) {
+    const fileForm = new FormData();
+    fileForm.append("file", param.file);
+    uploadFile(fileForm).then((res) => {
+      if (res.code === 200) {
+        const file = {};
+        file.fileName = res.newFileName;
+        file.url = res.url;
+        file.originalFileName = res.originalFilename;
+        file.fileUrl = res.fileName;
+        console.log(11212, form.value.files);
+        form.value.files.push(file);
+      }
     });
-}
+  }
+  function upload2(param) {
+    const formData = new FormData();
+    formData.append("file", param.file);
+    uploadFile(formData).then((res) => {
+      if (res.code === 200) {
+        const file = {};
+        file.fileName = res.newFileName;
+        file.url = res.url;
+        file.fileType =
+          res.newFileName.split(".")[res.newFileName.split(".").length - 1];
+        file.originalFileName = res.originalFilename;
+        file.fileUrl = res.fileName;
+        console.log(11212, file);
+        if (form.value.evidenceFiles == null) {
+          form.value.evidenceFiles = [];
+        }
+        form.value.evidenceFiles.push(file);
+      }
+    });
+  }
 
-function computeTotalAmount() {
-  let amount = 0;
-  for (let index = 0; index < form.value.details.length; index++) {
-    const element = form.value.details[index];
-    amount += element.arriveAmount == null ? 0 : element.arriveAmount;
+  function handleDelFile(index) {
+    form.value.files.splice(index, 1);
   }
-  form.value.arriveAmount = amount;
-}
 
-function amountChange() {
-  let amount = 0;
-  if (form.value.details.length > 0) {
-    for (let i = 0; i < form.value.details.length; i++) {
-      amount = amount + form.value.details[i].arriveAmount;
+  function amountChangeHandler(arg, row, field) {
+    computeTotalAmount();
+  }
+  function handlerEportFilesDel(row, index) {
+    proxy.$modal
+      .confirm("确定删除吗?")
+      .then((_) => {
+        form.value.evidenceFiles.splice(index, 1);
+      })
+      .catch((_) => {
+        proxy.$modal.msg("已取消删除");
+      });
+  }
+
+  function computeTotalAmount() {
+    let amount = 0;
+    for (let index = 0; index < form.value.details.length; index++) {
+      const element = form.value.details[index];
+      amount += element.arriveAmount == null ? 0 : element.arriveAmount;
     }
-    // 判断到款状态
     form.value.arriveAmount = amount;
-    if (form.value.arriveAmount > 0)
-      form.value.arriveStatus =
-        form.value.arriveAmount === form.value.amount ? 1 : 2;
-    else form.value.arriveStatus = 0;
   }
-}
-function querySearchAccountAsync(queryString, cb) {
-  const query =
-    queryString.length > 0
-      ? { keyword: queryString, pageSize: 20, pageNum: 1 }
-      : { pageSize: 20, pageNum: 1 };
-  listAccount(query).then((res) => {
-    cb(res.rows);
-  });
-}
 
-function handleSelectAccount(item) {
-  form.value.subsidiaryName = item.name;
-  form.value.subsidiaryBankName = item.accountOpen;
-  form.value.subsidiaryBankAccount = item.accountNum;
-}
+  function amountChange() {
+    let amount = 0;
+    if (form.value.details.length > 0) {
+      for (let i = 0; i < form.value.details.length; i++) {
+        amount = amount + form.value.details[i].arriveAmount;
+      }
+      // 判断到款状态
+      form.value.arriveAmount = amount;
+      if (form.value.arriveAmount > 0)
+        form.value.arriveStatus =
+          form.value.arriveAmount === form.value.amount ? 1 : 2;
+      else form.value.arriveStatus = 0;
+    }
+  }
+  function querySearchAccountAsync(queryString, cb) {
+    const query =
+      queryString.length > 0
+        ? { keyword: queryString, pageSize: 20, pageNum: 1 }
+        : { pageSize: 20, pageNum: 1 };
+    listAccount(query).then((res) => {
+      cb(res.rows);
+    });
+  }
 
-function openFile(row) {
-  window.open(`${baseUrl}${row.fileUrl}`);
-}
+  function handleSelectAccount(item) {
+    form.value.subsidiaryName = item.name;
+    form.value.subsidiaryBankName = item.accountOpen;
+    form.value.subsidiaryBankAccount = item.accountNum;
+  }
 
-function handlerDelAttach(row, index) {
-  proxy.$modal
-    .confirm("确认删除该项么?")
-    .then((_) => {
-      form.value.files.splice(index, 1);
-    })
-    .catch((err) => {
-      proxy.$modal.msgError("取消删除");
-    });
-}
+  function openFile(row) {
+    window.open(`${baseUrl}${row.fileUrl}`);
+  }
 
-/** 暴露给父组件的方法 */
-defineExpose({
-  open,
-});
-</script>
+  function handlerDelAttach(row, index) {
+    proxy.$modal
+      .confirm("确认删除该项么?")
+      .then((_) => {
+        form.value.files.splice(index, 1);
+      })
+      .catch((err) => {
+        proxy.$modal.msgError("取消删除");
+      });
+  }
+
+  /** 暴露给父组件的方法 */
+  defineExpose({
+    open,
+  });
+</script>

+ 252 - 362
src/views/business/financial/collection/index.vue

@@ -2,15 +2,8 @@
   <div class="page-container list-container">
     <!-- 功能按钮区 -->
     <div class="list-btns-container">
-      <el-button
-        type="danger"
-        size="small"
-        icon="Delete"
-        :disabled="multiple"
-        @click="handleDelete"
-        v-hasPermi="['business:collection:remove']"
-        >删除</el-button
-      >
+      <el-button type="danger" size="small" icon="Delete" :disabled="multiple" @click="handleDelete"
+        v-hasPermi="['business:collection:remove']">删除</el-button>
 
       <el-dropdown trigger="click">
         <el-button type="primary" size="small">
@@ -18,50 +11,33 @@
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
-            <el-dropdown-item
-              icon="Download"
-              @click="handleExport"
-              v-hasPermi="['business:collection:export']"
-            >
-              导出</el-dropdown-item
-            >
-            <el-dropdown-item
-              icon="Upload"
-              @click="handleImport"
-              v-hasPermi="['business:collection:import']"
-              >导入</el-dropdown-item
-            >
+            <el-dropdown-item icon="Download" @click="handleExport" v-hasPermi="['business:collection:export']">
+              导出</el-dropdown-item>
+            <el-dropdown-item icon="Upload" @click="handleImport"
+              v-hasPermi="['business:collection:import']">导入</el-dropdown-item>
           </el-dropdown-menu>
         </template>
       </el-dropdown>
     </div>
     <!-- 搜索区 -->
-    <el-form
-      class="list-search-container"
-      size="small"
-      :model="queryParams"
-      ref="queryRef"
-      :inline="true"
-      label-width="68px"
-    >
+    <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
+      label-width="68px">
       <el-form-item label="客户名称:" prop="companyName">
-        <el-input
-          v-model="queryParams.companyName"
-          style="width: 150px"
-          placeholder="请输入客户名称"
-          clearable
-          @keyup.enter="handleQuery"
-        />
+        <el-input v-model="queryParams.companyName" style="width: 150px" placeholder="请输入客户名称" clearable
+          @keyup.enter="handleQuery" />
       </el-form-item>
+      <el-form-item label="合同编号:" prop="contractNo">
+        <el-input v-model="queryParams.contractNo" style="width: 150px" placeholder="请输入合同编号" clearable
+          @keyup.enter="handleQuery" />
+      </el-form-item>
+
       <el-form-item prop="applierTime" label="审核时间:">
         <el-date-picker v-model="queryParams.dateFilter" type="daterange" clearable format="YYYY - MM - DD "
-        value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期" end-placeholder="业务日期"
-        style="width: 100%;"></el-date-picker>
+          value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期" end-placeholder="业务日期"
+          style="width: 100%;"></el-date-picker>
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="Search" @click="handleQuery"
-          >搜索</el-button
-        >
+        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
         <el-button icon="Refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
@@ -69,389 +45,303 @@
     <!-- 列表区 -->
     <!-- 
       :summary-method="getSummaries" -->
-    <el-table
-      v-loading="loading"
-      :data="orderList"
-      size="small"
-      show-summary
-      :summary-method="getSummaries"
-      border
-      height="100%"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="orderList" size="small" show-summary :summary-method="getSummaries" border
+      height="100%" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column
-        v-if="getShowStatus(2)"
-        label="客户"
-        prop="companyName"
-        min-width="250"
-        align="center"
-      />
-      <el-table-column
-        v-if="getShowStatus(3)"
-        label="合同编号"
-        prop="contractNo"
-        min-width="150"
-        align="center"
-      />
-      <el-table-column
-        v-if="getShowStatus(4)"
-        label="实际付款时间"
-        prop="actuallyDate"
-        width="100"
-        align="center"
-      >
+      <el-table-column v-if="getShowStatus(2)" label="客户" prop="companyName" min-width="250" align="center" />
+      <el-table-column v-if="getShowStatus(3)" label="合同编号" prop="contractNo" min-width="150" align="center" />
+      <el-table-column v-if="getShowStatus(4)" label="实际付款时间" prop="actuallyDate" width="100" align="center">
         <template #default="scope">
           {{
-            scope.row.actuallyDate
-              ? moment(scope.row.actuallyDate).format("YYYY-MM-DD")
-              : ""
+          scope.row.actuallyDate
+          ? moment(scope.row.actuallyDate).format("YYYY-MM-DD")
+          : ""
           }}
         </template>
       </el-table-column>
-      <el-table-column label="审核时间" prop="verifyDate" width="80" align="center"> 
+      <el-table-column label="审核时间" prop="verifyDate" width="80" align="center">
         <template #default="scope">
           {{
-            scope.row.verifyDate
-              ? moment(scope.row.verifyDate).format("YYYY-MM-DD")
-              : ""
+          scope.row.verifyDate
+          ? moment(scope.row.verifyDate).format("YYYY-MM-DD")
+          : ""
           }}
         </template>
-        </el-table-column>
-      <el-table-column
-        v-if="getShowStatus(5)"
-        label="收款时间"
-        prop="paymentCause"
-        align="center"
-      />
+      </el-table-column>
+      <el-table-column v-if="getShowStatus(5)" label="收款时间" prop="paymentCause" align="center" />
       <!-- <el-table-column label="支出科目" prop="paymentSubject" align="center" /> -->
-      <el-table-column
-        v-if="getShowStatus(8)"
-        width="80"
-        label="收款金额"
-        prop="arriveAmount"
-        header-align="center"
-        align="right"
-      >
+      <el-table-column v-if="getShowStatus(8)" width="80" label="收款金额" prop="arriveAmount" header-align="center"
+        align="right">
         <template #default="scope">
           <span>{{ rowNum(scope.row.arriveAmount) }}</span>
         </template>
       </el-table-column>
-      <el-table-column
-        v-if="getShowStatus(9)"
-        label="申请人"
-        prop="applierName"
-        min-width="100"
-        align="center"
-      />
-      <el-table-column
-        v-if="getShowStatus(11)"
-        label="审核状态"
-        prop="status"
-        min-width="90"
-        align="center"
-      >
+      <el-table-column v-if="getShowStatus(9)" label="申请人" prop="applierName" min-width="100" align="center" />
+      <el-table-column v-if="getShowStatus(11)" label="审核状态" prop="status" min-width="90" align="center">
         <template #header>
           <!-- <el-badge v-if="unVerifiedNum > 0 && verifiable" is-dot>审核状态</el-badge> -->
           <div>审核状态</div>
         </template>
         <template #default="scope">
-          <span v-if="scope.row.status === 0" style="color: #cd853f"
-            >未审核</span
-          >
-          <span v-else-if="scope.row.status === 1" style="color: #32cd32"
-            >审核通过</span
-          >
-          <span v-else-if="scope.row.status === 2" style="color: #dc143c"
-            >审核不通过</span
-          >
+          <span v-if="scope.row.status === 0" style="color: #cd853f">未审核</span>
+          <span v-else-if="scope.row.status === 1" style="color: #32cd32">审核通过</span>
+          <span v-else-if="scope.row.status === 2" style="color: #dc143c">审核不通过</span>
         </template>
       </el-table-column>
-      <el-table-column
-        v-if="getShowStatus(12)"
-        label="支付状态"
-        min-width="90"
-        prop="arriveStatus"
-        align="center"
-      >
+      <el-table-column v-if="getShowStatus(12)" label="支付状态" min-width="90" prop="arriveStatus" align="center">
         <template #default="scope">
-          <span v-if="scope.row.arriveStatus === 0" style="color: #dc143c"
-            >未支付</span
-          >
-          <span v-else-if="scope.row.arriveStatus === 1" style="color: #32cd32"
-            >已支付</span
-          >
-          <span v-else-if="scope.row.arriveStatus === 2" style="color: #cd853f"
-            >部分支付</span
-          >
+          <span v-if="scope.row.arriveStatus === 0" style="color: #dc143c">未支付</span>
+          <span v-else-if="scope.row.arriveStatus === 1" style="color: #32cd32">已支付</span>
+          <span v-else-if="scope.row.arriveStatus === 2" style="color: #cd853f">部分支付</span>
         </template>
       </el-table-column>
-      <el-table-column
-        v-if="getShowStatus(14)"
-        label="到账日期"
-        prop="actuallyDate"
-        align="center"
-      >
+      <el-table-column v-if="getShowStatus(14)" label="到账日期" prop="actuallyDate" align="center">
         <template #default="scope">
-          {{ (scope.row.arriveDate) }}  {{scope.row.arriveTime}}
+          {{ (scope.row.arriveDate) }} {{scope.row.arriveTime}}
         </template>
       </el-table-column>
-      <el-table-column
-        v-if="getShowStatus(13)"
-        label="备注"
-        prop="remark"
-        align="center"
-        min-width="100"
-      />
+      <el-table-column v-if="getShowStatus(13)" label="备注" prop="remark" align="center" min-width="100" />
       <el-table-column label="操作" width="80" align="center">
         <template #default="scope">
-          <el-button
-            type="primary"
-            size="small"
-            link
-            @click="handleView(scope.row.id)"
-            >查看</el-button
-          >
+          <el-button type="primary" size="small" link @click="handleView(scope.row.id)">查看</el-button>
         </template>
       </el-table-column>
     </el-table>
     <contract-form ref="contractRef" :get-list="getList" />
     <import-excel-dialog ref="importExcelDialogRef" :get-list="getList" />
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
   </div>
 </template>
 
-<script setup name="Company">
-import contractForm from "./form";
-import {
-  listCollection,
-  delCollection,
-  exportCllection,
-} from "@/api/business/financial/collection";
-import importExcelDialog from "./importExcelDialog.vue";
-const { proxy } = getCurrentInstance();
-/** 字典数组区 */
-/** 查询 对象 */
+<script setup name="Collection">
+  import contractForm from "./form";
+  import {
+    listCollection,
+    delCollection,
+    exportCllection,
+  } from "@/api/business/financial/collection";
+  import importExcelDialog from "./importExcelDialog.vue";
+  const { proxy } = getCurrentInstance();
+  /** 字典数组区 */
+  /** 查询 对象 */
 
-const orderList = ref([]);
-const loading = ref(true);
-const ids = ref([]);
-const single = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-const showRows = ref([2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13,14]);
-const importExcelDialogRef = ref(null);
-const rows = ref([
-  {
-    key: 2,
-    label: "客户名称",
-  },
-  {
-    key: 3,
-    label: "合同编号",
-  },
-  {
-    key: 4,
-    label: "收款日期",
-  },
-  {
-    key: 5,
-    label: "收款时间",
-  },
-  {
-    key: 9,
-    label: "申请人",
-  },
-  {
-    key: 11,
-    label: "审核状态",
-  },
-  {
-    key: 12,
-    label: "支付状态",
-  },
-  {
-    key: 14,
-    label: "确认到账时间",
-  },
-  {
-    key: 13,
-    label: "备注",
-  },
-]);
+  const orderList = ref([]);
+  const loading = ref(true);
+  const ids = ref([]);
+  const single = ref(true);
+  const multiple = ref(true);
+  const total = ref(0);
+  const showRows = ref([2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14]);
+  const importExcelDialogRef = ref(null);
+  const rows = ref([
+    {
+      key: 2,
+      label: "客户名称",
+    },
+    {
+      key: 3,
+      label: "合同编号",
+    },
+    {
+      key: 4,
+      label: "收款日期",
+    },
+    {
+      key: 5,
+      label: "收款时间",
+    },
+    {
+      key: 9,
+      label: "申请人",
+    },
+    {
+      key: 11,
+      label: "审核状态",
+    },
+    {
+      key: 12,
+      label: "支付状态",
+    },
+    {
+      key: 14,
+      label: "确认到账时间",
+    },
+    {
+      key: 13,
+      label: "备注",
+    },
+  ]);
 
-const { contract_verify_status } = proxy.useDict("contract_verify_status");
-const { contract_status } = proxy.useDict("contract_status");
-/** 查询对象 */
-const queryParams = ref({
-  pageNum: 1,
-  orderByColumn: "create_time",
-  pageSize: 20,
-});
-
-/***********************  方法区  ****************************/
+  const { contract_verify_status } = proxy.useDict("contract_verify_status");
+  const { contract_status } = proxy.useDict("contract_status");
+  /** 查询对象 */
+  const queryParams = ref({
+    pageNum: 1,
+    orderByColumn: "create_time",
+    pageSize: 20,
+  });
 
-/** 查询company列表 */
-function getList() {
-  console.log(1111,queryParams.value);
-  loading.value = true;
-  listCollection(queryParams.value).then((response) => {
-    orderList.value = response.rows;
-    total.value = response.total;
-    loading.value = false;
+  /***********************  方法区  ****************************/
+  onActivated(() => {
+    // 你的逻辑
+    getList();
   });
-}
+  /** 查询company列表 */
+  function getList() {
+    console.log(1111, queryParams.value);
+    loading.value = true;
+    listCollection(queryParams.value).then((response) => {
+      orderList.value = response.rows;
+      total.value = response.total;
+      loading.value = false;
+    });
+  }
 
-function getSummaries(param) {
-  const { columns, data } = param;
-  const sums = [];
-  let indexOf;
-  columns.forEach((column, index) => {
-    if (column.label != "收款金额") {
-      return;
-    }
-    indexOf = index;
-    const values = [];
+  function getSummaries(param) {
+    const { columns, data } = param;
+    const sums = [];
+    let indexOf;
+    columns.forEach((column, index) => {
+      if (column.label != "收款金额") {
+        return;
+      }
+      indexOf = index;
+      const values = [];
 
-    data.map((item) => {
-      if (item.arriveStatus == 1) {
-        if (item.arriveAmount) {
-          values.push(item.arriveAmount);
+      data.map((item) => {
+        if (item.arriveStatus == 1) {
+          if (item.arriveAmount) {
+            values.push(item.arriveAmount);
+          }
         }
+      });
+
+      if (!values.every((value) => Number.isNaN(value))) {
+        sums[index] = ` ${values.reduce((prev, curr) => {
+          const value = Number(curr);
+          if (!Number.isNaN(value)) {
+            return Number(Number(prev) + value).toFixed(2);
+          } else {
+            return Number(prev).toFixed(2);
+          }
+        }, 0)}`;
       }
     });
+    sums[indexOf] = numberToCurrencyNo(sums[indexOf]);
 
-    if (!values.every((value) => Number.isNaN(value))) {
-      sums[index] = ` ${values.reduce((prev, curr) => {
-        const value = Number(curr);
-        if (!Number.isNaN(value)) {
-          return Number(Number(prev) + value).toFixed(2);
-        } else {
-          return Number(prev).toFixed(2);
-        }
-      }, 0)}`;
-    }
-  });
-  sums[indexOf] = numberToCurrencyNo(sums[indexOf]);
-
-  return sums;
-}
+    return sums;
+  }
 
-function numberToCurrencyNo(value) {
-  if (!value) return 0;
-  // 获取整数部分
-  const intPart = Math.trunc(value);
+  function numberToCurrencyNo(value) {
+    if (!value) return 0;
+    // 获取整数部分
+    const intPart = Math.trunc(value);
 
-  // 整数部分处理,增加,
-  const intPartFormat = intPart
-    .toString()
-    .replace(/(\d)(?=(?:\d{3})+$)/g, "$1,");
-  // 预定义小数部分
+    // 整数部分处理,增加,
+    const intPartFormat = intPart
+      .toString()
+      .replace(/(\d)(?=(?:\d{3})+$)/g, "$1,");
+    // 预定义小数部分
 
-  let floatPart = "";
-  // 将数值截取为小数部分和整数部分
-  const valueArray = value.toString().split(".");
-  if (valueArray.length === 2) {
-    // 有小数部分
+    let floatPart = "";
+    // 将数值截取为小数部分和整数部分
+    const valueArray = value.toString().split(".");
+    if (valueArray.length === 2) {
+      // 有小数部分
 
-    floatPart = valueArray[1].toString(); // 取得小数部分
-    return intPartFormat + "." + floatPart;
+      floatPart = valueArray[1].toString(); // 取得小数部分
+      return intPartFormat + "." + floatPart;
+    }
+    return intPartFormat + floatPart;
   }
-  return intPartFormat + floatPart;
-}
 
-function rowNum(num) {
-  num = num.toLocaleString(); // 3,000
-  if (num.indexOf(".") == -1) {
-    num = num + ".00"; //3,000.00
-  } else if (num.charAt(num.indexOf(".") == num.length - 2)) {
-    num = num + "0";
+  function rowNum(num) {
+    num = num.toLocaleString(); // 3,000
+    if (num.indexOf(".") == -1) {
+      num = num + ".00"; //3,000.00
+    } else if (num.charAt(num.indexOf(".") == num.length - 2)) {
+      num = num + "0";
+    }
+    return num;
   }
-  return num;
-}
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
+  }
 
-/** 重置按钮操作 */
-function resetQuery() {
-  // proxy.resetForm("queryRef");
-  queryParams.value = {
-    pageNum: 1,
-    pageSize: 20,
-    nonpayment: true,
-  };
-  handleQuery();
-}
+  /** 重置按钮操作 */
+  function resetQuery() {
+    // proxy.resetForm("queryRef");
+    queryParams.value = {
+      pageNum: 1,
+      pageSize: 20,
+      nonpayment: true,
+    };
+    handleQuery();
+  }
 
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  single.value = selection.length != 1;
-  multiple.value = !selection.length;
-}
+  // 多选框选中数据
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    single.value = selection.length != 1;
+    multiple.value = !selection.length;
+  }
 
-/** 新增按钮操作 */
-function handleView(id) {
-  proxy.$refs.contractRef.open(id);
-}
+  /** 新增按钮操作 */
+  function handleView(id) {
+    proxy.$refs.contractRef.open(id);
+  }
 
-/** 删除按钮操作 */
-function handleDelete(row) {
-  const _ids = row.id || ids.value;
-  proxy.$modal
-    .confirm("是否确认删除选中的数据项?")
-    .then(function () {
-      return delCollection(_ids);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("删除成功!");
-    })
-    .catch(() => {});
-}
+  /** 删除按钮操作 */
+  function handleDelete(row) {
+    const _ids = row.id || ids.value;
+    proxy.$modal
+      .confirm("是否确认删除选中的数据项?")
+      .then(function () {
+        return delCollection(_ids);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功!");
+      })
+      .catch(() => { });
+  }
 
-function handleAlter(row) {
-  const id = row.id || ids.value;
-  proxy.$refs.contractRef.openSimple(id, "alterOrder");
-}
+  function handleAlter(row) {
+    const id = row.id || ids.value;
+    proxy.$refs.contractRef.openSimple(id, "alterOrder");
+  }
 
-function handleDissolution() {
-  const row = orderList.value.find((item) => item.id === ids.value[0]);
-  proxy.$modal
-    .confirm("是否确认解除合同?")
-    .then(function () {
-      return dissolutionOrder(row);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("删除成功!");
-    })
-    .catch(() => {});
-}
+  function handleDissolution() {
+    const row = orderList.value.find((item) => item.id === ids.value[0]);
+    proxy.$modal
+      .confirm("是否确认解除合同?")
+      .then(function () {
+        return dissolutionOrder(row);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功!");
+      })
+      .catch(() => { });
+  }
 
-/** 导出按钮操作 */
-function handleExport() {
-  exportCllection(queryParams.value);
-}
+  /** 导出按钮操作 */
+  function handleExport() {
+    exportCllection(queryParams.value);
+  }
 
-function handleImport() {
-  importExcelDialogRef.value.open();
-}
+  function handleImport() {
+    importExcelDialogRef.value.open();
+  }
 
-function getShowStatus(key) {
-  const index = showRows.value.findIndex((l) => l === key);
-  return index >= 0;
-}
+  function getShowStatus(key) {
+    const index = showRows.value.findIndex((l) => l === key);
+    return index >= 0;
+  }
 
-getList();
-</script>
+  getList();
+</script>

+ 5 - 2
src/views/business/financial/contract/index.vue

@@ -175,7 +175,7 @@
   </div>
 </template>
 
-<script setup name="Company">
+<script setup name="WaitForCollection">
 import contractForm from "./form";
 import { listContract } from "@/api/business/financial/collection";
 const { proxy } = getCurrentInstance();
@@ -203,7 +203,10 @@ const queryParams = ref({
 });
 
 /***********************  方法区  ****************************/
-
+onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
 /** 查询company列表 */
 function getList() {
   loading.value = true;

+ 16 - 2
src/views/business/financial/payment/form.vue

@@ -14,6 +14,8 @@
             <el-button v-if="editStatus" type="primary" size="small" icon="Finished" @click="submitForm">保存</el-button>
             <el-button v-else-if="form.verifyStatus === 0" type="warning" size="small" icon="Edit"
               @click="editStatus = true">修改</el-button>
+              <el-button v-show="form.verifyStatus == 3 " type="warning" size="small" icon="Finished"
+              @click="returnZero"    v-hasPermi="['business:payment:return']">退回</el-button>
             <el-button v-if="form.id && editStatus" size="small" icon="Close"
               @click="editStatus = false">取消修改</el-button>
           </template>
@@ -386,7 +388,7 @@
     savePayment,
     listTypes,
     listContractDetail,
-    verifyPayment,
+    verifyPayment,setPaymentZero
   } from "@/api/business/financial/payment";
   import { listSource } from "@/api/settings/source";
   import { listUser } from "@/api/system/user";
@@ -553,7 +555,19 @@
     form.value = JSON.parse(JSON.stringify(paymentEmpty));
     paymentSubjects.value = [];
   }
-
+  function returnZero() {
+    proxy.$modal
+      .confirm("是否确认退回")
+      .then(function () {
+        setPaymentZero(form.value.id)
+      })
+      .then(() => {
+        visible.value = false;
+        getList.value();
+        proxy.$modal.msgSuccess("退回成功");
+      })
+      .catch(() => { });
+  }
   /** 全屏缩放 */
   function handleScreen() {
     const dom = document.querySelector(

+ 205 - 335
src/views/business/financial/payment/index.vue

@@ -2,412 +2,282 @@
   <div class="page-container list-container">
     <!-- 功能按钮区 -->
     <div class="list-btns-container">
-      <el-button
-        type="primary"
-        size="small"
-        icon="Plus"
-        @click="handleAdd"
-        v-hasPermi="['business:payment:add']"
-        >新增</el-button
-      >
+      <el-button type="primary" size="small" icon="Plus" @click="handleAdd"
+        v-hasPermi="['business:payment:add']">新增</el-button>
       <el-dropdown trigger="click">
         <el-button type="primary" size="small">
           其它<el-icon class="el-icon--right"><arrow-down /></el-icon>
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
-            <el-dropdown-item
-              icon="Download"
-              @click="handleExport"
-              v-hasPermi="['business:payment:export']"
-            >
-              导出</el-dropdown-item
-            >
+            <el-dropdown-item icon="Download" @click="handleExport" v-hasPermi="['business:payment:export']">
+              导出</el-dropdown-item>
           </el-dropdown-menu>
         </template>
       </el-dropdown>
     </div>
     <!-- 搜索区 -->
-    <el-form
-      class="list-search-container"
-      size="small"
-      :model="queryParams"
-      ref="queryRef"
-      :inline="true"
-      label-width="68px"
-    >
+    <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
+      label-width="68px">
       <el-form-item label="客户名称:" prop="companyName">
-        <el-input
-          v-model="queryParams.companyName"
-          style="width: 150px"
-          placeholder="请输入客户名称"
-          clearable
-          @keyup.enter="handleQuery"
-        />
+        <el-input v-model="queryParams.companyName" style="width: 150px" placeholder="请输入客户名称" clearable
+          @keyup.enter="handleQuery" />
       </el-form-item>
+
+      <el-form-item label="合同编号:" prop="contractNo">
+        <el-input v-model="queryParams.contractNo" style="width: 150px" placeholder="请输入合同编号" clearable
+          @keyup.enter="handleQuery" />
+      </el-form-item>
+
       <el-form-item prop="applierTime" label="审核时间:">
         <el-date-picker v-model="queryParams.dateFilter" type="daterange" clearable format="YYYY - MM - DD "
-        value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期" end-placeholder="业务日期"
-        style="width: 100%;"></el-date-picker>
+          value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期" end-placeholder="业务日期"
+          style="width: 100%;"></el-date-picker>
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="Search" @click="handleQuery"
-          >搜索</el-button
-        >
+        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
         <el-button icon="Refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
 
     <!-- 列表区 -->
-    <el-table
-      v-loading="loading"
-      :data="orderList"
-      size="small"
-      border
-      height="100%"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="orderList" size="small" border height="100%"
+      @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <!-- <el-table-column type="index" label="序号" width="50" align="center" /> -->
-      <el-table-column
-        v-if="getShowStatus(2)"
-        label="客户名称"
-        prop="companyName"
-        min-width="250"
-        align="center"
-      />
-      <el-table-column
-        v-if="getShowStatus(16)"
-        label="服务公司"
-        prop="serviceCompanyName"
-        width="200"
-        align="center"
-      />
-      <el-table-column
-        v-if="getShowStatus(3)"
-        label="订单号"
-        prop="formNo"
-        min-width="200"
-        align="center"
-      />
-      <el-table-column
-        v-if="getShowStatus(4)"
-        label="申请日期"
-        prop="formDate"
-        min-width="90"
-        align="center"
-      >
+      <el-table-column v-if="getShowStatus(2)" label="客户名称" prop="companyName" min-width="250" align="center" />
+      <el-table-column v-if="getShowStatus(16)" label="服务公司" prop="serviceCompanyName" width="200" align="center" />
+      <el-table-column v-if="getShowStatus(3)" label="合同号" prop="formNo" min-width="200" align="center" />
+      <el-table-column v-if="getShowStatus(4)" label="申请日期" prop="formDate" min-width="90" align="center">
         <template #default="scope">
           {{
-            scope.row.formDate
-              ? moment(scope.row.formDate).format("YYYY-MM-DD")
-              : ""
+          scope.row.formDate
+          ? moment(scope.row.formDate).format("YYYY-MM-DD")
+          : ""
           }}
         </template>
       </el-table-column>
       <!-- <el-table-column label="服务公司" prop="subsidiary" width="150" align="center" /> -->
-      <el-table-column
-        v-if="getShowStatus(5)"
-        label="支出事由"
-        prop="paymentCause"
-        min-width="90"
-        align="center"
-      />
-      <el-table-column
-        v-if="getShowStatus(6)"
-        label="支出科目"
-        prop="paymentSubject"
-        min-width="90"
-        align="center"
-        show-overflow-tooltip
-      />
-      <el-table-column
-        v-if="getShowStatus(7)"
-        label="支出金额"
-        prop="sumAmount"
-        width="80"
-        header-align="center"
-        align="right"
-      >
+      <el-table-column v-if="getShowStatus(5)" label="支出事由" prop="paymentCause" min-width="90" align="center" />
+      <el-table-column v-if="getShowStatus(6)" label="支出科目" prop="paymentSubject" min-width="90" align="center"
+        show-overflow-tooltip />
+      <el-table-column v-if="getShowStatus(7)" label="支出金额" prop="sumAmount" width="80" header-align="center"
+        align="right">
         <template #default="scope">
           <span>{{ rowNum(scope.row.sumAmount) }}</span>
         </template>
       </el-table-column>
-      <el-table-column
-        label="审核日期"
-        prop="verifyDate"
-        width="150"
-        align="center"
-      />
-      <el-table-column
-        v-if="getShowStatus(8)"
-        label="审核状态"
-        prop="status"
-        min-width="120"
-        align="center"
-      >
+      <el-table-column label="审核日期" prop="verifyDate" width="150" align="center" />
+      <el-table-column v-if="getShowStatus(8)" label="审核状态" prop="status" min-width="120" align="center">
         <template #header>
           <div>审核状态</div>
         </template>
         <template #default="scope">
-          <span v-if="scope.row.verifyStatus === 0" style="color: #cd853f"
-            >未审核</span
-          >
-          <span v-else-if="scope.row.verifyStatus === 1" style="color: #32cd32"
-            >财务审核通过</span
-          >
-          <span v-else-if="scope.row.verifyStatus === 2" style="color: #dc143c"
-            >财务审核不通过</span
-          >
-          <span v-else-if="scope.row.verifyStatus === 3" style="color: #32cd32"
-            >出纳审核通过</span
-          >
-          <span v-else-if="scope.row.verifyStatus === 4" style="color: #dc143c"
-            >出纳审核不通过</span
-          >
+          <span v-if="scope.row.verifyStatus === 0" style="color: #cd853f">未审核</span>
+          <span v-else-if="scope.row.verifyStatus === 1" style="color: #32cd32">财务审核通过</span>
+          <span v-else-if="scope.row.verifyStatus === 2" style="color: #dc143c">财务审核不通过</span>
+          <span v-else-if="scope.row.verifyStatus === 3" style="color: #32cd32">出纳审核通过</span>
+          <span v-else-if="scope.row.verifyStatus === 4" style="color: #dc143c">出纳审核不通过</span>
         </template>
       </el-table-column>
-      <el-table-column
-        v-if="getShowStatus(9)"
-        label="支付状态"
-        min-width="100"
-        prop="arriveStatus"
-        align="center"
-      >
+      <el-table-column v-if="getShowStatus(9)" label="支付状态" min-width="100" prop="arriveStatus" align="center">
         <template #default="scope">
-          <span v-if="scope.row.paymentStatus === 0" style="color: #dc143c"
-            >未支付</span
-          >
-          <span v-else-if="scope.row.paymentStatus === 1" style="color: #32cd32"
-            >已支付</span
-          >
-          <span v-else-if="scope.row.paymentStatus === 2" style="color: #cd853f"
-            >部分支付</span
-          >
+          <span v-if="scope.row.paymentStatus === 0" style="color: #dc143c">未支付</span>
+          <span v-else-if="scope.row.paymentStatus === 1" style="color: #32cd32">已支付</span>
+          <span v-else-if="scope.row.paymentStatus === 2" style="color: #cd853f">部分支付</span>
         </template>
       </el-table-column>
-      <el-table-column
-        v-if="getShowStatus(10)"
-        label="收款账户名"
-        prop="acceptAccount"
-        min-width="100"
-        align="center"
-      />
-      <el-table-column
-        v-if="getShowStatus(11)"
-        label="收款账号"
-        prop="acceptAccountNo"
-        width="90"
-        align="center"
-      />
+      <el-table-column v-if="getShowStatus(10)" label="收款账户名" prop="acceptAccount" min-width="100" align="center" />
+      <el-table-column v-if="getShowStatus(11)" label="收款账号" prop="acceptAccountNo" width="90" align="center" />
 
-      <el-table-column
-        v-if="getShowStatus(13)"
-        label="申请人"
-        prop="applierName"
-        min-width="130"
-        align="center"
-      />
-      <el-table-column
-        v-if="getShowStatus(14)"
-        label="备注"
-        prop="remark"
-        align="center"
-      />
+      <el-table-column v-if="getShowStatus(13)" label="申请人" prop="applierName" min-width="130" align="center" />
+      <el-table-column v-if="getShowStatus(14)" label="备注" prop="remark" align="center" />
       <el-table-column label="操作" fixed="right" width="60" align="center">
         <template #default="scope">
-          <el-button
-            link
-            type="primary"
-            size="small"
-            @click="handleFormPageOpen(scope.row.id)"
-            >查看</el-button
-          >
+          <el-button link type="primary" size="small" @click="handleFormPageOpen(scope.row.id)">查看</el-button>
         </template>
       </el-table-column>
     </el-table>
     <payment-form ref="paymentRef" :get-list="getList" />
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
   </div>
 </template>
 
-<script setup name="Company">
-import paymentForm from "./form";
-import { listPayment, exportPayment } from "@/api/business/financial/payment";
-const { proxy } = getCurrentInstance();
-/** 字典数组区 */
-/** 查询 对象 */
+<script setup name="Payment">
+  import paymentForm from "./form";
+  import { listPayment, exportPayment } from "@/api/business/financial/payment";
+  const { proxy } = getCurrentInstance();
+  /** 字典数组区 */
+  /** 查询 对象 */
 
-const orderList = ref([]);
-const loading = ref(true);
-const ids = ref([]);
-const single = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-const showRows = ref([2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13]);
-const rows = ref([
-  {
-    key: 2,
-    label: "客户名称",
-  },
-  {
-    key: 3,
-    label: "合同编号",
-  },
-  {
-    key: 4,
-    label: "收款日期",
-  },
-  {
-    key: 5,
-    label: "收款时间",
-  },
-  {
-    key: 9,
-    label: "申请人",
-  },
-  {
-    key: 11,
-    label: "审核状态",
-  },
-  {
-    key: 12,
-    label: "支付状态",
-  },
-  {
-    key: 14,
-    label: "确认到账时间",
-  },
-  {
-    key: 13,
-    label: "备注",
-  },
-]);
+  const orderList = ref([]);
+  const loading = ref(true);
+  const ids = ref([]);
+  const single = ref(true);
+  const multiple = ref(true);
+  const total = ref(0);
+  const showRows = ref([2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13]);
+  const rows = ref([
+    {
+      key: 2,
+      label: "客户名称",
+    },
+    {
+      key: 3,
+      label: "合同编号",
+    },
+    {
+      key: 4,
+      label: "收款日期",
+    },
+    {
+      key: 5,
+      label: "收款时间",
+    },
+    {
+      key: 9,
+      label: "申请人",
+    },
+    {
+      key: 11,
+      label: "审核状态",
+    },
+    {
+      key: 12,
+      label: "支付状态",
+    },
+    {
+      key: 14,
+      label: "确认到账时间",
+    },
+    {
+      key: 13,
+      label: "备注",
+    },
+  ]);
 
-const { contract_verify_status } = proxy.useDict("contract_verify_status");
-const { contract_status } = proxy.useDict("contract_status");
-/** 查询对象 */
-const queryParams = ref({
-  pageNum: 1,
-  orderByColumn: "create_time",
-  pageSize: 20,
-});
-
-/***********************  方法区  ****************************/
-
-/** 查询company列表 */
-function getList() {
-  loading.value = true;
-  listPayment(queryParams.value).then((response) => {
-    orderList.value = response.rows;
-    total.value = response.total;
-    loading.value = false;
+  const { contract_verify_status } = proxy.useDict("contract_verify_status");
+  const { contract_status } = proxy.useDict("contract_status");
+  /** 查询对象 */
+  const queryParams = ref({
+    pageNum: 1,
+    orderByColumn: "create_time",
+    pageSize: 20,
   });
-}
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
+  /***********************  方法区  ****************************/
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
+  /** 查询company列表 */
+  function getList() {
+    loading.value = true;
+    listPayment(queryParams.value).then((response) => {
+      orderList.value = response.rows;
+      total.value = response.total;
+      loading.value = false;
+    });
+  }
 
-/** 重置按钮操作 */
-function resetQuery() {
-  // proxy.resetForm("queryRef");
-  queryParams.value = {
-    pageNum: 1,
-    pageSize: 20,
-    nonpayment: true,
-  };
-  handleQuery();
-}
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
+  }
 
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  single.value = selection.length != 1;
-  multiple.value = !selection.length;
-}
+  /** 重置按钮操作 */
+  function resetQuery() {
+    // proxy.resetForm("queryRef");
+    queryParams.value = {
+      pageNum: 1,
+      pageSize: 20,
+      nonpayment: true,
+    };
+    handleQuery();
+  }
 
-/** 新增按钮操作 */
-function handleView(id) {
-  proxy.$refs.paymentRef.open(id);
-}
+  // 多选框选中数据
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    single.value = selection.length != 1;
+    multiple.value = !selection.length;
+  }
 
-// 数字格式化
-function rowNum(num) {
-  if (!num) {
-    return;
+  /** 新增按钮操作 */
+  function handleView(id) {
+    proxy.$refs.paymentRef.open(id);
   }
-  num = num.toLocaleString(); // 3,000
-  if (num.indexOf(".") == -1) {
-    num = num + ".00"; //3,000.00
-  } else if (num.charAt(num.indexOf(".") == num.length - 2)) {
-    num = num + "0";
+
+  // 数字格式化
+  function rowNum(num) {
+    if (!num) {
+      return;
+    }
+    num = num.toLocaleString(); // 3,000
+    if (num.indexOf(".") == -1) {
+      num = num + ".00"; //3,000.00
+    } else if (num.charAt(num.indexOf(".") == num.length - 2)) {
+      num = num + "0";
+    }
+    return num;
   }
-  return num;
-}
 
-/** 删除按钮操作 */
-function handleDelete(row) {
-  const _ids = row.id || ids.value;
-  proxy.$modal
-    .confirm("是否确认删除选中的数据项?")
-    .then(function () {
-      return delOrder(_ids);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("删除成功!");
-    })
-    .catch(() => {});
-}
+  /** 删除按钮操作 */
+  function handleDelete(row) {
+    const _ids = row.id || ids.value;
+    proxy.$modal
+      .confirm("是否确认删除选中的数据项?")
+      .then(function () {
+        return delOrder(_ids);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功!");
+      })
+      .catch(() => { });
+  }
 
-function handleAlter(row) {
-  const id = row.id || ids.value;
-  proxy.$refs.paymentRef.openSimple(id, "alterOrder");
-}
+  function handleAlter(row) {
+    const id = row.id || ids.value;
+    proxy.$refs.paymentRef.openSimple(id, "alterOrder");
+  }
 
-function handleDissolution() {
-  const row = orderList.value.find((item) => item.id === ids.value[0]);
-  proxy.$modal
-    .confirm("是否确认解除合同?")
-    .then(function () {
-      return dissolutionOrder(row);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("删除成功!");
-    })
-    .catch(() => {});
-}
+  function handleDissolution() {
+    const row = orderList.value.find((item) => item.id === ids.value[0]);
+    proxy.$modal
+      .confirm("是否确认解除合同?")
+      .then(function () {
+        return dissolutionOrder(row);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功!");
+      })
+      .catch(() => { });
+  }
 
-/** 导出按钮操作 */
-function handleExport() {
-  exportPayment(queryParams.value);
-}
+  /** 导出按钮操作 */
+  function handleExport() {
+    exportPayment(queryParams.value);
+  }
 
-function handleImport() {}
+  function handleImport() { }
 
-function getShowStatus(key) {
-  const index = showRows.value.findIndex((l) => l === key);
-  return index >= 0;
-}
+  function getShowStatus(key) {
+    const index = showRows.value.findIndex((l) => l === key);
+    return index >= 0;
+  }
 
-function handleAdd() {
-  proxy.$refs.paymentRef.open();
-}
+  function handleAdd() {
+    proxy.$refs.paymentRef.open();
+  }
 
-function handleFormPageOpen(id) {
-  proxy.$refs.paymentRef.open(id);
-}
+  function handleFormPageOpen(id) {
+    proxy.$refs.paymentRef.open(id);
+  }
 
-getList();
+  getList();
 </script>

+ 9 - 4
src/views/business/housingFund/confirm/index.vue

@@ -55,7 +55,7 @@
       </el-form-item>
     </el-form>
     <div v-if="flag && flag2 && tenant.versionId !== '4'">
-      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" >
+      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
         <el-tab-pane label="全部" name="first">
         </el-tab-pane>
         <el-tab-pane label="我的" name="second">
@@ -67,7 +67,9 @@
       @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="客户名称" align="center" prop="companyName" min-width="250" />
-      <el-table-column label="来源" align="center" prop="fromCompanyName" min-width="100" />
+      <el-table-column label="来源" align="center" prop="fromCompanyName" v-if="tenant.versionId === '4'" />
+      <el-table-column label="受委托方" align="center" prop="toTenantName" min-width="130"
+        v-if="tenant.versionId !== '4'" />
       <el-table-column label="纳税性质" width="120" align="center" prop="taxType" />
       <el-table-column label="所属期" min-width="90" align="center">
         <template #default="scope">
@@ -176,7 +178,7 @@
   </div>
 </template>
 
-<script setup>
+<script setup name="HousingFundConfirm">
   import useUserStore from "@/store/modules/user";
   import {
     listHousingFundConfirm,
@@ -325,7 +327,10 @@
   };
 
   /***********************  方法区  ****************************/
-
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
   /** 查询company列表 */
   function getList() {
     loading.value = true;

+ 9 - 6
src/views/business/housingFund/declare/index.vue

@@ -52,7 +52,7 @@
       </el-form-item>
     </el-form>
     <div v-if="flag && flag2 && tenant.versionId !== '4'">
-      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" >
+      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
         <el-tab-pane label="全部" name="first">
         </el-tab-pane>
         <el-tab-pane label="我的" name="second">
@@ -64,7 +64,9 @@
       @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="客户名称" min-width="250" align="center" prop="companyName" />
-      <el-table-column label="来源" min-width="100" align="center" prop="fromCompanyName" />
+      <el-table-column label="来源" align="center" prop="fromCompanyName" v-if="tenant.versionId === '4'" />
+      <el-table-column label="受委托方" align="center" prop="toTenantName" min-width="130"
+        v-if="tenant.versionId !== '4'" />
       <el-table-column label="纳税性质" width="100" align="center" prop="taxType" />
       <el-table-column label="人员信息" width="100" align="center" prop="">
         <template #default="scope">
@@ -204,7 +206,7 @@
   </div>
 </template>
 
-<script setup>
+<script setup name="HousingFundDeclare">
   import useUserStore from "@/store/modules/user";
   import {
     listHousingFundDeclare,
@@ -240,10 +242,8 @@
   const viewDialogRef = ref(null);
   const memeberDialogRef = ref(null);
   const fileListDialogRef = ref(null);
-
   const formOpen = ref(false);
   const currentMonth = ref(proxy.moment().format("YYYY-MM-01"));
-
   const form = ref({
     id: null,
     companyName: "",
@@ -299,7 +299,10 @@
     month: proxy.moment().format("MM"),
     principal: tenant.versionId !== '4' && !flag.value ? useUserStore().user.userId : null,
   });
-
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
   /***********************  方法区  ****************************/
 
   /** 查询company列表 */

+ 196 - 0
src/views/business/invoice/ContractChoice.vue

@@ -0,0 +1,196 @@
+<template>
+    <el-dialog v-model="visible" width="55%" append-to-body draggable :close-on-click-modal="false">
+        <template #header>
+            <div class="dialog-title-container">
+                <span class="title-label" style="color: white"><i class="el-icon-document" style="color: white" />
+                    合同选择</span>
+                <i class="el-icon-close" @click="close" />
+            </div>
+        </template>
+        <!-- 功能按钮 -->
+        <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true" label-width="68px">
+            <el-form-item label="客户名称:" prop="companyName">
+                <el-input v-model="queryParams.companyName" size="small" placeholder="请输入客户名称" clearable
+                    style="width: 150px" @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="合同编号:" prop="contractNo">
+                <el-input v-model="queryParams.contractNo" size="small" placeholder="请输入合同编号" clearable
+                    style="width: 150px" @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="服务类型:" prop="serviceType">
+                <el-select size="small" v-model="queryParams.serviceType" placeholder="服务类型" clearable
+                    style="width: 150px" @keyup.enter="handleQuery">
+                    <el-option v-for="item in serviceTypes" :key="item.value" :label="item.label" :value="item.value" />
+                </el-select>
+            </el-form-item>
+            <el-form-item>
+                <el-button type="primary" icon="Search" @click="handleQuery" size="small">搜索</el-button>
+                <el-button icon="Refresh" @click="resetQuery" size="small">重置</el-button>
+            </el-form-item>
+        </el-form>
+        <div class="dialog-list-container">
+            <el-table :data="list" size="small" border height="400px" header-row-class-name="list-header-row"
+                row-class-name="list-row" @selection-change="handleSelectionChange">
+                <el-table-column v-if="multiple" type="selection" width="40" align="center" />
+                <el-table-column type="index" label="序号" width="46" align="center" />
+                <el-table-column label="合同编号" prop="contractNo" width="100" align="center" />
+                <el-table-column label="客户名称" prop="companyName" width="200" align="center" />
+                <el-table-column label="备注" prop="remark" header-align="center" />
+                <el-table-column v-if="!multiple" label="操作" width="50" align="center">
+                    <template #default="scope">
+                        <el-button link type="success" size="small"
+                            @click="handleSimpleSelected(scope.row)">选择</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </div>
+        <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+            v-model:limit="queryParams.pageSize" @pagination="getList" style="background-color: rgba(0, 0, 0, 0);" />
+    </el-dialog>
+</template>
+<script setup>
+    import { toRef } from 'vue'
+    import { listOrder } from "@/api/business/crm/contract";
+    const { proxy } = getCurrentInstance();
+    const props = defineProps({
+        width: {
+            type: String,
+            default: '800px'
+        },
+        multiple: {
+            type: Boolean,
+            default: () => false
+        }
+    })
+    const total = ref(0);
+    const emit = defineEmits(['choice']);
+    const { width, multiple } = toRefs(props)
+    const data = reactive({
+        visible: false,
+        query: {
+            pageNum: 1,
+            pageSize: 15,
+            total: 0
+        },
+        list: [],
+        selections: [],
+        options: {}
+    })
+
+    const serviceTypes = ref([
+        {
+            label: "循环服务",
+            value: 1,
+        },
+        {
+            label: "单次服务",
+            value: 2,
+        },
+    ]);
+    const queryParams = ref({
+        pageNum: 1,
+        pageSize: 20,
+        fromId: 0,
+        orderByColumn: "create_time",
+        category: null,
+        code: null,
+        name: null,
+        shortName: null,
+        companyName: null,
+        oldName: null,
+        owner: null,
+        phone: null,
+        email: null,
+        contactAddress: null,
+        source: null,
+        type: null,
+        socialCreditCode: null,
+        mainBusiness: null,
+        legalRepresentative: null,
+        foundationDate: null,
+        licenceDate: null,
+        businessStartDate: null,
+        businessEndDate: null,
+        isPermanentlyEffective: null,
+        registerMoney: null,
+        registerMoneyUnit: null,
+        provinceCode: null,
+        province: null,
+        cityCode: null,
+        city: null,
+        districtCode: null,
+        district: null,
+        address: null,
+        businessField: null,
+        taxType: null,
+        isZero: null,
+        competentTaxAuthority: null,
+        taxCollectorName: null,
+        taxCollectorPhone: null,
+        taxMonth: null,
+        openingBank: null,
+        bankAccount: null,
+        annualIncome: null,
+        governmentAccountNo: null,
+        governmentPassword: null,
+        socialSecurityAccountNo: null,
+        socialSecurityPassword: null,
+        employeePassword: null,
+        housingFundPassword: null,
+        housingFundUnitAccount: null,
+        housingFundDeductionPassword: null,
+        collectionMethod: null,
+        quotaAmount: null,
+        isPayOnWindow: null,
+        isFirstSocialSecurity: null,
+        isFirstHousingFund: null,
+        customerLabelId: [],
+        boss: null
+    });
+    const { visible, query, list, selections, options } = toRefs(data)
+
+    function open(input) {
+        visible.value = true;
+
+        getList()
+    }
+    function close() {
+        visible.value = false;
+    }
+    const getList = () => {
+        listOrder(queryParams.value)
+            .then(res => {
+                total.value = res.total
+                list.value = res.rows
+
+            }).catch(err => {
+                console.log(err)
+            })
+    }
+    function resetQuery() {
+        proxy.resetForm("queryRef");
+        handleQuery();
+    }
+    const handleMultipleSelected = () => {
+        emit('choice', selections.value)
+        close()
+    }
+
+    const handleSimpleSelected = (row) => {
+        emit('choice', row)
+        close()
+    }
+    /** 搜索按钮操作 */
+    function handleQuery() {
+        queryParams.value.pageNum = 1;
+        getList();
+    }
+    const handleSelectionChange = (choiceSelections) => {
+        selections.value = choiceSelections
+    }
+    getList()
+    defineExpose({
+        open,
+        close
+    })
+</script>

+ 628 - 0
src/views/business/invoice/form.vue

@@ -0,0 +1,628 @@
+<template>
+    <!-- 添加或修改项目信息对话框 -->
+    <div class="el-drawer__wrapper">
+        <el-drawer :title="title" v-model="visible" direction="rtl" size="100%">
+            <div class="page-container form-container">
+                <div class="form-btns-container">
+                    <span class="title-label"><el-icon>
+                            <Document />
+                        </el-icon> 发票信息</span>
+                    <el-button-group>
+                        <el-button v-show="editStatus" type="primary" size="small" icon="Finished"
+                            @click="submitForm(0)" v-hasPermi="['business:invoice:save']">保存</el-button>
+
+                        <el-button v-show="editStatus" v-hasPermi="['business:invoice:submit']"
+                            style="margin-left: 10px;" type="primary" size="small" icon="Finished"
+                            @click="submitForm(1)">提交</el-button>
+                        <el-button v-show="form.id && editStatus" type="info" size="small" icon="Close"
+                            style="margin-left: 10px;" @click="editStatus = false">取消编辑</el-button>
+                        <div style="display: flex; gap: 10px;">
+                            <el-button v-show="!editStatus && (form.status == 0|| form.status == 4)" type="warning"
+                                size="small" icon="Edit" @click="editStatus = true"
+                                v-hasPermi="['business:invoice:edit']">编辑</el-button>
+                            <el-button v-show="!editStatus && (form.status == 0|| form.status == 4)"
+                                v-hasPermi="['business:invoice:submit']" style="margin-left: 10px;" type="primary"
+                                size="small" icon="Finished" @click="submitForm(1)">提交</el-button>
+                        </div>
+
+                        <div style="display: flex; gap: 10px;">
+                            <el-button v-show="!editStatus && form.status == 1" type="danger" size="small" icon="Close"
+                                @click="refuseStatus" v-hasPermi="['business:invoice:refuse']">拒绝</el-button>
+                            <el-button v-show="!editStatus && form.status == 1" type="primary" size="small" icon="Check"
+                                @click="passStatus" v-hasPermi="['business:invoice:pass']">通过</el-button>
+                            <el-button v-show="!editStatus && form.status == 1" type="warning" size="small" icon="Back"
+                                @click="returnStatus" v-hasPermi="['business:invoice:return']">退回</el-button>
+                        </div>
+
+
+                    </el-button-group>
+                    <div class="screen-btn" @click="handleScreen">
+                        <template v-if="!isFullscreen">
+                            <i class="fa fa-window-maximize" aria-hidden="true" />
+                            <!-- <span>全屏</span> -->
+                        </template>
+                        <template v-else>
+                            <i class="fa fa-window-restore" aria-hidden="true" />
+                            <!-- <span>还原</span> -->
+                        </template>
+                    </div>
+                    <div class="close-btn" @click="cancel">
+                        <i class="fa fa-times" aria-hidden="true" />
+                        <!-- <span>关闭</span> -->
+                    </div>
+                </div>
+                <div class="Y-scrollbar" style="position: absolute; top: 32px; bottom: 0; width: 100%; overflow: auto">
+                </div>
+                <el-form ref="invoiceRef" class="master-container" :model="form" :rules="rules" label-width="170px">
+                    <el-row :gutter="30">
+                        <el-col :span="12">
+                            <el-form-item label="发票类型:" prop="invoiceType">
+                                <el-select v-model="form.invoiceType" placeholder="请选择发票类型" size="small" clearable
+                                    v-if="editStatus">
+                                    <el-option label="增值税专用发票" :value="1"></el-option>
+                                    <el-option label="增值税普通发票" :value="2"></el-option>
+                                </el-select>
+                                <span v-else style="width: 100%">
+                                    {{ form.invoiceType == 1 ? '增值税专用发票' : '增值税普通发票' }}
+                                </span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="12" v-if="form.refuseReason != null && form.refuseReason != '' && 
+                        ( form.status == 4)">
+                            <el-form-item label="退回原因:" prop="refuseReason">
+                                <span>{{form.refuseReason}}</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row :gutter="30">
+                        <el-col :span="6">
+                            <el-form-item label="合同编号:" required>
+                                <el-input v-if="editStatus" style="width: 100%" v-model.trim="form.contractNo"
+                                    size="small" type="text" placeholder="请选择" :clearable="true">
+                                    <template #append>
+                                        <el-button icon="Search" @click="() => contractChoiceHandler()" />
+                                    </template>
+                                </el-input>
+                                <span v-else style="width: 100%">
+                                    <el-link :underline="false" type="primary" @click="handleContract(form)">{{
+                                        form.contractNo }}</el-link>
+                                </span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="可开票金额:">
+                                {{allowAmount + "元" }}
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="申请开票金额: " prop="allowInvoiceAmount">
+                                <el-input v-if="editStatus" v-model.number="form.allowInvoiceAmount"
+                                    placeholder="申请开票金额" size="small">
+                                    <template #append>元</template>
+                                </el-input>
+                                <span v-else>{{ form.allowInvoiceAmount + "元"}}</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="开票内容:" prop="invoiceContent">
+                                <el-select v-if="editStatus" v-model="form.invoiceContent" placeholder="开票内容"
+                                    size="small">
+                                    <el-option v-for="item in invoice_type" :key="item.value" :label="item.label"
+                                        :value="item.id"></el-option>
+                                </el-select>
+                                <span v-else>{{ form.invoiceContent }}</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="开票方:" prop="invoiceMy">
+                                <el-input v-if="editStatus" v-model="form.invoiceMy" placeholder="开票方" size="small" />
+                                <span v-else>{{ form.invoiceMy }}</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="社会信用代码:" prop="myCreditSocietyCode">
+                                <el-input v-if="editStatus" v-model="form.myCreditSocietyCode" placeholder="社会信用代码"
+                                    size="small" />
+                                <span v-else>{{ form.myCreditSocietyCode }}</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="开票方地址、电话:" prop="myAddress">
+                                <el-input v-if="editStatus" v-model="form.myAddress" placeholder="开票方地址、电话"
+                                    size="small" />
+                                <span v-else>{{ form.myAddress }}</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="开票方开户行及账号:" prop="myAccount">
+                                <el-input v-if="editStatus" v-model="form.myAccount" placeholder="开票方开户行及账号"
+                                    size="small" />
+                                <span v-else>{{ form.myAccount }}</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="收票方:" prop="invoiceOther">
+                                <el-input v-if="editStatus" v-model="form.invoiceOther" placeholder="请输入收票方"
+                                    size="small" />
+                                <span v-else>{{ form.invoiceOther }}</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="社会信用代码:" prop="otherCreditSocietyCode">
+                                <el-input v-if="editStatus" v-model="form.otherCreditSocietyCode" size="small"
+                                    placeholder="社会信用代码" />
+                                <span v-else>{{ form.otherCreditSocietyCode }}</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="收票方地址、电话:" prop="otherAddress">
+                                <el-input v-if="editStatus" v-model="form.otherAddress" placeholder="收票方地址、电话"
+                                    size="small" />
+                                <span v-else>{{ form.otherAddress }}</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="收票方开户行及账号:" prop="otherAccount">
+                                <el-input v-if="editStatus" v-model="form.otherAccount" placeholder="收票方开户行及账号"
+                                    size="small" />
+                                <span v-else>{{ form.otherAccount }}</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="6" v-if="!editStatus">
+                            <el-form-item label="申请人:" prop="applierName">
+                                <span>{{ form.applierName }}</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="6" v-if="!editStatus">
+                            <el-form-item label="申请时间:" prop="applierTime">
+                                <span>{{ form.applierTime }}</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="6" v-if="!editStatus">
+                            <el-form-item label="状态:" prop="status">
+                                <span v-if="form.status == 0">未提交</span>
+                                <span v-if="form.status == 1">待开票</span>
+                                <span v-if="form.status == 2">已拒绝</span>
+                                <span v-if="form.status == 3">已开票</span>
+                            </el-form-item>
+                        </el-col>
+
+
+                    </el-row>
+                    <el-row :gutter="30">
+                        <el-col :span="12">
+                            <el-form-item label="备注:" prop="remark">
+                                <el-input v-if="editStatus" v-model="form.remark" placeholder="请输入备注" size="small" />
+                                <span v-else>{{ form.remark }}</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row :gutter="30" v-show="form.status == 2">
+                        <el-col :span="6">
+                            <el-form-item label="拒绝原因:" prop="refuseReason">
+                                <span>{{ form.refuseReason }}</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row :gutter="30" v-show="form.status == 3">
+                        <el-col :span="6">
+                            <el-form-item label="开票人:" prop="inoviceName">
+                                <span>{{ form.invoiceName }}</span>
+                            </el-form-item>
+                        </el-col>
+
+                        <el-col :span="6">
+                            <el-form-item label="开票时间:" prop="inoviceTime">
+                                <span>{{ form.invoiceTime }}</span>
+                            </el-form-item>
+                        </el-col>
+
+                        <el-col :span="6">
+                            <el-form-item label="开票备注:" prop="invoiceRemark">
+                                <span>{{ form.invoiceRemark }}</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row v-show="form.status == 3">
+                        <el-form-item label="凭证文件:">
+                            <img style="height: 148px; width: 148px" :src="`${baseUrl}/${form.evidenceFile}`"
+                                class="avatar" @click="openEvidience('evidenceFile')" />
+                        </el-form-item>
+
+                    </el-row>
+                </el-form>
+            </div>
+        </el-drawer>
+
+        <el-dialog title="拒绝开票" v-model="refuseFlag" width="620px" append-to-body draggable
+            :close-on-click-modal="false">
+            <el-form ref="formRef" :model="form" :rules="refuseRules" label-width="100px">
+                <el-row :gutter="30">
+                    <el-col :span="12">
+                        <el-form-item label="拒绝原因" prop="refuseReason">
+                            <el-input :autosize="{ minRows: 2, maxRows: 4 }" type="textarea" v-model="form.refuseReason"
+                                placeholder="请输入拒绝原因" size="small" />
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+            </el-form>
+            <template #footer>
+                <el-button type="primary" @click="changeStauts1">确 定</el-button>
+                <el-button @click="refuseFlag = false">取 消</el-button>
+            </template>
+        </el-dialog>
+
+        <el-dialog title="退回开票" v-model="returnFlag" width="620px" append-to-body draggable
+            :close-on-click-modal="false">
+            <el-form ref="formRef" :model="form" :rules="returnRules" label-width="100px">
+                <el-row :gutter="30">
+                    <el-col :span="12">
+                        <el-form-item label="退回原因" prop="refuseReason">
+                            <el-input :autosize="{ minRows: 2, maxRows: 4 }" type="textarea" v-model="form.refuseReason"
+                                placeholder="请输入退回原因" size="small" />
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+            </el-form>
+            <template #footer>
+                <el-button type="primary" @click="changeStauts2">确 定</el-button>
+                <el-button @click="returnFlag = false">取 消</el-button>
+            </template>
+        </el-dialog>
+
+        <el-dialog title="开票审核通过" v-model="passFlag" width="70%" append-to-body draggable :close-on-click-modal="false">
+            <el-form ref="formRef" :model="form" :rules="passRules" label-width="100px">
+                <el-row :gutter="30">
+                    <el-col :span="8">
+                        <el-form-item label="收票方" prop="invoiceOther">
+                            <span>{{ form.invoiceOther }}</span>
+                        </el-form-item>
+                    </el-col>
+
+                    <el-col :span="6">
+                        <el-form-item label="申请开票金额 " prop="allowInvoiceAmount">
+                            <span>{{ form.allowInvoiceAmount }}</span>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="8">
+                        <el-form-item label="开票人 " prop="allowInvoiceAmount">
+                            <span>{{useUserStore().user.nickName }}</span>
+                        </el-form-item>
+                    </el-col>
+
+                </el-row>
+                <el-row :gutter="30">
+                    <el-col :span="8">
+                        <el-form-item label="开票时间 " prop="invoiceTime">
+                            <el-date-picker v-model.trim="form.invoiceTime" size="small" :clearable="true"
+                                style="width: 100%" format="YYYY-MM-DD" value-format="YYYY-MM-DD" align="center"
+                                type="date" placeholder="开票时间" />
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="14">
+                        <el-form-item label="社会信用代码" prop="otherCreditSocietyCode">
+                            <span>{{ form.otherCreditSocietyCode }}</span>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+                <el-col :span="24">
+                    <div class="details-btns-container">
+                        <el-form-item label="凭证文件" prop="evidenceFile">
+                            <dragUpload :accept="accept" style="width:50%" @file="upload"
+                                v-if="form.evidenceFile == null || form.evidenceFile == ''" />
+                            <img v-else style="height: 148px; width: 148px" :src="`${baseUrl}/${form.evidenceFile}`"
+                                class="avatar" @click="openEvidience('evidenceFile')" />
+                            <div v-if="!isView|| emptyForm.status !== 3">
+                                <el-icon :size="20" v-if="form.evidenceFile !== '' ||form.evidenceFile == null "
+                                    @click="form.evidenceFile = ''" class="delete-button">
+                                    <Delete />
+                                </el-icon>
+                            </div>
+                        </el-form-item>
+
+                    </div>
+                </el-col>
+                <el-row>
+                    <el-col :span="12">
+                        <el-form-item label="开票备注" prop="invoiceRemark">
+                            <el-input type="textarea" v-model="form.invoiceRemark" placeholder="开票备注"
+                                :autosize="{ minRows: 2, maxRows: 4 }" />
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+            </el-form>
+            <template #footer>
+                <el-button type="primary" @click="changeStauts3">确 定</el-button>
+                <el-button @click="passFlag = false">取 消</el-button>
+            </template>
+        </el-dialog>
+        <dialog-contract-choice ref="contractChoiceRef" @choice="contractChoiceHandle" />
+        <contract-form ref="contractRef" :get-list="getList" />
+    </div>
+</template>
+<script setup>
+    import { getInvoice, getCollectionToAmount, addInvoice, getInfoByName, updateInvoice } from "@/api/business/invoice";
+    import { getInfoByTenantId } from "@/api/business/info";
+    import DialogContractChoice from "./ContractChoice";
+    import { getToken, getTenant } from "@/utils/auth";
+    import contractForm from "@/views/business/crm/order/form.vue";
+    import dragUpload from "@/components/dragUpload"
+    import useUserStore from "@/store/modules/user";
+    import { uploadFile } from "@/api/tool/file";
+    const { proxy } = getCurrentInstance()
+    const baseUrl = import.meta.env.VITE_APP_BASE_API;
+    /** 父组件传参 */
+    const props = defineProps({
+        getList: {
+            type: Function,
+            default: () => { }
+        }
+    })
+    const userStore = useUserStore();
+    const { getList } = toRefs(props)
+    /** 字典数组区 */
+    const { invoice_type } = proxy.useDict("invoice_type");
+    /** 表单抽屉 页变量 */
+    const title = ref("")
+    const loading = ref(false)
+    const multiple = ref(true)
+    const visible = ref(false)
+    const refuseFlag = ref(false)
+    const returnFlag = ref(false)
+    const passFlag = ref(false)
+    const editStatus = ref(false)
+    const allowAmount = ref(0)
+    const fileList = ref([]);
+    const isFullscreen = ref(false)
+    const webHost = import.meta.env.VITE_APP_BASE_API
+    const data = reactive({
+        form: {},
+        rules: {
+            invoiceMy: [{ required: true, trigger: "blur", message: "请输入开票方" }],
+            myCreditSocietyCode: [{ required: true, max: 18, min: 18, message: "社会信用代码为18位", trigger: "blur" }],
+            invoiceOther: [{ required: true, trigger: "blur", message: "请输入请输入收票方" }],
+            otherCreditSocietyCode: [{ required: true, max: 18, min: 18, message: "社会信用代码为18位", trigger: "blur" }],
+            allowInvoiceAmount: [
+                { required: true, type: 'number', message: '请输入正确数据', trigger: 'blur' }
+            ],
+            invoiceContent: [
+                { required: true, trigger: "change", message: "请选择开票内容" }
+            ],
+            invoiceType: [{ required: true, trigger: "change", message: "请选择发票类型" }],
+        },
+        returnRules: {
+            refuseReason: [{ required: true, trigger: "blur", message: "请输入退回原因" }],
+        },
+        refuseRules: {
+            refuseReason: [{ required: true, trigger: "blur", message: "请输入拒绝原因" }],
+        },
+        passRules: {
+            evidenceFile: [{ required: true, trigger: "blur", message: "请上传图片" }],
+            invoiceTime: [{ required: true, trigger: "change", message: "请选择开票时间" }],
+        }
+    });
+    const { form, rules, returnRules, refuseRules, passRules } = toRefs(data);
+    /***********************  方法区  ****************************/
+    /** 打开抽屉 */
+    function open(id) {
+        reset();
+        visible.value = true;
+        if (id) {
+            getInvoice(id).then(response => {
+                form.value = response.data;
+                editStatus.value = false
+                title.value = "修改发票信息"
+                //通过合同id 查询出已收款的合同
+                getCollectionToAmount(form.value.contractId).then(res => {
+                    allowAmount.value = res.data
+                })
+            })
+        } else {
+            editStatus.value = true
+            title.value = "添加发票信息"
+            getCodeInfo()
+        }
+    }
+    function openEvidience() {
+
+        window.open(`${baseUrl}${form.value.evidenceFile}`);
+    }
+    /** 取消按钮 */
+    function cancel() {
+        visible.value = false;
+        reset();
+    }
+
+    /** 表单重置 */
+    function reset() {
+        form.value = {
+            id: null,
+            invoiceType: null,
+            contractId: null,
+            allowInvoiceAmount: null,
+            invoiceContent: null,
+            invoiceMy: null,
+            myCreditSocietyCode: null,
+            myAddress: null,
+            myAccount: null,
+            invoiceOther: null,
+            otherCreditSocietyCode: null,
+            otherAddress: null,
+            applierId: null,
+            applierTime: null,
+            status: null,
+            invoiceId: null,
+            invoiceTime: null,
+            remark: null,
+            invoiceRemark: null,
+            createTime: null,
+            creatorId: null,
+            updateTime: null,
+            updaterId: null,
+            deleted: null,
+            version: null
+        };
+        proxy.resetForm("invoiceRef");
+    }
+
+    /** 全屏缩放 */
+    function handleScreen() {
+        const dom = document.querySelector('.list-container > .el-drawer__wrapper > .el-overlay')
+        isFullscreen.value = !isFullscreen.value
+        dom.style.position = isFullscreen.value ? 'fixed' : 'absolute'
+    }
+    function handleContract() {
+        proxy.$refs.contractRef.open(form.value.contractId);
+    }
+    function getCodeInfo() {
+        getInfoByTenantId().then(res => {
+            if (res.data != null) {
+                form.value.myCreditSocietyCode = res.data.code
+                form.value.myAddress = res.data.address
+                form.value.myAccount = res.data.account
+                form.value.invoiceMy = res.data.name
+            }
+        })
+    }
+    function refuseStatus() {
+
+
+        refuseFlag.value = true
+    }
+
+    function returnStatus() {
+
+        returnFlag.value = true
+    }
+
+    function passStatus() {
+        passFlag.value = true
+    }
+    function changeStauts1() {
+        if (form.value.refuseReason === "" || form.value.refuseReason == null) {
+            proxy.$modal.msgError("请填写拒绝原因");
+            return;
+        }
+        form.value.status = 2
+        updateInvoice(form.value).then(response => {
+            proxy.$modal.msgSuccess("修改成功");
+            visible.value = false;
+            refuseFlag.value = false
+            getList.value()
+        });
+    }
+    /** 文件上传 */
+    function upload(param) {
+        const formData = new FormData();
+        formData.append("file", param);
+        uploadFile(formData).then((res) => {
+            if (res.code === 200) {
+                const file = {};
+                file.fileName = res.newFileName;
+                file.url = res.fileName;
+                file.originalFileName = res.originalFilename;
+                file.fileUrl = res.fileName;
+                fileList.value.push(file);
+                form.value.evidenceFile = file.fileUrl;
+                form.value.originalFileName = res.originalFilename;
+                form.value.fileName = res.newFileName;
+            }
+        });
+    }
+    function changeStauts2() {
+        if (form.value.refuseReason === "" || form.value.refuseReason == null) {
+            proxy.$modal.msgError("请填写退回原因");
+            return;
+        }
+        form.value.status = 4
+        updateInvoice(form.value).then(response => {
+            proxy.$modal.msgSuccess("修改成功");
+            visible.value = false;
+            returnFlag.value = false
+            getList.value()
+        });
+    }
+    function changeStauts3() {
+        console.log(form.value.refuseReason);
+
+        if (form.value.invoiceTime === "" || form.value.invoiceTime == null) {
+            proxy.$modal.msgError("请选择开票时间");
+            return;
+        }
+
+        if (form.value.evidenceFile === "" || form.value.evidenceFile == null) {
+            proxy.$modal.msgError("请上传图片");
+            return;
+        }
+        form.value.status = 3
+        updateInvoice(form.value).then(response => {
+            proxy.$modal.msgSuccess("修改成功");
+            visible.value = false;
+            passFlag.value = false
+            getList.value()
+        });
+    }
+    /** 提交按钮 */
+    function submitForm(status) {
+        if (form.value.contractNo === "" || form.value.contractNo == null) {
+            proxy.$modal.msgError("请选择合同");
+            return;
+        }
+        proxy.$refs["invoiceRef"].validate(valid => {
+            if (valid) {
+                if (form.value.status == 4 && status == 0) {
+                    form.value.status = 4
+                } else {
+                    form.value.status = status
+                }
+
+                if (form.value.id != null) {
+                    updateInvoice(form.value).then(response => {
+                        proxy.$modal.msgSuccess("修改成功");
+                        visible.value = false;
+                        getList.value()
+                    });
+                } else {
+                    addInvoice(form.value).then(response => {
+                        proxy.$modal.msgSuccess("新增成功");
+                        visible.value = false;
+                        getList.value()
+                    });
+                }
+            }
+        });
+    }
+    function contractChoiceHandler() {
+
+        proxy.$refs.contractChoiceRef.open();
+    }
+    function contractChoiceHandle(info) {
+        form.value.contractId = info.id
+        form.value.contractNo = info.contractNo
+        form.value.invoiceOther = info.companyName
+        getInfoByName(info.companyName).then(res => {
+            if (res.data != null) {
+                form.value.otherCreditSocietyCode = res.data.code
+                form.value.otherAddress = res.data.address
+                form.value.otherAccount = res.data.account
+            }
+        })
+        //通过合同id 查询出已收款的合同
+        getCollectionToAmount(info.id).then(res => {
+            allowAmount.value = res.data
+        })
+    }
+    /** 查询表单信息  */
+    function getForm() {
+        loading.value = true
+        getInvoice(form.value.id).then(response => {
+            loading.value = false
+            form.value = response.data
+        })
+    }
+
+    /** 暴露给父组件的方法 */
+    defineExpose({
+        open
+    })
+</script>

+ 230 - 0
src/views/business/invoice/index.vue

@@ -0,0 +1,230 @@
+<template>
+    <div class="page-container list-container">
+        <!-- 功能按钮区 -->
+        <div class="list-btns-container">
+            <el-button type="primary" size="small" icon="Plus" @click="handleAdd"
+                v-hasPermi="['business:invoice:add']">新增</el-button>
+
+            <!-- <el-button
+                    type="success"
+                    size="small"
+                    icon="Edit"
+                    :disabled="single"
+                    @click="handleUpdate"
+                    v-hasPermi="['business:invoice:edit']"
+            >修改</el-button>
+
+            <el-button
+                    type="danger"
+                    size="small"
+                    icon="Delete"
+                    :disabled="multiple"
+                    @click="handleDelete"
+                    v-hasPermi="['business:invoice:remove']"
+            >删除</el-button> -->
+
+            <el-button type="warning" size="small" icon="Download" @click="handleExport"
+                v-hasPermi="['business:invoice:export']">导出</el-button>
+            <!--<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>-->
+        </div>
+        <!-- 搜索区 -->
+        <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true" label-width="68px">
+            <el-form-item label="收票方:" prop="invoiceOther">
+                <el-input size="small" v-model="queryParams.invoiceOther" style="width: 150px" placeholder="请输入收票方"
+                    clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="合同编号: " prop="contractNo">
+                <el-input size="small" v-model="queryParams.contractNo" style="width: 150px" placeholder="合同编号"
+                    clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="发票类型: " prop="invoiceType">
+                <el-select v-model="queryParams.invoiceType" placeholder="请选择发票类型" size="small" clearable
+                    style="width: 150px">
+                    <el-option label="增值税专用发票" value="1"></el-option>
+                    <el-option label="增值税普通发票" value="2"></el-option>
+                </el-select>
+            </el-form-item>
+            <el-form-item label="状态:" prop="status">
+                <el-select v-model="queryParams.status" placeholder="请选择状态" size="small" clearable style="width: 150px">
+                    <el-option label="未提交" value="0"></el-option>
+                    <el-option label="待开票" value="1"></el-option>
+                    <el-option label="已拒绝" value="2"></el-option>
+                    <el-option label="已开票" value="3"></el-option>
+                    <el-option label="已退回" value="4"></el-option>
+                </el-select>
+            </el-form-item>
+            <el-form-item label="申请人: " prop="applierName">
+                <el-input size="small" v-model="queryParams.applierName" style="width: 150px" placeholder="申请人"
+                    clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item prop="dateFilter" label="申请时间:">
+                <el-date-picker v-model="queryParams.dateFilter" type="daterange" clearable size="small"
+                    format="YYYY - MM - DD " value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期"
+                    end-placeholder="业务日期" style="width: 100%;"></el-date-picker>
+            </el-form-item>
+            <el-form-item label="开票人:" prop="invoiceName">
+                <el-input size="small" v-model="queryParams.invoiceName" placeholder="请输入开票人" clearable
+                    style="width: 150px" @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item prop="invoiceDateFilter" label="开票时间:">
+                <el-date-picker v-model="queryParams.invoiceDateFilter" type="daterange" clearable size="small"
+                    format="YYYY - MM - DD " value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期"
+                    end-placeholder="业务日期" style="width: 100%;"></el-date-picker>
+            </el-form-item>
+            <el-form-item>
+                <el-button type="primary" icon="Search" @click="handleQuery" size="small">搜索</el-button>
+                <el-button icon="Refresh" @click="resetQuery" size="small">重置</el-button>
+            </el-form-item>
+
+        </el-form>
+        <!-- 列表区 -->
+        <el-table v-loading="loading" :data="invoiceList" size="small" border height="100%">
+            <el-table-column type="index" width="55" align="center" />
+            <el-table-column label="收票方" align="center" prop="invoiceOther" width="200"></el-table-column>/>
+            <el-table-column label="合同编号" align="center" prop="contractNo" />
+            <el-table-column label="发票类型" align="center" prop="invoiceType">
+                <template #default="scope">
+                    <span v-if="scope.row.invoiceType == 1">增值税专用发票</span>
+                    <span v-if="scope.row.invoiceType == 2">增值税普通发票</span>
+                    <span v-if="scope.row.invoiceType == 3">增值税电子发票</span>
+                </template>
+            </el-table-column>
+            <el-table-column label="开票金额" align="center" prop="allowInvoiceAmount" />
+            <el-table-column label="发票备注" align="center" prop="remark" />
+            <el-table-column label="状态" align="center" prop="status">
+                <template #default="scope">
+                    <el-link style="font-size: 12px;" type="warning" :underline="false"
+                        v-if="scope.row.status == 0">未提交</el-link>
+                    <el-link style="font-size: 12px;" type="primary" :underline="false"
+                        v-if="scope.row.status == 1">待开票</el-link>
+                    <el-link style="font-size: 12px;" type="danger" :underline="false"
+                        v-if="scope.row.status == 2">已拒绝</el-link>
+                    <el-link style="font-size: 12px;" type="success" :underline="false"
+                        v-if="scope.row.status == 3">已开票</el-link>
+                        <el-link style="font-size: 12px;" type="warning" :underline="false"
+                        v-if="scope.row.status == 4">已退回</el-link>
+                </template>
+            </el-table-column>
+            <el-table-column label="申请人" align="center" prop="applierName" />
+            <el-table-column label="申请时间" align="center" prop="applierTime" width="180">
+            </el-table-column>
+            <el-table-column label="开票人" align="center" prop="invoiceName" />
+            <el-table-column label="开票时间" align="center" prop="invoiceTime" />
+
+            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+                <template #default="scope">
+                    <el-button link type="warning" size="small" icon="Edit" @click="handleUpdate(scope.row)"
+                        v-hasPermi="['business:invoice:query']">查看</el-button>
+                    <!-- <el-button link type="warning" size="small" icon="Edit" @click="handleUpdate(scope.row)"
+                        v-hasPermi="['business:invoice:edit']">修改</el-button> -->
+                    <!-- <el-button link type="danger" size="small" icon="Delete" @click="handleDelete(scope.row)"
+                        v-hasPermi="['business:invoice:remove']">删除</el-button> -->
+                </template>
+            </el-table-column>
+        </el-table>
+
+        <!-- 分页 -->
+        <pagination v-show="total>0" :total="total" v-model:page="queryParams.pageNum"
+            v-model:limit="queryParams.pageSize" @pagination="getList" />
+
+        <!-- 表单 -->
+        <invoice-form ref="invoiceRef" :get-list="getList"></invoice-form>
+    </div>
+</template>
+
+<script setup name="Invoice">
+    import { listInvoice, delInvoice, exportInfo } from "@/api/business/invoice";
+    import invoiceForm from "./form"
+    const { proxy } = getCurrentInstance()
+    /** 字典数组区 */
+    /** 查询 对象 */
+
+    const invoiceList = ref([]);
+    const loading = ref(true);
+    const ids = ref([])
+    const single = ref(true);
+    const multiple = ref(true);
+    const total = ref(0);
+    /** 查询对象 */
+    const queryParams = ref({
+        pageNum: 1,
+        pageSize: 20,
+        invoiceType: null,
+        allowInvoiceAmount: null,
+        invoiceContent: null,
+        invoiceMy: null,
+        myCreditSocietyCode: null,
+        myAddress: null,
+        myAccount: null,
+        invoiceOther: null,
+        otherCreditSocietyCode: null,
+        otherAddress: null,
+        applierTime: null,
+        status: null,
+        invoiceTime: null,
+        invoiceRemark: null,
+    })
+
+    /***********************  方法区  ****************************/
+    onActivated(() => {
+        // 你的逻辑
+        getList();
+    });
+    /** 查询企业租户列表 */
+    function getList() {
+        loading.value = true;
+        listInvoice(queryParams.value).then(response => {
+            invoiceList.value = response.rows;
+            total.value = response.total;
+            loading.value = false;
+        });
+    }
+
+    /** 搜索按钮操作 */
+    function handleQuery() {
+        queryParams.value.pageNum = 1;
+        getList();
+    }
+
+    /** 重置按钮操作 */
+    function resetQuery() {
+        proxy.resetForm("queryRef");
+        handleQuery();
+    }
+
+    // 多选框选中数据
+    function handleSelectionChange(selection) {
+        ids.value = selection.map(item => item.id);
+        single.value = selection.length != 1;
+        multiple.value = !selection.length;
+    }
+
+    /** 新增按钮操作 */
+    function handleAdd() {
+        proxy.$refs.invoiceRef.open()
+    }
+
+    /** 修改按钮操作 */
+    function handleUpdate(row) {
+        const id = row.id || ids.value
+        proxy.$refs.invoiceRef.open(id)
+    }
+
+
+    /** 删除按钮操作 */
+    function handleDelete(row) {
+        const _ids = row.id || ids.value;
+        proxy.$modal.confirm('是否确认删除选中的数据项?').then(function () {
+            return delInvoice(_ids);
+        }).then(() => {
+            getList();
+            proxy.$modal.msgSuccess("删除成功!");
+        }).catch(() => { });
+    }
+
+    /** 导出按钮操作 */
+    function handleExport() {
+        exportInfo(queryParams.value)
+    }
+    getList();
+</script>

+ 300 - 438
src/views/business/paymentEntry/type/index.vue

@@ -6,8 +6,7 @@
         <div class="page-container list-container">
           <!--操作按钮 开始-->
           <div>
-            <span
-              style="
+            <span style="
                 display: inline-block;
                 height: 20px;
                 line-height: 18px;
@@ -16,120 +15,52 @@
                 margin-top: 5px;
                 font-weight: 700;
                 border-left: 3px;
-              "
-              >支出类目</span
-            >
-            <el-button
-              type="primary"
-              size="small"
-              v-hasPermi="['paymentEntry:type:add']"
-              icon="plus"
-              @click="newType"
-            >
-              新增</el-button
-            >
+              ">支出类目</span>
+            <el-button type="primary" size="small" v-hasPermi="['paymentEntry:type:add']" icon="plus" @click="newType">
+              新增</el-button>
 
-            <el-button
-              type="success"
-              size="small"
-              icon="refresh"
-              @click="loadData"
-            >
-              刷新</el-button
-            >
+            <el-button type="success" size="small" icon="refresh" @click="loadData">
+              刷新</el-button>
           </div>
-          <div
-            class="el-table-container"
-            style="height: 100%; position: relative; overflow: auto"
-          >
-            <div
-              style="
+          <div class="el-table-container" style="height: 100%; position: relative; overflow: auto">
+            <div style="
                 height: 100%;
                 position: absolute;
                 top: 0;
                 left: 0;
                 right: 0;
                 bottom: 0;
-              "
-            >
-              <el-table
-                class="table-falex"
-                v-loading="loading"
-                :data="typeList"
-                size="small"
-                border
-                height="100%"
-                @row-click="rowClick"
-                @selection-change="handleSelectionChange"
-                highlight-current-row="true"
-              >
+              ">
+              <el-table class="table-falex" v-loading="loading" :data="typeList" size="small" border height="100%"
+                @row-click="rowClick" @selection-change="handleSelectionChange" highlight-current-row="true">
                 <el-table-column label="支出类目" align="center" prop="name">
                   <template #default="scope">
-                    <el-input
-                      size="small"
-                      v-if="scope.row.isAdd || scope.row.isEdit"
-                      v-model="scope.row.name"
-                      placeholder="请输入支出类目"
-                    ></el-input>
+                    <el-input size="small" v-if="scope.row.isAdd || scope.row.isEdit" v-model="scope.row.name"
+                      placeholder="请输入支出类目"></el-input>
                     <span v-else>{{ scope.row.name }}</span>
                   </template>
                 </el-table-column>
 
                 <el-table-column label="备注" align="center" prop="remark">
                   <template #default="scope">
-                    <el-input
-                      size="small"
-                      v-if="scope.row.isAdd || scope.row.isEdit"
-                      v-model="scope.row.remark"
-                      placeholder="请输入备注"
-                    ></el-input>
+                    <el-input size="small" v-if="scope.row.isAdd || scope.row.isEdit" v-model="scope.row.remark"
+                      placeholder="请输入备注"></el-input>
                     <span v-else>{{ scope.row.remark }}</span>
                   </template>
                 </el-table-column>
-                <el-table-column
-                  label="操作"
-                  align="center"
-                  class-name="small-padding fixed-width"
-                >
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
                   <template #default="scope">
                     <template v-if="!scope.row.isAdd && !scope.row.isEdit">
-                      <el-button
-                        v-show="!scope.row.isAdd && !scope.row.isEdit"
-                        link
-                        type="warning"
-                        size="small"
-                        @click="handleUpdate(scope.row)"
-                        circle
-                        v-hasPermi="['paymentEntry:type:edit']"
-                        >修改</el-button
-                      >
-                      <el-button
-                        v-show="!scope.row.isAdd && !scope.row.isEdit"
-                        link
-                        type="danger"
-                        size="small"
-                        @click="handleDelete(scope.row)"
-                        v-hasPermi="['paymentEntry:type:remove']"
-                        >删除</el-button
-                      >
+                      <el-button v-show="!scope.row.isAdd && !scope.row.isEdit" link type="warning" size="small"
+                        @click="handleUpdate(scope.row)" circle v-hasPermi="['paymentEntry:type:edit']">修改</el-button>
+                      <el-button v-show="!scope.row.isAdd && !scope.row.isEdit" link type="danger" size="small"
+                        @click="handleDelete(scope.row)" v-hasPermi="['paymentEntry:type:remove']">删除</el-button>
                     </template>
                     <template v-if="scope.row.isEdit || scope.row.isAdd">
-                      <el-button
-                        v-if="scope.row.isEdit || scope.row.isAdd"
-                        link
-                        type="primary"
-                        size="small"
-                        @click="typeleSave(scope.row)"
-                        >保存</el-button
-                      >
-                      <el-button
-                        v-if="scope.row.isEdit || scope.row.isAdd"
-                        link
-                        type="Delete"
-                        size="small"
-                        @click="handleCancel(scope.row)"
-                        >取消</el-button
-                      >
+                      <el-button v-if="scope.row.isEdit || scope.row.isAdd" link type="primary" size="small"
+                        @click="typeleSave(scope.row)">保存</el-button>
+                      <el-button v-if="scope.row.isEdit || scope.row.isAdd" link type="Delete" size="small"
+                        @click="handleCancel(scope.row)">取消</el-button>
                     </template>
                   </template>
                 </el-table-column>
@@ -141,8 +72,7 @@
       <el-col :span="14" style="height: 100%">
         <div class="page-container list-container">
           <div>
-            <span
-              style="
+            <span style="
                 display: inline-block;
                 height: 20px;
                 line-height: 18px;
@@ -151,115 +81,49 @@
                 margin-top: 5px;
                 font-weight: 700;
                 border-left: 3px;
-              "
-              >支付科目</span
-            >
+              ">支付科目</span>
             <template v-if="currentDepartment !== null">
-              <el-button
-                type="primary"
-                size="small"
-                icon="plus"
-                v-hasPermi="['expenditure:subject:add']"
-                @click="newSubType"
-                >新增</el-button
-              >
+              <el-button type="primary" size="small" icon="plus" v-hasPermi="['expenditure:subject:add']"
+                @click="newSubType">新增</el-button>
             </template>
-            <el-button
-              type="success"
-              size="small"
-              icon="refresh"
-              @click="loadSubData"
-            >
-              刷新</el-button
-            >
+            <el-button type="success" size="small" icon="refresh" @click="loadSubData">
+              刷新</el-button>
           </div>
           <div class="el-table-container" style="height: 100%">
             <div style="height: 100%">
-              <el-table
-                v-loading="loading"
-                :data="typeSubLis"
-                size="small"
-                border
-                height="100%"
-                @selection-change="handleSelectionChange"
-              >
+              <el-table v-loading="loading" :data="typeSubLis" size="small" border height="100%"
+                @selection-change="handleSelectionChange">
                 <el-table-column label="支付科目" align="center" prop="name">
                   <template #default="scope">
-                    <el-input
-                      size="small"
-                      v-if="scope.row.isAdd || scope.row.isEdit"
-                      v-model="scope.row.name"
-                      placeholder="请输入支付科目"
-                    ></el-input>
+                    <el-input size="small" v-if="scope.row.isAdd || scope.row.isEdit" v-model="scope.row.name"
+                      placeholder="请输入支付科目"></el-input>
                     <span v-else>{{ scope.row.name }}</span>
                   </template>
                 </el-table-column>
                 <el-table-column label="状态" align="center" prop="status">
                   <template #default="scope">
-                    <el-select
-                      size="small"
-                      style="width: 100%"
-                      v-if="scope.row.isAdd || scope.row.isEdit"
-                      v-model.trim="scope.row.status"
-                      placeholder="选择状态"
-                      :clearable="true"
-                    >
-                      <el-option
-                        v-for="item in subType"
-                        :key="item.label"
-                        :label="item.label"
-                        :value="item.value"
-                      />
+                    <el-select size="small" style="width: 100%" v-if="scope.row.isAdd || scope.row.isEdit"
+                      v-model.trim="scope.row.status" placeholder="选择状态" :clearable="true">
+                      <el-option v-for="item in subType" :key="item.label" :label="item.label" :value="item.value" />
                     </el-select>
                     <span v-else>{{
                       scope.row.status === 0 ? "启用" : "停用"
-                    }}</span>
+                      }}</span>
                   </template>
                 </el-table-column>
-                <el-table-column
-                  label="操作"
-                  align="center"
-                  class-name="small-padding fixed-width"
-                >
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
                   <template #default="scope">
                     <template v-if="!scope.row.isAdd && !scope.row.isEdit">
-                      <el-button
-                        v-show="!scope.row.isAdd && !scope.row.isEdit"
-                        link
-                        type="warning"
-                        size="small"
-                        @click="handleUpdate(scope.row)"
-                        circle
-                        v-hasPermi="['expenditure:subject:edit']"
-                        >修改</el-button
-                      >
-                      <el-button
-                        v-show="!scope.row.isAdd && !scope.row.isEdit"
-                        link
-                        type="danger"
-                        size="small"
-                        @click="handleSubDelete(scope.row)"
-                        v-hasPermi="['expenditure:subject:remove']"
-                        >删除</el-button
-                      >
+                      <el-button v-show="!scope.row.isAdd && !scope.row.isEdit" link type="warning" size="small"
+                        @click="handleUpdate(scope.row)" circle v-hasPermi="['expenditure:subject:edit']">修改</el-button>
+                      <el-button v-show="!scope.row.isAdd && !scope.row.isEdit" link type="danger" size="small"
+                        @click="handleSubDelete(scope.row)" v-hasPermi="['expenditure:subject:remove']">删除</el-button>
                     </template>
                     <template v-if="scope.row.isEdit || scope.row.isAdd">
-                      <el-button
-                        v-if="scope.row.isEdit || scope.row.isAdd"
-                        link
-                        type="primary"
-                        size="small"
-                        @click="typeSubSave(scope.row)"
-                        >保存</el-button
-                      >
-                      <el-button
-                        v-if="scope.row.isEdit || scope.row.isAdd"
-                        link
-                        type="Delete"
-                        size="small"
-                        @click="subCancel(scope.row)"
-                        >取消</el-button
-                      >
+                      <el-button v-if="scope.row.isEdit || scope.row.isAdd" link type="primary" size="small"
+                        @click="typeSubSave(scope.row)">保存</el-button>
+                      <el-button v-if="scope.row.isEdit || scope.row.isAdd" link type="Delete" size="small"
+                        @click="subCancel(scope.row)">取消</el-button>
                     </template>
                   </template>
                 </el-table-column>
@@ -269,304 +133,302 @@
         </div>
       </el-col>
     </el-row>
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="loadSubData"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="loadSubData" />
   </div>
 </template>
 
-<script setup name="Type">
-import {
-  listType,
-  delType,
-  listTypeSub,
-  addType,
-  updateType,
-} from "@/api/business/paymentEntry/type";
-import {
-  addSubject,
-  updateSubject,
-  delSubject,
-} from "@/api/business/paymentEntry/subject";
-import { subType } from "@/utils/default";
+<script setup name="PaymentEntry">
+  import {
+    listType,
+    delType,
+    listTypeSub,
+    addType,
+    updateType,
+  } from "@/api/business/paymentEntry/type";
+  import {
+    addSubject,
+    updateSubject,
+    delSubject,
+  } from "@/api/business/paymentEntry/subject";
+  import { subType } from "@/utils/default";
 
-import { ref } from "vue";
-// import typeForm from "./form";
-const { proxy } = getCurrentInstance();
-/** 字典数组区 */
-/** 查询 对象 */
+  import { ref } from "vue";
+  // import typeForm from "./form";
+  const { proxy } = getCurrentInstance();
+  /** 字典数组区 */
+  /** 查询 对象 */
 
-const typeList = ref([]);
-const typeSubLis = ref([]);
-const bizPaymentSubjectList = ref([]);
-const loading = ref(true);
-const ids = ref([]);
-const single = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-const typeId = ref();
-/** 查询对象 */
+  const typeList = ref([]);
+  const typeSubLis = ref([]);
+  const bizPaymentSubjectList = ref([]);
+  const loading = ref(true);
+  const ids = ref([]);
+  const single = ref(true);
+  const multiple = ref(true);
+  const total = ref(0);
+  const typeId = ref();
+  /** 查询对象 */
 
-const query = ref({
-  name: null,
-  remark: null,
-  isAdd: false,
-  isEdit: false,
-});
+  const query = ref({
+    name: null,
+    remark: null,
+    isAdd: false,
+    isEdit: false,
+  });
 
-const queryParams = ref({
-  pageNum: 1,
-  pageSize: 20,
-  id: null,
-  name: null,
-  isAdd: false,
-  isEdit: false,
-  status: 0,
-});
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    id: null,
+    name: null,
+    isAdd: false,
+    isEdit: false,
+    status: 0,
+  });
 
-/***********************  方法区  ****************************/
+  /***********************  方法区  ****************************/
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
+  /** 查询支出类目列表 */
+  function getList() {
+    listType(query.value).then((response) => {
+      typeList.value = response.rows;
+
+      if (typeList.value.length > 0) {
+        queryParams.value.paymentTypeId = typeList.value[0].id;
+        typeId.value = typeList.value[0].id;
+        getTypeSubList(queryParams.value);
+      } else {
+        loading.value = false;
+      }
+    });
+  }
 
-/** 查询支出类目列表 */
-function getList() {
-  listType(query.value).then((response) => {
-    typeList.value = response.rows;
+  /** 支出类目列表刷新 */
+  function loadData() {
+    getList();
+  }
 
-    if (typeList.value.length > 0) {
-      queryParams.value.paymentTypeId = typeList.value[0].id;
-      typeId.value = typeList.value[0].id;
+  //支付科目刷新
+  function loadSubData() {
+    if (typeId.value != null) {
+      loading.value = true;
+      queryParams.value.paymentTypeId = typeId.value;
       getTypeSubList(queryParams.value);
-    } else {
-      loading.value = false;
     }
-  });
-}
-
-/** 支出类目列表刷新 */
-function loadData() {
-  getList();
-}
+  }
 
-//支付科目刷新
-function loadSubData() {
-  if (typeId.value != null) {
-    loading.value = true;
-    queryParams.value.paymentTypeId = typeId.value;
+  /** 支出类目列表点击事件 */
+  function rowClick(record) {
+    if (record.isAdd) {
+      return;
+    }
+    queryParams.value.paymentTypeId = record.id;
+    typeId.value = record.id;
     getTypeSubList(queryParams.value);
   }
-}
 
-/** 支出类目列表点击事件 */
-function rowClick(record) {
-  if (record.isAdd) {
-    return;
+  /** 获取支出科目列表 */
+  function getTypeSubList(data) {
+    listTypeSub(data).then((response) => {
+      typeSubLis.value = response.rows;
+      total.value = response.total;
+      loading.value = false;
+    });
   }
-  queryParams.value.paymentTypeId = record.id;
-  typeId.value = record.id;
-  getTypeSubList(queryParams.value);
-}
 
-/** 获取支出科目列表 */
-function getTypeSubList(data) {
-  listTypeSub(data).then((response) => {
-    typeSubLis.value = response.rows;
-    total.value = response.total;
-    loading.value = false;
-  });
-}
+  /** 新增支付科目 */
+  function newSubType() {
+    // 此处必须进行深拷贝,否则添加的明细,将都指向了一个对象
+    const _newSource = JSON.parse(JSON.stringify(queryParams.value));
+    typeSubLis.value.push(_newSource);
+    handleSourceCurrentChange(_newSource);
+  }
 
-/** 新增支付科目 */
-function newSubType() {
-  // 此处必须进行深拷贝,否则添加的明细,将都指向了一个对象
-  const _newSource = JSON.parse(JSON.stringify(queryParams.value));
-  typeSubLis.value.push(_newSource);
-  handleSourceCurrentChange(_newSource);
-}
+  /** 支出科目保存 */
+  function typeSubSave(row) {
+    if (typeList.value.length == 0) {
+      proxy.$modal.msgError("请先添加支出类目");
+      return;
+    }
+    if (typeId.value == null || typeId.value === "") {
+      proxy.$modal.msgError("请选择支出类目");
+      return;
+    }
+    if (row.name == "" || row.name == null) {
+      proxy.$modal.msgError("支付科目不能为空");
+      return;
+    }
+    if (row.status == null || row.status === "") {
+      proxy.$modal.msgError("状态不能为空");
+      return;
+    }
+    loading.value = true;
 
-/** 支出科目保存 */
-function typeSubSave(row) {
-  if (typeList.value.length == 0) {
-    proxy.$modal.msgError("请先添加支出类目");
-    return;
-  }
-  if (typeId.value == null || typeId.value === "") {
-    proxy.$modal.msgError("请选择支出类目");
-    return;
-  }
-  if (row.name == "" || row.name == null) {
-    proxy.$modal.msgError("支付科目不能为空");
-    return;
-  }
-  if (row.status == null || row.status === "") {
-    proxy.$modal.msgError("状态不能为空");
-    return;
+    if (row.isAdd) {
+      addSubject(row).then((response) => {
+        if (response.code === 200) {
+          proxy.$modal.msgSuccess("保存成功");
+          queryParams.value.paymentTypeId = typeId.value;
+          getTypeSubList(queryParams.value);
+        }
+      });
+    } else {
+      updateSubject(row).then((response) => {
+        if (response.code === 200) {
+          proxy.$modal.msgSuccess("保存成功");
+          queryParams.value.paymentTypeId = typeId.value;
+          getTypeSubList(queryParams.value);
+        }
+      });
+    }
   }
-  loading.value = true;
 
-  if (row.isAdd) {
-    addSubject(row).then((response) => {
-      if (response.code === 200) {
-        proxy.$modal.msgSuccess("保存成功");
-        queryParams.value.paymentTypeId = typeId.value;
-        getTypeSubList(queryParams.value);
-      }
-    });
-  } else {
-    updateSubject(row).then((response) => {
-      if (response.code === 200) {
-        proxy.$modal.msgSuccess("保存成功");
-        queryParams.value.paymentTypeId = typeId.value;
-        getTypeSubList(queryParams.value);
-      }
-    });
+  /** 支出类目保存按钮 */
+  function typeleSave(row) {
+    if (row.name == "" || row.name == null) {
+      proxy.$modal.msgError("支出类目不能为空");
+      return;
+    }
+    if (row.isAdd) {
+      addType(row).then((response) => {
+        if (response.code === 200) {
+          proxy.$modal.msgSuccess("保存成功");
+          getList();
+        }
+      });
+    } else {
+      updateType(row).then((response) => {
+        if (response.code === 200) {
+          proxy.$modal.msgSuccess("保存成功");
+          getList();
+        }
+      });
+    }
   }
-}
 
-/** 支出类目保存按钮 */
-function typeleSave(row) {
-  if (row.name == "" || row.name == null) {
-    proxy.$modal.msgError("支出类目不能为空");
-    return;
-  }
-  if (row.isAdd) {
-    addType(row).then((response) => {
-      if (response.code === 200) {
-        proxy.$modal.msgSuccess("保存成功");
-        getList();
-      }
-    });
-  } else {
-    updateType(row).then((response) => {
-      if (response.code === 200) {
-        proxy.$modal.msgSuccess("保存成功");
-        getList();
-      }
-    });
+  /** 取消按钮 */
+  function handleCancel(row) {
+    console.log("取消", row.isAdd);
+    if (row.isAdd) {
+      typeList.value.length = typeList.value.length - 1;
+    } else {
+      row.isEdit = false;
+    }
   }
-}
 
-/** 取消按钮 */
-function handleCancel(row) {
-  console.log("取消", row.isAdd);
-  if (row.isAdd) {
-    typeList.value.length = typeList.value.length - 1;
-  } else {
-    row.isEdit = false;
+  /** 支出科目取消按钮 */
+  function subCancel(row) {
+    console.log("科目取消", row.isAdd);
+    if (row.isAdd) {
+      typeSubLis.value.length = typeSubLis.value.length - 1;
+    } else {
+      row.isEdit = false;
+    }
   }
-}
 
-/** 支出科目取消按钮 */
-function subCancel(row) {
-  console.log("科目取消", row.isAdd);
-  if (row.isAdd) {
-    typeSubLis.value.length = typeSubLis.value.length - 1;
-  } else {
-    row.isEdit = false;
+  /** 支出类目新增按钮 */
+  function newType() {
+    // 此处必须进行深拷贝,否则添加的明细,将都指向了一个对象
+    const _newSource = JSON.parse(JSON.stringify(query.value));
+    typeList.value.push(_newSource);
+    handleSourceCurrentChange(_newSource);
   }
-}
 
-/** 支出类目新增按钮 */
-function newType() {
-  // 此处必须进行深拷贝,否则添加的明细,将都指向了一个对象
-  const _newSource = JSON.parse(JSON.stringify(query.value));
-  typeList.value.push(_newSource);
-  handleSourceCurrentChange(_newSource);
-}
-
-/** 修改新增属性判断 */
-function handleSourceCurrentChange(row) {
-  row.isAdd = true;
-}
+  /** 修改新增属性判断 */
+  function handleSourceCurrentChange(row) {
+    row.isAdd = true;
+  }
 
-/** 输入框输出建议 */
-const querySearchAsync = (queryString, cb) => {
-  console.log(links);
-  const results = queryString
-    ? links.value.filter(createFilter(queryString))
-    : links.value;
-  cb(results);
-};
+  /** 输入框输出建议 */
+  const querySearchAsync = (queryString, cb) => {
+    console.log(links);
+    const results = queryString
+      ? links.value.filter(createFilter(queryString))
+      : links.value;
+    cb(results);
+  };
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
+  }
 
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm("queryRef");
-  handleQuery();
-}
+  /** 重置按钮操作 */
+  function resetQuery() {
+    proxy.resetForm("queryRef");
+    handleQuery();
+  }
 
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  single.value = selection.length != 1;
-  multiple.value = !selection.length;
-}
+  // 多选框选中数据
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    single.value = selection.length != 1;
+    multiple.value = !selection.length;
+  }
 
-/** 新增按钮操作 */
-function handleAdd() {
-  proxy.$refs.typeRef.open();
-}
+  /** 新增按钮操作 */
+  function handleAdd() {
+    proxy.$refs.typeRef.open();
+  }
 
-/** 修改按钮操作 */
-function handleUpdate(row) {
-  row.isEdit = true;
-}
+  /** 修改按钮操作 */
+  function handleUpdate(row) {
+    row.isEdit = true;
+  }
 
-/** 删除按钮操作 */
-function handleDelete(row) {
-  const _ids = row.id || ids.value;
-  queryParams.value.paymentTypeId = _ids;
-  console.log("ids", _ids);
-  listTypeSub(queryParams.value).then((response) => {
-    if (response.rows.length > 0) {
-      proxy.$modal.msgError("请先删除支出科目!");
-      return;
-    }
+  /** 删除按钮操作 */
+  function handleDelete(row) {
+    const _ids = row.id || ids.value;
+    queryParams.value.paymentTypeId = _ids;
+    console.log("ids", _ids);
+    listTypeSub(queryParams.value).then((response) => {
+      if (response.rows.length > 0) {
+        proxy.$modal.msgError("请先删除支出科目!");
+        return;
+      }
+      proxy.$modal
+        .confirm("是否确认删除选中的数据项?")
+        .then(function () {
+          return delType(_ids);
+        })
+        .then(() => {
+          getList();
+          proxy.$modal.msgSuccess("删除成功!");
+        })
+        .catch(() => { });
+    });
+  }
+  /** 科目删除按钮操作 */
+  function handleSubDelete(row) {
+    const _ids = row.id || ids.value;
     proxy.$modal
       .confirm("是否确认删除选中的数据项?")
       .then(function () {
-        return delType(_ids);
+        return delSubject(_ids);
       })
       .then(() => {
-        getList();
+        queryParams.value.paymentTypeId = typeId.value;
+        getTypeSubList(queryParams.value);
         proxy.$modal.msgSuccess("删除成功!");
       })
-      .catch(() => {});
-  });
-}
-/** 科目删除按钮操作 */
-function handleSubDelete(row) {
-  const _ids = row.id || ids.value;
-  proxy.$modal
-    .confirm("是否确认删除选中的数据项?")
-    .then(function () {
-      return delSubject(_ids);
-    })
-    .then(() => {
-      queryParams.value.paymentTypeId = typeId.value;
-      getTypeSubList(queryParams.value);
-      proxy.$modal.msgSuccess("删除成功!");
-    })
-    .catch(() => {});
-}
+      .catch(() => { });
+  }
 
-/** 导出按钮操作 */
-function handleExport() {
-  proxy.download(
-    "paymentEntry/type/export",
-    {
-      ...queryParams.value,
-    },
-    `type_${new Date().getTime()}.xlsx`
-  );
-}
+  /** 导出按钮操作 */
+  function handleExport() {
+    proxy.download(
+      "paymentEntry/type/export",
+      {
+        ...queryParams.value,
+      },
+      `type_${new Date().getTime()}.xlsx`
+    );
+  }
 
-getList();
-</script>
+  getList();
+</script>

+ 8 - 4
src/views/business/production/IndividualIncomeTaxIs/index.vue

@@ -84,8 +84,9 @@
           </div>
         </template>
       </el-table-column>
-      <el-table-column label="客户名称" align="center" prop="companyName" min-width="250" />
-      <el-table-column label="来源" align="center" prop="fromCompanyName" width="180" />
+      <el-table-column label="来源" align="center" prop="fromCompanyName" v-if="tenant.versionId === '4'" />
+      <el-table-column label="受委托方" align="center" prop="toTenantName" min-width="130"
+        v-if="tenant.versionId !== '4'" />
       <el-table-column label="纳税性质" align="center" width="100" prop="taxType" />
       <el-table-column label="人员信息" align="center">
         <template #default="scope">
@@ -227,7 +228,7 @@
   </div>
 </template>
 
-<script setup name="Detail">
+<script setup name="IndividualIncomeTaxIs">
   import {
     listDetail,
     delDetail,
@@ -284,7 +285,10 @@
     month: proxy.moment().subtract(1, "month").format("MM"),
     principal: tenant.versionId !== '4' && !flag.value ? useUserStore().user.userId : null,
   });
-
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
   /***********************  方法区  ****************************/
   function getOption() {
     listLableNoPage().then(res => {

+ 9 - 4
src/views/business/production/IndividualIncomeTaxIsZero/index.vue

@@ -56,7 +56,7 @@
       </el-form-item>
     </el-form>
     <div v-if="flag && flag2 && tenant.versionId !== '4'">
-      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" >
+      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
         <el-tab-pane label="全部" name="first"> </el-tab-pane>
         <el-tab-pane label="我的" name="second"> </el-tab-pane>
       </el-tabs>
@@ -83,7 +83,9 @@
           </div>
         </template>
       </el-table-column>
-      <el-table-column label="来源" align="center" prop="fromCompanyName" min-width="100" />
+      <el-table-column label="来源" align="center" prop="fromCompanyName" v-if="tenant.versionId === '4'" />
+      <el-table-column label="受委托方" align="center" prop="toTenantName" min-width="130"
+        v-if="tenant.versionId !== '4'" />
       <el-table-column label="纳税性质" align="center" width="100" prop="taxType" />
       <el-table-column label="人员信息" min-width="60" align="center">
         <template #default="scope">
@@ -226,7 +228,7 @@
   </div>
 </template>
 
-<script setup name="DetailZero">
+<script setup name="IndividualIncomeTaxIsZero">
   import {
     listDetail,
     delDetail,
@@ -295,7 +297,10 @@
     month: proxy.moment().subtract(1, "month").format("MM"),
     principal: tenant.versionId !== '4' && !flag.value ? useUserStore().user.userId : null,
   });
-
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
   /***********************  方法区  ****************************/
   function getOption() {
     listLableNoPage().then(res => {

+ 305 - 449
src/views/business/production/accountAdjustment/index.vue

@@ -2,46 +2,25 @@
   <div class="page-container list-container">
     <!-- 功能按钮区 -->
     <div class="list-btns-container">
-      <el-button
-        type="primary"
-        size="small"
-        icon="Plus"
-        @click="handleAdd"
-        v-hasPermi="['business:accountAdjustment:add']"
-        >新增</el-button
-      >
+      <el-button type="primary" size="small" icon="Plus" @click="handleAdd"
+        v-hasPermi="['business:accountAdjustment:add']">新增</el-button>
       <el-dropdown trigger="click">
         <el-button type="primary" size="small">
           其它<el-icon class="el-icon--right"><arrow-down /></el-icon>
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
-            <el-dropdown-item
-              icon="Download"
-              @click="handleExport"
-              v-hasPermi="['business:deposit:export']"
-            >
-              导出</el-dropdown-item
-            >
+            <el-dropdown-item icon="Download" @click="handleExport" v-hasPermi="['business:deposit:export']">
+              导出</el-dropdown-item>
             <!-- <el-dropdown-item type="warning" size="small" icon="Download" @click="handleArea"
               v-hasPermi="['business:deposit:export']"> area</el-dropdown-item> -->
-            <el-dropdown-item
-              icon="Delete"
-              :disabled="multiple"
-              @click="handleDelete"
-              v-hasPermi="['business:accountAdjustment:remove']"
-            >
-              删除</el-dropdown-item
-            >
+            <el-dropdown-item icon="Delete" :disabled="multiple" @click="handleDelete"
+              v-hasPermi="['business:accountAdjustment:remove']">
+              删除</el-dropdown-item>
           </el-dropdown-menu>
         </template>
       </el-dropdown>
-      <el-radio-group
-        v-model="queryRadio"
-        style="margin-left: 20px"
-        size="small"
-        @change="radioChangeHandler"
-      >
+      <el-radio-group v-model="queryRadio" style="margin-left: 20px" size="small" @change="radioChangeHandler">
         <el-radio-button label="全部" />
         <el-radio-button label="审核中" />
         <el-radio-button label="处理中" />
@@ -53,167 +32,76 @@
       <!--<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>-->
     </div>
     <!-- 搜索区 -->
-    <el-form
-      class="list-search-container"
-      size="small"
-      :model="queryParams"
-      ref="queryRef"
-      :inline="true"
-      label-width="68px"
-    >
+    <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
+      label-width="68px">
       <el-form-item label="客户名称:" prop="companyName">
-        <el-input
-          v-model="queryParams.companyName"
-          placeholder="请输入客户名称"
-          clearable
-          @keyup.enter="handleQuery"
-        />
+        <el-input v-model="queryParams.companyName" placeholder="请输入客户名称" clearable @keyup.enter="handleQuery" />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="Search" @click="handleQuery"
-          >搜索</el-button
-        >
+        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
         <el-button icon="Refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
 
     <!-- 列表区 -->
-    <el-table
-      v-loading="loading"
-      :data="list"
-      size="small"
-      border
-      height="100%"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="list" size="small" border height="100%"
+      @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column
-        align="center"
-        type="index"
-        label="序号"
-        width="50"
-      ></el-table-column>
-      <el-table-column
-        label="申请时间"
-        prop="createTime"
-        width="150"
-        align="center"
-      />
-      <el-table-column
-        label="申请人"
-        prop="applieName"
-        width="150"
-        align="center"
-      />
-      <el-table-column
-        label="客户名称"
-        prop="companyName"
-        width="150"
-        align="center"
-      />
+      <el-table-column align="center" type="index" label="序号" width="50"></el-table-column>
+      <el-table-column label="申请时间" prop="createTime" width="150" align="center" />
+      <el-table-column label="申请人" prop="applieName" width="150" align="center" />
+      <el-table-column label="客户名称" prop="companyName" width="150" align="center" />
       <el-table-column label="调账账期" width="150" align="center">
         <template #default="scope">
           <span>{{ scope.row.year + "-" + scope.row.month }}</span>
         </template>
       </el-table-column>
-      <el-table-column
-        label="调账原因"
-        prop="adjustmentResult"
-        width="100"
-        align="center"
-      />
+      <el-table-column label="调账原因" prop="adjustmentResult" width="100" align="center" />
       <!-- <el-table-column label="要求完成时间" prop="planFinishedDate" align="center" /> -->
-      <el-table-column
-        label="实际完成时间"
-        prop="actuallyFinishedDate"
-        width="126"
-        align="center"
-      />
-      <el-table-column
-        label="记账会计"
-        prop="accountantName"
-        width="100"
-        align="center"
-      />
+      <el-table-column label="实际完成时间" prop="actuallyFinishedDate" width="126" align="center" />
+      <el-table-column label="记账会计" prop="accountantName" width="100" align="center" />
       <el-table-column label="操作" width="60" align="center">
         <template #default="scope">
-          <el-button
-            v-if="scope.row.status == 0"
-            type="primary"
-            size="small"
-            icon="Edit"
-            circle
-            @click="edit(scope.row.id)"
-          />
+          <el-button v-if="scope.row.status == 0" type="primary" size="small" icon="Edit" circle
+            @click="edit(scope.row.id)" />
         </template>
       </el-table-column>
       <el-table-column label="状态" width="100" align="center">
         <template #default="scope">
           <span v-if="scope.row.status === 1">已审批&nbsp;&nbsp;</span>
           <span v-if="scope.row.status === 2">已完成</span>
-          <span v-if="scope.row.status === 3">审核失败</span></template
-        >
+          <span v-if="scope.row.status === 3">审核失败</span></template>
       </el-table-column>
       <el-table-column label="审批" width="220" align="center">
         <template #default="scope">
-          <el-button
-            v-if="scope.row.status === 0"
-            type="primary"
-            size="small"
-            @click="editStatus(scope.row, 1)"
-            >审批通过</el-button
-          >
-          <el-button
-            v-if="scope.row.status === 0"
-            type="primary"
-            size="small"
-            @click="editStatus(scope.row, 3)"
-            >审批不通过</el-button
-          >
-          <el-button
-            v-if="scope.row.status === 1"
-            type="primary"
-            size="small"
-            @click="editStatus(scope.row, 2)"
-            >完成</el-button
-          >
+          <el-button v-if="scope.row.status === 0" type="primary" size="small"
+            @click="editStatus(scope.row, 1)">审批通过</el-button>
+          <el-button v-if="scope.row.status === 0" type="primary" size="small"
+            @click="editStatus(scope.row, 3)">审批不通过</el-button>
+          <el-button v-if="scope.row.status === 1" type="primary" size="small"
+            @click="editStatus(scope.row, 2)">完成</el-button>
         </template>
       </el-table-column>
     </el-table>
-    <el-dialog
-      title="扣款信息"
-      v-model="formOpen"
-      width="500px"
-      append-to-body
-      draggable
-      @close="formCancel"
-      :close-on-click-modal = "false"
-    >
+    <el-dialog title="扣款信息" v-model="formOpen" width="500px" append-to-body draggable @close="formCancel"
+      :close-on-click-modal="false">
       <!-- 功能按钮 -->
       <div class="form-btns-container">
-        <el-button type="success" size="small" @click="handleSave"
-          ><i class="fa fa-floppy-o" aria-hidden="true" /> 保存</el-button
-        >
+        <el-button type="success" size="small" @click="handleSave"><i class="fa fa-floppy-o" aria-hidden="true" />
+          保存</el-button>
       </div>
       <div style="padding: 8px 24px 16px 24px">
         <el-form size="small" label-width="130px">
           <el-form-item label="客户名称:" required>
-            <el-autocomplete
-              :fetch-suggestions="querySearchCompanyAsync"
-              :trigger-on-focus="true"
-              v-model="form.companyName"
-              placeholder="请输入客户名称"
-              popper-class="my-autocomplete"
-              @select="handleSelectCompany"
-            >
+            <el-autocomplete :fetch-suggestions="querySearchCompanyAsync" :trigger-on-focus="true"
+              v-model="form.companyName" placeholder="请输入客户名称" popper-class="my-autocomplete"
+              @select="handleSelectCompany">
               <template #default="{ item }">
-                <div
-                  style="
+                <div style="
                     display: flex;
                     flex-direction: row;
                     justify-content: space-between;
-                  "
-                >
+                  ">
                   <div class="name" style="font-size: 12px">
                     {{ item.name }}
                   </div>
@@ -223,355 +111,323 @@
             </el-autocomplete>
           </el-form-item>
           <el-form-item label="账期:" required>
-            <el-select
-              v-model="form.creditTerm"
-              placeholder="选择月"
-              style="width: 80.8%"
-              @change="getCreditTerm"
-            >
-              <el-option
-                v-for="item in creditTermList"
-                :key="item.checkDate"
-                :label="item.checkDate"
-                :value="item.checkDate"
-                value-format="yyyy-MM-dd"
-              />
+            <el-select v-model="form.creditTerm" placeholder="选择月" style="width: 80.8%" @change="getCreditTerm">
+              <el-option v-for="item in creditTermList" :key="item.checkDate" :label="item.checkDate"
+                :value="item.checkDate" value-format="yyyy-MM-dd" />
             </el-select>
           </el-form-item>
           <el-form-item label="调账原因">
-            <el-input
-              v-model="form.adjustmentResult"
-              size="small"
-              type="text"
-              placeholder="请输入调账原因"
-              style="width: 80.8%"
-              :clearable="true"
-            />
+            <el-input v-model="form.adjustmentResult" size="small" type="text" placeholder="请输入调账原因"
+              style="width: 80.8%" :clearable="true" />
           </el-form-item>
           <el-form-item label="备注">
-            <el-input
-              v-model="form.remark"
-              size="small"
-              type="text"
-              placeholder="备注"
-              style="width: 80.8%"
-              :clearable="true"
-            />
+            <el-input v-model="form.remark" size="small" type="text" placeholder="备注" style="width: 80.8%"
+              :clearable="true" />
           </el-form-item>
         </el-form>
       </div>
     </el-dialog>
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
-    <el-image-viewer
-      v-if="showViewer"
-      :url-list="currentFileList"
-      @close="closeImages"
-      :initial-index="showIndex"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
+    <el-image-viewer v-if="showViewer" :url-list="currentFileList" @close="closeImages" :initial-index="showIndex" />
   </div>
 </template>
 
 <script setup>
-import {
-  listAccountAdjustment,
-  listCompany,
-  getCreditTermByCompId,
-  addAccountAdjustment,
-  updateAccountAdjustment,
-  delAccountAdjustment,
-  getAccountAdjustment,
-} from "@/api/business/production/accountAdjustment";
-import useUserStore from "@/store/modules/user";
-import { reactive, toRefs } from "vue";
-const { proxy } = getCurrentInstance();
+  import {
+    listAccountAdjustment,
+    listCompany,
+    getCreditTermByCompId,
+    addAccountAdjustment,
+    updateAccountAdjustment,
+    delAccountAdjustment,
+    getAccountAdjustment,
+  } from "@/api/business/production/accountAdjustment";
+  import useUserStore from "@/store/modules/user";
+  import { reactive, toRefs } from "vue";
+  const { proxy } = getCurrentInstance();
 
-const formOpen = ref(false);
+  const formOpen = ref(false);
 
-const data = reactive({
-  // 列表数据源
-  list: [],
-  comList: [],
-  // 查询请求携带的参数
-  queryParams: {
+  const data = reactive({
+    // 列表数据源
+    list: [],
+    comList: [],
+    // 查询请求携带的参数
+    queryParams: {
+      pageNum: 1,
+      pageSize: 20,
+    },
+    visible: false,
+    custom: {},
+    creditTerm: null,
+    stages: [],
+    queryRadio: "全部",
+    selections: [],
+    creditTermList: [],
+    form: {},
+    userId: null,
+    employeeId: null,
+    formEmptyData: {
+      id: null,
+      companyId: "",
+      planFinishedDate: "",
+      actuallyFinishedDate: "",
+      remark: "",
+      year: "",
+      month: "",
+      adjustmentResult: "",
+    },
+  });
+  const loading = ref(true);
+  const ids = ref([]);
+  const single = ref(true);
+  const multiple = ref(true);
+  const total = ref(0);
+  const prev = ref([]);
+  const baseUrl = ref(import.meta.env.VITE_APP_BASE_API);
+  const showViewer = ref(false);
+  const currentFileList = ref([]);
+  const showIndex = ref(0);
+  const companyQuery = ref({
     pageNum: 1,
-    pageSize: 20,
-  },
-  visible: false,
-  custom: {},
-  creditTerm: null,
-  stages: [],
-  queryRadio: "全部",
-  selections: [],
-  creditTermList: [],
-  form: {},
-  userId: null,
-  employeeId: null,
-  formEmptyData: {
-    id: null,
-    companyId: "",
-    planFinishedDate: "",
-    actuallyFinishedDate: "",
-    remark: "",
-    year: "",
-    month: "",
-    adjustmentResult: "",
-  },
-});
-const loading = ref(true);
-const ids = ref([]);
-const single = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-const prev = ref([]);
-const baseUrl = ref(import.meta.env.VITE_APP_BASE_API);
-const showViewer = ref(false);
-const currentFileList = ref([]);
-const showIndex = ref(0);
-const companyQuery = ref({
-  pageNum: 1,
-  pageSize: 50,
-  keyword: "",
-});
-
-const {
-  queryParams,
-  form,
-  list,
-  queryRadio,
-  selections,
-  creditTerm,
-  creditTermList,
-} = toRefs(data);
+    pageSize: 50,
+    keyword: "",
+  });
 
-function getList() {
-  listAccountAdjustment(queryParams.value).then((res) => {
-    list.value = res.rows.map((l) => ({ ...l }));
-    total.value = res.total;
-    loading.value = false;
+  const {
+    queryParams,
+    form,
+    list,
+    queryRadio,
+    selections,
+    creditTerm,
+    creditTermList,
+  } = toRefs(data);
+  onActivated(() => {
+    // 你的逻辑
+    getList();
   });
-}
+  function getList() {
+    listAccountAdjustment(queryParams.value).then((res) => {
+      list.value = res.rows.map((l) => ({ ...l }));
+      total.value = res.total;
+      loading.value = false;
+    });
+  }
 
-function getCompanies() {
-  listCompany();
-}
+  function getCompanies() {
+    listCompany();
+  }
 
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  single.value = selection.length != 1;
-  multiple.value = !selection.length;
-}
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    single.value = selection.length != 1;
+    multiple.value = !selection.length;
+  }
 
-function formCancel() {
-  formOpen.value = false;
-  reset();
-}
+  function formCancel() {
+    formOpen.value = false;
+    reset();
+  }
 
-function radioChangeHandler(arg) {
-  const query = {
-    pageNum: 1,
-    pageSize: 20,
-    companyName: "",
-  };
-  switch (arg) {
-    case "全部":
-      query.status = null;
-      break;
-    case "审核中":
-      query.status = 0;
-      break;
-    case "处理中":
-      query.status = 1;
-      break;
-    case "已处理":
-      query.status = 2;
-      break;
-    case "未通过":
-      query.status = 3;
-      break;
-    default:
-      break;
+  function radioChangeHandler(arg) {
+    const query = {
+      pageNum: 1,
+      pageSize: 20,
+      companyName: "",
+    };
+    switch (arg) {
+      case "全部":
+        query.status = null;
+        break;
+      case "审核中":
+        query.status = 0;
+        break;
+      case "处理中":
+        query.status = 1;
+        break;
+      case "已处理":
+        query.status = 2;
+        break;
+      case "未通过":
+        query.status = 3;
+        break;
+      default:
+        break;
+    }
+    queryParams.value = query;
+    handleQuery();
   }
-  queryParams.value = query;
-  handleQuery();
-}
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
+  }
 
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm("queryRef");
-  handleQuery();
-}
+  /** 重置按钮操作 */
+  function resetQuery() {
+    proxy.resetForm("queryRef");
+    handleQuery();
+  }
 
-function handleAdd() {
-  formOpen.value = true;
-}
+  function handleAdd() {
+    formOpen.value = true;
+  }
 
-function getCreditTermList() {
-  getCreditTermByCompId({ id: form.value.companyId }).then((res) => {
-    creditTermList.value = res.rows;
-  });
-}
+  function getCreditTermList() {
+    getCreditTermByCompId({ id: form.value.companyId }).then((res) => {
+      creditTermList.value = res.rows;
+    });
+  }
 
-function handleSave() {
-  form.value.applierId = useUserStore().user.userId;
-  if (form.value.companyId == null || form.value.companyId === "") {
-    proxy.$modal.msgError("客户名称不能为空");
-    return;
+  function handleSave() {
+    form.value.applierId = useUserStore().user.userId;
+    if (form.value.companyId == null || form.value.companyId === "") {
+      proxy.$modal.msgError("客户名称不能为空");
+      return;
+    }
+    if (
+      form.value.year == null ||
+      form.value.month == null ||
+      form.value.year === "" ||
+      form.value.month === ""
+    ) {
+      proxy.$modal.msgError("账期不能为空");
+      return;
+    }
+    if (form.value.id == null) {
+      addAccountAdjustment(form.value).then((res) => {
+        getList();
+        formCancel();
+      });
+    } else {
+      updateAccountAdjustment(form.value).then((res) => {
+        getList();
+        formCancel();
+      });
+    }
   }
-  if (
-    form.value.year == null ||
-    form.value.month == null ||
-    form.value.year === "" ||
-    form.value.month === ""
-  ) {
-    proxy.$modal.msgError("账期不能为空");
-    return;
+
+  function edit(id) {
+    formOpen.value = true;
+    form.value.id = id;
+    getFormValue();
   }
-  if (form.value.id == null) {
-    addAccountAdjustment(form.value).then((res) => {
-      getList();
-      formCancel();
-    });
-  } else {
-    updateAccountAdjustment(form.value).then((res) => {
-      getList();
-      formCancel();
+
+  function getFormValue() {
+    getAccountAdjustment(form.value.id).then((res) => {
+      form.value = res.data;
+      form.value.creditTerm = form.value.year + "-" + form.value.month + "-01";
+      getCreditTermList();
     });
   }
-}
-
-function edit(id) {
-  formOpen.value = true;
-  form.value.id = id;
-  getFormValue();
-}
 
-function getFormValue() {
-  getAccountAdjustment(form.value.id).then((res) => {
-    form.value = res.data;
-    form.value.creditTerm = form.value.year + "-" + form.value.month + "-01";
-    getCreditTermList();
-  });
-}
-
-function querySearchCompanyAsync(queryString, cb) {
-  const query =
-    queryString.length > 0
-      ? {
+  function querySearchCompanyAsync(queryString, cb) {
+    const query =
+      queryString.length > 0
+        ? {
           keyword: queryString,
           pageSize: 50,
           pageNum: 1,
           orderByColumn: "create_time",
         }
-      : { pageSize: 50, pageNum: 1, orderByColumn: "create_time" };
-  listCompany(query).then((res) => {
-    cb(res.rows);
-  });
-}
+        : { pageSize: 50, pageNum: 1, orderByColumn: "create_time" };
+    listCompany(query).then((res) => {
+      cb(res.rows);
+    });
+  }
 
-function handleSelectCompany(item) {
-  form.value.companyName = item.name;
-  form.value.companyId = item.id;
-  getCreditTermList();
-}
+  function handleSelectCompany(item) {
+    form.value.companyName = item.name;
+    form.value.companyId = item.id;
+    getCreditTermList();
+  }
 
-function getCreditTerm(arg) {
-  console.log(arg);
-  form.value.year = proxy.moment(arg).format("YYYY");
-  form.value.month = proxy.moment(arg).format("MM");
-}
+  function getCreditTerm(arg) {
+    console.log(arg);
+    form.value.year = proxy.moment(arg).format("YYYY");
+    form.value.month = proxy.moment(arg).format("MM");
+  }
 
-function reset() {
-  form.value = {};
-}
+  function reset() {
+    form.value = {};
+  }
 
-/** 删除按钮操作 */
-function handleDelete(row) {
-  const _ids = row.id || ids.value;
-  proxy.$modal
-    .confirm("是否确认删除选中的数据项?")
-    .then(function () {
-      return delAccountAdjustment(_ids);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("删除成功!");
-    });
-}
+  /** 删除按钮操作 */
+  function handleDelete(row) {
+    const _ids = row.id || ids.value;
+    proxy.$modal
+      .confirm("是否确认删除选中的数据项?")
+      .then(function () {
+        return delAccountAdjustment(_ids);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功!");
+      });
+  }
 
-function handleExport() {}
+  function handleExport() { }
 
-function editStatus(row, status) {
-  if (status === 2) {
-    row.accountantId = useUserStore().user.userId;
-    row.actuallyFinishedDate = proxy.moment().format("YYYY-MM-DD HH:mm:ss");
-  }
-  proxy.$modal
-    .confirm(`确认${status !== 2 ? "审批" : "完成"}么`)
-    .then((_) => {
-      row.status = status;
-      updateAccountAdjustment(row).then((res) => {
-        getList();
-        formCancel();
+  function editStatus(row, status) {
+    if (status === 2) {
+      row.accountantId = useUserStore().user.userId;
+      row.actuallyFinishedDate = proxy.moment().format("YYYY-MM-DD HH:mm:ss");
+    }
+    proxy.$modal
+      .confirm(`确认${status !== 2 ? "审批" : "完成"}么`)
+      .then((_) => {
+        row.status = status;
+        updateAccountAdjustment(row).then((res) => {
+          getList();
+          formCancel();
+        });
+      })
+      .catch((_) => {
+        proxy.$modal.msg("取消审批");
       });
-    })
-    .catch((_) => {
-      proxy.$modal.msg("取消审批");
-    });
-}
+  }
 
-getList();
+  getList();
 </script>
 <style>
-.companylist .el-badge__content.el-badge__content--undefined.is-fixed {
-  top: 0px;
-  right: -5px;
-}
+  .companylist .el-badge__content.el-badge__content--undefined.is-fixed {
+    top: 0px;
+    right: -5px;
+  }
 
-.companylist .el-radio-button__orig-radio:checked + .el-radio-button__inner {
-  color: rgb(64, 158, 255);
-  background-color: rgba(0, 0, 0, 0);
-  border-color: rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) rgb(64, 158, 255)
-    rgba(0, 0, 0, 0);
-  border-style: none none solid none;
-  border-width: 0 0 3px 0;
-  box-shadow: none;
-}
+  .companylist .el-radio-button__orig-radio:checked+.el-radio-button__inner {
+    color: rgb(64, 158, 255);
+    background-color: rgba(0, 0, 0, 0);
+    border-color: rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) rgb(64, 158, 255) rgba(0, 0, 0, 0);
+    border-style: none none solid none;
+    border-width: 0 0 3px 0;
+    box-shadow: none;
+  }
 
-.companylist .el-radio-button__inner {
-  border: none;
-  background-color: rgba(0, 0, 0, 0);
-  border-color: rgba(0, 0, 0, 0);
-  border-style: none none solid none;
-  border-width: 0 0 3px 0;
-  box-shadow: none;
-}
+  .companylist .el-radio-button__inner {
+    border: none;
+    background-color: rgba(0, 0, 0, 0);
+    border-color: rgba(0, 0, 0, 0);
+    border-style: none none solid none;
+    border-width: 0 0 3px 0;
+    box-shadow: none;
+  }
 
-.companylist .el-radio-button:first-child .el-radio-button__inner {
-  border-left: none;
-  border-radius: 0 0 0 0;
-}
+  .companylist .el-radio-button:first-child .el-radio-button__inner {
+    border-left: none;
+    border-radius: 0 0 0 0;
+  }
 
-.companylist .el-radio-button:last-child .el-radio-button__inner {
-  border-radius: 0 0 0 0;
-}
+  .companylist .el-radio-button:last-child .el-radio-button__inner {
+    border-radius: 0 0 0 0;
+  }
 
-.companylist
-  .badge-radio
-  .el-badge__content.el-badge__content--undefined.is-fixed {
-  top: -8px;
-  right: 10px;
-}
-</style>
+  .companylist .badge-radio .el-badge__content.el-badge__content--undefined.is-fixed {
+    top: -8px;
+    right: 10px;
+  }
+</style>

+ 9 - 4
src/views/business/production/archiveTicket/index.vue

@@ -62,7 +62,7 @@
     <!-- 列表区 -->
     <el-table v-loading="loading" :data="list" size="small" border height="100%"
       @selection-change="handleSelectionChange">
-      <el-table-column label="客户名称" align="center" prop="companyName" min-width="250">
+      <el-table-column label="客户名称" align="center" prop="companyName">
         <template #default="scope">
           <div style="display: flex; align-items: center; ">
             <template v-if="scope.row.customerLabelName ">
@@ -80,7 +80,9 @@
           </div>
         </template>
       </el-table-column>
-      <el-table-column label="来源" align="center" min-width="80" prop="fromCompanyName" />
+      <el-table-column label="来源" align="center" prop="fromCompanyName" min-width="100"
+        v-if="tenant.versionId === '4'" />
+      <el-table-column label="受委托方" align="center" prop="toTenantName" v-if="tenant.versionId !== '4'" />
       <el-table-column label="纳税性质" prop="taxType" min-width="110" align="center" />
       <el-table-column label="上传人" align="center" prop="finishUserName" min-width="100" />
       <el-table-column label="上传时间" align="center" prop="finishTime" min-width="100" />
@@ -146,7 +148,7 @@
   </div>
 </template>
 
-<script setup name="Company">
+<script setup name="ArchiveReceiveTicket">
   import { listLableNoPage } from "@/api/business/lable"
   import { listArchiveTicket } from "@/api/business/production/archiveTicket";
   import { uploadFile } from "@/api/tool/file";
@@ -216,7 +218,10 @@
   });
 
   /***********************  方法区  ****************************/
-
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
   /** 查询company列表 */
   function getList() {
     loading.value = true;

+ 232 - 357
src/views/business/production/deduction/index.vue

@@ -8,74 +8,34 @@
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
-            <el-dropdown-item
-              icon="Download"
-              @click="handleExport"
-              v-hasPermi="['business:deposit:export']"
-            >
-              导出</el-dropdown-item
-            >
+            <el-dropdown-item icon="Download" @click="handleExport" v-hasPermi="['business:deposit:export']">
+              导出</el-dropdown-item>
           </el-dropdown-menu>
         </template>
       </el-dropdown>
     </div>
     <!-- 搜索区 -->
-    <el-form
-      class="list-search-container"
-      size="small"
-      :model="queryParams"
-      ref="queryRef"
-      :inline="true"
-      label-width="68px"
-    >
+    <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
+      label-width="68px">
       <el-form-item label="客户名称:" prop="companyName">
-        <el-input
-          v-model="queryParams.companyName"
-          placeholder="请输入客户名称"
-          clearable
-          @keyup.enter="handleQuery"
-        />
+        <el-input v-model="queryParams.companyName" placeholder="请输入客户名称" clearable @keyup.enter="handleQuery" />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="Search" @click="handleQuery"
-          >搜索</el-button
-        >
+        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
         <el-button icon="Refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
 
     <!-- 列表区 -->
-    <el-table
-      v-loading="loading"
-      :data="orderList"
-      size="small"
-      border
-      height="100%"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="orderList" size="small" border height="100%"
+      @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column
-        align="center"
-        type="index"
-        label="序号"
-        width="50"
-      ></el-table-column>
-      <el-table-column
-        label="日期"
-        align="center"
-        prop="depositDate"
-        width="200"
-      />
+      <el-table-column align="center" type="index" label="序号" width="50"></el-table-column>
+      <el-table-column label="日期" align="center" prop="depositDate" width="200" />
       <el-table-column label="金额" align="center" prop="amount" width="120" />
       <el-table-column label="附件" align="center" prop="files">
         <template #default="scope">
-          <el-button
-            link
-            type="primary"
-            size="small"
-            @click="showFileList(scope.row)"
-            >查看</el-button
-          >
+          <el-button link type="primary" size="small" @click="showFileList(scope.row)">查看</el-button>
         </template>
       </el-table-column>
       <el-table-column label="审核状态" align="center" width="80" prop="remark">
@@ -83,126 +43,48 @@
           <dict-tag :options="verify_status" :value="scope.row.status" />
         </template>
       </el-table-column>
-      <el-table-column
-        label="操作"
-        align="center"
-        prop="verifyStatus"
-        width="200"
-      >
+      <el-table-column label="操作" align="center" prop="verifyStatus" width="200">
         <template #default="scope">
-          <el-button
-            v-show="scope.row.status === 0"
-            link
-            type="primary"
-            size="small"
-            @click="handleInfo(scope.row)"
-            v-hasPermi="['business:deposit:info']"
-            >修改</el-button
-          >
-          <el-button
-            v-show="scope.row.status === 0"
-            link
-            type="primary"
-            size="small"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['business:deposit:remove']"
-            >删除</el-button
-          >
-          <el-button
-            v-show="scope.row.status !== 0"
-            link
-            type="primary"
-            size="small"
-            @click="handleInfo(scope.row)"
-            v-hasPermi="['business:deposit:info']"
-            >查看</el-button
-          >
+          <el-button v-show="scope.row.status === 0" link type="primary" size="small" @click="handleInfo(scope.row)"
+            v-hasPermi="['business:deposit:info']">修改</el-button>
+          <el-button v-show="scope.row.status === 0" link type="primary" size="small" @click="handleDelete(scope.row)"
+            v-hasPermi="['business:deposit:remove']">删除</el-button>
+          <el-button v-show="scope.row.status !== 0" link type="primary" size="small" @click="handleInfo(scope.row)"
+            v-hasPermi="['business:deposit:info']">查看</el-button>
         </template>
       </el-table-column>
     </el-table>
     <!-- <Deposit-form ref="DepositRef" :get-list="getList" /> -->
-    <el-dialog
-      title="新增存款"
-      v-model="formOpen"
-      width="500px"
-      append-to-body
-      draggable
-      @close="formCancel"
-      :close-on-click-modal = "false"
-    >
+    <el-dialog title="新增存款" v-model="formOpen" width="500px" append-to-body draggable @close="formCancel"
+      :close-on-click-modal="false">
       <el-form ref="dictRef" :model="form" label-width="100" size="small">
         <el-row :gutter="30">
           <el-col :span="24">
             <el-form-item label="存款金额:">
-              <el-input-number
-                v-if="form.status !== 1"
-                v-model="form.amount"
-                :precision="2"
-                :step="0.1"
-                :min="0"
-                :controls="false"
-              />
+              <el-input-number v-if="form.status !== 1" v-model="form.amount" :precision="2" :step="0.1" :min="0"
+                :controls="false" />
               <div v-else>{{ form.amount }}</div>
             </el-form-item>
           </el-col>
           <el-col :span="24">
             <el-form-item label="凭证附件:">
               <div class="details-btns-container" style="display: flex">
-                <el-upload
-                  v-if="form.status !== 1"
-                  action="#"
-                  :http-request="upload"
-                  :with-credentials="true"
-                  :show-file-list="false"
-                  multiple
-                >
-                  <el-button size="small" type="primary" icon="Upload"
-                    >点击上传</el-button
-                  >
+                <el-upload v-if="form.status !== 1" action="#" :http-request="upload" :with-credentials="true"
+                  :show-file-list="false" multiple>
+                  <el-button size="small" type="primary" icon="Upload">点击上传</el-button>
                 </el-upload>
               </div>
-              <el-table
-                ref="filesTable"
-                :data="form.files"
-                size="small"
-                height="200px"
-                border
-                header-row-class-name="list-header-row"
-              >
-                <el-table-column
-                  v-if="form.status !== 1"
-                  label="操作"
-                  width="47"
-                  align="center"
-                >
+              <el-table ref="filesTable" :data="form.files" size="small" height="200px" border
+                header-row-class-name="list-header-row">
+                <el-table-column v-if="form.status !== 1" label="操作" width="47" align="center">
                   <template #default="scope">
-                    <el-button
-                      icon="Minus"
-                      size="small"
-                      circle
-                      type="danger"
-                      @click="handleDelFile(scope.$index)"
-                    />
+                    <el-button icon="Minus" size="small" circle type="danger" @click="handleDelFile(scope.$index)" />
                   </template>
                 </el-table-column>
-                <el-table-column
-                  type="index"
-                  label="序号"
-                  width="47"
-                  align="center"
-                />
-                <el-table-column
-                  label="文件名"
-                  prop="originalFileName"
-                  align="center"
-                >
+                <el-table-column type="index" label="序号" width="47" align="center" />
+                <el-table-column label="文件名" prop="originalFileName" align="center">
                   <template #default="scope">
-                    <el-link
-                      :href="`${baseUrl}${scope.row.fileUrl}`"
-                      :underline="false"
-                      target="_blank"
-                      type="primary"
-                    >
+                    <el-link :href="`${baseUrl}${scope.row.fileUrl}`" :underline="false" target="_blank" type="primary">
                       {{ scope.row.originalFileName }}
                     </el-link>
                   </template>
@@ -220,242 +102,235 @@
       </template>
     </el-dialog>
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
-    <el-image-viewer
-      v-if="showViewer"
-      :url-list="currentFileList"
-      @close="closeImages"
-      :initial-index="showIndex"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
+    <el-image-viewer v-if="showViewer" :url-list="currentFileList" @close="closeImages" :initial-index="showIndex" />
   </div>
 </template>
 
 <script setup name="Company">
-// import contractForm from "./form";
-import {
-  listDeposit,
-  delDeposit,
-  exportDeposit,
-  addDeposit,
-  getDeposit,
-  updateDeposit,
-} from "@/api/business/entrust/deposit";
-// import ElImageViewer from 'element-plus/lib/components/image-viewer';
-import { uploadFile } from "@/api/tool/file";
-import { listCompany } from "@/api/business/crm/company";
-import { ref } from "vue";
-// import DepositForm from "./form"
-const { proxy } = getCurrentInstance();
-/** 字典数组区 */
-/** 查询 对象 */
+  // import contractForm from "./form";
+  import {
+    listDeposit,
+    delDeposit,
+    exportDeposit,
+    addDeposit,
+    getDeposit,
+    updateDeposit,
+  } from "@/api/business/entrust/deposit";
+  // import ElImageViewer from 'element-plus/lib/components/image-viewer';
+  import { uploadFile } from "@/api/tool/file";
+  import { listCompany } from "@/api/business/crm/company";
+  import { ref } from "vue";
+  // import DepositForm from "./form"
+  const { proxy } = getCurrentInstance();
+  /** 字典数组区 */
+  /** 查询 对象 */
 
-const orderList = ref([]);
-const loading = ref(true);
-const ids = ref([]);
-const single = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-const prev = ref([]);
-const baseUrl = ref(import.meta.env.VITE_APP_BASE_API);
-const showViewer = ref(false);
-const currentFileList = ref([]);
-const showIndex = ref(0);
+  const orderList = ref([]);
+  const loading = ref(true);
+  const ids = ref([]);
+  const single = ref(true);
+  const multiple = ref(true);
+  const total = ref(0);
+  const prev = ref([]);
+  const baseUrl = ref(import.meta.env.VITE_APP_BASE_API);
+  const showViewer = ref(false);
+  const currentFileList = ref([]);
+  const showIndex = ref(0);
 
-const formOpen = ref(false);
+  const formOpen = ref(false);
 
-const form = ref({
-  id: null,
-  companyName: "",
-  companyId: null,
-  remark: "",
-  type: 1,
-  files: [],
-});
-
-const emptyForm = {
-  id: null,
-  companyName: "",
-  companyId: null,
-  type: 1,
-  remark: "",
-  files: [],
-};
-
-const { verify_status } = proxy.useDict("verify_status");
-/** 查询对象 */
-const queryParams = ref({
-  pageNum: 1,
-  pageSize: 20,
-  companyName: "",
-  noContract: 1,
-});
+  const form = ref({
+    id: null,
+    companyName: "",
+    companyId: null,
+    remark: "",
+    type: 1,
+    files: [],
+  });
 
-/***********************  方法区  ****************************/
+  const emptyForm = {
+    id: null,
+    companyName: "",
+    companyId: null,
+    type: 1,
+    remark: "",
+    files: [],
+  };
 
-/** 查询company列表 */
-function getList() {
-  loading.value = true;
-  listDeposit(queryParams.value).then((response) => {
-    orderList.value = response.rows.map((l) => ({ ...l }));
-    prev.value = proxy.deepClone(response.rows);
-    total.value = response.total;
-    loading.value = false;
+  const { verify_status } = proxy.useDict("verify_status");
+  /** 查询对象 */
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    companyName: "",
+    noContract: 1,
   });
-}
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
+  /***********************  方法区  ****************************/
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
+  /** 查询company列表 */
+  function getList() {
+    loading.value = true;
+    listDeposit(queryParams.value).then((response) => {
+      orderList.value = response.rows.map((l) => ({ ...l }));
+      prev.value = proxy.deepClone(response.rows);
+      total.value = response.total;
+      loading.value = false;
+    });
+  }
 
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm("queryRef");
-  handleQuery();
-}
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
+  }
 
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  single.value = selection.length != 1;
-  multiple.value = !selection.length;
-}
+  /** 重置按钮操作 */
+  function resetQuery() {
+    proxy.resetForm("queryRef");
+    handleQuery();
+  }
 
-/** 新增按钮操作 */
-function handleAdd() {
-  // proxy.$refs.DepositRef.open();
-  formOpen.value = true;
-}
+  // 多选框选中数据
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    single.value = selection.length != 1;
+    multiple.value = !selection.length;
+  }
 
-function formCancel() {
-  formOpen.value = false;
-  reset();
-}
+  /** 新增按钮操作 */
+  function handleAdd() {
+    // proxy.$refs.DepositRef.open();
+    formOpen.value = true;
+  }
 
-function reset() {
-  form.value = proxy.deepClone(emptyForm);
-}
+  function formCancel() {
+    formOpen.value = false;
+    reset();
+  }
 
-/** 修改按钮操作 */
-function handleUpdate(row) {
-  // const id = row.id || ids.value;
-  // proxy.$refs.DepositRef.open(id);
-}
+  function reset() {
+    form.value = proxy.deepClone(emptyForm);
+  }
 
-/** 删除按钮操作 */
-function handleDelete(row) {
-  const _ids = row.id || ids.value;
-  proxy.$modal
-    .confirm("是否确认删除选中的数据项?")
-    .then(function () {
-      return delDeposit(_ids);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("删除成功!");
-    })
-    .catch(() => {});
-}
+  /** 修改按钮操作 */
+  function handleUpdate(row) {
+    // const id = row.id || ids.value;
+    // proxy.$refs.DepositRef.open(id);
+  }
 
-/** 导出按钮操作 */
-function handleExport() {
-  // proxy.download(
-  //   "business/archive/order/export",
-  //   {
-  //     ...queryParams.value,
-  //   },
-  //   `合同导出_${new Date().getTime()}.xlsx`
-  // );
-  exportDeposit(queryParams.value);
-}
+  /** 删除按钮操作 */
+  function handleDelete(row) {
+    const _ids = row.id || ids.value;
+    proxy.$modal
+      .confirm("是否确认删除选中的数据项?")
+      .then(function () {
+        return delDeposit(_ids);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功!");
+      })
+      .catch(() => { });
+  }
 
-function startDateChangeHandler(row, startDate) {
-  if (startDate) {
-    // console.log(startDate)
-    row.endMonth = proxy
-      .moment(startDate)
-      .add(row.monthNum - 1, "M")
-      .format("YYYY-MM-DD");
-  } else row.endMonth = null;
-  console.log(row);
-}
+  /** 导出按钮操作 */
+  function handleExport() {
+    // proxy.download(
+    //   "business/archive/order/export",
+    //   {
+    //     ...queryParams.value,
+    //   },
+    //   `合同导出_${new Date().getTime()}.xlsx`
+    // );
+    exportDeposit(queryParams.value);
+  }
 
-function saveHandler() {
-  if (form.value.amount == null || form.value.amount === 0) {
-    proxy.$modal.msgError("请输入存款金额");
-    return;
+  function startDateChangeHandler(row, startDate) {
+    if (startDate) {
+      // console.log(startDate)
+      row.endMonth = proxy
+        .moment(startDate)
+        .add(row.monthNum - 1, "M")
+        .format("YYYY-MM-DD");
+    } else row.endMonth = null;
+    console.log(row);
   }
-  if (form.value.files.length === 0) {
-    proxy.$modal.msgError("请上传凭证附件");
-    return;
+
+  function saveHandler() {
+    if (form.value.amount == null || form.value.amount === 0) {
+      proxy.$modal.msgError("请输入存款金额");
+      return;
+    }
+    if (form.value.files.length === 0) {
+      proxy.$modal.msgError("请上传凭证附件");
+      return;
+    }
+    if (form.value.id == null) {
+      addDeposit(form.value).then((res) => {
+        formCancel();
+        getList();
+      });
+    } else {
+      updateDeposit(form.value).then((res) => {
+        formCancel();
+        getList();
+      });
+    }
   }
-  if (form.value.id == null) {
-    addDeposit(form.value).then((res) => {
-      formCancel();
-      getList();
-    });
-  } else {
-    updateDeposit(form.value).then((res) => {
-      formCancel();
-      getList();
+
+  function upload(param) {
+    const formData = new FormData();
+    formData.append("file", param.file);
+    uploadFile(formData).then((res) => {
+      if (res.code === 200) {
+        const file = {};
+        file.fileName = res.newFileName;
+        file.url = res.url;
+        file.originalFileName = res.originalFilename;
+        file.fileUrl = res.fileName;
+        form.value.files.push(file);
+      }
     });
   }
-}
 
-function upload(param) {
-  const formData = new FormData();
-  formData.append("file", param.file);
-  uploadFile(formData).then((res) => {
-    if (res.code === 200) {
-      const file = {};
-      file.fileName = res.newFileName;
-      file.url = res.url;
-      file.originalFileName = res.originalFilename;
-      file.fileUrl = res.fileName;
-      form.value.files.push(file);
-    }
-  });
-}
-
-function openFollowFile(arg) {
-  // console.log(arg)
-  const attach = arg;
-  window.open(`${arg.url}`, arg.fileName);
-}
+  function openFollowFile(arg) {
+    // console.log(arg)
+    const attach = arg;
+    window.open(`${arg.url}`, arg.fileName);
+  }
 
-function showFileList(row) {
-  currentFileList.value = row.files.map((l) => `${baseUrl.value}${l.fileUrl}`);
-  showViewer.value = true;
-}
+  function showFileList(row) {
+    currentFileList.value = row.files.map((l) => `${baseUrl.value}${l.fileUrl}`);
+    showViewer.value = true;
+  }
 
-function closeImages() {
-  showViewer.value = false;
-}
+  function closeImages() {
+    showViewer.value = false;
+  }
 
-function handleInfo(row) {
-  formOpen.value = true;
-  getForm(row.id);
-}
+  function handleInfo(row) {
+    formOpen.value = true;
+    getForm(row.id);
+  }
 
-function getForm(id) {
-  getDeposit(id).then((res) => {
-    form.value = res.data;
-    if (form.value == null) {
-      reset();
-    }
-  });
-}
+  function getForm(id) {
+    getDeposit(id).then((res) => {
+      form.value = res.data;
+      if (form.value == null) {
+        reset();
+      }
+    });
+  }
 
-function handleDelFile(index) {
-  form.value.files.splice(index, 1);
-}
+  function handleDelFile(index) {
+    form.value.files.splice(index, 1);
+  }
 
-getList();
-</script>
+  getList();
+</script>

+ 0 - 1
src/views/business/production/financialReportTax/FormDialog.vue

@@ -247,7 +247,6 @@
           </el-form>
         </div>
       </div>
-      <p>stp:{{stopUseBack}}</p>
       <div class="form-btns-container" style="height: 40px" v-if="!stopUseBack" >
         <el-button size="small" icon="close" v-if="!isView || emptyForm.status !== 3"
           style="float: right; margin-left: 12px; margin-right: 12px" @click="close">取消

+ 137 - 130
src/views/business/production/financialReportTax/index.vue

@@ -57,71 +57,73 @@
       </el-form-item>
     </el-form>
     <div v-if="flag && flag2 && tenant.versionId !== '4'">
-    <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
-      <el-tab-pane label="全部" name="first"></el-tab-pane>
-      <el-tab-pane label="我的" name="second"></el-tab-pane>
-    </el-tabs>
-  </div>
-  <!-- 列表区 -->
-  <el-table v-loading="loading" :data="taxList" size="small" border height="100%"
-    @selection-change="handleSelectionChange">
-    <!-- <el-table-column type="selection" width="55" align="center" /> -->
-    <el-table-column label="客户名称" align="center" prop="companyName" min-width="250">
-      <template #default="scope">
-        <div style="display: flex; align-items: center; ">
-          <template v-if="scope.row.customerLabelName ">
-            <el-tooltip :content="scope.row.customerLabelName" placement="top">
-              <el-icon :size="15">
-                <CollectionTag />
-              </el-icon>
-            </el-tooltip>
-            <span style="padding-left:5px;">{{ scope.row.companyName }}</span>
-          </template>
-          <template v-else>
-            <div style="width: 20px; height: 15px;"></div>
-            <span>{{ scope.row.companyName }}</span>
-          </template>
-        </div>
-      </template>
-    </el-table-column>
-    <el-table-column label="来源" align="center" prop="fromCompanyName" min-width="100" />
-    <el-table-column label="纳税性质" align="center" width="100" prop="taxType" />
-    <el-table-column label="是否零申报" align="center" min-width="80" prop="isZero">
-      <template #default="scope">
-        {{
-        scope.row.isZero === 1 ? "是" : scope.row.isZero === 0 ? "否" : ""
-        }}
-      </template>
-    </el-table-column>
-    <el-table-column label="报税填写" align="center" width="80" prop="evidenceFile">
-      <template #default="scope">
-        <el-button link type="primary" size="small" @click="fillIn(scope.row)"
-          v-hasPermi="['business:financialReportTaxNonZero:saveDetail']">{{
-          scope.row.detail == null
-          ? "填写"
-          : scope.row.detail.status === 1
-          ? "进行中"
-          : "已填写"
-          }}</el-button>
-      </template>
-    </el-table-column>
-    <el-table-column label="报税附件" align="center" width="80" prop="content">
-      <template #default="scope">
-        <el-button link type="primary" :disabled="
+      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
+        <el-tab-pane label="全部" name="first"></el-tab-pane>
+        <el-tab-pane label="我的" name="second"></el-tab-pane>
+      </el-tabs>
+    </div>
+    <!-- 列表区 -->
+    <el-table v-loading="loading" :data="taxList" size="small" border height="100%"
+      @selection-change="handleSelectionChange">
+      <!-- <el-table-column type="selection" width="55" align="center" /> -->
+      <el-table-column label="客户名称" align="center" prop="companyName" min-width="250">
+        <template #default="scope">
+          <div style="display: flex; align-items: center; ">
+            <template v-if="scope.row.customerLabelName ">
+              <el-tooltip :content="scope.row.customerLabelName" placement="top">
+                <el-icon :size="15">
+                  <CollectionTag />
+                </el-icon>
+              </el-tooltip>
+              <span style="padding-left:5px;">{{ scope.row.companyName }}</span>
+            </template>
+            <template v-else>
+              <div style="width: 20px; height: 15px;"></div>
+              <span>{{ scope.row.companyName }}</span>
+            </template>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="来源" align="center" prop="fromCompanyName" v-if="tenant.versionId === '4'" />
+      <el-table-column label="受委托方" align="center" prop="toTenantName" min-width="130"
+        v-if="tenant.versionId !== '4'" />
+      <el-table-column label="纳税性质" align="center" width="100" prop="taxType" />
+      <el-table-column label="是否零申报" align="center" min-width="80" prop="isZero">
+        <template #default="scope">
+          {{
+          scope.row.isZero === 1 ? "是" : scope.row.isZero === 0 ? "否" : ""
+          }}
+        </template>
+      </el-table-column>
+      <el-table-column label="报税填写" align="center" width="80" prop="evidenceFile">
+        <template #default="scope">
+          <el-button link type="primary" size="small" @click="fillIn(scope.row)"
+            v-hasPermi="['business:financialReportTaxNonZero:saveDetail']">{{
+            scope.row.detail == null
+            ? "填写"
+            : scope.row.detail.status === 1
+            ? "进行中"
+            : "已填写"
+            }}</el-button>
+        </template>
+      </el-table-column>
+      <el-table-column label="报税附件" align="center" width="80" prop="content">
+        <template #default="scope">
+          <el-button link type="primary" :disabled="
               scope.row.detail == null || scope.row.detail.evidenceFile === ''
             " size="small" @click="showFiles(scope.row)"
-          v-hasPermi="['business:financialReportTaxNonZero:query']">查看文件</el-button>
-      </template>
-    </el-table-column>
-    <el-table-column label="状态" align="center" min-width="80" prop="verifyContent">
-      <template #default="scope">
-        <div :style="getStatusStyle(scope.row)">
-          {{ getStatusLabel(scope.row) }}
-          <el-popover placement="top-start" width="250" trigger="hover">
-            <div style="display: flex; flex-direction: row">
-              <div v-for="item in selectStatus" :key="item.value"
-                style="display: flex; flex-direction: row; margin-right: 10px">
-                <div :style="{
+            v-hasPermi="['business:financialReportTaxNonZero:query']">查看文件</el-button>
+        </template>
+      </el-table-column>
+      <el-table-column label="状态" align="center" min-width="80" prop="verifyContent">
+        <template #default="scope">
+          <div :style="getStatusStyle(scope.row)">
+            {{ getStatusLabel(scope.row) }}
+            <el-popover placement="top-start" width="250" trigger="hover">
+              <div style="display: flex; flex-direction: row">
+                <div v-for="item in selectStatus" :key="item.value"
+                  style="display: flex; flex-direction: row; margin-right: 10px">
+                  <div :style="{
                       backgroundColor: item.color,
                       width: '14px',
                       height: '14px',
@@ -129,18 +131,18 @@
                       borderRadius: '50%',
                       border: item.color === '#fff' ? '1px solid #ddd' : 'none',
                     }" />
-                <div style="
+                  <div style="
                       display: inline-block;
                       margin-left: 10px;
                       line-height: 36px;
                       font-size: 10px;
                     ">
-                  {{ item.label }}
+                    {{ item.label }}
+                  </div>
                 </div>
               </div>
-            </div>
-            <template #reference>
-              <span style="
+              <template #reference>
+                <span style="
                     color: #fff;
                     font-size: 12px;
                     text-align: center;
@@ -151,16 +153,17 @@
                     background-color: #ccc;
                     border-radius: 50%;
                   ">?</span>
-            </template>
-          </el-popover>
-        </div>
-      </template>
-    </el-table-column>
-    <el-table-column label="执行人" align="center" min-width="100" prop="serviceName" />
-    <el-table-column label="审核人" align="center" prop="verifierName" min-width="100" />
-    <el-table-column label="审核时间" align="center" prop="verifierTime" min-width="100" :show-overflow-tooltip="true" />
-    <el-table-column label="税号" align="center" prop="socialCreditCode" min-width="150" :show-overflow-tooltip="true" />
-    <!-- <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width">
+              </template>
+            </el-popover>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="执行人" align="center" min-width="100" prop="serviceName" />
+      <el-table-column label="审核人" align="center" prop="verifierName" min-width="100" />
+      <el-table-column label="审核时间" align="center" prop="verifierTime" min-width="100" :show-overflow-tooltip="true" />
+      <el-table-column label="税号" align="center" prop="socialCreditCode" min-width="150"
+        :show-overflow-tooltip="true" />
+      <!-- <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width">
         <template #default="scope">
           <el-button size="small" link type="primary" :disabled="
               scope.row.detail == null || scope.row.detail.status !== 3
@@ -168,63 +171,64 @@
             v-hasPermi="['business:financialReportTaxNonZero:back']">退回</el-button>
         </template>
       </el-table-column> -->
-  </el-table>
+    </el-table>
 
-  <!-- 分页 -->
-  <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
-    @pagination="getList" />
+    <!-- 分页 -->
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
 
-  <!-- 表单 -->
-  <FormDialog ref="formDialog" :get-list="getList"></FormDialog>
+    <!-- 表单 -->
+    <FormDialog ref="formDialog" :get-list="getList"></FormDialog>
 
-  <!-- 更多搜索弹窗 -->
-  <el-dialog title="更多搜索" v-model="moreSearch" width="620px" append-to-body size="small" draggable
-    :close-on-click-modal="false">
-    <el-form ref="dictRef" size="small" label-width="100">
-      <el-row :gutter="20">
-        <el-col :span="12">
-          <el-form-item label="报税所属期:" prop="year">
-            <el-date-picker size="small" v-model="currentMonth" type="month" format="YYYY年MM月" value-format="YYYY-MM-01"
-              :disabled-date="disabledDateHandler" @change="monthChangeHandler" :clearable="false" />
-          </el-form-item>
-          <el-form-item label="纳税性质:" prop="taxType">
-            <el-select size="small" v-model="queryParams.taxType" placeholder="请选择纳税性质" :clearable="true">
-              <el-option v-for="item in taxTypes" :key="item.label" :label="item.label" :value="item.value" />
-            </el-select>
-          </el-form-item>
-          <el-form-item label="报税状态:">
-            <el-select size="small" v-model="queryParams.status" type="text" placeholder="状态" :clearable="true">
-              <el-option v-for="item in selectStatus" :key="item.value" :label="item.label" :value="item.value" />
-            </el-select>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="关键字:">
-            <el-input size="small" v-model="queryParams.companyName" type="text" placeholder="请输入客户名称"
-              :clearable="true" />
-          </el-form-item>
-          <el-form-item label="来源:" v-if="tenant.versionId === '4'">
-            <el-input v-model="queryParams.fromCompanyName" size="small" type="text" placeholder="请输入客户来源"
-              :clearable="true" />
-          </el-form-item>
-          <el-form-item label="税号:">
-            <el-input size="small" v-model="queryParams.socialCreditCode" type="text" placeholder="请输入税号"
-              :clearable="true" />
-          </el-form-item>
-        </el-col>
-      </el-row>
-    </el-form>
-    <template #footer>
-      <div class="dialog-footer">
-        <el-button type="primary" icon="Finished" size="small" @click="handleQuery">确 定</el-button>
-        <el-button icon="close" size="small" @click="moreSearch = false">取 消</el-button>
-      </div>
-    </template>
-  </el-dialog>
+    <!-- 更多搜索弹窗 -->
+    <el-dialog title="更多搜索" v-model="moreSearch" width="620px" append-to-body size="small" draggable
+      :close-on-click-modal="false">
+      <el-form ref="dictRef" size="small" label-width="100">
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="报税所属期:" prop="year">
+              <el-date-picker size="small" v-model="currentMonth" type="month" format="YYYY年MM月"
+                value-format="YYYY-MM-01" :disabled-date="disabledDateHandler" @change="monthChangeHandler"
+                :clearable="false" />
+            </el-form-item>
+            <el-form-item label="纳税性质:" prop="taxType">
+              <el-select size="small" v-model="queryParams.taxType" placeholder="请选择纳税性质" :clearable="true">
+                <el-option v-for="item in taxTypes" :key="item.label" :label="item.label" :value="item.value" />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="报税状态:">
+              <el-select size="small" v-model="queryParams.status" type="text" placeholder="状态" :clearable="true">
+                <el-option v-for="item in selectStatus" :key="item.value" :label="item.label" :value="item.value" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="关键字:">
+              <el-input size="small" v-model="queryParams.companyName" type="text" placeholder="请输入客户名称"
+                :clearable="true" />
+            </el-form-item>
+            <el-form-item label="来源:" v-if="tenant.versionId === '4'">
+              <el-input v-model="queryParams.fromCompanyName" size="small" type="text" placeholder="请输入客户来源"
+                :clearable="true" />
+            </el-form-item>
+            <el-form-item label="税号:">
+              <el-input size="small" v-model="queryParams.socialCreditCode" type="text" placeholder="请输入税号"
+                :clearable="true" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button type="primary" icon="Finished" size="small" @click="handleQuery">确 定</el-button>
+          <el-button icon="close" size="small" @click="moreSearch = false">取 消</el-button>
+        </div>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
-<script setup name="Tax">
+<script setup name="FinancialReportTax">
   import {
     selectMonths,
     selectStatus,
@@ -274,7 +278,10 @@
     principal: tenant.versionId !== '4' && !flag.value ? useUserStore().user.userId : null,
   });
   /***********************  方法区  ****************************/
-
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
   /** 查询报税列表 */
   function getList() {
     loading.value = true;

+ 260 - 390
src/views/business/production/financialReportTaxIsZero/index.vue

@@ -8,13 +8,8 @@
         </el-button>
         <template #dropdown>
           <el-dropdown-menu>
-            <el-dropdown-item
-              icon="Download"
-              @click="handleExport"
-              v-hasPermi="['business:financialReportTax:export']"
-            >
-              导出</el-dropdown-item
-            >
+            <el-dropdown-item icon="Download" @click="handleExport" v-hasPermi="['business:financialReportTax:export']">
+              导出</el-dropdown-item>
           </el-dropdown-menu>
         </template>
       </el-dropdown>
@@ -22,47 +17,22 @@
     <!-- 搜索区 -->
     <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true" label-width="68px">
       <el-form-item label="客户名称:">
-        <el-input
-          v-model="queryParams.companyName"
-          type="text" size="small"
-          placeholder="请输入客户名称"
-          :clearable="true"
-          style="width: 130px"
-        />
+        <el-input v-model="queryParams.companyName" type="text" size="small" placeholder="请输入客户名称" :clearable="true"
+          style="width: 130px" />
       </el-form-item>
       <el-form-item label="客户标签:">
-        <el-select v-model="queryParams.customerLabelId"   size="small"  style="width: 130px" clearable>
+        <el-select v-model="queryParams.customerLabelId" size="small" style="width: 130px" clearable>
           <el-option v-for="item in options" :key="item.id" :label="item.lable" :value="item.id" />
         </el-select>
       </el-form-item>
       <el-form-item label="所属期:" prop="year">
-        <el-date-picker
-          v-model="currentMonth"
-          type="month"
-          size="small"
-          format="YYYY年MM月"
-          value-format="YYYY-MM-01"
-          :clearable="false"
-          :disabled-date="disabledDateHandler"
-          style="width: 120px"
-          @change="monthChangeHandler"
-        />
+        <el-date-picker v-model="currentMonth" type="month" size="small" format="YYYY年MM月" value-format="YYYY-MM-01"
+          :clearable="false" :disabled-date="disabledDateHandler" style="width: 120px" @change="monthChangeHandler" />
       </el-form-item>
       <el-form-item label="报税状态:">
-        <el-select
-          v-model="queryParams.status"
-          type="text"
-          size="small"
-          placeholder="状态"
-          :clearable="true"
-          style="width: 130px"
-        >
-          <el-option
-            v-for="item in selectStatus"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          />
+        <el-select v-model="queryParams.status" type="text" size="small" placeholder="状态" :clearable="true"
+          style="width: 130px">
+          <el-option v-for="item in selectStatus" :key="item.value" :label="item.label" :value="item.value" />
         </el-select>
       </el-form-item>
       <el-form-item label="审核人:" prop="verifierName">
@@ -75,33 +45,25 @@
           format="YYYY - MM - DD " value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期"
           end-placeholder="业务日期" style="width: 70%;"></el-date-picker>
       </el-form-item>
-<!-- 
+      <!-- 
       <el-form-item v-if="tenant.versionId !== '4'" label="是否自己负责:" v-hasPermi="['business:taxeszero:person']">  
         <el-switch v-model="oneself" @change="handleOneself" />
       </el-form-item> -->
       <el-form-item>
-        <el-button type="primary" icon="Search" size="small"  @click="handleQuery"
-          >搜索</el-button
-        >
-        <el-button icon="operation" @click="moreSearch = true" size="small"  >更多</el-button>
-        <el-button icon="Refresh" @click="resetQuery" size="small" >重置</el-button>
+        <el-button type="primary" icon="Search" size="small" @click="handleQuery">搜索</el-button>
+        <el-button icon="operation" @click="moreSearch = true" size="small">更多</el-button>
+        <el-button icon="Refresh" @click="resetQuery" size="small">重置</el-button>
       </el-form-item>
     </el-form>
     <div v-if="flag && flag2 && tenant.versionId !== '4'">
-    <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" >
-      <el-tab-pane label="全部" name="first"></el-tab-pane>
-      <el-tab-pane label="我的" name="second"></el-tab-pane>
-    </el-tabs>
+      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
+        <el-tab-pane label="全部" name="first"></el-tab-pane>
+        <el-tab-pane label="我的" name="second"></el-tab-pane>
+      </el-tabs>
     </div>
     <!-- 列表区 -->
-    <el-table
-      v-loading="loading"
-      :data="taxList"
-      size="small"
-      border
-      height="100%"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="taxList" size="small" border height="100%"
+      @selection-change="handleSelectionChange">
       <!-- <el-table-column type="selection" width="55" align="center" /> -->
       <el-table-column label="客户名称" align="center" prop="companyName" min-width="250">
         <template #default="scope">
@@ -121,62 +83,41 @@
           </div>
         </template>
       </el-table-column>
-      <el-table-column
-        label="来源"
-        align="center"
-        prop="fromCompanyName"
-        width="180"
-      />
+      <el-table-column label="来源" align="center" prop="fromCompanyName" v-if="tenant.versionId === '4'" />
+      <el-table-column label="受委托方" align="center" prop="toTenantName" min-width="130"
+        v-if="tenant.versionId !== '4'" />
       <!-- <el-table-column
         label="税号"
         align="center"
         prop="socialCreditCode"
         width="180"
       /> -->
-      <el-table-column
-        label="纳税性质"
-        align="center"
-        width="100"
-        prop="taxType"
-      />
+      <el-table-column label="纳税性质" align="center" width="100" prop="taxType" />
       <el-table-column label="是否零申报" align="center" prop="isZero">
         <template #default="scope">
           {{
-            scope.row.isZero === 1 ? "是" : scope.row.isZero === 0 ? "否" : ""
+          scope.row.isZero === 1 ? "是" : scope.row.isZero === 0 ? "否" : ""
           }}
         </template>
       </el-table-column>
       <el-table-column label="报税填写" align="center" prop="evidenceFile">
         <template #default="scope">
-          <el-button
-            link
-            type="primary"
-            size="small"
-            v-hasPermi="['business:financialReportTax:saveDetail']"
-            @click="fillIn(scope.row)"
-            >{{
-              scope.row.detail == null
-                ? "填写"
-                : scope.row.detail.status === 1
-                ? "进行中"
-                : "已填写"
-            }}</el-button
-          >
+          <el-button link type="primary" size="small" v-hasPermi="['business:financialReportTax:saveDetail']"
+            @click="fillIn(scope.row)">{{
+            scope.row.detail == null
+            ? "填写"
+            : scope.row.detail.status === 1
+            ? "进行中"
+            : "已填写"
+            }}</el-button>
         </template>
       </el-table-column>
       <el-table-column label="报税附件" align="center" prop="content">
         <template #default="scope">
-          <el-button
-            link
-            type="primary"
-            :disabled="
+          <el-button link type="primary" :disabled="
               scope.row.detail == null || scope.row.detail.evidenceFile === ''
-            "
-            size="small"
-            v-hasPermi="['business:financialReportTax:query']"
-            @click="showFiles(scope.row)"
-            >查看文件</el-button
-          >
+            " size="small" v-hasPermi="['business:financialReportTax:query']"
+            @click="showFiles(scope.row)">查看文件</el-button>
         </template>
       </el-table-column>
       <el-table-column label="状态" align="center" prop="verifyContent">
@@ -185,36 +126,28 @@
             {{ getStatusLabel(scope.row) }}
             <el-popover placement="top-start" width="250" trigger="hover">
               <div style="display: flex; flex-direction: row">
-                <div
-                  v-for="item in selectStatus"
-                  :key="item.value"
-                  style="display: flex; flex-direction: row; margin-right: 10px"
-                >
-                  <div
-                    :style="{
+                <div v-for="item in selectStatus" :key="item.value"
+                  style="display: flex; flex-direction: row; margin-right: 10px">
+                  <div :style="{
                       backgroundColor: item.color,
                       width: '14px',
                       height: '14px',
                       margin: 'auto',
                       borderRadius: '50%',
                       border: item.color === '#fff' ? '1px solid #ddd' : 'none',
-                    }"
-                  />
-                  <div
-                    style="
+                    }" />
+                  <div style="
                       display: inline-block;
                       margin-left: 10px;
                       line-height: 36px;
                       font-size: 10px;
-                    "
-                  >
+                    ">
                     {{ item.label }}
                   </div>
                 </div>
               </div>
               <template #reference>
-                <span
-                  style="
+                <span style="
                     color: #fff;
                     font-size: 12px;
                     text-align: center;
@@ -224,9 +157,7 @@
                     height: 14px;
                     background-color: #ccc;
                     border-radius: 50%;
-                  "
-                  >?</span
-                >
+                  ">?</span>
               </template>
             </el-popover>
           </div>
@@ -234,9 +165,8 @@
       </el-table-column>
       <el-table-column label="执行人" align="center" prop="serviceName" />
       <el-table-column label="审核人" align="center" prop="verifierName" min-width="100" />
-      <el-table-column label="审核时间" align="center" prop="verifierTime" min-width="100"
-        :show-overflow-tooltip="true" />
-        <el-table-column label="税号" align="center" prop="socialCreditCode" min-width="150"
+      <el-table-column label="审核时间" align="center" prop="verifierTime" min-width="100" :show-overflow-tooltip="true" />
+      <el-table-column label="税号" align="center" prop="socialCreditCode" min-width="150"
         :show-overflow-tooltip="true" />
       <!-- <el-table-column
         label="操作"
@@ -260,196 +190,136 @@
     </el-table>
 
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
 
     <!-- 表单 -->
     <FormDialog ref="formDialog" :get-list="getList"></FormDialog>
     <!-- 更多搜索弹窗 -->
-    <el-dialog
-      title="更多搜索"
-      v-model="moreSearch"
-      width="620px"
-      append-to-body
-      size="small"
-      draggable
-      :close-on-click-modal = "false"
-    >
+    <el-dialog title="更多搜索" v-model="moreSearch" width="620px" append-to-body size="small" draggable
+      :close-on-click-modal="false">
       <el-form ref="dictRef" size="small" label-width="100">
         <el-row :gutter="20">
           <el-col :span="12">
             <el-form-item label="报税所属期:" prop="year">
-              <el-date-picker
-                size="small"
-                v-model="currentMonth"
-                type="month"
-                format="YYYY年MM月"
-                value-format="YYYY-MM-01"
-                :disabled-date="disabledDateHandler"
-                @change="monthChangeHandler"
-                :clearable="false"
-              />
+              <el-date-picker size="small" v-model="currentMonth" type="month" format="YYYY年MM月"
+                value-format="YYYY-MM-01" :disabled-date="disabledDateHandler" @change="monthChangeHandler"
+                :clearable="false" />
             </el-form-item>
             <el-form-item label="纳税性质:" prop="taxType">
-              <el-select
-                size="small"
-                v-model="queryParams.taxType"
-                placeholder="请选择纳税性质"
-                :clearable="true"
-              >
-                <el-option
-                  v-for="item in taxTypes"
-                  :key="item.label"
-                  :label="item.label"
-                  :value="item.value"
-                />
+              <el-select size="small" v-model="queryParams.taxType" placeholder="请选择纳税性质" :clearable="true">
+                <el-option v-for="item in taxTypes" :key="item.label" :label="item.label" :value="item.value" />
               </el-select>
             </el-form-item>
             <el-form-item label="报税状态:">
-              <el-select
-                size="small"
-                v-model="queryParams.status"
-                type="text"
-                placeholder="状态"
-                :clearable="true"
-              >
-                <el-option
-                  v-for="item in selectStatus"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                />
+              <el-select size="small" v-model="queryParams.status" type="text" placeholder="状态" :clearable="true">
+                <el-option v-for="item in selectStatus" :key="item.value" :label="item.label" :value="item.value" />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="关键字:">
-              <el-input
-                size="small"
-                v-model="queryParams.companyName"
-                type="text"
-                placeholder="请输入客户名称"
-                :clearable="true"
-              />
+              <el-input size="small" v-model="queryParams.companyName" type="text" placeholder="请输入客户名称"
+                :clearable="true" />
             </el-form-item>
             <el-form-item v-if="tenant.versionId === 4" label="来源:">
-              <el-input
-                v-model="queryParams.fromCompanyName"
-                size="small"
-                type="text"
-                placeholder="请输入客户来源"
-                :clearable="true"
-              />
+              <el-input v-model="queryParams.fromCompanyName" size="small" type="text" placeholder="请输入客户来源"
+                :clearable="true" />
             </el-form-item>
             <el-form-item label="税号:">
-              <el-input
-                size="small"
-                v-model="queryParams.socialCreditCode"
-                type="text"
-                placeholder="请输入税号"
-                :clearable="true"
-              />
+              <el-input size="small" v-model="queryParams.socialCreditCode" type="text" placeholder="请输入税号"
+                :clearable="true" />
             </el-form-item>
           </el-col>
         </el-row>
       </el-form>
       <template #footer>
         <div class="dialog-footer">
-          <el-button
-            type="primary"
-            icon="Finished"
-            size="small"
-            @click="handleQuery"
-            >确 定</el-button
-          >
-          <el-button icon="close" size="small" @click="moreSearch = false"
-            >取 消</el-button
-          >
+          <el-button type="primary" icon="Finished" size="small" @click="handleQuery">确 定</el-button>
+          <el-button icon="close" size="small" @click="moreSearch = false">取 消</el-button>
         </div>
       </template>
     </el-dialog>
   </div>
 </template>
 
-<script setup name="Tax">
-import {
-  selectMonths,
-  selectStatus,
-  taxTypes,
-  confirmDefault,
-} from "@/utils/default";
-import {
-  listTax,
-  deductionTurnBack,
-  exportFinalTax,
-} from "@/api/business/production/taxIsZero";
-import useUserStore from "@/store/modules/user";
-import FormDialog from "./FormDialog.vue";
+<script setup name="FinancialReportTaxIsZero">
+  import {
+    selectMonths,
+    selectStatus,
+    taxTypes,
+    confirmDefault,
+  } from "@/utils/default";
+  import {
+    listTax,
+    deductionTurnBack,
+    exportFinalTax,
+  } from "@/api/business/production/taxIsZero";
+  import useUserStore from "@/store/modules/user";
+  import FormDialog from "./FormDialog.vue";
   import { listLableNoPage } from "@/api/business/lable"
-const { proxy } = getCurrentInstance();
-/** 字典数组区 */
-/** 查询 对象 */
-const flag = ref(checkPermission(['business:taxeszero:person']))
-const flag2 = ref(checkPermission(['business:taxeszero:myself']))
- const activeName = flag.value ? ref('first') : ref('second');
-const tenant = useUserStore().tenant;
-const taxList = ref([]);
-const moreSearch = ref(false);
-const loading = ref(true);
-const oneself = ref(true);
-const ids = ref([]);
-const single = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-const options = ref([]);
-const currentMonth = ref(
-  proxy.moment().subtract(1, "month").format("YYYY-MM-01")
-);
-/** 查询对象 */
-const queryParams = ref({
-  pageNum: 1,
-  pageSize: 20,
-  tenantId: null,
-  currentEmployeeId: null,
-  employeeIds: null,
-  createTime: null,
-  creatorId: null,
-  workOrderId: null,
-  isStop: null,
-  year: proxy.moment().subtract(1, "month").format("YYYY"),
-  month: proxy.moment().subtract(1, "month").format("MM"),
-  principal: tenant.versionId !== '4' && !flag.value ? useUserStore().user.userId : null,
-});
-
-/***********************  方法区  ****************************/
-function getOption() {
+  const { proxy } = getCurrentInstance();
+  /** 字典数组区 */
+  /** 查询 对象 */
+  const flag = ref(checkPermission(['business:taxeszero:person']))
+  const flag2 = ref(checkPermission(['business:taxeszero:myself']))
+  const activeName = flag.value ? ref('first') : ref('second');
+  const tenant = useUserStore().tenant;
+  const taxList = ref([]);
+  const moreSearch = ref(false);
+  const loading = ref(true);
+  const oneself = ref(true);
+  const ids = ref([]);
+  const single = ref(true);
+  const multiple = ref(true);
+  const total = ref(0);
+  const options = ref([]);
+  const currentMonth = ref(
+    proxy.moment().subtract(1, "month").format("YYYY-MM-01")
+  );
+  /** 查询对象 */
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    tenantId: null,
+    currentEmployeeId: null,
+    employeeIds: null,
+    createTime: null,
+    creatorId: null,
+    workOrderId: null,
+    isStop: null,
+    year: proxy.moment().subtract(1, "month").format("YYYY"),
+    month: proxy.moment().subtract(1, "month").format("MM"),
+    principal: tenant.versionId !== '4' && !flag.value ? useUserStore().user.userId : null,
+  });
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
+  /***********************  方法区  ****************************/
+  function getOption() {
     listLableNoPage().then(res => {
       options.value = res.data
     })
   }
-/** 查询报税列表 */
-function getList() {
-  console.log("查询", queryParams.value);
-  loading.value = true;
-  listTax(queryParams.value).then((response) => {
-    taxList.value = response.rows;
-    total.value = response.total;
-    loading.value = false;
-  });
-}
+  /** 查询报税列表 */
+  function getList() {
+    console.log("查询", queryParams.value);
+    loading.value = true;
+    listTax(queryParams.value).then((response) => {
+      taxList.value = response.rows;
+      total.value = response.total;
+      loading.value = false;
+    });
+  }
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  moreSearch.value = false;
-  queryParams.value.pageNum = 1;
-  getList();
-}
-function handleClick(tab) {
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    moreSearch.value = false;
+    queryParams.value.pageNum = 1;
+    getList();
+  }
+  function handleClick(tab) {
     console.log(tab.props.name)
     if (tab.props.name === "second") {
       oneself.value = true
@@ -459,16 +329,16 @@ function handleClick(tab) {
       handleOneself()
     }
   }
-/** 是否为自己负责 */
-function handleOneself() {
-  if (oneself.value) {
-    queryParams.value.principal = useUserStore().user.userId;
-  } else {
-    queryParams.value.principal = null;
+  /** 是否为自己负责 */
+  function handleOneself() {
+    if (oneself.value) {
+      queryParams.value.principal = useUserStore().user.userId;
+    } else {
+      queryParams.value.principal = null;
+    }
+    getList();
   }
-  getList();
-}
-function checkPermission(templatePermission) {
+  function checkPermission(templatePermission) {
     const all_permission = "*:*:*";
     const permissions = useUserStore().permissions;
     const hasPermissions = permissions.some((permission) => {
@@ -478,137 +348,137 @@ function checkPermission(templatePermission) {
     });
     return hasPermissions;
   }
-/** 导出按钮操作 */
-function handleExport() {
-  exportFinalTax(queryParams.value);
-}
+  /** 导出按钮操作 */
+  function handleExport() {
+    exportFinalTax(queryParams.value);
+  }
 
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm("queryRef");
-  queryParams.value = {
-    pageNum: 1,
-    pageSize: 20,
-    tenantId: null,
-    currentEmployeeId: null,
-    employeeIds: null,
-    createTime: null,
-    creatorId: null,
-    workOrderId: null,
-    isStop: null,
-    year: proxy.moment().subtract(1, "month").format("YYYY"),
-    month: proxy.moment().subtract(1, "month").format("MM"),
-  };
-  currentMonth.value = proxy.moment().subtract(1, "month").format("YYYY-MM-01");
-  if (activeName.value != null && activeName.value === 'second') {
-        queryParams.value.principal = useUserStore().user.userId;
+  /** 重置按钮操作 */
+  function resetQuery() {
+    proxy.resetForm("queryRef");
+    queryParams.value = {
+      pageNum: 1,
+      pageSize: 20,
+      tenantId: null,
+      currentEmployeeId: null,
+      employeeIds: null,
+      createTime: null,
+      creatorId: null,
+      workOrderId: null,
+      isStop: null,
+      year: proxy.moment().subtract(1, "month").format("YYYY"),
+      month: proxy.moment().subtract(1, "month").format("MM"),
+    };
+    currentMonth.value = proxy.moment().subtract(1, "month").format("YYYY-MM-01");
+    if (activeName.value != null && activeName.value === 'second') {
+      queryParams.value.principal = useUserStore().user.userId;
     }
-  handleQuery();
-}
-
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  single.value = selection.length != 1;
-  multiple.value = !selection.length;
-}
-
-/** 查看文件 */
-function showFiles(row) {
-  console.log("查看文件", row);
-  openByPermission(null, row, {
-    month: queryParams.value.month,
-    year: queryParams.value.year,
-  });
-}
+    handleQuery();
+  }
 
-/** 退回按钮操作 */
-function turnBack(detail) {
-  deductionTurnBack(detail)
-    .then((res) => {
-      console.log(res);
-      getList();
-    })
-    .catch((err) => {
-      proxy.$modal.$modalMsgError(err);
-      console.log(err);
-      getList();
-    });
-  getList();
-}
+  // 多选框选中数据
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    single.value = selection.length != 1;
+    multiple.value = !selection.length;
+  }
 
-/** 填写按钮操作 */
-function fillIn(row) {
-  if (row.detail == null) {
-    openByPermission(0, row, {
-      month: queryParams.value.month,
-      year: queryParams.value.year,
-    });
-  } else if (row.detail != null && row.detail.status == 3) {
+  /** 查看文件 */
+  function showFiles(row) {
+    console.log("查看文件", row);
     openByPermission(null, row, {
       month: queryParams.value.month,
       year: queryParams.value.year,
     });
-  } else {
-    openByPermission(row.detail, row, {
-      month: queryParams.value.month,
-      year: queryParams.value.year,
-    });
   }
-}
 
-/** 打开弹窗 */
-function openByPermission(detailItem, row, item) {
-  console.log("打开弹窗", detailItem, row, item);
-  console.log(detailItem);
-  if (detailItem == null) {
-    proxy.$refs.formDialog.open(null, row, item);
-  } else {
-    proxy.$refs.formDialog.open(detailItem, row, item);
-    console.log(detailItem.id);
+  /** 退回按钮操作 */
+  function turnBack(detail) {
+    deductionTurnBack(detail)
+      .then((res) => {
+        console.log(res);
+        getList();
+      })
+      .catch((err) => {
+        proxy.$modal.$modalMsgError(err);
+        console.log(err);
+        getList();
+      });
+    getList();
   }
-}
 
-function getStatusStyle(row) {
-  if (row.detail == null) {
-    return { color: getStatusColor(0), verticalAlign: "middle" };
-  } else {
-    return {
-      color: getStatusColor(row.detail.status),
-      verticalAlign: "middle",
-    };
+  /** 填写按钮操作 */
+  function fillIn(row) {
+    if (row.detail == null) {
+      openByPermission(0, row, {
+        month: queryParams.value.month,
+        year: queryParams.value.year,
+      });
+    } else if (row.detail != null && row.detail.status == 3) {
+      openByPermission(null, row, {
+        month: queryParams.value.month,
+        year: queryParams.value.year,
+      });
+    } else {
+      openByPermission(row.detail, row, {
+        month: queryParams.value.month,
+        year: queryParams.value.year,
+      });
+    }
   }
-}
 
-function getStatusLabel(row) {
-  const index = selectStatus.findIndex(
-    (v) => v.value === (row.detail == null ? 0 : row.detail.status)
-  );
-  return index >= 0 ? selectStatus[index].label : "";
-}
+  /** 打开弹窗 */
+  function openByPermission(detailItem, row, item) {
+    console.log("打开弹窗", detailItem, row, item);
+    console.log(detailItem);
+    if (detailItem == null) {
+      proxy.$refs.formDialog.open(null, row, item);
+    } else {
+      proxy.$refs.formDialog.open(detailItem, row, item);
+      console.log(detailItem.id);
+    }
+  }
 
-function getStatusColor(status) {
-  const index = selectStatus.findIndex((v) => v.value === status);
-  return index >= 0 ? selectStatus[index].color : "#fff";
-}
+  function getStatusStyle(row) {
+    if (row.detail == null) {
+      return { color: getStatusColor(0), verticalAlign: "middle" };
+    } else {
+      return {
+        color: getStatusColor(row.detail.status),
+        verticalAlign: "middle",
+      };
+    }
+  }
 
-function disabledDateHandler(date) {
-  if (date <= proxy.moment().subtract(1, "month")) {
-    return false;
-  } else {
-    return true;
+  function getStatusLabel(row) {
+    const index = selectStatus.findIndex(
+      (v) => v.value === (row.detail == null ? 0 : row.detail.status)
+    );
+    return index >= 0 ? selectStatus[index].label : "";
   }
-}
 
-function monthChangeHandler(arg) {
-  const year = proxy.moment(arg).format("YYYY");
-  const month = proxy.moment(arg).format("MM");
-  queryParams.value.year = year;
-  queryParams.value.month = month;
-  console.log(year, month);
-  handleQuery();
-}
+  function getStatusColor(status) {
+    const index = selectStatus.findIndex((v) => v.value === status);
+    return index >= 0 ? selectStatus[index].color : "#fff";
+  }
 
-getList();
-getOption();
-</script>
+  function disabledDateHandler(date) {
+    if (date <= proxy.moment().subtract(1, "month")) {
+      return false;
+    } else {
+      return true;
+    }
+  }
+
+  function monthChangeHandler(arg) {
+    const year = proxy.moment(arg).format("YYYY");
+    const month = proxy.moment(arg).format("MM");
+    queryParams.value.year = year;
+    queryParams.value.month = month;
+    console.log(year, month);
+    handleQuery();
+  }
+
+  getList();
+  getOption();
+</script>

+ 9 - 4
src/views/business/production/keepAccount/index.vue

@@ -57,7 +57,7 @@
       </el-form-item>
     </el-form>
     <div v-if="flag && flag2 && tenant.versionId !== '4'">
-      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" >
+      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
         <el-tab-pane label="全部" name="first">
         </el-tab-pane>
         <el-tab-pane label="我的" name="second">
@@ -86,7 +86,9 @@
           </div>
         </template>
       </el-table-column>
-      <el-table-column label="来源" align="center" prop="fromCompanyName" min-width="100" />
+      <el-table-column label="来源" align="center" prop="fromCompanyName" v-if="tenant.versionId === '4'" />
+      <el-table-column label="受委托方" align="center" prop="toTenantName" min-width="130"
+        v-if="tenant.versionId !== '4'" />
       <el-table-column label="纳税性质" min-width="100" align="center" prop="taxType" />
       <el-table-column label="所属期" width="90" align="center">
         <template #default="scope">
@@ -197,7 +199,7 @@
   </div>
 </template>
 
-<script setup name="Company">
+<script setup name="KeepAccount">
   import useUserStore from "@/store/modules/user";
   import { taxTypes } from "@/utils/default";
   import {
@@ -340,7 +342,10 @@
   const editStatus = {
     startMonth: false,
   };
-
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
   /***********************  方法区  ****************************/
   function getOption() {
     listLableNoPage().then(res => {

+ 7 - 4
src/views/business/production/onceWork/index.vue

@@ -64,11 +64,11 @@
         min-width="150"
       /> -->
       <el-table-column label="来源" align="center" prop="accountName" min-width="150" v-if="tenant.versionId == '4'" />
-      <el-table-column label="工单类型" align="center" prop="amount" width="80">
+      <!-- <el-table-column label="工单类型" align="center" prop="amount" width="80">
         <template #default="scope">
           {{ scope.row.type === 1 ? "循环工单" : "代办工单" }}
         </template>
-      </el-table-column>
+      </el-table-column> -->
       <el-table-column label="项目" align="center" width="200" :show-overflow-tooltip="true">
         <template #default="scope">
           {{
@@ -203,7 +203,7 @@
   </div>
 </template>
 
-<script setup name="Company">
+<script setup name="OnceWork">
 
 
   import {
@@ -273,7 +273,10 @@
   };
 
   /***********************  方法区  ****************************/
-
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
   /** 查询company列表 */
   function getList() {
     loading.value = true;

+ 170 - 167
src/views/business/production/productionCompany/index.vue

@@ -38,7 +38,7 @@
         <template #default="scope">
           <span>{{
             scope.row.province + "-" + scope.row.city + "-" + scope.row.district
-          }}</span>
+            }}</span>
         </template>
       </el-table-column>
       <el-table-column label="年收入" align="center" prop="annualIncome" />
@@ -47,7 +47,7 @@
         <template #default="scope">
           <span>{{
             scope.row.isZero === 1 ? "是" : scope.row.isZero === 0 ? "否" : ""
-          }}</span>
+            }}</span>
         </template>
       </el-table-column>
       <el-table-column label="客服" align="center" min-width="110" prop="adviserName" />
@@ -55,147 +55,150 @@
     </el-table>
 
     <!-- 分页 -->
-    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
-      @pagination="getList" />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
 
     <!-- 表单 -->
   </div>
 </template>
 
-<script setup name="Company">
-import {
-  listProductionCompany,
-  delCompany,demo
-} from "@/api/business/production/productionCompany";
-const { proxy } = getCurrentInstance();
-import useUserStore from "@/store/modules/user";
-/** 字典数组区 */
-/** 查询 对象 */
-const flag = ref(checkPermission(['business:customer:person']))
-const flag2 = ref(checkPermission(['business:customer:myself']))
-const activeName = flag.value ? ref('first') : ref('second');
-const companyList = ref([]);
-const loading = ref(true);
-const ids = ref([]);
-const single = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-const tenant = useUserStore().tenant;
-const oneself = ref(false);
-/** 查询对象 */
-const queryParams = ref({
-  pageNum: 1,
-  pageSize: 20,
-  orderByColumn: "create_time",
-  category: null,
-  code: null,
-  name: null,
-  shortName: null,
-  oldName: null,
-  owner: null,
-  phone: null,
-  email: null,
-  contactAddress: null,
-  source: null,
-  type: null,
-  socialCreditCode: null,
-  mainBusiness: null,
-  legalRepresentative: null,
-  foundationDate: null,
-  licenceDate: null,
-  businessStartDate: null,
-  businessEndDate: null,
-  isPermanentlyEffective: null,
-  registerMoney: null,
-  registerMoneyUnit: null,
-  provinceCode: null,
-  province: null,
-  cityCode: null,
-  city: null,
-  districtCode: null,
-  district: null,
-  address: null,
-  businessField: null,
-  taxType: null,
-  isZero: null,
-  competentTaxAuthority: null,
-  taxCollectorName: null,
-  taxCollectorPhone: null,
-  taxMonth: null,
-  openingBank: null,
-  bankAccount: null,
-  annualIncome: null,
-  governmentAccountNo: null,
-  governmentPassword: null,
-  socialSecurityAccountNo: null,
-  socialSecurityPassword: null,
-  employeePassword: null,
-  housingFundPassword: null,
-  housingFundUnitAccount: null,
-  housingFundDeductionPassword: null,
-  collectionMethod: null,
-  quotaAmount: null,
-  isPayOnWindow: null,
-  isFirstSocialSecurity: null,
-  isFirstHousingFund: null,
-  leaderId: null,
-  adviserId: null,
-  leaderName: null,
-  adviserName: null,
-  principal:tenant.versionId !== '4' && !flag.value ? useUserStore().user.userId : null,
-});
-
-/***********************  方法区  ****************************/
+<script setup name="ProductionCompany">
+  import {
+    listProductionCompany,
+    delCompany, demo
+  } from "@/api/business/production/productionCompany";
+  const { proxy } = getCurrentInstance();
+  import useUserStore from "@/store/modules/user";
+  /** 字典数组区 */
+  /** 查询 对象 */
+  const flag = ref(checkPermission(['business:customer:person']))
+  const flag2 = ref(checkPermission(['business:customer:myself']))
+  const activeName = flag.value ? ref('first') : ref('second');
+  const companyList = ref([]);
+  const loading = ref(true);
+  const ids = ref([]);
+  const single = ref(true);
+  const multiple = ref(true);
+  const total = ref(0);
+  const tenant = useUserStore().tenant;
+  const oneself = ref(false);
+  /** 查询对象 */
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    orderByColumn: "create_time",
+    category: null,
+    code: null,
+    name: null,
+    shortName: null,
+    oldName: null,
+    owner: null,
+    phone: null,
+    email: null,
+    contactAddress: null,
+    source: null,
+    type: null,
+    socialCreditCode: null,
+    mainBusiness: null,
+    legalRepresentative: null,
+    foundationDate: null,
+    licenceDate: null,
+    businessStartDate: null,
+    businessEndDate: null,
+    isPermanentlyEffective: null,
+    registerMoney: null,
+    registerMoneyUnit: null,
+    provinceCode: null,
+    province: null,
+    cityCode: null,
+    city: null,
+    districtCode: null,
+    district: null,
+    address: null,
+    businessField: null,
+    taxType: null,
+    isZero: null,
+    competentTaxAuthority: null,
+    taxCollectorName: null,
+    taxCollectorPhone: null,
+    taxMonth: null,
+    openingBank: null,
+    bankAccount: null,
+    annualIncome: null,
+    governmentAccountNo: null,
+    governmentPassword: null,
+    socialSecurityAccountNo: null,
+    socialSecurityPassword: null,
+    employeePassword: null,
+    housingFundPassword: null,
+    housingFundUnitAccount: null,
+    housingFundDeductionPassword: null,
+    collectionMethod: null,
+    quotaAmount: null,
+    isPayOnWindow: null,
+    isFirstSocialSecurity: null,
+    isFirstHousingFund: null,
+    leaderId: null,
+    adviserId: null,
+    leaderName: null,
+    adviserName: null,
+    principal: tenant.versionId !== '4' && !flag.value ? useUserStore().user.userId : null,
+  });
 
-/** 查询company列表 */
-function getList() {
-  loading.value = true;
-  listProductionCompany(queryParams.value).then((response) => {
-    companyList.value = response.rows;
-    total.value = response.total;
-    loading.value = false;
-    console.log(response);
+  /***********************  方法区  ****************************/
+  onActivated(() => {
+    // 你的逻辑
+    getList();
   });
-}
+  /** 查询company列表 */
+  function getList() {
+    loading.value = true;
+    listProductionCompany(queryParams.value).then((response) => {
+      companyList.value = response.rows;
+      total.value = response.total;
+      loading.value = false;
+      console.log(response);
+    });
+  }
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1;
-  getList();
-}
-function aaa(){
-  demo().then(res =>{
-    
-  })
-}
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm("queryRef");
-  queryParams.value.name = "";
-  queryParams.value.socialCreditCode = "";
-  queryParams.value.leaderName = "";
-  if (activeName.value != null && activeName.value === 'second') {
-        queryParams.value.principal = useUserStore().user.userId;
+  /** 搜索按钮操作 */
+  function handleQuery() {
+    queryParams.value.pageNum = 1;
+    getList();
+  }
+  function aaa() {
+    demo().then(res => {
+
+    })
+  }
+  /** 重置按钮操作 */
+  function resetQuery() {
+    proxy.resetForm("queryRef");
+    queryParams.value.name = "";
+    queryParams.value.socialCreditCode = "";
+    queryParams.value.leaderName = "";
+    if (activeName.value != null && activeName.value === 'second') {
+      queryParams.value.principal = useUserStore().user.userId;
     }
-  handleQuery();
-}
+    handleQuery();
+  }
 
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  single.value = selection.length != 1;
-  multiple.value = !selection.length;
-}
-/** 是否为自己负责 */
-function handleOneself() {
-  if (oneself.value) {
-    queryParams.value.principal = useUserStore().user.userId;
-  } else {
-    queryParams.value.principal = null;
+  // 多选框选中数据
+  function handleSelectionChange(selection) {
+    ids.value = selection.map((item) => item.id);
+    single.value = selection.length != 1;
+    multiple.value = !selection.length;
   }
-  getList();
-}
-function checkPermission(templatePermission) {
+  /** 是否为自己负责 */
+  function handleOneself() {
+    if (oneself.value) {
+      queryParams.value.principal = useUserStore().user.userId;
+    } else {
+      queryParams.value.principal = null;
+    }
+    getList();
+  }
+  function checkPermission(templatePermission) {
     const all_permission = "*:*:*";
     const permissions = useUserStore().permissions;
     const hasPermissions = permissions.some((permission) => {
@@ -215,42 +218,42 @@ function checkPermission(templatePermission) {
       handleOneself()
     }
   }
-/** 新增按钮操作 */
-function handleAdd() {
-  proxy.$refs.companyRef.open();
-}
+  /** 新增按钮操作 */
+  function handleAdd() {
+    proxy.$refs.companyRef.open();
+  }
 
-/** 修改按钮操作 */
-function handleUpdate(row) {
-  const id = row.id || ids.value;
-  proxy.$refs.companyRef.open(id);
-}
+  /** 修改按钮操作 */
+  function handleUpdate(row) {
+    const id = row.id || ids.value;
+    proxy.$refs.companyRef.open(id);
+  }
 
-/** 删除按钮操作 */
-function handleDelete(row) {
-  const _ids = row.id || ids.value;
-  proxy.$modal
-    .confirm("是否确认删除选中的数据项?")
-    .then(function () {
-      return delCompany(_ids);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("删除成功!");
-    })
-    .catch(() => { });
-}
+  /** 删除按钮操作 */
+  function handleDelete(row) {
+    const _ids = row.id || ids.value;
+    proxy.$modal
+      .confirm("是否确认删除选中的数据项?")
+      .then(function () {
+        return delCompany(_ids);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功!");
+      })
+      .catch(() => { });
+  }
 
-/** 导出按钮操作 */
-function handleExport() {
-  proxy.download(
-    "business/company/export",
-    {
-      ...queryParams.value,
-    },
-    `company_${new Date().getTime()}.xlsx`
-  );
-}
+  /** 导出按钮操作 */
+  function handleExport() {
+    proxy.download(
+      "business/company/export",
+      {
+        ...queryParams.value,
+      },
+      `company_${new Date().getTime()}.xlsx`
+    );
+  }
 
-getList();
-</script>
+  getList();
+</script>

+ 10 - 4
src/views/business/production/receiveTicket/index.vue

@@ -57,7 +57,7 @@
       </el-form-item>
     </el-form>
     <div v-if="flag && flag2 && tenant.versionId !== '4'">
-      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" >
+      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
         <el-tab-pane label="全部" name="first">
         </el-tab-pane>
         <el-tab-pane label="我的" name="second">
@@ -86,7 +86,10 @@
           </div>
         </template>
       </el-table-column>
-      <el-table-column label="来源" align="center" prop="fromCompanyName" min-width="90" />
+      <el-table-column label="来源" align="center" prop="fromCompanyName" min-width="130"
+        v-if="tenant.versionId === '4'" />
+      <el-table-column label="受委托方" align="center" prop="toTenantName" min-width="130"
+        v-if="tenant.versionId !== '4'" />
       <el-table-column label="纳税性质" min-width="90" align="center" prop="taxType" />
       <el-table-column label="所属期" width="90" align="center">
         <template #default="scope">
@@ -246,7 +249,7 @@
   </div>
 </template>
 
-<script setup name="Company">
+<script setup name="Receive">
   import useUserStore from "@/store/modules/user";
 
   import {
@@ -404,7 +407,10 @@
   };
 
   /***********************  方法区  ****************************/
-
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
   function getOption() {
     listLableNoPage().then(res => {
       options.value = res.data

+ 10 - 4
src/views/business/production/receiveTicketFeedback/index.vue

@@ -43,7 +43,7 @@
       </el-form-item>
     </el-form>
     <div v-if="flag && flag2 && tenant.versionId !== '4'">
-      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" >
+      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
         <el-tab-pane label="全部" name="first">
         </el-tab-pane>
         <el-tab-pane label="我的" name="second">
@@ -61,7 +61,10 @@ label="序号"
 width="50"
 ></el-table-column> -->
       <el-table-column label="客户名称" prop="companyName" min-width="250" align="center" />
-      <el-table-column label="来源" min-width="90" align="center" prop="fromCompanyName" />
+      <el-table-column label="来源" align="center" prop="fromCompanyName" min-width="130"
+        v-if="tenant.versionId === '4'" />
+      <el-table-column label="受委托方" align="center" prop="toTenantName" min-width="130"
+        v-if="tenant.versionId !== '4'" />
       <el-table-column label="纳税性质" prop="taxType" align="center" min-width="90" />
       <el-table-column label="收票月份" prop="provinceCode" min-width="80" align="center">
         <template #default="scope">
@@ -137,7 +140,7 @@ width="50"
   </div>
 </template>
 
-<script setup name="Company">
+<script setup name="ReceiveTicketFeedback">
   // import contractForm from "./form";
   import {
     listReceiveTicketFeedback,
@@ -210,7 +213,10 @@ width="50"
   });
 
   /***********************  方法区  ****************************/
-
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
   /** 查询company列表 */
   function getList() {
     loading.value = true;

+ 9 - 3
src/views/business/production/salary/index.vue

@@ -88,7 +88,10 @@
           </div>
         </template>
       </el-table-column>
-      <el-table-column label="来源" align="center" min-width="80" prop="fromCompanyName" />
+      <el-table-column label="来源" align="center" prop="fromCompanyName" min-width="130"
+        v-if="tenant.versionId === '4'" />
+      <el-table-column label="受委托方" align="center" prop="toTenantName" min-width="130"
+        v-if="tenant.versionId !== '4'" />
       <el-table-column label="纳税性质" min-width="100" align="center" prop="taxType" />
 
       <el-table-column label="所属期" min-width="90" align="center">
@@ -212,7 +215,7 @@
   </div>
 </template>
 
-<script setup name="Company">
+<script setup name="Salary">
   import useUserStore from "@/store/modules/user";
   import { taxTypes } from "@/utils/default";
   import { listSalary, exportSalary } from "@/api/business/production/salary";
@@ -396,7 +399,10 @@
   };
 
   /***********************  方法区  ****************************/
-
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
   /** 查询company列表 */
   function getList() {
     loading.value = true;

+ 10 - 4
src/views/business/production/salaryZero/index.vue

@@ -93,8 +93,11 @@
           </div>
         </template>
       </el-table-column>
-      <el-table-column label="来源" align="center" prop="fromCompanyName" min-width="100" />
-      <el-table-column label="纳税性质" align="center" min-width="130" prop="taxType" />
+      <el-table-column label="来源" align="center" prop="fromCompanyName" min-width="130"
+        v-if="tenant.versionId === '4'" />
+      <el-table-column label="受委托方" align="center" prop="toTenantName" min-width="130"
+        v-if="tenant.versionId !== '4'" />
+      <el-table-column label="纳税性质" align="center" min-width="150" prop="taxType" />
 
       <el-table-column label="所属期" min-width="90" align="center">
         <template #default="scope">
@@ -205,7 +208,7 @@
   </div>
 </template>
 
-<script setup name="Company">
+<script setup name="SalaryZero">
   import useUserStore from "@/store/modules/user";
   import { taxTypes } from "@/utils/default";
   import { listSalary, exportSalary } from "@/api/business/production/salaryZero";
@@ -350,7 +353,10 @@
   const editStatus = {
     startMonth: false,
   };
-
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
   /***********************  方法区  ****************************/
   function getOption() {
     listLableNoPage().then(res => {

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 421 - 517
src/views/business/service/loop/index.vue


+ 1 - 1
src/views/business/service/once/index.vue

@@ -213,7 +213,7 @@
   </div>
 </template>
 
-<script setup name="Company">
+<script setup name="Once">
 import { listOnce, exportOnce } from "@/api/business/crm/serviceWorkOrder";
 import auth from "@/plugins/auth";
 import useUserStore from "@/store/modules/user";

+ 8 - 3
src/views/business/socialSecurity/confirm/index.vue

@@ -68,7 +68,9 @@
       @selection-change="handleSelectionChange">
       <!-- <el-table-column type="selection" width="55" align="center" /> -->
       <el-table-column label="客户名称" align="center" prop="companyName" min-width="250" />
-      <el-table-column label="来源" align="center" prop="fromCompanyName" width="100" />
+      <el-table-column label="来源" align="center" prop="fromCompanyName" v-if="tenant.versionId === '4'" />
+      <el-table-column label="受委托方" align="center" prop="toTenantName" min-width="130"
+        v-if="tenant.versionId !== '4'" />
       <el-table-column label="纳税性质" width="100" align="center" prop="taxType" />
       <el-table-column label="所属期" min-width="90" align="center">
         <template #default="scope">
@@ -179,7 +181,7 @@
   </div>
 </template>
 
-<script setup>
+<script setup name="SocialSecurityConfirm">
   import useUserStore from "@/store/modules/user";
   import {
     listSocialSecurityConfirm,
@@ -328,7 +330,10 @@
   };
 
   /***********************  方法区  ****************************/
-
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
   /** 查询company列表 */
   function getList() {
     loading.value = true;

+ 25 - 19
src/views/business/socialSecurity/declare/index.vue

@@ -17,12 +17,13 @@
     <!-- 搜索区 -->
     <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true" label-width="68px">
       <el-form-item label="客户名称:" prop="companyName">
-        <el-input v-model="queryParams.companyName"  size="small"  style="width: 130px" placeholder="请输入客户名称" clearable
+        <el-input v-model="queryParams.companyName" size="small" style="width: 130px" placeholder="请输入客户名称" clearable
           @keyup.enter="handleQuery" />
       </el-form-item>
       <el-form-item label="所属月:">
-        <el-date-picker v-model="currentMonth"  size="small"  type="month" style="width: 130px" format="YYYY年MM月" :clearable="false"
-          value-format="YYYY-MM-01" @change="currentMonthChange" :disabled-date="disabledDateHandler" />
+        <el-date-picker v-model="currentMonth" size="small" type="month" style="width: 130px" format="YYYY年MM月"
+          :clearable="false" value-format="YYYY-MM-01" @change="currentMonthChange"
+          :disabled-date="disabledDateHandler" />
       </el-form-item>
       <el-form-item label="状态:">
         <el-select v-model.trim="queryParams.status" prop="status" size="small" type="text" placeholder="状态"
@@ -44,25 +45,27 @@
         <el-switch v-model="oneself" @change="handleOneself" />
       </el-form-item> -->
       <el-form-item>
-        <el-button type="primary" icon="Search" @click="handleQuery"  size="small" >搜索</el-button>
-        <el-button icon="operation" @click="moreSearch = true"  size="small" >更多</el-button>
-        <el-button icon="Refresh" @click="resetQuery"  size="small" >重置</el-button>
+        <el-button type="primary" icon="Search" @click="handleQuery" size="small">搜索</el-button>
+        <el-button icon="operation" @click="moreSearch = true" size="small">更多</el-button>
+        <el-button icon="Refresh" @click="resetQuery" size="small">重置</el-button>
       </el-form-item>
     </el-form>
     <div v-if="flag && flag2 && tenant.versionId !== '4'">
-    <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" >
-      <el-tab-pane label="全部" name="first">
-      </el-tab-pane>
-      <el-tab-pane label="我的" name="second">
-      </el-tab-pane>
-    </el-tabs>
-  </div>
+      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
+        <el-tab-pane label="全部" name="first">
+        </el-tab-pane>
+        <el-tab-pane label="我的" name="second">
+        </el-tab-pane>
+      </el-tabs>
+    </div>
     <!-- 列表区 -->
     <el-table v-loading="loading" :data="orderList" size="small" border height="100%"
       @selection-change="handleSelectionChange">
       <!-- <el-table-column type="selection" width="55" align="center" /> -->
       <el-table-column label="客户名称" min-width="250" align="center" prop="companyName" />
-      <el-table-column label="来源" min-width="100" align="center" prop="fromCompanyName" />
+      <el-table-column label="来源" align="center" prop="fromCompanyName" v-if="tenant.versionId === '4'" />
+      <el-table-column label="受委托方" align="center" prop="toTenantName" min-width="130"
+        v-if="tenant.versionId !== '4'" />
       <el-table-column label="纳税性质" min-width="100" align="center" prop="taxType" />
       <el-table-column label="人员信息" min-width="60" align="center" prop="">
         <template #default="scope">
@@ -136,8 +139,7 @@
       </el-table-column>
       <el-table-column label="执行人" width="80" align="center" prop="serviceName" />
       <el-table-column label="审核人" align="center" prop="verifierName" min-width="100" />
-      <el-table-column label="审核时间" align="center" prop="verifierTime" min-width="100"
-        :show-overflow-tooltip="true" />
+      <el-table-column label="审核时间" align="center" prop="verifierTime" min-width="100" :show-overflow-tooltip="true" />
 
       <!-- <el-table-column label="操作" width="80" align="center" prop="">
         <template #default="scope">
@@ -155,7 +157,8 @@
     <member-dialog ref="memeberDialogRef" :get-list="getList" />
     <FileListDialog ref="fileListDialogRef" :get-list="getList" />
     <!-- 更多搜索弹窗 -->
-    <el-dialog title="更多搜索" v-model="moreSearch" width="620px" append-to-body size="small" draggable :close-on-click-modal = "false">
+    <el-dialog title="更多搜索" v-model="moreSearch" width="620px" append-to-body size="small" draggable
+      :close-on-click-modal="false">
       <el-form :model="queryParams" ref="queryRef" size="small" label-width="100">
         <el-row :gutter="20">
           <el-col :span="12">
@@ -197,7 +200,7 @@
   </div>
 </template>
 
-<script setup>
+<script setup name="SocialSecurityDeclare">
   import useUserStore from "@/store/modules/user";
   import {
     listSocialSecurityDeclare,
@@ -295,7 +298,10 @@
   });
 
   /***********************  方法区  ****************************/
-
+  onActivated(() => {
+    // 你的逻辑
+    getList();
+  });
   /** 查询company列表 */
   function getList() {
     loading.value = true;

+ 1 - 1
src/views/business/source/index.vue

@@ -73,7 +73,7 @@
   </div>
 </template>
 
-<script setup name="source">
+<script setup name="Source">
 import {
   listSource,
   delSource,

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác