Browse Source

待采购排序

cz 1 year ago
parent
commit
5b62a61ded

+ 5 - 0
src/components/WDLY/process/SendPurchaseWDLY.vue

@@ -148,6 +148,7 @@
                   :precision="4"
                   :precision="4"
                   :controls="false"
                   :controls="false"
                   :min="0"
                   :min="0"
+                  onmousewheel="return false;"
                   @change="handleChangeAmount"
                   @change="handleChangeAmount"
                 />
                 />
               </el-form-item>
               </el-form-item>
@@ -165,6 +166,7 @@
                   :precision="4"
                   :precision="4"
                   :controls="false"
                   :controls="false"
                   :min="0"
                   :min="0"
+                  onmousewheel="return false;"
                   @change="handleChangeAmount"
                   @change="handleChangeAmount"
                 />
                 />
               </el-form-item>
               </el-form-item>
@@ -208,6 +210,7 @@
                   v-model="row.price"
                   v-model="row.price"
                   :precision="4"
                   :precision="4"
                   :controls="false"
                   :controls="false"
+                  onmousewheel="return false;"
                   @change="handleChangeAmount"
                   @change="handleChangeAmount"
                 />
                 />
               </el-form-item>
               </el-form-item>
@@ -242,6 +245,7 @@
               :precision="4"
               :precision="4"
               :min="0"
               :min="0"
               :controls="false"
               :controls="false"
+              onmousewheel="return false;"
               @change="handleChangeAmount"
               @change="handleChangeAmount"
               style="width: 100%"
               style="width: 100%"
             />
             />
@@ -253,6 +257,7 @@
               v-model="formData.data.preferential"
               v-model="formData.data.preferential"
               :precision="4"
               :precision="4"
               :controls="false"
               :controls="false"
+              onmousewheel="return false;"
               @change="handleChangeAmount"
               @change="handleChangeAmount"
               style="width: 100%"
               style="width: 100%"
             />
             />

+ 37 - 1
src/views/WDLY/purchaseManage/purchase/index.vue

@@ -12,6 +12,7 @@
         :table-events="{
         :table-events="{
           //element talbe事件都能传
           //element talbe事件都能传
           select: selectRow,
           select: selectRow,
+          'sort-change': sortChange,
         }"
         }"
         :action-list="[
         :action-list="[
           {
           {
@@ -66,6 +67,8 @@ const sourceList = ref({
     pageNum: 1,
     pageNum: 1,
     pageSize: 10,
     pageSize: 10,
     status: "15,30",
     status: "15,30",
+    subscribeTimeSort: "",
+    productNameSort: "",
   },
   },
 });
 });
 const dialogVisible = ref(false);
 const dialogVisible = ref(false);
@@ -156,6 +159,7 @@ const config = computed(() => {
         label: "物品名称",
         label: "物品名称",
         prop: "productName",
         prop: "productName",
         "min-width": 150,
         "min-width": 150,
+        sortable: "custom",
       },
       },
     },
     },
     {
     {
@@ -225,6 +229,7 @@ const config = computed(() => {
         label: "申购时间",
         label: "申购时间",
         prop: "subcribeTime",
         prop: "subcribeTime",
         width: 155,
         width: 155,
+        sortable: "custom",
       },
       },
     },
     },
     {
     {
@@ -402,7 +407,38 @@ const getDict = () => {
   // getDeptList();
   // getDeptList();
 };
 };
 getDict();
 getDict();
-getList();
+
+const sortChange = ({ column, prop, order }) => {
+  sourceList.value.pagination.subscribeTimeSort = "";
+  sourceList.value.pagination.productNameSort = "";
+  let type = "";
+  if (order === "ascending") {
+    // 升序
+    type = "1";
+  } else if (order === "descending") {
+    // 降序
+    type = "0";
+  } else {
+    // 默认
+  }
+  if (column.label === "物品名称") {
+    sourceList.value.pagination.productNameSort = type;
+  } else if (column.label === "申购时间") {
+    sourceList.value.pagination.subscribeTimeSort = type;
+  } else {
+    sourceList.value.pagination.subscribeTimeSort = "";
+    sourceList.value.pagination.productNameSort = "";
+  }
+  getList();
+};
+
+sortChange({
+  column: {
+    label: "申购时间",
+  },
+  order: "descending",
+  prop: undefined,
+});
 </script>
 </script>
   
   
 <style lang="scss" scoped>
 <style lang="scss" scoped>

+ 13 - 33
src/views/purchaseManage/supplier/supplyPrice/index.vue

@@ -82,6 +82,7 @@
                         :precision="4"
                         :precision="4"
                         :controls="false"
                         :controls="false"
                         :min="1"
                         :min="1"
+                        onmousewheel="return false;"
                       />
                       />
                     </el-form-item>
                     </el-form-item>
                   </template>
                   </template>
@@ -422,35 +423,9 @@ const submitForm = () => {
                     }
                     }
                   )
                   )
                     .then(() => {
                     .then(() => {
-                      const arr = [];
-                      for (
-                        let i = 0;
-                        i < formData.data.supplierPriceList.length;
-                        i++
-                      ) {
-                        const iele = formData.data.supplierPriceList[i];
-                        for (
-                          let j = 0;
-                          j < res.existSupplierPriceList.length;
-                          j++
-                        ) {
-                          const jele = res.existSupplierPriceList[j];
-                          if (iele.productInfoId === jele.productInfoId) {
-                            jele.price = iele.price;
-                            arr.push(jele);
-                          }
-                        }
-                      }
-                      formData.data.supplierPriceList = arr.map((x) => ({
-                        productInfoId: x.productInfoId,
-                        price: x.price,
-                      }));
-                      formData.data.renewWhileItExists = true;
+                      submitData.renewWhileItExists = true;
                       proxy
                       proxy
-                        .post(
-                          "/supplierPrice/" + modalType.value,
-                          formData.data
-                        )
+                        .post("/supplierPrice/" + modalType.value, submitData)
                         .then((res) => {
                         .then((res) => {
                           if (res.addSuccess) {
                           if (res.addSuccess) {
                             ElMessage({
                             ElMessage({
@@ -463,7 +438,9 @@ const submitForm = () => {
                           }
                           }
                         });
                         });
                     })
                     })
-                    .catch(() => {});
+                    .catch(() => {
+                      submitLoading.value = false;
+                    });
                 }
                 }
               },
               },
               (err) => {
               (err) => {
@@ -477,9 +454,8 @@ const submitForm = () => {
             formData.data.price = formData.data.supplierPriceList[0].price;
             formData.data.price = formData.data.supplierPriceList[0].price;
             delete formData.data.supplierPriceList;
             delete formData.data.supplierPriceList;
             delete formData.data.supplierInfoIdCopy;
             delete formData.data.supplierInfoIdCopy;
-            proxy
-              .post("/supplierPrice/" + modalType.value, formData.data)
-              .then((res) => {
+            proxy.post("/supplierPrice/" + modalType.value, formData.data).then(
+              (res) => {
                 ElMessage({
                 ElMessage({
                   message: "修改成功",
                   message: "修改成功",
                   type: "success",
                   type: "success",
@@ -487,7 +463,11 @@ const submitForm = () => {
                 getList();
                 getList();
                 dialogVisible.value = false;
                 dialogVisible.value = false;
                 submitLoading.value = false;
                 submitLoading.value = false;
-              });
+              },
+              (err) => {
+                submitLoading.value = false;
+              }
+            );
           }
           }
         }
         }
       });
       });