Browse Source

wdly需求

cz 1 year ago
parent
commit
74a44dab8a

+ 1 - 0
src/components/WDLY/process/SendSubscribeWDLY.vue

@@ -42,6 +42,7 @@
                     :precision="4"
                     :controls="false"
                     :min="0"
+                    onmousewheel="return false;"
                   />
                 </el-form-item>
               </template>

+ 12 - 11
src/components/byTable/index.vue

@@ -44,7 +44,7 @@
                 justify-content: center;
               "
             >
-              {{$t('common.all')}}
+              {{ $t("common.all") }}
             </li>
             <li
               v-for="j in i.data"
@@ -76,9 +76,11 @@
           style="margin-left: 10px"
           size="default"
           @click="searchFn"
-          >{{$t('common.search')}}</el-button
+          >{{ $t("common.search") }}</el-button
         >
-        <div class="more-icon" @click="retrievalModalFn"><img src="@/assets/images/iconm_xiangyzk.png" alt=""></div>
+        <div class="more-icon" @click="retrievalModalFn">
+          <img src="@/assets/images/iconm_xiangyzk.png" alt="" />
+        </div>
       </div>
     </div>
     <component :is="containerTag">
@@ -357,14 +359,13 @@ export default defineComponent({
       console.log(props);
       proxy.$emit(
         "getList",
-        Object.assign(props.filterParams, { [props.searchKey]: props.pagination.keyword })
+        Object.assign(props.filterParams, {
+          [props.searchKey]: props.pagination.keyword,
+        })
       );
-    }
+    };
     const retrievalModalFn = () => {
-      proxy.$emit(
-        "moreSearch",
-        ''
-      );
+      proxy.$emit("moreSearch", "");
     };
     const handlePageChange = (val) => {
       proxy.$emit(
@@ -448,7 +449,7 @@ export default defineComponent({
       selectConfigCopy,
       isSelectable,
       retrievalModal,
-      retrievalModalFn
+      retrievalModalFn,
     };
   },
 });
@@ -478,7 +479,7 @@ export default defineComponent({
   display: flex;
   justify-content: space-between;
   margin-bottom: 10px;
-  .more-icon{
+  .more-icon {
     float: right;
     cursor: pointer;
   }

+ 4 - 2
src/utils/request.js

@@ -30,8 +30,10 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
 const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分
   baseURL: import.meta.env.VITE_APP_BASE_API,
-  // 超时
-  timeout: 100000
+  // 超时 设置为100s
+  // timeout: 100000
+  timeout: 360000 //设置为6分钟
+
 })
 
 // request拦截器

+ 7 - 7
src/views/WDLY/purchaseManage/alreadyPurchase/index.vue

@@ -372,7 +372,6 @@
       :title="'采购退货'"
       v-model="dialogVisibleTwo"
       width="60%"
-      v-loading="loadingTwo"
       destroy-on-close
     >
       <byForm
@@ -381,6 +380,7 @@
         v-model="formData.dataTwo"
         :rules="rulesTwo"
         ref="byformTwo"
+        v-loading="loadingTwo"
       >
         <template #detailSlot>
           <div style="width: 100%">
@@ -1211,14 +1211,15 @@ const submitForm = () => {
 const submitFormTwo = () => {
   byformTwo.value.handleSubmit((valid) => {
     loadingTwo.value = true;
-    const list = formData.dataTwo.purchaseBackDetailsList;
-    formData.dataTwo.purchaseBackDetailsList =
-      formData.dataTwo.purchaseBackDetailsList.map((x) => ({
+    let submitData = { ...formData.dataTwo };
+    submitData.purchaseBackDetailsList = submitData.purchaseBackDetailsList.map(
+      (x) => ({
         purchaseDetailsId: x.id,
         productId: x.bussinessId,
         quantity: x.quantity,
-      }));
-    proxy.post("/purchaseBack/add", formData.dataTwo).then(
+      })
+    );
+    proxy.post("/purchaseBack/add", submitData).then(
       (res) => {
         ElMessage({
           message: `操作成功!`,
@@ -1229,7 +1230,6 @@ const submitFormTwo = () => {
         getList();
       },
       (err) => {
-        formData.dataTwo.purchaseBackDetailsList = list;
         loadingTwo.value = false;
       }
     );

+ 10 - 0
src/views/WDLY/purchaseManage/payment/index.vue

@@ -237,6 +237,9 @@ let rulesOne = ref({
   refundDate: [
     { required: true, message: "请选择退款时间", trigger: "change" },
   ],
+  refundAccount: [
+    { required: true, message: "请选择退款账号", trigger: "change" },
+  ],
   // remark: [{ required: true, message: "请输入备注", trigger: "blur" }],
 });
 const { proxy } = getCurrentInstance();
@@ -475,6 +478,13 @@ let formConfigOne = computed(() => [
     itemWidth: 100,
   },
   {
+    type: "select",
+    prop: "refundAccount",
+    label: "退款账号",
+    data: accountData.value,
+    itemWidth: 100,
+  },
+  {
     type: "number",
     prop: "amount",
     label: "退款金额",

+ 50 - 43
src/views/WDLY/stockManage/query/index.vue

@@ -23,7 +23,7 @@
         :selectConfig="selectConfig"
         :table-events="{
           //element talbe事件都能传
-          select: select,
+          'sort-change': sortChange,
         }"
         :action-list="[]"
         @get-list="getList"
@@ -39,7 +39,7 @@
         :selectConfig="selectConfig"
         :table-events="{
           //element talbe事件都能传
-          select: select,
+          'sort-change': sortChange,
         }"
         :action-list="[]"
         @get-list="getList"
@@ -93,6 +93,10 @@ const sourceList = ref({
     total: 3,
     pageNum: 1,
     pageSize: 10,
+    quantitySort: "",
+    frozenQuantitySort: "",
+    defectiveQuantitySort: "",
+    updateTimeSort: "",
   },
 });
 let dialogVisible = ref(false);
@@ -213,30 +217,21 @@ const configData = [
       attrs: {
         label: "可用库存",
         prop: "quantity",
-        sortable: true,
-        "sort-method": (a, b) => {
-          return Number(a.quantity) - Number(b.quantity);
-        },
+        sortable: "custom",
       },
     },
     {
       attrs: {
         label: "冻结库存",
         prop: "frozenQuantity",
-        sortable: true,
-        "sort-method": (a, b) => {
-          return Number(a.frozenQuantity) - Number(b.frozenQuantity);
-        },
+        sortable: "custom",
       },
     },
     {
       attrs: {
         label: "次品库存",
         prop: "defectiveQuantity",
-        sortable: true,
-        "sort-method": (a, b) => {
-          return Number(a.defectiveQuantity) - Number(b.defectiveQuantity);
-        },
+        sortable: "custom",
       },
     },
     {
@@ -244,12 +239,7 @@ const configData = [
         label: "最近入库时间",
         prop: "updateTime",
         width: 155,
-        sortable: true,
-        "sort-method": (a, b) => {
-          return (
-            new Date(a.updateTime).getTime() - new Date(b.updateTime).getTime()
-          );
-        },
+        sortable: "custom",
       },
     },
     {
@@ -325,30 +315,21 @@ const configData = [
       attrs: {
         label: "可用库存",
         prop: "quantity",
-        sortable: true,
-        "sort-method": (a, b) => {
-          return Number(a.quantity) - Number(b.quantity);
-        },
+        sortable: "custom",
       },
     },
     {
       attrs: {
         label: "冻结库存",
         prop: "frozenQuantity",
-        sortable: true,
-        "sort-method": (a, b) => {
-          return Number(a.frozenQuantity) - Number(b.frozenQuantity);
-        },
+        sortable: "custom",
       },
     },
     {
       attrs: {
         label: "次品库存",
         prop: "defectiveQuantity",
-        sortable: true,
-        "sort-method": (a, b) => {
-          return Number(a.defectiveQuantity) - Number(b.defectiveQuantity);
-        },
+        sortable: "custom",
       },
     },
     {
@@ -356,12 +337,7 @@ const configData = [
         label: "最近入库时间",
         prop: "updateTime",
         width: 155,
-        sortable: true,
-        "sort-method": (a, b) => {
-          return (
-            new Date(a.updateTime).getTime() - new Date(b.updateTime).getTime()
-          );
-        },
+        sortable: "custom",
       },
     },
     {
@@ -422,10 +398,7 @@ const configData = [
       attrs: {
         label: "库存数量",
         prop: "quantity",
-        sortable: true,
-        "sort-method": (a, b) => {
-          return Number(a.quantity) - Number(b.quantity);
-        },
+        sortable: "custom",
       },
     },
   ],
@@ -519,6 +492,10 @@ config.value = configData[0];
 getList();
 
 const handleChange = () => {
+  sourceList.value.pagination.quantitySort = "";
+  sourceList.value.pagination.frozenQuantitySort = "";
+  sourceList.value.pagination.defectiveQuantitySort = "";
+  sourceList.value.pagination.updateTimeSort = "";
   sourceList.value.pagination.pageNum = 1;
   sourceList.value.data = [];
   if (activeName.value === "first") {
@@ -540,7 +517,37 @@ const handleChange = () => {
   }
   getList();
 };
-
+const sortChange = ({ column, prop, order }) => {
+  sourceList.value.pagination.quantitySort = "";
+  sourceList.value.pagination.frozenQuantitySort = "";
+  sourceList.value.pagination.defectiveQuantitySort = "";
+  sourceList.value.pagination.updateTimeSort = "";
+  let type = "";
+  if (order === "ascending") {
+    // 升序
+    type = "1";
+  } else if (order === "descending") {
+    // 降序
+    type = "0";
+  } else {
+    // 默认
+  }
+  if (column.label === "可用库存" || column.label === "库存数量") {
+    sourceList.value.pagination.quantitySort = type;
+  } else if (column.label === "冻结库存") {
+    sourceList.value.pagination.frozenQuantitySort = type;
+  } else if (column.label === "次品库存") {
+    sourceList.value.pagination.defectiveQuantitySort = type;
+  } else if (column.label === "最近入库时间") {
+    sourceList.value.pagination.updateTimeSort = type;
+  } else {
+    sourceList.value.pagination.quantitySort = "";
+    sourceList.value.pagination.frozenQuantitySort = "";
+    sourceList.value.pagination.defectiveQuantitySort = "";
+    sourceList.value.pagination.updateTimeSort = "";
+  }
+  getList();
+};
 const warehouseList = ref([]);
 const productUnit = ref([]);
 const getDict = () => {