lxf 1 year ago
parent
commit
6e99800570

+ 4 - 5
src/components/testForm/index.vue

@@ -10,7 +10,7 @@
       ref="testForm">
       <van-cell-group inset>
         <div v-for="(i, index) in formConfig" :key="index" :style="i.style || ''">
-          <van-field v-if="i.type == 'title'" style="background: #ecebeb;">
+          <van-field v-if="i.type == 'title'" style="background: #ecebeb">
             <template #input>
               <div class="_title">
                 {{ i.title }}
@@ -186,7 +186,7 @@
           <van-button
             plain
             type="primary"
-            @click="handleRemove(index, item)"
+            @click="handleRemove(index, btnConfigCopy)"
             size="mini"
             style="border: none; background: #ecebeb"
             v-if="formOption.btnConfig !== undefined && formOption.btnConfig.isNeed"
@@ -571,9 +571,8 @@ const handlePush = () => {
 };
 // remove
 const handleRemove = (index, item) => {
-  console.log(item);
   if (item.deleteFn) {
-    item.deleteFn(index, item);
+    item.deleteFn(index);
   } else {
     formData.value[btnConfigCopy.prop].splice(index, 1);
   }
@@ -782,7 +781,7 @@ const changeCheckboxGroup = (form, label, data, fieldNames) => {
     }
   }
   .van-form {
-    margin-top: 0px !important; 
+    margin-top: 0px !important;
   }
 }
 </style>

+ 32 - 0
src/lang/cn.js

@@ -1203,5 +1203,37 @@ export const lang = {
 		currencyTotal: '请款金额',
 		paymentRemarks: '用款说明',
 		fundsText: '放款状态',
+		basicInformation: '基础信息',
+		claimDetails: '请款明细',
+		receiptPaymentInformation: '收付款信息',
+		corporationId: '归属公司',
+		corporationIdMsg: '请选择归属公司',
+		departmentId: '归属部门',
+		departmentIdMsg: '请选择归属部门',
+		type: '请款类型',
+		typeMsg: '请选择请款类型',
+		advanceId: '预支单',
+		advanceIdMsg: '请选择预支单',
+		currency: '币种',
+		currencyMsg: '请选择币种',
+		costType: '费用类型',
+		costTypeMsg: '请选择费用类型',
+		contractId: '关联合同',
+		contractIdMsg: '请选择关联合同',
+		amount: '请款金额',
+		amountMsg: '请选择请款金额',
+		remarks: '款项说明',
+		remarksMsg: '请选择款项说明',
+		total: '请款总额',
+		quantity: '单据张数',
+		quantityMsg: '请选择单据张数',
+		paymentMethod: '付款方式',
+		paymentMethodMsg: '请选择付款方式',
+		accountManagementId: '付款账户',
+		accountManagementIdMsg: '请选择付款账户',
+		username: '户名',
+		accountOpening: '银行账号',
+		openingBank: '开户银行',
+		interbankNumber: '联行号 / SWIFT Code',
 	}
 }

+ 14 - 16
src/views/fund/funds/index.vue

@@ -18,7 +18,12 @@ import commonList from "@/components/common-list.vue";
 const proxy = getCurrentInstance().proxy;
 const onClickLeft = () => proxy.$router.push("/main/working");
 const onClickRight = () => {
-  proxy.$router.push("/main/processDtl?flowKey=account_request_funds_flow");
+  proxy.$router.push({
+    path: "/main/processDtl",
+    query: {
+      flowKey: "account_request_funds_flow",
+    },
+  });
 };
 const req = ref({
   pageNum: 1,
@@ -71,21 +76,14 @@ const getList = (type) => {
     });
 };
 const toDtl = (row) => {
-  // if (row.status == "10") {
-  //   proxy.$router.push({
-  //     path: "accountPaymentDetail",
-  //     query: {
-  //       id: row.id,
-  //     },
-  //   });
-  // } else if (row.status == "20") {
-  //   proxy.$router.push({
-  //     path: "accountPaymentAdd",
-  //     query: {
-  //       id: row.id,
-  //     },
-  //   });
-  // }
+  // proxy.$router.push({
+  //   path: "/main/processDtl",
+  //   query: {
+  //     flowKey: "account_request_funds_flow",
+  //     id: row.flowInfoId,
+  //     processType: 20,
+  //   },
+  // });
 };
 const listConfig = ref([
   {

+ 462 - 280
src/views/processApproval/components/SendFunds.vue

@@ -1,322 +1,504 @@
 <template>
   <div class="form">
     <van-tabs v-model:active="active">
-      <van-tab title="申购信息">
+      <van-tab :title="proxy.t('funds.basicInformation')">
         <div class="common-process-card">
-          <div class="common-title">申购信息</div>
-          <van-form @submit="onSubmit" label-align="top" style="margin-top: 20px">
-            <van-cell-group inset>
-              <van-field
-                v-model="formData.deptName"
-                is-link
-                readonly
-                :label="$t('purchased.procurementDepartment')"
-                :placeholder="$t('purchased.selectProcurementDepartment')"
-                :rules="[{ required: true, message: $t('purchased.procurementDepartmentCanNotBeEmpty') }]"
-                @click="submitType === 'edit' ? (typeModal = false) : (typeModal = true)"
-                :readonly="submitType === 'edit'"
-                required />
-              <van-popup v-model:show="typeModal" round position="bottom">
-                <van-picker :columns="columns" @cancel="typeModal = false" @confirm="onConfirm" />
-              </van-popup>
-              <van-field
-                v-model="formData.subcribeName"
-                type="text"
-                :name="$t('purchased.procurementPersonName')"
-                :label="$t('purchased.procurementPersonName')"
-                :placeholder="$t('purchased.pleaseFillInTheProcurementPersonName')"
-                :rules="[{ required: true, message: $t('purchased.procurementPersonNameCanNotBeEmpty') }]"
-                required
-                :readonly="submitType === 'edit'" />
-              <van-field
-                v-model="formData.subcribeTime"
-                is-link
-                readonly
-                name="datePicker"
-                :label="$t('purchased.procurementTime')"
-                :placeholder="$t('purchased.clickToSelectTime')"
-                :rules="[{ required: true, message: $t('purchased.procurementTimeCanNotBeEmpty') }]"
-                @click="submitType === 'edit' ? (timePicker = false) : (timePicker = true)"
-                required
-                :readonly="submitType === 'edit'" />
-              <van-popup v-model:show="timePicker" position="bottom">
-                <van-date-picker @confirm="timeOnConfirm" @cancel="timePicker = false" />
-              </van-popup>
-              <van-field
-                v-model="formData.subcribeContent"
-                type="textarea"
-                :name="$t('purchased.procurementDescription')"
-                :label="$t('purchased.procurementDescription')"
-                :placeholder="$t('purchased.pleaseFillInTheProcurementDescription')"
-                :rules="[{ required: true, message: $t('purchased.procurementDescriptionCanNotBeEmpty') }]"
-                required
-                :readonly="submitType === 'edit'"
-                rows="3" />
-            </van-cell-group>
-          </van-form>
+          <div class="common-title">{{ proxy.t("funds.basicInformation") }}</div>
+          <testForm v-model="formData.data" :formOption="formOption" :formConfig="formConfig" :rules="rules" ref="formDom"> </testForm>
         </div>
       </van-tab>
-      <van-tab title="明细">
+      <van-tab :title="proxy.t('funds.claimDetails')">
         <div class="common-process-card">
-          <div class="common-title">明细</div>
-          <!-- 明细列表 -->
-          <div v-for="(item, index) in formData.subscribeDetailList" :key="index">
-            <div class="commons-delete">
-              <div class="title">{{ $t("common.details") }}{{ index + 1 }}</div>
-              <div class="delete" @click.native="handleDel(index)" v-if="!route.query.id">
-                <van-icon name="cross" />
-              </div>
-            </div>
-            <van-cell-group inset>
-              <van-field
-                v-model="formData.subscribeDetailList[index].bussinessName"
-                is-link
-                readonly
-                :label="$t('purchased.procurementProduct')"
-                :placeholder="$t('purchased.selectProcurementProduct')"
-                :readonly="submitType === 'edit'"
-                @click="handleSelect(index)"
-                :rules="[{ required: true, message: $t('purchased.procurementProductCanNotBeEmpty') }]"
-                required />
-              <van-field
-                v-model="formData.subscribeDetailList[index].count"
-                :label="$t('subscribe.quantity')"
-                :placeholder="$t('subscribe.pleaseEnterTheQuantity')"
-                :rules="[{ required: true, message: $t('subscribe.quantityCanNotBeEmpty') }]"
-                required
-                type="number"
-                :readonly="submitType === 'edit'" />
-
-              <van-field
-                v-model="formData.subscribeDetailList[index].content"
-                :label="$t('subscribe.cause')"
-                :placeholder="$t('subscribe.pleaseEnterTheCause')"
-                :rules="[{ required: true, message: $t('subscribe.causeCanNotBeEmpty') }]"
-                :readonly="submitType === 'edit'"
-                rows="3"
-                type="textarea"
-                required />
-            </van-cell-group>
-          </div>
-          <van-popup v-model:show="typeModalOne" round position="bottom">
-            <van-picker :columns="columnsOne" @cancel="typeModalOne = false" @confirm="(data) => onConfirmOne(data)" />
-          </van-popup>
-          <div class="commons-add-btn" v-if="!route.query.id">
-            <van-button icon="plus" type="default" size="small" style="margin-top: 10px" block @click="handleAddRow">{{ $t("common.addDetails") }}</van-button>
-          </div>
-          <!-- <div style="margin: 16px" v-if="!route.query.id">
-						<van-button round block type="primary" native-type="submit">
-							{{$t('common.submit')}}
-						</van-button>
-					</div> -->
-          <div class="common-mobile-table">
-            <table>
-              <thead>
-                <tr>
-                  <th>物料编码</th>
-                  <th>物料名称</th>
-                  <th>规格型号</th>
-                  <th>规格型号</th>
-                  <th>规格型号</th>
-                  <th>规格型号</th>
-                  <th>规格型号</th>
-                </tr>
-              </thead>
-              <tbody>
-                <tr>
-                  <td>1000000001</td>
-                  <td>电脑</td>
-                  <td>台</td>
-                </tr>
-                <tr>
-                  <td>1000000002</td>
-                  <td>显示器</td>
-                  <td>台</td>
-                </tr>
-              </tbody>
-            </table>
-          </div>
+          <div class="common-title">{{ proxy.t("funds.claimDetails") }}</div>
+          <testForm v-model="formData.data" :formOption="formDetailOption" :formConfig="formDetailConfig" :rules="rules" ref="formDom"> </testForm>
+          <testForm v-model="formData.data" :formOption="formDetailTwoOption" :formConfig="formDetailTwoConfig" :rules="rules" ref="formDom"> </testForm>
+        </div>
+      </van-tab>
+      <van-tab :title="proxy.t('funds.receiptPaymentInformation')">
+        <div class="common-process-card">
+          <div class="common-title">{{ proxy.t("funds.receiptPaymentInformation") }}</div>
+          <testForm v-model="formData.data" :formOption="formReceiptPaymentOption" :formConfig="formReceiptPaymentConfig" :rules="rules" ref="formDom">
+          </testForm>
         </div>
       </van-tab>
-      <van-tab title="标签 3">内容 3</van-tab>
-      <van-tab title="标签 4">内容 4</van-tab>
-      <van-tab title="标签 4">内容 4</van-tab>
-      <van-tab title="标签 4">内容 4</van-tab>
     </van-tabs>
   </div>
 </template>
 
 <script setup>
-import { ref, getCurrentInstance, onMounted, defineProps, defineExpose, watch } from "vue";
+import { ref, getCurrentInstance, onMounted, defineProps, defineExpose, watch, reactive } from "vue";
 import { showSuccessToast, showFailToast } from "vant";
 import { useRoute } from "vue-router";
+import testForm from "@/components/testForm/index.vue";
+import { getUserInfo } from "@/utils/auth";
+
 // 接收父组件的传值
 const props = defineProps({
   queryData: String,
 });
-
 const proxy = getCurrentInstance().proxy;
 const route = useRoute();
-const typeModal = ref(false);
-const typeModalOne = ref(false);
-let selectIndex = ref(null);
-const timePicker = ref(false);
-const formData = ref({
-  productionTaskId: "",
-  code: "",
-  productName: "",
-  quantity: "",
-  personLiableName: "",
-  dueDate: "",
-  subscribeDetailList: [],
+const active = ref(0);
+const oldType = ref("");
+const formData = reactive({
+  data: {
+    corporationId: null,
+    departmentId: null,
+    type: null,
+    advanceId: null,
+    currency: null,
+    paymentRemarks: null,
+    accountRequestFundsDetailList: [],
+    total: null,
+    quantity: null,
+    paymentMethod: null,
+    accountManagementId: null,
+    username: null,
+    accountOpening: null,
+    openingBank: null,
+    interbankNumber: null,
+  },
 });
-const handleAddRow = () => {
-  console.log(formData.value);
-  if (!formData.value.subscribeDetailList) formData.value.subscribeDetailList = [];
-  formData.value.subscribeDetailList.push({
-    bussinessId: "",
-    bussinessName: "",
-    name: "",
-    quantity: "",
-    content: "",
-    count: "",
-  });
-};
-watch(
-  props.queryData,
-  () => {
-    if (props.queryData && ["10", "20", "30"].includes(route.query.processType)) {
-      for (const key in props.queryData) {
-        formData.data[key] = props.queryData[key];
+const formDom = ref(null);
+const formOption = reactive({
+  readonly: false, //用于控制整个表单是否只读
+  disabled: false,
+  labelAlign: "top",
+  scroll: true,
+  labelWidth: "62pk",
+  hiddenSubmitBtn: true,
+});
+const formConfig = reactive([
+  {
+    type: "picker",
+    label: proxy.t("funds.corporationId"),
+    prop: "corporationId",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+    changeFn: (val, item) => {
+      formData.data.corporationId = val.selectedValues[0];
+      let list = item.data.filter((aa) => aa[item.fieldNames.value] == val.selectedValues[0]);
+      if (list && list.length > 0) {
+        formData.data.corporationIdName = list[0][item.fieldNames.text];
+      } else {
+        formData.data.corporationIdName = "";
       }
-    }
+      if (formData.data.type == "3") {
+        getAdvanceList();
+      }
+      item.showPicker = false;
+    },
   },
   {
-    deep: true,
-  }
-);
-const timeOnConfirm = ({ selectedValues }) => {
-  formData.value.subcribeTime = selectedValues.join("-");
-  timePicker.value = false;
+    type: "picker",
+    label: proxy.t("funds.departmentId"),
+    prop: "departmentId",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+  },
+  {
+    type: "picker",
+    label: proxy.t("funds.type"),
+    prop: "type",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+    changeFn: (val, item) => {
+      if (val.selectedValues[0] === "3" || oldType.value === "3") {
+        for (var text in formData.data) {
+          if (text === "advanceId") {
+            formData.data.advanceId = "";
+          } else if (["corporationId", "type", "paymentTime"].includes(text)) {
+          } else if (text === "accountRequestFundsDetailList") {
+            formData.data.accountRequestFundsDetailList = [];
+          } else if (text === "fileList") {
+            formData.data.fileList = [];
+          } else {
+            delete formData.data[text];
+          }
+        }
+      }
+      oldType.value = JSON.parse(JSON.stringify(val.selectedValues[0]));
+      formData.data.type = JSON.parse(JSON.stringify(val.selectedValues[0]));
+      let list = item.data.filter((aa) => aa[item.fieldNames.value] == val.selectedValues[0]);
+      if (list && list.length > 0) {
+        formData.data.typeName = list[0][item.fieldNames.text];
+      } else {
+        formData.data.typeName = "";
+      }
+      if (val.selectedValues[0] === "3") {
+        formConfig[3].type = "picker";
+        getAdvanceList();
+      } else {
+        formConfig[3].type = "pickerAAA";
+      }
+      item.showPicker = false;
+    },
+  },
+  {
+    type: "pickerAAA",
+    label: proxy.t("funds.advanceId"),
+    prop: "advanceId",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+  },
+  {
+    type: "picker",
+    label: proxy.t("funds.currency"),
+    prop: "currency",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+  },
+  {
+    type: "input",
+    label: proxy.t("funds.paymentRemarks"),
+    prop: "paymentRemarks",
+    itemType: "textarea",
+  },
+]);
+const formDetailOption = reactive({
+  readonly: false, //用于控制整个表单是否只读
+  disabled: false,
+  labelAlign: "top",
+  scroll: true,
+  labelWidth: "62pk",
+  hiddenSubmitBtn: true,
+  btnConfig: {
+    isNeed: true,
+    prop: "accountRequestFundsDetailList",
+    plain: true,
+    listTitle: proxy.t("funds.claimDetails"),
+    listConfig: [
+      {
+        type: "picker",
+        label: proxy.t("funds.costType"),
+        prop: "costType",
+        itemType: "onePicker",
+        showPicker: false,
+        readonly: false,
+        fieldNames: {
+          text: "label",
+          value: "value",
+        },
+        data: [],
+      },
+      {
+        type: "picker",
+        label: proxy.t("funds.contractId"),
+        prop: "contractId",
+        itemType: "onePicker",
+        showPicker: false,
+        readonly: false,
+        fieldNames: {
+          text: "label",
+          value: "value",
+        },
+        data: [],
+      },
+      {
+        type: "input",
+        label: proxy.t("funds.amount"),
+        prop: "amount",
+        itemType: "number",
+        changeFn: () => {
+          handleChangeAmount();
+        },
+      },
+      {
+        type: "input",
+        label: proxy.t("funds.remarks"),
+        prop: "remarks",
+        itemType: "textarea",
+      },
+    ],
+    clickFn: () => {
+      if (formData.data.accountRequestFundsDetailList && formData.data.accountRequestFundsDetailList.length > 0) {
+        formData.data.accountRequestFundsDetailList.push({
+          costType: null,
+          contractId: null,
+          amount: null,
+          remarks: null,
+        });
+      } else {
+        formData.data.accountRequestFundsDetailList = [
+          {
+            costType: null,
+            contractId: null,
+            amount: null,
+            remarks: null,
+          },
+        ];
+      }
+    },
+    deleteFn: (index) => {
+      formData.data.accountRequestFundsDetailList.splice(index, 1);
+      handleChangeAmount();
+    },
+  },
+});
+const formDetailConfig = reactive([]);
+const formDetailTwoOption = reactive({
+  readonly: false, //用于控制整个表单是否只读
+  disabled: false,
+  labelAlign: "top",
+  scroll: true,
+  labelWidth: "62pk",
+  hiddenSubmitBtn: true,
+});
+const formDetailTwoConfig = reactive([
+  {
+    type: "input",
+    label: proxy.t("funds.total"),
+    prop: "total",
+    itemType: "number",
+    readonly: true,
+  },
+  {
+    type: "input",
+    label: proxy.t("funds.quantity"),
+    prop: "quantity",
+    itemType: "number",
+  },
+]);
+const formReceiptPaymentOption = reactive({
+  readonly: false, //用于控制整个表单是否只读
+  disabled: false,
+  labelAlign: "top",
+  scroll: true,
+  labelWidth: "62pk",
+  hiddenSubmitBtn: true,
+});
+const formReceiptPaymentConfig = reactive([
+  {
+    type: "picker",
+    label: proxy.t("funds.paymentMethod"),
+    prop: "paymentMethod",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+  },
+  {
+    type: "picker",
+    label: proxy.t("funds.accountManagementId"),
+    prop: "accountManagementId",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+  },
+  {
+    type: "input",
+    label: proxy.t("funds.username"),
+    prop: "name",
+    itemType: "text",
+  },
+  {
+    type: "input",
+    label: proxy.t("funds.accountOpening"),
+    prop: "accountOpening",
+    itemType: "text",
+  },
+  {
+    type: "input",
+    label: proxy.t("funds.openingBank"),
+    prop: "openingBank",
+    itemType: "text",
+  },
+  {
+    type: "input",
+    label: proxy.t("funds.interbankNumber"),
+    prop: "interbankNumber",
+    itemType: "text",
+  },
+]);
+const rules = {
+  corporationId: [{ required: true, message: proxy.t("funds.corporationIdMsg") }],
+  departmentId: [{ required: true, message: proxy.t("funds.departmentIdMsg") }],
+  type: [{ required: true, message: proxy.t("funds.typeMsg") }],
+  advanceId: [{ required: true, message: proxy.t("funds.advanceIdMsg") }],
+  currency: [{ required: true, message: proxy.t("funds.currencyMsg") }],
+  costType: [{ required: true, message: proxy.t("funds.costTypeMsg") }],
+  contractId: [{ required: true, message: proxy.t("funds.contractIdMsg") }],
+  amount: [{ required: true, message: proxy.t("funds.amountMsg") }],
+  remarks: [{ required: true, message: proxy.t("funds.remarksMsg") }],
+  quantity: [{ required: true, message: proxy.t("funds.quantityMsg") }],
+  paymentMethod: [{ required: true, message: proxy.t("funds.paymentMethodMsg") }],
+  accountManagementId: [{ required: true, message: proxy.t("funds.accountManagementIdMsg") }],
 };
-
-const getDict = () => {
-  proxy.get("/tenantDept/list", { pageNum: 1, pageSize: 9999 }).then((res) => {
-    columns.value = res.data.map((item) => {
-      return {
-        ...item,
-        text: item.deptName,
-        value: item.deptId,
-      };
+const getAdvanceList = () => {
+  proxy
+    .post("/accountRequestFunds/page", {
+      pageNum: 1,
+      pageSize: 999,
+      type: "1",
+      writeOffStatus: "0",
+      corporationId: formData.data.corporationId,
+      status: "30",
+      createUser: getUserInfo().userId,
+    })
+    .then((res) => {
+      if (res.data.rows && res.data.rows.length > 0) {
+        formConfig[3].data = res.data.rows.map((item) => {
+          return {
+            label: item.createTime.substr(0, 10) + "  " + item.currency + " " + item.total,
+            value: item.id,
+          };
+        });
+      }
     });
+};
+const getDict = () => {
+  let query = {
+    pageNum: 1,
+    pageSize: 999,
+    tenantId: getUserInfo().tenantId,
+  };
+  proxy.post("/corporation/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
+    if (res.data.rows && res.data.rows.length > 0) {
+      formConfig[0].data = res.data.rows.map((item) => {
+        return {
+          label: item.name,
+          value: item.id,
+        };
+      });
+    }
   });
-  setInterval(() => {
-    //停止循环
-    if (proxy.queryData) {
-      formData.value = proxy.queryData;
-      clearInterval();
+  proxy.get("/tenantDept/list", query).then((res) => {
+    if (res.data && res.data.length > 0) {
+      formConfig[1].data = res.data
+        .filter((item) => item.parentId != "0")
+        .map((item) => {
+          return {
+            label: item.deptName,
+            value: item.deptId,
+          };
+        });
     }
-  }, 1000);
-  proxy.post("/productInfo/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
-    columnsOne.value = res.data.rows.map((item) => {
-      return {
-        ...item,
-        text: item.name,
-        value: item.id,
-      };
-    });
   });
-};
-
-const getDetails = (id) => {
-  proxy.post("/subscribe/detail", { id: id }).then((res) => {
-    res.data.subscribeDetailList.map((item) => {
-      columnsOne.value.map((itemOne) => {
-        if (itemOne.value === item.bussinessId) {
-          item.bussinessName = itemOne.name;
-        }
+  proxy.post("/dictTenantData/page", { ...query, dictCode: "founds_type" }).then((res) => {
+    if (res.data.rows && res.data.rows.length > 0) {
+      formConfig[2].data = res.data.rows.map((item) => {
+        return {
+          label: item.dictValue,
+          value: item.dictKey,
+        };
       });
-    });
-    formData.value = res.data;
-
-    console.log(formData.value);
+    }
+  });
+  proxy.post("/dictTenantData/page", { ...query, dictCode: "account_currency" }).then((res) => {
+    if (res.data.rows && res.data.rows.length > 0) {
+      formConfig[4].data = res.data.rows.map((item) => {
+        return {
+          label: item.dictValue,
+          value: item.dictKey,
+        };
+      });
+    }
+  });
+  proxy.post("/dictTenantData/page", { ...query, dictCode: "funds_cost_type" }).then((res) => {
+    if (res.data.rows && res.data.rows.length > 0) {
+      formDetailOption.btnConfig.listConfig[0].data = res.data.rows.map((item) => {
+        return {
+          label: item.dictValue,
+          value: item.dictKey,
+        };
+      });
+    }
+  });
+  proxy.post("/contract/page", { pageNum: 1, pageSize: 9999, status: 30 }).then((res) => {
+    if (res.data.rows && res.data.rows.length > 0) {
+      formDetailOption.btnConfig.listConfig[1].data = res.data.rows.map((item) => {
+        return {
+          label: item.code,
+          value: item.id,
+        };
+      });
+    }
+  });
+  proxy.post("/dictTenantData/page", { ...query, dictCode: "funds_payment_method" }).then((res) => {
+    if (res.data.rows && res.data.rows.length > 0) {
+      formReceiptPaymentConfig[0].data = res.data.rows.map((item) => {
+        return {
+          label: item.dictValue,
+          value: item.dictKey,
+        };
+      });
+    }
+  });
+  proxy.post("/accountManagement/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
+    if (res.data.rows && res.data.rows.length > 0) {
+      formReceiptPaymentConfig[1].data = res.data.rows.map((item) => {
+        return {
+          label: item.alias,
+          value: item.id,
+        };
+      });
+    }
   });
 };
-
-const columns = ref([]);
-const columnsOne = ref([]);
-const submitType = ref("add");
-
-const onConfirm = ({ selectedOptions }) => {
-  formData.value.deptName = selectedOptions[0].text;
-  formData.value.productionTaskId = selectedOptions[0].value;
-  formData.value.productName = selectedOptions[0].productName;
-  formData.value.quantity = selectedOptions[0].quantity;
-  formData.value.personLiableName = selectedOptions[0].personLiableName;
-  formData.value.dueDate = selectedOptions[0].dueDate;
-  typeModal.value = false;
-};
-
-const onConfirmOne = ({ selectedOptions }) => {
-  formData.value.subscribeDetailList[selectIndex.value].bussinessId = selectedOptions[0].value;
-  formData.value.subscribeDetailList[selectIndex.value].bussinessName = selectedOptions[0].text;
-  typeModalOne.value = false;
-};
-
-const handleSelect = (index) => {
-  if (submitType.value === "edit") return;
-  selectIndex.value = index;
-  typeModalOne.value = true;
-};
-
-const handleDel = (index) => {
-  formData.value.subscribeDetailList.splice(index, 1);
+getDict();
+const handleChangeAmount = () => {
+  let sum = 0;
+  for (let i = 0; i < formData.data.accountRequestFundsDetailList.length; i++) {
+    const e = formData.data.accountRequestFundsDetailList[i];
+    if (e.amount) {
+      sum = Number(parseFloat(Number(sum) + Number(e.amount)).toFixed(2));
+    }
+  }
+  formData.data.total = sum;
 };
-
 const handleSubmit = async () => {
-  return formData.value;
+  return formData.data;
 };
-const onSubmit = () => {
-  if (!formData.value.subscribeDetailList.length > 0) return showFailToast(proxy.t("common.pleaseAddDetails"));
-  proxy
-    .post("/flowProcess/initiate", {
-      flowKey: "subscribe_flow",
-      data: formData.value,
-      remark: null,
-    })
-    .then(
-      (res) => {
-        setTimeout(() => {
-          showSuccessToast(proxy.t("common.procurementSuccess"));
-          proxy.$router.push("/main/subscribe");
-        }, 500);
-      },
-      (err) => {
-        return showFailToast(err.message);
+watch(
+  props.queryData,
+  () => {
+      console.log(props.queryData,'111');
+    if (props.queryData && [10, 20, 30].includes(route.query.processType)) {
+        console.log(props.queryData);
+      for (const key in props.queryData) {
+        formData.data[key] = props.queryData[key];
       }
-    );
-};
+    }
+  },
+  {
+    deep: true,
+  }
+);
 defineExpose({
   handleSubmit,
 });
-onMounted(() => {
-  getDict();
-});
+onMounted(() => {});
 </script>
-<style lang="scss" scoped>
-.row {
-  display: flex;
-  padding: 5px 15px;
-  justify-content: space-between;
-  align-items: center;
-  color: #999999;
-  .title {
-    flex: 1;
-  }
-  .delete {
-    width: 20px;
-    cursor: pointer;
-    text-align: center;
-  }
-}
-</style>
+<style lang="scss" scoped></style>

+ 10 - 9
src/views/processApproval/processDtl.vue

@@ -148,12 +148,13 @@ const handleResult = (res) => {
 	}
 }
 const skipPage = () => {
-	proxy.$router({
-		path:
-			route.query.processType === 10
-				? '/main/processApproval'
-				: componentObj[route.query.flowKey].backUrl,
-	})
+	onClickLeft()
+	// proxy.$router({
+	// 	path:
+	// 		route.query.processType === 10
+	// 			? '/main/processApproval'
+	// 			: componentObj.value[route.query.flowKey].backUrl,
+	// })
 }
 
 const handleSelectUser = () => {
@@ -174,7 +175,7 @@ const handleSubmit = async (_type) => {
 			proxy
 				.post('/flowProcess/jump', {
 					...flowForm,
-					childrenData,
+					data: childrenData,
 					handleType: _type,
 					version: route.query.version,
 					flowId: route.query.id,
@@ -195,7 +196,7 @@ const handleSubmit = async (_type) => {
 			proxy
 				.post('/flowProcess/initiate', {
 					...flowForm,
-					childrenData,
+					data: childrenData,
 				})
 				.then((res) => {
 					handleResult(res.data)
@@ -236,7 +237,7 @@ const getRecords = (_id) => {
 	}
 }
 onMounted(async () => {
-	//processType 10 为修改 20为查看 30回退发起 无为发起
+	//processType 10 为审批 20为查看 30回退发起 无为发起
 	if (!componentObj.value[route.query.flowKey]) {
 		showSuccessToast('代码未配置此流程!')
 		return