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

+ 27 - 5
src/main.js

@@ -1,13 +1,32 @@
-import { createApp } from "vue";
+import {
+  createApp
+} from "vue";
 import App from "./App.vue";
 import router from "./router";
 import i18n from "@/lang/";
-import { moneyFormat, getDictOne, compareTime, dictValueLabel, formChange, formChangeTwo, deepClone } from "@/utils/util";
+import {
+  moneyFormat,
+  getDictOne,
+  compareTime,
+  dictValueLabel,
+  formChange,
+  formChangeTwo,
+  deepClone
+} from "@/utils/util";
+import {
+  handleTree
+} from "@/utils/ruoyi";
+
 const app = createApp(App);
 app.use(router);
 app.use(i18n).mount("#app");
-import { uploadDdRightBtn } from "@/utils/ddAdapter";
-import { post, get } from "@/utils/axios";
+import {
+  uploadDdRightBtn
+} from "@/utils/ddAdapter";
+import {
+  post,
+  get
+} from "@/utils/axios";
 
 import store from './store'
 
@@ -27,10 +46,13 @@ app.config.globalProperties.formChange = formChange;
 app.config.globalProperties.formChangeTwo = formChangeTwo;
 // 深拷贝
 app.config.globalProperties.deepClone = deepClone;
+app.config.globalProperties.handleTree = handleTree;
+
+
 //pinia
 app.use(store);
 
 
 //中英文全局挂载
 app.config.globalProperties.t = i18n.global.t;
-export default app;
+export default app;

+ 13 - 3
src/router/index.js

@@ -126,12 +126,12 @@ const routes = [{
 			},
 			{
 				path: 'technology',
-				name: '工艺管理',
+				name: '产线管理',
 				component: () => import('../views/production/technology/index.vue')
 			},
 			{
 				path: 'technologyadd',
-				name: '工艺管理新增',
+				name: '产线管理详情',
 				component: () => import('../views/production/technology/add.vue')
 			},
 			{
@@ -386,7 +386,17 @@ const routes = [{
 				name: '出入库流水',
 				component: () => import('../views/purchase-sales/inventory-management/outInList/index.vue')
 			},
-			// ***********************  MES模块路由     *********************** 
+			// ***********************  MES模块路由     ***********************
+			{
+				path: 'processes',
+				name: '工序管理',
+				component: () => import('../views/MES/processes/index.vue')
+			},
+			{
+				path: 'processesAdd',
+				name: '工序管理详情',
+				component: () => import('../views/MES/processes/add.vue')
+			},
 			{
 				path: 'workOrder',
 				name: '工单管理',

+ 11 - 9
src/utils/ruoyi.js

@@ -1,5 +1,3 @@
-
-
 /**
  * 通用js方法封装处理
  * Copyright (c) 2019 ruoyi
@@ -37,7 +35,9 @@ export function parseTime(time, pattern) {
   const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
     let value = formatObj[key]
     // Note: getDay() returns 0 on Sunday
-    if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
+    if (key === 'a') {
+      return ['日', '一', '二', '三', '四', '五', '六'][value]
+    }
     if (result.length > 0 && value < 10) {
       value = '0' + value
     }
@@ -88,7 +88,7 @@ export function selectDictLabel(datas, value) {
 
 // 回显数据字典(字符串数组)
 export function selectDictLabels(datas, value, separator) {
-  if (value === undefined || value.length ===0) {
+  if (value === undefined || value.length === 0) {
     return "";
   }
   if (Array.isArray(value)) {
@@ -114,7 +114,9 @@ export function selectDictLabels(datas, value, separator) {
 
 // 字符串格式化(%s )
 export function sprintf(str) {
-  var args = arguments, flag = true, i = 1;
+  var args = arguments,
+    flag = true,
+    i = 1;
   str = str.replace(/%s/g, function () {
     var arg = args[i++];
     if (typeof arg === 'undefined') {
@@ -202,9 +204,9 @@ export function handleTree(data, id, parentId, children) {
 }
 
 /**
-* 参数处理
-* @param {*} params  参数
-*/
+ * 参数处理
+ * @param {*} params  参数
+ */
 export function tansParams(params) {
   let result = ''
   for (const propName of Object.keys(params)) {
@@ -249,4 +251,4 @@ export async function blobValidate(data) {
   } catch (error) {
     return true;
   }
-}
+}

+ 231 - 0
src/views/MES/processes/add.vue

@@ -0,0 +1,231 @@
+<template>
+  <div class="form" style="padding-bottom: 60px">
+    <van-nav-bar :title="$t('task.name')" :left-text="$t('common.back')" left-arrow @click-left="onClickLeft">
+    </van-nav-bar>
+    <testForm v-model="formData.data" :formOption="formOption" :formConfig="formConfig" :rules="rules" @onSubmit="onSubmit" ref="formDom"></testForm>
+  </div>
+</template>
+
+<script setup>
+import { ref, reactive, getCurrentInstance, onMounted } from "vue";
+import { showSuccessToast, showFailToast } from "vant";
+import { useRoute } from "vue-router";
+import testForm from "@/components/testForm/index.vue";
+const proxy = getCurrentInstance().proxy;
+const route = useRoute();
+const formDom = ref(null);
+const formData = reactive({
+  data: {
+    productionTaskDetailList: [],
+  },
+});
+const rules = {
+  productionPlanId: [
+    { required: true, message: proxy.t("task.selectProductionPlan") },
+  ],
+  dueDate: [
+    { required: true, message: proxy.t("task.selectCompletionDeadline") },
+  ],
+  personLiableId: [
+    { required: true, message: proxy.t("task.selectPrincipal") },
+  ],
+  quantity: [
+    { required: true, message: proxy.t("task.taskQuantityCanNotBeEmpty") },
+  ],
+};
+const formOption = reactive({
+  readonly: false, //用于控制整个表单是否只读
+  disabled: false,
+  labelAlign: "top",
+  scroll: true,
+  labelWidth: "62pk",
+  hiddenSubmitBtn: false,
+  btnConfig: {
+    isNeed: false,
+    prop: "productionTaskDetailList",
+    plain: true,
+    listTitle: proxy.t("common.productDetails"),
+    listConfig: [
+      {
+        type: "input",
+        itemType: "text",
+        label: proxy.t("receive.productSN"),
+        prop: "productSn",
+        readonly: true,
+      },
+      {
+        type: "input",
+        itemType: "text",
+        label: proxy.t("task.currentProcess"),
+        prop: "productionProcessesName",
+        readonly: true,
+      },
+      {
+        type: "input",
+        itemType: "text",
+        label: proxy.t("task.accumulatedTimeConsumption"),
+        prop: "cumulativeTime",
+        readonly: true,
+      },
+    ],
+    clickFn: () => {},
+  },
+});
+const formConfig = reactive([
+  // {
+  //   type: "picker",
+  //   label: proxy.t('task.productionPlan'),
+  //   prop: "productionPlanId",
+  //   itemType: "onePicker",
+  //   showPicker: false,
+  //   fieldNames: {
+  //     text: "label",
+  //     value: "value",
+  //   },
+  //   data: [],
+  //   changeFn: (option, item, index) => {
+  //     if (option.selectedOptions[0]) {
+  //       formData.data["productionPlanId" + "Name"] =
+  //         option.selectedOptions[0].label;
+  //       formData.data.productionPlanId = option.selectedOptions[0].value;
+  //       formData.data.productName = option.selectedOptions[0].productName;
+  //       formData.data.waitQuantity =
+  //         option.selectedOptions[0].remainingQuantity;
+  //       formData.data.startDate = option.selectedOptions[0].startDate;
+  //       formConfig[index].showPicker = false;
+  //     } else {
+  //       formConfig[index].showPicker = false;
+  //     }
+  //   },
+  // },
+  {
+    type: "input",
+    itemType: "text",
+    label: "工序名称",
+    prop: "name",
+    readonly: true,
+  },
+  {
+    type: "input",
+    itemType: "textarea",
+    label: "工序说明",
+    prop: "remarks",
+    readonly: true,
+  },
+  // {
+  //   type: "input",
+  //   itemType: "number",
+  //   label: proxy.t('task.scheduledQuantity'),
+  //   prop: "waitQuantity",
+  //   readonly: true,
+  // },
+  // {
+  //   type: "input",
+  //   itemType: "number",
+  //   label: proxy.t('task.taskQuantity'),
+  //   prop: "quantity",
+  // },
+  // {
+  //   type: "picker",
+  //   label: proxy.t('task.principal'),
+  //   prop: "personLiableId",
+  //   itemType: "onePicker",
+  //   showPicker: false,
+  //   fieldNames: {
+  //     text: "label",
+  //     value: "value",
+  //   },
+  //   data: [],
+  // },
+  // {
+  //   type: "picker",
+  //   label: proxy.t('task.completionDeadline'),
+  //   prop: "dueDate",
+  //   itemType: "datePicker",
+  //   showPicker: false,
+  //   split: "-",
+  //   columnsType: ["year", "month", "day"],
+  // },
+]);
+const getDict = () => {
+  proxy
+    .post("/productionPlan/page", { pageNum: 1, pageSize: 9999 })
+    .then((res) => {
+      formConfig[0].data = res.data.rows.map((item) => {
+        return {
+          ...item,
+          label: item.code,
+          value: item.id,
+        };
+      });
+    });
+
+  proxy.get("/system/user/list?pageNum=1&pageSize=9999").then((res) => {
+    formConfig[4].data = res.rows.map((item) => {
+      return {
+        label: item.userName,
+        value: item.userId,
+      };
+    });
+  });
+};
+
+const onClickLeft = () => history.back();
+const onSubmit = () => {
+  if (Number(formData.data.quantity) > Number(formData.data.waitQuantity)) {
+    return showFailToast(
+      proxy.t("task.taskQuantityCanNotBeGreaterThanTheScheduledQuantity")
+    );
+  }
+  if (proxy.compareTime(formData.data.startDate, formData.data.dueDate)) {
+    return showFailToast(
+      proxy.t("task.completionDeadlineCanNotBeEarlierThanThePlanStartTime")
+    );
+  }
+  proxy.post("/productionTask/addByJxst", formData.data).then(
+    (res) => {
+      setTimeout(() => {
+        showSuccessToast(proxy.t("common.addSuccess"));
+        proxy.$router.push("/main/jxskTask");
+      }, 500);
+    },
+    (err) => {
+      return showFailToast(err.message);
+    }
+  );
+};
+const getDetails = () => {
+  proxy.post("/productionProcesses/detail", { id: route.query.id }).then(
+    (res) => {
+      formData.data = res.data;
+    },
+    (err) => {
+      return showFailToast(err.message);
+    }
+  );
+};
+onMounted(() => {
+  // getDict();
+  if (route.query.id) {
+    getDetails();
+    formOption.readonly = true; //全部只读
+    formOption.hiddenSubmitBtn = true; //隐藏提交按钮
+  }
+});
+</script>
+<style lang="scss" scoped>
+.row {
+  display: flex;
+  padding: 5px 10px 0 10px;
+  justify-content: space-between;
+  align-items: center;
+  .title {
+    flex: 1;
+  }
+  .delete {
+    width: 20px;
+    cursor: pointer;
+    text-align: center;
+  }
+}
+</style>

+ 92 - 0
src/views/MES/processes/index.vue

@@ -0,0 +1,92 @@
+<template>
+  <div style="padding-bottom: 60px">
+    <van-nav-bar :title="$t('workOrder.name')" left-text="" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
+      <!-- <template #right> {{$t('common.add')}} </template> -->
+    </van-nav-bar>
+    <van-search v-model="req.keyword" :placeholder="$t('common.pleaseEnterKeywords')" @search="onRefresh" />
+
+    <van-pull-refresh v-model="loading" @refresh="onRefresh">
+      <div class="list">
+        <van-list v-model:loading="loading" :finished="finished" :finished-text="$t('common.noMore')" @load="onLoad" style="margin-bottom: 60px">
+          <commonList :data="listData" @onClick="toDtl" :config="listConfig"></commonList>
+        </van-list>
+      </div>
+    </van-pull-refresh>
+  </div>
+</template>
+<script setup>
+import { ref, getCurrentInstance, onMounted } from "vue";
+import commonList from "@/components/common-list.vue";
+import { useRoute } from "vue-router";
+const loading = ref(false);
+const router = useRoute();
+const req = ref({
+  pageNum: 1,
+  type: "1",
+  keyword: null,
+});
+const finished = ref(false);
+const proxy = getCurrentInstance().proxy;
+const listData = ref([]);
+
+const listConfig = ref([
+  {
+    label: "工序名称",
+    prop: "name",
+  },
+  {
+    label: "工序说明",
+    prop: "remarks",
+  },
+]);
+const onRefresh = () => {
+  req.value.pageNum = 1;
+  finished.value = false;
+  getList("refresh");
+};
+const onLoad = () => {
+  getList();
+};
+
+const onClickLeft = () => proxy.$router.push("/main/working");
+
+const onClickRight = () => {
+  proxy.$router.push("/main/workOrderAdd");
+};
+proxy.uploadDdRightBtn(onClickRight, proxy.t("common.add"));
+const toDtl = (row) => {
+  proxy.$router.push({
+    path: "processesAdd",
+    query: {
+      id: row.id,
+    },
+  });
+};
+
+const getList = (type) => {
+  loading.value = true;
+  proxy
+    .post("/productionProcesses/page", req.value)
+    .then((res) => {
+      listData.value =
+        type === "refresh"
+          ? res.data.rows
+          : listData.value.concat(res.data.rows);
+      if (req.value.pageNum * 10 >= res.data.total) {
+        finished.value = true;
+      }
+      req.value.pageNum++;
+      loading.value = false;
+    })
+    .catch((err) => {
+      loading.value = false;
+    });
+};
+// getList();
+</script>
+
+<style lang="scss" scoped>
+.list {
+  min-height: 70vh;
+}
+</style>

+ 80 - 241
src/views/processApproval/components/EhsdContract.vue

@@ -5,7 +5,7 @@
       <van-tab title="付款信息" />
       <van-tab :title="proxy.t('contract.commodityInformation')" />
       <van-tab :title="proxy.t('contract.otherCharges')" />
-      <van-tab :title="proxy.t('contract.shipmentPlan')" />
+
       <div class="common-process-card" v-show="active == 0">
 
         <div style="margin-bottom:20px" v-if="route.query && route.query.businessId">
@@ -33,11 +33,7 @@
         <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>
@@ -84,7 +80,6 @@ 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,
@@ -97,80 +92,43 @@ const formOption = reactive({
 const formConfigCode = reactive([
   {
     type: "title",
-    title: "合同号",
-  },
-  {
-    type: "input",
-    label: "合同号",
-    prop: "code",
-    itemType: "text",
-    readonly: true,
+    title: "合同类型",
   },
-]);
-const formConfig = reactive([
   {
     type: "picker",
-    label: proxy.t("contract.contractTemplateId"),
-    prop: "contractTemplateId",
+    label: "合同类型",
+    prop: "contractType",
     itemType: "onePicker",
     showPicker: false,
     fieldNames: {
-      text: "label",
-      value: "value",
+      text: "dictValue",
+      value: "dictKey",
     },
-    data: [],
-    changeFn: (val, data) => {
-      proxy.formChange(val, data, formData);
-      formData.data.sellCorporationId = "";
-      formData.data.sellCountryName = "";
-      formData.data.sellProvinceName = "";
-      formData.data.sellCityName = "";
-      formData.data.sellAddress = "";
-      formData.data.sellContactName = "";
-      formData.data.sellContactNumber = "";
-      if (val.selectedValues[0]) {
-        proxy
-          .post("/contractTemplate/detail", { id: val.selectedValues[0] })
-          .then((res) => {
-            formData.data.sellCorporationId = res.data.corporationId;
-            if (res.data.corporationId) {
-              proxy
-                .post("/corporation/detail", { id: res.data.corporationId })
-                .then((detailCorporation) => {
-                  let sellCity = "";
-                  if (detailCorporation.data.countryEnStr) {
-                    formData.data.sellCountryName =
-                      detailCorporation.data.countryEnStr;
-                    sellCity = detailCorporation.data.countryEnStr;
-                  }
-                  if (detailCorporation.data.provinceEnStr) {
-                    formData.data.sellProvinceName =
-                      detailCorporation.data.provinceEnStr;
-                    sellCity =
-                      sellCity + " " + detailCorporation.data.provinceEnStr;
-                  }
-                  if (detailCorporation.data.cityEnStr) {
-                    formData.data.sellCityName =
-                      detailCorporation.data.cityEnStr;
-                    sellCity =
-                      sellCity + " " + detailCorporation.data.cityEnStr;
-                  }
-                  if (detailCorporation.data.addressEn) {
-                    formData.data.sellAddress =
-                      detailCorporation.data.addressEn;
-                  }
-                  formData.data.sellCity = sellCity;
-                  formDom1.value.formDataShowLabelOne();
-                });
-            }
-            formData.data.sellContactName = res.data.contactName;
-            formData.data.sellContactNumber = res.data.contactNumber;
-            formDom1.value.formDataShowLabelOne();
-          });
-      }
-      data.showPicker = false;
+    data: [
+      {
+        dictKey: "2",
+        dictValue: "内销",
+      },
+      {
+        dictKey: "1",
+        dictValue: "外销",
+      },
+    ],
+  },
+  {
+    type: "cascader",
+    label: "归属公司",
+    prop: "companyId",
+    itemType: "common",
+    showPicker: false,
+    fieldNames: {
+      text: "deptName",
+      value: "deptId",
     },
+    data: [],
   },
+]);
+const formConfig = reactive([
   {
     type: "title",
     title: proxy.t("contract.sellerInformation"),
@@ -366,7 +324,7 @@ const formConfigOne = reactive([
   },
   {
     type: "input",
-    label: "预付比例",
+    label: "预付比例(%)",
     prop: "advanceRatio",
     itemType: "number",
     readonly: false,
@@ -406,6 +364,24 @@ const formConfigOne = reactive([
   },
   {
     type: "input",
+    label: "户名",
+    prop: "accountName",
+    itemType: "text",
+  },
+  {
+    type: "input",
+    label: "开户行",
+    prop: "openingBank",
+    itemType: "text",
+  },
+  {
+    type: "input",
+    label: "账号",
+    prop: "accountOpening",
+    itemType: "text",
+  },
+  {
+    type: "input",
     label: "Beneficiary Name",
     prop: "beneficiaryName",
     itemType: "text",
@@ -445,13 +421,6 @@ const formConfigOne = reactive([
     title: "交付信息",
   },
   {
-    type: "input",
-    label: "报价有效期 (天)",
-    prop: "effective",
-    itemType: "number",
-    readonly: false,
-  },
-  {
     type: "picker",
     label: "交货期限",
     prop: "deliveryTime",
@@ -495,14 +464,14 @@ const formGoodsOption = reactive({
     listConfig: [
       {
         type: "picker",
-        label: "商品中文名",
+        label: "商品名",
         prop: "productId",
         itemType: "onePicker",
         showPicker: false,
         readonly: false,
         fieldNames: {
-          text: "label",
-          value: "value",
+          text: "name",
+          value: "id",
         },
         data: [],
         changeFn: (val, data, index, indexTwo, propName) => {
@@ -572,8 +541,8 @@ const formGoodsOption = reactive({
       },
       {
         type: "input",
-        label: "商品英文名",
-        prop: "productName",
+        label: "商品编码",
+        prop: "productCode",
         itemType: "text",
       },
       {
@@ -584,12 +553,6 @@ const formGoodsOption = reactive({
       },
       {
         type: "input",
-        label: "包装方式",
-        prop: "packMethod",
-        itemType: "text",
-      },
-      {
-        type: "input",
         label: "数量",
         prop: "quantity",
         itemType: "number",
@@ -607,19 +570,6 @@ const formGoodsOption = reactive({
         },
       },
       {
-        type: "picker",
-        label: "贸易方式",
-        prop: "tradeMethods",
-        itemType: "onePicker",
-        showPicker: false,
-        fieldNames: {
-          text: "label",
-          value: "value",
-        },
-        data: [],
-        readonly: false,
-      },
-      {
         type: "input",
         label: "金额",
         prop: "amount",
@@ -759,49 +709,6 @@ const formProjectOption = reactive({
   },
 });
 
-const formShipmentOption = reactive({
-  readonly: false,
-  disabled: false,
-  labelAlign: "top",
-  scroll: true,
-  labelWidth: "62pk",
-  hiddenSubmitBtn: true,
-  btnConfig: {
-    isNeed: false,
-    prop: "contractShipmentList",
-    plain: true,
-    listTitle: "商品",
-    listConfig: [
-      {
-        type: "picker",
-        label: "出货日期",
-        prop: "shipmentTime",
-        itemType: "datePicker",
-        showPicker: false,
-        split: "-",
-        columnsType: ["year", "month", "day"],
-      },
-      {
-        type: "input",
-        label: "商品编码",
-        prop: "productCode",
-        itemType: "text",
-      },
-      {
-        type: "input",
-        label: "商品名称",
-        prop: "productName",
-        itemType: "text",
-      },
-      {
-        type: "input",
-        label: "出货数量",
-        prop: "quantity",
-        itemType: "number",
-      },
-    ],
-  },
-});
 const rules = {
   contractType: [
     { required: true, message: proxy.t("contract.contractTypeMsg") },
@@ -844,28 +751,7 @@ const rules = {
   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
@@ -920,19 +806,17 @@ const getDict = () => {
   };
 
   proxy
-    .post("/contractTemplate/page", { pageNum: 1, pageSize: 999 })
+    .get("/tenantDept/list", {
+      ...query,
+      type: 0,
+    })
     .then((res) => {
-      formConfig[0].data = res.data.rows.map((item) => {
-        return {
-          ...item,
-          label: item.templateName,
-          value: item.id,
-        };
-      });
+      formConfigCode[2].data = proxy.handleTree(res.data, "deptId");
     });
+
   // 卖方
   proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
-    formConfig[2].data = res.data.rows.map((item) => {
+    formConfig[1].data = res.data.rows.map((item) => {
       return {
         ...item,
         label: item.name,
@@ -947,47 +831,23 @@ const getDict = () => {
       pageSize: 999,
     })
     .then((res) => {
-      formConfig[8].data = res.data.rows.map((x) => ({
+      formConfig[7].data = res.data.rows.map((x) => ({
         ...x,
         label: x.name,
         value: x.id,
       }));
     });
   // 产品
-  Promise.all([getProduct(), getProductOne()]).then((res) => {
-    formGoodsOption.btnConfig.listConfig[0].data = res[0].concat(res[1]);
-  });
-  // 包装方式
+  // Promise.all([getProduct(), getProductOne()]).then((res) => {
+  //   formGoodsOption.btnConfig.listConfig[0].data = res[0].concat(res[1]);
+  // });
   proxy
-    .post("/dictTenantData/page", {
-      ...query,
-      dictCode: "inner_packaging_method_ehsd",
+    .post("/productInfo/page", {
+      pageNum: 1,
+      pageSize: 9999,
     })
     .then((res) => {
-      if (res.data.rows && res.data.rows.length > 0) {
-        innerMethod.value = res.data.rows.map((item) => {
-          return {
-            label: item.dictValue,
-            value: item.dictKey,
-          };
-        });
-      }
-    });
-  // 包装方式
-  proxy
-    .post("/dictTenantData/page", {
-      ...query,
-      dictCode: "outside_packaging_method_ehsd",
-    })
-    .then((res) => {
-      if (res.data.rows && res.data.rows.length > 0) {
-        outsideMethod.value = res.data.rows.map((item) => {
-          return {
-            label: item.dictValue,
-            value: item.dictKey,
-          };
-        });
-      }
+      formGoodsOption.btnConfig.listConfig[0].data = res.data.rows;
     });
 
   // 币种
@@ -1019,6 +879,7 @@ const getDict = () => {
         });
       }
     });
+
   // 账户
   proxy
     .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
@@ -1033,27 +894,16 @@ const getDict = () => {
         });
       }
     });
-  // 贸易方式
-  proxy
-    .post("/dictTenantData/page", { ...query, dictCode: "trade_mode" })
-    .then((res) => {
-      if (res.data.rows && res.data.rows.length > 0) {
-        formGoodsOption.btnConfig.listConfig[6].data = res.data.rows.map(
-          (item) => {
-            return {
-              label: item.dictValue,
-              value: item.dictKey,
-            };
-          }
-        );
-      }
-    });
+
   // 运输方式
   proxy
-    .post("/dictTenantData/page", { ...query, dictCode: "shipping_method" })
+    .post("/dictTenantData/page", {
+      ...query,
+      dictCode: "shipping_method",
+    })
     .then((res) => {
       if (res.data.rows && res.data.rows.length > 0) {
-        formConfigOne[15].data = res.data.rows.map((item) => {
+        formConfigOne[17].data = res.data.rows.map((item) => {
           return {
             label: item.dictValue,
             value: item.dictKey,
@@ -1061,6 +911,7 @@ const getDict = () => {
         });
       }
     });
+
   // if (["10", "20"].includes(route.query.processType)) {
   //   proxy
   //     .post("/customer/selPage", { pageNum: 1, pageSize: 50 })
@@ -1178,14 +1029,7 @@ const handleSubmit = async () => {
               active.value = 2;
               return false;
             } else {
-              return formDom6.value.validateForm().then((status3) => {
-                if (status3) {
-                  active.value = 3;
-                  return false;
-                } else {
-                  return true;
-                }
-              });
+              return true;
             }
           });
         }
@@ -1252,11 +1096,7 @@ onMounted(() => {
       ) {
         for (let i = 0; i < formData.data.contractProductList.length; i++) {
           const e = formData.data.contractProductList[i];
-          if (e.ehsdJson) {
-            let obj = JSON.parse(e.ehsdJson);
-            e.packMethod = obj.packMethod;
-            e.tradeMethods = obj.tradeMethods;
-          }
+          e.productModel = `${e.productLength}*${e.productWidth}*${e.productHeight}`;
         }
       }
 
@@ -1266,7 +1106,6 @@ onMounted(() => {
         formGoodsOption.btnConfig.isNeed = false;
         formProjectOption.readonly = true;
         formProjectOption.btnConfig.isNeed = false;
-        formShipmentOption.readonly = true;
       }
       setTimeout(() => {
         formDom1.value.formDataShowLabelOne();

+ 177 - 342
src/views/procurementManagement/supplierConfig/add.vue

@@ -1,379 +1,214 @@
 <template>
   <div class="form">
-    <van-nav-bar
-      :title="$t('supplierConfig.name')"
-      :left-text="$t('common.back')"
-      left-arrow
-      @click-left="onClickLeft"
-    >
-    </van-nav-bar>
-    <van-form
-      @submit="onSubmit"
-      label-align="top"
-      style="margin-top: 20px; overflow-y: auto"
-    >
-      <van-cell-group inset>
-        <van-field
-          v-model="formData.typeName"
-          is-link
-          readonly
-          :label="$t('supplierConfig.supplierType')"
-          :placeholder="$t('supplierConfig.selectSupplierType')"
-          @click="typeModal = true"
-          :rules="[{ required: true, message: $t('supplierConfig.supplierTypeCanNotBeEmpty') }]"
-          required
-        />
-        <van-popup v-model:show="typeModal" position="bottom">
-          <van-picker
-            :columns="classification"
-            @confirm="onConfirmType"
-            @cancel="typeModal = false"
-          />
-        </van-popup>
-
-        <van-field
-          v-model="formData.name"
-          :name="$t('supplierConfig.supplierName')"
-          :label="$t('supplierConfig.supplierName')"
-          :placeholder="$t('supplierConfig.pleaseFillInTheSupplierName')"
-          :rules="[{ required: true, message: $t('supplierConfig.supplierNameCanNotBeEmpty') }]"
-          required
-        />
-
-        <van-field
-          v-model="formData.cityName"
-          is-link
-          readonly
-          :label="$t('supplierConfig.city')"
-          :placeholder="$t('supplierConfig.selectCity')"
-          @click="cityModal = true"
-          :rules="[{ required: true, message: $t('supplierConfig.cityCanNotBeEmpty') }]"
-          required
-        />
-        <van-popup v-model:show="cityModal" round position="bottom">
-          <van-cascader
-            v-model="formData.city"
-            :title="$t('supplierConfig.selectArea')"
-            :options="areaInfo"
-            @close="showArea = false"
-            @change="cityOnChange"
-            @finish="getAreaInfo"
-          />
-        </van-popup>
-        <van-field
-          v-model="formData.areaDetail"
-          rows="3"
-          type="textarea"
-          :name="$t('supplierConfig.detailedAddress')"
-          :label="$t('supplierConfig.detailedAddress')"
-          :placeholder="$t('supplierConfig.pleaseFillInTheDetailedAddress')"
-        />
-
-        <van-field
-          v-model="formData.contactPerson"
-          :name="$t('supplierConfig.contact')"
-          :label="$t('supplierConfig.contact')"
-          :placeholder="$t('supplierConfig.pleaseFillInTheContact')"
-          :rules="[{ required: true, message: $t('supplierConfig.contactCanNotBeEmpty') }]"
-          required
-        />
-
-        <van-field
-          v-model="formData.contactNumber"
-          :name="$t('supplierConfig.contactNumber')"
-          :label="$t('supplierConfig.contactNumber')"
-          :placeholder="$t('supplierConfig.pleaseFillInTheContactNumber')"
-          :rules="[{ required: true, message: $t('supplierConfig.contactNumberCanNotBeEmpty') }]"
-          required
-        />
-        <van-field name="uploader" :label="$t('supplierConfig.fileUpload')">
-          <template #input>
-            <van-uploader
-              v-model="fileList"
-              :after-read="afterRead"
-              multiple
-              :max-count="9"
-              :max-size="5 * 1024 * 1024"
-              @oversize="onOversize"
-            />
-          </template>
-        </van-field>
-      </van-cell-group>
-      <div style="margin: 16px">
-        <van-button round block type="primary" native-type="submit">
-          {{$t('common.submit')}}
-        </van-button>
-      </div>
-    </van-form>
+    <van-nav-bar :title="'供应商详情'" :left-text="$t('common.back')" left-arrow @click-left="onClickLeft"> </van-nav-bar>
+    <testForm v-model="formData.data" :formOption="formOption" :formConfig="formConfig" :rules="rules" @onSubmit="onSubmit" ref="formDom"></testForm>
   </div>
 </template>
   
 <script setup>
-import { ref, getCurrentInstance, onMounted } from "vue";
+import { ref, getCurrentInstance, onMounted, reactive } from "vue";
 import { showSuccessToast, showToast } from "vant";
 import { useRoute } from "vue-router";
-import { showLoadingToast, closeToast, showNotify } from "vant";
+import testForm from "@/components/testForm/index.vue";
 
 const proxy = getCurrentInstance().proxy;
 const route = useRoute();
-const show = ref(false);
-const typeModal = ref(false);
-const cityModal = ref(false);
-const areaInfo = ref([]);
-const classification = ref([
+const formData = reactive({
+  data: {
+    id: null,
+    definition: "2",
+    productClassifyId: null,
+    productClassifyName: null,
+    code: null,
+    customCode: null,
+    type: null,
+    typeName: null,
+    name: null,
+    spec: null,
+    unit: null,
+    remark: null,
+    fileList: [],
+  },
+});
+const formDom = ref(null);
+const formOption = reactive({
+  readonly: false, //用于控制整个表单是否只读
+  disabled: false,
+  labelAlign: "top",
+  scroll: true,
+  labelWidth: "62pk",
+  // hiddenSubmitBtn: true,
+});
+const formConfig = reactive([
   {
-    text: proxy.t('supplierConfig.trader'),
-    value: 1,
+    type: "picker",
+    label: "供应商类型",
+    prop: "type",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "dictValue",
+      value: "dictKey",
+    },
+    data: [],
   },
   {
-    text: proxy.t('supplierConfig.factory'),
-    value: 2,
+    type: "input",
+    itemType: "text",
+    label: "供应商名称",
+    prop: "name",
+    clearable: true,
   },
-]);
-const fieldNames = {
-  text: "label",
-  value: "id",
-};
-const typeList = ref([
   {
-    text: proxy.t('supplierConfig.rawMaterial'),
-    value: "1",
+    type: "cascader",
+    label: "地址",
+    prop: "countryCity",
+    itemType: "city",
+    showPicker: false,
+  },
+
+  {
+    type: "input",
+    itemType: "text",
+    label: "联系人",
+    prop: "contactPerson",
+    clearable: true,
+  },
+
+  {
+    type: "input",
+    itemType: "text",
+    label: "联系信息",
+    prop: "contactNumber",
+    clearable: true,
   },
   {
-    text: proxy.t('supplierConfig.accessory'),
-    value: "2",
+    type: "input",
+    itemType: "number",
+    label: "账期 (天)",
+    prop: "accountPeriod",
+    clearable: true,
   },
+
   {
-    text: proxy.t('supplierConfig.fittings'),
-    value: "3",
+    type: "input",
+    itemType: "text",
+    label: "账期说明",
+    prop: "accountPeriodRemark",
+    clearable: true,
   },
   {
-    text: proxy.t('supplierConfig.packaging'),
-    value: "4",
+    type: "upload",
+    label: "上传附件",
+    prop: "fileList",
   },
   {
-    text: proxy.t('supplierConfig.other'),
-    value: "5",
+    type: "input",
+    itemType: "textarea",
+    label: "备注",
+    prop: "remark",
+    clearable: true,
   },
-]);
 
-const formData = ref({
-  id: null,
-  definition: "2",
-  productClassifyId: null,
-  productClassifyName: null,
-  code: null,
-  customCode: null,
-  type: null,
-  typeName: null,
-  name: null,
-  spec: null,
-  unit: null,
-  remark: null,
-  fileList: [],
-});
-const onConfirmType = ({ selectedOptions }) => {
-  formData.value.type = selectedOptions[0].value;
-  formData.value.typeName = selectedOptions[0].text;
-  typeModal.value = false;
-};
-const cityOnChange = (selectedOptions) => {
-  getAreaInfo(selectedOptions);
-};
-const onConfirmCity = (selectedOptions) => {
-  console.log(selectedOptions);
+  {
+    type: "input",
+    itemType: "text",
+    label: "账户名称",
+    prop: "openingName",
+    clearable: true,
+  },
+  {
+    type: "input",
+    itemType: "text",
+    label: "开户银行",
+    prop: "openingBank",
+    clearable: true,
+  },
+  {
+    type: "input",
+    itemType: "text",
+    label: "银行账号",
+    prop: "accountOpening",
+    clearable: true,
+  },
+  {
+    type: "input",
+    itemType: "text",
+    label: "联行号",
+    prop: "interbankNumber",
+    clearable: true,
+  },
+]);
+const rules = {
+  productClassifyId: [
+    {
+      required: true,
+      message: proxy.t("library.productClassificationCanNotBeEmpty"),
+    },
+  ],
+  type: [
+    { required: true, message: proxy.t("library.productTypeCanNotBeEmpty") },
+  ],
+  name: [
+    { required: true, message: proxy.t("library.productNameCanNotBeEmpty") },
+  ],
+  spec: [
+    {
+      required: true,
+      message: proxy.t("library.specificationModelCanNotBeEmpty"),
+    },
+  ],
+  unit: [{ required: true, message: proxy.t("library.unitCanNotBeEmpty") }],
+  select: [{ required: true, message: proxy.t("library.pleaseSelect") }],
+  date: [{ required: true, message: proxy.t("library.pleaseSelectTime") }],
+  common: [
+    { required: true, message: proxy.t("library.pleaseSelectCascader") },
+  ],
+  // city: [{ required: true, message: "请选择城市" }],
 };
+const onClickLeft = () => history.back();
 
-const getAreaInfo = (selectedOptions) => {
-  showLoadingToast("加载中...");
-  proxy
-    .post("/customizeArea/list", { parentId: selectedOptions.value })
-    .then((res) => {
-      let countryIndex = selectedOptions.selectedOptions[0].index;
-      let provinceIndex =
-        selectedOptions.tabIndex === 1
-          ? selectedOptions.selectedOptions[1].index
-          : null;
-      let cityIndex =
-        selectedOptions.tabIndex === 2
-          ? selectedOptions.selectedOptions[2].index
-          : null;
-      //已经没有下级数据
-      if (res.data.length === 0) {
-        if (selectedOptions.tabIndex === 1) {
-          formData.value.cityName = selectedOptions.selectedOptions
-            .map((item) => item.text)
-            .join(" ");
-          cityModal.value = false;
-          formData.value.selectedOptions = selectedOptions;
-          return;
-        }
+onMounted(async () => {
+  const res = await proxy.getDictOne(["supplier_type"]);
+  formConfig[0].data = res["supplier_type"].data;
+  if (route.query.id) {
+    formOption.readonly = true;
+    formOption.hiddenSubmitBtn = true;
+    proxy.post("/supplierInfo/detail", { id: route.query.id }).then((res) => {
+      formData.data = res.data;
+      formData.data.countryCityName =
+        formData.data.countryName +
+        " " +
+        formData.data.provinceName +
+        " " +
+        formData.data.cityName;
+      if (formData.data.countryId) {
+        formData.data.countryCity = formData.data.countryId;
       }
-      if (selectedOptions.tabIndex === 2) {
-        formData.value.cityName = selectedOptions.selectedOptions
-          .map((item) => item.text)
-          .join(" ");
-        cityModal.value = false;
-        formData.value.selectedOptions = selectedOptions;
-        return;
+      if (formData.data.provinceId) {
+        formData.data.countryCity = formData.data.provinceId;
       }
-      if (selectedOptions.tabIndex === 0) {
-        areaInfo.value[countryIndex].children = res.data.map((item, index) => {
-          return {
-            ...item,
-            index: index,
-            text: item.name,
-            value: item.id,
-          };
-        });
-      } else if (selectedOptions.tabIndex === 1) {
-        areaInfo.value[countryIndex].children[provinceIndex].children =
-          res.data.map((item, index) => {
-            return {
-              ...item,
-              index: index,
-              text: item.name,
-              value: item.id,
-            };
-          });
-      } else if (selectedOptions.tabIndex === 2) {
-        areaInfo.value[countryIndex].children[provinceIndex].children[
-          cityIndex
-        ].children = res.data.map((item, index) => {
-          return {
-            ...item,
-            index: index,
-            text: item.name,
-            value: item.id,
-          };
-        });
+      if (formData.data.cityId) {
+        formData.data.countryCity = formData.data.cityId;
       }
-      console.log(areaInfo);
-      closeToast();
     });
-};
-
-const fileList = ref([]);
-const afterRead = (file) => {
-  if (file && file.length > 0) {
-    for (let i = 0; i < file.length; i++) {
-      file[i].status = "uploading";
-      file[i].message = "上传中...";
-      proxy.post("/fileInfo/getSing", { fileName: file[i].file.name }).then(
-        (res) => {
-          let forms = new FormData();
-          forms.append("file", file[i].file);
-          proxy
-            .post("https://winfaster.obs.cn-south-1.myhuaweicloud.com", {
-              ...res.data.uploadBody,
-              file: forms.get("file"),
-            })
-            .then(
-              () => {
-                file[i].id = res.data.id;
-                file[i].url = res.data.fileUrl;
-                file[i].fileName = res.data.fileName;
-                delete file[i].status;
-                delete file[i].message;
-              },
-              () => {
-                file[i].status = "failed";
-                file[i].message = "上传失败";
-              }
-            );
-        },
-        () => {
-          file[i].status = "failed";
-          file[i].message = "上传失败";
+    proxy
+      .post("/fileInfo/getList", { businessIdList: [route.query.id] })
+      .then((res) => {
+        if (res.data[route.query.id] && res.data[route.query.id].length > 0) {
+          setTimeout(() => {
+            formData.data.fileList = res.data[route.query.id].map((item) => {
+              return {
+                ...item,
+                url: item.fileUrl,
+              };
+            });
+          }, 1000);
+        } else {
+          formData.data.fileList = [];
         }
-      );
-    }
-  } else {
-    file.status = "uploading";
-    file.message = "上传中...";
-    proxy.post("/fileInfo/getSing", { fileName: file.file.name }).then(
-      (res) => {
-        let forms = new FormData();
-        forms.append("file", file.file);
-        proxy
-          .post("https://winfaster.obs.cn-south-1.myhuaweicloud.com", {
-            ...res.data.uploadBody,
-            file: forms.get("file"),
-          })
-          .then(
-            () => {
-              file.id = res.data.id;
-              file.url = res.data.fileUrl;
-              file.fileName = res.data.fileName;
-              delete file.status;
-              delete file.message;
-            },
-            () => {
-              file.status = "failed";
-              file.message = "上传失败";
-            }
-          );
-      },
-      () => {
-        file.status = "failed";
-        file.message = "上传失败";
-      }
-    );
-  }
-};
-const onOversize = () => {
-  showToast("文件大小不能超过 5MB");
-};
-const onClickLeft = () => history.back();
-const onSubmit = () => {
-  if (fileList.value && fileList.value.length > 0) {
-    formData.value.fileList = fileList.value.map((item) => {
-      return {
-        id: item.id,
-        fileName: item.fileName,
-      };
-    });
-  } else {
-    formData.value.fileList = [];
-  }
-  console.log(formData.value.selectedOptions);
-  if (formData.value.selectedOptions) {
-    formData.value.countryId =
-      formData.value.selectedOptions.selectedOptions[0].value;
-    formData.value.provinceId =
-      formData.value.selectedOptions.tabIndex === 2
-        ? formData.value.selectedOptions.selectedOptions[1].value
-        : null;
-    formData.value.cityId =
-      formData.value.selectedOptions.tabIndex === 1
-        ? formData.value.selectedOptions.selectedOptions[1].value
-        : formData.value.selectedOptions.selectedOptions[2].value;
+      });
   }
-  proxy.post("/supplierInfo/" + route.query.type, formData.value).then(() => {
-    showSuccessToast(route.query.type == "add" ? "添加成功" : "修改成功");
-    setTimeout(() => {
-      history.back();
-    }, 500);
-  });
-};
-
-onMounted(() => {
-  proxy.post("/customizeArea/list", formData.value).then((res) => {
-    areaInfo.value = res.data.map((item, index) => {
-      return {
-        ...item,
-        index: index,
-        text: item.name,
-        value: item.id,
-        children: [],
-      };
-    });
-  });
-  if (route.query.type == "add") return;
-  proxy.post("/supplierInfo/detail", { id: route.query.id }).then((res) => {
-    formData.value = res.data;
-    formData.value.typeName = res.data.type == 1 ? "供应商" : "客户";
-  });
 });
 </script>
   

+ 129 - 111
src/views/procurementManagement/supplierConfig/index.vue

@@ -1,124 +1,142 @@
 <template>
-    <van-nav-bar :title="$t('supplierConfig.name')" left-text="" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
-      <template #right> {{$t('common.add')}}  </template>
-    </van-nav-bar>
-    <van-search v-model="req.keyword" :placeholder="$t('common.pleaseEnterKeywords')" @search="onRefresh" />
-    <van-pull-refresh v-model="loading" @refresh="onRefresh">
-      <div class="list">
-        <van-list v-model:loading="loading" :finished="finished" :finished-text="$t('common.noMore')" @load="onLoad" style="margin-bottom: 60px">
-          <commonList :data="listData" @onClick="toDtl" :config="listConfig"></commonList>
-        </van-list>
-      </div>
-    </van-pull-refresh>
-  </template>
+  <van-nav-bar :title="'供应商'" left-text="" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
+    <!-- <template #right> {{$t('common.add')}} </template> -->
+  </van-nav-bar>
+  <van-search v-model="req.keyword" :placeholder="$t('common.pleaseEnterKeywords')" @search="onRefresh" />
+  <van-pull-refresh v-model="loading" @refresh="onRefresh">
+    <div class="list">
+      <van-list v-model:loading="loading" :finished="finished" :finished-text="$t('common.noMore')" @load="onLoad" style="margin-bottom: 60px">
+        <commonList :data="listData" @onClick="toDtl" :config="listConfig"></commonList>
+      </van-list>
+    </div>
+  </van-pull-refresh>
+</template>
   <script setup>
-  import { ref, getCurrentInstance } from "vue";
-  import commonList from "@/components/common-list.vue";
-  import { useRoute } from "vue-router";
-  
-  const loading = ref(false);
-  const router = useRoute();
-  const req = ref({
-    pageNum: 1,
-    keyword: null,
-    definition: "2",
-  });
-  const finished = ref(false);
-  const proxy = getCurrentInstance().proxy;
-  const listData = ref([]);
-  const classification = ref([]);
-  const listConfig = ref([
-    {
-      label: proxy.t('supplierConfig.supplierType'),
-      prop: "typeName",
-    },
-    {
-      label: proxy.t('supplierConfig.supplierName'),
-      prop: "name",
+import { ref, getCurrentInstance } from "vue";
+import commonList from "@/components/common-list.vue";
+import { useRoute } from "vue-router";
+
+const loading = ref(false);
+const router = useRoute();
+const req = ref({
+  pageNum: 1,
+  keyword: null,
+  definition: "2",
+});
+const finished = ref(false);
+const proxy = getCurrentInstance().proxy;
+const listData = ref([]);
+const classification = ref([]);
+const listConfig = ref([
+  {
+    label: proxy.t("supplierConfig.supplierType"),
+    prop: "typeName",
+  },
+  {
+    label: proxy.t("supplierConfig.supplierName"),
+    prop: "name",
+  },
+  {
+    label: proxy.t("supplierConfig.contactInformation"),
+    prop: "contactPersonInfo",
+  },
+]);
+const onRefresh = () => {
+  req.value.pageNum = 1;
+  finished.value = false;
+  getList("refresh");
+};
+const onLoad = () => {
+  getDict();
+};
+const onClickLeft = () => proxy.$router.push("/main/working");
+const onClickRight = () => {
+  proxy.$router.push({
+    path: "supplierConfigAdd",
+    query: {
+      type: "add",
     },
-    {
-      label: proxy.t('supplierConfig.contactInformation'),
-      prop: "contactPerson",
+  });
+};
+proxy.uploadDdRightBtn(onClickRight, proxy.t("common.add"));
+const toDtl = (row) => {
+  proxy.$router.push({
+    path: "supplierConfigAdd",
+    query: {
+      id: row.id,
+      type: "edit",
     },
-  ]);
-  const onRefresh = () => {
-    req.value.pageNum = 1;
-    finished.value = false;
-    getList("refresh");
-  };
-  const onLoad = () => {
-    getClassification();
-  };
-  const onClickLeft = () => proxy.$router.push("/main/working");
-  const onClickRight = () => {
-    proxy.$router.push({
-      path: "supplierConfigAdd",
-      query: {
-          type: 'add'
-      },
-    });
-  };
-  proxy.uploadDdRightBtn(onClickRight,proxy.t('common.add'))
-  const toDtl = (row) => {
-    proxy.$router.push({
-      path: "supplierConfigAdd",
-      query: {
-        id: row.id,
-        type: 'edit'
-      },
+  });
+};
+const treeToList = (arr) => {
+  let res = []; // 用于存储递归结果(扁平数据)
+  // 递归函数
+  let fn = (source) => {
+    source.forEach((el) => {
+      res.push(el);
+      el.children && el.children.length > 0 ? fn(el.children) : ""; // 子级递归
     });
   };
-  const treeToList = (arr) => {
-    let res = []; // 用于存储递归结果(扁平数据)
-    // 递归函数
-    let fn = (source) => {
-      source.forEach((el) => {
-        res.push(el);
-        el.children && el.children.length > 0 ? fn(el.children) : ""; // 子级递归
-      });
-    };
-    fn(arr);
-    return res;
-  };
-  const getClassification = () => {
-    if (classification.value && classification.value.length > 0) {
-      getList();
-    } else {
-      proxy.post("/productClassify/tree", { parentId: "", name: "", definition: "2" }).then((res) => {
+  fn(arr);
+  return res;
+};
+const getClassification = () => {
+  if (classification.value && classification.value.length > 0) {
+    getList();
+  } else {
+    proxy
+      .post("/productClassify/tree", {
+        parentId: "",
+        name: "",
+        definition: "2",
+      })
+      .then((res) => {
         classification.value = treeToList(res.data);
         getList();
       });
-    }
-  };
-  const getList = (type) => {
-    loading.value = true;
-    proxy
-      .post("/supplierInfo/page", req.value)
-      .then((res) => {
-        res.data.rows = res.data.rows.map((item) => {
-          
-          return {
-            ...item,
-            contactPersonInfo: item.contactPerson + ' ' + item.contactPhone,
-            typeName: item.type === 1 ? proxy.t('supplierConfig.trader') : proxy.t('supplierConfig.factory'),
-          };
-        });
-        listData.value = type === "refresh" ? res.data.rows : listData.value.concat(res.data.rows);
-        if (req.value.pageNum * 10 >= res.data.total) {
-          finished.value = true;
-        }
-        req.value.pageNum++;
-        loading.value = false;
-      })
-      .catch((err) => {
-        loading.value = false;
+  }
+};
+const supplierType = ref([]);
+const getDict = async () => {
+  const res = await proxy.getDictOne(["supplier_type"]);
+  supplierType.value = res["supplier_type"].data.map((x) => ({
+    label: x.dictValue,
+    value: x.dictKey,
+  }));
+  getList();
+};
+
+const getList = (type) => {
+  loading.value = true;
+  proxy
+    .post("/supplierInfo/page", req.value)
+    .then((res) => {
+      res.data.rows = res.data.rows.map((item) => {
+        return {
+          ...item,
+          contactPersonInfo: item.contactPerson + " " + item.contactNumber,
+          typeName: proxy.dictValueLabel(item.type, supplierType.value),
+        };
       });
-  };
-  </script>
+      listData.value =
+        type === "refresh"
+          ? res.data.rows
+          : listData.value.concat(res.data.rows);
+      if (req.value.pageNum * 10 >= res.data.total) {
+        finished.value = true;
+      }
+      req.value.pageNum++;
+      loading.value = false;
+    })
+    .catch((err) => {
+      loading.value = false;
+    });
+};
+</script>
   
   <style lang="scss" scoped>
-  .list {
-    min-height: 70vh;
-  }
-  </style>
+.list {
+  min-height: 70vh;
+}
+</style>
   

+ 292 - 258
src/views/production/technology/add.vue

@@ -1,292 +1,326 @@
 <template>
-	<div class="form">
-		<van-nav-bar
-			:title="$t('technology.name')"
-			:left-text="$t('common.back')"
-			left-arrow
-			@click-left="onClickLeft"
-		>
-		</van-nav-bar>
+  <div class="form">
+    <van-nav-bar :title="$t('technology.name')" :left-text="$t('common.back')" left-arrow @click-left="onClickLeft">
+    </van-nav-bar>
 
-		<testForm
-			v-model="formData.data"
-			:formOption="formOption"
-			:formConfig="formConfig"
-			:rules="rules"
-			@onSubmit="onSubmit"
-			ref="formDom"
-		>
-			<template #processRouteList>
-				<div class="row">
-					<div class="col" style="width: 50%">
-						<van-checkbox-group
-							v-model="formData.data.processRouteList"
-						>
-							<van-checkbox
-								:name="i.id"
-								v-for="i in processRouteListData"
-								:key="i.id"
-								>{{ i.name }}</van-checkbox
-							>
-						</van-checkbox-group>
-					</div>
-					<div class="col" style="width: 50%">
-						<div v-for="(i, index) in formData.data.processRouteList" draggable="true">
-							<van-icon name="arrow-up" @click="sortUp(i)" />
-							<van-icon name="arrow-down" @click="sortdown(i)" />
-							<span style="margin-right: 10px">{{
+    <testForm v-model="formData.data" :formOption="formOption" :formConfig="formConfig" :rules="rules" @onSubmit="onSubmit" ref="formDom">
+      <template #processRouteList>
+        <div class="row">
+          <div class="col" style="width: 50%">
+            <van-checkbox-group v-model="formData.data.processRouteList">
+              <van-checkbox :name="i.id" v-for="i in processRouteListData" :key="i.id">{{ i.name }}</van-checkbox>
+            </van-checkbox-group>
+          </div>
+          <div class="col" style="width: 50%">
+            <div v-for="(i, index) in formData.data.processRouteList" draggable="true">
+              <van-icon name="arrow-up" @click="sortUp(i)" />
+              <van-icon name="arrow-down" @click="sortdown(i)" />
+              <span style="margin-right: 10px">{{
 								index + 1
 							}}</span>
-							{{ getName2(i) }}
-						</div>
-					</div>
-				</div>
-			</template>
-			<template #applicableProductsList>
-				<div
-					style="color: #999; width: calc(100vw - 32px)"
-					@click="show = true"
-				>
-					{{$t('common.pleaseSelect')}}
-				</div>
-				<div class="selectd" @click="show = true">
-					<div>
-						<van-tag
-							v-for="i in formData.data.applicableProductsList"
-							:key="i"
-							closeable
-							size="medium"
-							type="primary"
-							@close="deleteTag(i.id)"
-							style="margin-right: 10px"
-						>
-							{{ getName(i) }}
-						</van-tag>
-					</div>
-				</div>
-			</template>
-		</testForm>
-		<van-popup
-			v-model:show="show"
-			closeable
-			position="bottom"
-			:style="{ height: '60%' }"
-		>
-			<div style="height: 50px; width: 100px"></div>
-			<van-checkbox-group v-model="formData.data.applicableProductsList">
-				<van-cell-group inset v-for="i in productInfoData" :key="i.id">
-					<van-cell clickable :title="i.name">
-						<template #right-icon>
-							<van-checkbox :name="i.id"></van-checkbox>
-						</template>
-					</van-cell>
-				</van-cell-group>
-			</van-checkbox-group>
-		</van-popup>
-	</div>
+              {{ getName2(i) }}
+            </div>
+          </div>
+        </div>
+      </template>
+      <template #applicableProductsList>
+        <div style="color: #999; width: calc(100vw - 32px)" @click="show = true">
+          {{$t('common.pleaseSelect')}}
+        </div>
+        <div class="selectd" @click="show = true">
+          <div>
+            <van-tag v-for="i in formData.data.applicableProductsList" :key="i" closeable size="medium" type="primary" @close="deleteTag(i.id)"
+                     style="margin-right: 10px">
+              {{ getName(i) }}
+            </van-tag>
+          </div>
+        </div>
+      </template>
+    </testForm>
+    <van-popup v-model:show="show" closeable position="bottom" :style="{ height: '60%' }">
+      <div style="height: 50px; width: 100px"></div>
+      <van-checkbox-group v-model="formData.data.applicableProductsList">
+        <van-cell-group inset v-for="i in productInfoData" :key="i.id">
+          <van-cell clickable :title="i.name">
+            <template #right-icon>
+              <van-checkbox :name="i.id"></van-checkbox>
+            </template>
+          </van-cell>
+        </van-cell-group>
+      </van-checkbox-group>
+    </van-popup>
+  </div>
 </template>
 
 <script setup>
-import { ref, getCurrentInstance, onMounted, reactive } from 'vue'
-import { showSuccessToast, showToast } from 'vant'
-import { useRoute } from 'vue-router'
-import { getUserInfo } from '@/utils/auth'
-import testForm from '@/components/testForm/index.vue'
+import { ref, getCurrentInstance, onMounted, reactive } from "vue";
+import { showSuccessToast, showToast } from "vant";
+import { useRoute } from "vue-router";
+import { getUserInfo } from "@/utils/auth";
+import testForm from "@/components/testForm/index.vue";
 
-const proxy = getCurrentInstance().proxy
-const route = useRoute()
-const show = ref(false)
-const typeModal = ref(false)
-const unitModal = ref(false)
-const classification = ref([])
+const proxy = getCurrentInstance().proxy;
+const route = useRoute();
+const show = ref(false);
+const typeModal = ref(false);
+const unitModal = ref(false);
+const classification = ref([]);
 const formData = reactive({
-	data: {
-		checked: [],
-	},
-})
-const formDom = ref(null)
+  data: {
+    checked: [],
+  },
+});
+const formDom = ref(null);
 const formOption = reactive({
-	readonly: false, //用于控制整个表单是否只读
-	disabled: false,
-	labelAlign: 'top',
-	scroll: true,
-	labelWidth: '62pk',
-	// hiddenSubmitBtn: true,
-})
-let selected = ref([])
+  readonly: false, //用于控制整个表单是否只读
+  disabled: false,
+  labelAlign: "top",
+  scroll: true,
+  labelWidth: "62pk",
+  // hiddenSubmitBtn: true,
+});
+let selected = ref([]);
 
 const sortUp = (id) => {
-	let index = formData.data.processRouteList.findIndex((i) => i === id)
-	if (index === 0) {
-		return
-	}
-	let temp = formData.data.processRouteList[index]
-	formData.data.processRouteList[index] = formData.data.processRouteList[index - 1]
-	formData.data.processRouteList[index - 1] = temp
-}
+  let index = formData.data.processRouteList.findIndex((i) => i === id);
+  if (index === 0) {
+    return;
+  }
+  let temp = formData.data.processRouteList[index];
+  formData.data.processRouteList[index] =
+    formData.data.processRouteList[index - 1];
+  formData.data.processRouteList[index - 1] = temp;
+};
 
 const sortdown = (id) => {
-	let index = formData.data.processRouteList.findIndex((i) => i === id)
-	if (index === formData.data.processRouteList.length - 1) {
-		return
-	}
-	let temp = formData.data.processRouteList[index]
-	formData.data.processRouteList[index] = formData.data.processRouteList[index + 1]
-	formData.data.processRouteList[index + 1] = temp
-}
-
-
+  let index = formData.data.processRouteList.findIndex((i) => i === id);
+  if (index === formData.data.processRouteList.length - 1) {
+    return;
+  }
+  let temp = formData.data.processRouteList[index];
+  formData.data.processRouteList[index] =
+    formData.data.processRouteList[index + 1];
+  formData.data.processRouteList[index + 1] = temp;
+};
 
 const deleteTag = (id) => {
-	let index = formData.data.applicableProductsList.findIndex((i) => i.id === id)
-	formData.data.applicableProductsList.splice(index, 1)
-}
+  let index = formData.data.applicableProductsList.findIndex(
+    (i) => i.id === id
+  );
+  formData.data.applicableProductsList.splice(index, 1);
+};
 
 const getName = (id) => {
-	let name = ''
-	productInfoData.value.forEach((i) => {
-		if (i.id === id) {
-			name = i.name
-		}
-	})
-	return name
-}
+  let name = "";
+  productInfoData.value.forEach((i) => {
+    if (i.id === id) {
+      name = i.name;
+    }
+  });
+  return name;
+};
 
 const getName2 = (id) => {
-	let name = ''
-	processRouteListData.value.forEach((i) => {
-		if (i.id === id) {
-			name = i.name
-		}
-	})
-	return name
-}
+  let name = "";
+  processRouteListData.value.forEach((i) => {
+    if (i.id === id) {
+      name = i.name;
+    }
+  });
+  return name;
+};
 
 const formConfig = reactive([
-	{
-		type: 'input',
-		itemType: 'text',
-		label: proxy.$t('technology.workshopName'),
-		prop: 'name',
-		clearable: true,
-	},
-	{
-		type: 'slot',
-		label: proxy.$t('technology.processRoute'),
-		slotName: 'processRouteList',
-	},
-	{
-		type: 'slot',
-		label: proxy.$t('technology.applicableProducts'),
-		slotName: 'applicableProductsList',
-	},
-])
+  {
+    type: "input",
+    itemType: "text",
+    label: "产线名称",
+    prop: "name",
+    clearable: true,
+  },
+  {
+    type: "input",
+    itemType: "text",
+    label: "产线路线",
+    prop: "processRouteNameLists",
+    clearable: true,
+  },
+  {
+    type: "picker",
+    label: "批量模式",
+    prop: "isBatchMode",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [
+      {
+        value: "0",
+        label: "关闭批量模式",
+      },
+      {
+        value: "1",
+        label: "开启批量模式",
+      },
+    ],
+  },
+  {
+    type: "picker",
+    label: "生产任务",
+    prop: "productionTaskId",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+  },
+  {
+    type: "input",
+    itemType: "textarea",
+    label: "产线说明",
+    prop: "remarks",
+    clearable: true,
+  },
+  // {
+  // 	type: 'slot',
+  // 	label: proxy.$t('technology.processRoute'),
+  // 	slotName: 'processRouteList',
+  // },
+  // {
+  // 	type: 'slot',
+  // 	label: proxy.$t('technology.applicableProducts'),
+  // 	slotName: 'applicableProductsList',
+  // },
+]);
 const rules = {
-	name: [{ required: true, message: proxy.$t('technology.workshopTypeCanNotBeEmpty') }],
-	fileList: [{ required: true, message: proxy.$t('technology.pleaseUploadProcessFile') }],
-}
-const unitList = ref([])
-let processRouteListData = ref([])
+  name: [
+    {
+      required: true,
+      message: proxy.$t("technology.workshopTypeCanNotBeEmpty"),
+    },
+  ],
+  fileList: [
+    { required: true, message: proxy.$t("technology.pleaseUploadProcessFile") },
+  ],
+};
+const unitList = ref([]);
+let processRouteListData = ref([]);
 const getUserList = () => {
-	proxy.get('/system/user/list?pageNum=1&pageSize=10000', {}).then((res) => {
-		formConfig[2].data = res.rows
-	})
-}
-getUserList()
-const fileList = ref([])
+  proxy.get("/system/user/list?pageNum=1&pageSize=10000", {}).then((res) => {
+    formConfig[2].data = res.rows;
+  });
+};
+// getUserList();
+const fileList = ref([]);
 const onOversize = () => {
-	showToast('文件大小不能超过 5MB')
-}
-const onClickLeft = () => history.back()
+  showToast("文件大小不能超过 5MB");
+};
+const onClickLeft = () => history.back();
 const onSubmit = () => {
-	console.log(formData)
-	formData.data.productList = formData.data.applicableProductsList.map(item=>{
-		return {
-			productId:item
-		}
-	})
-	proxy
-		.post('/technology/' + route.query.type, formData.data)
-		.then(() => {
-			showSuccessToast(
-				route.query.type === 'add' ? proxy.$t('common.addSuccess') : proxy.$t('common.editSuccess')
-			)
-			setTimeout(() => {
-				history.back()
-			}, 500)
-		})
-}
+  console.log(formData);
+  formData.data.productList = formData.data.applicableProductsList.map(
+    (item) => {
+      return {
+        productId: item,
+      };
+    }
+  );
+  proxy.post("/technology/" + route.query.type, formData.data).then(() => {
+    showSuccessToast(
+      route.query.type === "add"
+        ? proxy.$t("common.addSuccess")
+        : proxy.$t("common.editSuccess")
+    );
+    setTimeout(() => {
+      history.back();
+    }, 500);
+  });
+};
 const treeToList = (arr) => {
-	let res = [] // 用于存储递归结果(扁平数据)
-	// 递归函数
-	let fn = (source) => {
-		source.forEach((el) => {
-			res.push(el)
-			el.children && el.children.length > 0 ? fn(el.children) : '' // 子级递归
-		})
-	}
-	fn(arr)
-	return res
-}
+  let res = []; // 用于存储递归结果(扁平数据)
+  // 递归函数
+  let fn = (source) => {
+    source.forEach((el) => {
+      res.push(el);
+      el.children && el.children.length > 0 ? fn(el.children) : ""; // 子级递归
+    });
+  };
+  fn(arr);
+  return res;
+};
 const getDtl = (id) => {
-	proxy
-		.post('/productionProcesses/page', { id: route.query.id })
-		.then((resDetail) => {
-			processRouteListData.value = resDetail.data.rows
-			console.log(processRouteListData.value)
-		})
-	proxy
-		.post('/productInfo/page', { pageNum: 1, pageSize: 10000 })
-		.then((resDetail) => {
-			productInfoData.value = resDetail.data.rows
-		})
-}
-let productInfoData = ref([])
+  proxy
+    .post("/productionProcesses/page", { id: route.query.id })
+    .then((resDetail) => {
+      processRouteListData.value = resDetail.data.rows;
+      console.log(processRouteListData.value);
+    });
+  proxy
+    .post("/productInfo/page", { pageNum: 1, pageSize: 10000 })
+    .then((resDetail) => {
+      productInfoData.value = resDetail.data.rows;
+    });
+};
+let productInfoData = ref([]);
 onMounted(() => {
-	if (route.query.id) {
-		proxy
-			.post('/technology/detail', { id: route.query.id })
-			.then((resDetail) => {
-				formData.data = {
-					...resDetail.data,
-					processRouteList: resDetail.data.processRouteList.map(
-						(item) => item.id
-					),
-					applicableProductsList: resDetail.data.applicableProductsList.map(
-						(item) => item.id
-					),
-
-				}
-				getDtl()
-			})
-	}else{
-		getDtl()
-	}
-	
-})
+  proxy
+    .post("/produceOrderDetail/page", { pageNum: 1, pageSize: 9999 })
+    .then((res) => {
+      formConfig[3].data = res.data.rows.map((x) => ({
+        ...x,
+        label: x.orderCode,
+        value: x.id,
+      }));
+    });
+  if (route.query.id) {
+    formOption.readonly = true; //全部只读
+    formOption.hiddenSubmitBtn = true; //隐藏提交按钮
+    formData.data = { ...route.query };
+    // proxy
+    //   .post("/technology/detail", { id: route.query.id })
+    //   .then((resDetail) => {
+    //     formData.data = {
+    //       ...resDetail.data,
+    //       processRouteList: resDetail.data.processRouteList.map(
+    //         (item) => item.id
+    //       ),
+    //       applicableProductsList: resDetail.data.applicableProductsList.map(
+    //         (item) => item.id
+    //       ),
+    //     };
+    //     getDtl();
+    //   });
+  } else {
+    // getDtl()
+  }
+});
 </script>
 <style scoped lang="scss">
 .row {
-	overflow: hidden;
-	width: calc(100vw - 32px);
-	.col {
-		width: 50%;
-		float: left;
-		box-sizing: border-box;
-		padding: 0 10px;
-		overflow: hidden;
-		.van-icon-arrow-down,
-		.van-icon-arrow-up {
-			display: inline-block;
-			height: 18px;
-			margin: 1px 3px;
-			line-height: 18px;
-			background: #1989fa;
-			width: 18px;
-			color: #fff;
-			border-radius: 9px;
-			text-align: center;
-		}
-	}
+  overflow: hidden;
+  width: calc(100vw - 32px);
+  .col {
+    width: 50%;
+    float: left;
+    box-sizing: border-box;
+    padding: 0 10px;
+    overflow: hidden;
+    .van-icon-arrow-down,
+    .van-icon-arrow-up {
+      display: inline-block;
+      height: 18px;
+      margin: 1px 3px;
+      line-height: 18px;
+      background: #1989fa;
+      width: 18px;
+      color: #fff;
+      border-radius: 9px;
+      text-align: center;
+    }
+  }
 }
 </style>

+ 112 - 130
src/views/production/technology/index.vue

@@ -1,149 +1,131 @@
 <template>
-	<van-nav-bar
-		:title="$t('technology.name')"
-		left-text=""
-		left-arrow
-		@click-left="onClickLeft"
-		@click-right="onClickRight"
-	>
-		<template #right> {{$t('common.add')}} </template>
-	</van-nav-bar>
-	<van-search
-		v-model="req.keyword"
-		:placeholder="$t('common.pleaseEnterKeywords')"
-		@search="onRefresh"
-	/>
-	<van-pull-refresh v-model="loading" @refresh="onRefresh">
-		<div class="list">
-			<van-list
-				v-model:loading="loading"
-				:finished="finished"
-				:finished-text="$t('common.noMore')"
-				@load="onLoad"
-				style="margin-bottom: 60px"
-			>
-				<commonList
-					:data="listData"
-					@onClick="toDtl"
-					:config="listConfig"
-				></commonList>
-			</van-list>
-		</div>
-	</van-pull-refresh>
+  <van-nav-bar :title="$t('technology.name')" left-text="" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
+    <!-- <template #right> {{$t('common.add')}} </template> -->
+  </van-nav-bar>
+  <van-search v-model="req.keyword" :placeholder="$t('common.pleaseEnterKeywords')" @search="onRefresh" />
+  <van-pull-refresh v-model="loading" @refresh="onRefresh">
+    <div class="list">
+      <van-list v-model:loading="loading" :finished="finished" :finished-text="$t('common.noMore')" @load="onLoad" style="margin-bottom: 60px">
+        <commonList :data="listData" @onClick="toDtl" :config="listConfig"></commonList>
+      </van-list>
+    </div>
+  </van-pull-refresh>
 </template>
 <script setup>
-import { ref, getCurrentInstance } from 'vue'
-import commonList from '@/components/common-list.vue'
-import { useRoute } from 'vue-router'
+import { ref, getCurrentInstance } from "vue";
+import commonList from "@/components/common-list.vue";
+import { useRoute } from "vue-router";
 
-const loading = ref(false)
-const router = useRoute()
+const loading = ref(false);
+const router = useRoute();
 const req = ref({
-	pageNum: 1,
-	keyword: null,
-	definition: '1',
-})
-const finished = ref(false)
-const proxy = getCurrentInstance().proxy
-const listData = ref([])
-const classification = ref([])
+  pageNum: 1,
+  keyword: null,
+  definition: "1",
+});
+const finished = ref(false);
+const proxy = getCurrentInstance().proxy;
+const listData = ref([]);
+const classification = ref([]);
 const listConfig = ref([
-	{
-		label: proxy.t('technology.processName'),
-		prop: 'name',
-	},
-	{
-		label: proxy.t('technology.processRoute'),
-		prop: 'processRouteNameListText',
-	},
-	{
-		label: proxy.t('technology.applicableProducts'),
-		prop: 'applicableProductsNameListText',
-	},
-])
+  {
+    label: "产线名称",
+    prop: "name",
+  },
+  {
+    label: "产线路线",
+    prop: "processRouteNameLists",
+  },
+  {
+    label: "产线说明",
+    prop: "remarks",
+  },
+]);
 const onRefresh = () => {
-	req.value.pageNum = 1
-	finished.value = false
-	getList('refresh')
-}
+  req.value.pageNum = 1;
+  finished.value = false;
+  getList("refresh");
+};
 const onLoad = () => {
-	getClassification()
-}
-const onClickLeft = () => proxy.$router.push('/main/working')
+  // getClassification()
+  getList();
+};
+const onClickLeft = () => proxy.$router.push("/main/working");
 const onClickRight = () => {
-	proxy.$router.push({
-		path: 'technologyAdd',
-		query: {
-			type: 'add',
-		},
-	})
-}
-proxy.uploadDdRightBtn(onClickRight,proxy.t('common.add'))
+  proxy.$router.push({
+    path: "technologyAdd",
+    query: {
+      type: "add",
+    },
+  });
+};
+proxy.uploadDdRightBtn(onClickRight, proxy.t("common.add"));
 const toDtl = (row) => {
-	proxy.$router.push({
-		path: 'technologyAdd',
-		query: {
-			id: row.id,
-			type: 'edit',
-		},
-	})
-}
+  proxy.$router.push({
+    path: "technologyAdd",
+    query: {
+      ...row,
+      id: row.id,
+      type: "edit",
+    },
+  });
+};
 const treeToList = (arr) => {
-	let res = [] // 用于存储递归结果(扁平数据)
-	// 递归函数
-	let fn = (source) => {
-		source.forEach((el) => {
-			res.push(el)
-			el.children && el.children.length > 0 ? fn(el.children) : '' // 子级递归
-		})
-	}
-	fn(arr)
-	return res
-}
+  let res = []; // 用于存储递归结果(扁平数据)
+  // 递归函数
+  let fn = (source) => {
+    source.forEach((el) => {
+      res.push(el);
+      el.children && el.children.length > 0 ? fn(el.children) : ""; // 子级递归
+    });
+  };
+  fn(arr);
+  return res;
+};
 const getClassification = () => {
-	if (classification.value && classification.value.length > 0) {
-		getList()
-	} else {
-		proxy
-			.post('/productClassify/tree', {
-				parentId: '',
-				name: '',
-				definition: '1',
-			})
-			.then((res) => {
-				classification.value = treeToList(res.data)
-				getList()
-			})
-	}
-}
+  if (classification.value && classification.value.length > 0) {
+    getList();
+  } else {
+    proxy
+      .post("/productClassify/tree", {
+        parentId: "",
+        name: "",
+        definition: "1",
+      })
+      .then((res) => {
+        classification.value = treeToList(res.data);
+        getList();
+      });
+  }
+};
 const getList = (type) => {
-	loading.value = true
-	proxy
-		.post('technology/page', req.value)
-		.then((res) => {
-			
-			listData.value =
-				type === 'refresh'
-					? res.data.rows
-					: listData.value.concat(res.data.rows)
-			if (req.value.pageNum * 10 >= res.data.total) {
-				finished.value = true
-			}
-			req.value.pageNum++
-			loading.value = false
-            listData.value.map(item=>{
-				item.processRouteNameListText = item.processRouteNameList.join('>')
-				item.applicableProductsNameListText = item.applicableProductsNameList.join(',')
-			})
-		})
-		.catch((err) => {
-			loading.value = false
-		})
-}
+  loading.value = true;
+  proxy
+    .post("/technology/page", req.value)
+    .then((res) => {
+      listData.value =
+        type === "refresh"
+          ? res.data.rows
+          : listData.value.concat(res.data.rows);
+      if (req.value.pageNum * 10 >= res.data.total) {
+        finished.value = true;
+      }
+      req.value.pageNum++;
+      loading.value = false;
+      listData.value.map((item) => {
+        item.processRouteNameLists = item.processRouteNameList.join(" > ");
+        // item.applicableProductsNameListText =
+        //   item.applicableProductsNameList.join(",");
+      });
+    })
+    .catch((err) => {
+      loading.value = false;
+    });
+};
 </script>
 
 <style lang="scss" scoped>
 .list {
-	min-height: 70vh;
+  min-height: 70vh;
 }
 </style>

+ 2 - 2
src/views/salesContract/contract/index.vue

@@ -125,7 +125,7 @@ const listConfig = ref([
   },
   {
     label: proxy.t("contract.sellCorporation"),
-    prop: "sellCorporationName",
+    prop: "companyName",
   },
   {
     label: "业务员",
@@ -136,7 +136,7 @@ const listConfig = ref([
     prop: "buyCorporationName",
   },
   {
-    label: proxy.t("contract.amount"),
+    label: "合同金额",
     prop: "currencyAmount",
   },
 ]);