浏览代码

部分功能完善

cz 1 年之前
父节点
当前提交
898f37f474

+ 2 - 2
src/components/byForm/index.vue

@@ -44,8 +44,8 @@
                        :key="j.id || j.dictKey || j.value" :disabled="j.disabled ?j.disabled:false ">
             </el-option>
           </el-select>
-          <el-tree-select v-model="formData[i.prop]" v-else-if="i.type == 'treeSelect'" :data="i.data" :readonly="i.readonly ? i.readonly : false"
-                          :props="{
+          <el-tree-select v-model="formData[i.prop]" :multiple="i.multiple || false" v-else-if="i.type == 'treeSelect'" :data="i.data"
+                          :readonly="i.readonly ? i.readonly : false" :props="{
               value: i.propsTreeValue || 'id',
               label: i.propsTreeLabel || 'label',
               children: i.propsTreeChildren || 'children',

+ 107 - 36
src/components/process/SF/CostControl.vue

@@ -6,14 +6,14 @@
           <el-button type="primary" @click="clickAdd()" plain :disabled="getBtnDisabled()" style="margin-bottom: 16px"
                      v-if="!judgeStatus()">添加</el-button>
           <el-table :data="formData.data.costControlDetailList" style="width: 100%; ">
-            <el-table-column prop="remark" label="收付款说明" min-width="200" v-if="isShowAtt('remark','detailObj')">
+            <el-table-column prop="remark" label="收付款说明" min-width="250" v-if="isShowAtt('remark','detailObj')" fixed="left">
               <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" disabled />
                 </el-form-item>
               </template>
             </el-table-column>
-            <el-table-column prop="applyRemark" label="申请事由" min-width="200" v-if="isShowAtt('applyRemark','detailObj')">
+            <el-table-column prop="applyRemark" label="申请事由" min-width="250" v-if="isShowAtt('applyRemark','detailObj')">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'costControlDetailList.' + $index + '.applyRemark'" :rules="rules.applyRemark" :inline-message="true"
                               class="margin-b-0">
@@ -52,6 +52,17 @@
                 </el-form-item>
               </template>
             </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"
+                              class="margin-b-0">
+                  <el-select v-model="row.payeeAccountId" placeholder="请选择" style="width: 100%" filterable
+                             @change="(val)=>changeSelectData(val,$index,'4')">
+                    <el-option v-for="item in payeeData" :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"
@@ -112,7 +123,7 @@
                 <el-form-item :prop="'costControlDetailList.' + $index + '.accountPeriodAmountTax'" :rules="rules.accountPeriodAmountTax"
                               :inline-message="true" class="margin-b-0">
                   <el-input-number onmousewheel="return false;" v-model="row.accountPeriodAmountTax" placeholder="请输入" style="width: 100%"
-                                   :precision="2" :controls="false" :min="0" />
+                                   :precision="2" :controls="false" :min="0" disabled />
                 </el-form-item>
               </template>
             </el-table-column>
@@ -121,7 +132,7 @@
                 <el-form-item :prop="'costControlDetailList.' + $index + '.accountPeriodAmount'" :rules="rules.accountPeriodAmount"
                               :inline-message="true" class="margin-b-0">
                   <el-input-number onmousewheel="return false;" v-model="row.accountPeriodAmount" placeholder="请输入" style="width: 100%" :precision="2"
-                                   :controls="false" :min="0" />
+                                   :controls="false" :min="0" disabled />
                 </el-form-item>
               </template>
             </el-table-column>
@@ -130,7 +141,7 @@
                 <el-form-item :prop="'costControlDetailList.' + $index + '.accountPeriodAdjustAmount'" :rules="rules.accountPeriodAdjustAmount"
                               :inline-message="true" class="margin-b-0">
                   <el-input-number onmousewheel="return false;" v-model="row.accountPeriodAdjustAmount" placeholder="请输入" style="width: 100%"
-                                   :precision="2" :controls="false" :min="0" />
+                                   :precision="2" :controls="false" :min="0" disabled />
                 </el-form-item>
               </template>
             </el-table-column>
@@ -202,26 +213,7 @@
                 </el-form-item>
               </template>
             </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"
-                              class="margin-b-0">
-                  <!-- <el-select v-model="row.promotionFeeType" placeholder="请选择" style="width: 100%" filterable>
-                    <el-option v-for="item in corporationList" :key="item.value" :label="item.label" :value="item.value" />
-                  </el-select> -->
-                  <el-input v-model="row.payeeAccountId"></el-input>
-                </el-form-item>
-              </template>
-            </el-table-column>
-            <!-- <el-table-column prop="payeeAccountId" label="其他" width="150" >
-              <template #default="{ row, $index }">
-                <el-form-item :prop="'costControlDetailList.' + $index + '.payeeAccountId'" :rules="rules.payeeAccountId" :inline-message="true"
-                              class="margin-b-0">
-              
-                  <el-input v-model="row.payeeAccountId"></el-input>
-                </el-form-item>
-              </template>
-            </el-table-column> -->
+
             <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">
@@ -316,7 +308,7 @@
                 <el-form-item :prop="'costControlDetailList.' + $index + '.returnAmount'" :rules="rules.returnAmount" :inline-message="true"
                               class="margin-b-0">
                   <el-input-number onmousewheel="return false;" v-model="row.returnAmount" placeholder="请输入" style="width: 100%" :precision="2"
-                                   :controls="false" :min="0" />
+                                   :controls="false" :min="0" @change="handleGetRemark($index)" />
                 </el-form-item>
               </template>
             </el-table-column>
@@ -326,13 +318,13 @@
                   <el-form-item :prop="'costControlDetailList.' + $index + '.accountSubjectsId'" :rules="rules.accountSubjectsId"
                                 :inline-message="true" class="margin-b-0">
                     <el-tree-select v-model="row.accountSubjectsId" :data="accountSubjectsData" check-strictly :render-after-expand="false"
-                                    node-key="id" :props="defaultProps" style="width:100%" />
+                                    node-key="id" :props="defaultProps" style="width:100%" disabled />
                   </el-form-item>
                 </div>
               </template>
             </el-table-column>
-            <el-table-column label="核算项目名称" width="110" prop="amount" v-if="isShowAtt('accountSubjectsId','detailObj')" />
-            <el-table-column label="核算项目" width="100" prop="amount" v-if="isShowAtt('accountSubjectsId','detailObj')" />
+            <el-table-column label="核算项目名称" width="110" prop="accountSubjectsName" v-if="isShowAtt('accountSubjectsId','detailObj')" />
+            <el-table-column label="核算项目" width="100" prop="accountSubjectsName" v-if="isShowAtt('accountSubjectsId','detailObj')" />
             <el-table-column label="记账金额" width="100" prop="money" v-if="isShowAtt('money','detailObj')" />
             <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus()">
               <template #default="{ $index }">
@@ -368,6 +360,7 @@ const paymentMethod = computed(
   () => proxy.useUserStore().allDict["payment_method"]
 );
 const logisticsCompanyData = ref([]);
+const payeeData = ref([]);
 const accountSubjectsData = ref([]);
 const accountSubjectsList = ref([]);
 
@@ -407,6 +400,7 @@ const formData = reactive({
   data: {
     applyTime: moment().format("yyyy-MM-DD"),
     companyId: proxy.useUserStore().user.companyId,
+    companyIdSet: [],
     deptId: proxy.useUserStore().user.dept.deptId,
     applyUserId: proxy.useUserStore().user.userId,
     costControlDetailList: [
@@ -558,8 +552,27 @@ const formConfig = computed(() => {
         getDeptData(val);
       },
       disabled: true,
-      isShow: isShowAtt("companyId", "mainObj"),
+      isShow:
+        isShowAtt("companyId", "mainObj") &&
+        currentCostTypeData.value.name != "采购货款",
+    },
+    {
+      type: "treeSelect",
+      prop: "companyIdSet",
+      label: "业务公司",
+      data: treeData.value,
+      propsTreeLabel: "deptName",
+      propsTreeValue: "deptId",
+      itemWidth: 25,
+      // fn: (val) => {
+      //   getDeptData(val);
+      // },
+      multiple: true,
+      isShow:
+        isShowAtt("companyId", "mainObj") &&
+        currentCostTypeData.value.name == "采购货款",
     },
+
     {
       type: "treeSelect",
       prop: "deptId",
@@ -746,6 +759,9 @@ const rules = ref({
   isVoucher: [
     { required: true, message: "请选择是否后提交凭证", trigger: "change" },
   ],
+  companyIdSet: [
+    { required: true, message: "请选择业务公司", trigger: "change" },
+  ],
   companyId: [{ required: true, message: "请选择业务公司", trigger: "change" }],
   deptId: [{ required: true, message: "请选择业务部门", trigger: "change" }],
   invoiceTaxPoint: [
@@ -934,6 +950,7 @@ const getDeptData = (val) => {
 
 const changeCostType = (val) => {
   currentCostTypeData.value = paymentTypeData.value.find((x) => x.value == val);
+  formData.data.tradeType = currentCostTypeData.value.tradeType;
   if (formData.data && formData.data.applyUserId) {
     changApplyUserId(formData.data.applyUserId);
   }
@@ -967,7 +984,7 @@ const changeCostType = (val) => {
 };
 
 const changeSelectData = (val, index, type) => {
-  // type 1:快递公司 2:店铺  3:供应商
+  // type 1:快递公司 2:店铺  3:供应商  4:收款单位
   let current = null;
   switch (type) {
     case "1":
@@ -975,6 +992,10 @@ const changeSelectData = (val, index, type) => {
       if (current) {
         formData.data.costControlDetailList[index].invoiceTaxPoint =
           current.taxPoints;
+        formData.data.costControlDetailList[index].balancePrepaid =
+          current.balancePrepaid;
+        formData.data.costControlDetailList[index].balancePrepaidTax =
+          current.balancePrepaidTax;
         formData.data.costControlDetailList[index].labelName = current.label;
       }
       break;
@@ -989,13 +1010,26 @@ const changeSelectData = (val, index, type) => {
       if (current) {
         formData.data.costControlDetailList[index].invoiceTaxPoint =
           current.privTaxPoints;
+        formData.data.costControlDetailList[index].balancePrepaid =
+          current.balancePrepaid;
+        formData.data.costControlDetailList[index].balancePrepaidTax =
+          current.balancePrepaidTax;
+        formData.data.costControlDetailList[index].labelName = current.label;
+      }
+      break;
+
+    case "4":
+      current = payeeData.value.find((x) => x.value == val);
+      if (current) {
+        formData.data.costControlDetailList[index].invoiceTaxPoint =
+          current.taxPoints;
         formData.data.costControlDetailList[index].labelName = current.label;
       }
       break;
     default:
       break;
   }
-  if (current && ["1", "2"].includes(type)) {
+  if (current && ["1", "2", "4"].includes(type)) {
     formData.data.accountBank = current.accountBank;
     formData.data.accountName = current.accountName;
     formData.data.accountNumber = current.accountNumber;
@@ -1011,6 +1045,16 @@ const getDict = () => {
       accountSubjectsData.value = proxy.handleTree(res, "id");
     });
 
+  proxy.post("/payeeInfo/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    payeeData.value = res.rows.map((item) => {
+      return {
+        ...item,
+        label: item.name,
+        value: item.id,
+      };
+    });
+  });
+
   proxy
     .post("/logisticsCompanyInfo/list", { pageNum: 1, pageSize: 999 })
     .then((res) => {
@@ -1113,7 +1157,14 @@ const handleGetRemark = (index) => {
   //   index
   // ].remark = `支付${row.applyRemark}${currentCostTypeData.value.name}${money}`;
   formData.data.costControlDetailList[index].money = money;
-  if (currentCostTypeData.value.name.indexOf("备用金") != -1) {
+  if (currentCostTypeData.value.name.indexOf("归还") != -1) {
+    formData.data.costControlDetailList[index].money = parseFloat(
+      Number(row.returnAmount)
+    ).toFixed(2);
+    formData.data.costControlDetailList[
+      index
+    ].remark = `归还备用金${formData.data.costControlDetailList[index].money}`;
+  } else if (currentCostTypeData.value.name.indexOf("备用金") != -1) {
     formData.data.costControlDetailList[
       index
     ].remark = `支付${row.applyRemark}备用金${money}`;
@@ -1137,6 +1188,20 @@ const handleGetRemark = (index) => {
 };
 
 const clickAdd = () => {
+  let accountSubjectsId = "";
+  let accountSubjectsName = "";
+  if (
+    currentCostTypeData.value &&
+    currentCostTypeData.value.accountSubjectsId
+  ) {
+    accountSubjectsId = currentCostTypeData.value.accountSubjectsId;
+    let currentAccountSubjects = accountSubjectsList.value.find(
+      (x) => x.id == accountSubjectsId
+    );
+    if (currentAccountSubjects) {
+      accountSubjectsName = currentAccountSubjects.calculateItemName;
+    }
+  }
   if (
     formData.data.costControlDetailList &&
     formData.data.costControlDetailList.length > 0
@@ -1147,7 +1212,8 @@ const clickAdd = () => {
       payeeAccountId: "",
       applyRemark: "",
       deductionMonth: "",
-      accountSubjectsId: "",
+      accountSubjectsId: accountSubjectsId,
+      accountSubjectsName: accountSubjectsName,
       logisticsCompanyId: "",
       invoiceTaxPoint: "",
       currentPayable: null,
@@ -1179,7 +1245,8 @@ const clickAdd = () => {
         payeeAccountId: "",
         applyRemark: "",
         deductionMonth: "",
-        accountSubjectsId: "",
+        accountSubjectsId: accountSubjectsId,
+        accountSubjectsName: accountSubjectsName,
         logisticsCompanyId: "",
         invoiceTaxPoint: "",
         currentPayable: null,
@@ -1261,7 +1328,10 @@ const disabledFn = (date) => {
   return moment(current).add(1, "month").isBefore(moment());
 };
 
-const handleSubmit = async () => {
+const handleSubmit = async (isStag = false) => {
+  if (isStag) {
+    return true;
+  }
   let flag = await formDom.value.handleSubmit(() => {});
   if (flag) {
     if (
@@ -1361,6 +1431,7 @@ const getAllData = (businessId) => {
 };
 
 onMounted(() => {
+  formData.data.companyIdSet.push(proxy.useUserStore().user.companyId);
   getDeptData(formData.data.companyId);
   formOption.disabled = judgeStatus();
   if (route.query && route.query.businessId && route.query.processType) {

+ 9 - 9
src/views/EHSD/saleContract/accountingSubjects/index.vue

@@ -179,15 +179,15 @@ const formConfig = computed(() => {
       prop: "subjectsName",
       label: "名称",
     },
-    {
-      type: "select",
-      label: "收付款类型",
-      prop: "paymentTypeId",
-      itemWidth: 100,
-      data: paymentTypeData.value,
-      // clearable: true,
-      fn: (val) => {},
-    },
+    // {
+    //   type: "select",
+    //   label: "收付款类型",
+    //   prop: "paymentTypeId",
+    //   itemWidth: 100,
+    //   data: paymentTypeData.value,
+    //   // clearable: true,
+    //   fn: (val) => {},
+    // },
     {
       type: "input",
       prop: "calculateItemName",

+ 143 - 3
src/views/finance/fundManage/costControl/index.vue

@@ -1,7 +1,8 @@
 <template>
   <div class="pageIndexClass">
     <div class="content">
-      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row :action-list="[
+      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :selectConfig="selectConfig" :loading="loading"
+               highlight-current-row :action-list="[
           {
             text: '添加',
             action: () => openModal('add'),
@@ -68,63 +69,176 @@ const sourceList = ref({
     pageNum: 1,
     pageSize: 10,
     keyword: "",
+    tradeType: "",
+    status: "",
   },
 });
 const loading = ref(false);
+const tradeTypeData = ref([
+  {
+    label: "收入",
+    value: 10,
+  },
+  {
+    label: "支出",
+    value: 20,
+  },
+]);
+const statusData = ref([
+  {
+    label: "草稿",
+    value: 0,
+  },
+  {
+    label: "审批中",
+    value: 10,
+  },
+  {
+    label: "审批驳回",
+    value: 20,
+  },
+  {
+    label: "审批通过",
+    value: 30,
+  },
+  {
+    label: "作废",
+    value: 88,
+  },
+  {
+    label: "终止",
+    value: 99,
+  },
+]);
+const selectConfig = computed(() => {
+  return [
+    {
+      label: "收支类型",
+      prop: "tradeType",
+      data: tradeTypeData.value,
+    },
+    {
+      label: "审批状态",
+      prop: "status",
+      data: statusData.value,
+    },
+  ];
+});
+
 const config = computed(() => {
   return [
     {
       attrs: {
+        label: "费用类型",
+        prop: "costTypeName",
+        width: 130,
+        fixed: "left",
+      },
+    },
+    {
+      attrs: {
         label: "交易类型",
         prop: "tradeType",
+        width: 80,
+        fixed: "left",
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, tradeTypeData.value);
       },
     },
     {
       attrs: {
         label: "记账凭证号",
         prop: "voucherNo",
+        width: 110,
       },
     },
     {
       attrs: {
         label: "申请时间",
         prop: "applyTime",
+        width: 100,
       },
     },
     {
       attrs: {
         label: "流水号",
         prop: "code",
+        width: 150,
       },
     },
     {
       attrs: {
         label: "业务公司",
         prop: "companyName",
+        width: 100,
       },
     },
     {
       attrs: {
         label: "业务部门",
-        prop: "deptId",
+        prop: "deptName",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "申请人",
+        prop: "applyUserName",
+        width: 110,
+      },
+    },
+    {
+      attrs: {
+        label: "是否预付",
+        prop: "isAdvance",
+        width: 80,
+      },
+      render(val) {
+        return val == 1 ? "是" : "否";
+      },
+    },
+    {
+      attrs: {
+        label: "是否后提交凭证",
+        prop: "isVoucher",
+        width: 125,
+      },
+      render(val) {
+        return val == 1 ? "是" : "否";
       },
     },
+
     {
       attrs: {
         label: "开户行",
         prop: "accountBank",
+        "min-width": 150,
       },
     },
     {
       attrs: {
         label: "开户名",
         prop: "accountName",
+        "min-width": 150,
       },
     },
     {
       attrs: {
         label: "开户账号",
         prop: "accountNumber",
+        "min-width": 150,
+      },
+    },
+    {
+      attrs: {
+        label: "订单状态",
+        prop: "status",
+        width: 100,
+        fixed: "right",
+      },
+      render(val) {
+        return proxy.dictValueLabel(val, statusData.value);
       },
     },
     {
@@ -132,6 +246,7 @@ const config = computed(() => {
         label: "操作",
         width: "120",
         align: "center",
+        fixed: "right",
       },
       renderHTML(row) {
         return [
@@ -173,6 +288,31 @@ const config = computed(() => {
                 },
               }
             : {},
+          row.status == 10 || row.status == 30
+            ? {
+                attrs: {
+                  label: "作废",
+                  type: "danger",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  proxy
+                    .msgConfirm()
+                    .then((res) => {
+                      proxy
+                        .post("/costControl/cancellation", {
+                          id: row.id,
+                        })
+                        .then((res) => {
+                          proxy.msgTip("操作成功", 1);
+                          getList();
+                        });
+                    })
+                    .catch((err) => {});
+                },
+              }
+            : {},
         ];
       },
     },
@@ -447,7 +587,7 @@ const update = (row) => {
     query: {
       flowKey: "cost_control_flow",
       flowName: "费控流程",
-      businessId: row.id,
+      businessId: row.costType,
       random: proxy.random(),
     },
   });

+ 308 - 0
src/views/finance/fundManage/payee/index.vue

@@ -0,0 +1,308 @@
+<template>
+  <div class="pageIndexClass">
+    <div class="content">
+      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row :action-list="[
+          {
+            text: '添加',
+            action: () => openModal('add'),
+          },
+        ]" @get-list="getList">
+      </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">
+
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="default">取 消</el-button>
+        <el-button type="primary" @click="submitForm()" size="default">确 定</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import { computed, ref } from "vue";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import useUserStore from "@/store/modules/user";
+import { ElMessage, ElMessageBox } from "element-plus";
+
+const { proxy } = getCurrentInstance();
+const accountCurrency = ref([]);
+const typeData = ref([
+  {
+    label: "收入",
+    value: "10",
+  },
+  {
+    label: "支出",
+    value: "20",
+  },
+]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+  },
+});
+const loading = ref(false);
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "收款单位",
+        prop: "name",
+      },
+    },
+
+    {
+      attrs: {
+        label: "税点",
+        prop: "taxPoints",
+      },
+    },
+    {
+      attrs: {
+        label: "开户行",
+        prop: "accountBank",
+      },
+    },
+    {
+      attrs: {
+        label: "开户名",
+        prop: "accountName",
+      },
+    },
+    {
+      attrs: {
+        label: "账号",
+        prop: "accountNumber",
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "120",
+        align: "center",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "修改",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              update(row);
+            },
+          },
+          {
+            attrs: {
+              label: "删除",
+              type: "danger",
+              text: true,
+            },
+            el: "button",
+            click() {
+              proxy
+                .msgConfirm()
+                .then((res) => {
+                  proxy
+                    .post("/payeeInfo/delete", {
+                      id: row.id,
+                    })
+                    .then((res) => {
+                      proxy.msgTip("操作成功", 1);
+                      getList();
+                    });
+                })
+                .catch((err) => {});
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+const corporationList = ref([]);
+
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/payeeInfo/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+getList();
+const modalType = ref("add");
+const dialogVisible = ref(false);
+const loadingDialog = ref(false);
+const submit = ref(null);
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const formConfig = computed(() => {
+  return [
+    {
+      type: "title1",
+      title: "基本信息",
+    },
+    {
+      type: "input",
+      prop: "name",
+      label: "收款单位",
+      required: true,
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "number",
+      prop: "taxPoints",
+      label: "税点",
+      precision: 2,
+      min: 0,
+      max: 100,
+      controls: false,
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      prop: "accountBank",
+      label: "开户行",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "accountName",
+      label: "开户名",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "accountNumber",
+      label: "账号",
+      itemWidth: 50,
+      itemType: "text",
+    },
+  ];
+});
+const rules = ref({
+  name: [{ required: true, message: "请输入收款单位", trigger: "blur" }],
+  taxPoints: [{ required: true, message: "请输入税点", trigger: "blur" }],
+  accountBank: [{ required: true, message: "请输入开户行", trigger: "blur" }],
+  accountName: [{ required: true, message: "请输入开户名", trigger: "blur" }],
+  accountNumber: [{ required: true, message: "请输入账号", trigger: "blur" }],
+});
+const formData = reactive({
+  data: {
+    accountRemainderList: [{ currency: "", remainder: undefined }],
+  },
+});
+const openModal = (val) => {
+  modalType.value = val;
+  formData.data = {
+    accountRemainderList: [{ currency: "", remainder: undefined }],
+  };
+  loadingDialog.value = false;
+  dialogVisible.value = true;
+};
+const clickBalance = () => {
+  if (
+    formData.data.accountRemainderList &&
+    formData.data.accountRemainderList.length > 0
+  ) {
+    formData.data.accountRemainderList.push({
+      currency: "",
+      remainder: undefined,
+    });
+  } else {
+    formData.data.accountRemainderList = [
+      { currency: "", remainder: undefined },
+    ];
+  }
+};
+const handleRemove = (index) => {
+  formData.data.accountRemainderList.splice(index, 1);
+};
+const isRepeat = (arr) => {
+  var hash = {};
+  for (var i in arr) {
+    if (hash[arr[i].currency]) return true;
+    hash[arr[i].currency] = true;
+  }
+  return false;
+};
+const submitForm = () => {
+  submit.value.handleSubmit(() => {
+    loadingDialog.value = true;
+    proxy.post("/payeeInfo/" + modalType.value, formData.data).then(
+      () => {
+        proxy.msgTip("操作成功", 1);
+        dialogVisible.value = false;
+        getList();
+      },
+      (err) => {
+        console.log(err);
+        loadingDialog.value = false;
+      }
+    );
+    // if (
+    //   formData.data.accountRemainderList &&
+    //   formData.data.accountRemainderList.length > 0
+    // ) {
+    //   if (isRepeat(formData.data.accountRemainderList)) {
+    //     return ElMessage("请勿重复添加货币余额");
+    //   } else {
+    //     loadingDialog.value = true;
+    //     proxy.post("/accountManagement/" + modalType.value, formData.data).then(
+    //       () => {
+    //         ElMessage({
+    //           message: modalType.value == "add" ? "添加成功" : "编辑成功",
+    //           type: "success",
+    //         });
+    //         dialogVisible.value = false;
+    //         getList();
+    //       },
+    //       (err) => {
+    //         console.log(err);
+    //         loadingDialog.value = false;
+    //       }
+    //     );
+    //   }
+    // } else {
+    //   return ElMessage("请添加至少一条类型余额");
+    // }
+  });
+};
+const update = (row) => {
+  loadingDialog.value = false;
+  modalType.value = "edit";
+  formData.data = proxy.deepClone(row);
+  dialogVisible.value = true;
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>

+ 25 - 2
src/views/finance/fundManage/paymentType/index.vue

@@ -145,11 +145,19 @@ const config = computed(() => {
     },
   ];
 });
-const corporationList = ref([]);
+const accountSubjectsData = ref([]);
+const accountSubjectsList = ref([]);
 const getDict = () => {
   proxy.post("/costControl/getFieldInfo").then((res) => {
     checkBoxMap.value = res;
   });
+
+  proxy
+    .post("/accountSubjects/list", { pageNum: 1, pageSize: 999 })
+    .then((res) => {
+      accountSubjectsList.value = res;
+      accountSubjectsData.value = proxy.handleTree(res, "id");
+    });
 };
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
@@ -203,13 +211,25 @@ const formConfig = computed(() => {
       itemType: "textarea",
     },
     {
+      type: "treeSelect",
+      prop: "accountSubjectsId",
+      label: "记帐科目",
+      data: accountSubjectsData.value,
+      propsTreeLabel: "subjectsName",
+      propsTreeValue: "id",
+      itemWidth: 50,
+      fn: (val) => {
+        // getDeptData(val);
+      },
+    },
+    {
       type: "number",
       prop: "sort",
       label: "排序",
       precision: 0,
       min: 0,
       controls: false,
-      // itemWidth: 25,
+      itemWidth: 50,
     },
     {
       type: "title1",
@@ -230,6 +250,9 @@ const formConfig = computed(() => {
 const rules = ref({
   name: [{ required: true, message: "请输入名称", trigger: "blur" }],
   tradeType: [{ required: true, message: "请选择收支类型", trigger: "change" }],
+  accountSubjectsId: [
+    { required: true, message: "请选择记账科目", trigger: "change" },
+  ],
   sort: [{ required: true, message: "请输入排序", trigger: "blur" }],
 });