浏览代码

部分需求更改以及部分功能(采购暂存、bom附件上传)

cz 10 月之前
父节点
当前提交
30af2c0996

+ 14 - 3
src/components/headerBar/header-bar.vue

@@ -312,7 +312,7 @@
               </div>
               <div>待出库</div>
             </div>
-            <div class="job-item" @click=" handlePushRouter(6)" v-if="useUserStore().user.companyId =='100'">
+            <!-- <div class="job-item" @click=" handlePushRouter(6)" v-if="useUserStore().user.companyId =='100'">
               <el-badge :value="jobData.waitClaimCount" :max="99" style="margin-right:20px;margin-top:10px" v-if="jobData.waitClaimCount">
                 <div style="margin-top:-10px">
                   <el-icon size="20" color="#fff">
@@ -326,8 +326,8 @@
                 </el-icon>
               </div>
               <div>待认领</div>
-            </div>
-            <div class="job-item" style="margin-right:5px" @click=" handlePushRouter(7)" v-else>
+            </div> -->
+            <div class="job-item" style="margin-right:5px" @click=" handlePushRouter(7)" v-if="useUserStore().user.companyId !='100'">
               <el-badge :value="jobData.stockWarnCount" :max="99" style="margin-right:20px;margin-top:10px" v-if="jobData.stockWarnCount">
                 <div style="margin-top:-10px">
                   <el-icon size="20" color="#fff">
@@ -405,6 +405,7 @@ import TitleInfoOne from "@/components/TitleInfo/indexOne.vue";
 import Sortable from "sortablejs";
 import { tansParams } from "@/utils/ruoyi";
 import QRCode from "qrcodejs2-fix";
+import $bus from "@/bus/index.js";
 
 const router = useRouter();
 const userStore = useUserStore();
@@ -782,12 +783,22 @@ onMounted(() => {
     // }
   });
   getCollectData();
+  $bus.on("refreshTableData", () => {
+    getList();
+  });
+});
+const getList = () => {
   proxy.get("/statistics/workStatistics").then((res) => {
     for (const key in res.data) {
       res.data[key] = Number(res.data[key]);
     }
     jobData.value = res.data;
   });
+};
+getList();
+onBeforeUnmount(() => {
+  // 取消订阅特定事件
+  $bus.off("refreshTableData");
 });
 const openDrawer = ref(false);
 const handleOpenDrawer = () => {

+ 97 - 17
src/components/process/SF/Contract.vue

@@ -231,7 +231,7 @@
                       </template>
                     </el-table-column>
                     <el-table-column prop="productColor" label="颜色" width="170" />
-                    <el-table-column prop="standardDosage" label="标准用量" width="110">
+                    <el-table-column prop="standardDosage" label="标准用量" width="100">
                       <template #default="{ row, $index }">
                         <div style="width: 100%">
                           <el-form-item v-if="route.query.flowKey=='contract_update_flow'"
@@ -244,7 +244,7 @@
                         </div>
                       </template>
                     </el-table-column>
-                    <el-table-column prop="lossRate" label="损耗率(%)" width="110">
+                    <el-table-column prop="lossRate" label="损耗率(%)" width="100">
                       <template #default="{ row, $index }">
                         <div style="width: 100%">
                           <el-form-item v-if="route.query.flowKey=='contract_update_flow'"
@@ -257,7 +257,7 @@
                         </div>
                       </template>
                     </el-table-column>
-                    <el-table-column prop="quantity" label="数量" width="130">
+                    <el-table-column prop="quantity" label="数量" width="100">
                       <template #default="{ row, $index }">
                         <div style="width: 100%">
                           <el-form-item v-if="isEditList"
@@ -295,7 +295,15 @@
                         </div>
                       </template>
                     </el-table-column> -->
-                    <el-table-column prop="remark" label="备注" min-width="180" />
+                    <el-table-column prop="remark" label="备注" min-width="150" />
+                    <el-table-column label="附件" min-width="130">
+                      <template #default="{ row, $index }">
+                        <div style="width: 100%">
+                          <div class="el-click" v-for="file in row.bomFileList " :key="file.id" @click="openImg(file.fileUrl)"> {{file.fileName}}
+                          </div>
+                        </div>
+                      </template>
+                    </el-table-column>
                     <!-- <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus() &&  isEditList">
                       <template #default="{ row,$index }">
                         <el-button type="primary" link @click="handleDeleteMaterial(scope.$index,$index)">删除</el-button>
@@ -1806,6 +1814,7 @@ const selectProduct = async (goods) => {
           amount: "",
           fileList: [],
           type: x.type,
+          oldId: x.id,
         }));
         let fileListOne = [];
         if (allFile && allFile.length > 0) {
@@ -1840,14 +1849,43 @@ const selectProduct = async (goods) => {
         });
         proxy.msgTip("添加成功", 1);
         changeProductPrice();
-        let ids = contractProductBomList.value.map((x) => x.materialId);
-        proxy.getFile(
-          ids,
-          contractProductBomList.value,
-          "materialId",
-          "fileList",
-          "fileUrl"
-        );
+        let bomIds = contractProductBomList.value.map((x) => x.materialId);
+        let bomIdsOne = contractProductBomList.value.map((x) => x.oldId);
+        // 取物料图片
+        proxy
+          .getFileData({ businessIdList: bomIds, getAll: true })
+          .then((res) => {
+            for (let i = 0; i < contractProductBomList.value.length; i++) {
+              const iele = contractProductBomList.value[i];
+              let fileData = res[iele.materialId] || [];
+              if (fileData && fileData.length > 0) {
+                iele.fileList = fileData
+                  .filter((x) => x.businessType == "0")
+                  .map((y) => ({ ...y, name: y.fileName, url: y.fileUrl }));
+                if (iele.fileList && iele.fileList.length > 0) {
+                  iele.fileUrl = iele.fileList[0].fileUrl;
+                }
+              } else {
+                iele.fileList = [];
+              }
+            }
+          });
+        // 取bom附件
+        proxy
+          .getFileData({ businessIdList: bomIdsOne, getAll: true })
+          .then((res) => {
+            for (let i = 0; i < contractProductBomList.value.length; i++) {
+              const iele = contractProductBomList.value[i];
+              let fileData = res[iele.oldId] || [];
+              if (fileData && fileData.length > 0) {
+                iele.bomFileList = fileData
+                  .filter((x) => x.businessType == "10")
+                  .map((y) => ({ ...y, name: y.fileName, url: y.fileUrl }));
+              } else {
+                iele.bomFileList = [];
+              }
+            }
+          });
       } else {
         return proxy.msgTip("该产品未配置BOM", 2);
       }
@@ -2434,9 +2472,6 @@ const getAllData = (businessId) => {
       formData.data.contractProductList &&
       formData.data.contractProductList.length > 0
     ) {
-      formData.data.contractProductList.forEach((x) => {
-        x.rowId = uuidv4();
-      });
       getFileData();
       let productIds = formData.data.contractProductList.map(
         (x) => x.productId
@@ -2454,8 +2489,10 @@ const getAllData = (businessId) => {
         businessIdList: productIds,
         getAll: true,
       });
+      let bomIds = [];
       for (let i = 0; i < formData.data.contractProductList.length; i++) {
         const ele = formData.data.contractProductList[i];
+        ele.rowId = uuidv4();
         for (const key in productAllFile) {
           if (
             ele.productId == key &&
@@ -2471,7 +2508,31 @@ const getAllData = (businessId) => {
             break;
           }
         }
+        for (let j = 0; j < ele.contractProductBomList.length; j++) {
+          const jele = ele.contractProductBomList[j];
+          bomIds.push(jele.id);
+        }
       }
+      // 获取bom文件
+      proxy
+        .getFileData({ businessIdList: bomIds, getAll: true })
+        .then((res) => {
+          for (let i = 0; i < formData.data.contractProductList.length; i++) {
+            const iele = formData.data.contractProductList[i];
+            for (let j = 0; j < iele.contractProductBomList.length; j++) {
+              const jele = iele.contractProductBomList[j];
+              let fileData = res[jele.id] || [];
+              if (fileData && fileData.length > 0) {
+                jele.bomFileList = fileData
+                  .filter((x) => x.businessType == "10")
+                  .map((y) => ({ ...y, name: y.fileName, url: y.fileUrl }));
+              } else {
+                jele.bomFileList = [];
+              }
+            }
+          }
+        });
+
       let ids = formData.data.contractProductList.map((x) => x.id);
       proxy
         .getFileData({
@@ -2569,7 +2630,7 @@ const getFileData = () => {
     });
 };
 const getPriceSheetData = (id) => {
-  proxy.post("/extQuotation/detail", { id }).then(async (res) => {
+  proxy.post("/extQuotation/toContractDetail", { id }).then(async (res) => {
     if (formData.data.deptId) {
       res.deptId = formData.data.deptId;
     }
@@ -2600,7 +2661,7 @@ const getPriceSheetData = (id) => {
     // } else {
     //   formData.data.contractType = "1";
     // }
-
+    let bomIds = [];
     formData.data.contractProductList = res.quotationProductList.map((x) => ({
       quotationProductId: x.id,
       fileUrl: "",
@@ -2626,12 +2687,31 @@ const getPriceSheetData = (id) => {
       ),
       fileList: [],
       contractProductBomList: x.quotationProductBomList.map((y) => {
+        bomIds.push(y.id);
+        y.bomFileList = [];
         y.quotationProductBomId = y.id;
         delete y.id;
         return y;
       }),
       rowId: uuidv4(),
     }));
+    // 获取BOM文件
+    proxy.getFileData({ businessIdList: bomIds, getAll: true }).then((res) => {
+      for (let i = 0; i < formData.data.contractProductList.length; i++) {
+        const iele = formData.data.contractProductList[i];
+        for (let j = 0; j < iele.contractProductBomList.length; j++) {
+          const jele = iele.contractProductBomList[j];
+          let fileData = res[jele.quotationProductBomId] || [];
+          if (fileData && fileData.length > 0) {
+            jele.bomFileList = fileData
+              .filter((x) => x.businessType == "10")
+              .map((y) => ({ ...y, name: y.fileName, url: y.fileUrl }));
+          } else {
+            jele.bomFileList = [];
+          }
+        }
+      }
+    });
     changeProductPrice();
     totalAmount();
     getFileData();

+ 97 - 17
src/components/process/SF/ContractChange.vue

@@ -231,7 +231,7 @@
                       </template>
                     </el-table-column>
                     <el-table-column prop="productColor" label="颜色" width="170" />
-                    <el-table-column prop="standardDosage" label="标准用量" width="110">
+                    <el-table-column prop="standardDosage" label="标准用量" width="100">
                       <template #default="{ row, $index }">
                         <div style="width: 100%">
                           <el-form-item v-if="route.query.flowKey=='contract_update_flow'"
@@ -244,7 +244,7 @@
                         </div>
                       </template>
                     </el-table-column>
-                    <el-table-column prop="lossRate" label="损耗率(%)" width="110">
+                    <el-table-column prop="lossRate" label="损耗率(%)" width="100">
                       <template #default="{ row, $index }">
                         <div style="width: 100%">
                           <el-form-item v-if="route.query.flowKey=='contract_update_flow'"
@@ -257,7 +257,7 @@
                         </div>
                       </template>
                     </el-table-column>
-                    <el-table-column prop="quantity" label="数量" width="130">
+                    <el-table-column prop="quantity" label="数量" width="100">
                       <template #default="{ row, $index }">
                         <div style="width: 100%">
                           <el-form-item v-if="isEditList"
@@ -295,7 +295,15 @@
                         </div>
                       </template>
                     </el-table-column> -->
-                    <el-table-column prop="remark" label="备注" min-width="180" />
+                    <el-table-column prop="remark" label="备注" min-width="150" />
+                    <el-table-column label="附件" min-width="130">
+                      <template #default="{ row, $index }">
+                        <div style="width: 100%">
+                          <div class="el-click" v-for="file in row.bomFileList " :key="file.id" @click="openImg(file.fileUrl)"> {{file.fileName}}
+                          </div>
+                        </div>
+                      </template>
+                    </el-table-column>
                     <!-- <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus() &&  isEditList">
                       <template #default="{ row,$index }">
                         <el-button type="primary" link @click="handleDeleteMaterial(scope.$index,$index)">删除</el-button>
@@ -1806,6 +1814,7 @@ const selectProduct = async (goods) => {
           amount: "",
           fileList: [],
           type: x.type,
+          oldId: x.id,
         }));
         let fileListOne = [];
         if (allFile && allFile.length > 0) {
@@ -1840,14 +1849,43 @@ const selectProduct = async (goods) => {
         });
         proxy.msgTip("添加成功", 1);
         changeProductPrice();
-        let ids = contractProductBomList.value.map((x) => x.materialId);
-        proxy.getFile(
-          ids,
-          contractProductBomList.value,
-          "materialId",
-          "fileList",
-          "fileUrl"
-        );
+        let bomIds = contractProductBomList.value.map((x) => x.materialId);
+        let bomIdsOne = contractProductBomList.value.map((x) => x.oldId);
+        // 取物料图片
+        proxy
+          .getFileData({ businessIdList: bomIds, getAll: true })
+          .then((res) => {
+            for (let i = 0; i < contractProductBomList.value.length; i++) {
+              const iele = contractProductBomList.value[i];
+              let fileData = res[iele.materialId] || [];
+              if (fileData && fileData.length > 0) {
+                iele.fileList = fileData
+                  .filter((x) => x.businessType == "0")
+                  .map((y) => ({ ...y, name: y.fileName, url: y.fileUrl }));
+                if (iele.fileList && iele.fileList.length > 0) {
+                  iele.fileUrl = iele.fileList[0].fileUrl;
+                }
+              } else {
+                iele.fileList = [];
+              }
+            }
+          });
+        // 取bom附件
+        proxy
+          .getFileData({ businessIdList: bomIdsOne, getAll: true })
+          .then((res) => {
+            for (let i = 0; i < contractProductBomList.value.length; i++) {
+              const iele = contractProductBomList.value[i];
+              let fileData = res[iele.oldId] || [];
+              if (fileData && fileData.length > 0) {
+                iele.bomFileList = fileData
+                  .filter((x) => x.businessType == "10")
+                  .map((y) => ({ ...y, name: y.fileName, url: y.fileUrl }));
+              } else {
+                iele.bomFileList = [];
+              }
+            }
+          });
       } else {
         return proxy.msgTip("该产品未配置BOM", 2);
       }
@@ -2434,9 +2472,6 @@ const getAllData = (businessId) => {
       formData.data.contractProductList &&
       formData.data.contractProductList.length > 0
     ) {
-      formData.data.contractProductList.forEach((x) => {
-        x.rowId = uuidv4();
-      });
       getFileData();
       let productIds = formData.data.contractProductList.map(
         (x) => x.productId
@@ -2454,8 +2489,10 @@ const getAllData = (businessId) => {
         businessIdList: productIds,
         getAll: true,
       });
+      let bomIds = [];
       for (let i = 0; i < formData.data.contractProductList.length; i++) {
         const ele = formData.data.contractProductList[i];
+        ele.rowId = uuidv4();
         for (const key in productAllFile) {
           if (
             ele.productId == key &&
@@ -2471,7 +2508,31 @@ const getAllData = (businessId) => {
             break;
           }
         }
+        for (let j = 0; j < ele.contractProductBomList.length; j++) {
+          const jele = ele.contractProductBomList[j];
+          bomIds.push(jele.id);
+        }
       }
+      // 获取bom文件
+      proxy
+        .getFileData({ businessIdList: bomIds, getAll: true })
+        .then((res) => {
+          for (let i = 0; i < formData.data.contractProductList.length; i++) {
+            const iele = formData.data.contractProductList[i];
+            for (let j = 0; j < iele.contractProductBomList.length; j++) {
+              const jele = iele.contractProductBomList[j];
+              let fileData = res[jele.id] || [];
+              if (fileData && fileData.length > 0) {
+                jele.bomFileList = fileData
+                  .filter((x) => x.businessType == "10")
+                  .map((y) => ({ ...y, name: y.fileName, url: y.fileUrl }));
+              } else {
+                jele.bomFileList = [];
+              }
+            }
+          }
+        });
+
       let ids = formData.data.contractProductList.map((x) => x.id);
       proxy
         .getFileData({
@@ -2569,7 +2630,7 @@ const getFileData = () => {
     });
 };
 const getPriceSheetData = (id) => {
-  proxy.post("/extQuotation/detail", { id }).then(async (res) => {
+  proxy.post("/extQuotation/toContractDetail", { id }).then(async (res) => {
     if (formData.data.deptId) {
       res.deptId = formData.data.deptId;
     }
@@ -2600,7 +2661,7 @@ const getPriceSheetData = (id) => {
     // } else {
     //   formData.data.contractType = "1";
     // }
-
+    let bomIds = [];
     formData.data.contractProductList = res.quotationProductList.map((x) => ({
       quotationProductId: x.id,
       fileUrl: "",
@@ -2626,12 +2687,31 @@ const getPriceSheetData = (id) => {
       ),
       fileList: [],
       contractProductBomList: x.quotationProductBomList.map((y) => {
+        bomIds.push(y.id);
+        y.bomFileList = [];
         y.quotationProductBomId = y.id;
         delete y.id;
         return y;
       }),
       rowId: uuidv4(),
     }));
+    // 获取BOM文件
+    proxy.getFileData({ businessIdList: bomIds, getAll: true }).then((res) => {
+      for (let i = 0; i < formData.data.contractProductList.length; i++) {
+        const iele = formData.data.contractProductList[i];
+        for (let j = 0; j < iele.contractProductBomList.length; j++) {
+          const jele = iele.contractProductBomList[j];
+          let fileData = res[jele.quotationProductBomId] || [];
+          if (fileData && fileData.length > 0) {
+            jele.bomFileList = fileData
+              .filter((x) => x.businessType == "10")
+              .map((y) => ({ ...y, name: y.fileName, url: y.fileUrl }));
+          } else {
+            jele.bomFileList = [];
+          }
+        }
+      }
+    });
     changeProductPrice();
     totalAmount();
     getFileData();

+ 98 - 34
src/components/process/SF/Purchase.vue

@@ -171,7 +171,7 @@
                   <el-form-item :prop="'purchaseProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
                                 class="margin-b-0 wid100">
                     <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
-                                     :controls="false" :min="0" @change="calculationAmount('quantity')" />
+                                     :controls="false" :min="0" @change="calculationAmount()" />
                   </el-form-item>
                 </div>
               </template>
@@ -182,7 +182,7 @@
                   <el-form-item :prop="'purchaseProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true"
                                 class="margin-b-0 wid100">
                     <div style="display:flex;">
-                      <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
+                      <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="4"
                                        :controls="false" :min="0" @change="calculationAmount()" />
                       <el-popover placement="top-start" :width="400" trigger="hover" @show="showEcharts(row,$index)">
                         <template #default>
@@ -241,8 +241,8 @@
                 <div style="width: 100%">
                   <el-form-item :prop="'purchaseProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true"
                                 class="margin-b-0 wid100">
-                    <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
-                                     :controls="false" :min="0" @change="calculationAmount()" />
+                    <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="4"
+                                     :controls="false" :min="0" @change="calculationAmount(true)" />
                   </el-form-item>
                 </div>
               </template>
@@ -252,7 +252,7 @@
                 <div style="width: 100%">
                   <el-form-item :prop="'purchaseProductList.' + $index + '.priceIncludingTax'" :rules="rules.priceIncludingTax" :inline-message="true"
                                 class="margin-b-0 wid100">
-                    <el-input-number onmousewheel="return false;" v-model="row.priceIncludingTax" placeholder="请输入" style="width: 100%" :precision="2"
+                    <el-input-number onmousewheel="return false;" v-model="row.priceIncludingTax" placeholder="请输入" style="width: 100%" :precision="4"
                                      :controls="false" :min="0" @change="calculationAmount()" disabled />
                   </el-form-item>
                 </div>
@@ -298,7 +298,7 @@
                 <div style="width: 100%">
                   <el-form-item :prop="'purchaseProjectList.' + $index + '.amount'" :rules="rules.amount" :inline-message="true"
                                 class="margin-b-0 wid100">
-                    <el-input-number onmousewheel="return false;" v-model="row.amount" placeholder="请输入金额" style="width: 100%" :precision="2"
+                    <el-input-number onmousewheel="return false;" v-model="row.amount" placeholder="请输入金额" style="width: 100%" :precision="4"
                                      :controls="false" :min="0" @change="totalAmount()" />
                   </el-form-item>
                 </div>
@@ -626,6 +626,26 @@ const formConfig = computed(() => {
       itemWidth: 33.33,
     },
     {
+      type: "radio",
+      prop: "taxPointMode",
+      label: "税点模式",
+      border: true,
+      data: [
+        {
+          label: "1+税点",
+          value: "1",
+        },
+        {
+          label: "1-税点",
+          value: "2",
+        },
+      ],
+      itemWidth: 33.33,
+      fn: (val) => {
+        calculationAmount(true);
+      },
+    },
+    {
       type: "upload",
       listType: "text",
       accept: "",
@@ -997,7 +1017,30 @@ const changeSupplierPrice = (val) => {
             for (const key in res) {
               if (e.productId === key && res[key]) {
                 e.price = Number(res[key].price);
-                e.priceIncludingTax = Number(res[key].includingTaxPrice);
+                // e.priceIncludingTax = Number(res[key].includingTaxPrice);
+                if (formData.data.taxPointMode == "1") {
+                  e.priceIncludingTax = Number(
+                    parseFloat(
+                      e.price *
+                        Number(
+                          parseFloat(
+                            1 + Number(formData.data.supplierTaxPoints) / 100
+                          ).toFixed(4)
+                        )
+                    ).toFixed(4)
+                  );
+                } else {
+                  e.priceIncludingTax = Number(
+                    parseFloat(
+                      e.price /
+                        Number(
+                          parseFloat(
+                            1 - Number(formData.data.supplierTaxPoints) / 100
+                          ).toFixed(4)
+                        )
+                    ).toFixed(4)
+                  );
+                }
                 break;
               }
             }
@@ -1010,10 +1053,6 @@ const changeSupplierPrice = (val) => {
 const changeSupplier = (val) => {
   // 产品价格趋势
   changeProductPrice();
-  // 供应价格
-  if (route.query.dataType == 1) {
-    changeSupplierPrice(val);
-  }
 
   formData.data.countryId = "";
   formData.data.provinceId = "";
@@ -1041,6 +1080,8 @@ const changeSupplier = (val) => {
       formData.data.supplierTaxPoints = res.privTaxPoints;
       formData.data.deliverMethod = res.deliverMethod;
       formData.data.paymentMethod = res.paymentMethod;
+      // 供应价格
+      changeSupplierPrice(val);
     });
   }
 };
@@ -1102,20 +1143,42 @@ const handleRemove = (index) => {
   totalAmount();
 };
 
-const calculationAmount = () => {
+const calculationAmount = (flag = false) => {
   if (
     formData.data.purchaseProductList &&
     formData.data.purchaseProductList.length > 0
   ) {
     for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
-      formData.data.purchaseProductList[i].amount = parseFloat(
-        Number(formData.data.purchaseProductList[i].quantity) *
-          Number(formData.data.purchaseProductList[i].price)
-      ).toFixed(2);
-      formData.data.purchaseProductList[i].amountIncludingTax = parseFloat(
-        Number(formData.data.purchaseProductList[i].quantity) *
-          Number(formData.data.purchaseProductList[i].priceIncludingTax)
-      ).toFixed(2);
+      let e = formData.data.purchaseProductList[i];
+      if (flag) {
+        if (formData.data.taxPointMode == "1") {
+          e.priceIncludingTax = Number(
+            parseFloat(
+              e.price *
+                Number(
+                  parseFloat(
+                    1 + Number(formData.data.supplierTaxPoints) / 100
+                  ).toFixed(4)
+                )
+            ).toFixed(4)
+          );
+        } else {
+          e.priceIncludingTax = Number(
+            parseFloat(
+              e.price /
+                Number(
+                  parseFloat(
+                    1 - Number(formData.data.supplierTaxPoints) / 100
+                  ).toFixed(4)
+                )
+            ).toFixed(4)
+          );
+        }
+      }
+      e.amount = parseFloat(Number(e.quantity) * Number(e.price)).toFixed(4);
+      e.amountIncludingTax = parseFloat(
+        Number(e.quantity) * Number(e.priceIncludingTax)
+      ).toFixed(4);
     }
   }
   totalAmount();
@@ -1130,16 +1193,14 @@ const totalAmount = () => {
     formData.data.purchaseProductList.length > 0
   ) {
     for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
-      if (formData.data.purchaseProductList[i].amount) {
-        money = parseFloat(
-          Number(money) + Number(formData.data.purchaseProductList[i].amount)
-        ).toFixed(2);
+      const row = formData.data.purchaseProductList[i];
+      if (row.amount) {
+        money = parseFloat(Number(money) + Number(row.amount)).toFixed(4);
       }
-      if (formData.data.purchaseProductList[i].amountIncludingTax) {
+      if (row.amountIncludingTax) {
         moneyTwo = parseFloat(
-          Number(moneyTwo) +
-            Number(formData.data.purchaseProductList[i].amountIncludingTax)
-        ).toFixed(2);
+          Number(moneyTwo) + Number(row.amountIncludingTax)
+        ).toFixed(4);
       }
     }
   }
@@ -1148,10 +1209,9 @@ const totalAmount = () => {
     formData.data.purchaseProjectList.length > 0
   ) {
     for (let i = 0; i < formData.data.purchaseProjectList.length; i++) {
-      if (formData.data.purchaseProjectList[i].amount) {
-        money = parseFloat(
-          Number(money) + Number(formData.data.purchaseProjectList[i].amount)
-        ).toFixed(2);
+      const row = formData.data.purchaseProjectList[i];
+      if (row.amount) {
+        money = parseFloat(Number(money) + Number(row.amount)).toFixed(4);
       }
     }
   }
@@ -1212,7 +1272,10 @@ const remoteMethod = (keyword) => {
   return;
 };
 
-const handleSubmit = async () => {
+const handleSubmit = async (isStag = false) => {
+  if (isStag) {
+    return true;
+  }
   let flag = await formDom.value.handleSubmit(() => {});
   if (flag) {
     for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
@@ -1325,6 +1388,7 @@ const getProductList = (ids) => {
       formData.data.purchaseUserId =
         res.subcribeUserId || proxy.useUserStore().user.userId;
       formData.data.warehouseId = res.putWarehouseId;
+      formData.data.taxPointMode = "1";
 
       let detailList = res.subscribeDetailList;
       if (detailList && detailList.length > 0) {
@@ -1397,7 +1461,7 @@ onMounted(() => {
     let ids = route.query.ids.split(",");
     getProductList(ids);
   }
-  if (route.query.businessId && route.query.processType) {
+  if (route.query.businessId) {
     getAllData(route.query.businessId);
   }
 });

+ 124 - 34
src/components/process/SF/PurchaseChange.vue

@@ -171,7 +171,7 @@
                   <el-form-item :prop="'purchaseProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
                                 class="margin-b-0 wid100">
                     <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
-                                     :controls="false" :min="0" @change="calculationAmount('quantity')" />
+                                     :controls="false" :min="0" @change="calculationAmount()" />
                   </el-form-item>
                 </div>
               </template>
@@ -182,7 +182,7 @@
                   <el-form-item :prop="'purchaseProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true"
                                 class="margin-b-0 wid100">
                     <div style="display:flex;">
-                      <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
+                      <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="4"
                                        :controls="false" :min="0" @change="calculationAmount()" />
                       <el-popover placement="top-start" :width="400" trigger="hover" @show="showEcharts(row,$index)">
                         <template #default>
@@ -241,8 +241,8 @@
                 <div style="width: 100%">
                   <el-form-item :prop="'purchaseProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true"
                                 class="margin-b-0 wid100">
-                    <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
-                                     :controls="false" :min="0" @change="calculationAmount()" />
+                    <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="4"
+                                     :controls="false" :min="0" @change="calculationAmount(true)" />
                   </el-form-item>
                 </div>
               </template>
@@ -252,7 +252,7 @@
                 <div style="width: 100%">
                   <el-form-item :prop="'purchaseProductList.' + $index + '.priceIncludingTax'" :rules="rules.priceIncludingTax" :inline-message="true"
                                 class="margin-b-0 wid100">
-                    <el-input-number onmousewheel="return false;" v-model="row.priceIncludingTax" placeholder="请输入" style="width: 100%" :precision="2"
+                    <el-input-number onmousewheel="return false;" v-model="row.priceIncludingTax" placeholder="请输入" style="width: 100%" :precision="4"
                                      :controls="false" :min="0" @change="calculationAmount()" disabled />
                   </el-form-item>
                 </div>
@@ -298,7 +298,7 @@
                 <div style="width: 100%">
                   <el-form-item :prop="'purchaseProjectList.' + $index + '.amount'" :rules="rules.amount" :inline-message="true"
                                 class="margin-b-0 wid100">
-                    <el-input-number onmousewheel="return false;" v-model="row.amount" placeholder="请输入金额" style="width: 100%" :precision="2"
+                    <el-input-number onmousewheel="return false;" v-model="row.amount" placeholder="请输入金额" style="width: 100%" :precision="4"
                                      :controls="false" :min="0" @change="totalAmount()" />
                   </el-form-item>
                 </div>
@@ -360,6 +360,12 @@ const shippingMethod = computed(
 const frontLinesData = computed(
   () => proxy.useUserStore().allDict["front_lines"]
 );
+const supplierShippingMethod = computed(
+  () => proxy.useUserStore().allDict["supplier_shipping_method"]
+);
+const supplierPaymentMethod = computed(
+  () => proxy.useUserStore().allDict["supplier_payment_method"]
+);
 // const companyId = computed(() => proxy.useUserStore().user.companyId);
 const deliveryType = ref([
   {
@@ -602,6 +608,44 @@ const formConfig = computed(() => {
       placeholder: " ",
     },
     {
+      type: "select",
+      prop: "deliverMethod",
+      label: "发货方式",
+      required: true,
+      filterable: true,
+      data: supplierShippingMethod.value,
+      itemWidth: 33.33,
+    },
+    {
+      type: "select",
+      prop: "paymentMethod",
+      label: "付款方式",
+      required: true,
+      filterable: true,
+      data: supplierPaymentMethod.value,
+      itemWidth: 33.33,
+    },
+    {
+      type: "radio",
+      prop: "taxPointMode",
+      label: "税点模式",
+      border: true,
+      data: [
+        {
+          label: "1+税点",
+          value: "1",
+        },
+        {
+          label: "1-税点",
+          value: "2",
+        },
+      ],
+      itemWidth: 33.33,
+      fn: (val) => {
+        calculationAmount(true);
+      },
+    },
+    {
       type: "upload",
       listType: "text",
       accept: "",
@@ -973,7 +1017,30 @@ const changeSupplierPrice = (val) => {
             for (const key in res) {
               if (e.productId === key && res[key]) {
                 e.price = Number(res[key].price);
-                e.priceIncludingTax = Number(res[key].includingTaxPrice);
+                // e.priceIncludingTax = Number(res[key].includingTaxPrice);
+                if (formData.data.taxPointMode == "1") {
+                  e.priceIncludingTax = Number(
+                    parseFloat(
+                      e.price *
+                        Number(
+                          parseFloat(
+                            1 + Number(formData.data.supplierTaxPoints) / 100
+                          ).toFixed(4)
+                        )
+                    ).toFixed(4)
+                  );
+                } else {
+                  e.priceIncludingTax = Number(
+                    parseFloat(
+                      e.price /
+                        Number(
+                          parseFloat(
+                            1 - Number(formData.data.supplierTaxPoints) / 100
+                          ).toFixed(4)
+                        )
+                    ).toFixed(4)
+                  );
+                }
                 break;
               }
             }
@@ -986,10 +1053,6 @@ const changeSupplierPrice = (val) => {
 const changeSupplier = (val) => {
   // 产品价格趋势
   changeProductPrice();
-  // 供应价格
-  if (route.query.dataType == 1) {
-    changeSupplierPrice(val);
-  }
 
   formData.data.countryId = "";
   formData.data.provinceId = "";
@@ -1015,6 +1078,10 @@ const changeSupplier = (val) => {
       setTimeout(() => changeAddress(), 1500);
       formData.data.supplierIncludingTax = res.privIncludingTax;
       formData.data.supplierTaxPoints = res.privTaxPoints;
+      formData.data.deliverMethod = res.deliverMethod;
+      formData.data.paymentMethod = res.paymentMethod;
+      // 供应价格
+      changeSupplierPrice(val);
     });
   }
 };
@@ -1076,20 +1143,42 @@ const handleRemove = (index) => {
   totalAmount();
 };
 
-const calculationAmount = () => {
+const calculationAmount = (flag = false) => {
   if (
     formData.data.purchaseProductList &&
     formData.data.purchaseProductList.length > 0
   ) {
     for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
-      formData.data.purchaseProductList[i].amount = parseFloat(
-        Number(formData.data.purchaseProductList[i].quantity) *
-          Number(formData.data.purchaseProductList[i].price)
-      ).toFixed(2);
-      formData.data.purchaseProductList[i].amountIncludingTax = parseFloat(
-        Number(formData.data.purchaseProductList[i].quantity) *
-          Number(formData.data.purchaseProductList[i].priceIncludingTax)
-      ).toFixed(2);
+      let e = formData.data.purchaseProductList[i];
+      if (flag) {
+        if (formData.data.taxPointMode == "1") {
+          e.priceIncludingTax = Number(
+            parseFloat(
+              e.price *
+                Number(
+                  parseFloat(
+                    1 + Number(formData.data.supplierTaxPoints) / 100
+                  ).toFixed(4)
+                )
+            ).toFixed(4)
+          );
+        } else {
+          e.priceIncludingTax = Number(
+            parseFloat(
+              e.price /
+                Number(
+                  parseFloat(
+                    1 - Number(formData.data.supplierTaxPoints) / 100
+                  ).toFixed(4)
+                )
+            ).toFixed(4)
+          );
+        }
+      }
+      e.amount = parseFloat(Number(e.quantity) * Number(e.price)).toFixed(4);
+      e.amountIncludingTax = parseFloat(
+        Number(e.quantity) * Number(e.priceIncludingTax)
+      ).toFixed(4);
     }
   }
   totalAmount();
@@ -1104,16 +1193,14 @@ const totalAmount = () => {
     formData.data.purchaseProductList.length > 0
   ) {
     for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
-      if (formData.data.purchaseProductList[i].amount) {
-        money = parseFloat(
-          Number(money) + Number(formData.data.purchaseProductList[i].amount)
-        ).toFixed(2);
+      const row = formData.data.purchaseProductList[i];
+      if (row.amount) {
+        money = parseFloat(Number(money) + Number(row.amount)).toFixed(4);
       }
-      if (formData.data.purchaseProductList[i].amountIncludingTax) {
+      if (row.amountIncludingTax) {
         moneyTwo = parseFloat(
-          Number(moneyTwo) +
-            Number(formData.data.purchaseProductList[i].amountIncludingTax)
-        ).toFixed(2);
+          Number(moneyTwo) + Number(row.amountIncludingTax)
+        ).toFixed(4);
       }
     }
   }
@@ -1122,10 +1209,9 @@ const totalAmount = () => {
     formData.data.purchaseProjectList.length > 0
   ) {
     for (let i = 0; i < formData.data.purchaseProjectList.length; i++) {
-      if (formData.data.purchaseProjectList[i].amount) {
-        money = parseFloat(
-          Number(money) + Number(formData.data.purchaseProjectList[i].amount)
-        ).toFixed(2);
+      const row = formData.data.purchaseProjectList[i];
+      if (row.amount) {
+        money = parseFloat(Number(money) + Number(row.amount)).toFixed(4);
       }
     }
   }
@@ -1186,7 +1272,10 @@ const remoteMethod = (keyword) => {
   return;
 };
 
-const handleSubmit = async () => {
+const handleSubmit = async (isStag = false) => {
+  if (isStag) {
+    return true;
+  }
   let flag = await formDom.value.handleSubmit(() => {});
   if (flag) {
     for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
@@ -1299,6 +1388,7 @@ const getProductList = (ids) => {
       formData.data.purchaseUserId =
         res.subcribeUserId || proxy.useUserStore().user.userId;
       formData.data.warehouseId = res.putWarehouseId;
+      formData.data.taxPointMode = "1";
 
       let detailList = res.subscribeDetailList;
       if (detailList && detailList.length > 0) {
@@ -1371,7 +1461,7 @@ onMounted(() => {
     let ids = route.query.ids.split(",");
     getProductList(ids);
   }
-  if (route.query.businessId && route.query.processType) {
+  if (route.query.businessId) {
     getAllData(route.query.businessId);
   }
 });

+ 84 - 7
src/components/process/SF/Subscribe.vue

@@ -38,7 +38,7 @@
                 <div style="width: 100%">
                   <el-form-item :prop="'subscribeDetailList.' + $index + '.price'" :rules="rules.price" :inline-message="true"
                                 class="margin-b-0 wid100">
-                    <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
+                    <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="4"
                                      :controls="false" :min="0" @change="calculationAmount(true)" />
                   </el-form-item>
                 </div>
@@ -49,7 +49,7 @@
                 <div style="width: 100%">
                   <el-form-item :prop="'subscribeDetailList.' + $index + '.priceIncludingTax'" :rules="rules.priceIncludingTax" :inline-message="true"
                                 class="margin-b-0 wid100">
-                    <el-input-number onmousewheel="return false;" v-model="row.priceIncludingTax" placeholder="请输入" style="width: 100%" :precision="2"
+                    <el-input-number onmousewheel="return false;" v-model="row.priceIncludingTax" placeholder="请输入" style="width: 100%" :precision="4"
                                      :controls="false" :min="0" @change="calculationAmount()" disabled />
                   </el-form-item>
                 </div>
@@ -243,6 +243,9 @@ const formConfig = computed(() => {
       fn: (val) => {
         if (val == "0") {
           formData.data.supplierId = "";
+          formData.data.taxPointMode = "";
+        } else {
+          formData.data.taxPointMode = "1";
         }
       },
     },
@@ -298,6 +301,53 @@ const formConfig = computed(() => {
       isShow: formData.data.isAppoint == "1" ? true : false,
     },
     {
+      type: "radio",
+      prop: "taxPointMode",
+      label: "税点模式",
+      border: true,
+      data: [
+        {
+          label: "1+税点",
+          value: "1",
+        },
+        {
+          label: "1-税点",
+          value: "2",
+        },
+      ],
+      itemWidth: 50,
+      isShow: formData.data.isAppoint == "1" ? true : false,
+      fn: (val) => {
+        // for (let i = 0; i < formData.data.subscribeDetailList.length; i++) {
+        //   const e = formData.data.subscribeDetailList[i];
+        //   if (val == "1") {
+        //     e.priceIncludingTax = Number(
+        //       parseFloat(
+        //         e.price *
+        //           Number(
+        //             parseFloat(
+        //               1 + Number(formData.data.privTaxPoints) / 100
+        //             ).toFixed(4)
+        //           )
+        //       ).toFixed(4)
+        //     );
+        //   } else {
+        //     e.priceIncludingTax = Number(
+        //       parseFloat(
+        //         e.price /
+        //           Number(
+        //             parseFloat(
+        //               1 - Number(formData.data.privTaxPoints) / 100
+        //             ).toFixed(4)
+        //           )
+        //       ).toFixed(4)
+        //     );
+        //   }
+        // }
+        calculationAmount(true);
+      },
+    },
+    {
       type: "input",
       prop: "purposeRemark",
       itemType: "textarea",
@@ -391,6 +441,9 @@ const rules = ref({
   priceIncludingTax: [
     { required: true, message: "请输入单价(含税)", trigger: "blur" },
   ],
+  taxPointMode: [
+    { required: true, message: "请输入税点模式", trigger: "change" },
+  ],
 });
 
 const changeSupplierPrice = (val) => {
@@ -408,7 +461,31 @@ const changeSupplierPrice = (val) => {
             for (const key in res) {
               if (e.productId === key && res[key]) {
                 e.price = Number(res[key].price);
-                e.priceIncludingTax = Number(res[key].includingTaxPrice);
+                //  e.priceIncludingTax = Number(res[key].includingTaxPrice);
+                if (formData.data.taxPointMode == "1") {
+                  e.priceIncludingTax = Number(
+                    parseFloat(
+                      e.price *
+                        Number(
+                          parseFloat(
+                            1 + Number(formData.data.privTaxPoints) / 100
+                          ).toFixed(4)
+                        )
+                    ).toFixed(4)
+                  );
+                } else {
+                  e.priceIncludingTax = Number(
+                    parseFloat(
+                      e.price /
+                        Number(
+                          parseFloat(
+                            1 - Number(formData.data.privTaxPoints) / 100
+                          ).toFixed(4)
+                        )
+                    ).toFixed(4)
+                  );
+                }
+
                 break;
               }
             }
@@ -507,11 +584,11 @@ const calculationAmount = (flag = false) => {
       formData.data.subscribeDetailList[i].amount = parseFloat(
         Number(formData.data.subscribeDetailList[i].count) *
           Number(formData.data.subscribeDetailList[i].price)
-      ).toFixed(2);
+      ).toFixed(4);
       formData.data.subscribeDetailList[i].amountIncludingTax = parseFloat(
         Number(formData.data.subscribeDetailList[i].count) *
           Number(formData.data.subscribeDetailList[i].priceIncludingTax)
-      ).toFixed(2);
+      ).toFixed(4);
     }
   }
   totalAmount();
@@ -528,13 +605,13 @@ const totalAmount = () => {
       if (formData.data.subscribeDetailList[i].amount) {
         money = parseFloat(
           Number(money) + Number(formData.data.subscribeDetailList[i].amount)
-        ).toFixed(2);
+        ).toFixed(4);
       }
       if (formData.data.subscribeDetailList[i].amountIncludingTax) {
         moneyTwo = parseFloat(
           Number(moneyTwo) +
             Number(formData.data.subscribeDetailList[i].amountIncludingTax)
-        ).toFixed(2);
+        ).toFixed(4);
       }
     }
   }

+ 50 - 0
src/views/EHSD/procurement/purchasedEHSD/index.vue

@@ -437,6 +437,44 @@ const config = computed(() => {
       },
       renderHTML(row) {
         return [
+          row.status == 0
+            ? {
+                attrs: {
+                  label: "修改",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  clickUpdate(row);
+                },
+              }
+            : {},
+          row.status == 0
+            ? {
+                attrs: {
+                  label: "删除",
+                  type: "danger",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  proxy
+                    .msgConfirm()
+                    .then((res) => {
+                      proxy
+                        .post("/ehsdPurchase/delete", {
+                          id: row.id,
+                        })
+                        .then((res) => {
+                          proxy.msgTip("操作成功", 1);
+                          getList();
+                        });
+                    })
+                    .catch((err) => {});
+                },
+              }
+            : {},
           row.status == 30 && row.arrivalStatus == 0
             ? {
                 attrs: {
@@ -851,6 +889,18 @@ const disabledFn = (date) => {
   // return moment(current).add(1, "month").isBefore(moment());
   return moment(current).isAfter(moment());
 };
+
+const clickUpdate = (row) => {
+  proxy.$router.push({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: "purchase_flow",
+      flowName: "采购发起流程",
+      random: proxy.random(),
+      businessId: row.id,
+    },
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 84 - 2
src/views/EHSD/productLibrary/companyProduct/index.vue

@@ -102,7 +102,7 @@
                     </div>
                   </template>
                 </el-table-column> -->
-                <el-table-column label="标准用量" width="150">
+                <el-table-column label="标准用量" width="120">
                   <template #default="{ row, $index }">
                     <div style="width: 100%">
                       <el-form-item :prop="'productBomDetailList.' + $index + '.standardDosage'" :rules="rules.standardDosage" :inline-message="true"
@@ -113,7 +113,7 @@
                     </div>
                   </template>
                 </el-table-column>
-                <el-table-column label="损耗率(%)" width="150">
+                <el-table-column label="损耗率(%)" width="120">
                   <template #default="{ row, $index }">
                     <div style="width: 100%">
                       <el-form-item :prop="'productBomDetailList.' + $index + '.lossRate'" :rules="rules.lossRate" :inline-message="true"
@@ -134,6 +134,18 @@
                     </div>
                   </template>
                 </el-table-column>
+                <el-table-column label="附件" min-width="150">
+                  <template #default="{ row, $index }">
+                    <el-form-item :prop="'productBomDetailList.' + $index + '.bomFileList'" :inline-message="true" class="margin-b-0">
+                      <el-upload :file-list="row.bomFileList" :action="uploadUrl" :data="row.uploadData" :limit="2" :list-type="'text'"
+                                 :before-upload="(file)=>handleBeforeUpload(file,$index)" :on-success="()=>handleFileSuccess($index)"
+                                 :on-remove="(file)=>handleRemoveFileOne(file,$index)" :on-preview="onPreviewFile"
+                                 :on-exceed="()=>msgTip(`上传文件数量不可大于2`, 2)">
+                        <el-button type="primary" plain>上传</el-button>
+                      </el-upload>
+                    </el-form-item>
+                  </template>
+                </el-table-column>
                 <el-table-column label="操作" width="60" align="center" fixed="right">
                   <template #default="{ row, $index }">
                     <el-button type="primary" link @click="handleRemove($index,1)" v-if="row.type !=3">删除</el-button>
@@ -1077,6 +1089,13 @@ const formConfig = computed(() => {
       disabled: true,
     },
     // {
+    //   type: "upload",
+    //   listType: "text",
+    //   accept: "",
+    //   prop: "bomFileList",
+    //   label: "BOM附件",
+    // },
+    // {
     //   type: "input",
     //   prop: "rawMaterialSize",
     //   label: "原材料尺寸",
@@ -1294,6 +1313,7 @@ const openModal = () => {
     fileList: [],
     currency: "",
     prodFileList: [],
+    bomFileList: [],
     isFold: 0,
     isCustomized: 0,
     packAsk: [],
@@ -1480,10 +1500,33 @@ const getDtl = (row) => {
                 url: item.fileUrl,
               };
             });
+          formData.data.bomFileList = fileObj[row.id]
+            .filter((x) => x.businessType == "10")
+            .map((item) => {
+              return {
+                ...item,
+                name: item.fileName,
+                url: item.fileUrl,
+              };
+            });
         } else {
           formData.data.prodFileList = [];
+          formData.data.bomFileList = [];
         }
       });
+    // bom清单附件
+    formData.data.productBomDetailList.forEach((x) => {
+      x.bomFileList = [];
+    });
+    let ids = formData.data.productBomDetailList.map((x) => x.id);
+    proxy.getFileData({
+      businessIdList: ids,
+      data: formData.data.productBomDetailList,
+      att: "id",
+      businessType: "10",
+      fileAtt: "bomFileList",
+      filePathAtt: "fileUrl",
+    });
 
     dialogVisible.value = true;
   });
@@ -1625,6 +1668,7 @@ const selectMaterial = (row) => {
         standardDosage: 1,
         lossRate: null,
         remark: "",
+        bomFileList: [],
       });
       proxy.msgTip("选择成功");
     } else {
@@ -1645,6 +1689,7 @@ const selectMaterial = (row) => {
         materialColor: row.color,
         materialId: row.id,
         quantity: null,
+        bomFileList: [],
       });
       proxy.msgTip("选择成功");
     } else {
@@ -1844,6 +1889,7 @@ const selectRawMaterial = (row) => {
         standardDosage: 1,
         lossRate: null,
         remark: "",
+        bomFileList: [],
       });
       proxy.msgTip("选择成功");
     } else {
@@ -1888,6 +1934,7 @@ const selectTechnology = (row) => {
       standardDosage: 1,
       lossRate: null,
       remark: "",
+      bomFileList: [],
     }));
 
     if (index >= 0) {
@@ -1905,6 +1952,41 @@ const selectTechnology = (row) => {
     return proxy.msgTip("选择成功", 1);
   }
 };
+
+const handleBeforeUpload = async (file, index) => {
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  file.id = res.id;
+  file.fileUrl = res.fileUrl;
+  formData.data.productBomDetailList[index].uploadData = res.uploadBody;
+  formData.data.productBomDetailList[index].fileData = res;
+  return true;
+};
+
+const handleFileSuccess = (index, att) => {
+  if (
+    formData.data.productBomDetailList[index].fileData &&
+    formData.data.productBomDetailList[index].fileData.fileUrl
+  ) {
+    let file = formData.data.productBomDetailList[index].fileData;
+    formData.data.productBomDetailList[index].bomFileList.push({
+      id: file.id,
+      fileName: file.fileName,
+      name: file.fileName,
+      url: file.fileUrl,
+      fileUrl: file.fileUrl,
+    });
+    formData.data.productBomDetailList[index].fileData = {};
+  }
+};
+
+const handleRemoveFileOne = (file, index) => {
+  let sonIndex = formData.data.productBomDetailList[
+    index
+  ].bomFileList.findIndex((x) => x.id == file.id || x.id == file.raw.id);
+  if (sonIndex > -1) {
+    formData.data.productBomDetailList[index].bomFileList.splice(sonIndex, 1);
+  }
+};
 </script>
 
 <style lang="scss" scoped>

+ 67 - 5
src/views/EHSD/productLibrary/waitCreateProduct/index.vue

@@ -51,8 +51,8 @@
 
               <div>
                 <el-button type="primary" @click="openDialog(1)" plain>主材</el-button>
-                <el-button type="primary" @click="openDialog(2)" plain>工艺</el-button>
-                <el-button type="primary" @click="openDialog(3)" plain>辅材</el-button>
+                <!-- <el-button type="primary" @click="openDialog(2)" plain>工艺</el-button>
+                <el-button type="primary" @click="openDialog(3)" plain>辅材</el-button> -->
               </div>
               <div style="color:red"> BOM主材请选择有属性原材料,并移除下表中标红的数据</div>
               <el-table :data="formData.data.productBomDetailList" style="width: 100%; margin-top: 16px" :row-class-name="getRowClass">
@@ -77,7 +77,7 @@
                     </div>
                   </template>
                 </el-table-column> -->
-                <el-table-column label="标准用量" width="150">
+                <el-table-column label="标准用量" width="120">
                   <template #default="{ row, $index }">
                     <div style="width: 100%">
                       <el-form-item :prop="'productBomDetailList.' + $index + '.standardDosage'" :rules="rules.standardDosage" :inline-message="true"
@@ -88,7 +88,7 @@
                     </div>
                   </template>
                 </el-table-column>
-                <el-table-column label="损耗率(%)" width="150">
+                <el-table-column label="损耗率(%)" width="120">
                   <template #default="{ row, $index }">
                     <div style="width: 100%">
                       <el-form-item :prop="'productBomDetailList.' + $index + '.lossRate'" :rules="rules.lossRate" :inline-message="true"
@@ -109,9 +109,22 @@
                     </div>
                   </template>
                 </el-table-column>
+                <el-table-column label="附件" min-width="150">
+                  <template #default="{ row, $index }">
+                    <el-form-item :prop="'productBomDetailList.' + $index + '.bomFileList'" :inline-message="true" class="margin-b-0">
+                      <el-upload :file-list="row.bomFileList" :action="uploadUrl" :data="row.uploadData" :limit="2" :list-type="'text'"
+                                 :before-upload="(file)=>handleBeforeUpload(file,$index)" :on-success="()=>handleFileSuccess($index)"
+                                 :on-remove="(file)=>handleRemoveFileOne(file,$index)" :on-preview="onPreviewFile"
+                                 :on-exceed="()=>msgTip(`上传文件数量不可大于2`, 2)">
+                        <el-button type="primary" plain>上传</el-button>
+                      </el-upload>
+                    </el-form-item>
+                  </template>
+                </el-table-column>
                 <el-table-column label="操作" width="60" align="center" fixed="right">
                   <template #default="{ row, $index }">
-                    <el-button type="primary" link @click="handleRemove($index,1)" v-if="row.type !=3">删除</el-button>
+                    <!-- <el-button type="primary" link @click="handleRemove($index,1)" v-if="row.type !=3">删除</el-button> -->
+                    <el-button type="primary" link @click="handleRemove($index,1)" v-if="row.type ==1">删除</el-button>
                   </template>
                 </el-table-column>
               </el-table>
@@ -905,6 +918,13 @@ const formConfig = computed(() => {
       disabled: true,
     },
     // {
+    //   type: "upload",
+    //   listType: "text",
+    //   accept: "",
+    //   prop: "bomFileList",
+    //   label: "BOM附件",
+    // },
+    // {
     //   type: "input",
     //   prop: "rawMaterialSize",
     //   label: "原材料尺寸",
@@ -1232,6 +1252,7 @@ const getDtl = (row) => {
     fileList: [],
     hsCode: "",
     prodFileList: [],
+    bomFileList: [],
     prodImgPath: "",
     technologyId: row.technologyId,
     color: row.productColor,
@@ -1239,6 +1260,7 @@ const getDtl = (row) => {
     width: row.productWidth,
     height: row.productHeight,
     productBomDetailList: row.quotationProductBomList.map((x) => ({
+      id: x.id,
       type: x.type,
       materialName: x.productName,
       materialCode: x.productCode,
@@ -1252,6 +1274,7 @@ const getDtl = (row) => {
       quantity: x.quantity,
       remark: x.remark || "",
       ancestors: x.type == 1 ? 110 : null,
+      bomFileList: [],
     })),
     productCustomInfoList: row.quotationProductCustomInfoList || [],
     rawMaterialIdLabel: row.rawMaterialName + "," + row.rawMaterialCode,
@@ -1337,6 +1360,7 @@ const selectMaterial = (row) => {
         materialColor: row.color,
         materialId: row.id,
         quantity: null,
+        bomFileList: [],
       });
       proxy.msgTip("选择成功");
     } else {
@@ -1357,6 +1381,7 @@ const selectMaterial = (row) => {
         materialColor: row.color,
         materialId: row.id,
         quantity: null,
+        bomFileList: [],
       });
       proxy.msgTip("选择成功");
     } else {
@@ -1484,6 +1509,7 @@ const selectRawMaterial = (row) => {
         lossRate: null,
         remark: "",
         ancestors: 100,
+        bomFileList: [],
       });
       proxy.msgTip("选择成功");
     } else {
@@ -1528,6 +1554,7 @@ const selectTechnology = (row) => {
       standardDosage: 1,
       lossRate: null,
       remark: "",
+      bomFileList: [],
     }));
 
     if (index >= 0) {
@@ -1552,6 +1579,41 @@ const getRowClass = ({ row }) => {
   }
   return "";
 };
+
+const handleBeforeUpload = async (file, index) => {
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  file.id = res.id;
+  file.fileUrl = res.fileUrl;
+  formData.data.productBomDetailList[index].uploadData = res.uploadBody;
+  formData.data.productBomDetailList[index].fileData = res;
+  return true;
+};
+
+const handleFileSuccess = (index, att) => {
+  if (
+    formData.data.productBomDetailList[index].fileData &&
+    formData.data.productBomDetailList[index].fileData.fileUrl
+  ) {
+    let file = formData.data.productBomDetailList[index].fileData;
+    formData.data.productBomDetailList[index].bomFileList.push({
+      id: file.id,
+      fileName: file.fileName,
+      name: file.fileName,
+      url: file.fileUrl,
+      fileUrl: file.fileUrl,
+    });
+    formData.data.productBomDetailList[index].fileData = {};
+  }
+};
+
+const handleRemoveFileOne = (file, index) => {
+  let sonIndex = formData.data.productBomDetailList[
+    index
+  ].bomFileList.findIndex((x) => x.id == file.id || x.id == file.raw.id);
+  if (sonIndex > -1) {
+    formData.data.productBomDetailList[index].bomFileList.splice(sonIndex, 1);
+  }
+};
 </script>
 
 <style lang="scss" scoped>

+ 3 - 0
src/views/EHSD/saleContract/priceSheetEstimate/index.vue

@@ -918,6 +918,8 @@ import { ref } from "vue";
 import * as echarts from "echarts";
 import SelectMaterial from "@/components/product/SelectMaterial.vue";
 import QuotationPDF from "@/components/PDF/quotationPDF.vue";
+import $bus from "@/bus/index.js";
+
 const { proxy } = getCurrentInstance();
 const packAskData = computed(() => proxy.useUserStore().allDict["pack_ask"]);
 const foldWayData = computed(() => proxy.useUserStore().allDict["fold_way"]);
@@ -1577,6 +1579,7 @@ const handleSubmitOne = () => {
             proxy.msgTip("操作成功", 1);
             openAddDialog.value = false;
             getList();
+            $bus.emit("refreshTableData");
           });
       })
       .catch((err) => {});

+ 2 - 2
src/views/MES/productionOrder/index.vue

@@ -403,8 +403,7 @@ import byForm from "@/components/byForm/index";
 import moment from "moment";
 import * as date from "@/utils/date.js";
 import { ArrowLeftBold, ArrowRightBold } from "@element-plus/icons-vue";
-import { async } from "@antv/x6/lib/registry/marker/main";
-import { reactive } from "vue";
+import $bus from "@/bus/index.js";
 
 const { proxy } = getCurrentInstance();
 const contractTag = computed(
@@ -1377,6 +1376,7 @@ const submitConfirm = (type) => {
         confirmDialog.value = false;
         getList();
         getRightData();
+        $bus.emit("refreshTableData");
       });
   });
 };

+ 11 - 1
src/views/process/processApproval/index.vue

@@ -288,6 +288,7 @@ const StagFlowKey = ref([
   "personal_invoice_flow",
   "invoice_tax_deduction_flow",
   "invoice_apply_flow",
+  "purchase_flow",
 ]);
 // tab切换逻辑
 const activeName = ref("first");
@@ -565,6 +566,15 @@ const handleSubmitStag = async (_type) => {
                 btnLoading.value = false;
               }
             );
+          } else if (flowForm.flowKey == "purchase_flow") {
+            proxy.post("/ehsdPurchase/add", data).then(
+              (res) => {
+                skipPage();
+              },
+              (err) => {
+                btnLoading.value = false;
+              }
+            );
           }
         }
       });
@@ -583,7 +593,7 @@ const skipPage = () => {
     sample_update_flow: "ContractSample",
     sale_quotation_flow: "Quotation",
     purchase_update_flow: "Purchased",
-    purchase_flow: "Purchase",
+    purchase_flow: "purchased",
     pay_flow: "Payment",
     purchase_back_flow: "ReturnGood",
     discuss_price_flow: "PriceSheetEHSD",

+ 4 - 0
src/views/process/processConfig/vueFlow.vue

@@ -133,6 +133,10 @@ const rankData = ref([
     value: 10,
   },
   {
+    label: "组长",
+    value: 15,
+  },
+  {
     label: "主管",
     value: 20,
   },

+ 2 - 0
src/views/purchaseSales/outAndInWarehouse/waitingForDelivery/index.vue

@@ -104,6 +104,7 @@ import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { ElMessage } from "element-plus";
 import moment from "moment";
+import $bus from "@/bus/index.js";
 
 const { proxy } = getCurrentInstance();
 const warehouseList = ref([]);
@@ -559,6 +560,7 @@ const submitForm = () => {
         proxy.msgTip("提交成功", 1);
         dialogVisible.value = false;
         getList();
+        $bus.emit("refreshTableData");
       },
       (err) => {
         loadingDialog.value = false;

+ 3 - 0
src/views/purchaseSales/outAndInWarehouse/waitingForStorage/index.vue

@@ -90,6 +90,7 @@ import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { ElMessage } from "element-plus";
 import moment from "moment";
+import $bus from "@/bus/index.js";
 
 const { proxy } = getCurrentInstance();
 const warehouseList = ref([]);
@@ -340,6 +341,7 @@ const config = computed(() => {
                     .then((res) => {
                       proxy.msgTip("操作成功", 1);
                       getList();
+                      $bus.emit("refreshTableData");
                     });
                 })
                 .catch((err) => {});
@@ -541,6 +543,7 @@ const submitForm = () => {
         proxy.msgTip("提交成功", 1);
         dialogVisible.value = false;
         getList();
+        $bus.emit("refreshTableData");
       },
       (err) => {
         loadingDialog.value = false;

+ 42 - 40
src/views/salesMange/shipmentMange/packing/index.vue

@@ -7,7 +7,7 @@
           'select-all': selectRow,
         }" :action-list="[
           {
-            text: '出货',
+            text: '提交',
             disabled: selectData.length === 0,
             action: () => openModalOne(),
           },
@@ -611,15 +611,15 @@ const firstRules = ref({
 const { proxy } = getCurrentInstance();
 const selectConfig = reactive([
   {
-    label: "出货状态",
+    label: "提交状态",
     prop: "shipmentStatus",
     data: [
       {
-        label: "未出货",
+        label: "未提交",
         value: "0",
       },
       {
-        label: "已出货",
+        label: "已提交",
         value: "1",
       },
     ],
@@ -739,18 +739,18 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "出货状态",
+        label: "提交状态",
         prop: "shipmentStatus",
         width: 90,
         fixed: "right",
       },
       render(status) {
-        return status == 1 ? "已出货" : status == 0 ? "未出货" : "";
+        return status == 1 ? "已提交" : status == 0 ? "未提交" : "";
       },
     },
     {
       attrs: {
-        label: "出货时间",
+        label: "提交时间",
         prop: "shipmentTime",
         width: 80,
         fixed: "right",
@@ -784,39 +784,41 @@ const config = computed(() => {
           //     clickShippingNotice(row);
           //   },
           // },
-          {
-            attrs: {
-              label: "删除",
-              type: "primary",
-              text: true,
-              disabled: false,
-            },
-            el: "button",
-            click() {
-              ElMessageBox.confirm(
-                "此操作将永久作废该数据, 是否继续?",
-                "提示",
-                {
-                  confirmButtonText: "确定",
-                  cancelButtonText: "取消",
-                  type: "warning",
-                }
-              ).then(() => {
-                // 删除
-                proxy
-                  .post("/pack/delete", {
-                    id: row.packId,
-                  })
-                  .then((res) => {
-                    ElMessage({
-                      message: "作废成功",
-                      type: "success",
-                    });
-                    getList();
+          row.shipmentStatus != 1
+            ? {
+                attrs: {
+                  label: "删除",
+                  type: "primary",
+                  text: true,
+                  disabled: false,
+                },
+                el: "button",
+                click() {
+                  ElMessageBox.confirm(
+                    "此操作将永久作废该数据, 是否继续?",
+                    "提示",
+                    {
+                      confirmButtonText: "确定",
+                      cancelButtonText: "取消",
+                      type: "warning",
+                    }
+                  ).then(() => {
+                    // 删除
+                    proxy
+                      .post("/pack/delete", {
+                        id: row.packId,
+                      })
+                      .then((res) => {
+                        ElMessage({
+                          message: "作废成功",
+                          type: "success",
+                        });
+                        getList();
+                      });
                   });
-              });
-            },
-          },
+                },
+              }
+            : {},
         ];
       },
     },
@@ -1012,7 +1014,7 @@ const submitFormOne = () => {
     proxy.post("/packDetail/shipment", formData.dataOne).then(
       (res) => {
         ElMessage({
-          message: "出货成功",
+          message: "提交成功",
           type: "success",
         });
         dialogVisibleOne.value = false;

+ 9 - 5
src/views/systemTenant/tenant/userTenant/index.vue

@@ -170,6 +170,10 @@ const rankData = ref([
     value: 10,
   },
   {
+    label: "组长",
+    value: 15,
+  },
+  {
     label: "主管",
     value: 20,
   },
@@ -926,11 +930,11 @@ const getTreeData = () => {
       treeData.value = proxy.handleTree(res.data, "deptId");
       deptList.value = proxy.handleTree(res.data, "deptId");
       let newData = proxy.deepClone(res.data);
-      for (let i = 0; i < newData.length; i++) {
-        if (newData[i] && newData[i].type == 3) {
-          newData[i].disabled = true;
-        }
-      }
+      // for (let i = 0; i < newData.length; i++) {
+      //   if (newData[i] && newData[i].type == 3) {
+      //     newData[i].disabled = true;
+      //   }
+      // }
       deptListOne.value = proxy.handleTree(newData, "deptId");
     });
 };