Эх сурвалжийг харах

费控完善,增加打款状态

cz 1 жил өмнө
parent
commit
ee0281714e

+ 1 - 0
src/components/byForm/index.vue

@@ -116,6 +116,7 @@
               <el-icon v-if="i.listType=='picture-card'">
                 <Plus />
               </el-icon>
+              <span v-else-if="formOption.disabled" style="color:#409EFF">已上传:</span>
               <el-button type="primary" plain v-else>点击上传</el-button>
             </el-upload>
           </div>

+ 46 - 60
src/components/process/SF/CostControl.vue

@@ -18,8 +18,8 @@
           <el-table :data="formData.data.contractOutboundInfoList" style="width: 100%;">
             <el-table-column prop="contractBelongType" label="订单归属" width="150"
                              :formatter="(row)=>dictKeyValue(row.contractBelongType,contractBelongTypeData)" />
-            <el-table-column prop="contractTaxTransportationWay" label="税运方式" width="150"
-                             :formatter="(row)=>dictKeyValue(row.contractTaxTransportationWay,contractTaxTransportationWay)" />
+            <!-- <el-table-column prop="contractTaxTransportationWay" label="税运方式" width="150"
+                             :formatter="(row)=>dictKeyValue(row.contractTaxTransportationWay,contractTaxTransportationWay)" /> -->
             <el-table-column prop="code" label="出货单号" width="150" />
             <el-table-column prop="sumQuantity" label="出货件数" width="150" />
             <el-table-column label="出货单图片">
@@ -299,30 +299,23 @@
                 <div v-else>-</div>
               </template>
             </el-table-column>
-            <!-- <el-table-column prop="currentPayable" label="本期应付(抵扣)" width="140" v-if="isShowAtt('currentPayable','detailObj')">
+            <el-table-column prop="currentPayableDeductionBefore" label="本期应付(抵扣前)" width="140"
+                             v-if="isShowAtt('currentPayableDeductionBefore','detailObj')">
               <template #default="{ row, $index }">
-                <el-form-item :prop="'costControlDetailList.' + $index + '.currentPayable'" :rules="rules.currentPayable" :inline-message="true"
-                              class="margin-b-0">
-                  <el-input-number onmousewheel="return false;" v-model="row.currentPayable" placeholder="请输入" style="width: 100%" :precision="2"
-                                   :controls="false" :min="0" />
+                <el-form-item :prop="'costControlDetailList.' + $index + '.currentPayableDeductionBefore'"
+                              :rules="rules.currentPayableDeductionBefore" :inline-message="true" class="margin-b-0">
+                  <el-input-number onmousewheel="return false;" v-model="row.currentPayableDeductionBefore" placeholder="请输入" style="width: 100%"
+                                   :precision="2" :controls="false" :min="0"
+                                   @change="(val)=>handleChangeMoney(val,$index,'currentPayableDeductionBefore')" />
                 </el-form-item>
               </template>
             </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"
-                              class="margin-b-0">
-                  <el-input-number onmousewheel="return false;" v-model="row.currentPayable" placeholder="请输入" style="width: 100%" :precision="2"
-                                   :controls="false" :min="0" />
-                </el-form-item>
-              </template>
-            </el-table-column> -->
             <el-table-column prop="currentPayableDeduction" label="本期应付(抵扣后)" width="140" v-if="isShowAtt('currentPayableDeduction','detailObj')">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'costControlDetailList.' + $index + '.currentPayableDeduction'" :rules="rules.currentPayableDeduction"
                               :inline-message="true" class="margin-b-0">
                   <el-input-number onmousewheel="return false;" v-model="row.currentPayableDeduction" placeholder="请输入" style="width: 100%"
-                                   :precision="2" :controls="false" :disabled="isDisabled" />
+                                   :precision="2" :controls="false" :disabled="getCurrentPayableDisabled" />
                 </el-form-item>
               </template>
             </el-table-column>
@@ -842,6 +835,19 @@ const formConfig = computed(() => {
         ) {
           formData.data.shopName =
             formData.data.costControlDetailList[0].businessName;
+        } else if (
+          val == 2 &&
+          formData.data.costControlDetailList &&
+          formData.data.costControlDetailList.length > 0
+        ) {
+          let current = shopList.value.find(
+            (x) => x.value == formData.data.costControlDetailList[0].shopId
+          );
+          if (current) {
+            formData.data.accountBank = current.accountBank;
+            formData.data.accountName = current.accountName;
+            formData.data.accountNumber = current.accountNumber;
+          }
         }
       },
     },
@@ -1405,15 +1411,7 @@ const changeIsPublicTransfer = (val) => {
       const row = formData.data.costControlDetailList[i];
       if (formData.data.isAdvance == "1") {
         row.currentPayable =
-          val == "1"
-            ? Number(
-                parseFloat(
-                  row.balancePrepaidTax - row.currentPrepaidTax
-                ).toFixed(2)
-              )
-            : Number(
-                parseFloat(row.balancePrepaid - row.currentPrepaid).toFixed(2)
-              );
+          val == "1" ? row.currentPrepaidTax : row.currentPrepaid;
       } else {
         row.currentPayable =
           val == "1"
@@ -1424,9 +1422,10 @@ const changeIsPublicTransfer = (val) => {
               )
             : Number(
                 parseFloat(
-                  row.accountPeriodAmountTax - row.deductionPrepaid
+                  row.accountPeriodAmount - row.deductionPrepaid
                 ).toFixed(2)
               );
+        row.currentPayable = row.currentPayable > 0 ? row.currentPayable : 0;
       }
       handleGetRemark(i);
     }
@@ -1438,26 +1437,24 @@ const changeIsPublicTransfer = (val) => {
       const row = formData.data.costControlDetailList[i];
       if (formData.data.isAdvance == "1") {
         row.currentPayable =
+          val == "1" ? row.currentPrepaidTax : row.currentPrepaid;
+      } else {
+        row.currentPayableDeduction =
           val == "1"
             ? Number(
                 parseFloat(
-                  row.balancePrepaidTax - row.currentPrepaidTax
+                  row.currentPayableDeductionBefore - row.deductionPrepaidTax
                 ).toFixed(2)
               )
             : Number(
-                parseFloat(row.balancePrepaid - row.currentPrepaid).toFixed(2)
-              );
-      } else {
-        row.currentPayable =
-          val == "1"
-            ? Number(
                 parseFloat(
-                  row.balancePrepaidTax - row.deductionPrepaidTax
+                  row.currentPayableDeductionBefore - row.deductionPrepaid
                 ).toFixed(2)
-              )
-            : Number(
-                parseFloat(row.balancePrepaid - row.deductionPrepaid).toFixed(2)
               );
+
+        row.currentPayableDeduction =
+          row.currentPayableDeduction > 0 ? row.currentPayableDeduction : 0;
+        row.currentPayable = row.currentPayableDeduction;
       }
       handleGetRemark(i);
     }
@@ -1466,7 +1463,7 @@ const changeIsPublicTransfer = (val) => {
 
 const handleChangeMoney = (val, index, att) => {
   let row = formData.data.costControlDetailList[index];
-  if (formData.data.isPublicTransfer) {
+  if (formData.data.isPublicTransfer != undefined) {
     // 快递费充值 应付取对应的含税和不含税
     if (currentCostTypeData.value.name.indexOf("快递费充值") != -1) {
       row.currentPayable =
@@ -1492,14 +1489,8 @@ const handleChangeMoney = (val, index, att) => {
       if (formData.data.isAdvance == "1") {
         row.currentPayable =
           formData.data.isPublicTransfer == "1"
-            ? Number(
-                parseFloat(
-                  row.balancePrepaidTax - row.currentPrepaidTax
-                ).toFixed(2)
-              )
-            : Number(
-                parseFloat(row.balancePrepaid - row.currentPrepaid).toFixed(2)
-              );
+            ? row.currentPrepaidTax
+            : row.currentPrepaid;
       } else {
         row.currentPayable =
           formData.data.isPublicTransfer == "1"
@@ -1510,7 +1501,7 @@ const handleChangeMoney = (val, index, att) => {
               )
             : Number(
                 parseFloat(
-                  row.accountPeriodAmountTax - row.deductionPrepaid
+                  row.accountPeriodAmount - row.deductionPrepaid
                 ).toFixed(2)
               );
       }
@@ -1523,25 +1514,20 @@ const handleChangeMoney = (val, index, att) => {
       if (formData.data.isAdvance == "1") {
         row.currentPayable =
           formData.data.isPublicTransfer == "1"
-            ? Number(
-                parseFloat(
-                  row.balancePrepaidTax - row.currentPrepaidTax
-                ).toFixed(2)
-              )
-            : Number(
-                parseFloat(row.balancePrepaid - row.currentPrepaid).toFixed(2)
-              );
-        row.currentPayable = row.currentPayable > 0 ? row.currentPayable : 0;
+            ? row.currentPrepaidTax
+            : row.currentPrepaid;
       } else {
         row.currentPayableDeduction =
           formData.data.isPublicTransfer == "1"
             ? Number(
                 parseFloat(
-                  row.balancePrepaidTax - row.deductionPrepaidTax
+                  row.currentPayableDeductionBefore - row.deductionPrepaidTax
                 ).toFixed(2)
               )
             : Number(
-                parseFloat(row.balancePrepaid - row.deductionPrepaid).toFixed(2)
+                parseFloat(
+                  row.currentPayableDeductionBefore - row.deductionPrepaid
+                ).toFixed(2)
               );
         row.currentPayableDeduction =
           row.currentPayableDeduction > 0 ? row.currentPayableDeduction : 0;
@@ -1630,7 +1616,7 @@ const changeSelectData = (val, index, type) => {
     default:
       break;
   }
-  if (current && ["1", "2", "4"].includes(type)) {
+  if (current && ["1", "2", "4"].includes(type) && index == 0) {
     formData.data.accountBank = current.accountBank;
     formData.data.accountName = current.accountName;
     formData.data.accountNumber = current.accountNumber;

+ 19 - 18
src/views/finance/fundManage/accountPayment/index.vue

@@ -445,20 +445,20 @@ const formConfig = computed(() => {
       disabled: true,
       itemWidth: 50,
     },
-    {
-      type: "input",
-      prop: "interbankNumber",
-      label: "联行号 / SWIFT Code",
-      disabled: true,
-      itemWidth: 50,
-    },
+    // {
+    //   type: "input",
+    //   prop: "interbankNumber",
+    //   label: "联行号 / SWIFT Code",
+    //   disabled: true,
+    //   itemWidth: 50,
+    // },
     {
       type: "input",
       prop: "paymentRemark",
       label: "摘要",
       disabled: true,
       itemType: "textarea",
-      itemWidth: 50,
+      itemWidth: 100,
     },
     {
       type: "title1",
@@ -470,23 +470,23 @@ const formConfig = computed(() => {
       label: "付款账户",
       required: true,
       data: accountList.value,
-      itemWidth: 50.1,
+      itemWidth: 50,
       style: {
         width: "100%",
       },
     },
-    {
-      type: "select",
-      label: "付款金额",
-      prop: "currency",
-      data: accountCurrency.value,
-      itemWidth: 50,
-      disabled: true,
-    },
+    // {
+    //   type: "select",
+    //   label: "付款金额",
+    //   prop: "currency",
+    //   data: accountCurrency.value,
+    //   itemWidth: 50,
+    //   disabled: true,
+    // },
     {
       type: "number",
       prop: "amount",
-      label: " ",
+      label: "付款金额",
       itemWidth: 50,
       precision: 2,
       min: 0,
@@ -611,6 +611,7 @@ const getList = async (req) => {
       }, 200);
     });
 };
+
 const paymentType = ref([
   {
     label: "已打款",

+ 192 - 121
src/views/finance/fundManage/costControl/index.vue

@@ -13,46 +13,24 @@
             <span class="el-click" @click="handleClickCode(item)">{{item.code}}</span>
           </div>
         </template>
-      </byTable>
-    </div>
-
-    <el-dialog :title="modalType == 'add' ? '添加账户' : '编辑账户'" v-if="dialogVisible" v-model="dialogVisible" width="60%">
-      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit" v-loading="loadingDialog">
-        <template #balance>
+        <template #accountPaymentStatus="{item}">
           <div style="width: 100%">
-            <el-button type="primary" @click="clickBalance">添加</el-button>
-            <el-table :data="formData.data.accountRemainderList" style="width: 100%; margin-top: 16px">
-              <el-table-column label="币种">
-                <template #default="{ row, $index }">
-                  <el-form-item :prop="'accountRemainderList.' + $index + '.currency'" :rules="rules.currency" :inline-message="true"
-                                class="margin-b-0 wid100">
-                    <el-select v-model="row.currency" placeholder="请选择币种" style="width: 100%" :disabled="row.id">
-                      <el-option v-for="item in accountCurrency" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
-                    </el-select>
-                  </el-form-item>
-                </template>
-              </el-table-column>
-              <el-table-column label="余额">
-                <template #default="{ row, $index }">
-                  <el-form-item :prop="'accountRemainderList.' + $index + '.remainder'" :rules="rules.remainder" :inline-message="true"
-                                class="margin-b-0 wid100">
-                    <el-input-number onmousewheel="return false;" v-model="row.remainder" placeholder="请输入余额" style="width: 100%" :precision="2"
-                                     :controls="false" :min="0" :disabled="row.id" />
-                  </el-form-item>
-                </template>
-              </el-table-column>
-              <el-table-column label="操作" width="80">
-                <template #default="{ row, $index }">
-                  <el-button type="primary" link @click="handleRemove($index)" v-if="!row.id">删除</el-button>
-                </template>
-              </el-table-column>
-            </el-table>
+            <span :class="{'el-click':item.accountPaymentStatus <20}"
+                  @click="getDtl(item)">{{dictValueLabel(item.accountPaymentStatus ,paymentType)}}</span>
           </div>
         </template>
+      </byTable>
+    </div>
+
+    <el-dialog title="打款" v-if="dialogVisible" v-model="dialogVisible" width="50%" v-loading="loading">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
+
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="default">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" size="default">确 定</el-button>
+        <!-- <el-button type="primary" @click="submitForm()" size="default" :loading="submitLoading" v-show="submitType === 'add'">
+          确 定
+        </el-button> -->
       </template>
     </el-dialog>
   </div>
@@ -67,6 +45,10 @@ import { ElMessage, ElMessageBox } from "element-plus";
 import $bus from "@/bus/index.js";
 
 const { proxy } = getCurrentInstance();
+const fundsPaymentMethod = computed(
+  () => proxy.useUserStore().allDict["funds_payment_method"]
+);
+const accountList = ref([]);
 const accountCurrency = ref([]);
 const sourceList = ref({
   data: [],
@@ -116,6 +98,20 @@ const statusData = ref([
     value: 99,
   },
 ]);
+const paymentType = ref([
+  {
+    label: "已打款",
+    value: 10,
+  },
+  {
+    label: "部分打款",
+    value: 15,
+  },
+  {
+    label: "未打款",
+    value: 20,
+  },
+]);
 const selectConfig = computed(() => {
   return [
     {
@@ -128,6 +124,11 @@ const selectConfig = computed(() => {
       prop: "status",
       data: statusData.value,
     },
+    {
+      label: "打款状态",
+      prop: "accountPaymentStatus",
+      data: paymentType.value,
+    },
   ];
 });
 
@@ -137,7 +138,7 @@ const config = computed(() => {
       attrs: {
         label: "费用类型",
         prop: "costTypeName",
-        width: 130,
+        width: 150,
         fixed: "left",
       },
     },
@@ -156,7 +157,7 @@ const config = computed(() => {
       attrs: {
         label: "记账凭证号",
         prop: "voucherNo",
-        width: 110,
+        width: 130,
       },
     },
     {
@@ -249,6 +250,15 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "打款状态",
+        prop: "accountPaymentStatus",
+        slot: "accountPaymentStatus",
+        width: 100,
+        fixed: "right",
+      },
+    },
+    {
+      attrs: {
         label: "操作",
         width: "120",
         align: "center",
@@ -363,123 +373,125 @@ const formConfig = computed(() => {
   return [
     {
       type: "title1",
-      title: "基本信息",
+      title: "请款信息",
     },
     {
-      type: "select",
-      prop: "corporationId",
-      label: "企业信息",
-      data: corporationList.value,
-      itemWidth: 50,
-    },
-    {
-      type: "select",
-      prop: "type",
-      label: "类型",
-      data: typeData.value,
+      type: "input",
+      prop: "businessManagementName",
+      label: "付款账户",
+      disabled: true,
       itemWidth: 50,
     },
     {
       type: "input",
-      prop: "alias",
-      label: "账户别名",
-      required: true,
+      prop: "incomeAmount",
+      label: "请款金额",
+      disabled: true,
       itemWidth: 50,
-      itemType: "text",
     },
     {
-      type: "input",
-      prop: "openingBank",
-      label: "开户银行",
-      required: true,
+      type: "select",
+      prop: "paymentMethod",
+      label: "付款方式",
+      disabled: true,
+      data: fundsPaymentMethod.value,
       itemWidth: 50,
-      itemType: "text",
     },
     {
       type: "input",
       prop: "name",
-      label: "户名",
-      required: true,
+      label: "户名",
+      disabled: true,
       itemWidth: 50,
-      itemType: "text",
     },
     {
       type: "input",
       prop: "accountOpening",
-      label: "账号",
-      required: true,
+      label: "银行账号",
+      disabled: true,
       itemWidth: 50,
-      itemType: "text",
     },
     {
       type: "input",
-      prop: "interbankNumber",
-      label: "联行号",
-      required: true,
+      prop: "openingBank",
+      label: "开户银行",
+      disabled: true,
       itemWidth: 50,
-      itemType: "text",
     },
     // {
-    //   type: "title1",
-    //   title: "外汇信息",
-    // },
-    // {
-    //   type: "input",
-    //   prop: "beneficiaryName",
-    //   label: "Beneficiary Name",
-    //   required: true,
-    //   itemType: "text",
-    //   itemWidth: 50,
-    // },
-    // {
-    //   type: "input",
-    //   prop: "beneficiaryBank",
-    //   label: "Beneficiary Bank",
-    //   required: true,
-    //   itemType: "text",
-    //   itemWidth: 50,
-    // },
-    // {
-    //   type: "input",
-    //   prop: "beneficiaryBankAddress",
-    //   label: "Beneficiary Bank Address",
-    //   required: true,
-    //   itemType: "text",
-    //   itemWidth: 50,
-    // },
-    // {
     //   type: "input",
-    //   prop: "beneficiaryAccountNumber",
-    //   label: "Beneficiary Account Number",
-    //   required: true,
-    //   itemType: "text",
-    //   itemWidth: 50,
-    // },
-    // {
-    //   type: "input",
-    //   prop: "swiftCode",
-    //   label: "Swift Code",
-    //   required: true,
-    //   itemType: "text",
+    //   prop: "interbankNumber",
+    //   label: "联行号 / SWIFT Code",
+    //   disabled: true,
     //   itemWidth: 50,
     // },
+    {
+      type: "input",
+      prop: "paymentRemark",
+      label: "摘要",
+      disabled: true,
+      itemType: "textarea",
+      itemWidth: 100,
+    },
+    {
+      type: "title1",
+      title: "付款信息",
+    },
+    {
+      type: "select",
+      prop: "accountManagementId",
+      label: "付款账户",
+      required: true,
+      data: accountList.value,
+      itemWidth: 50,
+      style: {
+        width: "100%",
+      },
+    },
     // {
-    //   type: "input",
-    //   prop: "beneficiaryAddress",
-    //   label: "Beneficiary Address",
-    //   required: true,
-    //   itemType: "text",
+    //   type: "select",
+    //   label: "付款金额",
+    //   prop: "currency",
+    //   data: accountCurrency.value,
     //   itemWidth: 50,
+    //   disabled: true,
     // },
-    // {
-    //   type: "title1",
-    //   title: "账户余额",
-    // },
-    // {
-    //   type: "slot",
-    //   slotName: "balance",
-    //   label: "账户余额",
-    // },
+    {
+      type: "number",
+      prop: "amount",
+      label: "付款金额",
+      itemWidth: 50,
+      precision: 2,
+      min: 0,
+      controls: false,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "date",
+      itemType: "datetime",
+      prop: "expensesTime",
+      label: "打款时间",
+      format: "YYYY-MM-DD HH:mm:ss",
+      itemWidth: 50,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "input",
+      prop: "remark",
+      label: "摘要",
+      itemType: "textarea",
+    },
+    {
+      type: "upload",
+      label: "上传附件",
+      listType: "text",
+      accept: "",
+      prop: "fileList",
+    },
   ];
 });
 const rules = ref({
@@ -621,6 +633,65 @@ onBeforeUnmount(() => {
   // 取消订阅特定事件
   $bus.off("refreshTableData");
 });
+
+const getDict = () => {
+  proxy
+    .post("/accountManagement/page", { pageNum: 1, pageSize: 9999 })
+    .then((res) => {
+      if (res.rows && res.rows.length > 0) {
+        accountList.value = res.rows.map((item) => {
+          return {
+            label: item.alias + " (" + item.name + ")",
+            value: item.id,
+          };
+        });
+      }
+    });
+};
+getDict();
+
+const getDtl = (row) => {
+  formOption.disabled = true;
+  proxy
+    .post("/accountPayment/detail", { id: row.accountPaymentId })
+    .then((res) => {
+      formData.data = res;
+      formData.data.fileList = [];
+      formData.data.expensesTime = formData.data.updateTime;
+      let ids = [];
+      if (
+        res.accountPaymentRecordsList &&
+        res.accountPaymentRecordsList.length > 0
+      ) {
+        ids = res.accountPaymentRecordsList.map((x) => x.id);
+      }
+      proxy
+        .post("/fileInfo/getList", { businessIdList: [row.id, ...ids] })
+        .then((fileObj) => {
+          if (fileObj) {
+            let arr = [];
+            for (const key in fileObj) {
+              if (fileObj[key]) {
+                arr = [...arr, ...fileObj[key]];
+              }
+            }
+            formData.data.fileList = arr;
+            if (formData.data.fileList && formData.data.fileList.length > 0) {
+              formData.data.fileList = formData.data.fileList.map((item) => {
+                return {
+                  raw: item,
+                  name: item.fileName,
+                  url: item.fileUrl,
+                };
+              });
+            } else {
+              formData.data.fileList = [];
+            }
+          }
+        });
+      dialogVisible.value = true;
+    });
+};
 </script>
 
 <style lang="scss" scoped>

+ 2 - 1
src/views/systemTenant/tenant/deptTenant/index.vue

@@ -10,7 +10,8 @@
     </byTable>
     <div style="padding: 0 20px 20px 20px; background-color: white">
       <el-table v-loading="loading" :data="sourceList.data" row-key="deptId" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
-                default-expand-all>
+                :expand-row-keys="['100']">
+        <!-- default-expand-all -->
         <el-table-column prop="deptName" label="机构名称" min-width="260" />
         <el-table-column prop="type" label="机构类型" width="100">
           <template #default="{ row }">