cz 1 year ago
parent
commit
574fa2771c

+ 976 - 0
src/views/processApproval/components/EhsdPurchaseChange.vue

@@ -0,0 +1,976 @@
+<template>
+  <div class="form">
+    <van-tabs v-model:active="active">
+      <van-tab :title="proxy.t('contract.transactionInformation')" />
+      <van-tab title="付款信息" />
+      <van-tab :title="'采购明细'" />
+      <van-tab :title="proxy.t('contract.otherCharges')" />
+      <van-tab :title="'到货要求'" />
+      <div class="common-process-card" v-show="active == 0">
+        <div class="common-title">
+          {{ proxy.t("contract.transactionInformation") }}
+        </div>
+        <testForm
+          v-model="formData.data"
+          :formOption="formOption"
+          :formConfig="formConfig"
+          :rules="rules"
+          ref="formDom1"
+        >
+        </testForm>
+      </div>
+      <div class="common-process-card" v-show="active == 1">
+        <div class="common-title">付款信息</div>
+        <testForm
+          v-model="formData.data"
+          :formOption="formOption"
+          :formConfig="formConfigOne"
+          :rules="rules"
+          ref="formDom2"
+        >
+        </testForm>
+      </div>
+      <div class="common-process-card" v-show="active == 2">
+        <div class="common-title">商品信息</div>
+        <testForm
+          v-model="formData.data"
+          :formOption="formGoodsOption"
+          :formConfig="formEmptyConfig"
+          :rules="rules"
+          ref="formDom3"
+        >
+        </testForm>
+      </div>
+      <div class="common-process-card" v-show="active == 3">
+        <div class="common-title">其他收费</div>
+        <testForm
+          v-model="formData.data"
+          :formOption="formProjectOption"
+          :formConfig="formEmptyConfig"
+          :rules="rules"
+          ref="formDom4"
+        >
+        </testForm>
+        <testForm
+          v-model="formData.data"
+          :formOption="formOption"
+          :formConfig="formAmountProjectConfig"
+          :rules="rules"
+          ref="formDom5"
+        >
+        </testForm>
+      </div>
+      <div class="common-process-card" v-show="active == 4">
+        <div class="common-title">到货要求</div>
+        <testForm
+          v-model="formData.data"
+          :formOption="formShipmentOption"
+          :formConfig="formEmptyConfig"
+          :rules="rulesTwo"
+          ref="formDom6"
+        >
+        </testForm>
+      </div>
+    </van-tabs>
+  </div>
+</template>
+
+<script setup>
+import {
+  ref,
+  getCurrentInstance,
+  onMounted,
+  defineProps,
+  defineExpose,
+  watch,
+  reactive,
+  toRefs,
+} from "vue";
+import { useRoute } from "vue-router";
+import testForm from "@/components/testForm/index.vue";
+import { getUserInfo } from "@/utils/auth";
+import { showFailToast } from "vant";
+
+// 接收父组件的传值
+const props = defineProps({
+  queryData: Object,
+});
+const refProps = toRefs(props);
+const proxy = getCurrentInstance().proxy;
+const route = useRoute();
+const active = ref(0);
+const tabsChange = () => {
+  active.value++;
+};
+const innerMethod = ref([]);
+const outsideMethod = ref([]);
+
+const formData = reactive({
+  data: {
+    purchaseProductList: [],
+    purchaseProjectList: [],
+    purchaseProjectList: [],
+  },
+});
+const formDom1 = ref(null);
+const formDom2 = ref(null);
+const formDom3 = ref(null);
+const formDom4 = ref(null);
+const formDom5 = ref(null);
+const formDom6 = ref(null);
+
+const formOption = reactive({
+  readonly: false,
+  disabled: false,
+  labelAlign: "top",
+  scroll: true,
+  labelWidth: "62pk",
+  hiddenSubmitBtn: true,
+});
+const formConfig = reactive([
+  {
+    type: "title",
+    title: "买方信息",
+  },
+  {
+    type: "picker",
+    label: "买方公司",
+    prop: "buyCorporationId",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+    readonly: false,
+    changeFn: (val, data) => {},
+  },
+  {
+    type: "input",
+    label: "地址",
+    prop: "buyCity",
+    itemType: "text",
+    readonly: false,
+  },
+  {
+    type: "input",
+    label: "详细地址",
+    prop: "buyAddress",
+    itemType: "textarea",
+  },
+  {
+    type: "input",
+    label: proxy.t("contract.contactName"),
+    prop: "buyContactName",
+    itemType: "text",
+  },
+  {
+    type: "input",
+    label: proxy.t("contract.contactNumber"),
+    prop: "buyContactNumber",
+    itemType: "text",
+  },
+  {
+    type: "title",
+    title: "卖方信息",
+  },
+  {
+    type: "picker",
+    label: "卖方公司",
+    prop: "sellCorporationId",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+    changeFn: (val, data) => {},
+  },
+  {
+    type: "cascader",
+    label: proxy.t("contract.cityText"),
+    prop: "countryCity",
+    itemType: "city",
+    showPicker: false,
+  },
+  {
+    type: "input",
+    label: "详细地址",
+    prop: "sellAddress",
+    itemType: "textarea",
+  },
+  {
+    type: "input",
+    label: proxy.t("contract.postalCode"),
+    prop: "sellPostalCode",
+    itemType: "text",
+  },
+  {
+    type: "input",
+    label: proxy.t("contract.contactName"),
+    prop: "sellContactName",
+    itemType: "text",
+  },
+  {
+    type: "input",
+    label: proxy.t("contract.contactNumber"),
+    prop: "sellContactNumber",
+    itemType: "text",
+  },
+]);
+const formConfigOne = reactive([
+  {
+    type: "picker",
+    label: "付款方式",
+    prop: "paymentMethod",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+    readonly: false,
+  },
+
+  {
+    type: "picker",
+    label: "发票类型",
+    prop: "invoiceType",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+    readonly: false,
+  },
+
+  {
+    type: "title",
+    title: "交付信息",
+  },
+  {
+    type: "picker",
+    label: "交货类型",
+    prop: "deliveryType",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [
+      {
+        label: "买方地址",
+        value: "1",
+      },
+      {
+        label: "工厂交付",
+        value: "2",
+      },
+      {
+        label: "其他",
+        value: "3",
+      },
+    ],
+    readonly: false,
+  },
+  {
+    type: "input",
+    label: "详细地址",
+    prop: "address",
+    itemType: "textarea",
+    readonly: false,
+  },
+
+  {
+    type: "picker",
+    label: "交货日期",
+    prop: "deliveryTime",
+    itemType: "datePicker",
+    showPicker: false,
+    split: "-",
+    columnsType: ["year", "month", "day"],
+  },
+  {
+    type: "input",
+    label: "保质期(天)",
+    prop: "warranty",
+    itemType: "number",
+  },
+]);
+const formGoodsOption = reactive({
+  readonly: false,
+  disabled: false,
+  labelAlign: "top",
+  scroll: true,
+  labelWidth: "62pk",
+  hiddenSubmitBtn: true,
+  btnConfig: {
+    isNeed: true,
+    prop: "purchaseProductList",
+    plain: true,
+    listTitle: "采购明细",
+    listConfig: [
+      {
+        type: "picker",
+        label: "产品名称",
+        prop: "productId",
+        itemType: "onePicker",
+        showPicker: false,
+        readonly: false,
+        fieldNames: {
+          text: "label",
+          value: "value",
+        },
+        data: [],
+        changeFn: (val, data, index, indexTwo, propName) => {},
+      },
+      {
+        type: "input",
+        label: "尺寸 cm*cm*cm",
+        prop: "productModel",
+        itemType: "text",
+      },
+      {
+        type: "input",
+        label: "数量",
+        prop: "quantity",
+        itemType: "number",
+        changeFn: () => {},
+      },
+      {
+        type: "input",
+        label: "单价",
+        prop: "price",
+        itemType: "number",
+        changeFn: () => {},
+      },
+      {
+        type: "input",
+        label: "金额小计",
+        prop: "amount",
+        itemType: "number",
+        changeFn: () => {},
+      },
+    ],
+    clickFn: () => {},
+    deleteFn: (index) => {},
+  },
+});
+const formEmptyConfig = reactive([]);
+const formAmountProjectConfig = reactive([
+  {
+    type: "title",
+    title: "合同条款",
+  },
+  {
+    type: "picker",
+    label: "合同模板",
+    prop: "contractTemplateId",
+    itemType: "onePicker",
+    showPicker: false,
+    readonly: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+    changeFn: (val, data) => {},
+  },
+  {
+    type: "input",
+    label: "条款内容",
+    prop: "remark",
+    itemType: "textarea",
+    readonly: false,
+  },
+  {
+    type: "title",
+    title: "合同总金额",
+  },
+  {
+    type: "input",
+    label: "合同总金额",
+    prop: "amount",
+    itemType: "text",
+    readonly: true,
+  },
+]);
+const formProjectOption = reactive({
+  readonly: false,
+  disabled: false,
+  labelAlign: "top",
+  scroll: true,
+  labelWidth: "62pk",
+  hiddenSubmitBtn: true,
+  btnConfig: {
+    isNeed: true,
+    prop: "purchaseProjectList",
+    plain: true,
+    listTitle: "收费项目",
+    listConfig: [
+      {
+        type: "input",
+        label: "收费项目",
+        prop: "payName",
+        itemType: "text",
+      },
+      {
+        type: "input",
+        label: "金额",
+        prop: "amount",
+        itemType: "number",
+        changeFn: () => {
+          handleChangeAmount();
+        },
+      },
+      {
+        type: "input",
+        label: "备注",
+        prop: "remark",
+        itemType: "textarea",
+      },
+    ],
+    clickFn: () => {
+      if (
+        formData.data.purchaseProjectList &&
+        formData.data.purchaseProjectList.length > 0
+      ) {
+        formData.data.purchaseProjectList.push({
+          payName: null,
+          amount: null,
+          remark: null,
+        });
+      } else {
+        formData.data.purchaseProjectList = [
+          {
+            payName: null,
+            amount: null,
+            remark: null,
+          },
+        ];
+      }
+    },
+    deleteFn: (index) => {
+      formData.data.purchaseProjectList.splice(index, 1);
+      handleChangeAmount();
+    },
+  },
+});
+
+const formShipmentOption = reactive({
+  readonly: false,
+  disabled: false,
+  labelAlign: "top",
+  scroll: true,
+  labelWidth: "62pk",
+  hiddenSubmitBtn: true,
+  btnConfig: {
+    isNeed: false,
+    prop: "purchaseArrivalList",
+    plain: true,
+    listTitle: "商品",
+    listConfig: [
+      {
+        type: "input",
+        label: "商品编码",
+        prop: "productCode",
+        itemType: "text",
+      },
+      {
+        type: "input",
+        label: "商品名称",
+        prop: "productName",
+        itemType: "text",
+      },
+      {
+        type: "picker",
+        label: "到货日期",
+        prop: "arrivalTime",
+        itemType: "datePicker",
+        showPicker: false,
+        split: "-",
+        columnsType: ["year", "month", "day"],
+      },
+      {
+        type: "input",
+        label: "到货数量",
+        prop: "quantity",
+        itemType: "number",
+      },
+    ],
+  },
+});
+const rules = {
+  contractType: [
+    { required: true, message: proxy.t("contract.contractTypeMsg") },
+  ],
+  contractTemplateId: [
+    { required: true, message: proxy.t("contract.contractTemplateIdMsg") },
+  ],
+  sellCorporationId: [
+    { required: true, message: proxy.t("contract.sellCorporationIdMsg") },
+  ],
+  buyCorporationId: [
+    { required: true, message: proxy.t("contract.buyCorporationIdMsg") },
+  ],
+  sellCity: [{ required: true, message: proxy.t("contract.cityMsg") }],
+  countryCity: [{ required: true, message: proxy.t("contract.cityMsg") }],
+  sellAddress: [{ required: true, message: proxy.t("contract.addressMsg") }],
+  buyAddress: [{ required: true, message: proxy.t("contract.addressMsg") }],
+  sellContactName: [
+    { required: true, message: proxy.t("contract.contactNameMsg") },
+  ],
+  sellContactNumber: [
+    { required: true, message: proxy.t("contract.contactNumberMsg") },
+  ],
+  // buyPostalCode: [{ required: true, message: proxy.t("contract.postalCodeMsg") }],
+  buyContactName: [
+    { required: true, message: proxy.t("contract.contactNameMsg") },
+  ],
+  buyContactNumber: [
+    { required: true, message: proxy.t("contract.contactNumberMsg") },
+  ],
+  productId: [{ required: true, message: proxy.t("contract.productIdMsg") }],
+  productName: [
+    { required: true, message: proxy.t("contract.productNameMsg") },
+  ],
+  productModel: [
+    { required: true, message: proxy.t("contract.productModelMsg") },
+  ],
+  quantity: [{ required: true, message: proxy.t("contract.quantityMsg") }],
+  price: [{ required: true, message: proxy.t("contract.priceMsg") }],
+  payName: [{ required: true, message: proxy.t("contract.chargeItemMsg") }],
+  amount: [{ required: true, message: proxy.t("contract.amountMsg") }],
+};
+const rulesTwo = {
+  currency: [{ required: true, message: proxy.t("contract.currencyMsg") }],
+  paymentMethod: [
+    { required: true, message: proxy.t("contract.paymentMethodMsg") },
+  ],
+  advanceRatio: [
+    { required: true, message: proxy.t("contract.advanceRatioMsg") },
+  ],
+  shroffAccountId: [
+    { required: true, message: proxy.t("contract.shroffAccountIdMsg") },
+  ],
+  tradeMethods: [
+    { required: true, message: proxy.t("contract.tradeMethodsMsg") },
+  ],
+  transportMethod: [
+    { required: true, message: proxy.t("contract.transportMethodMsg") },
+  ],
+  transportRemark: [
+    { required: true, message: proxy.t("contract.transportRemarkMsg") },
+  ],
+  remark: [{ required: true, message: proxy.t("contract.remarksMsg") }],
+};
+const getProduct = () => {
+  return new Promise((resolve, reject) => {
+    proxy
+      .post("productInfo/getConditionProductList", {
+        pageNum: 1,
+        pageSize: 9999,
+        definition: "1",
+      })
+      .then((res) => {
+        if (res.data.rows && res.data.rows.length > 0) {
+          const data = res.data.rows.map((x) => {
+            if (x.ehsdJson) {
+              let jsonObj = JSON.parse(x.ehsdJson);
+              x.nameEnglish = jsonObj.nameEnglish;
+            }
+            return {
+              ...x,
+              label: x.nameEnglish,
+              value: x.id,
+            };
+          });
+          resolve(data);
+        }
+      });
+  });
+};
+
+const getMaterial = () => {
+  return new Promise((resolve, reject) => {
+    proxy
+      .post("productInfo/page", {
+        pageNum: 1,
+        pageSize: 9999,
+        definition: "2",
+      })
+      .then((res) => {
+        if (res.data.rows && res.data.rows.length > 0) {
+          const data = res.data.rows.map((x) => {
+            return {
+              ...x,
+              label: x.name,
+              value: x.id,
+            };
+          });
+          resolve(data);
+        }
+      });
+  });
+};
+
+const getDict = () => {
+  let query = {
+    pageNum: 1,
+    pageSize: 999,
+    tenantId: getUserInfo().tenantId,
+  };
+  // 合同模板
+  proxy
+    .post("/contractTemplate/page", { pageNum: 1, pageSize: 999 })
+    .then((res) => {
+      formAmountProjectConfig[1].data = res.data.rows.map((item) => {
+        return {
+          ...item,
+          label: item.templateName,
+          value: item.id,
+        };
+      });
+    });
+  // 买方
+  proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    formConfig[1].data = res.data.rows.map((item) => {
+      return {
+        ...item,
+        label: item.name,
+        value: item.id,
+      };
+    });
+  });
+
+  // 产品
+  Promise.all([getProduct(), getMaterial()]).then((res) => {
+    formGoodsOption.btnConfig.listConfig[0].data = res[0].concat(res[1]);
+  });
+
+  // 付款方式
+  proxy
+    .post("/dictTenantData/page", {
+      ...query,
+      dictCode: "funds_payment_method",
+    })
+    .then((res) => {
+      if (res.data.rows && res.data.rows.length > 0) {
+        formConfigOne[0].data = res.data.rows.map((item) => {
+          return {
+            label: item.dictValue,
+            value: item.dictKey,
+          };
+        });
+      }
+    });
+
+  // 发票类型
+  proxy
+    .post("/dictTenantData/page", { ...query, dictCode: "invoice_type" })
+    .then((res) => {
+      if (res.data.rows && res.data.rows.length > 0) {
+        formConfigOne[1].data = res.data.rows.map((item) => {
+          return {
+            label: item.dictValue,
+            value: item.dictKey,
+          };
+        });
+      }
+    });
+  // if (["10", "20"].includes(route.query.processType)) {
+  //   proxy
+  //     .post("/customer/selPage", { pageNum: 1, pageSize: 50 })
+  //     .then((res) => {
+  //       formConfig[8].data = res.data.rows.map((x) => ({
+  //         ...x,
+  //         label: x.name,
+  //         value: x.id,
+  //       }));
+  //     });
+  // }
+};
+getDict();
+const calculatedAmount = () => {
+  if (
+    formData.data.purchaseProductList &&
+    formData.data.purchaseProductList.length > 0
+  ) {
+    for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
+      let money = 0;
+      if (
+        formData.data.purchaseProductList[i].quantity &&
+        formData.data.purchaseProductList[i].price
+      ) {
+        money = Number(
+          Math.round(
+            Number(formData.data.purchaseProductList[i].quantity) *
+              Number(formData.data.purchaseProductList[i].price) *
+              10000
+          ) / 10000
+        );
+      }
+      formData.data.purchaseProductList[i].amount = money;
+    }
+  }
+  handleChangeAmount();
+};
+const handleChangeAmount = () => {
+  let money = 0;
+  let amountProduct = 0;
+  let amountProject = 0;
+  if (
+    formData.data.purchaseProductList &&
+    formData.data.purchaseProductList.length > 0
+  ) {
+    for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
+      if (formData.data.purchaseProductList[i].amount) {
+        money = Number(
+          Math.round(
+            (Number(money) +
+              Number(formData.data.purchaseProductList[i].amount)) *
+              10000
+          ) / 10000
+        );
+        amountProduct = Number(
+          Math.round(
+            (Number(amountProduct) +
+              Number(formData.data.purchaseProductList[i].amount)) *
+              10000
+          ) / 10000
+        );
+      }
+    }
+  }
+  if (
+    formData.data.purchaseProjectList &&
+    formData.data.purchaseProjectList.length > 0
+  ) {
+    for (let i = 0; i < formData.data.purchaseProjectList.length; i++) {
+      if (formData.data.purchaseProjectList[i].amount) {
+        money = Number(
+          Math.round(
+            (Number(money) +
+              Number(formData.data.purchaseProjectList[i].amount)) *
+              10000
+          ) / 10000
+        );
+        amountProject = Number(
+          Math.round(
+            (Number(amountProject) +
+              Number(formData.data.purchaseProjectList[i].amount)) *
+              10000
+          ) / 10000
+        );
+      }
+    }
+  }
+  formData.data.amount = money;
+  formData.data.amountProduct = amountProduct;
+  formData.data.amountProject = amountProject;
+};
+const handleSubmit = async () => {
+  const flag = await formDom1.value.validateForm().then((status) => {
+    if (status) {
+      active.value = 0;
+      return false;
+    } else {
+      if (
+        !(
+          formData.data.purchaseProductList &&
+          formData.data.purchaseProductList.length > 0
+        )
+      ) {
+        active.value = 1;
+        showFailToast("请添加采购明细");
+        return false;
+      }
+      return formDom2.value.validateForm().then((status1) => {
+        if (status1) {
+          active.value = 1;
+          return false;
+        } else {
+          return formDom4.value.validateForm().then((status2) => {
+            if (status2) {
+              active.value = 2;
+              return false;
+            } else {
+              return formDom6.value.validateForm().then((status3) => {
+                if (status3) {
+                  active.value = 3;
+                  return false;
+                } else {
+                  return true;
+                }
+              });
+            }
+          });
+        }
+      });
+    }
+  });
+  if (flag) {
+    return formData.data;
+  }
+};
+let status = ref(true);
+onMounted(() => {
+  if (route.query && route.query.businessId) {
+    let businessId = route.query.businessId;
+    proxy.post("/ehsdPurchase/detail", { id: businessId }).then((res) => {
+      res.data.purchaseProductList = res.data.ehsdPurchaseProductList || [];
+      let arr = [];
+      for (let i = 0; i < res.data.purchaseProductList.length; i++) {
+        const ele = res.data.purchaseProductList[i];
+        arr = arr.concat(ele.purchaseProductMountingsList);
+      }
+      res.data.purchaseProductList = arr;
+      res.data.countryId = res.data.sellCountryId;
+      res.data.provinceId = res.data.sellProvinceId;
+      res.data.cityId = res.data.sellCityId;
+      res.data.buyCity =
+        res.data.buyCountryName +
+        res.data.buyProvinceName +
+        res.data.buyCityName;
+      proxy
+        .post("/supplierInfo/page", { keyword: res.data.sellCorporationName })
+        .then((res) => {
+          formConfig[7].data = res.data.rows.map((item) => {
+            return {
+              ...item,
+              label: item.name,
+              value: item.id,
+            };
+          });
+        });
+      for (const key in res.data) {
+        formData.data[key] = res.data[key];
+      }
+      formData.data.countryCityName =
+        res.data.sellCountryName +
+        " " +
+        res.data.sellProvinceName +
+        " " +
+        res.data.sellCityName;
+      if (["10", "20"].includes(route.query.processType)) {
+        formOption.readonly = true;
+        formGoodsOption.readonly = true;
+        formGoodsOption.btnConfig.isNeed = false;
+        formProjectOption.readonly = true;
+        formProjectOption.btnConfig.isNeed = false;
+        formShipmentOption.readonly = true;
+      }
+      setTimeout(() => {
+        formDom1.value.formDataShowLabelOne();
+        formDom2.value.formDataShowLabelOne();
+      }, 200);
+    });
+  }
+});
+watch(
+  refProps.queryData,
+  () => {
+    console.log(refProps.queryData, "aa");
+    return;
+    if (
+      refProps.queryData.value &&
+      ["10", "20", "30"].includes(route.query.processType)
+    ) {
+      for (const key in refProps.queryData.value) {
+        formData.data[key] = refProps.queryData.value[key];
+      }
+      formDom1.value.formDataShowLabelOne();
+      formDom2.value.formDataListShowLabelOne();
+      formDom6.value.formDataShowLabelOne();
+      if (!formData.data.sellCity) {
+        let sellCity = "";
+        if (formData.data.sellCountryName) {
+          sellCity = formData.data.sellCountryName;
+        }
+        if (formData.data.sellProvinceName) {
+          sellCity = sellCity + " " + formData.data.sellProvinceName;
+        }
+        if (formData.data.sellCityName) {
+          sellCity = sellCity + " " + formData.data.sellCityName;
+        }
+        formData.data.sellCity = sellCity;
+      }
+      if (["10", "20"].includes(route.query.processType)) {
+        formOption.readonly = true;
+        formGoodsOption.readonly = true;
+        formGoodsOption.btnConfig.isNeed = false;
+        formProjectOption.readonly = true;
+        formProjectOption.btnConfig.isNeed = false;
+        formShipmentOption.readonly = true;
+      }
+      handleChangeAmount();
+      if (status.value) {
+        if (!formData.data.countryCityName) {
+          if (formData.data.countryId) {
+            let countryCityName = "";
+            formData.data.countryCity = formData.data.countryId;
+            proxy.post("/customizeArea/list", { parentId: "0" }).then((res) => {
+              let list = res.data.filter(
+                (item) => item.id == formData.data.countryId
+              );
+              if (list && list.length > 0) {
+                countryCityName = list[0].name;
+                formData.data.countryCityName = countryCityName;
+              }
+              if (formData.data.provinceId) {
+                formData.data.countryCity = formData.data.provinceId;
+                proxy
+                  .post("/customizeArea/list", {
+                    parentId: formData.data.countryId,
+                  })
+                  .then((res) => {
+                    let list = res.data.filter(
+                      (item) => item.id == formData.data.provinceId
+                    );
+                    if (list && list.length > 0) {
+                      countryCityName = countryCityName + " " + list[0].name;
+                      formData.data.countryCityName = countryCityName;
+                    }
+                    if (formData.data.cityId) {
+                      formData.data.countryCity = formData.data.cityId;
+                      proxy
+                        .post("/customizeArea/list", {
+                          parentId: formData.data.provinceId,
+                        })
+                        .then((res) => {
+                          let list = res.data.filter(
+                            (item) => item.id == formData.data.cityId
+                          );
+                          if (list && list.length > 0) {
+                            countryCityName =
+                              countryCityName + " " + list[0].name;
+                            formData.data.countryCityName = countryCityName;
+                          }
+                        });
+                    }
+                  });
+              }
+            });
+          }
+        }
+        status.value = false;
+      }
+    }
+  },
+  {
+    deep: true,
+  }
+);
+defineExpose({
+  handleSubmit,
+  tabsChange,
+});
+onMounted(() => {});
+</script>
+<style lang="scss" scoped></style>

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

@@ -44,7 +44,7 @@
         <div
           class="for-btn"
           @click="footerMoreBtnType = !footerMoreBtnType"
-          v-if="approvalRecordData.buttonInfoList.length < 1"
+          v-if="approvalRecordData.buttonInfoList.length > 1"
         >
           <div>
             <i class="iconfont icon-iconx__caidan1"></i>
@@ -78,7 +78,7 @@
         </span>
         {{ i.name }}
       </div>
-      <div style="height: 50px">1</div>
+      <div style="height: 50px"></div>
     </van-action-sheet>
     <van-action-sheet
       v-model:show="footerMoreType"
@@ -157,6 +157,7 @@ import EhsdContractChange from "./components/EhsdContractChange";
 import EhsdSample from "./components/EhsdSample";
 import EhsdSampleChange from "./components/EhsdSampleChange";
 import EhsdPurchase from "./components/EhsdPurchase";
+import EhsdPurchaseChange from "./components/EhsdPurchaseChange";
 
 import SendPurchase from "./components/SendPurchase";
 import SendPurchasePayment from "./components/SendPurchasePayment";
@@ -258,6 +259,12 @@ let componentObj = ref({
     backUrl: "/main/working",
     tabsNum: 5,
   },
+  ehsd_purchase_update_flow: {
+    title: "采购合同变更",
+    component: EhsdPurchaseChange,
+    backUrl: "/main/working",
+    tabsNum: 5,
+  },
 });
 
 let dialogVisible = ref(false);