cz 1 år sedan
förälder
incheckning
026e7de5c1

+ 22 - 10
src/components/WDLY/process/SendPurchaseWDLY.vue

@@ -144,12 +144,12 @@
                 :inline-message="true"
               >
                 <el-input-number
-                  v-model="row.count"
+                  :value="formData.data.purchaseDetailList[$index].count"
                   :precision="4"
                   :controls="false"
                   :min="0"
                   onmousewheel="return false;"
-                  @change="handleChangeAmount"
+                  @change="(val) => handleChangeMoney(val, $index, 'count')"
                 />
               </el-form-item>
             </template>
@@ -162,12 +162,12 @@
                 :inline-message="true"
               >
                 <el-input-number
-                  v-model="row.price"
+                  :value="formData.data.purchaseDetailList[$index].price"
                   :precision="4"
                   :controls="false"
                   :min="0"
                   onmousewheel="return false;"
-                  @change="handleChangeAmount"
+                  @change="(val) => handleChangeMoney(val, $index, 'price')"
                 />
               </el-form-item>
             </template>
@@ -246,8 +246,8 @@
               :min="0"
               :controls="false"
               onmousewheel="return false;"
-              @change="handleChangeAmount"
               style="width: 100%"
+              @change="handleChangeAmount"
             />
           </el-form-item>
         </el-col>
@@ -258,8 +258,8 @@
               :precision="4"
               :controls="false"
               onmousewheel="return false;"
-              @change="handleChangeAmount"
               style="width: 100%"
+              @change="handleChangeAmount"
             />
           </el-form-item>
         </el-col>
@@ -589,16 +589,15 @@ const handleChangeSupplier = (val) => {
           e.price = 0;
         }
       }
-      handleChangeAmount();
+      handleChangeMoney();
     });
 };
 // 计算采购总金额
-const handleChangeAmount = async () => {
-  await nextTick();
+const handleChangeAmount = () => {
   let sum = 0;
   for (let i = 0; i < formData.data.purchaseDetailList.length; i++) {
     const e = formData.data.purchaseDetailList[i];
-    e.amount = parseFloat(e.count * e.price).toFixed(4);
+    // e.amount = parseFloat(e.count * e.price).toFixed(4);
     sum += Number(e.amount);
   }
   for (let i = 0; i < formData.data.otherFeeList.length; i++) {
@@ -610,6 +609,19 @@ const handleChangeAmount = async () => {
   formData.data.amount = parseFloat(sum).toFixed(4);
 };
 
+const handleChangeMoney = (val, index, key) => {
+  if (val) {
+    formData.data.purchaseDetailList[index][key] = val;
+  }
+  for (let i = 0; i < formData.data.purchaseDetailList.length; i++) {
+    formData.data.purchaseDetailList[i].amount = parseFloat(
+      formData.data.purchaseDetailList[i].count *
+        formData.data.purchaseDetailList[i].price
+    ).toFixed(4);
+  }
+  handleChangeAmount();
+};
+
 const productUnit = ref([]);
 const getDict = () => {
   proxy.getDictOne(["unit"]).then((res) => {

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

@@ -164,7 +164,7 @@ const rowClick = (row) => {
 
 const toDealWith = (item) => {
   let urlConfig = {
-    0: "DealWith",
+    0: "Backlog",
     5: "Claim",
     6: "Abnormal",
     hisMsg: "HisMsg",

+ 18 - 30
src/utils/request.js

@@ -152,37 +152,25 @@ service.interceptors.response.use(res => {
   }
 )
 // 通用下载方法
-export function download(url, params, filename, config) {
-  downloadLoadingInstance = ElLoading.service({
-    text: "正在下载数据,请稍候",
-    background: "rgba(0, 0, 0, 0.7)",
-  })
-  return service.post(url, params, {
-    transformRequest: [(params) => {
-      return tansParams(params)
-    }],
-    headers: {
-      'Content-Type': 'application/x-www-form-urlencoded'
-    },
-    responseType: 'blob',
-    ...config
-  }).then(async (data) => {
-    const isLogin = await blobValidate(data);
-    if (isLogin) {
-      const blob = new Blob([data])
-      saveAs(blob, filename)
-    } else {
-      const resText = await data.text();
-      const rspObj = JSON.parse(resText);
-      const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
-      ElMessage.error(errMsg);
+export function download(fileUrl, fileName) {
+  let xhr = new XMLHttpRequest();
+  //域名是华为云的
+  xhr.open("GET", `${fileUrl}`, true);
+  xhr.responseType = "blob";
+  xhr.send();
+  xhr.onreadystatechange = function () {
+    if (xhr.readyState === 4 && xhr.status === 200) {
+      let url = window.URL.createObjectURL(xhr.response);
+      const a = document.createElement("a");
+      a.href = url;
+      a.download = fileName; // 下载后文件名
+      a.style.display = "none";
+      document.body.appendChild(a);
+      a.click(); // 点击下载
+      window.URL.revokeObjectURL(a.href);
+      document.body.removeChild(a); // 下载完成移除元素
     }
-    downloadLoadingInstance.close();
-  }).catch((r) => {
-    console.error(r)
-    ElMessage.error('下载文件出现错误,请联系管理员!')
-    downloadLoadingInstance.close();
-  })
+  };
 }
 
 

+ 32 - 2
src/views/WDLY/outInBound/waitOutBound/index.vue

@@ -340,8 +340,9 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: "100",
-        align: "right",
+        width: "120",
+        align: "center",
+        fixed: "right",
       },
       // 渲染 el-button,一般用在最后一列。
       renderHTML(row) {
@@ -360,6 +361,35 @@ const config = computed(() => {
                 },
               }
             : {},
+          // {
+          //   attrs: {
+          //     label: "结束",
+          //     type: "primary",
+          //     text: true,
+          //     disabled: false,
+          //   },
+          //   el: "button",
+          //   click() {
+          //     ElMessageBox.confirm(`您确定执行此操作吗?`, "提示", {
+          //       confirmButtonText: "确定",
+          //       cancelButtonText: "取消",
+          //       type: "warning",
+          //     }).then(() => {
+          //       // 删除
+          //       proxy
+          //         .post("/orderInfo/edit", {
+          //           id: row.id,
+          //         })
+          //         .then((res) => {
+          //           ElMessage({
+          //             message: "操作成功",
+          //             type: "success",
+          //           });
+          //           getList();
+          //         });
+          //     });
+          //   },
+          // },
         ];
       },
     },

+ 104 - 31
src/views/WDLY/purchaseManage/arrival/index.vue

@@ -29,10 +29,21 @@
             {{ item.fileName }}
           </div>
         </template>
+        <template #qualityStatus="{ item }">
+          <div
+            :style="{
+              cursor: item.qualityStatus > 0 ? 'pointer' : 'inherit',
+              color: item.qualityStatus > 0 ? '#409eff' : '',
+            }"
+            @click="item.qualityStatus > 0 ? getDtlOne(item) : () => {}"
+          >
+            {{ dictValueLabel(item.qualityStatus, qualityStatusData) }}
+          </div>
+        </template>
       </byTable>
     </div>
     <el-dialog
-      title="到货质检"
+      :title="modalType == 'add' ? '到货质检' : '质检详情'"
       v-model="dialogVisible"
       width="80%"
       v-loading="submitLoading"
@@ -131,11 +142,48 @@
           @click="submitForm()"
           size="large"
           :loading="submitLoading"
+          v-if="modalType == 'add'"
         >
           确 定
         </el-button>
       </template>
     </el-dialog>
+
+    <el-dialog
+      :title="'质检记录'"
+      v-model="dialogVisibleOne"
+      width="600"
+      destroy-on-close
+    >
+      <byForm
+        :formConfig="formConfigOne"
+        :formOption="formOptionOne"
+        v-model="formData.dataOne"
+        :rules="rules"
+        ref="byformOne"
+      >
+        <template #products>
+          <div style="width: 100%">
+            <el-table :data="formData.dataOne.qualityDetailsList">
+              <el-table-column prop="createTime" label="质检时间" width="155" />
+              <el-table-column prop="qualityUserName" label="质检人" />
+              <el-table-column label="操作" width="100" align="center">
+                <template #default="{ row, $index }">
+                  <el-button type="primary" text @click="getDtl(row)"
+                    >查看</el-button
+                  >
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisibleOne = false" size="large"
+          >取 消</el-button
+        >
+      </template>
+    </el-dialog>
   </div>
 </template>
   
@@ -168,6 +216,7 @@ const qualityStatusData = [
   },
 ];
 let dialogVisible = ref(false);
+let dialogVisibleOne = ref(false);
 let modalType = ref("add");
 let rules = ref({
   qualifiedQuantity: [
@@ -234,11 +283,12 @@ const config = computed(() => {
       attrs: {
         label: "质检状态",
         prop: "qualityStatus",
+        slot: "qualityStatus",
       },
-      render(status) {
-        const current = qualityStatusData.find((x) => x.value == status);
-        if (current) return current.label;
-      },
+      // render(status) {
+      //   const current = qualityStatusData.find((x) => x.value == status);
+      //   if (current) return current.label;
+      // },
     },
     {
       attrs: {
@@ -271,13 +321,25 @@ const config = computed(() => {
 
 let formData = reactive({
   data: {},
+  dataOne: {
+    qualityDetailsList: [],
+  },
 });
 const formOption = reactive({
+  disabled: false,
   inline: true,
   labelWidth: 100,
   itemWidth: 100,
   rules: [],
 });
+const formOptionOne = reactive({
+  disabled: false,
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+
 const formConfig = reactive([
   {
     type: "title",
@@ -315,6 +377,17 @@ const formConfig = reactive([
   },
 ]);
 
+const formConfigOne = reactive([
+  {
+    type: "title",
+    title: "质检记录",
+  },
+  {
+    type: "slot",
+    slotName: "products",
+  },
+]);
+
 const byform = ref(null);
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
@@ -378,14 +451,34 @@ const submitForm = () => {
     );
   });
 };
-
+// 质检详情
 const getDtl = (row) => {
+  formOption.disabled = true;
   modalType.value = "edit";
   dialogVisible.value = true;
-  // proxy.post("/productionProcesses/detail", { id: row.id }).then((res) => {
-  //   formData.data = res;
-  //   dialogVisible.value = true;
-  // });
+  proxy.post("/qualityInfo/detail", { id: row.id }).then((res) => {
+    formData.data = {
+      supplyName: rowData.value.supplyName,
+      logisticsCompanyName: rowData.value.logisticsCompanyName,
+      logisticsCode: rowData.value.logisticsCode,
+      qualityDetailsList: res.qualityDetailsList.map((x) => ({
+        ...x,
+        quantity: x.arrivalQuantity,
+      })),
+    };
+    dialogVisible.value = true;
+  });
+};
+// 质检记录
+const rowData = ref({});
+const getDtlOne = (row) => {
+  rowData.value = row;
+  dialogVisibleOne.value = true;
+  proxy
+    .post("/qualityInfo/getList", { arrivalStockRecordsId: row.id })
+    .then((res) => {
+      formData.dataOne.qualityDetailsList = res;
+    });
 };
 
 getList();
@@ -408,6 +501,7 @@ const selectRow = (data) => {
 };
 
 const start = (type) => {
+  formOption.disabled = false;
   modalType.value = "add";
   let ids = [];
   let row = {};
@@ -434,27 +528,6 @@ const start = (type) => {
     dialogVisible.value = true;
   });
 };
-
-// watch(selectData, (newVal, oldVal) => {
-//   if (newVal.length == 0) {
-//     sourceList.value.data.forEach((x) => {
-//       if (x.status < 20) {
-//         x.isCheck = true;
-//       } else {
-//         x.isCheck = false;
-//       }
-//     });
-//   } else if (newVal.length == 1) {
-//     const current = newVal[0];
-//     sourceList.value.data.forEach((x) => {
-//       if (x.arrivalId !== current.arrivalId || x.status == 20) {
-//         x.isCheck = false;
-//       }
-//     });
-//   }
-// });
-
-onMounted(() => {});
 </script>
   
 <style lang="scss" scoped>

+ 87 - 17
src/views/WDLY/salesMange/order/index.vue

@@ -29,6 +29,12 @@
             {{ item.code }}
           </div>
         </template>
+        <template #status="{ item }">
+          <div style="cursor: pointer; color: #409eff">
+            <!-- @click="handleClickStatus(item)" -->
+            {{ dictValueLabel(item.status, statusData) }}
+          </div>
+        </template>
         <template #address="{ item }">
           <div>
             {{ item.countryName }}, {{ item.provinceName }} ,
@@ -215,6 +221,44 @@
         </span>
       </template>
     </el-dialog>
+
+    <el-dialog
+      :title="'查看'"
+      v-model="recordDialog"
+      width="800"
+      destroy-on-close
+    >
+      <byForm
+        :formConfig="recordFormConfig"
+        :formOption="recordFormOption"
+        v-model="recordFormData.data"
+      >
+        <template #products>
+          <div style="width: 100%">
+            <el-table :data="recordFormData.data.list">
+              <el-table-column
+                prop="物流/快递公司"
+                label="物流/快递公司"
+                width="155"
+              />
+              <el-table-column prop="qualityUserName" label="物流/快递单号" />
+              <el-table-column prop="qualityUserName" label="物流状态" />
+              <el-table-column prop="qualityUserName" label="创建时间" />
+              <el-table-column label="操作" width="100" align="center">
+                <template #default="{ row, $index }">
+                  <el-button type="primary" text @click="pushRoute(row)"
+                    >查看</el-button
+                  >
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="recordDialog = false" size="large">取 消</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
   
@@ -319,6 +363,20 @@ let rules = ref({
   ],
 });
 const { proxy } = getCurrentInstance();
+const statusData = [
+  {
+    label: "进行中",
+    value: "1",
+  },
+  {
+    label: "已完成",
+    value: "2",
+  },
+  {
+    label: "已取消",
+    value: "3",
+  },
+];
 const selectConfig = reactive([
   {
     label: "订单类型",
@@ -328,20 +386,7 @@ const selectConfig = reactive([
   {
     label: "订单状态",
     prop: "status",
-    data: [
-      {
-        label: "进行中",
-        value: "1",
-      },
-      {
-        label: "已完成",
-        value: "2",
-      },
-      {
-        label: "已取消",
-        value: "3",
-      },
-    ],
+    data: statusData,
   },
 ]);
 
@@ -407,9 +452,7 @@ const config = computed(() => {
       attrs: {
         label: "订单状态",
         prop: "status",
-      },
-      render(status) {
-        return status == 1 ? "进行中" : status == 2 ? "已完成" : "已取消";
+        slot: "status",
       },
     },
 
@@ -720,6 +763,33 @@ const handleClickCode = (row) => {
   formData.orderData = row;
   openDetails.value = true;
 };
+
+const recordDialog = ref(false);
+const recordFormOption = reactive({
+  disabled: false,
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const recordFormConfig = reactive([
+  {
+    type: "title",
+    title: "物流数据",
+  },
+  {
+    type: "slot",
+    slotName: "products",
+  },
+]);
+const recordFormData = reactive({
+  data: {
+    list: [],
+  },
+});
+const handleClickStatus = (row) => {
+  recordDialog.value = true;
+};
 </script>
   
 <style lang="scss" scoped>

+ 85 - 3
src/views/process/processApproval/index.vue

@@ -92,6 +92,19 @@
             >
             </el-input>
           </el-form-item>
+          <el-form-item label-width="80px" label="附件上传">
+            <el-upload
+              v-model:fileList="flowForm.fileList"
+              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+              :data="uploadData"
+              multiple
+              :before-upload="uploadFile"
+              :on-success="handleSuccess"
+              :on-preview="onPreviewFile"
+            >
+              <el-button>选择</el-button>
+            </el-upload>
+          </el-form-item>
           <el-form-item>
             <el-button
               type="primary"
@@ -143,6 +156,17 @@
                     }}<span class="time">{{ item.processedDate }}</span>
                   </div>
                   {{ item.remark }}
+                  <div
+                    v-for="j in fileObj[item.flowExampleDetailId]"
+                    v-if="fileObj[item.flowExampleDetailId]"
+                  >
+                    <!-- :href="j.fileUrl" -->
+                    <a
+                      @click="proxy.download(j.fileUrl, j.fileName)"
+                      style="color: #409eff; line-height: 30px"
+                      >{{ j.fileName }}</a
+                    >
+                  </div>
                 </div>
               </div>
               <div class="line"></div>
@@ -237,7 +261,9 @@ const flowForm = reactive({
   handleUserId: "",
   remark: "",
   data: {},
+  fileList: [],
 });
+const uploadData = ref({});
 const flowRules = reactive({
   // remark: [{ required: true, message: "请输入处理意见", trigger: "blur" }],
 });
@@ -427,6 +453,12 @@ const handleSubmit = async (_type) => {
               };
             });
           }
+          flowForm.fileList = flowForm.fileList.map((item) => {
+            return {
+              ...item,
+              ...item.raw,
+            };
+          });
           if (route.query.processType == 10) {
             proxy
               .post("/flowProcess/jump", {
@@ -536,7 +568,7 @@ const skipPage = () => {
       });
     } else if (flowForm.flowKey == "wdly_purchase") {
       router.replace({
-        path: "/oa/1/dealWith",
+        path: "/oa/1/backlog",
       });
     } else if (flowForm.flowKey == "wdly_apply_purchase") {
       router.replace({
@@ -550,6 +582,10 @@ let queryData = reactive({
 });
 // 记录
 const recordList = ref([]);
+const fileIds = ref([]);
+const fileObj = ref({});
+let isRevocation = ref(false);
+
 const approvalRecordData = ref({
   buttonInfoList: [],
 });
@@ -563,6 +599,24 @@ const getRecords = (_id) => {
         recordList.value = res.recordList;
         queryData.data.recordList = res.recordList;
         approvalRecordData.value = res;
+        fileIds.value = res.recordList.map((item) => {
+          return item.flowExampleDetailId;
+        });
+        for (let i = 0; i < res.recordList.length; i++) {
+          const element = res.recordList[i];
+          if (element.status == 2) {
+            // 2为审批中
+            if (element.processedUser === res.recordList[i - 1].processedUser) {
+              // 当前审批人和上一条审批人相同,开启撤回开关
+              isRevocation.value = true;
+            }
+          }
+        }
+        proxy
+          .post("fileInfo/getList", { businessIdList: fileIds.value })
+          .then((res2) => {
+            fileObj.value = res2;
+          });
       });
   } else {
     proxy
@@ -574,6 +628,21 @@ const getRecords = (_id) => {
       });
   }
 };
+const uploadFile = async (file) => {
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  uploadData.value = res.uploadBody;
+  file.id = res.id;
+  file.fileName = res.fileName;
+  file.fileUrl = res.fileUrl;
+  file.uploadState = true;
+  return true;
+};
+const handleSuccess = (any, UploadFile) => {
+  UploadFile.raw.uploadState = false;
+};
+const onPreviewFile = (file) => {
+  window.open(file.raw.fileUrl, "_blank");
+};
 onMounted(() => {
   //processType 10 为修改 20为查看
   if (route.query.processType == 10 || route.query.processType == 20) {
@@ -591,7 +660,19 @@ onMounted(() => {
   getRecords(route.query.id);
 });
 </script>
-
+<style>
+.el-upload-list {
+  float: left;
+  margin: 0 !important;
+}
+.el-upload-list li {
+  width: 100px;
+  margin-left: 10px;
+}
+.el-upload--text {
+  float: left;
+}
+</style>
 <style lang="scss" scoped>
 .processApproval {
   display: flex;
@@ -615,9 +696,10 @@ onMounted(() => {
     }
     .bottom {
       margin-top: 10px;
-      height: 170px;
+      height: 220px;
       background: #fff;
       padding: 20px 20px 0px 20px;
+      overflow: auto;
     }
   }
   .right-card {