cz hai 1 ano
pai
achega
b98d0d6bfe

+ 103 - 91
src/components/process/SendPurchase.vue

@@ -34,9 +34,9 @@
       </el-row>
       <el-row :gutter="10">
         <el-col :span="6">
-          <el-form-item label="供应商" prop="supplyId">
+          <el-form-item label="供应商" prop="sellCorporationId">
             <el-select
-              v-model="formData.data.supplyId"
+              v-model="formData.data.sellCorporationId"
               placeholder="请选择"
               @change="handleChangeSupplier"
               filterable
@@ -91,15 +91,15 @@
       </el-form-item>
       <div class="_t">采购明细</div>
       <el-form-item>
-        <el-button
+        <!-- <el-button
           type="primary"
           @click="openProduct = true"
           style="margin: 10px 0"
           v-if="ids.length == 0"
         >
           添加货品
-        </el-button>
-        <el-table :data="formData.data.purchaseDetailList">
+        </el-button> -->
+        <el-table :data="formData.data.purchaseProductList">
           <el-table-column
             prop="goodType"
             label="货品类型"
@@ -123,19 +123,19 @@
             label="已采购数量"
             v-if="ids.length > 0"
           />
-          <el-table-column prop="count" label="本次采购" min-width="150">
+          <el-table-column prop="quantity" label="本次采购" min-width="150">
             <template #default="{ row, $index }">
               <el-form-item
-                :prop="'purchaseDetailList.' + $index + '.count'"
-                :rules="rules.count"
+                :prop="'purchaseProductList.' + $index + '.quantity'"
+                :rules="rules.quantity"
                 :inline-message="true"
               >
                 <el-input-number
                   onmousewheel="return false;"
-                  v-model="formData.data.purchaseDetailList[$index].count"
+                  v-model="formData.data.purchaseProductList[$index].quantity"
                   :controls="false"
                   :min="0"
-                  @change="(e) => handleChangeMoney(e, $index, 'count')"
+                  @change="(e) => handleChangeMoney(e, $index, 'quantity')"
                 />
               </el-form-item>
             </template>
@@ -143,13 +143,13 @@
           <el-table-column prop="price" label="单价" min-width="150">
             <template #default="{ row, $index }">
               <el-form-item
-                :prop="'purchaseDetailList.' + $index + '.price'"
+                :prop="'purchaseProductList.' + $index + '.price'"
                 :rules="rules.price"
                 :inline-message="true"
               >
                 <el-input-number
                   onmousewheel="return false;"
-                  v-model="formData.data.purchaseDetailList[$index].price"
+                  v-model="formData.data.purchaseProductList[$index].price"
                   :controls="false"
                   :min="0"
                   @change="(e) => handleChangeMoney(e, $index, 'price')"
@@ -164,7 +164,7 @@
                 type="primary"
                 link
                 @click="handleRemove($index, 20)"
-                :disabled="formData.data.purchaseDetailList.length === 1"
+                :disabled="formData.data.purchaseProductList.length === 1"
                 >删除</el-button
               >
             </template>
@@ -187,16 +187,16 @@
         <el-button type="primary" style="margin: 10px 0" @click="handleAdd">
           添加
         </el-button>
-        <el-table :data="formData.data.otherFeeList">
-          <el-table-column prop="name" label="收费项目" min-width="150">
+        <el-table :data="formData.data.purchaseProjectList">
+          <el-table-column prop="payName" label="收费项目" min-width="150">
             <template #default="{ row, $index }">
               <el-form-item
-                :prop="'otherFeeList.' + $index + '.name'"
-                :rules="rulesOne.name"
+                :prop="'purchaseProjectList.' + $index + '.payName'"
+                :rules="rulesOne.payName"
                 :inline-message="true"
               >
                 <el-autocomplete
-                  v-model="row.name"
+                  v-model="row.payName"
                   :fetch-suggestions="querySearchPerson"
                   clearable
                   class="inline-input w-50"
@@ -207,18 +207,18 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column prop="price" label="金额" min-width="150">
+          <el-table-column prop="amount" label="金额" min-width="150">
             <template #default="{ row, $index }">
               <el-form-item
-                :prop="'otherFeeList.' + $index + '.price'"
-                :rules="rulesOne.price"
+                :prop="'purchaseProjectList.' + $index + '.amount'"
+                :rules="rulesOne.amount"
                 :inline-message="true"
               >
                 <el-input-number
                   onmousewheel="return false;"
-                  v-model="formData.data.otherFeeList[$index].price"
+                  v-model="formData.data.purchaseProjectList[$index].amount"
                   :controls="false"
-                  @change="(e) => handleChangeOtherMoney(e, $index, 'price')"
+                  @change="(e) => handleChangeOtherMoney(e, $index, 'amount')"
                 />
               </el-form-item>
             </template>
@@ -227,7 +227,7 @@
           <el-table-column prop="remark" label="备注" min-width="150">
             <template #default="{ row, $index }">
               <el-form-item
-                :prop="'otherFeeList.' + $index + '.remark'"
+                :prop="'purchaseProjectList.' + $index + '.remark'"
                 :inline-message="true"
               >
                 <el-input v-model="row.remark" placeholder="请输入" />
@@ -299,8 +299,8 @@ const props = defineProps({
 let formData = reactive({
   data: {
     purchaseTime: "",
-    purchaseDetailList: [],
-    otherFeeList: [],
+    purchaseProductList: [],
+    purchaseProjectList: [],
   },
 });
 let rules = ref({
@@ -311,8 +311,12 @@ let rules = ref({
   purchaseTime: [
     { required: true, message: "请选择采购时间", trigger: "change" },
   ],
-  supplyId: [{ required: true, message: "请选择供应商", trigger: "change" }],
-  count: [{ required: true, message: "请输入本次采购数量", trigger: "blur" }],
+  sellCorporationId: [
+    { required: true, message: "请选择供应商", trigger: "change" },
+  ],
+  quantity: [
+    { required: true, message: "请输入本次采购数量", trigger: "blur" },
+  ],
   price: [{ required: true, message: "请输入单价", trigger: "blur" }],
   remark: [{ required: true, message: "请输入备注", trigger: "blur" }],
   invoiceType: [
@@ -321,8 +325,8 @@ let rules = ref({
   rate: [{ required: true, message: "请输入税率", trigger: "blur" }],
 });
 let rulesOne = ref({
-  name: [{ required: true, message: "请输入名称", trigger: "blur" }],
-  price: [{ required: true, message: "请输入金额", trigger: "blur" }],
+  payName: [{ required: true, message: "请输入名称", trigger: "blur" }],
+  amount: [{ required: true, message: "请输入金额", trigger: "blur" }],
 });
 const invoiceTypeData = ref([
   {
@@ -351,21 +355,21 @@ let openProduct = ref(false);
 // 物品相应逻辑
 const handleRemove = (index, type) => {
   if (type === 20) {
-    formData.data.purchaseDetailList.splice(index, 1);
+    formData.data.purchaseProductList.splice(index, 1);
     return ElMessage({
       message: "删除成功!",
       type: "success",
     });
   } else {
-    formData.data.otherFeeList.splice(index, 1);
+    formData.data.purchaseProjectList.splice(index, 1);
   }
   handleChangeAmount();
 };
 
 const handleAdd = () => {
-  formData.data.otherFeeList.push({
-    name: "",
-    price: undefined,
+  formData.data.purchaseProjectList.push({
+    payName: "",
+    amount: undefined,
     remark: "",
   });
 };
@@ -374,12 +378,12 @@ const pushGoods = (goods) => {
   if (goods && goods.length > 0) {
     let afterFiltering = [];
     if (
-      formData.data.purchaseDetailList &&
-      formData.data.purchaseDetailList.length > 0
+      formData.data.purchaseProductList &&
+      formData.data.purchaseProductList.length > 0
     ) {
       afterFiltering = goods.filter((item) => {
-        let data = formData.data.purchaseDetailList.filter(
-          (itemProduct) => itemProduct.bussinessId === item.id
+        let data = formData.data.purchaseProductList.filter(
+          (itemProduct) => itemProduct.productId === item.id
         );
         if (data && data.length > 0) {
           return false;
@@ -390,22 +394,23 @@ const pushGoods = (goods) => {
       afterFiltering = goods;
     }
     const arr = afterFiltering.map((x) => ({
+      dataResource: "0",
       goodType: x.goodType,
       productCode: x.code,
       productName: x.name,
       productSpec: x.spec,
       productUnit: x.unit,
-      count: 0,
+      quantity: 0,
       price: 0,
-      bussinessId: x.id,
+      productId: x.id,
       amount: 0,
     }));
-    formData.data.purchaseDetailList =
-      formData.data.purchaseDetailList.concat(arr);
+    formData.data.purchaseProductList =
+      formData.data.purchaseProductList.concat(arr);
     openProduct.value = false;
-    const ids = formData.data.purchaseDetailList.map((x) => x.bussinessId);
-    if (formData.data.supplyId && ids.length > 0) {
-      handleChangeSupplier(formData.data.supplyId);
+    const ids = formData.data.purchaseProductList.map((x) => x.productId);
+    if (formData.data.sellCorporationId && ids.length > 0) {
+      handleChangeSupplier(formData.data.sellCorporationId);
     }
     return ElMessage({
       message: "添加成功!",
@@ -420,12 +425,12 @@ const formDom = ref(null);
 const handleSubmit = async () => {
   const vaild = await formDom.value.validate();
   if (vaild) {
-    if (formData.data.purchaseDetailList.length > 0) {
-      const list = formData.data.purchaseDetailList;
+    if (formData.data.purchaseProductList.length > 0) {
+      const list = formData.data.purchaseProductList;
       for (let i = 0; i < list.length; i++) {
         const e = list[i];
         if (ids.value.length > 0) {
-          if (e.count == 0) {
+          if (e.quantity == 0) {
             ElMessage({
               message: "本次采购数量不能为0!",
               type: "info",
@@ -433,7 +438,7 @@ const handleSubmit = async () => {
             return false;
           }
           // if (Number(e.subscribeCount) - Number(e.purchaseCount) > 0) {
-          //   if (e.count == 0) {
+          //   if (e.quantity == 0) {
           //     ElMessage({
           //       message: "本次采购数量不能为0!",
           //       type: "info",
@@ -441,7 +446,7 @@ const handleSubmit = async () => {
           //     return false;
           //   }
           // }
-          // if (e.count + Number(e.purchaseCount) > Number(e.subscribeCount)) {
+          // if (e.quantity + Number(e.purchaseCount) > Number(e.subscribeCount)) {
           //   ElMessage({
           //     message: "本次采购数量和已采购数量和不可大于申购数量!",
           //     type: "info",
@@ -449,7 +454,7 @@ const handleSubmit = async () => {
           //   return false;
           // }
         } else {
-          if (e.count == 0) {
+          if (e.quantity == 0) {
             ElMessage({
               message: "本次采购数量不能为0!",
               type: "info",
@@ -473,15 +478,15 @@ const ids = ref([]);
 const getDetails = () => {
   if (props.queryData.type && props.queryData.type === "handoverSlip") {
     proxy.post("/contractProduct/getListDetail", ids.value).then((res) => {
-      formData.data.purchaseDetailList = res.map((x) => {
+      formData.data.purchaseProductList = res.map((x) => {
         let obj = {
           ...x,
           dataResource: "1", //来源写死外销合同采购
           dataResourceId: x.id,
-          bussinessId: x.productId,
+          productId: x.productId,
           subscribeCount: x.quantity || x.sumPackQuantity || 0,
           purchaseCount: x.sumPurchaseCount || 0,
-          count: x.expendQuantity || 0,
+          quantity: x.expendQuantity || 0,
           price: null,
           amount: null,
         };
@@ -491,17 +496,19 @@ const getDetails = () => {
     });
   } else {
     proxy.post("/subscribeDetail/detail", { ids: ids.value }).then((res) => {
-      formData.data.purchaseDetailList = res.map((x) => ({
+      formData.data.dataResource = "0";
+      formData.data.purchaseProductList = res.map((x) => ({
+        dataResource: "0",
         subscribeDetailId: x.id,
-        bussinessId: x.bussinessId,
+        productId: x.bussinessId,
         goodType: x.productDefinition,
         productCode: x.productCode,
         productName: x.productName,
         productSpec: x.productSpec,
         productUnit: x.productUnit,
         purchaseCount: x.purchaseCount,
-        subscribeCount: x.count,
-        count: 0,
+        subscribeCount: x.quantity,
+        quantity: 0,
         price: null,
         amount: null,
       }));
@@ -510,7 +517,7 @@ const getDetails = () => {
 };
 // 获取供应商数据
 const supplierData = ref([]);
-const otherFeeListData = ref([]);
+const purchaseProjectListData = ref([]);
 const getSupplierList = async (req) => {
   proxy
     .post("/supplierInfo/page", { pageNum: 1, pageSize: 9999 })
@@ -533,11 +540,11 @@ const auxiliaryChange = (data) => {
   emit("auxiliaryChange", data);
 };
 
-const getAuxiliaryData = (supplyId, productIdList) => {
-  if (supplyId && productIdList.length > 0) {
+const getAuxiliaryData = (sellCorporationId, productIdList) => {
+  if (sellCorporationId && productIdList.length > 0) {
     proxy
       .post("/subscribe/decisionAid", {
-        supplyId: supplyId,
+        supplyId: sellCorporationId,
         productIdList: productIdList,
       })
       .then((res) => {
@@ -657,7 +664,7 @@ const getAuxiliaryData = (supplyId, productIdList) => {
 };
 // 供应商改变逻辑
 const handleChangeSupplier = (val) => {
-  const ids = formData.data.purchaseDetailList.map((x) => x.bussinessId);
+  const ids = formData.data.purchaseProductList.map((x) => x.productId);
   if (val && ids.length > 0) {
     getAuxiliaryData(val, ids);
     proxy
@@ -667,17 +674,17 @@ const handleChangeSupplier = (val) => {
       })
       .then((res) => {
         if (res && Object.keys(res).length > 0) {
-          for (let i = 0; i < formData.data.purchaseDetailList.length; i++) {
-            const e = formData.data.purchaseDetailList[i];
+          for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
+            const e = formData.data.purchaseProductList[i];
             for (const key in res) {
-              if (e.bussinessId === key) {
+              if (e.productId === key) {
                 e.price = Number(res[key]);
               }
             }
           }
         } else {
-          for (let i = 0; i < formData.data.purchaseDetailList.length; i++) {
-            const e = formData.data.purchaseDetailList[i];
+          for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
+            const e = formData.data.purchaseProductList[i];
             e.price = 0;
           }
         }
@@ -698,17 +705,17 @@ const formatNumber = (value, num = 10000) => {
 // 计算采购总金额
 const handleChangeAmount = () => {
   let productAmount = 0;
-  for (let i = 0; i < formData.data.purchaseDetailList.length; i++) {
-    const e = formData.data.purchaseDetailList[i];
-    e.amount = formatNumber(parseFloat(e.count * e.price), 100);
+  for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
+    const e = formData.data.purchaseProductList[i];
+    e.amount = formatNumber(parseFloat(e.quantity * e.price), 100);
     productAmount += Number(e.amount);
   }
   formData.data.productAmount = formatNumber(productAmount, 100);
   // 其他收费
   let otherAmount = 0;
-  for (let i = 0; i < formData.data.otherFeeList.length; i++) {
-    const e = formData.data.otherFeeList[i];
-    otherAmount += Number(e.price);
+  for (let i = 0; i < formData.data.purchaseProjectList.length; i++) {
+    const e = formData.data.purchaseProjectList[i];
+    otherAmount += Number(e.amount);
   }
   formData.data.otherAmount = formatNumber(otherAmount, 100);
   formData.data.amount = formatNumber(
@@ -721,15 +728,15 @@ const handleChangeAmount = () => {
 
 const handleChangeMoney = (val, index, key) => {
   let num = 100;
-  if (key === "count") {
+  if (key === "quantity") {
     num = 10000;
   }
-  formData.data.purchaseDetailList[index][key] = formatNumber(val, num);
+  formData.data.purchaseProductList[index][key] = formatNumber(val, num);
   handleChangeAmount();
 };
 
 const handleChangeOtherMoney = (val, index, key) => {
-  formData.data.otherFeeList[index][key] = formatNumber(val, 100);
+  formData.data.purchaseProjectList[index][key] = formatNumber(val, 100);
   handleChangeAmount();
 };
 
@@ -742,7 +749,10 @@ const getDict = () => {
     }));
   });
   proxy.get("/purchaseOtherFee/listName").then((res) => {
-    otherFeeListData.value = res.data.map((x) => ({ ...x, value: x.name }));
+    purchaseProjectListData.value = res.data.map((x) => ({
+      ...x,
+      value: x.name,
+    }));
   });
 };
 getDict();
@@ -757,15 +767,17 @@ const createFilter = (queryString) => {
 
 const querySearchPerson = (queryString, callback) => {
   const results = queryString
-    ? otherFeeListData.value.filter(createFilter(queryString))
-    : otherFeeListData.value;
+    ? purchaseProjectListData.value.filter(createFilter(queryString))
+    : purchaseProjectListData.value;
   callback(results);
 };
 
 const handlePerson = (item, index) => {
-  formData.data.otherFeeList[index].name = item.name;
-  formData.data.otherFeeList[index].price = item.price ? item.price : 0;
-  formData.data.otherFeeList[index].remark = item.remark ? item.remark : "";
+  formData.data.purchaseProjectList[index].payName = item.name;
+  formData.data.purchaseProjectList[index].amount = item.price ? item.price : 0;
+  formData.data.purchaseProjectList[index].remark = item.remark
+    ? item.remark
+    : "";
 };
 
 watch(
@@ -778,9 +790,9 @@ watch(
         route.query.processType == 30)
     ) {
       formData.data = proxy.deepClone(props.queryData);
-      const ids = formData.data.purchaseDetailList.map((x) => x.bussinessId);
-      if (formData.data.supplyId && ids.length > 0) {
-        getAuxiliaryData(formData.data.supplyId, ids);
+      const ids = formData.data.purchaseProductList.map((x) => x.productId);
+      if (formData.data.sellCorporationId && ids.length > 0) {
+        getAuxiliaryData(formData.data.sellCorporationId, ids);
       }
     }
   },
@@ -839,12 +851,12 @@ defineExpose({
 const acquireSelectList = () => {
   let data = [];
   if (
-    formData.data.purchaseDetailList &&
-    formData.data.purchaseDetailList.length > 0
+    formData.data.purchaseProductList &&
+    formData.data.purchaseProductList.length > 0
   ) {
-    data = formData.data.purchaseDetailList.map((item) => {
+    data = formData.data.purchaseProductList.map((item) => {
       return {
-        id: item.bussinessId,
+        id: item.productId,
         name: item.productName,
       };
     });

+ 68 - 22
src/views/EHSD/procurement/handoverSlipEHSD/index.vue

@@ -18,7 +18,8 @@
             action: () => clickPurchase(),
           },
         ]"
-        @get-list="getList">
+        @get-list="getList"
+      >
         <template #claimTime="{ item }">
           <div style="width: 100%">
             <span v-if="item.claimTime">{{ item.claimTime }}</span>
@@ -33,19 +34,45 @@
       </byTable>
     </div>
 
-    <el-dialog title="交接单" v-if="openAllFile" v-model="openAllFile" width="600">
-      <byForm :formConfig="formConfig" :formOption="formOption" v-model="rowData" ref="fileState">
+    <el-dialog
+      title="交接单"
+      v-if="openAllFile"
+      v-model="openAllFile"
+      width="600"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="rowData"
+        ref="fileState"
+      >
         <template #file>
           <div>
-            <div v-for="(file, index) in rowData.fileList" :key="index" style="padding: 4px 0">
-              <a style="color: #409eff; cursor: pointer" @click="openFile(file.fileUrl)">{{ file.fileName }}</a>
+            <div
+              v-for="(file, index) in rowData.fileList"
+              :key="index"
+              style="padding: 4px 0"
+            >
+              <a
+                style="color: #409eff; cursor: pointer"
+                @click="openFile(file.fileUrl)"
+                >{{ file.fileName }}</a
+              >
             </div>
           </div>
         </template>
         <template #indication>
           <div>
-            <div v-for="(file, index) in rowData.packageFileList" :key="index" style="padding: 4px 0">
-              <a style="color: #409eff; cursor: pointer" @click="openFile(file.fileUrl)">{{ file.fileName }}</a>
+            <div
+              v-for="(file, index) in rowData.packageFileList"
+              :key="index"
+              style="padding: 4px 0"
+            >
+              <a
+                style="color: #409eff; cursor: pointer"
+                @click="openFile(file.fileUrl)"
+                >{{ file.fileName }}</a
+              >
             </div>
           </div>
         </template>
@@ -193,13 +220,15 @@ const config = computed(() => {
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/delivery/contractHandoverPage", sourceList.value.pagination).then((res) => {
-    sourceList.value.data = res.rows;
-    sourceList.value.pagination.total = res.total;
-    setTimeout(() => {
-      loading.value = false;
-    }, 200);
-  });
+  proxy
+    .post("/delivery/contractHandoverPage", sourceList.value.pagination)
+    .then((res) => {
+      sourceList.value.data = res.rows;
+      sourceList.value.pagination.total = res.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
 };
 getList();
 const clickPurchase = (row) => {
@@ -222,6 +251,7 @@ const clickPurchase = (row) => {
       tenantType: "EHSD",
       ids: ids,
       type: 1,
+      submitType: "10",
     },
   });
 };
@@ -239,12 +269,22 @@ const checkTheTransferSlip = (item) => {
   rowData.value.fileList = [];
   rowData.value.packageFileList = [];
   openAllFile.value = true;
-  proxy.post("/fileInfo/getList", { businessIdList: [item.contractId], fileType: 1 }).then((fileObj) => {
-    rowData.value.fileList = fileObj[item.contractId] || [];
-  });
-  proxy.post("/fileInfo/getList", { businessIdList: [item.contractId], fileType: 2 }).then((fileObj) => {
-    rowData.value.packageFileList = fileObj[item.contractId] || [];
-  });
+  proxy
+    .post("/fileInfo/getList", {
+      businessIdList: [item.contractId],
+      fileType: 1,
+    })
+    .then((fileObj) => {
+      rowData.value.fileList = fileObj[item.contractId] || [];
+    });
+  proxy
+    .post("/fileInfo/getList", {
+      businessIdList: [item.contractId],
+      fileType: 2,
+    })
+    .then((fileObj) => {
+      rowData.value.packageFileList = fileObj[item.contractId] || [];
+    });
 };
 const openFile = (path) => {
   window.open(path, "_blank");
@@ -289,9 +329,15 @@ const getTimeSpent = (item) => {
   if (item.sampleTime && item.updateTime) {
     let data = { days: 0, hours: 0, minutes: 0, seconds: 0 };
     if (proxy.compareTime(item.sampleTime, item.updateTime)) {
-      data = proxy.timeInterval(item.sampleTime, moment().format("yyyy-MM-DD HH:mm:ss"));
+      data = proxy.timeInterval(
+        item.sampleTime,
+        moment().format("yyyy-MM-DD HH:mm:ss")
+      );
     } else {
-      data = proxy.timeInterval(item.updateTime, moment().format("yyyy-MM-DD HH:mm:ss"));
+      data = proxy.timeInterval(
+        item.updateTime,
+        moment().format("yyyy-MM-DD HH:mm:ss")
+      );
     }
     if (data.days) {
       text = data.days + "天" + data.hours + "小时" + data.minutes + "分";

+ 62 - 22
src/views/EHSD/procurement/handoverSlipSampleEHSD/index.vue

@@ -18,7 +18,8 @@
             action: () => clickPurchase(),
           },
         ]"
-        @get-list="getList">
+        @get-list="getList"
+      >
         <template #claimTime="{ item }">
           <div style="width: 100%">
             <span v-if="item.claimTime">{{ item.claimTime }}</span>
@@ -33,19 +34,45 @@
       </byTable>
     </div>
 
-    <el-dialog title="交接单" v-if="openAllFile" v-model="openAllFile" width="600">
-      <byForm :formConfig="formConfig" :formOption="formOption" v-model="rowData" ref="fileState">
+    <el-dialog
+      title="交接单"
+      v-if="openAllFile"
+      v-model="openAllFile"
+      width="600"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="rowData"
+        ref="fileState"
+      >
         <template #file>
           <div>
-            <div v-for="(file, index) in rowData.fileList" :key="index" style="padding: 4px 0">
-              <a style="color: #409eff; cursor: pointer" @click="openFile(file.fileUrl)">{{ file.fileName }}</a>
+            <div
+              v-for="(file, index) in rowData.fileList"
+              :key="index"
+              style="padding: 4px 0"
+            >
+              <a
+                style="color: #409eff; cursor: pointer"
+                @click="openFile(file.fileUrl)"
+                >{{ file.fileName }}</a
+              >
             </div>
           </div>
         </template>
         <template #indication>
           <div>
-            <div v-for="(file, index) in rowData.packageFileList" :key="index" style="padding: 4px 0">
-              <a style="color: #409eff; cursor: pointer" @click="openFile(file.fileUrl)">{{ file.fileName }}</a>
+            <div
+              v-for="(file, index) in rowData.packageFileList"
+              :key="index"
+              style="padding: 4px 0"
+            >
+              <a
+                style="color: #409eff; cursor: pointer"
+                @click="openFile(file.fileUrl)"
+                >{{ file.fileName }}</a
+              >
             </div>
           </div>
         </template>
@@ -193,13 +220,15 @@ const config = computed(() => {
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/delivery/sampleHandoverList", sourceList.value.pagination).then((res) => {
-    sourceList.value.data = res.rows;
-    sourceList.value.pagination.total = res.total;
-    setTimeout(() => {
-      loading.value = false;
-    }, 200);
-  });
+  proxy
+    .post("/delivery/sampleHandoverList", sourceList.value.pagination)
+    .then((res) => {
+      sourceList.value.data = res.rows;
+      sourceList.value.pagination.total = res.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
 };
 getList();
 const clickPurchase = (row) => {
@@ -222,6 +251,7 @@ const clickPurchase = (row) => {
       tenantType: "EHSD",
       ids: ids,
       type: 2,
+      submitType: "10",
     },
   });
 };
@@ -239,12 +269,16 @@ const checkTheTransferSlip = (item) => {
   rowData.value.fileList = [];
   rowData.value.packageFileList = [];
   openAllFile.value = true;
-  proxy.post("/fileInfo/getList", { businessIdList: [item.sampleId], fileType: 1 }).then((fileObj) => {
-    rowData.value.fileList = fileObj[item.sampleId] || [];
-  });
-  proxy.post("/fileInfo/getList", { businessIdList: [item.sampleId], fileType: 2 }).then((fileObj) => {
-    rowData.value.packageFileList = fileObj[item.sampleId] || [];
-  });
+  proxy
+    .post("/fileInfo/getList", { businessIdList: [item.sampleId], fileType: 1 })
+    .then((fileObj) => {
+      rowData.value.fileList = fileObj[item.sampleId] || [];
+    });
+  proxy
+    .post("/fileInfo/getList", { businessIdList: [item.sampleId], fileType: 2 })
+    .then((fileObj) => {
+      rowData.value.packageFileList = fileObj[item.sampleId] || [];
+    });
 };
 const openFile = (path) => {
   window.open(path, "_blank");
@@ -289,9 +323,15 @@ const getTimeSpent = (item) => {
   if (item.sampleTime && item.updateTime) {
     let data = { days: 0, hours: 0, minutes: 0, seconds: 0 };
     if (proxy.compareTime(item.sampleTime, item.updateTime)) {
-      data = proxy.timeInterval(item.sampleTime, moment().format("yyyy-MM-DD HH:mm:ss"));
+      data = proxy.timeInterval(
+        item.sampleTime,
+        moment().format("yyyy-MM-DD HH:mm:ss")
+      );
     } else {
-      data = proxy.timeInterval(item.updateTime, moment().format("yyyy-MM-DD HH:mm:ss"));
+      data = proxy.timeInterval(
+        item.updateTime,
+        moment().format("yyyy-MM-DD HH:mm:ss")
+      );
     }
     if (data.days) {
       text = data.days + "天" + data.hours + "小时" + data.minutes + "分";

+ 17 - 26
src/views/EHSD/productLibrary/customerProduct/index.vue

@@ -808,17 +808,13 @@ const handleSuccess = (res) => {
   }
 };
 const getDict = () => {
-  // proxy.post("/customer/page", { pageNum: 1, pageSize: 99999 }).then(
-  //   (res) => {
-  //     customerData.value = res.rows.map((x) => ({
-  //       label: x.name,
-  //       value: x.id,
-  //     }));
-  //   },
-  //   (err) => {
-  //     console.log(err);
-  //   }
-  // );
+  proxy.post("/customer/selPage", { pageNum: 1, pageSize: 50 }).then((res) => {
+    customerData.value = res.rows.map((x) => ({
+      ...x,
+      label: x.name,
+      value: x.id,
+    }));
+  });
   proxy
     .getDictOne([
       "inner_packaging_method_ehsd",
@@ -853,23 +849,18 @@ const clickSelect = (item) => {
 };
 const loadingSearch = ref(false);
 const remoteMethod = (keyword) => {
-  loadingSearch.value = true;
   if (keyword && typeof keyword === "string") {
-    proxy.post("/customer/page", { keyword }).then(
-      (res) => {
-        customerData.value = res.rows.map((x) => ({
-          label: x.name,
-          value: x.id,
-        }));
-        setTimeout(() => {
-          loadingSearch.value = false;
-        }, 100);
-      },
-      (err) => {
-        console.log(err);
-      }
-    );
+    loadingSearch.value = true;
+    proxy.post("/customer/selPage", { keyword }).then((res) => {
+      customerData.value = res.rows.map((x) => ({
+        ...x,
+        label: x.name,
+        value: x.id,
+      }));
+      loadingSearch.value = false;
+    });
   }
+  return;
 };
 </script>
 

+ 171 - 84
src/views/finance/fundManage/accountPayment/index.vue

@@ -13,7 +13,8 @@
         }"
         :action-list="[]"
         @moreSearch="moreSearch"
-        @get-list="getList">
+        @get-list="getList"
+      >
         <template #amount="{ item }">
           <div style="width: 100%">
             <span>{{ item.currency }} {{ item.amount }}</span>
@@ -21,8 +22,20 @@
         </template>
       </byTable>
     </div>
-    <el-dialog title="打款" v-if="dialogVisible" v-model="dialogVisible" width="500" v-loading="loading">
-      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
+    <el-dialog
+      title="打款"
+      v-if="dialogVisible"
+      v-model="dialogVisible"
+      width="500"
+      v-loading="loading"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
         <template #fileSlot>
           <div style="width: 100%">
             <el-upload
@@ -31,7 +44,8 @@
               :data="uploadData"
               multiple
               :before-upload="uploadFile"
-              :on-preview="onPreviewFile">
+              :on-preview="onPreviewFile"
+            >
               <el-button type="primary">文件上传</el-button>
             </el-upload>
           </div>
@@ -39,12 +53,30 @@
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" size="large" :loading="submitLoading"> 确 定 </el-button>
+        <el-button
+          type="primary"
+          @click="submitForm()"
+          size="large"
+          :loading="submitLoading"
+          v-show="submitType === 'add'"
+        >
+          确 定
+        </el-button>
       </template>
     </el-dialog>
 
-    <el-dialog title="高级检索" v-if="openSearch" v-model="openSearch" width="600" :before-close="cancelSearch">
-      <byForm :formConfig="formSearchConfig" :formOption="formOptionTwo" v-model="sourceList.pagination">
+    <el-dialog
+      title="高级检索"
+      v-if="openSearch"
+      v-model="openSearch"
+      width="600"
+      :before-close="cancelSearch"
+    >
+      <byForm
+        :formConfig="formSearchConfig"
+        :formOption="formOptionTwo"
+        v-model="sourceList.pagination"
+      >
         <template #departmentId>
           <div>
             <el-tree-select
@@ -55,7 +87,8 @@
               node-key="deptId"
               style="width: 100%"
               :props="defaultProps"
-              clearable />
+              clearable
+            />
           </div>
         </template>
         <template #time>
@@ -67,7 +100,8 @@
                   type="datetime"
                   placeholder="请选择"
                   style="width: 100%"
-                  value-format="YYYY-MM-DD HH:mm:ss" />
+                  value-format="YYYY-MM-DD HH:mm:ss"
+                />
               </el-col>
               <el-col :span="2" style="text-align: center">到</el-col>
               <el-col :span="11">
@@ -76,7 +110,8 @@
                   type="datetime"
                   placeholder="请选择"
                   style="width: 100%"
-                  value-format="YYYY-MM-DD HH:mm:ss" />
+                  value-format="YYYY-MM-DD HH:mm:ss"
+                />
               </el-col>
             </el-row>
           </div>
@@ -90,7 +125,8 @@
                   type="datetime"
                   placeholder="请选择"
                   style="width: 100%"
-                  value-format="YYYY-MM-DD HH:mm:ss" />
+                  value-format="YYYY-MM-DD HH:mm:ss"
+                />
               </el-col>
               <el-col :span="2" style="text-align: center">到</el-col>
               <el-col :span="11">
@@ -99,7 +135,8 @@
                   type="datetime"
                   placeholder="请选择"
                   style="width: 100%"
-                  value-format="YYYY-MM-DD HH:mm:ss" />
+                  value-format="YYYY-MM-DD HH:mm:ss"
+                />
               </el-col>
             </el-row>
           </div>
@@ -115,7 +152,8 @@
                   style="width: 100%"
                   :precision="2"
                   :controls="false"
-                  :min="0" />
+                  :min="0"
+                />
               </el-col>
               <el-col :span="2" style="text-align: center">到</el-col>
               <el-col :span="11">
@@ -126,7 +164,8 @@
                   style="width: 100%"
                   :precision="2"
                   :controls="false"
-                  :min="0" />
+                  :min="0"
+                />
               </el-col>
             </el-row>
           </div>
@@ -134,7 +173,9 @@
       </byForm>
       <template #footer>
         <el-button @click="cancelSearch()" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitSearch()" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitSearch()" size="large"
+          >确 定</el-button
+        >
       </template>
     </el-dialog>
 
@@ -143,26 +184,48 @@
       <PaymentPDF v-else :rowData="rowData"></PaymentPDF>
       <template #footer>
         <el-button @click="openPrint = false" size="large">取消</el-button>
-        <el-button type="primary" @click="clickDownload()" size="large">下载PDF</el-button>
+        <el-button type="primary" @click="clickDownload()" size="large"
+          >下载PDF</el-button
+        >
       </template>
     </el-dialog>
 
-    <el-dialog title="冲销" v-if="openCancelledOut" v-model="openCancelledOut" width="500">
+    <el-dialog
+      title="冲销"
+      v-if="openCancelledOut"
+      v-model="openCancelledOut"
+      width="500"
+    >
       <byForm
         :formConfig="formCancelledOutConfig"
         :formOption="formOptionTwo"
         v-model="formCancelledOutData.data"
         :rules="rulesCancelledOut"
-        ref="cancelledOut">
+        ref="cancelledOut"
+      >
         <template #detail>
           <div style="width: 100%">
-            <el-button type="primary" style="margin-left: -15px" @click="clickDetail" text>查看详情</el-button>
+            <el-button
+              type="primary"
+              style="margin-left: -15px"
+              @click="clickDetail"
+              text
+              >查看详情</el-button
+            >
           </div>
         </template>
       </byForm>
       <template #footer>
-        <el-button @click="openCancelledOut = false" size="large">取 消</el-button>
-        <el-button type="danger" @click="submitCancelledOutForm()" size="large" :loading="submitCancelledOutLoading">冲 销</el-button>
+        <el-button @click="openCancelledOut = false" size="large"
+          >取 消</el-button
+        >
+        <el-button
+          type="danger"
+          @click="submitCancelledOutForm()"
+          size="large"
+          :loading="submitCancelledOutLoading"
+          >冲 销</el-button
+        >
       </template>
     </el-dialog>
   </div>
@@ -204,9 +267,12 @@ const sourceList = ref({
 });
 let dialogVisible = ref(false);
 let rules = ref({
-  productClassifyId: [{ required: true, message: "请选择物料分类", trigger: "change" }],
+  productClassifyId: [
+    { required: true, message: "请选择物料分类", trigger: "change" },
+  ],
   type: [{ required: true, message: "请选择物料类型", trigger: "change" }],
 });
+const submitType = ref("add");
 const accountCurrency = ref([]);
 const accountList = ref([]);
 const companyData = ref([]);
@@ -319,6 +385,7 @@ const config = computed(() => {
                 el: "button",
                 click() {
                   formOption.disabled = false;
+                  submitType.value = "add";
                   getDtl(row);
                 },
               }
@@ -330,11 +397,15 @@ const config = computed(() => {
                 },
                 el: "button",
                 click(item) {
-                  ElMessageBox.confirm("冲销后,已生成的资金流水数据会被删除,且关联的数据状态会由“已打款”退回至“未打款”,并支持重新打款。是否继续?", "提示", {
-                    confirmButtonText: "继续",
-                    cancelButtonText: "取消",
-                    type: "warning",
-                  })
+                  ElMessageBox.confirm(
+                    "冲销后,已生成的资金流水数据会被删除,且关联的数据状态会由“已打款”退回至“未打款”,并支持重新打款。是否继续?",
+                    "提示",
+                    {
+                      confirmButtonText: "继续",
+                      cancelButtonText: "取消",
+                      type: "warning",
+                    }
+                  )
                     .then(() => {
                       rowData.value = item;
                       formCancelledOutData.data = {
@@ -366,6 +437,7 @@ const config = computed(() => {
             el: "button",
             click() {
               formOption.disabled = true;
+              submitType.value = "edit";
               getDtl(row);
             },
           },
@@ -520,46 +592,52 @@ const recursive = (data) => {
   });
 };
 const getDict = () => {
-  proxy.getDict(["account_currency", "founds_type", "funds_payment_method"]).then((res) => {
-    accountCurrency.value = res.account_currency.map((item) => {
-      return {
-        label: item.dictValue,
-        value: item.dictKey,
-      };
-    });
-    fundsType.value = res.founds_type.map((item) => {
-      return {
-        label: item.dictValue,
-        value: item.dictKey,
-      };
-    });
-    fundsPaymentMethod.value = res.funds_payment_method.map((item) => {
-      return {
-        label: item.dictValue,
-        value: item.dictKey,
-      };
-    });
-  });
-  proxy.post("/accountManagement/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
-    if (res.rows && res.rows.length > 0) {
-      accountList.value = res.rows.map((item) => {
+  proxy
+    .getDict(["account_currency", "founds_type", "funds_payment_method"])
+    .then((res) => {
+      accountCurrency.value = res.account_currency.map((item) => {
         return {
-          label: item.alias + " (" + item.name + ")",
-          value: item.id,
+          label: item.dictValue,
+          value: item.dictKey,
         };
       });
-    }
-  });
-  proxy.post("/corporation/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
-    if (res.rows && res.rows.length > 0) {
-      companyData.value = res.rows.map((item) => {
+      fundsType.value = res.founds_type.map((item) => {
         return {
-          label: item.name,
-          value: item.id,
+          label: item.dictValue,
+          value: item.dictKey,
         };
       });
-    }
-  });
+      fundsPaymentMethod.value = res.funds_payment_method.map((item) => {
+        return {
+          label: item.dictValue,
+          value: item.dictKey,
+        };
+      });
+    });
+  proxy
+    .post("/accountManagement/page", { pageNum: 1, pageSize: 9999 })
+    .then((res) => {
+      if (res.rows && res.rows.length > 0) {
+        accountList.value = res.rows.map((item) => {
+          return {
+            label: item.alias + " (" + item.name + ")",
+            value: item.id,
+          };
+        });
+      }
+    });
+  proxy
+    .post("/corporation/page", { pageNum: 1, pageSize: 9999 })
+    .then((res) => {
+      if (res.rows && res.rows.length > 0) {
+        companyData.value = res.rows.map((item) => {
+          return {
+            label: item.name,
+            value: item.id,
+          };
+        });
+      }
+    });
   proxy
     .get("/tenantDept/list", {
       pageNum: 1,
@@ -600,13 +678,15 @@ getDict();
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/accountPayment/page", sourceList.value.pagination).then((message) => {
-    sourceList.value.data = message.rows;
-    sourceList.value.pagination.total = message.total;
-    setTimeout(() => {
-      loading.value = false;
-    }, 200);
-  });
+  proxy
+    .post("/accountPayment/page", sourceList.value.pagination)
+    .then((message) => {
+      sourceList.value.data = message.rows;
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
 };
 const paymentType = ref([
   {
@@ -670,20 +750,25 @@ const getDtl = (row) => {
   proxy.post("/accountPayment/detail", { id: row.id }).then((res) => {
     formData.data = res;
     formData.data.expensesTime = moment().format("yyyy-MM-DD HH:mm:ss");
-    proxy.post("/fileInfo/getList", { businessIdList: [row.id] }).then((fileObj) => {
-      formData.data.fileList = fileObj[row.id] || [];
-      if (formData.data.fileList && formData.data.fileList.length > 0) {
-        fileList.value = formData.data.fileList.map((item) => {
-          return {
-            raw: item,
-            name: item.fileName,
-            url: item.fileUrl,
-          };
-        });
-      } else {
-        fileList.value = [];
-      }
-    });
+    if (submitType.value === "add") {
+      formData.data.currency = accountCurrency.value[0].value;
+    }
+    proxy
+      .post("/fileInfo/getList", { businessIdList: [row.id] })
+      .then((fileObj) => {
+        formData.data.fileList = fileObj[row.id] || [];
+        if (formData.data.fileList && formData.data.fileList.length > 0) {
+          fileList.value = formData.data.fileList.map((item) => {
+            return {
+              raw: item,
+              name: item.fileName,
+              url: item.fileUrl,
+            };
+          });
+        } else {
+          fileList.value = [];
+        }
+      });
     dialogVisible.value = true;
   });
 };
@@ -768,14 +853,16 @@ const submitSearch = () => {
   if (
     sourceList.value.pagination.startAmount &&
     sourceList.value.pagination.endAmount &&
-    Number(sourceList.value.pagination.startAmount) > Number(sourceList.value.pagination.endAmount)
+    Number(sourceList.value.pagination.startAmount) >
+      Number(sourceList.value.pagination.endAmount)
   ) {
     return ElMessage("交易金额输入错误");
   }
   if (
     sourceList.value.pagination.beginCreateTime &&
     sourceList.value.pagination.endCreateTime &&
-    sourceList.value.pagination.beginCreateTime > sourceList.value.pagination.endCreateTime
+    sourceList.value.pagination.beginCreateTime >
+      sourceList.value.pagination.endCreateTime
   ) {
     return ElMessage("开始时间不能大于结束时间");
   }

+ 10 - 6
src/views/process/processApproval/index.vue

@@ -12,12 +12,7 @@
           v-if="flowForm.flowKey == 'subscribe_flow'"
           :queryData="queryData.data"
         ></SendSubscribe>
-        <SendPurchase
-          ref="makeDom"
-          @auxiliaryChange="(e) => getAuxiliaryData(e)"
-          v-else-if="flowForm.flowKey == 'purchase_flow'"
-          :queryData="queryData.data"
-        ></SendPurchase>
+
         <SendFunds
           ref="makeDom"
           v-else-if="flowForm.flowKey == 'account_request_funds_flow'"
@@ -79,8 +74,15 @@
           <PurchaseEHSD
             ref="makeDom"
             :queryData="queryData.data"
+            v-if="flowForm.submitType === '10'"
             @auxiliaryChange="(e) => getAuxiliaryData(e)"
           ></PurchaseEHSD>
+          <SendPurchase
+            ref="makeDom"
+            :queryData="queryData.data"
+            v-else
+            @auxiliaryChange="(e) => getAuxiliaryData(e)"
+          ></SendPurchase>
         </template>
 
         <ServiceContract
@@ -685,6 +687,8 @@ onMounted(async () => {
   }
   flowForm.flowKey = route.query.flowKey;
   flowForm.tenantType = route.query.tenantType;
+  flowForm.submitType = route.query.submitType;
+
   getRecords(route.query.id);
 });
 </script>

+ 2 - 1
src/views/purchaseManage/purchaseManage/purchase/index.vue

@@ -495,9 +495,10 @@ const start = () => {
     proxy.$router.replace({
       path: "/platform_manage/process/processApproval",
       query: {
-        flowKey: "purchase_flow",
+        flowKey: "ehsd_purchase_flow",
         random: proxy.random(),
         ids,
+        submitType: "20",
       },
     });
   } else {

+ 22 - 5
src/views/salesMange/shipmentMange/packing/index.vue

@@ -47,6 +47,14 @@
             </div>
           </div>
         </template>
+
+        <template #cases="{ item }">
+          <div>
+            <div v-for="(i, index) in item.dataJsonListCopy" :key="index">
+              {{ i.cases }}
+            </div>
+          </div>
+        </template>
         <template #netWeight="{ item }">
           <div>
             <div v-for="(i, index) in item.dataJsonListCopy" :key="index">
@@ -524,6 +532,7 @@ const config = computed(() => {
         label: "合同号",
         prop: "codeAPName",
         slot: "code",
+        width: 150,
       },
     },
     {
@@ -531,6 +540,7 @@ const config = computed(() => {
         label: "产品名称",
         prop: "codeAPName",
         slot: "productName",
+        "min-width": 150,
       },
     },
 
@@ -543,6 +553,13 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "箱数",
+        slot: "cases",
+        width: 90,
+      },
+    },
+    {
+      attrs: {
         label: "净重",
         slot: "netWeight",
         width: 90,
@@ -581,7 +598,7 @@ const config = computed(() => {
       attrs: {
         label: "体积",
         slot: "bomVolume",
-        width: 90,
+        width: 160,
       },
     },
     {
@@ -608,7 +625,7 @@ const config = computed(() => {
       attrs: {
         label: "总体积",
         prop: "bomVolume",
-        width: 120,
+        width: 140,
       },
       render(bomVolume) {
         return bomVolume + " m³";
@@ -628,7 +645,7 @@ const config = computed(() => {
       attrs: {
         label: "出货时间",
         prop: "shipmentTime",
-        width: 155,
+        width: 80,
       },
       render(shipmentTime) {
         if (shipmentTime) {
@@ -741,9 +758,9 @@ const getList = async (req) => {
           boxHigh: jarr[3],
           roughWeight: jarr[4],
           netWeight: jarr[5],
+          cases: jarr[6],
         };
-        let createArr = new Array(Number(jarr[6])).fill(obj);
-        newArr = [...newArr, ...createArr];
+        newArr.push(obj);
       }
       e.dataJsonListCopy = newArr;
     }