cz 1 rok pred
rodič
commit
5f520df030

+ 22 - 5
src/components/byForm/index.vue

@@ -109,8 +109,8 @@
           <div class="upload" v-else-if="i.type == 'upload'">
             <el-upload :file-list="formData[i.prop]" action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" :data="uploadData"
                        :list-type="i.listType ? i.listType : 'text'" :accept="i.accept?i.accept :''" :limit="i.limit?i.limit:3"
-                       :before-upload="(file)=>handleBeforeUpload(file,i)" :on-success="()=>handleSuccess(i)" :on-exceed="()=>handleExceed(i)"
-                       :on-preview="onPreviewFile">
+                       :before-upload="(file)=>handleBeforeUpload(file,i)" :on-success="()=>handleSuccess(i)"
+                       :on-remove="(file)=>handleRemove(file,i)" :on-exceed="()=>handleExceed(i)" :on-preview="onPreviewFile">
 
               <el-icon v-if="i.listType=='picture-card'">
                 <Plus />
@@ -213,21 +213,38 @@ const handleSuccess = (item) => {
       url: fileData.value.fileUrl,
       fileUrl: fileData.value.fileUrl,
     });
-    emit("update:modelValue", formData.value);
+  }
+  emit("update:modelValue", formData.value);
+};
+
+const handleRemove = (file, item) => {
+  let index = formData.value[item.prop].findIndex(
+    (x) => x.id == file.id || x.id == file.raw.id
+  );
+  if (index > -1) {
+    formData.value[item.prop].splice(index, 1);
   }
 };
 const handleBeforeUpload = async (file, item) => {
+  fileData.value = {};
   const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  file.id = res.id;
+  file.fileUrl = res.fileUrl;
   uploadData.value = res.uploadBody;
   fileData.value = res;
+  return true;
 };
 
 const handleExceed = (item) => {
   let limit = item.limit || 3;
   return proxy.msgTip(`上传文件数量不可大于${limit}`, 2);
 };
-const onPreviewFile = (file) => {
-  if (file && file.fileUrl) window.open(file.fileUrl, "_blank");
+const onPreviewFile = (file, a) => {
+  if (file && file.fileUrl) {
+    window.open(file.fileUrl, "_blank");
+  } else {
+    window.open(file.raw.fileUrl, "_blank");
+  }
 };
 const imgLoading = ref(false);
 const handleBeforeUploadOne = async (file, prop, imgProp) => {

+ 1 - 1
src/components/byTable/index.vue

@@ -140,7 +140,7 @@
       <el-row v-if="!hidePagination" class="table-pagination" justify="end" type="flex">
         <el-pagination background layout="total, sizes, prev, pager, next, jumper" :current-page="getPagination.pageNum"
                        :page-size="getPagination.pageSize" :total="getPagination.total" @size-change="handleSizeChange"
-                       @current-change="handlePageChange" />
+                       @current-change="handlePageChange" :page-sizes="[10, 20, 30, 40, 50]" />
       </el-row>
     </component>
   </div>

+ 82 - 21
src/components/process/SF/Contract.vue

@@ -194,7 +194,7 @@
                         </div>
                       </template>
                     </el-table-column>
-                    <el-table-column label="操作" width="60" align="center" fixed="right" v-if="isEditList">
+                    <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>
                       </template>
@@ -239,17 +239,19 @@
               <template #default="{ row, $index }">
                 <div style="width:100%">
                   <div style="display:flex">
-                    <div class="el-click" style="writing-mode: vertical-rl" link @click="handleClickUploadOne($index)">
-                      {{row.isShowProductFile?'定制图稿':'取消定制'}}</div>
+                    <el-button type="primary" text link style="writing-mode: vertical-rl;margin-right:10px;" @click="handleClickUploadOne($index)">
+                      {{row.isShowProductFile?'定制图稿':'取消定制'}}
+                    </el-button>
                     <div>
                       <div v-if="row.isShowProductFile &&row.fileListOne && row.fileListOne.length > 0">
                         <span class="el-click" @click="onPicture(row.fileListOne[0].fileUrl)">{{row.fileListOne[0].fileName}}</span>
                       </div>
                       <div v-else>
-                        <el-upload action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" :data="uploadData" :limit="1"
-                                   :before-upload="(file)=>handleBeforeUploadOne(file,$index)" :on-success="()=>handleSuccessOne($index)"
-                                   :on-exceed="()=>msgTip(`上传文件数量不可大于1`, 2)">
-                          <span class="el-click" style="line-height:1">点击上传</span>
+                        <el-upload :file-list="row.prodFileList" action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" :data="uploadData"
+                                   :limit="1" :list-type="'text'" :before-upload="(file)=>handleBeforeUploadOne(file,$index)"
+                                   :on-success="()=>handleSuccessOne($index)" :on-remove="(file)=>handleRemoveFile(file,$index)"
+                                   :on-preview="onPreviewFile" :on-exceed="()=>msgTip(`上传文件数量不可大于1`, 2)">
+                          <el-button text type="primary">上传</el-button>
                         </el-upload>
                       </div>
                     </div>
@@ -943,11 +945,15 @@ const sellCorporationIdChange = (val) => {
         formData.data.sellProvinceName = res.provinceName;
         formData.data.sellCityName = res.cityName;
         formData.data.sellAddress = res.address;
+        formData.data.sellContactName = res.contactName;
+        formData.data.sellContactNumber = res.contactPhone;
       } else {
         formData.data.sellCountryName = res.countryEnStr;
         formData.data.sellProvinceName = res.provinceEnStr;
         formData.data.sellCityName = res.cityEnStr;
         formData.data.sellAddress = res.addressEn;
+        formData.data.sellContactName = res.contactName;
+        formData.data.sellContactNumber = res.contactPhone;
       }
     });
   }
@@ -1306,10 +1312,12 @@ const handleBeforeUpload = async (file, index) => {
   return true;
 };
 
-const fileData = ref({});
 const handleBeforeUploadOne = async (file, index) => {
   const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  file.id = res.id;
+  file.fileUrl = res.fileUrl;
   uploadData.value = res.uploadBody;
+  formData.data.contractProductList[index].fileData = res;
   return true;
 };
 
@@ -1328,17 +1336,37 @@ const handleSuccess = (index) => {
 };
 
 const handleSuccessOne = (index) => {
-  if (fileData.value && fileData.value.fileUrl) {
+  if (
+    formData.data.contractProductList[index].fileData &&
+    formData.data.contractProductList[index].fileData.fileUrl
+  ) {
+    let file = formData.data.contractProductList[index].fileData;
     formData.data.contractProductList[index].prodFileList.push({
-      id: fileData.value.id,
-      fileName: fileData.value.fileName,
-      name: fileData.value.fileName,
-      url: fileData.value.fileUrl,
-      fileUrl: fileData.value.fileUrl,
+      id: file.id,
+      fileName: file.fileName,
+      name: file.fileName,
+      url: file.fileUrl,
+      fileUrl: file.fileUrl,
     });
+    formData.data.contractProductList[index].fileData = {};
   }
 };
 
+const handleRemoveFile = (file, index) => {
+  let sonIndex = formData.data.contractProductList[
+    index
+  ].prodFileList.findIndex((x) => x.id == file.id || x.id == file.raw.id);
+  if (sonIndex > -1) {
+    formData.data.contractProductList[index].prodFileList.splice(sonIndex, 1);
+  }
+};
+const onPreviewFile = (file) => {
+  if (file && file.fileUrl) {
+    window.open(file.fileUrl, "_blank");
+  } else {
+    window.open(file.raw.fileUrl, "_blank");
+  }
+};
 const loadingSearch = ref(false);
 const remoteMethod = (keyword) => {
   if (keyword && typeof keyword === "string") {
@@ -1442,6 +1470,7 @@ const handleClickUploadOne = (index) => {
     !formData.data.contractProductList[index].isShowProductFile;
   if (formData.data.contractProductList[index].isShowProductFile) {
     formData.data.contractProductList[index].prodFileList = [];
+    formData.data.contractProductList[index].fileData = {};
   }
 };
 
@@ -1463,13 +1492,42 @@ const getAllData = (businessId) => {
     ) {
       getFileData();
       let ids = formData.data.contractProductList.map((x) => x.id);
-      proxy.getFile(
-        ids,
-        formData.data.contractProductList,
-        "id",
-        "fileList",
-        "imageUrl"
-      );
+      // proxy.getFile(
+      //   ids,
+      //   formData.data.contractProductList,
+      //   "id",
+      //   "fileList",
+      //   "imageUrl"
+      // );
+      proxy
+        .post("/fileInfo/getList", { businessIdList: ids })
+        .then((fileObj) => {
+          for (let i = 0; i < formData.data.contractProductList.length; i++) {
+            const ele = formData.data.contractProductList[i];
+            for (const key in fileObj) {
+              if (
+                ele.id == key &&
+                fileObj[ele.id] &&
+                fileObj[ele.id].length > 0
+              ) {
+                ele.fileListOne = fileObj[ele.id].filter(
+                  (x) => x.businessType == "0"
+                );
+                if (ele.fileListOne && ele.fileListOne.length > 0) {
+                  ele.imageUrl = ele.fileListOne[0].fileUrl;
+                }
+                ele.prodFileList = fileObj[ele.id]
+                  .filter((x) => x.businessType == "1")
+                  .map((x) => ({ ...x, name: x.fileName, url: x.fileUrl }));
+                if (ele.prodFileList && ele.prodFileList.length > 0) {
+                  ele.isShowProductFile = false;
+                } else {
+                  ele.isShowProductFile = true;
+                }
+              }
+            }
+          }
+        });
       changeProductPrice();
     }
     if (formData.data.countryId) {
@@ -1705,4 +1763,7 @@ const clickCopy = (type) => {
 :deep(.el-upload-list--text .el-upload-list__item) {
   min-width: 150px !important;
 }
+:deep(.bom-table .el-table__body-wrapper .el-table__body .el-table__row) {
+  background: #fbfbfb !important;
+}
 </style>

+ 3 - 0
src/components/process/SF/Purchase.vue

@@ -719,6 +719,8 @@ const buyCorporationIdChange = (val) => {
       formData.data.buyProvinceName = res.provinceName;
       formData.data.buyCityName = res.cityName;
       formData.data.buyAddress = res.address;
+      formData.data.buyContactName = res.contactName;
+      formData.data.buyContactNumber = res.contactPhone;
       changeAddress();
     });
   }
@@ -739,6 +741,7 @@ const changeSupplier = (val) => {
       formData.data.provinceId = data[0].provinceId;
       formData.data.cityId = data[0].cityId;
       formData.data.sellAddress = data[0].areaDetail;
+      formData.data.sellPostalCode = data[0].postalCode;
       formData.data.sellContactName = data[0].contactPerson;
       formData.data.sellContactNumber = data[0].contactNumber;
       if (formData.data.countryId) {

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

@@ -59,14 +59,12 @@
               <span style="color:#409eff;cursor:pointer" @click="handleClickUpload('prodFilePath',true)"
                     v-if="!formData.data.prodFilePath">点击上传</span>
               <span style="color:#409eff;cursor:pointer" @click="handleClickUpload('prodFilePath',false)" v-else>点击查看</span>
-
             </div>
           </template>
           <template #productionFileOne>
             <div style="width: 100%">
-              <span style="color:#409eff;cursor:pointer" @click="handleClickUpload('prodImgPath',true)" v-if="!formData.data.prodImgPath">点击上传</span>
-              <span style="color:#409eff;cursor:pointer" @click="handleClickUpload('prodImgPath',false)" v-else>点击查看</span>
-
+              <el-button type="primary" plain @click="handleClickUpload('prodImgPath',true)" v-if="!formData.data.prodImgPath">点击上传</el-button>
+              <el-button type="primary" plain @click="handleClickUpload('prodImgPath',false)" v-else>点击查看</el-button>
             </div>
           </template>
           <template #size>

+ 8 - 1
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -416,6 +416,13 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "下发生产时间",
+        prop: "orderDistributeTime",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
         label: "客户名称",
         slot: "buyCorporationName",
         "min-width": 180,
@@ -510,7 +517,7 @@ const config = computed(() => {
       attrs: {
         label: "生产指示",
         slot: "prodTag",
-        "min-width": 200,
+        "min-width": 240,
       },
     },
     {

+ 18 - 1
src/views/EHSD/saleContract/performanceSet/index.vue

@@ -7,7 +7,8 @@
         <template v-for="(month, index) in attrData" v-slot:[month]="{ item }" :key="month">
           <div style="width:100%">
             <el-input-number v-model="item[month]" :placeholder="''+monthData[index]+'月绩效'" onmousewheel="return false;" :precision="2"
-                             :controls="false" :min="0" @change="(val)=>handleChangeVal(item,month,val)" style="width:100%">
+                             :controls="false" :min="0" @change="(val)=>handleChangeVal(item,month,val)" :disabled="getIsDisabled(index)"
+                             style="width:100%">
             </el-input-number>
           </div>
         </template>
@@ -202,6 +203,7 @@ const flitterData = (arr) => {
 const handleChangeVal = (item, month, val) => {
   if (val) {
     const data = {
+      ...item,
       id: item.id,
       deptId: item.deptId,
       groupId: item.groupId,
@@ -214,6 +216,21 @@ const handleChangeVal = (item, month, val) => {
     });
   }
 };
+
+let date = new Date();
+const getIsDisabled = (index) => {
+  let currentMonth = monthData.value[index];
+  let year = sourceList.value.pagination.years;
+  let nowYear = date.getFullYear();
+  let nowMonth = date.getMonth() + 1;
+  if (Number(year) < nowYear) {
+    return true;
+  } else if (Number(year) == nowYear && Number(currentMonth) < nowMonth) {
+    return true;
+  } else {
+    return false;
+  }
+};
 </script>
 
 <style lang="scss" scoped>

+ 41 - 1
src/views/MES/productionOrder/index.vue

@@ -193,7 +193,17 @@
               </el-table-column>
               <el-table-column label="生产源文件" width="140">
                 <template #default="{ row, $index }">
-                  <span class="el-click" v-if="row.prodFilePath" @click="handleClickUpload('prodFilePath',false,$index)">点击上传 (查看)</span>
+                  <div style="width:100%">
+                    <div v-if="row.isShowProductFile &&row.fileListOne && row.fileListOne.length > 0">
+                      <span class="el-click" @click="onPicture(row.fileListOne[0].fileUrl)">{{row.fileListOne[0].fileName}}</span>
+                    </div>
+                    <div v-else>
+                      <div v-if="row.prodFileList && row.prodFileList.length > 0">
+                        <span class="el-click" @click="onPicture(row.prodFileList[0].fileUrl)">{{row.prodFileList[0].fileName}}</span>
+                      </div>
+                    </div>
+                  </div>
+
                 </template>
               </el-table-column>
               <el-table-column label="数量" width="150" prop="quantity" />
@@ -712,6 +722,36 @@ const lookDetails = (item) => {
       formData.orderData.contractProductList.length > 0
     ) {
       getFileData();
+      let ids = formData.data.contractProductList.map((x) => x.id);
+      proxy
+        .post("/fileInfo/getList", { businessIdList: ids })
+        .then((fileObj) => {
+          for (let i = 0; i < formData.data.contractProductList.length; i++) {
+            const ele = formData.data.contractProductList[i];
+            for (const key in fileObj) {
+              if (
+                ele.id == key &&
+                fileObj[ele.id] &&
+                fileObj[ele.id].length > 0
+              ) {
+                ele.fileListOne = fileObj[ele.id].filter(
+                  (x) => x.businessType == "0"
+                );
+                if (ele.fileListOne && ele.fileListOne.length > 0) {
+                  ele.imageUrl = ele.fileListOne[0].fileUrl;
+                }
+                ele.prodFileList = fileObj[ele.id]
+                  .filter((x) => x.businessType == "1")
+                  .map((x) => ({ ...x, name: x.fileName, url: x.fileUrl }));
+                if (ele.prodFileList && ele.prodFileList.length > 0) {
+                  ele.isShowProductFile = false;
+                } else {
+                  ele.isShowProductFile = true;
+                }
+              }
+            }
+          }
+        });
     }
   });
 };

+ 70 - 29
src/views/MES/productionTask/index.vue

@@ -5,7 +5,7 @@
                :selectConfig="selectConfig" :action-list="[ {
                 text: '打印二维码',
                 action: () => openModal('add'),
-                disabled: printList.length==0,
+                disabled: selectIds.length==0,
               } 
               
         ]" :table-events="{
@@ -175,10 +175,14 @@
                   <div>
                     <table border class="table son">
                       <tr>
-                        <td style="width:60%">名称</td>
-                        <td style="width:20%">单量</td>
-                        <td style="width:20%">总量</td>
-
+                        <td style="width:70%">名称</td>
+                        <td style="width:15%">单价</td>
+                        <td style="width:15%">总量</td>
+                      </tr>
+                      <tr v-for="son in item.contractProductBomList" :key="son.id">
+                        <td>{{son.productName}}</td>
+                        <td>{{son.price}}</td>
+                        <td>{{son.quantity}}</td>
                       </tr>
                     </table>
                   </div>
@@ -439,38 +443,75 @@ const getList = async (req) => {
       const productIdListOne = res.rows.map((x) => x.contractDetailId);
       // 请求文件数据并回显
       if (productIdListOne.length > 0) {
-        proxy.getFile(
-          productIdListOne,
-          sourceList.value.data,
-          "contractDetailId",
-          "fileListOne"
-        );
+        proxy
+          .post("/fileInfo/getList", { businessIdList: productIdListOne })
+          .then((fileObj) => {
+            for (let i = 0; i < sourceList.value.data.length; i++) {
+              const ele = sourceList.value.data[i];
+              for (const key in fileObj) {
+                if (
+                  ele.contractDetailId == key &&
+                  fileObj[ele.contractDetailId] &&
+                  fileObj[ele.contractDetailId].length > 0
+                ) {
+                  ele.fileListOne = fileObj[ele.contractDetailId].filter(
+                    (x) => x.businessType == "0"
+                  );
+                }
+              }
+            }
+          });
+        // proxy.getFile(
+        //   productIdListOne,
+        //   sourceList.value.data,
+        //   "contractDetailId",
+        //   "fileListOne"
+        // );
       }
     });
 };
 
 const printList = ref([]);
+
+const selectIds = ref([]);
 const selectRow = (data) => {
-  printList.value = data;
+  selectIds.value = data.map((x) => x.id);
 };
 const printTime = ref("");
 const openModal = () => {
-  printTime.value = moment().format("yyyy-MM-DD HH:mm:ss");
-  dialogVisible.value = true;
-  nextTick(() => {
-    for (let i = 0; i < printList.value.length; i++) {
-      const row = printList.value[i];
-      proxy.$refs[row.id][0].innerHTML = ""; //清除二维码方法一
-      new QRCode(proxy.$refs[row.id][0], {
-        text: row.id,
-        width: 200,
-        height: 200,
-        colorDark: "#000000",
-        colorLight: "#ffffff",
-        correctLevel: QRCode.CorrectLevel.H,
+  proxy.msgTip("请稍后", 2);
+  proxy
+    .post("/produceOrderDetail/detailByIds", { taskIds: selectIds.value })
+    .then((res) => {
+      printList.value = res;
+      for (let i = 0; i < printList.value.length; i++) {
+        const iele = printList.value[i];
+        for (let j = 0; j < sourceList.value.data.length; j++) {
+          const jele = sourceList.value.data[j];
+          if (iele.id == jele.id) {
+            iele.fileList = jele.fileList;
+            iele.fileListOne = jele.fileListOne;
+            break;
+          }
+        }
+      }
+      printTime.value = moment().format("yyyy-MM-DD HH:mm:ss");
+      dialogVisible.value = true;
+      nextTick(() => {
+        for (let i = 0; i < printList.value.length; i++) {
+          const row = printList.value[i];
+          proxy.$refs[row.id][0].innerHTML = ""; //清除二维码方法一
+          new QRCode(proxy.$refs[row.id][0], {
+            text: row.id,
+            width: 200,
+            height: 200,
+            colorDark: "#000000",
+            colorLight: "#ffffff",
+            correctLevel: QRCode.CorrectLevel.H,
+          });
+        }
       });
-    }
-  });
+    });
 };
 
 const submitForm = () => {
@@ -548,12 +589,12 @@ const printType = ref(false);
 
 const printQrCode = (row) => {
   printType.value = true;
-  printList.value = [row];
+  selectIds.value = [row.id];
   openModal();
 };
 const beforeClose = () => {
   if (printType.value) {
-    printList.value = [];
+    selectIds.value = [];
   }
   dialogVisible.value = false;
 };

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

@@ -196,7 +196,7 @@
       </el-tabs>
     </div>
 
-    <el-dialog title="下一处理人" width="400" v-model="dialogVisible" v-if="dialogVisible" :show-close="false" :close-on-click-modal="false"
+    <el-dialog title="下一处理人" width="400" v-model="dialogVisible" v-if="dialogVisible" :show-close="true" :close-on-click-modal="false"
                :close-on-press-escape="false">
       <el-form :model="flowForm">
         <el-form-item prop="remark" label="处理人">

+ 13 - 0
src/views/publicModule/companyConfig/index.vue

@@ -231,6 +231,7 @@ const config = computed(() => {
         label: "营业期限",
       },
     },
+
     {
       attrs: {
         label: "纳税人资质",
@@ -368,6 +369,18 @@ const formConfig = computed(() => {
       label: "营业期限",
     },
     {
+      type: "input",
+      prop: "contactName",
+      label: "联系人名称",
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      prop: "contactPhone",
+      label: "联系人电话",
+      itemWidth: 50,
+    },
+    {
       type: "slot",
       slotName: "allAddress",
       label: "公司地址",

+ 8 - 6
src/views/purchaseManage/supplier/supplier/index.vue

@@ -283,6 +283,12 @@ const formConfig = computed(() => {
       label: "地址",
     },
     {
+      type: "input",
+      label: "邮编",
+      prop: "postalCode",
+      itemType: "text",
+    },
+    {
       type: "slot",
       slotName: "contact",
       prop: "",
@@ -300,12 +306,6 @@ const formConfig = computed(() => {
       itemType: "text",
     },
     {
-      type: "input",
-      label: "邮编字段",
-      prop: "postalCode",
-      itemType: "text",
-    },
-    {
       type: "upload",
       listType: "text",
       accept: "",
@@ -419,6 +419,8 @@ const getDtl = (row) => {
               url: item.fileUrl,
             };
           });
+        } else {
+          formData.data.fileList = [];
         }
       });
   });