asd26269546 1 ano atrás
pai
commit
88018d5cbc
1 arquivos alterados com 246 adições e 126 exclusões
  1. 246 126
      src/views/finance/fundManage/accountPayment/index.vue

+ 246 - 126
src/views/finance/fundManage/accountPayment/index.vue

@@ -13,7 +13,8 @@
         }"
         :action-list="[]"
         @moreSearch="moreSearch"
-        @get-list="getList">
+        @get-list="getList"
+      >
         <template #amount="{ item }">
           <div style="width: 100%">
             <span>{{ item.currency }} {{ item.amount }}</span>
@@ -21,8 +22,20 @@
         </template>
       </byTable>
     </div>
-    <el-dialog title="打款" v-if="dialogVisible" v-model="dialogVisible" width="500" v-loading="loading">
-      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
+    <el-dialog
+      title="打款"
+      v-if="dialogVisible"
+      v-model="dialogVisible"
+      width="500"
+      v-loading="loading"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
         <template #fileSlot>
           <div style="width: 100%">
             <el-upload
@@ -31,14 +44,18 @@
               :data="uploadData"
               multiple
               :before-upload="uploadFile"
-              :on-preview="onPreviewFile">
+              :on-preview="onPreviewFile"
+            >
               <el-button type="primary">文件上传</el-button>
             </el-upload>
           </div>
         </template>
         <template #isTransaction>
           <div style="width: 100%">
-            <el-radio-group v-model="formData.data.isTransaction" @change="changeIsTransaction">
+            <el-radio-group
+              v-model="formData.data.isTransaction"
+              @change="changeIsTransaction"
+            >
               <el-radio label="1" border>是</el-radio>
               <el-radio label="0" border>否</el-radio>
             </el-radio-group>
@@ -46,20 +63,49 @@
         </template>
         <template #transactionDeptId>
           <div style="width: 100%">
-            <el-select v-model="formData.data.transactionDeptId" placeholder="请选择往来单位" style="width: 100%" clearable @change="changeTransactionDept">
-              <el-option v-for="item in departmentList" :key="item.value" :label="item.label" :value="item.value" />
+            <el-select
+              v-model="formData.data.transactionDeptId"
+              placeholder="请选择往来单位"
+              style="width: 100%"
+              clearable
+              @change="changeTransactionDept"
+            >
+              <el-option
+                v-for="item in departmentList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              />
             </el-select>
           </div>
         </template>
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" v-if="!formOption.disabled" size="large" :loading="submitLoading"> 确 定 </el-button>
+        <el-button
+          type="primary"
+          @click="submitForm()"
+          v-if="!formOption.disabled"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
       </template>
     </el-dialog>
 
-    <el-dialog title="高级检索" v-if="openSearch" v-model="openSearch" width="600" :before-close="cancelSearch">
-      <byForm :formConfig="formSearchConfig" :formOption="formOptionTwo" v-model="sourceList.pagination">
+    <el-dialog
+      title="高级检索"
+      v-if="openSearch"
+      v-model="openSearch"
+      width="600"
+      :before-close="cancelSearch"
+    >
+      <byForm
+        :formConfig="formSearchConfig"
+        :formOption="formOptionTwo"
+        v-model="sourceList.pagination"
+      >
         <template #departmentId>
           <div>
             <el-tree-select
@@ -70,7 +116,8 @@
               node-key="deptId"
               style="width: 100%"
               :props="defaultProps"
-              clearable />
+              clearable
+            />
           </div>
         </template>
         <template #time>
@@ -82,7 +129,8 @@
                   type="datetime"
                   placeholder="请选择"
                   style="width: 100%"
-                  value-format="YYYY-MM-DD HH:mm:ss" />
+                  value-format="YYYY-MM-DD HH:mm:ss"
+                />
               </el-col>
               <el-col :span="2" style="text-align: center">到</el-col>
               <el-col :span="11">
@@ -91,7 +139,8 @@
                   type="datetime"
                   placeholder="请选择"
                   style="width: 100%"
-                  value-format="YYYY-MM-DD HH:mm:ss" />
+                  value-format="YYYY-MM-DD HH:mm:ss"
+                />
               </el-col>
             </el-row>
           </div>
@@ -105,7 +154,8 @@
                   type="datetime"
                   placeholder="请选择"
                   style="width: 100%"
-                  value-format="YYYY-MM-DD HH:mm:ss" />
+                  value-format="YYYY-MM-DD HH:mm:ss"
+                />
               </el-col>
               <el-col :span="2" style="text-align: center">到</el-col>
               <el-col :span="11">
@@ -114,7 +164,8 @@
                   type="datetime"
                   placeholder="请选择"
                   style="width: 100%"
-                  value-format="YYYY-MM-DD HH:mm:ss" />
+                  value-format="YYYY-MM-DD HH:mm:ss"
+                />
               </el-col>
             </el-row>
           </div>
@@ -130,7 +181,8 @@
                   style="width: 100%"
                   :precision="2"
                   :controls="false"
-                  :min="0" />
+                  :min="0"
+                />
               </el-col>
               <el-col :span="2" style="text-align: center">到</el-col>
               <el-col :span="11">
@@ -141,7 +193,8 @@
                   style="width: 100%"
                   :precision="2"
                   :controls="false"
-                  :min="0" />
+                  :min="0"
+                />
               </el-col>
             </el-row>
           </div>
@@ -149,7 +202,9 @@
       </byForm>
       <template #footer>
         <el-button @click="cancelSearch()" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitSearch()" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitSearch()" size="large"
+          >确 定</el-button
+        >
       </template>
     </el-dialog>
 
@@ -161,26 +216,48 @@
       <template #footer>
         <el-button @click="openPrint = false" size="large">取消</el-button>
         <el-button v-print="printObj" size="large">打印</el-button>
-        <el-button type="primary" @click="clickDownload()" size="large">下载PDF</el-button>
+        <el-button type="primary" @click="clickDownload()" size="large"
+          >下载PDF</el-button
+        >
       </template>
     </el-dialog>
 
-    <el-dialog title="冲销" v-if="openCancelledOut" v-model="openCancelledOut" width="500">
+    <el-dialog
+      title="冲销"
+      v-if="openCancelledOut"
+      v-model="openCancelledOut"
+      width="500"
+    >
       <byForm
         :formConfig="formCancelledOutConfig"
         :formOption="formOptionTwo"
         v-model="formCancelledOutData.data"
         :rules="rulesCancelledOut"
-        ref="cancelledOut">
+        ref="cancelledOut"
+      >
         <template #detail>
           <div style="width: 100%">
-            <el-button type="primary" style="margin-left: -15px" @click="clickDetail" text>查看详情</el-button>
+            <el-button
+              type="primary"
+              style="margin-left: -15px"
+              @click="clickDetail"
+              text
+              >查看详情</el-button
+            >
           </div>
         </template>
       </byForm>
       <template #footer>
-        <el-button @click="openCancelledOut = false" size="large">取 消</el-button>
-        <el-button type="danger" @click="submitCancelledOutForm()" size="large" :loading="submitCancelledOutLoading">冲 销</el-button>
+        <el-button @click="openCancelledOut = false" size="large"
+          >取 消</el-button
+        >
+        <el-button
+          type="danger"
+          @click="submitCancelledOutForm()"
+          size="large"
+          :loading="submitCancelledOutLoading"
+          >冲 销</el-button
+        >
       </template>
     </el-dialog>
   </div>
@@ -221,11 +298,15 @@ const sourceList = ref({
   },
 });
 let dialogVisible = ref(false);
+const submitType = ref("add");
 let rules = ref({
-  productClassifyId: [{ required: true, message: "请选择物料分类", trigger: "change" }],
-  type: [{ required: true, message: "请选择物料类型", trigger: "change" }],
-  isTransaction: [{ required: true, message: "请选择是否往来", trigger: "change" }],
-  transactionDeptId: [{ required: true, message: "请选择往来单位", trigger: "change" }],
+  isTransaction: [
+    { required: true, message: "请选择是否往来", trigger: "change" },
+  ],
+  transactionDeptId: [
+    { required: true, message: "请选择往来单位", trigger: "change" },
+  ],
+  amount: [{ required: true, message: "请输入付款金额", trigger: "blur" }],
 });
 const accountCurrency = ref([]);
 const accountList = ref([]);
@@ -330,7 +411,7 @@ const config = computed(() => {
       },
       renderHTML(row) {
         return [
-          row.status == "20"
+          row.status != "10"
             ? {
                 attrs: {
                   label: "打款",
@@ -340,6 +421,7 @@ const config = computed(() => {
                 el: "button",
                 click() {
                   formOption.disabled = false;
+                  submitType.value = "add";
                   getDtl(row);
                 },
               }
@@ -351,11 +433,15 @@ const config = computed(() => {
                 },
                 el: "button",
                 click(item) {
-                  ElMessageBox.confirm("冲销后,已生成的资金流水数据会被删除,且关联的数据状态会由“已打款”退回至“未打款”,并支持重新打款。是否继续?", "提示", {
-                    confirmButtonText: "继续",
-                    cancelButtonText: "取消",
-                    type: "warning",
-                  })
+                  ElMessageBox.confirm(
+                    "冲销后,已生成的资金流水数据会被删除,且关联的数据状态会由“已打款”退回至“未打款”,并支持重新打款。是否继续?",
+                    "提示",
+                    {
+                      confirmButtonText: "继续",
+                      cancelButtonText: "取消",
+                      type: "warning",
+                    }
+                  )
                     .then(() => {
                       rowData.value = item;
                       formCancelledOutData.data = {
@@ -387,6 +473,7 @@ const config = computed(() => {
             el: "button",
             click() {
               formOption.disabled = true;
+              submitType.value = "edit";
               getDtl(row);
             },
           },
@@ -416,7 +503,6 @@ const formOptionTwo = reactive({
   disabled: false,
 });
 const byform = ref(null);
-const treeListData = ref([]);
 const formConfig = computed(() => {
   return [
     {
@@ -483,24 +569,41 @@ const formConfig = computed(() => {
       label: "付款账户",
       required: true,
       data: accountList.value,
+      itemWidth: 50.1,
+      style: {
+        width: "100%",
+      },
     },
     {
-      type: "selectInput",
+      type: "select",
       label: "付款金额",
-      itemWidth: 60,
-      prop: "amount",
+      prop: "currency",
       data: accountCurrency.value,
-      placeholder: "请输入",
-      selectPlaceholder: "币种",
-      selectProp: "currency",
+      itemWidth: 50,
       disabled: true,
     },
     {
+      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%",
+      },
     },
     formData.data.type != "20"
       ? {
@@ -557,46 +660,52 @@ const recursive = (data) => {
   });
 };
 const getDict = () => {
-  proxy.getDict(["account_currency", "founds_type", "funds_payment_method"]).then((res) => {
-    accountCurrency.value = res.account_currency.map((item) => {
-      return {
-        label: item.dictValue,
-        value: item.dictKey,
-      };
-    });
-    fundsType.value = res.founds_type.map((item) => {
-      return {
-        label: item.dictValue,
-        value: item.dictKey,
-      };
-    });
-    fundsPaymentMethod.value = res.funds_payment_method.map((item) => {
-      return {
-        label: item.dictValue,
-        value: item.dictKey,
-      };
-    });
-  });
-  proxy.post("/accountManagement/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
-    if (res.rows && res.rows.length > 0) {
-      accountList.value = res.rows.map((item) => {
+  proxy
+    .getDict(["account_currency", "founds_type", "funds_payment_method"])
+    .then((res) => {
+      accountCurrency.value = res.account_currency.map((item) => {
         return {
-          label: item.alias + " (" + item.name + ")",
-          value: item.id,
+          label: item.dictValue,
+          value: item.dictKey,
         };
       });
-    }
-  });
-  proxy.post("/corporation/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
-    if (res.rows && res.rows.length > 0) {
-      companyData.value = res.rows.map((item) => {
+      fundsType.value = res.founds_type.map((item) => {
         return {
-          label: item.name,
-          value: item.id,
+          label: item.dictValue,
+          value: item.dictKey,
         };
       });
-    }
-  });
+      fundsPaymentMethod.value = res.funds_payment_method.map((item) => {
+        return {
+          label: item.dictValue,
+          value: item.dictKey,
+        };
+      });
+    });
+  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,
+          };
+        });
+      }
+    });
+  proxy
+    .post("/corporation/page", { pageNum: 1, pageSize: 9999 })
+    .then((res) => {
+      if (res.rows && res.rows.length > 0) {
+        companyData.value = res.rows.map((item) => {
+          return {
+            label: item.name,
+            value: item.id,
+          };
+        });
+      }
+    });
   proxy
     .get("/tenantDept/list", {
       pageNum: 1,
@@ -632,31 +741,35 @@ const getDict = () => {
         });
       }
     });
-  proxy.get("/transactionDepartment/list", { pageNum: 1, pageSize: 999 }).then((res) => {
-    if (res.data && res.data.length > 0) {
-      departmentList.value = res.data.map((item) => {
-        return {
-          ...item,
-          label: item.name,
-          value: item.id,
-        };
-      });
-    } else {
-      departmentList.value = [];
-    }
-  });
+  proxy
+    .get("/transactionDepartment/list", { pageNum: 1, pageSize: 999 })
+    .then((res) => {
+      if (res.data && res.data.length > 0) {
+        departmentList.value = res.data.map((item) => {
+          return {
+            ...item,
+            label: item.name,
+            value: item.id,
+          };
+        });
+      } else {
+        departmentList.value = [];
+      }
+    });
 };
 getDict();
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/accountPayment/page", sourceList.value.pagination).then((message) => {
-    sourceList.value.data = message.rows;
-    sourceList.value.pagination.total = message.total;
-    setTimeout(() => {
-      loading.value = false;
-    }, 200);
-  });
+  proxy
+    .post("/accountPayment/page", sourceList.value.pagination)
+    .then((message) => {
+      sourceList.value.data = message.rows;
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
 };
 const paymentType = ref([
   {
@@ -664,6 +777,10 @@ const paymentType = ref([
     value: 10,
   },
   {
+    label: "部分打款",
+    value: 15,
+  },
+  {
     label: "未打款",
     value: 20,
   },
@@ -704,41 +821,40 @@ const submitForm = () => {
     );
   });
 };
-const getTreeList = () => {
-  proxy
-    .post("/productClassify/tree", {
-      parentId: "",
-      name: "",
-      definition: "2",
-    })
-    .then((message) => {
-      treeListData.value = message;
-      formConfig.value[0].data = message;
-    });
-};
+
 const getDtl = (row) => {
   proxy.post("/accountPayment/detail", { id: row.id }).then((res) => {
     formData.data = res;
+    if (submitType.value === "add") {
+      formData.data.expensesTime = moment().format("yyyy-MM-DD HH:mm:ss");
+      formData.data.currency = row.currency;
+      formData.data.amount = Number(
+        parseFloat(res.incomeAmount - res.amount).toFixed(2)
+      );
+    } else {
+      formData.data.expensesTime = formData.data.updateTime;
+    }
     formData.data.remark = proxy.deepClone(res.paymentRemark);
-    formData.data.expensesTime = moment().format("yyyy-MM-DD HH:mm:ss");
-    proxy.post("/fileInfo/getList", { businessIdList: [row.id] }).then((fileObj) => {
-      formData.data.fileList = fileObj[row.id] || [];
-      if (formData.data.fileList && formData.data.fileList.length > 0) {
-        fileList.value = formData.data.fileList.map((item) => {
-          return {
-            raw: item,
-            name: item.fileName,
-            url: item.fileUrl,
-          };
-        });
-      } else {
-        fileList.value = [];
-      }
-    });
+    proxy
+      .post("/fileInfo/getList", { businessIdList: [row.id] })
+      .then((fileObj) => {
+        formData.data.fileList = fileObj[row.id] || [];
+        if (formData.data.fileList && formData.data.fileList.length > 0) {
+          fileList.value = formData.data.fileList.map((item) => {
+            return {
+              raw: item,
+              name: item.fileName,
+              url: item.fileUrl,
+            };
+          });
+        } else {
+          fileList.value = [];
+        }
+      });
     dialogVisible.value = true;
   });
 };
-getTreeList();
+
 getList();
 const openSearch = ref(false);
 const formSearchConfig = computed(() => {
@@ -819,14 +935,16 @@ const submitSearch = () => {
   if (
     sourceList.value.pagination.startAmount &&
     sourceList.value.pagination.endAmount &&
-    Number(sourceList.value.pagination.startAmount) > Number(sourceList.value.pagination.endAmount)
+    Number(sourceList.value.pagination.startAmount) >
+      Number(sourceList.value.pagination.endAmount)
   ) {
     return ElMessage("交易金额输入错误");
   }
   if (
     sourceList.value.pagination.beginCreateTime &&
     sourceList.value.pagination.endCreateTime &&
-    sourceList.value.pagination.beginCreateTime > sourceList.value.pagination.endCreateTime
+    sourceList.value.pagination.beginCreateTime >
+      sourceList.value.pagination.endCreateTime
   ) {
     return ElMessage("开始时间不能大于结束时间");
   }
@@ -903,12 +1021,14 @@ const submitCancelledOutForm = () => {
 };
 const clickDetail = () => {
   formOption.disabled = true;
+  submitType.value = "edit";
   getDtl(rowData.value);
 };
 const printObj = ref({
   id: "printMe",
   popTitle: "",
-  extraCss: "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
+  extraCss:
+    "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
   extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
 });
 const changeIsTransaction = () => {