Parcourir la source

部分新需求

cz il y a 1 an
Parent
commit
e73007beda

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

@@ -106,8 +106,8 @@
           </van-popup>
           <!-- 级联 公共 -->
           <van-field v-if="i.type == 'cascader' && i.itemType == 'common'" :label="i.label" :name="i.prop" v-model="formData[i.prop + 'Name']" is-link
-                     :readonly="true" :placeholder="i.placeholder ? i.placeholder : '请选择'"
-                     @click="() => (!formOption.readonly ? (i.showPicker = true) : '')" :rules="getRules(i)" :required="getRequired(i)" />
+                     :readonly="true" :placeholder="i.placeholder ? i.placeholder : '请选择'" @click="() => getFieldReadonly(i)" :rules="getRules(i)"
+                     :required="getRequired(i)" />
           <van-popup v-if="i.type == 'cascader' && i.itemType == 'common'" v-model:show="i.showPicker" round position="bottom">
             <van-cascader v-model="formData[i.prop]" :title="i.title ? i.title : '请选择'" :options="i.data"
                           :field-names="i.fieldNames ? i.fieldNames : fieldNames" @close="i.showPicker = false"

+ 2 - 2
src/lang/cnLXF.js

@@ -162,8 +162,8 @@ export function cnLXF() {
     contract: {
       name: "销售合同",
       sellCorporation: "归属公司",
-      contractType: "合同类型",
-      contractTypeMsg: "请选择合同类型",
+      contractType: "订单类型",
+      contractTypeMsg: "请选择订单类型",
       code: "合同编码",
       buyCorporation: "客户名称",
       amount: "合同金额",

+ 4 - 0
src/main.js

@@ -9,6 +9,7 @@ import {
   getDictOne,
   compareTime,
   dictValueLabel,
+  dictKeyValue,
   formChange,
   formChangeTwo,
   deepClone,
@@ -47,6 +48,9 @@ app.config.globalProperties.moneyFormat = moneyFormat;
 app.config.globalProperties.getDictOne = getDictOne;
 // 字典回显
 app.config.globalProperties.dictValueLabel = dictValueLabel;
+app.config.globalProperties.dictKeyValue = dictKeyValue;
+
+
 // 比较时间大小
 app.config.globalProperties.compareTime = compareTime;
 app.config.globalProperties.uploadDdRightBtn = uploadDdRightBtn;

+ 11 - 5
src/utils/auth.js

@@ -8,11 +8,19 @@ export function getUserInfo() {
 }
 
 export function setUserInfo(userInfo) {
-    return localStorage.setItem('userInfo',JSON.stringify(userInfo))
+    return localStorage.setItem('userInfo', JSON.stringify(userInfo))
+}
+
+export function getAllDict() {
+    return localStorage.getItem('allDict') ? JSON.parse(localStorage.getItem('allDict')) : {}
+}
+
+export function setAllDict(data) {
+    return localStorage.setItem('allDict', JSON.stringify(data))
 }
 
 export function setToken(token) {
-    return localStorage.setItem('token',token)
+    return localStorage.setItem('token', token)
 }
 
 export function removeToken() {
@@ -42,6 +50,4 @@ export function formatDate(date, fmt) {
 
 function padLeftZero(str) {
     return ('00' + str).substr(str.length);
-}
-
-
+}

+ 13 - 0
src/utils/util.js

@@ -106,6 +106,19 @@ export function dictValueLabel(value, arr) {
   return "";
 }
 
+//根据dictKey值回显字典label值
+export function dictKeyValue(value, arr) {
+  if ((value || value == 0) && arr) {
+    value = value + "";
+    const current = arr.find((x) => x.dictKey == value);
+    if (current != undefined && current.dictValue) {
+      return current.dictValue;
+    }
+    return "";
+  }
+  return "";
+}
+
 // form组件 formConfig select change事件回填
 export function formChange(val, data, formData) {
   formData.data[data.prop] = val.selectedValues[0];

+ 12 - 1
src/views/login.vue

@@ -105,7 +105,13 @@
 <script setup>
 import "vant/lib/index.css";
 import { ref, getCurrentInstance, onMounted } from "vue";
-import { setUserInfo, setToken, getUserInfo, getToken } from "@/utils/auth";
+import {
+  setUserInfo,
+  setAllDict,
+  setToken,
+  getUserInfo,
+  getToken,
+} from "@/utils/auth";
 import { showSuccessToast, showFailToast, showConfirmDialog } from "vant";
 import * as dd from "dingtalk-jsapi";
 import axios from "axios";
@@ -152,6 +158,11 @@ const getInfo = () => {
     console.log(res);
     if (res.code == 200) {
       setUserInfo(res.user);
+      proxy.get("/tenantDict/allDictMap").then((dictData) => {
+        if (dictData && dictData.data) {
+          setAllDict(dictData.data);
+        }
+      });
       window.localStorage.setItem("tenantId", loginForm.value.tenantId);
       if (rememberMe.value) {
         window.localStorage.setItem("username", loginForm.value.username);

+ 396 - 0
src/views/processApproval/components/DiscussPrice.vue

@@ -0,0 +1,396 @@
+<template>
+  <div class="form">
+    <van-form @submit="onSubmit" label-align="top" style="margin-top: 20px" readonly>
+      <TitleInfo :title="'基本信息'"></TitleInfo>
+      <van-cell-group inset>
+        <van-field v-model="formData.data.code" readonly label="报价单号" />
+      </van-cell-group>
+      <div style="height:20px"></div>
+      <TitleInfo :title="'商品信息'"></TitleInfo>
+      <van-collapse v-model="activeNames">
+        <van-collapse-item v-for="(product,index) in formData.data.quotationProductList" :name="index" :key="index">
+          <template #title>
+            <div :style="{background:product.isShowYiJia?'red':'',color:product.isShowYiJia?'#fff':''}" style="padding-left:5px;">
+              产品编码:{{product.productCode || '定制产品'}}</div>
+            <div>数量:{{product.quantity}}</div>
+            <div>业务成本单价:{{product.businessCostPrice}}</div>
+            <div>最低价:{{product.minPrice}}</div>
+            <div>最高价:{{product.maxPrice}}</div>
+            <div>单价:{{product.price}}</div>
+          </template>
+          <div style="background:#fff;color:#000">
+            <div style="margin-left:-10px;">
+              <TitleInfo :title="'主材'"></TitleInfo>
+            </div>
+            <div style="margin:5px 0">
+              <div style="display:flex">
+                <div style="width:50%">原材料:{{product.rawMaterialName}}</div>
+                <div style="width:50%">颜色:{{product.productColor}}</div>
+              </div>
+              <div style="display:flex;margin-top:5px">
+                <div style="width:50%">尺寸(cm):{{product.productLength}}*{{product.productWidth}}*{{product.productHeight}}</div>
+                <div style="width:50%">净重(kg):{{product.netWeight}}</div>
+              </div>
+            </div>
+            <div style="display:flex;margin-left:-10px;align-items:center;">
+              <TitleInfo :title="'辅材'"></TitleInfo>
+              <div>(表格可向右滑动)</div>
+            </div>
+            <div style="width:100%;overflow-x:auto">
+              <table border class="table">
+                <thead>
+                  <tr>
+                    <th style="min-width:150px">物料名称</th>
+                    <th style="min-width:150px;">物料编码</th>
+                    <th style="min-width:50px">数量</th>
+                  </tr>
+                </thead>
+                <tbody v-if="product.quotationProductBomList && product.quotationProductBomList.length>0">
+                  <tr v-for="(item,sonIndex) in product.quotationProductBomList" :key="sonIndex">
+                    <td>{{item.productName}}</td>
+                    <td>{{item.productCode}}</td>
+                    <td>{{item.quantity}}</td>
+                  </tr>
+                </tbody>
+              </table>
+            </div>
+            <div style="margin-left:-10px;">
+              <TitleInfo :title="'附加工艺要求'"></TitleInfo>
+            </div>
+            <div style="margin:5px 0">
+              <div>生产工艺:{{product.technologyName}}</div>
+              <div style="margin-top:5px">LOGO尺寸 (cm):{{product.logoLength}}*{{product.logoWidth}}</div>
+              <div style="margin-top:5px">几色印刷:{{product.colorCount}}</div>
+              <div style="margin-top:5px">是否折叠:{{product.isFold?'是':"否"}}
+                <span v-if="product.isFold" style="margin-left:10px">折叠数:{{dictKeyValue(product.foldWay,foldWayData)}}</span>
+              </div>
+              <div style="margin-top:5px">包装要求:{{product.packAskText}}</div>
+              <div style="margin-top:5px">是否定制:{{product.isCustomized?'是':"否"}}</div>
+              <div style="width:100%;overflow-x:auto;margin-top:5px" v-if="product.isCustomized">
+                <table border class="table">
+                  <thead>
+                    <tr>
+                      <th style="min-width:100px"></th>
+                      <th style="min-width:150px;">附件</th>
+                      <th style="min-width:200px">备注</th>
+                    </tr>
+                  </thead>
+                  <tbody v-if="product.quotationProductCustomInfoList && product.quotationProductCustomInfoList.length>0">
+                    <tr v-for="(row,sonIndex) in product.quotationProductCustomInfoList" :key="sonIndex">
+                      <td>
+                        <div style="display:flex">
+                          <van-checkbox v-model="row.isCheckBox" disabled></van-checkbox>
+                          <span style="position:relative;top:-2px;margin-left:10px">
+                            {{getLabelOne(row.type)}}</span>
+                        </div>
+                      </td>
+                      <td>
+                        <div v-for="file in row.fileList" :key="file.id" class="el-click" @click="onPreviewFile(file.fileName,file.fileUrl)">
+                          {{file.fileName}}
+                        </div>
+                      </td>
+                      <td>{{row.remark}}</td>
+                    </tr>
+                  </tbody>
+                </table>
+              </div>
+
+            </div>
+          </div>
+        </van-collapse-item>
+      </van-collapse>
+      <div style="height:20px"></div>
+      <TitleInfo :title="'报价总金额'"></TitleInfo>
+      <van-cell-group inset>
+        <van-field v-model="formData.data.amount" readonly label="报价总金额" />
+      </van-cell-group>
+      <div style="height:20px"></div>
+      <TitleInfo :title="'备注'"></TitleInfo>
+      <van-cell-group inset>
+        <van-field v-model="formData.data.discussRemark" readonly label="备注" />
+      </van-cell-group>
+      <div style="height:20px"></div>
+      <TitleInfo :title="'附件'"></TitleInfo>
+      <van-field readonly label="附件">
+        <template #input>
+          <div>
+            <div v-for="file in formData.data.discussFileList" :key="file.id" class="el-click" @click="onPreviewFile(file.fileName,file.fileUrl)">
+              {{file.fileName}}
+            </div>
+          </div>
+        </template>
+      </van-field>
+
+    </van-form>
+  </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";
+import { getAllDict } from "@/utils/auth";
+const packAskData = getAllDict()["pack_ask"];
+const foldWayData = getAllDict()["fold_way"];
+// 接收父组件的传值
+const props = defineProps({
+  queryData: Object,
+});
+const technologyData = ref([]);
+const activeNames = ref([]);
+const refProps = toRefs(props);
+const proxy = getCurrentInstance().proxy;
+const route = useRoute();
+const active = ref(0);
+const tabsChange = () => {
+  active.value++;
+};
+const formData = reactive({
+  data: {
+    quotationProductList: [],
+    quotationPayList: [],
+  },
+});
+const formDom1 = ref(null);
+
+const changeForeignQuantity = () => {
+  let money = 0;
+  let num = 0;
+  if (
+    formData.data.quotationProductList &&
+    formData.data.quotationProductList.length > 0
+  ) {
+    // 单个产品的价格
+    for (let i = 0; i < formData.data.quotationProductList.length; i++) {
+      let iele = formData.data.quotationProductList[i];
+      if (iele.price > iele.maxPrice || iele.price < iele.minPrice) {
+        num += 1;
+        iele.isShowYiJia = true;
+      } else {
+        iele.isShowYiJia = false;
+      }
+      iele.amount = Number(parseFloat(iele.price * iele.quantity).toFixed(2));
+      money += Number(iele.amount);
+    }
+    formData.data.amount = parseFloat(money).toFixed(2);
+  }
+  isShowYiJia.value = num > 0 ? true : false;
+};
+
+const handleSubmit = async () => {
+  const flag = true;
+  if (flag) {
+    return formData.data;
+  }
+};
+
+const status = ref(true);
+watch(
+  refProps.queryData,
+  () => {
+    if (
+      refProps.queryData.value &&
+      ["10", "20", "30"].includes(route.query.processType)
+    ) {
+      return;
+    }
+  },
+  {
+    deep: true,
+  }
+);
+defineExpose({
+  handleSubmit,
+  tabsChange,
+});
+
+const getRawMaterialData = () => {
+  proxy.post("/technology/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    technologyData.value = res.data.rows;
+  });
+};
+getRawMaterialData();
+const isShowYiJia = ref(false);
+let obj = {
+  1: "定制刀模",
+  2: "定制纹路",
+  3: "定制模具",
+};
+const getLabelOne = (type) => {
+  return obj[type];
+};
+onMounted(() => {
+  if (route.query && route.query.businessId) {
+    let businessId = route.query.businessId;
+    proxy.post("/saleQuotation/detail", { id: businessId }).then((res) => {
+      formData.data = res.data;
+      for (let i = 0; i < formData.data.quotationProductList.length; i++) {
+        const iele = formData.data.quotationProductList[i];
+        iele.quotationProductId = iele.id;
+        iele.price = iele.discussPrice;
+        iele.maxPrice = Number(
+          parseFloat((iele.amplifyRatio / 100 + 1) * iele.minPrice).toFixed(2)
+        );
+        for (let j = 0; j < iele.quotationProductBomList.length; j++) {
+          const jele = iele.quotationProductBomList[j];
+          jele.quotationProductBomId = jele.id;
+        }
+      }
+      if (
+        formData.data.quotationProductList &&
+        formData.data.quotationProductList.length > 0
+      ) {
+        for (let i = 0; i < formData.data.quotationProductList.length; i++) {
+          const iele = formData.data.quotationProductList[i];
+          let packAskText = "";
+          if (iele.packAsk) {
+            iele.packAsk = iele.packAsk.split(",");
+            for (let j = 0; j < iele.packAsk.length; j++) {
+              if (j < iele.packAsk.length - 1) {
+                packAskText +=
+                  proxy.dictKeyValue(iele.packAsk[j], packAskData) + ",";
+              } else {
+                packAskText += proxy.dictKeyValue(iele.packAsk[j], packAskData);
+              }
+            }
+          } else {
+            iele.packAsk = [];
+          }
+          iele.packAskText = packAskText;
+
+          if (iele.technologyId) {
+            let current = technologyData.value.find(
+              (x) => x.id == iele.technologyId
+            );
+            if (current) {
+              iele.technologyName = current.name;
+            }
+          }
+
+          if (
+            iele.quotationProductBomList &&
+            iele.quotationProductBomList.length > 0
+          ) {
+            let rawMaterialName = "";
+            let type1Arr = iele.quotationProductBomList.filter(
+              (x) => x.type == 1
+            );
+            if (type1Arr && type1Arr.length > 0) {
+              rawMaterialName = type1Arr[0].productName;
+            }
+            iele.rawMaterialName = rawMaterialName;
+
+            iele.quotationProductBomList = iele.quotationProductBomList
+              .filter((x) => x.type == 2)
+              .map((x) => ({
+                ...x,
+                materialName: x.productName,
+                materialCode: x.productCode,
+              }));
+          }
+          if (
+            iele.quotationProductCustomInfoList &&
+            iele.quotationProductCustomInfoList.length > 0
+          ) {
+            for (
+              let j = 0;
+              j < iele.quotationProductCustomInfoList.length;
+              j++
+            ) {
+              const jele = iele.quotationProductCustomInfoList[j];
+              if (jele.fileList) {
+                jele.fileList = jele.fileList.map((x) => ({
+                  ...x,
+                  url: x.fileUrl,
+                  name: x.fileName,
+                }));
+              } else {
+                jele.fileList = [];
+              }
+              jele.isCheckBox = jele.isCheck == 1;
+            }
+          }
+        }
+      }
+      isShowYiJia.value = false;
+      changeForeignQuantity();
+
+      proxy
+        .post("/fileInfo/getList", {
+          businessIdList: [formData.data.id],
+        })
+        .then((res) => {
+          if (res.data && res.data[formData.data.id]) {
+            formData.data.discussFileList = res.data[formData.data.id]
+              .filter((x) => x.businessType == "10")
+              .map((x) => ({ ...x, name: x.fileName, url: x.fileUrl }));
+          } else {
+            formData.data.discussFileList = [];
+          }
+        });
+    });
+  }
+});
+const onPreviewFile = (name, url) => {
+  uni.postMessage({
+    data: {
+      type: "file",
+      url: url,
+      name: name,
+    },
+  });
+};
+</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;
+  }
+}
+
+.table {
+  border-collapse: collapse;
+  border-spacing: 0;
+  width: 100%;
+  border-color: #ebeef5;
+  color: #606266;
+  thead tr th {
+    padding: 6px;
+    text-align: left;
+  }
+  td {
+    text-align: left;
+    padding: 6px;
+  }
+}
+.pic {
+  width: 50px;
+  height: 50px;
+  object-fit: contain;
+  vertical-align: middle;
+}
+.el-click {
+  cursor: pointer;
+  color: #409eff;
+}
+</style>

+ 186 - 70
src/views/processApproval/components/EhsdContract.vue

@@ -134,14 +134,28 @@ const formConfigCode = reactive([
   },
   {
     type: "input",
-    label: "合同类型",
+    label: "合同",
     prop: "code",
     itemType: "text",
     readonly: true,
   },
   {
+    type: "input",
+    label: "业务公司",
+    prop: "ofCompanyName",
+    itemType: "text",
+    readonly: true,
+  },
+  {
+    type: "input",
+    label: "业务部门",
+    prop: "deptName",
+    itemType: "text",
+    readonly: true,
+  },
+  {
     type: "picker",
-    label: "合同类型",
+    label: "订单类型",
     prop: "contractType",
     itemType: "onePicker",
     showPicker: false,
@@ -151,18 +165,26 @@ const formConfigCode = reactive([
     },
     data: [
       {
+        dictKey: "3",
+        dictValue: "打样订单",
+      },
+      {
         dictKey: "2",
-        dictValue: "内销",
+        dictValue: "内销订单",
       },
       {
         dictKey: "1",
-        dictValue: "外销",
+        dictValue: "外贸订单(退税)",
+      },
+      {
+        dictKey: "4",
+        dictValue: "外贸订单(不退税)",
       },
     ],
   },
   {
     type: "cascader",
-    label: "生产公司",
+    label: "工厂",
     prop: "companyId",
     itemType: "common",
     showPicker: false,
@@ -172,6 +194,39 @@ const formConfigCode = reactive([
     },
     data: [],
   },
+  {
+    type: "picker",
+    label: "订单归属",
+    prop: "belongType",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "dictValue",
+      value: "dictKey",
+    },
+    data: [
+      {
+        dictKey: "2",
+        dictValue: "归属业务",
+      },
+      {
+        dictKey: "1",
+        dictValue: "归属工厂",
+      },
+    ],
+  },
+  {
+    type: "picker",
+    label: "跟单员",
+    prop: "merchUserId",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "text",
+      value: "value",
+    },
+    data: [],
+  },
 ]);
 const formConfig = reactive([
   {
@@ -334,24 +389,68 @@ const formConfig = reactive([
   },
 ]);
 const formConfigOne = reactive([
+  // {
+  //   type: "picker",
+  //   label: "币种",
+  //   prop: "currency",
+  //   itemType: "onePicker",
+  //   showPicker: false,
+  //   fieldNames: {
+  //     text: "label",
+  //     value: "value",
+  //   },
+  //   data: [],
+  //   readonly: false,
+  // },
+  // {
+  //   type: "input",
+  //   label: "汇率",
+  //   prop: "rate",
+  //   itemType: "number",
+  //   readonly: false,
+  // },
   {
     type: "picker",
-    label: "币种",
-    prop: "currency",
+    label: "是否含税",
+    prop: "isTax",
     itemType: "onePicker",
     showPicker: false,
     fieldNames: {
-      text: "label",
-      value: "value",
+      text: "dictValue",
+      value: "dictKey",
     },
-    data: [],
+    data: [
+      {
+        dictKey: "1",
+        dictValue: "含税",
+      },
+      {
+        dictKey: "0",
+        dictValue: "不含税",
+      },
+    ],
     readonly: false,
   },
   {
-    type: "input",
-    label: "汇率",
-    prop: "rate",
-    itemType: "number",
+    type: "picker",
+    label: "是否含运费",
+    prop: "isFreight",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "dictValue",
+      value: "dictKey",
+    },
+    data: [
+      {
+        dictKey: "1",
+        dictValue: "含运费",
+      },
+      {
+        dictKey: "0",
+        dictValue: "不含运费",
+      },
+    ],
     readonly: false,
   },
   {
@@ -425,42 +524,42 @@ const formConfigOne = reactive([
     prop: "accountOpening",
     itemType: "text",
   },
-  {
-    type: "input",
-    label: "Beneficiary Name",
-    prop: "beneficiaryName",
-    itemType: "text",
-  },
-  {
-    type: "input",
-    label: "Beneficiary Account Number",
-    prop: "beneficiaryAccountNumber",
-    itemType: "text",
-  },
-  {
-    type: "input",
-    label: "Beneficiary Bank",
-    prop: "beneficiaryBank",
-    itemType: "text",
-  },
-  {
-    type: "input",
-    label: "Swift Code",
-    prop: "swiftCode",
-    itemType: "text",
-  },
-  {
-    type: "input",
-    label: "Beneficiary Bank Address",
-    prop: "beneficiaryBankAddress",
-    itemType: "text",
-  },
-  {
-    type: "input",
-    label: "Beneficiary Address",
-    prop: "beneficiaryAddress",
-    itemType: "text",
-  },
+  // {
+  //   type: "input",
+  //   label: "Beneficiary Name",
+  //   prop: "beneficiaryName",
+  //   itemType: "text",
+  // },
+  // {
+  //   type: "input",
+  //   label: "Beneficiary Account Number",
+  //   prop: "beneficiaryAccountNumber",
+  //   itemType: "text",
+  // },
+  // {
+  //   type: "input",
+  //   label: "Beneficiary Bank",
+  //   prop: "beneficiaryBank",
+  //   itemType: "text",
+  // },
+  // {
+  //   type: "input",
+  //   label: "Swift Code",
+  //   prop: "swiftCode",
+  //   itemType: "text",
+  // },
+  // {
+  //   type: "input",
+  //   label: "Beneficiary Bank Address",
+  //   prop: "beneficiaryBankAddress",
+  //   itemType: "text",
+  // },
+  // {
+  //   type: "input",
+  //   label: "Beneficiary Address",
+  //   prop: "beneficiaryAddress",
+  //   itemType: "text",
+  // },
   {
     type: "title",
     title: "交付信息",
@@ -487,12 +586,12 @@ const formConfigOne = reactive([
     data: [],
     readonly: false,
   },
-  {
-    type: "input",
-    label: "运输说明",
-    prop: "transportRemark",
-    itemType: "text",
-  },
+  // {
+  //   type: "input",
+  //   label: "运输说明",
+  //   prop: "transportRemark",
+  //   itemType: "text",
+  // },
 ]);
 const formGoodsOption = reactive({
   readonly: false,
@@ -884,7 +983,24 @@ const getDict = () => {
       type: 0,
     })
     .then((res) => {
-      formConfigCode[3].data = proxy.handleTree(res.data, "deptId");
+      formConfigCode[5].data = proxy.handleTree(res.data, "deptId");
+    });
+
+  proxy
+    .get("/tenantUser/list", {
+      pageNum: 1,
+      pageSize: 10000,
+      tenantId: getUserInfo().tenantId,
+    })
+    .then((res) => {
+      if (res.rows && res.rows.length > 0) {
+        formConfigCode[7].data = res.rows.map((item) => {
+          return {
+            text: item.nickName,
+            value: item.userId,
+          };
+        });
+      }
     });
 
   // 卖方
@@ -924,18 +1040,18 @@ const getDict = () => {
     });
 
   // 币种
-  proxy
-    .post("/dictTenantData/page", { ...query, dictCode: "account_currency" })
-    .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: "account_currency" })
+  //   .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", {
@@ -976,7 +1092,7 @@ const getDict = () => {
     })
     .then((res) => {
       if (res.data.rows && res.data.rows.length > 0) {
-        formConfigOne[17].data = res.data.rows.map((item) => {
+        formConfigOne[11].data = res.data.rows.map((item) => {
           return {
             label: item.dictValue,
             value: item.dictKey,

Fichier diff supprimé car celui-ci est trop grand
+ 522 - 217
src/views/processApproval/components/EhsdContractChange.vue


+ 0 - 6
src/views/processApproval/components/EhsdPurchase.vue

@@ -316,12 +316,6 @@ const formConfigOne = reactive([
     split: "-",
     columnsType: ["year", "month", "day"],
   },
-  {
-    type: "input",
-    label: "保质期(天)",
-    prop: "warranty",
-    itemType: "number",
-  },
 ]);
 const formGoodsOption = reactive({
   readonly: false,

+ 88 - 50
src/views/processApproval/components/EhsdPurchaseChange.vue

@@ -5,7 +5,7 @@
       <van-tab title="付款信息" />
       <van-tab :title="'采购明细'" />
       <van-tab :title="proxy.t('contract.otherCharges')" />
-      <van-tab :title="'到货要求'" />
+      <!-- <van-tab :title="'到货要求'" /> -->
       <div class="common-process-card" v-show="active == 0">
 
         <div style="margin-bottom:20px" v-if="route.query && route.query.businessId">
@@ -13,24 +13,49 @@
           </testForm>
         </div>
 
-        <div class="common-title">
+        <!-- <div class="common-title">
           {{ proxy.t("contract.transactionInformation") }}
-        </div>
+        </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>
+        <!-- <div class="common-title">付款信息</div> -->
+        <van-field style="border-bottom:1px solid #0084ff;width:45%">
+          <template #input>
+            <div class="_title">
+              <div class="line"></div>
+              <div> 付款信息</div>
+            </div>
+          </template>
+        </van-field>
         <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>
+        <!-- <div class="common-title">商品信息</div> -->
+        <van-field style="border-bottom:1px solid #0084ff;width:45%">
+          <template #input>
+            <div class="_title">
+              <div class="line"></div>
+              <div> 采购明细</div>
+            </div>
+          </template>
+        </van-field>
         <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>
+        <!-- <div class="common-title">其他收费</div> -->
+        <van-field style="border-bottom:1px solid #0084ff;width:45%">
+          <template #input>
+            <div class="_title">
+              <div class="line"></div>
+              <div> 其他收费</div>
+            </div>
+          </template>
+        </van-field>
         <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">
@@ -41,11 +66,11 @@
           </template>
         </testForm>
       </div>
-      <div class="common-process-card" v-show="active == 4">
+      <!-- <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>
+      </div> -->
     </van-tabs>
     <van-popup closeable v-model:show="showRemark" position="bottom" :style="{ height: '40%' }">
       <div style="padding: 10px; padding-bottom: 70px" class="remark-class">
@@ -107,10 +132,11 @@ const formOption = reactive({
   labelWidth: "62pk",
   hiddenSubmitBtn: true,
 });
+
 const formConfigCode = reactive([
   {
     type: "title",
-    title: "合同号",
+    title: "基本信息",
   },
   {
     type: "input",
@@ -120,6 +146,7 @@ const formConfigCode = reactive([
     readonly: true,
   },
 ]);
+
 const formConfig = reactive([
   {
     type: "title",
@@ -289,12 +316,6 @@ const formConfigOne = reactive([
     split: "-",
     columnsType: ["year", "month", "day"],
   },
-  {
-    type: "input",
-    label: "保质期(天)",
-    prop: "warranty",
-    itemType: "number",
-  },
 ]);
 const formGoodsOption = reactive({
   readonly: false,
@@ -311,7 +332,7 @@ const formGoodsOption = reactive({
     listConfig: [
       {
         type: "picker",
-        label: "品名称",
+        label: "品名称",
         prop: "productId",
         itemType: "onePicker",
         showPicker: false,
@@ -325,13 +346,19 @@ const formGoodsOption = reactive({
       },
       {
         type: "input",
-        label: "尺寸 cm*cm*cm",
+        label: "商品编码",
+        prop: "productCode",
+        itemType: "text",
+      },
+      {
+        type: "input",
+        label: "尺寸 (cm)",
         prop: "productModel",
         itemType: "text",
       },
       {
         type: "input",
-        label: "数量",
+        label: "采购数量",
         prop: "quantity",
         itemType: "number",
         changeFn: () => {},
@@ -350,6 +377,13 @@ const formGoodsOption = reactive({
         itemType: "number",
         changeFn: () => {},
       },
+      {
+        type: "input",
+        label: "备注",
+        prop: "remark",
+        itemType: "texteare",
+        // changeFn: () => {},
+      },
     ],
     clickFn: () => {},
     deleteFn: (index) => {},
@@ -565,21 +599,17 @@ const rulesTwo = {
 const getProduct = () => {
   return new Promise((resolve, reject) => {
     proxy
-      .post("productInfo/getConditionProductList", {
+      .post("productInfo/page", {
         pageNum: 1,
         pageSize: 9999,
-        definition: "1",
+        definition: "",
       })
       .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,
+              label: x.name,
               value: x.id,
             };
           });
@@ -644,7 +674,11 @@ const getDict = () => {
   };
   // 合同模板
   proxy
-    .post("/contractTemplate/page", { pageNum: 1, pageSize: 999 })
+    .post("/contractTemplate/page", {
+      pageNum: 1,
+      pageSize: 999,
+      templateType: "2",
+    })
     .then((res) => {
       formAmountProjectConfig[1].data = res.data.rows.map((item) => {
         return {
@@ -665,12 +699,9 @@ const getDict = () => {
     });
   });
 
-  // 产品
-  Promise.all([getProduct(), getProductOne(), getMaterial()]).then((res) => {
-    formGoodsOption.btnConfig.listConfig[0].data = res[0].concat(
-      res[1],
-      res[2]
-    );
+  // 商品
+  Promise.all([getProduct()]).then((res) => {
+    formGoodsOption.btnConfig.listConfig[0].data = res[0].concat();
   });
 
   // 付款方式
@@ -820,14 +851,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;
             }
           });
         }
@@ -843,19 +867,20 @@ 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.purchaseProductList.map((x) => {
+        if (x.productLength && x.productWidth && x.productHeight) {
+          x.productModel =
+            x.productLength + "*" + x.productWidth + "*" + x.productHeight;
+        }
+      });
       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 })
@@ -877,7 +902,7 @@ onMounted(() => {
         res.data.sellProvinceName +
         " " +
         res.data.sellCityName;
-      if (["10", "20"].includes(route.query.processType)) {
+      if (["10", "20", "30"].includes(route.query.processType)) {
         formOption.readonly = true;
         formGoodsOption.readonly = true;
         formGoodsOption.btnConfig.isNeed = false;
@@ -888,14 +913,14 @@ onMounted(() => {
       setTimeout(() => {
         formDom1.value.formDataShowLabelOne();
         formDom2.value.formDataShowLabelOne();
-      }, 200);
+        formDom4.value.formDataShowLabelOne();
+      }, 300);
     });
   }
 });
 watch(
   refProps.queryData,
   () => {
-    console.log(refProps.queryData, "aa");
     return;
     if (
       refProps.queryData.value &&
@@ -1000,4 +1025,17 @@ const showRemark = ref(false);
     object-fit: contain;
   }
 }
+._title {
+  display: flex;
+  align-items: center;
+  font-size: 14px;
+  font-weight: 700;
+  margin-left: -10px;
+  .line {
+    width: 4px;
+    background-color: #0084ff;
+    height: 15px;
+    margin-right: 8px;
+  }
+}
 </style>

+ 0 - 1052
src/views/processApproval/components/PriceSheet.vue

@@ -1,1052 +0,0 @@
-<template>
-  <div class="form">
-    <van-tabs v-model:active="active">
-      <van-tab :title="proxy.t('priceSheet.transactionInformation')" />
-      <van-tab :title="proxy.t('priceSheet.quotationDetails')" />
-      <van-tab :title="proxy.t('priceSheet.otherCharges')" />
-      <van-tab :title="proxy.t('priceSheet.otherInformation')" />
-      <div class="common-process-card" v-show="active == 0">
-        <div class="common-title">
-          {{ proxy.t("priceSheet.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">
-          {{ proxy.t("priceSheet.quotationDetails") }}
-        </div>
-        <testForm
-          v-model="formData.data"
-          :formOption="formGoodsOption"
-          :formConfig="formEmptyConfig"
-          :rules="rules"
-          ref="formDom2"
-        >
-        </testForm>
-        <testForm
-          v-model="formData.data"
-          :formOption="formOption"
-          :formConfig="formAmountProductConfig"
-          :rules="rules"
-          ref="formDom3"
-        >
-        </testForm>
-      </div>
-      <div class="common-process-card" v-show="active == 2">
-        <div class="common-title">{{ proxy.t("priceSheet.otherCharges") }}</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 == 3">
-        <div class="common-title">
-          {{ proxy.t("priceSheet.otherInformation") }}
-        </div>
-        <testForm
-          v-model="formData.data"
-          :formOption="formOption"
-          :formConfig="formDeliveryConfig"
-          :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 formData = reactive({
-  data: {
-    quotationProductList: [],
-    quotationPayList: [],
-  },
-});
-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: "picker",
-    label: proxy.t("priceSheet.contractTemplateId"),
-    prop: "contractTemplateId",
-    itemType: "onePicker",
-    showPicker: false,
-    fieldNames: {
-      text: "label",
-      value: "value",
-    },
-    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;
-    },
-  },
-  {
-    type: "title",
-    title: proxy.t("priceSheet.sellerInformation"),
-  },
-  {
-    type: "picker",
-    label: proxy.t("priceSheet.sellCorporationId"),
-    prop: "sellCorporationId",
-    itemType: "onePicker",
-    showPicker: false,
-    fieldNames: {
-      text: "label",
-      value: "value",
-    },
-    data: [],
-    readonly: true,
-  },
-  {
-    type: "input",
-    label: proxy.t("priceSheet.cityText"),
-    prop: "sellCity",
-    itemType: "text",
-    readonly: true,
-  },
-  {
-    type: "input",
-    label: proxy.t("priceSheet.address"),
-    prop: "sellAddress",
-    itemType: "textarea",
-  },
-  {
-    type: "input",
-    label: proxy.t("priceSheet.contactName"),
-    prop: "sellContactName",
-    itemType: "text",
-  },
-  {
-    type: "input",
-    label: proxy.t("priceSheet.contactNumber"),
-    prop: "sellContactNumber",
-    itemType: "text",
-  },
-  {
-    type: "title",
-    title: proxy.t("priceSheet.buyerInformation"),
-  },
-  {
-    type: "picker",
-    label: proxy.t("priceSheet.buyCorporationId"),
-    prop: "buyCorporationId",
-    itemType: "onePicker",
-    showPicker: false,
-    fieldNames: {
-      text: "label",
-      value: "value",
-    },
-    data: [],
-    changeFn: (val, data) => {
-      proxy.formChange(val, data, formData);
-      formData.data.buyContactName = "";
-      formData.data.buyContactNumber = "";
-      if (val.selectedValues[0]) {
-        proxy
-          .post("/customer/detail", { id: val.selectedValues[0] })
-          .then((res) => {
-            if (
-              res.data.customerUserList &&
-              res.data.customerUserList.length > 0
-            ) {
-              formData.data.buyContactName = res.data.customerUserList[0].name;
-              if (res.data.customerUserList[0].contactJson) {
-                let contactJson = JSON.parse(
-                  res.data.customerUserList[0].contactJson
-                );
-                if (contactJson && contactJson.length > 0) {
-                  formData.data.buyContactNumber = contactJson[0].contactNo;
-                }
-              }
-            }
-            let countryCityName = "";
-            if (res.data.countryName) {
-              countryCityName = res.data.countryName;
-              if (res.data.provinceName) {
-                countryCityName = countryCityName + " " + res.data.provinceName;
-                if (res.data.cityName) {
-                  countryCityName = countryCityName + " " + res.data.cityName;
-                }
-              }
-            }
-            formData.data.countryCityName = countryCityName;
-            if (res.data.cityId) {
-              formData.data.countryCity = res.data.cityId;
-            } else if (res.data.provinceId) {
-              formData.data.countryCity = res.data.provinceId;
-            } else if (res.data.countryId) {
-              formData.data.countryCity = res.data.countryId;
-            } else {
-              formData.data.countryCity = "";
-            }
-            formData.data.countryId = res.data.countryId;
-            formData.data.provinceId = res.data.provinceId;
-            formData.data.cityId = res.data.cityId;
-            formData.data.buyPostalCode = res.data.zipCode;
-            formData.data.buyAddress = res.data.address;
-          });
-      } else {
-        formData.data.countryId = "";
-        formData.data.provinceId = "";
-        formData.data.cityId = "";
-        formData.data.buyPostalCode = "";
-        formData.data.buyAddress = "";
-      }
-      data.showPicker = false;
-    },
-  },
-  {
-    type: "cascader",
-    label: proxy.t("priceSheet.cityText"),
-    prop: "countryCity",
-    itemType: "city",
-    showPicker: false,
-  },
-  {
-    type: "input",
-    label: proxy.t("priceSheet.address"),
-    prop: "buyAddress",
-    itemType: "textarea",
-  },
-  {
-    type: "input",
-    label: proxy.t("priceSheet.postalCode"),
-    prop: "buyPostalCode",
-    itemType: "text",
-  },
-  {
-    type: "input",
-    label: proxy.t("priceSheet.contactName"),
-    prop: "buyContactName",
-    itemType: "text",
-  },
-  {
-    type: "input",
-    label: proxy.t("priceSheet.contactNumber"),
-    prop: "buyContactNumber",
-    itemType: "text",
-  },
-]);
-const formGoodsOption = reactive({
-  readonly: false,
-  disabled: false,
-  labelAlign: "top",
-  scroll: true,
-  labelWidth: "62pk",
-  hiddenSubmitBtn: true,
-  btnConfig: {
-    isNeed: true,
-    prop: "quotationProductList",
-    plain: true,
-    listTitle: proxy.t("priceSheet.commodityInformation"),
-    listConfig: [
-      {
-        type: "picker",
-        label: proxy.t("priceSheet.productId"),
-        prop: "productId",
-        itemType: "onePicker",
-        showPicker: false,
-        readonly: false,
-        fieldNames: {
-          text: "label",
-          value: "value",
-        },
-        data: [],
-        changeFn: (val, data, index, indexTwo, propName) => {
-          let selectList = formData.data[propName].filter(
-            (item, itemIndex) =>
-              item[data.prop] === val.selectedValues[0] && itemIndex !== index
-          );
-          if (selectList && selectList.length > 0) {
-            return showFailToast(proxy.t("priceSheet.productRepeat"));
-          }
-          formData.data[propName][index][data.prop] = val.selectedValues[0];
-          let list = data.data.filter(
-            (item) => item[data.fieldNames.value] == val.selectedValues[0]
-          );
-          if (list && list.length > 0) {
-            formData.data[propName][index][data.prop + "Name"] =
-              list[0][data.fieldNames.text];
-            let name = list[0].name;
-            if (list[0].standardJson) {
-              let standardJson = JSON.parse(list[0].standardJson);
-              if (standardJson && standardJson.englishName) {
-                name = standardJson.englishName;
-              }
-            }
-            formData.data[propName][index].productName = name;
-            formData.data[propName][index].productModel = list[0].spec;
-          } else {
-            formData.data[propName][index][data.prop + "Name"] = "";
-          }
-          formData.data[propName][index].quantity = null;
-          formData.data[propName][index].price = null;
-          formData.data[propName][index].amount = null;
-          formData.data[propName][index].remark = null;
-          data.showPicker = false;
-        },
-      },
-      {
-        type: "input",
-        label: proxy.t("priceSheet.productName"),
-        prop: "productName",
-        itemType: "text",
-      },
-      {
-        type: "input",
-        label: proxy.t("priceSheet.productModel"),
-        prop: "productModel",
-        itemType: "text",
-      },
-      {
-        type: "input",
-        label: proxy.t("priceSheet.quantity"),
-        prop: "quantity",
-        itemType: "number",
-        changeFn: () => {
-          calculatedAmount();
-        },
-      },
-      {
-        type: "input",
-        label: proxy.t("priceSheet.price"),
-        prop: "price",
-        itemType: "number",
-        changeFn: () => {
-          calculatedAmount();
-        },
-      },
-    ],
-    clickFn: () => {
-      if (
-        formData.data.quotationProductList &&
-        formData.data.quotationProductList.length > 0
-      ) {
-        formData.data.quotationProductList.push({
-          productId: null,
-          productName: null,
-          productModel: null,
-          quantity: null,
-          price: null,
-          amount: null,
-          remark: null,
-        });
-      } else {
-        formData.data.quotationProductList = [
-          {
-            productId: null,
-            productName: null,
-            productModel: null,
-            quantity: null,
-            price: null,
-            amount: null,
-            remark: null,
-          },
-        ];
-      }
-    },
-    deleteFn: (index) => {
-      formData.data.quotationProductList.splice(index, 1);
-      handleChangeAmount();
-    },
-  },
-});
-const formEmptyConfig = reactive([]);
-const formAmountProductConfig = reactive([
-  {
-    type: "input",
-    label: proxy.t("priceSheet.amountProduct"),
-    prop: "amountProduct",
-    itemType: "text",
-    readonly: true,
-    placeholder: proxy.t("priceSheet.amountProductPlaceholder"),
-  },
-]);
-const formAmountProjectConfig = reactive([
-  {
-    type: "input",
-    label: proxy.t("priceSheet.amountProject"),
-    prop: "amountProject",
-    itemType: "text",
-    readonly: true,
-    placeholder: proxy.t("priceSheet.amountProjectPlaceholder"),
-  },
-]);
-const formProjectOption = reactive({
-  readonly: false,
-  disabled: false,
-  labelAlign: "top",
-  scroll: true,
-  labelWidth: "62pk",
-  hiddenSubmitBtn: true,
-  btnConfig: {
-    isNeed: true,
-    prop: "quotationPayList",
-    plain: true,
-    listTitle: proxy.t("priceSheet.chargeItem"),
-    listConfig: [
-      {
-        type: "input",
-        label: proxy.t("priceSheet.chargeItem"),
-        prop: "payName",
-        itemType: "text",
-      },
-      {
-        type: "input",
-        label: proxy.t("priceSheet.amount"),
-        prop: "amount",
-        itemType: "number",
-        changeFn: () => {
-          handleChangeAmount();
-        },
-      },
-      {
-        type: "input",
-        label: proxy.t("priceSheet.remark"),
-        prop: "remark",
-        itemType: "textarea",
-      },
-    ],
-    clickFn: () => {
-      if (
-        formData.data.quotationPayList &&
-        formData.data.quotationPayList.length > 0
-      ) {
-        formData.data.quotationPayList.push({
-          payName: null,
-          amount: null,
-          remark: null,
-        });
-      } else {
-        formData.data.quotationPayList = [
-          {
-            payName: null,
-            amount: null,
-            remark: null,
-          },
-        ];
-      }
-    },
-    deleteFn: (index) => {
-      formData.data.quotationPayList.splice(index, 1);
-      handleChangeAmount();
-    },
-  },
-});
-const formDeliveryConfig = reactive([
-  {
-    type: "title",
-    title: proxy.t("priceSheet.quotedAmount"),
-  },
-  {
-    type: "picker",
-    label: proxy.t("priceSheet.currency"),
-    prop: "currency",
-    itemType: "onePicker",
-    showPicker: false,
-    fieldNames: {
-      text: "label",
-      value: "value",
-    },
-    data: [],
-  },
-  {
-    type: "input",
-    label: proxy.t("priceSheet.amountAll"),
-    prop: "amount",
-    itemType: "text",
-    readonly: true,
-    placeholder: proxy.t("priceSheet.amountAllPlaceholder"),
-  },
-  {
-    type: "input",
-    label: proxy.t("priceSheet.effective"),
-    prop: "effective",
-    itemType: "digit",
-  },
-  {
-    type: "picker",
-    label: proxy.t("priceSheet.paymentMethod"),
-    prop: "paymentMethod",
-    itemType: "onePicker",
-    showPicker: false,
-    fieldNames: {
-      text: "label",
-      value: "value",
-    },
-    data: [],
-  },
-  {
-    type: "input",
-    label: proxy.t("priceSheet.advanceRatio"),
-    prop: "advanceRatio",
-    itemType: "number",
-    inputFn: (val) => {
-      if (val) {
-        if (val > 100) {
-          formData.data.advanceRatio = 100;
-        } else if (val < 0) {
-          formData.data.advanceRatio = 0;
-        }
-      }
-    },
-  },
-  {
-    type: "title",
-    title: proxy.t("priceSheet.deliveryInformation"),
-  },
-  {
-    type: "picker",
-    label: proxy.t("priceSheet.tradeMethods"),
-    prop: "tradeMethods",
-    itemType: "onePicker",
-    showPicker: false,
-    fieldNames: {
-      text: "label",
-      value: "value",
-    },
-    data: [],
-  },
-  {
-    type: "picker",
-    label: proxy.t("priceSheet.transportMethod"),
-    prop: "transportMethod",
-    itemType: "onePicker",
-    showPicker: false,
-    fieldNames: {
-      text: "label",
-      value: "value",
-    },
-    data: [],
-  },
-  {
-    type: "input",
-    label: proxy.t("priceSheet.transportRemark"),
-    prop: "transportRemark",
-    itemType: "text",
-  },
-  {
-    type: "input",
-    label: proxy.t("priceSheet.remarks"),
-    prop: "remark",
-    itemType: "textarea",
-  },
-  {
-    type: "input",
-    label: proxy.t("priceSheet.warranty"),
-    prop: "warranty",
-    itemType: "digit",
-  },
-]);
-const rules = {
-  contractTemplateId: [
-    { required: true, message: proxy.t("priceSheet.contractTemplateIdMsg") },
-  ],
-  sellCorporationId: [
-    { required: true, message: proxy.t("priceSheet.sellCorporationIdMsg") },
-  ],
-  buyCorporationId: [
-    { required: true, message: proxy.t("priceSheet.buyCorporationIdMsg") },
-  ],
-  sellCity: [{ required: true, message: proxy.t("priceSheet.cityMsg") }],
-  countryCity: [{ required: true, message: proxy.t("priceSheet.cityMsg") }],
-  sellAddress: [{ required: true, message: proxy.t("priceSheet.addressMsg") }],
-  buyAddress: [{ required: true, message: proxy.t("priceSheet.addressMsg") }],
-  sellContactName: [
-    { required: true, message: proxy.t("priceSheet.contactNameMsg") },
-  ],
-  sellContactNumber: [
-    { required: true, message: proxy.t("priceSheet.contactNumberMsg") },
-  ],
-  // buyPostalCode: [{ required: true, message: proxy.t("priceSheet.postalCodeMsg") }],
-  buyContactName: [
-    { required: true, message: proxy.t("priceSheet.contactNameMsg") },
-  ],
-  buyContactNumber: [
-    { required: true, message: proxy.t("priceSheet.contactNumberMsg") },
-  ],
-  productId: [{ required: true, message: proxy.t("priceSheet.productIdMsg") }],
-  productName: [
-    { required: true, message: proxy.t("priceSheet.productNameMsg") },
-  ],
-  productModel: [
-    { required: true, message: proxy.t("priceSheet.productModelMsg") },
-  ],
-  quantity: [{ required: true, message: proxy.t("priceSheet.quantityMsg") }],
-  price: [{ required: true, message: proxy.t("priceSheet.priceMsg") }],
-  payName: [{ required: true, message: proxy.t("priceSheet.chargeItemMsg") }],
-  amount: [{ required: true, message: proxy.t("priceSheet.amountMsg") }],
-};
-const rulesTwo = {
-  currency: [{ required: true, message: proxy.t("priceSheet.currencyMsg") }],
-  effective: [{ required: true, message: proxy.t("priceSheet.effectiveMsg") }],
-  paymentMethod: [
-    { required: true, message: proxy.t("priceSheet.paymentMethodMsg") },
-  ],
-  advanceRatio: [
-    { required: true, message: proxy.t("priceSheet.advanceRatioMsg") },
-  ],
-  tradeMethods: [
-    { required: true, message: proxy.t("priceSheet.tradeMethodsMsg") },
-  ],
-  transportMethod: [
-    { required: true, message: proxy.t("priceSheet.transportMethodMsg") },
-  ],
-  transportRemark: [
-    { required: true, message: proxy.t("priceSheet.transportRemarkMsg") },
-  ],
-  remark: [{ required: true, message: proxy.t("priceSheet.remarksMsg") }],
-};
-const getDict = () => {
-  let query = {
-    pageNum: 1,
-    pageSize: 999,
-    tenantId: getUserInfo().tenantId,
-  };
-  proxy
-    .post("/contractTemplate/page", { pageNum: 1, pageSize: 999 })
-    .then((res) => {
-      if (res.data.rows && res.data.rows.length > 0) {
-        formConfig[0].data = res.data.rows.map((item) => {
-          return {
-            ...item,
-            label: item.templateName,
-            value: item.id,
-          };
-        });
-      }
-    });
-  proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
-    if (res.data.rows && res.data.rows.length > 0) {
-      formConfig[2].data = res.data.rows.map((item) => {
-        return {
-          ...item,
-          label: item.name,
-          value: item.id,
-        };
-      });
-    }
-  });
-  proxy
-    .post("/productInfo/page", { pageNum: 1, pageSize: 19999, definition: "1" })
-    .then((res) => {
-      if (res.data.rows && res.data.rows.length > 0) {
-        formGoodsOption.btnConfig.listConfig[0].data = res.data.rows.map(
-          (item) => {
-            return {
-              ...item,
-              label: item.name,
-              value: item.id,
-            };
-          }
-        );
-        console.log(formGoodsOption.btnConfig.listConfig[0].data, "wadfzx");
-      }
-    });
-  proxy
-    .post("/dictTenantData/page", { ...query, dictCode: "account_currency" })
-    .then((res) => {
-      if (res.data.rows && res.data.rows.length > 0) {
-        formDeliveryConfig[1].data = res.data.rows.map((item) => {
-          return {
-            label: item.dictValue,
-            value: item.dictKey,
-          };
-        });
-      }
-    });
-  proxy
-    .post("/dictTenantData/page", {
-      ...query,
-      dictCode: "funds_payment_method",
-    })
-    .then((res) => {
-      if (res.data.rows && res.data.rows.length > 0) {
-        formDeliveryConfig[4].data = res.data.rows.map((item) => {
-          return {
-            label: item.dictValue,
-            value: item.dictKey,
-          };
-        });
-      }
-    });
-  proxy
-    .post("/dictTenantData/page", { ...query, dictCode: "trade_mode" })
-    .then((res) => {
-      if (res.data.rows && res.data.rows.length > 0) {
-        formDeliveryConfig[7].data = res.data.rows.map((item) => {
-          return {
-            label: item.dictValue,
-            value: item.dictKey,
-          };
-        });
-      }
-    });
-  proxy
-    .post("/dictTenantData/page", { ...query, dictCode: "shipping_method" })
-    .then((res) => {
-      if (res.data.rows && res.data.rows.length > 0) {
-        formDeliveryConfig[8].data = res.data.rows.map((item) => {
-          return {
-            label: item.dictValue,
-            value: item.dictKey,
-          };
-        });
-      }
-    });
-  if (["10", "20"].includes(route.query.processType)) {
-    proxy.post("/customer/page", { pageNum: 1, pageSize: 999 }).then((res) => {
-      if (res.data.rows && res.data.rows.length > 0) {
-        formConfig[8].data = res.data.rows.map((item) => {
-          return {
-            ...item,
-            label: item.name,
-            value: item.id,
-          };
-        });
-      }
-    });
-  } else {
-    proxy
-      .post("/customer/privateSeaPage", { pageNum: 1, pageSize: 999 })
-      .then((res) => {
-        if (res.data.rows && res.data.rows.length > 0) {
-          formConfig[8].data = res.data.rows.map((item) => {
-            return {
-              ...item,
-              label: item.name,
-              value: item.id,
-            };
-          });
-        }
-      });
-  }
-};
-getDict();
-const calculatedAmount = () => {
-  if (
-    formData.data.quotationProductList &&
-    formData.data.quotationProductList.length > 0
-  ) {
-    for (let i = 0; i < formData.data.quotationProductList.length; i++) {
-      let money = 0;
-      if (
-        formData.data.quotationProductList[i].quantity &&
-        formData.data.quotationProductList[i].price
-      ) {
-        money = Number(
-          Math.round(
-            Number(formData.data.quotationProductList[i].quantity) *
-              Number(formData.data.quotationProductList[i].price) *
-              10000
-          ) / 10000
-        );
-      }
-      formData.data.quotationProductList[i].amount = money;
-    }
-  }
-  handleChangeAmount();
-};
-const handleChangeAmount = () => {
-  let money = 0;
-  let amountProduct = 0;
-  let amountProject = 0;
-  if (
-    formData.data.quotationProductList &&
-    formData.data.quotationProductList.length > 0
-  ) {
-    for (let i = 0; i < formData.data.quotationProductList.length; i++) {
-      if (formData.data.quotationProductList[i].amount) {
-        money = Number(
-          Math.round(
-            (Number(money) +
-              Number(formData.data.quotationProductList[i].amount)) *
-              10000
-          ) / 10000
-        );
-        amountProduct = Number(
-          Math.round(
-            (Number(amountProduct) +
-              Number(formData.data.quotationProductList[i].amount)) *
-              10000
-          ) / 10000
-        );
-      }
-    }
-  }
-  if (
-    formData.data.quotationPayList &&
-    formData.data.quotationPayList.length > 0
-  ) {
-    for (let i = 0; i < formData.data.quotationPayList.length; i++) {
-      if (formData.data.quotationPayList[i].amount) {
-        money = Number(
-          Math.round(
-            (Number(money) + Number(formData.data.quotationPayList[i].amount)) *
-              10000
-          ) / 10000
-        );
-        amountProject = Number(
-          Math.round(
-            (Number(amountProject) +
-              Number(formData.data.quotationPayList[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.quotationProductList &&
-          formData.data.quotationProductList.length > 0
-        )
-      ) {
-        active.value = 1;
-        showFailToast(proxy.t("priceSheet.pleaseAddProduct"));
-        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;
-  }
-};
-const status = ref(true);
-watch(
-  refProps.queryData,
-  () => {
-    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();
-      console.log(formData.data, "dwada");
-      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;
-      }
-      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>

+ 43 - 22
src/views/processApproval/components/SendPurchasePayment.vue

@@ -1,21 +1,8 @@
 <template>
   <div class="form">
-    <testForm
-      v-model="formData.data"
-      :formOption="formOption"
-      :formConfig="formConfig"
-      :rules="rules"
-      @onSubmit="onSubmit"
-      ref="formDom"
-    ></testForm>
-    <testForm
-      v-model="formData.data"
-      :formOption="formOptionOne"
-      :formConfig="formConfigOne"
-      :rules="rules"
-      @onSubmit="onSubmit"
-      ref="formDomOne"
-    ></testForm>
+    <testForm v-model="formData.data" :formOption="formOption" :formConfig="formConfig" :rules="rules" @onSubmit="onSubmit" ref="formDom"></testForm>
+    <testForm v-model="formData.data" :formOption="formOptionOne" :formConfig="formConfigOne" :rules="rules" @onSubmit="onSubmit" ref="formDomOne">
+    </testForm>
   </div>
 </template>
 
@@ -31,7 +18,10 @@ import {
 import { showSuccessToast, showFailToast } from "vant";
 import { useRoute } from "vue-router";
 import testForm from "@/components/testForm/index.vue";
+import { getAllDict } from "@/utils/auth";
 const proxy = getCurrentInstance().proxy;
+const payMethod = getAllDict()["pay_method"];
+
 const route = useRoute();
 const formDom = ref(null);
 const formDomOne = ref(null);
@@ -273,6 +263,25 @@ const formConfig = reactive([
     // },
   },
   {
+    type: "picker",
+    label: "付款类型",
+    prop: "type",
+    itemType: "onePicker",
+    showPicker: false,
+    readonly: false,
+    fieldNames: {
+      text: "dictValue",
+      value: "dictKey",
+    },
+    data: payMethod,
+    // changeFn: function (option, item, index) {
+    //   formData.data[item.prop] = option.selectedOptions[0].value;
+    //   formData.data[item.prop + "Name"] = option.selectedOptions[0].label;
+    //   formConfig[index].showPicker = false;
+    //   changeSupply(option.selectedOptions[0].value);
+    // },
+  },
+  {
     type: "input",
     label: proxy.t("purchasePayment.paymentDescription"),
     prop: "remark",
@@ -281,6 +290,13 @@ const formConfig = reactive([
   },
   {
     type: "input",
+    label: "业务公司",
+    prop: "name",
+    itemType: "text",
+    readonly: true,
+  },
+  {
+    type: "input",
     label: proxy.t("purchasePayment.documentNumber"),
     prop: "receiptsNum",
     itemType: "number",
@@ -301,16 +317,21 @@ const formConfig = reactive([
     changeFn: function (option, item, index) {
       proxy.formChange(option, item, formData);
       formConfig[index].showPicker = false;
-      changeInvoiceType(formData.data[item.prop]);
+      // changeInvoiceType(formData.data[item.prop]);
     },
   },
   {
     type: "input",
     label: proxy.t("purchasePayment.taxRate") + "(%)",
-    prop: "rate",
+    prop: "taxRate",
     itemType: "number",
     readonly: false,
   },
+  {
+    type: "upload",
+    label: "上传附件",
+    prop: "fileList",
+  },
 ]);
 const formOptionOne = reactive({
   readonly: false, //用于控制整个表单是否只读
@@ -460,13 +481,13 @@ const changeType = (val) => {
 const changeInvoiceType = (val) => {
   if (val == "1") {
     formConfig[7].type = "input";
-    formData.data.rate = "13";
+    formData.data.taxRate = "13";
   } else if (val == "2") {
     formConfig[7].type = "input";
-    formData.data.rate = "6";
+    formData.data.taxRate = "6";
   } else {
     formConfig[7].type = "inputOne";
-    formData.data.rate = "";
+    formData.data.taxRate = "";
   }
 };
 const changeAccount = (val) => {
@@ -518,7 +539,7 @@ const getDict = () => {
       label: x.dictValue,
       value: x.dictKey,
     }));
-    formConfig[6].data = invoiceType.value;
+    formConfig[8].data = invoiceType.value;
     formConfigOne[1].data = fundsPaymentMethod.value;
   });
 };

+ 6 - 0
src/views/processApproval/components/SendSubscribe.vue

@@ -225,6 +225,12 @@ onMounted(() => {
     let businessId = route.query.businessId;
     proxy.post("/subscribe/detail", { id: businessId }).then((res) => {
       formData.data = res.data;
+      formData.data.subscribeDetailList = formData.data.subscribeDetailList.map(
+        (x) => ({
+          ...x,
+          productModel: `${x.productLength}*${x.productWidth}*${x.productHeight}`,
+        })
+      );
     });
   }
 });

+ 38 - 31
src/views/processApproval/processDtl.vue

@@ -104,7 +104,7 @@ import { ref, getCurrentInstance, onMounted, reactive } from "vue";
 import { useRoute } from "vue-router";
 import SendSubscribe from "./components/SendSubscribe";
 import SendFunds from "./components/SendFunds";
-// import PriceSheet from "./components/PriceSheet";
+import DiscussPrice from "./components/DiscussPrice";
 import Contract from "./components/Contract";
 import EhsdContract from "./components/EhsdContract";
 import EhsdContractChange from "./components/EhsdContractChange";
@@ -168,59 +168,66 @@ let componentObj = ref({
     backUrl: "/main/funds",
     tabsNum: 3,
   },
-  sale_quotation_flow: {
-    title: "报价单",
-    component: EhsdPriceSheet,
-    backUrl: "/main/working",
-    tabsNum: 4,
-  },
+  // sale_quotation_flow: {
+  //   title: "报价单",
+  //   component: EhsdPriceSheet,
+  //   backUrl: "/main/working",
+  //   tabsNum: 4,
+  // },
   contract_flow: {
     title: "销售合同",
     component: EhsdContract,
     backUrl: "/main/contract",
     tabsNum: 5,
   },
-  purchase_flow: {
-    title: "采购合同",
-    component: EhsdPurchase,
-    backUrl: "/main/working",
-    tabsNum: 4,
-  },
-  pay_flow: {
-    title: "采购付款",
-    component: SendPurchasePayment,
-    backUrl: "/main/working",
-  },
   contract_update_flow: {
     title: "销售合同变更",
     component: EhsdContractChange,
     backUrl: "/main/contract",
     tabsNum: 5,
   },
-  sample_flow: {
-    title: "样品单",
-    component: EhsdSample,
-    backUrl: "/main/working",
-    tabsNum: 5,
-  },
-  sample_update_flow: {
-    title: "样品单变更",
-    component: EhsdSampleChange,
+  pay_flow: {
+    title: "采购付款",
+    component: SendPurchasePayment,
     backUrl: "/main/working",
-    tabsNum: 5,
   },
-  ehsd_purchase_flow: {
+
+  // sample_flow: {
+  //   title: "样品单",
+  //   component: EhsdSample,
+  //   backUrl: "/main/working",
+  //   tabsNum: 5,
+  // },
+  // sample_update_flow: {
+  //   title: "样品单变更",
+  //   component: EhsdSampleChange,
+  //   backUrl: "/main/working",
+  //   tabsNum: 5,
+  // },
+  // ehsd_purchase_flow: {
+  //   title: "采购合同",
+  //   component: EhsdPurchase,
+  //   backUrl: "/main/working",
+  //   tabsNum: 5,
+  // },
+  purchase_flow: {
     title: "采购合同",
     component: EhsdPurchase,
     backUrl: "/main/working",
-    tabsNum: 5,
+    tabsNum: 4,
   },
-  ehsd_purchase_update_flow: {
+  purchase_update_flow: {
     title: "采购合同变更",
     component: EhsdPurchaseChange,
     backUrl: "/main/working",
     tabsNum: 5,
   },
+  discuss_price_flow: {
+    title: "议价",
+    component: DiscussPrice,
+    backUrl: "/main/working",
+    tabsNum: 0,
+  },
 });
 
 let dialogVisible = ref(false);

+ 422 - 108
src/views/purchase-sales/inbound-outbound/manualInbound/add.vue

@@ -1,29 +1,12 @@
 <template>
   <div class="form">
-    <van-nav-bar
-      :title="$t('manualInbound.name')"
-      :left-text="$t('common.back')"
-      left-arrow
-      @click-left="onClickLeft"
-      @click-right="onClickRight"
-    >
-      <template #right> <div v-show="isShowVideo">{{$t('manualInbound.closeCamera')}}</div> </template>
+    <van-nav-bar :title="'其他入库'" :left-text="$t('common.back')" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
+      <!-- <template #right>
+        <div v-show="isShowVideo">{{$t('manualInbound.closeCamera')}}</div>
+      </template> -->
     </van-nav-bar>
-    <testForm
-      v-model="formData.data"
-      :formOption="formOption"
-      :formConfig="formConfig"
-      :rules="rules"
-      @onSubmit="onSubmit"
-      ref="formDom"
-    ></testForm>
-    <video
-      ref="video"
-      id="video"
-      class="scan-video"
-      autoplay
-      v-show="isShowVideo"
-    ></video>
+    <testForm v-model="formData.data" :formOption="formOption" :formConfig="formConfig" :rules="rules" @onSubmit="onSubmit" ref="formDom"></testForm>
+    <!-- <video ref="video" id="video" class="scan-video" autoplay v-show="isShowVideo"></video> -->
   </div>
 </template>
 
@@ -43,15 +26,102 @@ const productData = ref([]);
 const formData = reactive({
   data: {
     warehouseId: "",
-    type: "1",
+    type: "110",
     list: [],
   },
 });
 const rules = {
-  warehouseId: [{ required: true, message: proxy.t('manualInbound.warehouseNameCanNotBeEmpty') }],
-  productId: [{ required: true, message: proxy.t('manualInbound.goodsNameCanNotBeEmpty') }],
-  quantity: [{ required: true, message: proxy.t('manualInbound.warehousingQuantityCanNotBeEmpty')}],
+  warehouseId: [
+    {
+      required: true,
+      message: proxy.t("manualInbound.warehouseNameCanNotBeEmpty"),
+    },
+  ],
+  productId: [
+    {
+      required: true,
+      message: proxy.t("manualInbound.goodsNameCanNotBeEmpty"),
+    },
+  ],
+  quantity: [
+    {
+      required: true,
+      message: proxy.t("manualInbound.warehousingQuantityCanNotBeEmpty"),
+    },
+  ],
+  companyId: [
+    {
+      required: true,
+      message: "请选择业务公司",
+    },
+  ],
+  exWarehousePerson: [
+    {
+      required: true,
+      message: "请输入申请入库人",
+    },
+  ],
+  type: [
+    {
+      required: true,
+      message: "请选择入库原因",
+    },
+  ],
+  prodOrderId: [
+    {
+      required: true,
+      message: "请选择生产订单",
+    },
+  ],
+  borrowId: [
+    {
+      required: true,
+      message: "请选择借出单",
+    },
+  ],
+  loseId: [
+    {
+      required: true,
+      message: "请选择丢件单",
+    },
+  ],
+  remarks: [
+    {
+      required: true,
+      message: "请输入备注",
+    },
+  ],
 };
+const inBoundReason = ref([
+  {
+    label: "借用归还",
+    value: "100",
+  },
+  {
+    label: "退料入库",
+    value: "101",
+  },
+  {
+    label: "废料入库",
+    value: "102",
+  },
+  {
+    label: "丢件寻回",
+    value: "103",
+  },
+  {
+    label: "超领归还",
+    value: "108",
+  },
+  {
+    label: "错领归还",
+    value: "109",
+  },
+  {
+    label: "其他入库",
+    value: "110",
+  },
+]);
 const formOption = reactive({
   readonly: false, //用于控制整个表单是否只读
   disabled: false,
@@ -60,13 +130,13 @@ const formOption = reactive({
   labelWidth: "62pk",
   btnConfig: {
     isNeed: true,
-    label: proxy.t('common.details'),
+    label: "入库明细",
     prop: "list",
     plain: true,
     listConfig: [
       {
         type: "picker",
-        label: proxy.t('manualInbound.goodsName'),
+        label: "名称",
         prop: "productId",
         itemType: "onePicker",
         showPicker: false,
@@ -76,18 +146,51 @@ const formOption = reactive({
           value: "id",
         },
         data: [],
-        isShowScanCode: true,
-        scanCode: (index) => {
-          scanIndex.value = index;
-          handleScanCode();
+        changeFn: function (option, item, index, currentSonIndex, prop) {
+          proxy.formChangeTwo(
+            option,
+            item,
+            index,
+            currentSonIndex,
+            prop,
+            formData
+          );
+          formDom.value.btnConfigCopy.listConfig[
+            currentSonIndex
+          ].showPicker = false;
+
+          let current = item.data.find((x) => x.id == option.selectedValues[0]);
+
+          if (current) {
+            formData.data.list[index].productName = current.name;
+            formData.data.list[index].productCode = current.customCode;
+            formData.data.list[
+              index
+            ].size = `${current["length"]}*${current["width"]}*${current["height"]}`;
+          }
         },
       },
       {
         type: "input",
         itemType: "text",
-        label: proxy.t('manualInbound.warehousingQuantity'),
+        label: "编码",
+        prop: "productCode",
+        readonly: true,
+      },
+      {
+        type: "input",
+        itemType: "text",
+        label: "尺寸 (cm)",
+        prop: "size",
+        readonly: true,
+      },
+      {
+        type: "input",
+        itemType: "digit",
+        label: "入库数量",
         prop: "quantity",
         clearable: true,
+        readonly: false,
       },
     ],
     clickFn: () => {
@@ -107,113 +210,324 @@ const formOption = reactive({
     },
   },
 });
+
+const getType = (type = "110", att) => {
+  if (["101", "102", "108", "109", "110"].includes(type)) {
+    if (att == "prop") {
+      return "prodOrderId";
+    } else {
+      return "生产订单";
+    }
+  } else if (["100"].includes(type)) {
+    if (att == "prop") {
+      return "borrowId";
+    } else {
+      return "借出单";
+    }
+  } else if (["103"].includes(type)) {
+    if (att == "prop") {
+      return "loseId";
+    } else {
+      return "丢件单";
+    }
+  } else {
+    if (att == "prop") {
+      return "prodOrderId";
+    } else {
+      return "生产订单";
+    }
+  }
+};
 const formConfig = reactive([
   {
+    type: "title",
+    title: "基本信息",
+  },
+  {
+    type: "cascader",
+    label: "业务公司",
+    prop: "companyId",
+    itemType: "common",
+    showPicker: false,
+    data: [],
+    fieldNames: {
+      text: "deptName",
+      value: "deptId",
+      children: "children",
+    },
+    finishFn: (config, option) => {
+      if (option.selectedOptions[0]) {
+        let val = option.selectedOptions[0].deptId;
+        proxy
+          .post("/warehouse/page", {
+            pageNum: 1,
+            pageSize: 999,
+            companyId: val,
+          })
+          .then((res) => {
+            if (res.data.rows && res.data.rows.length > 0) {
+              formConfig[2].data = res.data.rows.map((item) => {
+                return {
+                  label: item.name,
+                  value: item.id,
+                };
+              });
+            }
+          });
+      }
+      config.showPicker = false;
+    },
+  },
+  {
     type: "picker",
-    label: proxy.t('manualInbound.warehouseName'),
+    label: "仓库名称",
     prop: "warehouseId",
     itemType: "onePicker",
     showPicker: false,
     fieldNames: {
-      text: "name",
-      value: "id",
+      text: "label",
+      value: "value",
+    },
+    data: [],
+  },
+  {
+    type: "input",
+    itemType: "text",
+    prop: "exWarehousePerson",
+    label: "申请入库人",
+  },
+  {
+    type: "picker",
+    prop: "type",
+    label: "入库原因",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: inBoundReason.value,
+    changeFn: (val, data) => {
+      if (val.selectedValues[0]) {
+        proxy.formChange(val, data, formData);
+        formData.data.list = [];
+        if (
+          ["101", "102", "108", "109", "110"].includes(val.selectedValues[0])
+        ) {
+          formData.data.borrowId = "";
+          formData.data.loseId = "";
+          formData.data.borrowIdName = "";
+          formData.data.loseIdName = "";
+          formConfig[5].data = produceOrder.value;
+          formOption.btnConfig.isNeed = true;
+          formOption.btnConfig.listConfig[0].readonly = false;
+          formOption.btnConfig.listConfig[3].readonly = false;
+        } else if (val.selectedValues[0] == "103") {
+          formData.data.borrowId = "";
+          formData.data.prodOrderId = "";
+          formData.data.borrowIdName = "";
+          formData.data.prodOrderIdName = "";
+          formConfig[5].data = lendDataOne.value;
+          formOption.btnConfig.isNeed = false;
+          formOption.btnConfig.listConfig[0].readonly = true;
+          formOption.btnConfig.listConfig[3].readonly = true;
+        } else {
+          formData.data.loseId = "";
+          formData.data.prodOrderId = "";
+          formData.data.loseIdName = "";
+          formData.data.prodOrderIdName = "";
+          formConfig[5].data = lendData.value;
+          formOption.btnConfig.isNeed = false;
+          formOption.btnConfig.listConfig[0].readonly = true;
+          formOption.btnConfig.listConfig[3].readonly = true;
+        }
+        formConfig[5].prop = getType(val.selectedValues[0], "prop");
+        formConfig[5].label = getType(val.selectedValues[0], "label");
+      }
+      data.showPicker = false;
+    },
+  },
+  {
+    type: "picker",
+    prop: getType(formData.data.type, "prop"),
+    label: getType(formData.data.type, "label"),
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
     },
     data: [],
+    changeFn: (val, data) => {
+      let selectVal = "";
+      if (val.selectedValues[0]) {
+        selectVal = val.selectedValues[0];
+      }
+      if (selectVal) {
+        proxy.formChange(val, data, formData);
+        if (formData.data.type == "100") {
+          proxy.post("/stockJournal/detail", { id: selectVal }).then((res) => {
+            if (res.data.list && res.data.list.length < 1) {
+              return;
+            }
+            formData.data.list = res.data.list.map((x) => ({
+              fileUrl: "",
+              productCode: x.productCode,
+              productId: x.productId,
+              productName: x.productName,
+              productLength: x.productLength,
+              productWidth: x.productWidth,
+              productHeight: x.productHeight,
+              size: `${x["productLength"]}*${x["productWidth"]}*${x["productHeight"]}`,
+              quantity: x.quantity,
+            }));
+          });
+        } else if (formData.data.type == "103") {
+          const current = lendDataOne.value.find((x) => x.value == selectVal);
+          if (current && current.materialId) {
+            formData.data.list = [
+              {
+                fileUrl: "",
+                productCode: current.materialCode,
+                productId: current.materialId,
+                productName: current.materialName,
+                productLength: current.materialLength,
+                productWidth: current.materialWidth,
+                productHeight: current.materialHeight,
+                size: `${current["materialLength"]}*${current["materialWidth"]}*${current["materialHeight"]}`,
+                quantity: current.quantity,
+              },
+            ];
+          }
+        } else {
+        }
+      }
+      data.showPicker = false;
+    },
+  },
+  {
+    type: "input",
+    itemType: "textarea",
+    prop: "remarks",
+    label: "备注",
   },
 ]);
 const onClickLeft = () => history.back();
+const companyData = ref([]);
+const produceOrder = ref([]);
+const lendData = ref([]);
+const lendDataOne = ref([]);
+
 const getDict = async () => {
-  proxy.post("/warehouse/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
-    formConfig[0].data = res.data.rows;
-  });
+  // proxy.post("/warehouse/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
+  //   formConfig[0].data = res.data.rows;
+  // });
   proxy
     .post("/productInfo/page", { pageNum: 1, pageSize: 9999, definition: "" })
     .then((res) => {
       formOption.btnConfig.listConfig[0].data = res.data.rows;
       productData.value = res.data.rows;
     });
+
+  proxy
+    .post("/tenantUser/getUserCompanyList", {
+      pageNum: 1,
+      pageSize: 9999,
+    })
+    .then((res) => {
+      formConfig[1].data = proxy.handleTree(res.data, "deptId");
+    });
+
+  proxy
+    .post("produceOrder/page", { pageNum: 1, pageSize: 9999 })
+    .then((res) => {
+      produceOrder.value = res.data.rows.map((x) => ({
+        label: x.code,
+        value: x.id,
+      }));
+      produceOrder.value.unshift({
+        label: "无",
+        value: -1,
+      });
+      formConfig[5].data = produceOrder.value;
+    });
+
+  proxy
+    .post("/stockJournal/page", {
+      pageNum: 1,
+      pageSize: 9999,
+      isRestitution: 0,
+      type: "3",
+    })
+    .then((res) => {
+      lendData.value = res.data.rows.map((x) => ({
+        label:
+          x.code +
+          " " +
+          x.expectRestitutionTime.slice(0, 10) +
+          " " +
+          x.exWarehousePerson +
+          " " +
+          x.remarks,
+        value: x.id,
+      }));
+    });
+  proxy
+    .post("/reportLossesDetails/page", {
+      pageNum: 1,
+      pageSize: 9999,
+      type: "2",
+    })
+    .then((res) => {
+      lendDataOne.value = res.data.rows.map((x) => ({
+        ...x,
+        label:
+          // x.code +
+          // " " +
+          x.repoTime.slice(0, 10) + " " + x.respUserName + " 数量" + x.quantity,
+        value: x.id,
+      }));
+    });
 };
 onMounted(async () => {
   getDict();
-  if (route.query.id) {
-    formOption.hiddenSubmitBtn = true;
-    formOption.readonly = true;
-    formOption.btnConfig.isNeed = false;
-    getDetails(route.query.id);
-  }
+  // if (route.query.id) {
+  //   formOption.hiddenSubmitBtn = true;
+  //   formOption.readonly = true;
+  //   formOption.btnConfig.isNeed = false;
+  //   getDetails(route.query.id);
+  // }
 });
 const getDetails = (id) => {
   proxy.post("/stockJournal/detail", { id }).then((res) => {
     formData.data = res.data;
   });
 };
+
 const onSubmit = () => {
-  if (!formData.data.list.length > 0) return showFailToast(proxy.t('manualInbound.addDetails'));
-  proxy.post("/stock/add", formData.data).then(
-    () => {
-      showSuccessToast(proxy.t('manualInbound.warehousingSuccess'),);
-      setTimeout(() => {
-        onClickLeft();
-        // proxy.$router.push("/main/manualInbound");
-      }, 500);
-    },
-    (err) => {
-      return showFailToast(err.message);
-    }
-  );
-};
-const showScanData = (id) => {
-  const current = productData.value.find((x) => x.id === id);
-  if (current) {
-    formData.data.list[scanIndex.value].productId = current.id;
-    formData.data.list[scanIndex.value].productIdName = current.name;
-  }
-};
-const decodeFromInputVideoFunc = (firstDeviceId) => {
-  codeReader.reset(); // 重置
-  isShowVideo.value = true;
-  codeReader.decodeFromInputVideoDeviceContinuously(
-    firstDeviceId,
-    "video",
-    (result, err) => {
-      if (result) {
-        codeReader.reset();
-        showSuccessToast(proxy.t('manualInbound.scanSuccess'));
-        isShowVideo.value = false;
-        showScanData(result.text);
-      }
-      if (err && !err) {
-        console.error(err);
-        isShowVideo.value = false;
+  if (formData.data.list.length > 0) {
+    for (let i = 0; i < formData.data.list.length; i++) {
+      if (Number(formData.data.list[i].quantity) == 0) {
+        return showFailToast("出库数量不能为0");
       }
     }
-  );
-};
-
-const handleScanCode = () => {
-  codeReader
-    .getVideoInputDevices()
-    .then((videoInputDevices) => {
-      // 默认获取第一个摄像头设备id
-      let firstDeviceId = videoInputDevices[0].deviceId;
-      // 获取第一个摄像头设备的名称
-      const videoInputDeviceslablestr = JSON.stringify(
-        videoInputDevices[0].label
-      );
-      if (videoInputDevices.length > 1) {
-        // 判断是否后置摄像头
-        if (videoInputDeviceslablestr.indexOf("back") > -1) {
-          firstDeviceId = videoInputDevices[0].deviceId;
-        } else {
-          firstDeviceId = videoInputDevices[1].deviceId;
-        }
+    proxy.post("/stock/add", formData.data).then(
+      () => {
+        showSuccessToast("操作成功");
+        setTimeout(() => {
+          onClickLeft();
+          // proxy.$router.push("/main/manualInbound");
+        }, 500);
+      },
+      (err) => {
+        return showFailToast(err.message);
       }
-      decodeFromInputVideoFunc(firstDeviceId);
-    })
-    .catch((err) => {
-      console.error(err, "错误");
-    });
+    );
+  } else {
+    return showFailToast("请添加入库明细");
+  }
 };
+
 const onClickRight = () => {
   codeReader.reset();
   isShowVideo.value = false;

+ 87 - 40
src/views/purchase-sales/inbound-outbound/manualInbound/index.vue

@@ -1,32 +1,12 @@
 <template>
-  <van-nav-bar
-    :title="$t('manualInbound.name')"
-    left-text=""
-    left-arrow
-    @click-left="onClickLeft"
-    @click-right="onClickRight"
-  >
+  <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-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 v-model:loading="loading" :finished="finished" :finished-text="$t('common.noMore')" @load="onLoad" style="margin-bottom: 60px">
+        <commonList :data="listData" @onClick="toDtl" :config="listConfig" :showMore="false"></commonList>
       </van-list>
     </div>
   </van-pull-refresh>
@@ -38,26 +18,87 @@ import { useRoute } from "vue-router";
 const loading = ref(false);
 const router = useRoute();
 const req = ref({
+  total: 0,
   pageNum: 1,
-  type: "1",
-  keyword: null,
+  pageSize: 10,
+  keyword: "",
+  warehouseId: "",
+  type: "",
+  opType: "1",
 });
 const finished = ref(false);
 const proxy = getCurrentInstance().proxy;
 const listData = ref([]);
-
+const inBoundReason = ref([
+  {
+    label: "借用归还",
+    value: "100",
+  },
+  {
+    label: "退料入库",
+    value: "101",
+  },
+  {
+    label: "废料入库",
+    value: "102",
+  },
+  {
+    label: "丢件寻回",
+    value: "103",
+  },
+  {
+    label: "超领归还",
+    value: "108",
+  },
+  {
+    label: "错领归还",
+    value: "109",
+  },
+  {
+    label: "其他入库",
+    value: "110",
+  },
+]);
 const listConfig = ref([
   {
-    label: proxy.t('manualInbound.warehouseName'),
+    label: "操作时间",
+    prop: "createTime",
+  },
+  {
+    label: "单号",
+    prop: "code",
+  },
+  {
+    label: "业务公司",
+    prop: "companyName",
+  },
+  {
+    label: "入库原因",
+    prop: "typeName",
+  },
+  {
+    label: "仓库名称",
     prop: "warehouseName",
   },
   {
-    label: proxy.t('manualInbound.warehousingTime'),
-    prop: "createTime",
+    label: "物品编码",
+    prop: "name",
+  },
+  {
+    label: "关联生产订单",
+    prop: "prodOrderCode",
+  },
+  {
+    label: "入库数量",
+    prop: "quantity",
+  },
+  {
+    label: "申请入库人",
+    prop: "exWarehousePerson",
   },
   {
-    label: proxy.t('manualInbound.operator'),
-    prop: "userName",
+    label: "操作人",
+    prop: "opUserName",
   },
 ]);
 const onRefresh = () => {
@@ -74,21 +115,27 @@ const onClickLeft = () => proxy.$router.push("/main/working");
 const onClickRight = () => {
   proxy.$router.push("/main/manualInboundAdd");
 };
-proxy.uploadDdRightBtn(onClickRight,proxy.t('common.add'))
+proxy.uploadDdRightBtn(onClickRight, proxy.t("common.add"));
 const toDtl = (row) => {
-  proxy.$router.push({
-    path: "manualInboundAdd",
-    query: {
-      id: row.id,
-    },
-  });
+  // proxy.$router.push({
+  //   path: "manualInboundAdd",
+  //   query: {
+  //     id: row.id,
+  //   },
+  // });
 };
 
 const getList = (type) => {
   loading.value = true;
   proxy
-    .post("/stockJournal/page", req.value)
+    .post("/stockJournalDetails/page", req.value)
     .then((res) => {
+      res.data.rows = res.data.rows.map((x) => ({
+        ...x,
+        typeName: proxy.dictValueLabel(x.type, inBoundReason.value),
+        name: `${x.productCustomCode}(${x.productName})`,
+        prodOrderCode: x.prodOrderCode ? x.prodOrderCode : "-",
+      }));
       console.log(req.value);
       listData.value =
         type === "refresh"

+ 395 - 102
src/views/purchase-sales/inbound-outbound/manualOutbound/add.vue

@@ -1,29 +1,12 @@
 <template>
   <div class="form">
-    <van-nav-bar
-      :title="$t('manualOutbound.name')"
-      :left-text="$t('common.back')"
-      left-arrow
-      @click-left="onClickLeft"
-      @click-right="onClickRight"
-    >
-      <template #right> <div v-show="isShowVideo">{{$t('manualInbound.closeCamera')}}</div> </template>
+    <van-nav-bar :title="'其他出库'" :left-text="$t('common.back')" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
+      <!-- <template #right>
+        <div v-show="isShowVideo">{{$t('manualInbound.closeCamera')}}</div>
+      </template> -->
     </van-nav-bar>
-    <testForm
-      v-model="formData.data"
-      :formOption="formOption"
-      :formConfig="formConfig"
-      :rules="rules"
-      @onSubmit="onSubmit"
-      ref="formDom"
-    ></testForm>
-    <video
-      ref="video"
-      id="video"
-      class="scan-video"
-      autoplay
-      v-show="isShowVideo"
-    ></video>
+    <testForm v-model="formData.data" :formOption="formOption" :formConfig="formConfig" :rules="rules" @onSubmit="onSubmit" ref="formDom"></testForm>
+    <!-- <video ref="video" id="video" class="scan-video" autoplay v-show="isShowVideo"></video> -->
   </div>
 </template>
 
@@ -43,15 +26,88 @@ const productData = ref([]);
 const formData = reactive({
   data: {
     warehouseId: "",
-    type: "2",
+    type: "10",
     list: [],
   },
 });
 const rules = {
-  warehouseId: [{ required: true, message: proxy.t('manualOutbound.warehouseNameCanNotBeEmpty') }],
-  productId: [{ required: true, message: proxy.t('manualOutbound.goodsNameCanNotBeEmpty') }],
-  quantity: [{ required: true, message: proxy.t('manualOutbound.outboundQuantityCanNotBeEmpty') }],
+  warehouseId: [
+    {
+      required: true,
+      message: proxy.t("manualInbound.warehouseNameCanNotBeEmpty"),
+    },
+  ],
+  productId: [
+    {
+      required: true,
+      message: proxy.t("manualInbound.goodsNameCanNotBeEmpty"),
+    },
+  ],
+  quantity: [
+    {
+      required: true,
+      message: proxy.t("manualInbound.warehousingQuantityCanNotBeEmpty"),
+    },
+  ],
+  companyId: [
+    {
+      required: true,
+      message: "请选择业务公司",
+    },
+  ],
+  exWarehousePerson: [
+    {
+      required: true,
+      message: "请输入领料人",
+    },
+  ],
+  type: [
+    {
+      required: true,
+      message: "请选择入库原因",
+    },
+  ],
+  prodOrderId: [
+    {
+      required: true,
+      message: "请选择生产订单",
+    },
+  ],
+  expectRestitutionTime: [
+    {
+      required: true,
+      message: "请选择归还日期",
+    },
+  ],
+  remarks: [
+    {
+      required: true,
+      message: "请输入备注",
+    },
+  ],
 };
+const outBoundReason = ref([
+  {
+    label: "生产打样",
+    value: "0",
+  },
+  {
+    label: "生产超领",
+    value: "1",
+  },
+  {
+    label: "销售出库",
+    value: "2",
+  },
+  {
+    label: "借用出库",
+    value: "3",
+  },
+  {
+    label: "其他出库",
+    value: "10",
+  },
+]);
 const formOption = reactive({
   readonly: false, //用于控制整个表单是否只读
   disabled: false,
@@ -60,34 +116,78 @@ const formOption = reactive({
   labelWidth: "62pk",
   btnConfig: {
     isNeed: true,
-    label: proxy.t('common.details'),
+    label: "入库明细",
     prop: "list",
     plain: true,
     listConfig: [
       {
         type: "picker",
-        label: proxy.t('manualOutbound.goodsName'),
+        label: "名称",
         prop: "productId",
         itemType: "onePicker",
         showPicker: false,
         readonly: false,
         fieldNames: {
-          text: "name",
-          value: "id",
+          text: "label",
+          value: "value",
         },
         data: [],
-        isShowScanCode: true,
-        scanCode: (index) => {
-          scanIndex.value = index;
-          handleScanCode();
+        changeFn: function (option, item, index, currentSonIndex, prop) {
+          proxy.formChangeTwo(
+            option,
+            item,
+            index,
+            currentSonIndex,
+            prop,
+            formData
+          );
+          formDom.value.btnConfigCopy.listConfig[
+            currentSonIndex
+          ].showPicker = false;
+
+          let current = item.data.find(
+            (x) => x.value == option.selectedValues[0]
+          );
+          console.log(current, "sada");
+          if (current) {
+            formData.data.list[index].productName = current.productName;
+            formData.data.list[index].productCode = current.productCustomCode;
+            formData.data.list[index].stockQuantity = current.quantity;
+            formData.data.list[
+              index
+            ].size = `${current["productLength"]}*${current["productWidth"]}*${current["productHeight"]}`;
+          }
         },
       },
       {
         type: "input",
         itemType: "text",
-        label: proxy.t('manualOutbound.outboundQuantity'),
+        label: "编码",
+        prop: "productCode",
+        readonly: true,
+      },
+      {
+        type: "input",
+        itemType: "text",
+        label: "尺寸 (cm)",
+        prop: "size",
+        readonly: true,
+      },
+      {
+        type: "input",
+        itemType: "digit",
+        label: "库存数量",
+        prop: "stockQuantity",
+        readonly: true,
+      },
+
+      {
+        type: "input",
+        itemType: "digit",
+        label: "入库数量",
         prop: "quantity",
         clearable: true,
+        readonly: false,
       },
     ],
     clickFn: () => {
@@ -107,37 +207,266 @@ const formOption = reactive({
     },
   },
 });
+
+const getTypeOne = (type) => {
+  if (type == "3") {
+    return "datePicker";
+  }
+  return "onePicker";
+};
+
+const getType = (type = "3", att) => {
+  if (["3"].includes(type)) {
+    if (att == "prop") {
+      return "expectRestitutionTime";
+    } else {
+      return "归还日期";
+    }
+  } else {
+    if (att == "prop") {
+      return "prodOrderId";
+    } else {
+      return "生产订单";
+    }
+  }
+};
 const formConfig = reactive([
   {
+    type: "title",
+    title: "基本信息",
+  },
+  {
+    type: "cascader",
+    label: "业务公司",
+    prop: "companyId",
+    itemType: "common",
+    showPicker: false,
+    data: [],
+    fieldNames: {
+      text: "deptName",
+      value: "deptId",
+      children: "children",
+    },
+    finishFn: (config, option) => {
+      if (option.selectedOptions[0]) {
+        let val = option.selectedOptions[0].deptId;
+        proxy
+          .post("/warehouse/page", {
+            pageNum: 1,
+            pageSize: 999,
+            companyId: val,
+          })
+          .then((res) => {
+            if (res.data.rows && res.data.rows.length > 0) {
+              formConfig[2].data = res.data.rows.map((item) => {
+                return {
+                  label: item.name,
+                  value: item.id,
+                };
+              });
+            }
+          });
+      }
+      config.showPicker = false;
+    },
+  },
+  {
+    type: "picker",
+    label: "仓库名称",
+    prop: "warehouseId",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+    changeFn: (val, data) => {
+      if (val.selectedValues[0]) {
+        proxy.formChange(val, data, formData);
+        getProductData(val.selectedValues[0]);
+      }
+      data.showPicker = false;
+    },
+  },
+  {
     type: "picker",
-    label: proxy.t('manualOutbound.warehouseName'),
+    label: "仓库名称",
     prop: "warehouseId",
     itemType: "onePicker",
     showPicker: false,
     fieldNames: {
-      text: "name",
-      value: "id",
+      text: "label",
+      value: "value",
+    },
+    data: [],
+    changeFn: (val, data) => {
+      if (val.selectedValues[0]) {
+        proxy.formChange(val, data, formData);
+        getProductData(val.selectedValues[0]);
+      }
+      data.showPicker = false;
+    },
+  },
+  {
+    type: "input",
+    itemType: "text",
+    prop: "exWarehousePerson",
+    label: "领料人",
+  },
+  {
+    type: "picker",
+    prop: "type",
+    label: "出库原因",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: outBoundReason.value,
+    changeFn: (val, data) => {
+      if (val.selectedValues[0]) {
+        proxy.formChange(val, data, formData);
+        formData.data.list = [];
+        if (["3"].includes(val.selectedValues[0])) {
+          formData.data.prodOrderId = "";
+        } else {
+          formData.data.expectRestitutionTime = "";
+        }
+        formConfig[5].prop = getType(val.selectedValues[0], "prop");
+        formConfig[5].label = getType(val.selectedValues[0], "label");
+        formConfig[5].itemType = getTypeOne(val.selectedValues[0]);
+      }
+      data.showPicker = false;
+    },
+  },
+  {
+    type: "picker",
+    prop: getType(formData.data.type, "prop"),
+    label: getType(formData.data.type, "label"),
+    itemType: getTypeOne(formData.data.type),
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
     },
     data: [],
+    changeFn: (val, data) => {
+      let selectVal = "";
+      if (val.selectedValues[0]) {
+        selectVal = val.selectedValues[0];
+      }
+      if (selectVal) {
+        proxy.formChange(val, data, formData);
+      }
+      data.showPicker = false;
+    },
+  },
+  {
+    type: "input",
+    itemType: "textarea",
+    prop: "remarks",
+    label: "备注",
   },
 ]);
 const onClickLeft = () => history.back();
+const companyData = ref([]);
+const produceOrder = ref([]);
+const lendData = ref([]);
+const lendDataOne = ref([]);
+
+const getProductData = (val) => {
+  proxy
+    .post("/stock/page", { pageNum: 1, pageSize: 9999, id: val })
+    .then((res) => {
+      productData.value = res.data.rows.map((x) => ({
+        ...x,
+        label: `${x.productName}(${x.quantity})`,
+        value: x.productId,
+      }));
+      formOption.btnConfig.listConfig[0].data = productData.value;
+    });
+};
 const getDict = async () => {
-  await proxy
-    .post("/warehouse/page", { pageNum: 1, pageSize: 9999 })
+  // proxy.post("/warehouse/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
+  //   formConfig[0].data = res.data.rows;
+  // });
+  // proxy
+  //   .post("/productInfo/page", { pageNum: 1, pageSize: 9999, definition: "" })
+  //   .then((res) => {
+  //     formOption.btnConfig.listConfig[0].data = res.data.rows;
+  //     productData.value = res.data.rows;
+  //   });
+
+  proxy
+    .post("/tenantUser/getUserCompanyList", {
+      pageNum: 1,
+      pageSize: 9999,
+    })
     .then((res) => {
-      formConfig[0].data = res.data.rows;
+      formConfig[1].data = proxy.handleTree(res.data, "deptId");
     });
-  await proxy
-    .post("/productInfo/page", { pageNum: 1, pageSize: 9999, definition: "" })
+
+  proxy
+    .post("produceOrder/page", { pageNum: 1, pageSize: 9999 })
     .then((res) => {
-      formOption.btnConfig.listConfig[0].data = res.data.rows;
-      productData.value = res.data.rows;
+      produceOrder.value = res.data.rows.map((x) => ({
+        label: x.code,
+        value: x.id,
+      }));
+      produceOrder.value.unshift({
+        label: "无",
+        value: -1,
+      });
+      formConfig[5].data = produceOrder.value;
+    });
+
+  proxy
+    .post("/stockJournal/page", {
+      pageNum: 1,
+      pageSize: 9999,
+      isRestitution: 0,
+      type: "3",
+    })
+    .then((res) => {
+      lendData.value = res.data.rows.map((x) => ({
+        label:
+          x.code +
+          " " +
+          x.expectRestitutionTime.slice(0, 10) +
+          " " +
+          x.exWarehousePerson +
+          " " +
+          x.remarks,
+        value: x.id,
+      }));
+    });
+  proxy
+    .post("/reportLossesDetails/page", {
+      pageNum: 1,
+      pageSize: 9999,
+      type: "2",
+    })
+    .then((res) => {
+      lendDataOne.value = res.data.rows.map((x) => ({
+        ...x,
+        label:
+          // x.code +
+          // " " +
+          x.repoTime.slice(0, 10) + " " + x.respUserName + " 数量" + x.quantity,
+        value: x.id,
+      }));
     });
 };
 onMounted(async () => {
-  await getDict();
-  if (route.query.id) getDetails(route.query.id);
+  getDict();
+  // if (route.query.id) {
+  //   formOption.hiddenSubmitBtn = true;
+  //   formOption.readonly = true;
+  //   formOption.btnConfig.isNeed = false;
+  //   getDetails(route.query.id);
+  // }
 });
 const getDetails = (id) => {
   proxy.post("/stockJournal/detail", { id }).then((res) => {
@@ -145,12 +474,27 @@ const getDetails = (id) => {
   });
 };
 const onSubmit = () => {
-  if (!formData.data.list.length > 0) return showFailToast(proxy.t('manualOutbound.addDetails'));
-  proxy.post("/stock/edit", formData.data).then(
+  if (formData.data.list && formData.data.list.length > 0) {
+    for (let i = 0; i < formData.data.list.length; i++) {
+      if (Number(formData.data.list[i].quantity) == 0) {
+        return showFailToast("出库数量不能为0");
+      }
+      if (
+        Number(formData.data.list[i].stockQuantity) <
+        Number(formData.data.list[i].quantity)
+      ) {
+        return showFailToast("出库数量不能大于库存数量");
+      }
+    }
+  } else {
+    return showFailToast("请添加出库产品");
+  }
+  proxy.post("/stock/add", formData.data).then(
     () => {
-      showSuccessToast(proxy.t('manualOutbound.outboundSuccess'));
+      showSuccessToast("操作成功");
       setTimeout(() => {
         onClickLeft();
+        // proxy.$router.push("/main/manualInbound");
       }, 500);
     },
     (err) => {
@@ -158,58 +502,7 @@ const onSubmit = () => {
     }
   );
 };
-const showScanData = (id) => {
-  const current = productData.value.find((x) => x.id === id);
-  if (current) {
-    formData.data.list[scanIndex.value].productId = current.id;
-    formData.data.list[scanIndex.value].productIdName = current.name;
-  }
-};
-const decodeFromInputVideoFunc = (firstDeviceId) => {
-  codeReader.reset(); // 重置
-  isShowVideo.value = true;
-  codeReader.decodeFromInputVideoDeviceContinuously(
-    firstDeviceId,
-    "video",
-    (result, err) => {
-      if (result) {
-        codeReader.reset();
-        showSuccessToast(proxy.t('manualOutbound.scanSuccess'));
-        isShowVideo.value = false;
-        showScanData(result.text);
-      }
-      if (err && !err) {
-        console.error(err);
-        isShowVideo.value = false;
-      }
-    }
-  );
-};
 
-const handleScanCode = () => {
-  codeReader
-    .getVideoInputDevices()
-    .then((videoInputDevices) => {
-      // 默认获取第一个摄像头设备id
-      let firstDeviceId = videoInputDevices[0].deviceId;
-      // 获取第一个摄像头设备的名称
-      const videoInputDeviceslablestr = JSON.stringify(
-        videoInputDevices[0].label
-      );
-      if (videoInputDevices.length > 1) {
-        // 判断是否后置摄像头
-        if (videoInputDeviceslablestr.indexOf("back") > -1) {
-          firstDeviceId = videoInputDevices[0].deviceId;
-        } else {
-          firstDeviceId = videoInputDevices[1].deviceId;
-        }
-      }
-      decodeFromInputVideoFunc(firstDeviceId);
-    })
-    .catch((err) => {
-      console.error(err, "错误");
-    });
-};
 const onClickRight = () => {
   codeReader.reset();
   isShowVideo.value = false;

+ 92 - 41
src/views/purchase-sales/inbound-outbound/manualOutbound/index.vue

@@ -1,32 +1,12 @@
 <template>
-  <van-nav-bar
-    :title="$t('manualOutbound.name')"
-    left-text=""
-    left-arrow
-    @click-left="onClickLeft"
-    @click-right="onClickRight"
-  >
+  <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-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 v-model:loading="loading" :finished="finished" :finished-text="$t('common.noMore')" @load="onLoad" style="margin-bottom: 60px">
+        <commonList :data="listData" @onClick="toDtl" :config="listConfig" :showMore="false"></commonList>
       </van-list>
     </div>
   </van-pull-refresh>
@@ -38,26 +18,88 @@ import { useRoute } from "vue-router";
 const loading = ref(false);
 const router = useRoute();
 const req = ref({
+  total: 0,
   pageNum: 1,
-  type: "2",
-  keyword: null,
+  pageSize: 10,
+  keyword: "",
+  warehouseId: "",
+  type: "",
+  opType: "2",
+  isRestitution: "",
 });
 const finished = ref(false);
 const proxy = getCurrentInstance().proxy;
 const listData = ref([]);
-
+const outBoundReason = ref([
+  {
+    label: "生产打样",
+    value: "0",
+  },
+  {
+    label: "生产超领",
+    value: "1",
+  },
+  {
+    label: "销售出库",
+    value: "2",
+  },
+  {
+    label: "借用出库",
+    value: "3",
+  },
+  {
+    label: "其他出库",
+    value: "10",
+  },
+]);
 const listConfig = ref([
   {
-    label: proxy.t('manualOutbound.warehouseName'),
-    prop: "warehouseName",
+    label: "业务公司",
+    prop: "companyName",
   },
   {
-    label: proxy.t('manualOutbound.outboundTime'),
+    label: "操作时间",
     prop: "createTime",
   },
   {
-    label: proxy.t('manualOutbound.operator'),
-    prop: "userName",
+    label: "单号",
+    prop: "code",
+  },
+  {
+    label: "出库原因",
+    prop: "typeName",
+  },
+  {
+    label: "仓库名称",
+    prop: "warehouseName",
+  },
+  {
+    label: "物品编码",
+    prop: "name",
+  },
+  {
+    label: "关联生产订单",
+    prop: "prodOrderCode",
+  },
+  {
+    label: "约定归还日期",
+    prop: "expectRestitutionTime",
+  },
+  {
+    label: "实际归还日期",
+    prop: "restitutionTime",
+  },
+  {
+    label: "入库数量",
+    prop: "quantity",
+  },
+  {
+    label: "领料人",
+    prop: "exWarehousePerson",
+  },
+  {
+    label: "操作人",
+    prop: "opUserName",
   },
 ]);
 const onRefresh = () => {
@@ -74,22 +116,31 @@ const onClickLeft = () => proxy.$router.push("/main/working");
 const onClickRight = () => {
   proxy.$router.push("/main/manualOutboundAdd");
 };
-proxy.uploadDdRightBtn(onClickRight,proxy.t('common.add'))
+proxy.uploadDdRightBtn(onClickRight, proxy.t("common.add"));
 const toDtl = (row) => {
-  console.log(row);
-  proxy.$router.push({
-    path: "manualOutboundAdd",
-    query: {
-      id: row.id,
-    },
-  });
+  // proxy.$router.push({
+  //   path: "manualOutboundAdd",
+  //   query: {
+  //     id: row.id,
+  //   },
+  // });
 };
 
 const getList = (type) => {
   loading.value = true;
   proxy
-    .post("/stockJournal/page", req.value)
+    .post("/stockJournalDetails/page", req.value)
     .then((res) => {
+      res.data.rows = res.data.rows.map((x) => ({
+        ...x,
+        typeName: proxy.dictValueLabel(x.type, outBoundReason.value),
+        name: `${x.productCustomCode}(${x.productName})`,
+        prodOrderCode: x.prodOrderCode ? x.prodOrderCode : "-",
+        expectRestitutionTime: x.expectRestitutionTime
+          ? x.expectRestitutionTime
+          : "-",
+        restitutionTime: x.restitutionTime ? x.restitutionTime : "-",
+      }));
       console.log(req.value);
       listData.value =
         type === "refresh"

+ 253 - 65
src/views/purchase-sales/inbound-outbound/waitInbound/add.vue

@@ -1,78 +1,245 @@
 <template>
   <div class="form">
-    <van-nav-bar
-      :title="$t('waitInbound.name')"
-      :left-text="$t('common.back')"
-      left-arrow
-      @click-left="onClickLeft"
-    >
+    <van-nav-bar :title="$t('waitInbound.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">
-      <van-cell-group inset>
-        <van-field
-          v-model="formData.businessTypeName"
-          readonly
-          :label="$t('waitInbound.dataSource')"
-        />
-        <van-field v-model="formData.businessCode" readonly :label="$t('waitInbound.orderNumber')" />
-        <van-field v-model="formData.productName" readonly :label="$t('waitInbound.goodsName')" />
-        <van-field v-model="formData.inQuantity" readonly :label="$t('waitInbound.waitInboundQuantity')" />
-      </van-cell-group>
-      <div style="padding: 5px 0 5px 15px; color: #999999">{{$t('waitInbound.thisTimeInbound')}}</div>
-      <van-cell-group inset>
-        <van-field
-          v-model="formData.warehouseName"
-          is-link
-          readonly
-          :label="$t('waitInbound.warehouseName')"
-          :placeholder="$t('waitInbound.selectWarehouseName')"
-          @click="typeModal = true"
-          :rules="[{ required: true, message: $t('waitInbound.warehouseNameCanNotBeEmpty') }]"
-          required
-        />
-        <van-popup v-model:show="typeModal" round position="bottom">
-          <van-picker
-            :columns="columns"
-            @cancel="typeModal = false"
-            @confirm="onConfirm"
-          />
-        </van-popup>
-        <van-field
-          v-model="formData.quantity"
-          :label="$t('waitInbound.warehousingQuantity')"
-          :placeholder="$t('waitInbound.pleaseEnterWarehousingQuantity')"
-          :rules="[{ required: true, message: $t('waitInbound.warehousingQuantityCanNotBeEmpty') }]"
-          required
-        />
-      </van-cell-group>
-      <div style="margin: 16px">
-        <van-button round block type="primary" native-type="submit">
-          {{$t('common.submit')}}
-        </van-button>
-      </div>
-    </van-form>
+    <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, showFailToast } from "vant";
 import { useRoute } from "vue-router";
-
+import testForm from "@/components/testForm/index.vue";
 const proxy = getCurrentInstance().proxy;
 const route = useRoute();
 const typeModal = ref(false);
-const formData = ref({});
-
+const businessType = ref([
+  {
+    label: "借用归还",
+    value: "100",
+  },
+  {
+    label: "退料入库",
+    value: "101",
+  },
+  {
+    label: "废料入库",
+    value: "102",
+  },
+  {
+    label: "丢件寻回",
+    value: "103",
+  },
+  {
+    label: "采购入库",
+    value: "104",
+  },
+  {
+    label: "调拨入库",
+    value: "105",
+  },
+  {
+    label: "盘盈入库",
+    value: "106",
+  },
+  {
+    label: "完工入库",
+    value: "107",
+  },
+]);
+const formData = reactive({
+  data: {},
+});
+const formDom = ref(null);
+const formOption = reactive({
+  readonly: false, //用于控制整个表单是否只读
+  disabled: false,
+  labelAlign: "top",
+  scroll: true,
+  labelWidth: "62pk",
+  hiddenSubmitBtn: false,
+  btnConfig: {
+    isNeed: false,
+    label: "入库明细",
+    prop: "stockWaitDetailsList",
+    plain: true,
+    listConfig: [
+      {
+        type: "input",
+        itemType: "text",
+        label: "物品名称",
+        prop: "productName",
+        readonly: true,
+      },
+      {
+        type: "input",
+        itemType: "text",
+        label: "物品编码",
+        prop: "productCustomCode",
+        readonly: true,
+      },
+      {
+        type: "input",
+        itemType: "text",
+        label: "尺寸 (cm)",
+        prop: "size",
+        readonly: true,
+      },
+      {
+        type: "input",
+        itemType: "digit",
+        label: "需入库数量",
+        prop: "needQuantity",
+        clearable: true,
+        readonly: true,
+      },
+      {
+        type: "input",
+        itemType: "digit",
+        label: "待入库数量",
+        prop: "waitQuantity",
+        clearable: true,
+        readonly: true,
+      },
+      {
+        type: "input",
+        itemType: "digit",
+        label: "已入库数量",
+        prop: "receiptQuantity",
+        clearable: true,
+        readonly: true,
+      },
+      {
+        type: "input",
+        itemType: "digit",
+        label: "入库数量",
+        prop: "quantity",
+        clearable: true,
+        readonly: false,
+      },
+    ],
+    clickFn: () => {},
+  },
+});
+const formConfig = reactive([
+  {
+    type: "title",
+    title: "待入库信息",
+  },
+  {
+    type: "picker",
+    label: "数据来源",
+    prop: "businessType",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+    readonly: true,
+  },
+  {
+    type: "input",
+    itemType: "text",
+    label: "单号",
+    prop: "businessCode",
+    clearable: true,
+    readonly: true,
+  },
+  {
+    type: "cascader",
+    label: "业务公司",
+    prop: "companyId",
+    itemType: "common",
+    showPicker: false,
+    data: [],
+    readonly: true,
+    fieldNames: {
+      text: "deptName",
+      value: "deptId",
+      children: "children",
+    },
+    finishFn: (config, option) => {
+      if (option.selectedOptions[0]) {
+        let val = option.selectedOptions[0].deptId;
+        proxy
+          .post("/warehouse/page", {
+            pageNum: 1,
+            pageSize: 999,
+            companyId: val,
+          })
+          .then((res) => {
+            if (res.data.rows && res.data.rows.length > 0) {
+              formConfig[2].data = res.data.rows.map((item) => {
+                return {
+                  label: item.name,
+                  value: item.id,
+                };
+              });
+            }
+          });
+      }
+      config.showPicker = false;
+    },
+  },
+  {
+    type: "picker",
+    label: "仓库名称",
+    prop: "warehouseId",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "text",
+      value: "value",
+    },
+    data: [],
+  },
+  {
+    type: "upload",
+    label: "上传凭证",
+    prop: "fileList",
+  },
+  {
+    type: "title",
+    title: "入库明细",
+  },
+]);
+const rules = {
+  warehouseId: [
+    {
+      required: true,
+      message: proxy.t("manualInbound.warehouseNameCanNotBeEmpty"),
+    },
+  ],
+  quantity: [
+    {
+      required: true,
+      message: "请输入入库数量",
+    },
+  ],
+};
 const getDict = () => {
+  formConfig[1].data = businessType.value;
+
   proxy.post("/warehouse/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
-    columns.value = res.data.rows.map((item) => {
+    formConfig[4].data = res.data.rows.map((item) => {
       return {
         text: item.name,
         value: item.id,
       };
     });
   });
+
+  proxy
+    .post("/tenantUser/getUserCompanyList", {
+      pageNum: 1,
+      pageSize: 9999,
+    })
+    .then((res) => {
+      formConfig[3].data = proxy.handleTree(res.data, "deptId");
+    });
 };
 
 const getDetails = (id) => {
@@ -93,12 +260,19 @@ const onConfirm = ({ selectedOptions }) => {
 const onClickLeft = () => history.back();
 
 const onSubmit = () => {
-  const data = {
-    id: formData.value.id,
-    warehouseId: formData.value.warehouseId,
-    quantity: formData.value.quantity,
-  };
-  proxy.post("/stockWait/add", data).then(
+  if (!(formData.data.fileList && formData.data.fileList.length > 0)) {
+    return showFailToast("请上传附件");
+  }
+  for (let i = 0; i < formData.data.stockWaitDetailsList.length; i++) {
+    const ele = formData.data.stockWaitDetailsList[i];
+    if (Number(ele.quantity) == 0) {
+      return showFailToast("入库数量不能为0");
+    }
+    if (Number(ele.quantity) > Number(ele.waitQuantity)) {
+      return showFailToast("入库数量不可大于待入库数量");
+    }
+  }
+  proxy.post("/stockWait/add", formData.data).then(
     (res) => {
       setTimeout(() => {
         showSuccessToast(proxy.$t("manualInbound.warehousingSuccess"));
@@ -112,11 +286,25 @@ const onSubmit = () => {
 };
 
 onMounted(() => {
-  if (route.query) {
-    formData.value = { ...route.query };
-    formData.value.inQuantity = formData.value.quantity;
-  }
   getDict();
+  if (route.query && route.query.row) {
+    let row = JSON.parse(route.query.row);
+    formData.data = {
+      id: row.id,
+      companyId: row.companyId,
+      businessType: row.businessType + "",
+      businessCode: row.businessCode,
+      warehouseId: "",
+      stockWaitDetailsList: row.stockWaitDetailsList.map((x) => ({
+        ...x,
+        size: `${x["productLength"]}*${x["productWidth"]}*${x["productHeight"]}`,
+        needQuantity: x.quantity,
+        quantity: null,
+      })),
+      fileList: [],
+    };
+    console.log(formData.data.stockWaitDetailsList, "saa");
+  }
 });
 </script>
 <style lang="scss" scoped>

+ 85 - 62
src/views/purchase-sales/inbound-outbound/waitInbound/index.vue

@@ -2,25 +2,11 @@
   <van-nav-bar :title="$t('waitInbound.name')" left-text="" left-arrow @click-left="onClickLeft">
     <!-- <template #right> 添加 </template> -->
   </van-nav-bar>
-  <van-search
-    v-model="req.keyword"
-    :placeholder="$t('common.pleaseEnterKeywords')"
-    @search="onRefresh"
-  />
+  <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 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>
         <div></div>
       </van-list>
     </div>
@@ -33,26 +19,84 @@ import { useRoute } from "vue-router";
 const loading = ref(false);
 const router = useRoute();
 const req = ref({
+  total: 0,
   pageNum: 1,
-  type: "1",
-  keyword: null,
+  pageSize: 10,
+  keyword: "",
+  status: "",
+  type: 1,
 });
 const finished = ref(false);
 const proxy = getCurrentInstance().proxy;
 const listData = ref([]);
-
+const status = ref([
+  {
+    label: "待入库",
+    value: 0,
+  },
+  {
+    label: "部分入库",
+    value: 1,
+  },
+  // {
+  //   label: "入库完成",
+  //   value: 2,
+  // },
+]);
+const businessType = ref([
+  {
+    label: "借用归还",
+    value: "100",
+  },
+  {
+    label: "退料入库",
+    value: "101",
+  },
+  {
+    label: "废料入库",
+    value: "102",
+  },
+  {
+    label: "丢件寻回",
+    value: "103",
+  },
+  {
+    label: "采购入库",
+    value: "104",
+  },
+  {
+    label: "调拨入库",
+    value: "105",
+  },
+  {
+    label: "盘盈入库",
+    value: "106",
+  },
+  {
+    label: "完工入库",
+    value: "107",
+  },
+]);
 const listConfig = ref([
   {
-    label: proxy.t('waitInbound.dataSource'),
+    label: "业务公司",
+    prop: "companyName",
+  },
+  {
+    label: "数据来源",
     prop: "businessTypeName",
   },
   {
-    label: proxy.t('waitInbound.goodsName'),
-    prop: "productName",
+    label: "单号",
+    prop: "businessCode",
   },
   {
-    label: proxy.t('waitInbound.toBeDoneQuantity'),
-    prop: "quantity",
+    label: "入库状态",
+    prop: "statusName",
+  },
+  {
+    label: "创建时间",
+    prop: "createTime",
   },
 ]);
 const onRefresh = () => {
@@ -74,55 +118,34 @@ const toDtl = (row) => {
   proxy.$router.push({
     path: "waitInboundAdd",
     query: {
-      ...row,
+      row: JSON.stringify(row),
     },
   });
 };
-const businessType = ref([
-  {
-    label: proxy.t('waitInbound.lineSideReturnWarehouse'),
-    value: 1,
-  },
-  {
-    label: proxy.t('waitInbound.completedWarehouse'),
-    value: 2,
-  },
-  {
-    label: proxy.t('waitInbound.purchaseArrival'),
-    value: 3,
-  },
-  {
-    label: proxy.t('waitInbound.returnOutbound'),
-    value: 4,
-  },
-  {
-    label: proxy.t('waitInbound.jdOrder'),
-    value: 5,
-  },
-  {
-    label: proxy.t('waitInbound.salesOrderOutbound'),
-    value: 6,
-  },
-]);
 
 const getList = (type) => {
   loading.value = true;
   proxy
-    .post("/stockWaitDetails/page", req.value)
+    .post("/stockWait/page", req.value)
     .then((res) => {
-      console.log(req.value);
+      res.data.rows = res.data.rows.map((x) => ({
+        ...x,
+        businessTypeName: proxy.dictValueLabel(
+          x.businessType,
+          businessType.value
+        ),
+        statusName: proxy.dictValueLabel(x.status, status.value),
+      }));
+      for (let i = 0; i < res.data.rows.length; i++) {
+        for (let j = 0; j < res.data.rows[i].stockWaitDetailsList.length; j++) {
+          let ele = res.data.rows[i].stockWaitDetailsList[j];
+          ele.waitQuantity = Number(ele.quantity) - Number(ele.receiptQuantity);
+        }
+      }
       listData.value =
         type === "refresh"
           ? res.data.rows
           : listData.value.concat(res.data.rows);
-      listData.value.forEach((x) => {
-        const current = businessType.value.find(
-          (v) => v.value == x.businessType
-        );
-        if (current) {
-          x.businessTypeName = current.label;
-        }
-      });
       if (req.value.pageNum * 10 >= res.data.total) {
         finished.value = true;
       }

+ 262 - 68
src/views/purchase-sales/inbound-outbound/waitOutbound/add.vue

@@ -1,86 +1,259 @@
 <template>
   <div class="form">
-    <van-nav-bar
-      :title="$t('waitOutbound.name')"
-      :left-text="$t('common.back')"
-      left-arrow
-      @click-left="onClickLeft"
-    >
+    <van-nav-bar :title="'待出库'" :left-text="$t('common.back')" left-arrow @click-left="onClickLeft">
     </van-nav-bar>
-    <van-form @submit="onSubmit" label-align="top" style="margin-top: 20px">
-      <van-cell-group inset>
-        <van-field
-          v-model="formData.businessTypeName"
-          readonly
-          :label="$t('waitOutbound.dataSource')"
-        />
-        <van-field v-model="formData.businessCode" readonly :label="$t('waitInbound.orderNumber')" />
-        <van-field v-model="formData.productName" readonly :label="$t('waitOutbound.goodsName')" />
-        <van-field v-model="formData.inQuantity" readonly :label="$t('waitOutbound.waitOutboundQuantity')" />
-      </van-cell-group>
-      <div style="padding: 5px 0 5px 15px; color: #999999">{{$t('waitOutbound.thisTimeOutbound')}}</div>
-      <van-cell-group inset>
-        <van-field
-          v-model="formData.warehouseName"
-          is-link
-          readonly
-          :label="$t('waitInbound.warehouseName')"
-          :placeholder="$t('waitInbound.selectWarehouseName')"
-          @click="typeModal = true"
-          :rules="[{ required: true, message: $t('waitInbound.warehouseNameCanNotBeEmpty') }]"
-          required
-        />
-        <van-popup v-model:show="typeModal" round position="bottom">
-          <van-picker
-            :columns="columns"
-            @cancel="typeModal = false"
-            @confirm="onConfirm"
-          />
-        </van-popup>
-        <van-field
-          v-model="formData.quantity"
-          :label="$t('waitInbound.outboundQuantity')"
-          :placeholder="$t('waitInbound.pleaseEnterOutboundQuantity')"
-          :rules="[{ required: true, message: $t('waitInbound.outboundQuantityCanNotBeEmpty') }]"
-          required
-        />
-      </van-cell-group>
-      <div style="margin: 16px">
-        <van-button round block type="primary" native-type="submit">
-          {{$t('common.submit')}}
-        </van-button>
-      </div>
-    </van-form>
+    <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, showFailToast } from "vant";
 import { useRoute } from "vue-router";
-
+import testForm from "@/components/testForm/index.vue";
 const proxy = getCurrentInstance().proxy;
 const route = useRoute();
 const typeModal = ref(false);
-const formData = ref({});
-
+const businessType = ref([
+  {
+    label: "生产打样",
+    value: "0",
+  },
+  {
+    label: "生产超领",
+    value: "1",
+  },
+  {
+    label: "销售出库",
+    value: "2",
+  },
+  {
+    label: "借用出库",
+    value: "3",
+  },
+  {
+    label: "报损超领",
+    value: "4",
+  },
+  {
+    label: "丢件超领",
+    value: "5",
+  },
+  {
+    label: "采购退货",
+    value: "6",
+  },
+  {
+    label: "调拨出库",
+    value: "7",
+  },
+  {
+    label: "盘亏出库",
+    value: "8",
+  },
+  {
+    label: "生产出库",
+    value: "9",
+  },
+]);
+const formData = reactive({
+  data: {},
+});
+const formDom = ref(null);
+const formOption = reactive({
+  readonly: false, //用于控制整个表单是否只读
+  disabled: false,
+  labelAlign: "top",
+  scroll: true,
+  labelWidth: "62pk",
+  hiddenSubmitBtn: false,
+  btnConfig: {
+    isNeed: false,
+    label: "出库明细",
+    prop: "stockWaitDetailsList",
+    plain: true,
+    listConfig: [
+      {
+        type: "input",
+        itemType: "text",
+        label: "物品名称",
+        prop: "productName",
+        readonly: true,
+      },
+      {
+        type: "input",
+        itemType: "text",
+        label: "物品编码",
+        prop: "productCustomCode",
+        readonly: true,
+      },
+      {
+        type: "input",
+        itemType: "text",
+        label: "尺寸 (cm)",
+        prop: "size",
+        readonly: true,
+      },
+      {
+        type: "input",
+        itemType: "digit",
+        label: "需出库数量",
+        prop: "needQuantity",
+        clearable: true,
+        readonly: true,
+      },
+      {
+        type: "input",
+        itemType: "digit",
+        label: "待出库数量",
+        prop: "waitQuantity",
+        clearable: true,
+        readonly: true,
+      },
+      {
+        type: "input",
+        itemType: "digit",
+        label: "已出库数量",
+        prop: "receiptQuantity",
+        clearable: true,
+        readonly: true,
+      },
+      {
+        type: "input",
+        itemType: "digit",
+        label: "出库数量",
+        prop: "quantity",
+        clearable: true,
+        readonly: false,
+      },
+    ],
+    clickFn: () => {},
+  },
+});
+const formConfig = reactive([
+  {
+    type: "title",
+    title: "待出库信息",
+  },
+  {
+    type: "picker",
+    label: "数据来源",
+    prop: "businessType",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "label",
+      value: "value",
+    },
+    data: [],
+    readonly: true,
+  },
+  {
+    type: "input",
+    itemType: "text",
+    label: "单号",
+    prop: "businessCode",
+    clearable: true,
+    readonly: true,
+  },
+  {
+    type: "cascader",
+    label: "业务公司",
+    prop: "companyId",
+    itemType: "common",
+    showPicker: false,
+    data: [],
+    readonly: true,
+    fieldNames: {
+      text: "deptName",
+      value: "deptId",
+      children: "children",
+    },
+    finishFn: (config, option) => {
+      if (option.selectedOptions[0]) {
+        let val = option.selectedOptions[0].deptId;
+        proxy
+          .post("/warehouse/page", {
+            pageNum: 1,
+            pageSize: 999,
+            companyId: val,
+          })
+          .then((res) => {
+            if (res.data.rows && res.data.rows.length > 0) {
+              formConfig[2].data = res.data.rows.map((item) => {
+                return {
+                  label: item.name,
+                  value: item.id,
+                };
+              });
+            }
+          });
+      }
+      config.showPicker = false;
+    },
+  },
+  {
+    type: "picker",
+    label: "仓库名称",
+    prop: "warehouseId",
+    itemType: "onePicker",
+    showPicker: false,
+    fieldNames: {
+      text: "text",
+      value: "value",
+    },
+    data: [],
+  },
+  {
+    type: "upload",
+    label: "上传凭证",
+    prop: "fileList",
+  },
+  {
+    type: "title",
+    title: "出库明细",
+  },
+]);
+const rules = {
+  warehouseId: [
+    {
+      required: true,
+      message: proxy.t("manualInbound.warehouseNameCanNotBeEmpty"),
+    },
+  ],
+  quantity: [
+    {
+      required: true,
+      message: "请输入出库数量",
+    },
+  ],
+};
 const getDict = () => {
+  formConfig[1].data = businessType.value;
+
   proxy.post("/warehouse/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
-    columns.value = res.data.rows.map((item) => {
+    formConfig[4].data = res.data.rows.map((item) => {
       return {
         text: item.name,
         value: item.id,
       };
     });
   });
+
+  proxy
+    .post("/tenantUser/getUserCompanyList", {
+      pageNum: 1,
+      pageSize: 9999,
+    })
+    .then((res) => {
+      formConfig[3].data = proxy.handleTree(res.data, "deptId");
+    });
 };
 
 const getDetails = (id) => {
   proxy.post("/stockWait/detail", { id }).then((res) => {
     res.data.inQuantity = res.data.quantity;
     formData.value = res.data;
-    formData.value.businessTypeName =
-      formData.value.businessType == 6 ? proxy.t('waitOutbound.salesOrderOutbound') : proxy.t('waitOutbound.jdOrderOutbound');
   });
 };
 
@@ -95,15 +268,22 @@ const onConfirm = ({ selectedOptions }) => {
 const onClickLeft = () => history.back();
 
 const onSubmit = () => {
-  const data = {
-    id: formData.value.id,
-    warehouseId: formData.value.warehouseId,
-    quantity: formData.value.quantity,
-  };
-  proxy.post("/stockWait/add", data).then(
+  if (!(formData.data.fileList && formData.data.fileList.length > 0)) {
+    return showFailToast("请上传附件");
+  }
+  for (let i = 0; i < formData.data.stockWaitDetailsList.length; i++) {
+    const ele = formData.data.stockWaitDetailsList[i];
+    if (Number(ele.quantity) == 0) {
+      return showFailToast("出库数量不能为0");
+    }
+    if (Number(ele.quantity) > Number(ele.waitQuantity)) {
+      return showFailToast("出库数量不可大于待出库数量");
+    }
+  }
+  proxy.post("/stockWait/add", formData.data).then(
     (res) => {
       setTimeout(() => {
-        showSuccessToast(proxy.t('waitOutbound.outboundSuccess'));
+        showSuccessToast("出库成功");
         proxy.$router.push("/main/waitOutbound");
       }, 500);
     },
@@ -114,11 +294,25 @@ const onSubmit = () => {
 };
 
 onMounted(() => {
-  if (route.query) {
-    formData.value = { ...route.query };
-    formData.value.inQuantity = formData.value.quantity;
-  }
   getDict();
+  if (route.query && route.query.row) {
+    let row = JSON.parse(route.query.row);
+    formData.data = {
+      id: row.id,
+      companyId: row.companyId,
+      businessType: row.businessType + "",
+      businessCode: row.businessCode,
+      warehouseId: "",
+      stockWaitDetailsList: row.stockWaitDetailsList.map((x) => ({
+        ...x,
+        size: `${x["productLength"]}*${x["productWidth"]}*${x["productHeight"]}`,
+        needQuantity: x.quantity,
+        quantity: null,
+      })),
+      fileList: [],
+    };
+    console.log(formData.data.stockWaitDetailsList, "saa");
+  }
 });
 </script>
 <style lang="scss" scoped>

+ 94 - 67
src/views/purchase-sales/inbound-outbound/waitOutbound/index.vue

@@ -1,26 +1,12 @@
 <template>
-  <van-nav-bar :title="$T('waitOutbound.name')" left-text="" left-arrow @click-left="onClickLeft">
+  <van-nav-bar :title="'待出库'" left-text="" left-arrow @click-left="onClickLeft">
     <!-- <template #right> 添加 </template> -->
   </van-nav-bar>
-  <van-search
-    v-model="req.keyword"
-    :placeholder="$t('common.pleaseEnterKeywords')"
-    @search="onRefresh"
-  />
+  <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 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>
         <div></div>
       </van-list>
     </div>
@@ -33,26 +19,92 @@ import { useRoute } from "vue-router";
 const loading = ref(false);
 const router = useRoute();
 const req = ref({
+  total: 0,
   pageNum: 1,
-  type: "2",
-  keyword: null,
+  pageSize: 10,
+  keyword: "",
+  status: "",
+  type: 2,
 });
 const finished = ref(false);
 const proxy = getCurrentInstance().proxy;
 const listData = ref([]);
-
+const status = ref([
+  {
+    label: "待出库",
+    value: 0,
+  },
+  {
+    label: "部分出库",
+    value: 1,
+  },
+  {
+    label: "出库完成",
+    value: 2,
+  },
+]);
+const businessType = ref([
+  {
+    label: "生产打样",
+    value: "0",
+  },
+  {
+    label: "生产超领",
+    value: "1",
+  },
+  {
+    label: "销售出库",
+    value: "2",
+  },
+  {
+    label: "借用出库",
+    value: "3",
+  },
+  {
+    label: "报损超领",
+    value: "4",
+  },
+  {
+    label: "丢件超领",
+    value: "5",
+  },
+  {
+    label: "采购退货",
+    value: "6",
+  },
+  {
+    label: "调拨出库",
+    value: "7",
+  },
+  {
+    label: "盘亏出库",
+    value: "8",
+  },
+  {
+    label: "生产出库",
+    value: "9",
+  },
+]);
 const listConfig = ref([
   {
-    label: proxy.t('waitOutbound.dataSource'),
+    label: "业务公司",
+    prop: "companyName",
+  },
+  {
+    label: "数据来源",
     prop: "businessTypeName",
   },
   {
-    label: proxy.t('waitOutbound.goodsName'),
-    prop: "productName",
+    label: "单号",
+    prop: "businessCode",
+  },
+  {
+    label: "入库状态",
+    prop: "statusName",
   },
   {
-    label: proxy.t('waitOutbound.toBeDoneQuantity'),
-    prop: "quantity",
+    label: "创建时间",
+    prop: "createTime",
   },
 ]);
 const onRefresh = () => {
@@ -74,59 +126,34 @@ const toDtl = (row) => {
   proxy.$router.push({
     path: "waitOutboundAdd",
     query: {
-      ...row
+      row: JSON.stringify(row),
     },
   });
 };
-const businessType = ref([
-  {
-    label: proxy.t('waitOutbound.lineSideReturnWarehouse'),
-    value: 1,
-  },
-  {
-    label: proxy.t('waitOutbound.completedWarehouse'),
-    value: 2,
-  },
-  {
-    label: proxy.t('waitOutbound.purchaseArrival'),
-    value: 3,
-  },
-  {
-    label: proxy.t('waitOutbound.returnOutbound'),
-    value: 4,
-  },
-  {
-    label: proxy.t('waitOutbound.jdOrder'),
-    value: 5,
-  },
-  {
-    label: proxy.t('waitOutbound.salesOrderOutbound'),
-    value: 6,
-  },
-  {
-    label: proxy.t('waitOutbound.productionTaskOutbound'),
-    value: 7,
-  },
-]);
 
 const getList = (type) => {
   loading.value = true;
   proxy
-    .post("/stockWaitDetails/page", req.value)
+    .post("/stockWait/page", req.value)
     .then((res) => {
-      console.log(req.value);
+      res.data.rows = res.data.rows.map((x) => ({
+        ...x,
+        businessTypeName: proxy.dictValueLabel(
+          x.businessType,
+          businessType.value
+        ),
+        statusName: proxy.dictValueLabel(x.status, status.value),
+      }));
+      for (let i = 0; i < res.data.rows.length; i++) {
+        for (let j = 0; j < res.data.rows[i].stockWaitDetailsList.length; j++) {
+          let ele = res.data.rows[i].stockWaitDetailsList[j];
+          ele.waitQuantity = Number(ele.quantity) - Number(ele.receiptQuantity);
+        }
+      }
       listData.value =
         type === "refresh"
           ? res.data.rows
           : listData.value.concat(res.data.rows);
-      listData.value.forEach((x) => {
-        const current = businessType.value.find(
-          (v) => v.value == x.businessType
-        );
-        if (current) {
-          x.businessTypeName = current.label;
-        }
-      });
       if (req.value.pageNum * 10 >= res.data.total) {
         finished.value = true;
       }

+ 1 - 0
src/views/salesContract/contract/index.vue

@@ -17,6 +17,7 @@
 <script setup>
 import { ref, getCurrentInstance } from "vue";
 import commonList from "@/components/common-list.vue";
+import { getAllDict } from "@/utils/auth";
 
 const proxy = getCurrentInstance().proxy;
 const onClickLeft = () => proxy.$router.push("/main/working");

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff