Explorar o código

费控部分功能实现

cz hai 1 ano
pai
achega
72c5d34b14

+ 37 - 12
src/components/process/SF/Contract.vue

@@ -900,6 +900,11 @@ const formConfig = computed(() => {
       label: "客户付款方式",
       data: fundsPaymentMethod.value,
       itemWidth: 25,
+      fn: (val) => {
+        if (val.indexOf("bank") != -1) {
+          getaccountList(val);
+        }
+      },
     },
     // {
     //   type: "select",
@@ -941,7 +946,9 @@ const formConfig = computed(() => {
       fn: (val) => {
         changeShroffAccount(val);
       },
-      isShow: formData.data.paymentMethod == "bank1",
+      isShow:
+        formData.data.paymentMethod == "bank1" ||
+        formData.data.paymentMethod == "bank2",
     },
     {
       type: "input",
@@ -1341,6 +1348,24 @@ const rules = ref({
     { required: true, message: "请选择1688店铺名称", trigger: "change" },
   ],
 });
+
+const getaccountList = (val) => {
+  proxy
+    .post("/accountManagement/page", {
+      pageNum: 1,
+      pageSize: 999,
+      type: val == "bank1" ? "10" : "20",
+    })
+    .then((res) => {
+      accountList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.alias,
+          value: item.id,
+        };
+      });
+    });
+};
 const getDict = () => {
   proxy
     .post("/contractTemplate/page", {
@@ -1378,17 +1403,17 @@ const getDict = () => {
     });
   });
 
-  proxy
-    .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
-    .then((res) => {
-      accountList.value = res.rows.map((item) => {
-        return {
-          ...item,
-          label: item.alias,
-          value: item.id,
-        };
-      });
-    });
+  // proxy
+  //   .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
+  //   .then((res) => {
+  //     accountList.value = res.rows.map((item) => {
+  //       return {
+  //         ...item,
+  //         label: item.alias,
+  //         value: item.id,
+  //       };
+  //     });
+  //   });
 
   proxy
     .get("/tenantDept/list", {

+ 38 - 12
src/components/process/SF/ContractChange.vue

@@ -900,6 +900,11 @@ const formConfig = computed(() => {
       label: "客户付款方式",
       data: fundsPaymentMethod.value,
       itemWidth: 25,
+      fn: (val) => {
+        if (val.indexOf("bank") != -1) {
+          getaccountList(val);
+        }
+      },
     },
     // {
     //   type: "select",
@@ -941,7 +946,9 @@ const formConfig = computed(() => {
       fn: (val) => {
         changeShroffAccount(val);
       },
-      isShow: formData.data.paymentMethod == "bank1",
+      isShow:
+        formData.data.paymentMethod == "bank1" ||
+        formData.data.paymentMethod == "bank2",
     },
     {
       type: "input",
@@ -1341,6 +1348,24 @@ const rules = ref({
     { required: true, message: "请选择1688店铺名称", trigger: "change" },
   ],
 });
+
+const getaccountList = (val) => {
+  proxy
+    .post("/accountManagement/page", {
+      pageNum: 1,
+      pageSize: 999,
+      type: val == "bank1" ? "10" : "20",
+    })
+    .then((res) => {
+      accountList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.alias,
+          value: item.id,
+        };
+      });
+    });
+};
 const getDict = () => {
   proxy
     .post("/contractTemplate/page", {
@@ -1378,17 +1403,17 @@ const getDict = () => {
     });
   });
 
-  proxy
-    .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
-    .then((res) => {
-      accountList.value = res.rows.map((item) => {
-        return {
-          ...item,
-          label: item.alias,
-          value: item.id,
-        };
-      });
-    });
+  // proxy
+  //   .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
+  //   .then((res) => {
+  //     accountList.value = res.rows.map((item) => {
+  //       return {
+  //         ...item,
+  //         label: item.alias,
+  //         value: item.id,
+  //       };
+  //     });
+  //   });
 
   proxy
     .get("/tenantDept/list", {
@@ -1935,6 +1960,7 @@ const handleRemoveFile = (file, index) => {
     formData.data.contractProductList[index].prodFileList.splice(sonIndex, 1);
   }
 };
+
 const onPreviewFile = (file) => {
   if (file && file.fileUrl) {
     window.open(file.fileUrl, "_blank");

+ 288 - 109
src/components/process/SF/CostControl.vue

@@ -9,7 +9,7 @@
             <el-table-column prop="remark" label="收付款说明" min-width="200" v-if="isShowAtt('remark','detailObj')">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'costControlDetailList.' + $index + '.remark'" :rules="rules.remark" :inline-message="true" class="margin-b-0">
-                  <el-input v-model="row.remark" placeholder="请输入" type="textarea" />
+                  <el-input v-model="row.remark" placeholder="请输入" type="textarea" disabled />
                 </el-form-item>
               </template>
             </el-table-column>
@@ -30,12 +30,43 @@
                 </el-form-item>
               </template>
             </el-table-column>
+            <el-table-column prop="logisticsCompanyId" label="快递公司" width="150" v-if="isShowAtt('logisticsCompanyId','detailObj')">
+              <template #default="{ row, $index }">
+                <el-form-item :prop="'costControlDetailList.' + $index + '.logisticsCompanyId'" :rules="rules.logisticsCompanyId"
+                              :inline-message="true" class="margin-b-0">
+                  <el-select v-model="row.logisticsCompanyId" placeholder="请选择" style="width: 100%" filterable
+                             @change="(val)=>changeSelectData(val,$index,'1')">
+                    <el-option v-for="item in logisticsCompanyData" :key="item.value" :label="item.label" :value="item.value" />
+                  </el-select>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column prop="supplierId" label="供应商" width="150" v-if="isShowAtt('supplierId','detailObj')">
+              <template #default="{ row, $index }">
+                <el-form-item :prop="'costControlDetailList.' + $index + '.supplierId'" :rules="rules.supplierId" :inline-message="true"
+                              class="margin-b-0">
+                  <el-select v-model="row.supplierId" placeholder="请选择" style="width: 100%" filterable
+                             @change="(val)=>changeSelectData(val,$index,'3')">
+                    <el-option v-for="item in supplierList" :key="item.value" :label="item.label" :value="item.value" />
+                  </el-select>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column prop="invoiceTaxPoint" label="开票税点" width="100" v-if="isShowAtt('invoiceTaxPoint','detailObj')">
+              <template #default="{ row, $index }">
+                <el-form-item :prop="'costControlDetailList.' + $index + '.invoiceTaxPoint'" :rules="rules.invoiceTaxPoint" :inline-message="true"
+                              class="margin-b-0">
+                  <el-input-number onmousewheel="return false;" v-model="row.invoiceTaxPoint" placeholder="请输入" style="width: 100%" :precision="2"
+                                   :controls="false" :min="0" :max="100" disabled />
+                </el-form-item>
+              </template>
+            </el-table-column>
             <el-table-column prop="balancePrepaidTax" label="结存预付款(含税)" width="140" v-if="isShowAtt('balancePrepaidTax','detailObj')">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'costControlDetailList.' + $index + '.balancePrepaidTax'" :rules="rules.balancePrepaidTax" :inline-message="true"
                               class="margin-b-0">
                   <el-input-number onmousewheel="return false;" v-model="row.balancePrepaidTax" placeholder="请输入" style="width: 100%" :precision="2"
-                                   :controls="false" :min="0" />
+                                   :controls="false" :min="0" disabled />
                 </el-form-item>
               </template>
             </el-table-column>
@@ -44,7 +75,7 @@
                 <el-form-item :prop="'costControlDetailList.' + $index + '.balancePrepaid'" :rules="rules.balancePrepaid" :inline-message="true"
                               class="margin-b-0">
                   <el-input-number onmousewheel="return false;" v-model="row.balancePrepaid" placeholder="请输入" style="width: 100%" :precision="2"
-                                   :controls="false" :min="0" />
+                                   :controls="false" :min="0" disabled />
                 </el-form-item>
               </template>
             </el-table-column>
@@ -121,15 +152,6 @@
                 </el-form-item>
               </template>
             </el-table-column>
-            <el-table-column prop="invoiceTaxPoint" label="开票税点" width="140" v-if="isShowAtt('invoiceTaxPoint','detailObj')">
-              <template #default="{ row, $index }">
-                <el-form-item :prop="'costControlDetailList.' + $index + '.invoiceTaxPoint'" :rules="rules.invoiceTaxPoint" :inline-message="true"
-                              class="margin-b-0">
-                  <el-input-number onmousewheel="return false;" v-model="row.invoiceTaxPoint" placeholder="请输入" style="width: 100%" :precision="2"
-                                   :controls="false" :min="0" :max="100" />
-                </el-form-item>
-              </template>
-            </el-table-column>
             <el-table-column prop="taxation" label="税费" width="140" v-if="isShowAtt('taxation','detailObj')">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'costControlDetailList.' + $index + '.taxation'" :rules="rules.taxation" :inline-message="true"
@@ -139,7 +161,7 @@
                 </el-form-item>
               </template>
             </el-table-column>
-            <el-table-column prop="invoiceFileList" label="发票附件" width="140" v-if="isShowAtt('invoiceFileList','detailObj')">
+            <el-table-column prop="invoiceFileList" label="发票附件" width="200" v-if="isShowAtt('invoiceFileList','detailObj')">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'costControlDetailList.' + $index + '.invoiceFileList'" :rules="rules.invoiceFileList" :inline-message="true"
                               class="margin-b-0">
@@ -153,7 +175,7 @@
                 </el-form-item>
               </template>
             </el-table-column>
-            <el-table-column prop="fileList" label="非发票附件" width="140" v-if="isShowAtt('fileList','detailObj')">
+            <el-table-column prop="fileList" label="非发票附件" width="200" v-if="isShowAtt('fileList','detailObj')">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'costControlDetailList.' + $index + '.fileList'" :rules="rules.fileList" :inline-message="true"
                               class="margin-b-0">
@@ -166,7 +188,7 @@
                 </el-form-item>
               </template>
             </el-table-column>
-            <el-table-column prop="invoiceFileList" label="归还转账截图" width="140" v-if="isShowAtt('invoiceFileList','detailObj')">
+            <!-- <el-table-column prop="invoiceFileList" label="归还转账截图" width="140" v-if="isShowAtt('invoiceFileList','detailObj')">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'costControlDetailList.' + $index + '.invoiceFileList'" :rules="rules.invoiceFileList" :inline-message="true"
                               class="margin-b-0">
@@ -179,7 +201,7 @@
                   </el-upload>
                 </el-form-item>
               </template>
-            </el-table-column>
+            </el-table-column> -->
             <el-table-column prop="payeeAccountId" label="收款单位" width="150" v-if="isShowAtt('payeeAccountId','detailObj')">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'costControlDetailList.' + $index + '.payeeAccountId'" :rules="rules.payeeAccountId" :inline-message="true"
@@ -203,22 +225,13 @@
             <el-table-column prop="shopId" label="店铺名称" width="150" v-if="isShowAtt('shopId','detailObj')">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'costControlDetailList.' + $index + '.shopId'" :rules="rules.shopId" :inline-message="true" class="margin-b-0">
-                  <el-select v-model="row.shopId" placeholder="请选择" style="width: 100%" filterable>
+                  <el-select v-model="row.shopId" placeholder="请选择" style="width: 100%" filterable @change="(val)=>changeSelectData(val,$index,'2')">
                     <el-option v-for="item in shopList" :key="item.value" :label="item.label" :value="item.value" />
                   </el-select>
                 </el-form-item>
               </template>
             </el-table-column>
-            <el-table-column prop="supplierId" label="供应商" width="150" v-if="isShowAtt('supplierId','detailObj')">
-              <template #default="{ row, $index }">
-                <el-form-item :prop="'costControlDetailList.' + $index + '.supplierId'" :rules="rules.supplierId" :inline-message="true"
-                              class="margin-b-0">
-                  <el-select v-model="row.supplierId" placeholder="请选择" style="width: 100%" filterable>
-                    <el-option v-for="item in supplierList" :key="item.value" :label="item.label" :value="item.value" />
-                  </el-select>
-                </el-form-item>
-              </template>
-            </el-table-column>
+
             <el-table-column prop="costType" label="费用类型" width="150" v-if="isShowAtt('costType','detailObj')">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'costControlDetailList.' + $index + '.costType'" :rules="rules.costType" :inline-message="true"
@@ -229,24 +242,30 @@
                 </el-form-item>
               </template>
             </el-table-column>
-            <!-- <el-table-column prop="quantity" label="刷单时间/推广费类别" width="160">
+            <el-table-column label="刷单时间/推广费类别" width="160" v-if="isShowAtt('brushingTime','detailObj') || isShowAtt('promotionFeeType','detailObj')">
               <template #default="{ row, $index }">
-                <el-form-item :prop="'costControlDetailList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true" class="margin-b-0">
+                <el-form-item :prop="'costControlDetailList.' + $index + '.brushingTime'" :rules="rules.brushingTime" :inline-message="true"
+                              class="margin-b-0" v-if="row.costType=='1'">
+                  <el-date-picker v-model="row.brushingTime" type="date" placeholder="请选择" style="width: 100%" value-format="YYYY-MM-DD" />
+                </el-form-item>
+                <el-form-item :prop="'costControlDetailList.' + $index + '.promotionFeeType'" :rules="rules.promotionFeeType" :inline-message="true"
+                              class="margin-b-0" v-else-if="row.costType=='2'">
                   <el-select v-model="row.promotionFeeType" placeholder="请选择" style="width: 100%" filterable>
                     <el-option v-for="item in promotionFeeType" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
                   </el-select>
                 </el-form-item>
+                <div v-else>-</div>
               </template>
-            </el-table-column> -->
-            <el-table-column prop="brushingTime" label="刷单时间" width="150" v-if="isShowAtt('brushingTime','detailObj')">
+            </el-table-column>
+            <!-- <el-table-column prop="brushingTime" label="刷单时间" width="150" v-if="isShowAtt('brushingTime','detailObj')">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'costControlDetailList.' + $index + '.brushingTime'" :rules="rules.brushingTime" :inline-message="true"
                               class="margin-b-0">
                   <el-date-picker v-model="row.brushingTime" type="date" placeholder="请选择" style="width: 100%" value-format="YYYY-MM-DD" />
                 </el-form-item>
               </template>
-            </el-table-column>
-            <el-table-column prop="promotionFeeType" label="推广费类别" width="150" v-if="isShowAtt('promotionFeeType','detailObj')">
+            </el-table-column> -->
+            <!-- <el-table-column prop="promotionFeeType" label="推广费类别" width="150" v-if="isShowAtt('promotionFeeType','detailObj')">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'costControlDetailList.' + $index + '.promotionFeeType'" :rules="rules.promotionFeeType" :inline-message="true"
                               class="margin-b-0">
@@ -255,7 +274,7 @@
                   </el-select>
                 </el-form-item>
               </template>
-            </el-table-column>
+            </el-table-column> -->
             <!-- <el-table-column prop="currentPayable" label="本期应付(抵扣)" width="140" v-if="isShowAtt('currentPayable','detailObj')">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'costControlDetailList.' + $index + '.currentPayable'" :rules="rules.currentPayable" :inline-message="true"
@@ -424,6 +443,7 @@ const formData = reactive({
     invoiceFileList: [],
   },
 });
+
 const formDom = ref(null);
 const judgeStatus = () => {
   if (route.query.processType == 20 || route.query.processType == 10) {
@@ -479,7 +499,7 @@ const formConfig = computed(() => {
       itemWidth: 25,
       data: isAfterSubmit.value,
       isShow: isShowAtt("isAdvance", "mainObj"),
-      // disabled: true,
+      disabled: true,
     },
     {
       type: "date",
@@ -496,7 +516,7 @@ const formConfig = computed(() => {
       prop: "code",
       label: "流水号",
       itemType: "text",
-      disabled: false,
+      disabled: true,
       itemWidth: 25,
       isShow: isShowAtt("code", "mainObj"),
     },
@@ -517,19 +537,7 @@ const formConfig = computed(() => {
       itemWidth: 25,
       isShow: isShowAtt("invoiceTaxPoint", "mainObj"),
     },
-    {
-      type: "select",
-      prop: "applyUserId",
-      label: "申请人",
-      required: true,
-      filterable: true,
-      data: userList.value,
-      itemWidth: 25,
-      fn: (val) => {
-        changApplyUserId(val);
-      },
-      isShow: isShowAtt("applyUserId", "mainObj"),
-    },
+
     {
       type: "select",
       label: "是否后提交凭证",
@@ -549,6 +557,7 @@ const formConfig = computed(() => {
       fn: (val) => {
         getDeptData(val);
       },
+      disabled: true,
       isShow: isShowAtt("companyId", "mainObj"),
     },
     {
@@ -559,9 +568,24 @@ const formConfig = computed(() => {
       propsTreeLabel: "deptName",
       propsTreeValue: "deptId",
       itemWidth: 25,
+      disabled: true,
       isShow: isShowAtt("deptId", "mainObj"),
     },
     {
+      type: "select",
+      prop: "applyUserId",
+      label: "申请人",
+      required: true,
+      filterable: true,
+      data: userList.value,
+      itemWidth: 25,
+      fn: (val) => {
+        changApplyUserId(val);
+      },
+      // disabled: true,
+      isShow: isShowAtt("applyUserId", "mainObj"),
+    },
+    {
       type: "title",
       title: "收付款明细",
       haveLine: true,
@@ -573,15 +597,39 @@ const formConfig = computed(() => {
     },
     {
       type: "title",
-      title: "付款信息",
+      title: "付款信息",
       haveLine: true,
+      isShow:
+        isShowAtt("isPublicTransfer", "mainObj") ||
+        isShowAtt("paymentMethod", "mainObj"),
     },
     {
       type: "select",
-      label: "是否公转出",
+      label: "是否公转出",
       prop: "isPublicTransfer",
       itemWidth: 25,
       data: isAfterSubmit.value,
+      fn: (val) => {
+        formData.data.paymentAccountId = "";
+        formData.data.paymentAccountName = "";
+        formData.data.paymentAccountBank = "";
+        formData.data.paymentAccountNumber = "";
+        proxy
+          .post("/accountManagement/page", {
+            pageNum: 1,
+            pageSize: 999,
+            type: val == 1 ? "10" : "20",
+          })
+          .then((res) => {
+            accountList.value = res.rows.map((item) => {
+              return {
+                ...item,
+                label: item.alias,
+                value: item.id,
+              };
+            });
+          });
+      },
       isShow: isShowAtt("isPublicTransfer", "mainObj"),
     },
     {
@@ -591,19 +639,31 @@ const formConfig = computed(() => {
       itemWidth: 25,
       data: paymentMethod.value,
       isShow: isShowAtt("paymentMethod", "mainObj"),
+      fn: (val) => {
+        if (
+          val == 1 &&
+          formData.data.costControlDetailList &&
+          formData.data.costControlDetailList.length > 0
+        ) {
+          formData.data.shopName =
+            formData.data.costControlDetailList[0].labelName;
+        }
+      },
     },
     {
       type: "input",
-      prop: "openingBank",
+      prop: "shopName",
       label: "充值店铺名称",
       itemWidth: 25,
       disabled: true,
-      isShow: isShowAtt("status", "mainObj"),
+      isShow:
+        isShowAtt("paymentMethod", "mainObj") &&
+        formData.data.paymentMethod == "1",
     },
     {
       type: "select",
       prop: "paymentAccountId",
-      label: "公司户",
+      label: "公司户",
       data: accountList.value,
       itemWidth: 25,
       fn: (val) => {
@@ -613,11 +673,42 @@ const formConfig = computed(() => {
     },
     {
       type: "input",
+      prop: "paymentAccountBank",
+      label: "开户行",
+      placeholder: "请输入开户行",
+      itemWidth: 25,
+      isShow: isShowAtt("paymentAccountId", "mainObj"),
+    },
+    {
+      type: "input",
+      prop: "paymentAccountName",
+      label: "开户名",
+      placeholder: "请输入开户名",
+      itemWidth: 25,
+      isShow: isShowAtt("paymentAccountId", "mainObj"),
+    },
+    {
+      type: "input",
+      prop: "paymentAccountNumber",
+      label: "账号",
+      placeholder: "请输入账号",
+      itemWidth: 25,
+      isShow: isShowAtt("paymentAccountId", "mainObj"),
+    },
+    {
+      type: "title",
+      title: "收款信息",
+      haveLine: true,
+      isShow: getIsShowData("accountBank"),
+    },
+    {
+      type: "input",
       prop: "accountBank",
       label: "开户行",
       placeholder: "请输入开户行",
       itemWidth: 25,
-      isShow: isShowAtt("accountBank", "mainObj"),
+      // isShow:  isShowAtt("accountBank", "mainObj"),
+      isShow: getIsShowData("accountBank"),
     },
     {
       type: "input",
@@ -625,7 +716,8 @@ const formConfig = computed(() => {
       label: "开户名",
       placeholder: "请输入开户名",
       itemWidth: 25,
-      isShow: isShowAtt("accountName", "mainObj"),
+      // isShow: isShowAtt("accountName", "mainObj"),
+      isShow: getIsShowData("accountName"),
     },
     {
       type: "input",
@@ -633,7 +725,8 @@ const formConfig = computed(() => {
       label: "账号",
       placeholder: "请输入账号",
       itemWidth: 25,
-      isShow: isShowAtt("accountNumber", "mainObj"),
+      // isShow: isShowAtt("accountNumber", "mainObj"),
+      isShow: getIsShowData("accountNumber"),
     },
   ];
 });
@@ -642,10 +735,10 @@ const rules = ref({
   costType: [
     { required: true, message: "请选择收付款类型", trigger: "change" },
   ],
-  voucherNo: [{ required: true, message: "请输入记账凭证号", trigger: "blur" }],
+  // voucherNo: [{ required: true, message: "请输入记账凭证号", trigger: "blur" }],
   isAdvance: [{ required: true, message: "请选择是否预付", trigger: "change" }],
   applyTime: [{ required: true, message: "请选择申请日期", trigger: "change" }],
-  code: [{ required: true, message: "请输入流水号", trigger: "blur" }],
+  // code: [{ required: true, message: "请输入流水号", trigger: "blur" }],
   logisticsCompanyId: [
     { required: true, message: "请选择快递公司", trigger: "change" },
   ],
@@ -667,6 +760,15 @@ const rules = ref({
   accountBank: [{ required: true, message: "请输入开户行", trigger: "blur" }],
   accountName: [{ required: true, message: "请输入开户名", trigger: "blur" }],
   accountNumber: [{ required: true, message: "请输入账号", trigger: "blur" }],
+  paymentAccountBank: [
+    { required: true, message: "请输入开户行", trigger: "blur" },
+  ],
+  paymentAccountName: [
+    { required: true, message: "请输入开户名", trigger: "blur" },
+  ],
+  paymentAccountNumber: [
+    { required: true, message: "请输入账号", trigger: "blur" },
+  ],
 
   // 明细
   remark: [{ required: true, message: "请输入收付款说明", trigger: "blur" }],
@@ -674,12 +776,12 @@ const rules = ref({
   deductionMonth: [
     { required: true, message: "请选择抵扣工资月份", trigger: "change" },
   ],
-  balancePrepaidTax: [
-    { required: true, message: "请输入结存预付款(含税)", trigger: "blur" },
-  ],
-  balancePrepaid: [
-    { required: true, message: "请输入结存预付款(不含税)", trigger: "blur" },
-  ],
+  // balancePrepaidTax: [
+  //   { required: true, message: "请输入结存预付款(含税)", trigger: "blur" },
+  // ],
+  // balancePrepaid: [
+  //   { required: true, message: "请输入结存预付款(不含税)", trigger: "blur" },
+  // ],
   currentPrepaidTax: [
     { required: true, message: "请输入本期预付款(含税)", trigger: "blur" },
   ],
@@ -706,12 +808,12 @@ const rules = ref({
     { required: true, message: "请输入开票税点", trigger: "blur" },
   ],
   taxation: [{ required: true, message: "请输入税费", trigger: "blur" }],
-  invoiceFileList: [
-    { required: true, message: "请上传发票附件", trigger: "change" },
-  ],
-  fileList: [
-    { required: true, message: "请上传非发票附件", trigger: "change" },
-  ],
+  // invoiceFileList: [
+  //   { required: true, message: "请上传发票附件", trigger: "change" },
+  // ],
+  // fileList: [
+  //   { required: true, message: "请上传非发票附件", trigger: "change" },
+  // ],
   payeeAccountId: [
     { required: true, message: "请输入收款单位", trigger: "blur" },
   ],
@@ -750,18 +852,46 @@ const isShowAtt = (formAtt, att = "mainObj") => {
   }
 };
 
+const getIsShowData = (formAtt, att = "mainObj") => {
+  if (
+    currentCostTypeData.value &&
+    currentCostTypeData.value.name &&
+    currentCostTypeData.value.name.indexOf("店铺") != -1
+  ) {
+    if (
+      formData.data &&
+      formData.data.paymentMethod &&
+      formData.data.paymentMethod == "2"
+    ) {
+      return true;
+    }
+    return false;
+  } else {
+    return isShowAtt(formAtt, att);
+  }
+};
+
 const changeShroffAccount = (val) => {
   if (val) {
     let data = accountList.value.find((item) => item.value == val);
     if (data) {
-      formData.data.accountName = data.name;
-      formData.data.accountBank = data.openingBank;
-      formData.data.accountNumber = data.accountNumber;
+      formData.data.paymentAccountName = data.name;
+      formData.data.paymentAccountBank = data.openingBank;
+      formData.data.paymentAccountNumber = data.accountOpening;
     }
   }
 };
 
 const changApplyUserId = (val) => {
+  if (
+    !(
+      currentCostTypeData.value.name.indexOf("备用金") != -1 ||
+      currentCostTypeData.value.name.indexOf("借款") != -1 ||
+      currentCostTypeData.value.name.indexOf("采购") != -1
+    )
+  ) {
+    return;
+  }
   const current = userList.value.find((x) => x.value == val);
   if (current) {
     formData.data.accountBank = current.accountBank;
@@ -804,7 +934,9 @@ const getDeptData = (val) => {
 
 const changeCostType = (val) => {
   currentCostTypeData.value = paymentTypeData.value.find((x) => x.value == val);
-  console.log(currentCostTypeData.value, "sasa");
+  if (formData.data && formData.data.applyUserId) {
+    changApplyUserId(formData.data.applyUserId);
+  }
   formData.data.applyTime = moment().format("yyyy-MM-DD");
   formData.data.companyId = proxy.useUserStore().user.companyId;
   formData.data.deptId = proxy.useUserStore().user.dept.deptId;
@@ -813,7 +945,6 @@ const changeCostType = (val) => {
   formData.data.costControlDetailList = [];
   formData.data.fileList = [];
   formData.data.invoiceFileList = [];
-
   // formData.data = {
   //   applyTime: moment().format("yyyy-MM-DD"),
   //   companyId: proxy.useUserStore().user.companyId,
@@ -830,12 +961,48 @@ const changeCostType = (val) => {
     currentCostTypeData.value.name.indexOf("预付") != -1
   ) {
     formData.data.isAdvance = "1";
-    console.log("sasa");
   } else {
     formData.data.isAdvance = "0";
   }
 };
 
+const changeSelectData = (val, index, type) => {
+  // type 1:快递公司 2:店铺  3:供应商
+  let current = null;
+  switch (type) {
+    case "1":
+      current = logisticsCompanyData.value.find((x) => x.value == val);
+      if (current) {
+        formData.data.costControlDetailList[index].invoiceTaxPoint =
+          current.taxPoints;
+        formData.data.costControlDetailList[index].labelName = current.label;
+      }
+      break;
+    case "2":
+      current = shopList.value.find((x) => x.value == val);
+      if (current) {
+        formData.data.costControlDetailList[index].labelName = current.label;
+      }
+      break;
+    case "3":
+      current = supplierList.value.find((x) => x.value == val);
+      if (current) {
+        formData.data.costControlDetailList[index].invoiceTaxPoint =
+          current.privTaxPoints;
+        formData.data.costControlDetailList[index].labelName = current.label;
+      }
+      break;
+    default:
+      break;
+  }
+  if (current && ["1", "2"].includes(type)) {
+    formData.data.accountBank = current.accountBank;
+    formData.data.accountName = current.accountName;
+    formData.data.accountNumber = current.accountNumber;
+  }
+  handleGetRemark(index);
+};
+
 const getDict = () => {
   proxy
     .post("/accountSubjects/list", { pageNum: 1, pageSize: 999 })
@@ -859,7 +1026,7 @@ const getDict = () => {
   proxy.post("/paymentType/page", { pageNum: 1, pageSize: 999 }).then((res) => {
     paymentTypeData.value = res.rows.map((item) => {
       return {
-        // ...item,
+        ...item,
         name: item.name,
         label: item.name,
         value: item.id,
@@ -871,23 +1038,23 @@ const getDict = () => {
     }
   });
 
-  proxy
-    .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
-    .then((res) => {
-      accountList.value = res.rows.map((item) => {
-        return {
-          ...item,
-          label: item.alias,
-          value: item.id,
-        };
-      });
-    });
+  // proxy
+  //   .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
+  //   .then((res) => {
+  //     accountList.value = res.rows.map((item) => {
+  //       return {
+  //         ...item,
+  //         label: item.alias,
+  //         value: item.id,
+  //       };
+  //     });
+  //   });
 
   proxy.post("/shopInfo/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
     shopList.value = res.rows.map((item) => {
       return {
         ...item,
-        label: item.alias,
+        label: item.name,
         value: item.id,
       };
     });
@@ -927,9 +1094,9 @@ const getBtnDisabled = () => {
     return false;
   } else {
     if (
-      ["快递费充值(预付)", "快递费付款"].includes(
-        currentCostTypeData.value.name
-      )
+      currentCostTypeData.value &&
+      currentCostTypeData.value.name &&
+      currentCostTypeData.value.name.indexOf("快递") != -1
     ) {
       return true;
     } else {
@@ -942,23 +1109,31 @@ const handleGetRemark = (index) => {
   let row = formData.data.costControlDetailList[index];
   let money = 0;
   money = parseFloat(Number(row.currentPayable)).toFixed(2);
-  formData.data.costControlDetailList[
-    index
-  ].remark = `支付${row.applyRemark}${currentCostTypeData.value.name}${money}`;
+  // formData.data.costControlDetailList[
+  //   index
+  // ].remark = `支付${row.applyRemark}${currentCostTypeData.value.name}${money}`;
   formData.data.costControlDetailList[index].money = money;
-  // if (currentCostTypeData.value.name == "备用金申请") {
-  //   money = parseFloat(Number(row.currentPayable)).toFixed(2);
-  //   formData.data.costControlDetailList[
-  //     index
-  //   ].remark = `支付${row.applyRemark}备用金${money}`;
-  //   formData.data.costControlDetailList[index].money = money;
-  // } else if (currentCostTypeData.value.name == "个人借款") {
-  //   money = parseFloat(Number(row.currentPayable)).toFixed(2);
-  //   formData.data.costControlDetailList[
-  //     index
-  //   ].remark = `支付${row.applyRemark}个人借款${money}`;
-  //   formData.data.costControlDetailList[index].money = money;
-  // }
+  if (currentCostTypeData.value.name.indexOf("备用金") != -1) {
+    formData.data.costControlDetailList[
+      index
+    ].remark = `支付${row.applyRemark}备用金${money}`;
+  } else if (currentCostTypeData.value.name.indexOf("借款") != -1) {
+    formData.data.costControlDetailList[
+      index
+    ].remark = `支付${row.applyRemark}借款${money}`;
+  } else if (currentCostTypeData.value.name.indexOf("快递") != -1) {
+    formData.data.costControlDetailList[
+      index
+    ].remark = `支付${row.labelName}${currentCostTypeData.value.name}${money}`;
+  } else if (currentCostTypeData.value.name.indexOf("店铺") != -1) {
+    formData.data.costControlDetailList[
+      index
+    ].remark = `支付${row.labelName}${currentCostTypeData.value.name}${money}`;
+  } else if (currentCostTypeData.value.name.indexOf("采购") != -1) {
+    formData.data.costControlDetailList[
+      index
+    ].remark = `支付${row.labelName}供应商${currentCostTypeData.value.name}${money}`;
+  }
 };
 
 const clickAdd = () => {
@@ -993,6 +1168,8 @@ const clickAdd = () => {
       brushingTime: "",
       promotionFeeType: "",
       taxation: null,
+      fileList: [],
+      invoiceFileList: [],
     });
   } else {
     formData.data.costControlDetailList = [
@@ -1023,6 +1200,8 @@ const clickAdd = () => {
         brushingTime: "",
         promotionFeeType: "",
         taxation: null,
+        fileList: [],
+        invoiceFileList: [],
       },
     ];
   }