cz 2 éve
szülő
commit
089f847476

+ 32 - 36
src/views/WDLY/outInBound/logistics/index.vue

@@ -312,17 +312,19 @@ const config = computed(() => {
               editStatus(row);
             },
           },
-          {
-            attrs: {
-              label: "到货通知",
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              handleArrival(row);
-            },
-          },
+          row.businessType == 1
+            ? {
+                attrs: {
+                  label: "到货通知",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  handleArrival(row);
+                },
+              }
+            : {},
         ];
       },
     },
@@ -384,6 +386,10 @@ const formConfig = reactive([
 ]);
 const formConfigOne = reactive([
   {
+    type: "title",
+    title: "基础信息",
+  },
+  {
     type: "input",
     prop: "supplyName",
     label: "供应商",
@@ -442,6 +448,7 @@ const submitForm = () => {
   byform.value.handleSubmit((valid) => {
     if (modalType.value == "other") {
       loading.value = true;
+      submitLoading.value = true;
       formData.data.arrivalDetailList = formData.data.arrivalDetailList.map(
         (x) => ({
           bussinessId: x.bussinessId,
@@ -456,16 +463,20 @@ const submitForm = () => {
         code: formData.data.code,
       };
       formData.data.victoriatouristJson = JSON.stringify(victoriatouristJson);
-      proxy.post("/arrival/addByWdly", formData.data).then((res) => {
-        ElMessage({
-          message: `操作成功!`,
-          type: "success",
-        });
-        dialogVisible.value = false;
-        loading.value = false;
-        getList();
-      });
+      proxy.post("/arrival/addByWdly", formData.data).then(
+        (res) => {
+          ElMessage({
+            message: `操作成功!`,
+            type: "success",
+          });
+          dialogVisible.value = false;
+          loading.value = false;
+          getList();
+        },
+        (err) => (submitLoading.value = false)
+      );
     } else {
+      loading.value = true;
       submitLoading.value = true;
       proxy.post("/logisticsInfos/" + modalType.value, formData.data).then(
         (res) => {
@@ -529,7 +540,6 @@ const getLogisticsData = (row) => {
     }));
   });
 };
-
 const handleClickCode = (row) => {
   let id = row.id;
   proxy.post("/logisticsInfos/getLogistics", { id }).then((res) => {
@@ -544,6 +554,7 @@ const handleClickCode = (row) => {
     }
   });
 };
+
 const deliverData = ref([]);
 const handleArrival = (row) => {
   modalType.value = "other";
@@ -574,21 +585,6 @@ const handleArrival = (row) => {
   });
 };
 
-// watch(
-//   () => formData.data.deliverGoodsId,
-//   (val) => {
-//     if (val) {
-//       const current = deliverData.value.find((x) => x.id === val);
-//       formData.data.logisticsCompanyCode = current
-//         ? current.logisticsCompanyCode
-//         : "";
-//       formData.data.code = current ? current.code : "";
-//       // formData.data.logisticsCompanyName = current ? current.logisticsCompanyCode : "";
-
-//     }
-//   }
-// );
-
 getList();
 getLogisticsData();
 onMounted(() => {

+ 21 - 55
src/views/WDLY/purchaseManage/arrival/index.vue

@@ -214,7 +214,7 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "到货单号",
+        label: "采购单号",
         prop: "code",
       },
     },
@@ -226,71 +226,36 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "物品类型",
+        label: "物流/快递公司",
         prop: "productType",
       },
-      render(type) {
-        return type == 1 ? "产品" : type == 2 ? "物料" : "";
-      },
     },
 
     {
       attrs: {
-        label: "物品编码",
+        label: "物流/快递单号",
         prop: "productCode",
       },
     },
     {
       attrs: {
-        label: "物品名称",
+        label: "采购员",
         prop: "productName",
       },
     },
     {
       attrs: {
-        label: "规格型号",
+        label: "采购时间",
         prop: "productSpec",
       },
     },
     {
       attrs: {
-        label: "单位",
-        prop: "productUnit",
-      },
-    },
-    {
-      attrs: {
-        label: "到货数量",
-        prop: "count",
-      },
-    },
-    {
-      attrs: {
-        label: "质检合格",
-        prop: "qualifiedCount",
-      },
-    },
-    {
-      attrs: {
-        label: "质检不合格",
-        prop: "noQualifiedCount",
-      },
-    },
-    {
-      attrs: {
         label: "质检状态",
-        prop: "status",
-      },
-      render(type) {
-        return type == 0
-          ? "未质检"
-          : type == 10
-          ? "部分质检"
-          : type == 20
-          ? "已质检"
-          : "";
+        prop: "productUnit",
       },
     },
+
     {
       attrs: {
         label: "操作",
@@ -300,19 +265,20 @@ const config = computed(() => {
       // 渲染 el-button,一般用在最后一列。
       renderHTML(row) {
         return [
-          {
-            attrs: {
-              label: "质检",
-              type: "primary",
-              text: true,
-              disabled: row.status == 20,
-            },
-            el: "button",
-            click() {
-              selectDataOne.value = [row];
-              start(10);
-            },
-          },
+          row.status == 20
+            ? {
+                attrs: {
+                  label: "质检",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  selectDataOne.value = [row];
+                  start(10);
+                },
+              }
+            : {},
         ];
       },
     },

+ 170 - 81
src/views/WDLY/stockManage/query/index.vue

@@ -11,6 +11,7 @@
       >
         <el-tab-pane label="按仓库" name="first"></el-tab-pane>
         <el-tab-pane label="按产品" name="second"></el-tab-pane>
+        <el-tab-pane label="按SPU" name="three"></el-tab-pane>
       </el-tabs>
       <byTable
         :source="sourceList.data"
@@ -87,98 +88,153 @@ let rules = ref({
 });
 const { proxy } = getCurrentInstance();
 const selectConfig = reactive([
-  // {
-  //   label: "spu类型",
-  //   prop: "type",
-  //   data: [],
-  // },
-]);
-
-const config = reactive([
   {
-    attrs: {
-      label: "仓库名称",
-      prop: "warehouseName",
-    },
+    label: "仓库名称",
+    prop: "id",
+    data: [],
   },
   {
-    attrs: {
-      label: "产品编码",
-      prop: "code",
-    },
+    label: "物品类型",
+    prop: "definition",
+    data: [
+      {
+        label: "产品",
+        value: "1",
+      },
+      {
+        label: "物料",
+        value: "2",
+      },
+    ],
   },
-  {
-    attrs: {
-      label: "产品名称",
-      prop: "productName",
+]);
+
+const config = ref([]);
+
+const configData = [
+  [
+    {
+      attrs: {
+        label: "仓库名称",
+        prop: "warehouseName",
+      },
     },
-  },
-  {
-    attrs: {
-      label: "规格",
-      prop: "spec",
+    {
+      attrs: {
+        label: "所属分类",
+        prop: "productClassifyName",
+      },
     },
-  },
-  {
-    attrs: {
-      label: "单位",
-      prop: "unit",
+    {
+      attrs: {
+        label: "物品编码",
+        prop: "productCode",
+      },
     },
-  },
-  {
-    attrs: {
-      label: "可用库存",
-      prop: "quantity",
+    {
+      attrs: {
+        label: "物品名称",
+        prop: "productName",
+      },
     },
-  },
-  {
-    attrs: {
-      label: "冻结库存",
-      prop: "frozenQuantity",
+    {
+      attrs: {
+        label: "规格",
+        prop: "productSpec",
+      },
     },
-  },
-  {
-    attrs: {
-      label: "次品",
-      prop: "defectiveQuantity",
+    {
+      attrs: {
+        label: "单位",
+        prop: "productUnit",
+      },
     },
-  },
-  {
-    attrs: {
-      label: "操作",
-      width: "200",
-      align: "right",
+    {
+      attrs: {
+        label: "可用库存",
+        prop: "quantity",
+      },
     },
-    // 渲染 el-button,一般用在最后一列。
-    renderHTML(row) {
-      return [
-        {
-          attrs: {
-            label: "良转次",
-            type: "primary",
-            text: true,
-          },
-          el: "button",
-          click() {
-            getDtl(row, "add");
-          },
-        },
-        {
-          attrs: {
-            label: "次转良",
-            type: "primary",
-            text: true,
+    {
+      attrs: {
+        label: "冻结库存",
+        prop: "frozenQuantity",
+      },
+    },
+    {
+      attrs: {
+        label: "次品库存",
+        prop: "defectiveQuantity",
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "200",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "良转次",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row, "add");
+            },
           },
-          el: "button",
-          click() {
-            getDtl(row, "edit");
+          {
+            attrs: {
+              label: "次转良",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row, "edit");
+            },
           },
-        },
-      ];
+        ];
+      },
     },
-  },
-]);
-
+  ],
+  [
+    {
+      attrs: {
+        label: "spu编码",
+        prop: "warehouseName",
+      },
+    },
+    {
+      attrs: {
+        label: "spu名称",
+        prop: "productClassifyName",
+      },
+    },
+    {
+      attrs: {
+        label: "关联产品数",
+        prop: "productCode",
+      },
+    },
+    {
+      attrs: {
+        label: "库存数量",
+        prop: "productName",
+      },
+    },
+    {
+      attrs: {
+        label: "可组合数量",
+        prop: "productSpec",
+      },
+    },
+  ],
+];
 let formData = reactive({
   data: {},
   treeData: [],
@@ -260,25 +316,58 @@ const getDtl = (row, type) => {
   };
   dialogVisible.value = true;
 };
-
+config.value = configData[0];
 getList();
 
 const handleChange = () => {
   sourceList.value.pagination.pageNum = 1;
   if (activeName.value === "first") {
     requestUrl = "/stock/pageByWarehouse";
-    config.unshift({
+    config.value = configData[0];
+    config.value.unshift({
       attrs: {
         label: "仓库名称",
         prop: "warehouseName",
       },
     });
+    selectConfig.unshift({
+      label: "仓库名称",
+      prop: "type",
+      data: warehouseList.value.map((x) => ({
+        label: x.name,
+        value: x.id,
+      })),
+    });
+  } else if (activeName.value === "second") {
+    requestUrl = "/stock/pageByProduct";
+    config.value = configData[0];
+    if (selectConfig.length > 1) selectConfig.shift();
+    config.value.shift();
   } else {
     requestUrl = "/stock/pageByProduct";
-    config.shift();
+    config.value = configData[1];
+    if (selectConfig.length > 1) selectConfig.shift();
   }
   getList();
 };
+
+const warehouseList = ref([]);
+const warehouseListData = () => {
+  // // 币种数据
+  proxy
+    .post("/warehouse/page", {
+      pageNum: 1,
+      pageSize: 999,
+    })
+    .then((message) => {
+      warehouseList.value = message.rows;
+      selectConfig[0].data = warehouseList.value.map((x) => ({
+        label: x.name,
+        value: x.id,
+      }));
+    });
+};
+warehouseListData();
 </script>
   
 <style lang="scss" scoped>

+ 37 - 34
src/views/purchaseSales/outAndInWarehouse/warehouseAdjustment/index.vue

@@ -39,7 +39,7 @@
               >添加明细</el-button
             >
             <el-table
-              :data="formData.data.list"
+              :data="formData.data.stockTransferDetailsList"
               style="width: 100%; margin-top: 16px"
             >
               <el-table-column
@@ -62,12 +62,14 @@
                 <template #default="{ row, $index }">
                   <div style="width: 100%">
                     <el-form-item
-                      :prop="'list.' + $index + '.quantity'"
-                      :rules="rules.quantity"
+                      :prop="
+                        'stockTransferDetailsList.' + $index + '.outQuantity'
+                      "
+                      :rules="rules.outQuantity"
                       :inline-message="true"
                     >
                       <el-input-number
-                        v-model="row.quantity"
+                        v-model="row.outQuantity"
                         placeholder="请输入数量"
                         style="width: 100%"
                         :precision="0"
@@ -132,8 +134,8 @@ const sourceList = ref({
     pageNum: 1,
     pageSize: 10,
     keyword: "",
-    warehouseId: "",
-    toWarehouseId: "",
+    outWarehouseId: "",
+    inWarehouseId: "",
     type: "3,11",
   },
 });
@@ -142,12 +144,12 @@ const selectConfig = computed(() => {
   return [
     {
       label: "调出仓库",
-      prop: "warehouseId",
+      prop: "outWarehouseId",
       data: warehouseList.value,
     },
     {
       label: "调入仓库",
-      prop: "toWarehouseId",
+      prop: "inWarehouseId",
       data: warehouseList.value,
     },
   ];
@@ -164,7 +166,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "调出仓库",
-        prop: "warehouseName",
+        prop: "outWarehouseName",
         width: 220,
       },
       // render(type) {
@@ -174,7 +176,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "调入仓库",
-        prop: "toWarehouseName",
+        prop: "inWarehouseName",
         width: 220,
       },
       // render(type) {
@@ -212,7 +214,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "调仓数量",
-        prop: "quantity",
+        prop: "outQuantity",
         width: 140,
       },
     },
@@ -248,7 +250,7 @@ const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   proxy
-    .post("/stockJournalDetails/page", sourceList.value.pagination)
+    .post("stockTransferDetails/page", sourceList.value.pagination)
     .then((res) => {
       sourceList.value.data = res.rows;
       sourceList.value.pagination.total = res.total;
@@ -279,7 +281,7 @@ const formConfig = computed(() => {
     },
     {
       type: "select",
-      prop: "warehouseId",
+      prop: "outWarehouseId",
       label: "调出仓库",
       required: true,
       data: warehouseList.value,
@@ -287,7 +289,7 @@ const formConfig = computed(() => {
     },
     {
       type: "select",
-      prop: "toWarehouseId",
+      prop: "inWarehouseId",
       label: "调入仓库",
       required: true,
       data: warehouseList.value,
@@ -307,36 +309,37 @@ const formConfig = computed(() => {
   ];
 });
 const rules = ref({
-  warehouseId: [
+  outWarehouseId: [
     { required: true, message: "请选择调出仓库", trigger: "change" },
   ],
-  toWarehouseId: [
+  inWarehouseId: [
     { required: true, message: "请选择调入仓库", trigger: "change" },
   ],
-  quantity: [{ required: true, message: "请输入调仓数量", trigger: "blur" }],
+  outQuantity: [{ required: true, message: "请输入调仓数量", trigger: "blur" }],
 });
 const openModal = () => {
   formData.data = {
     type: "1",
-    list: [],
+    stockTransferDetailsList: [],
   };
   loadingDialog.value = false;
   dialogVisible.value = true;
 };
 const pushGoods = (goods) => {
   if (goods && goods.length > 0) {
-    formData.data.list = formData.data.list.concat(
-      goods.map((item) => {
-        return {
-          productCode: item.code,
-          productId: item.id,
-          productName: item.name,
-          productSpec: item.spec,
-          productUnit: item.unit,
-          quantity: undefined,
-        };
-      })
-    );
+    formData.data.stockTransferDetailsList =
+      formData.data.stockTransferDetailsList.concat(
+        goods.map((item) => {
+          return {
+            productCode: item.code,
+            productId: item.id,
+            productName: item.name,
+            productSpec: item.spec,
+            productUnit: item.unit,
+            outQuantity: undefined,
+          };
+        })
+      );
     ElMessage({
       message: "添加成功!",
       type: "success",
@@ -348,19 +351,19 @@ const pushGoods = (goods) => {
 };
 const submitForm = () => {
   submit.value.handleSubmit(() => {
-    if (formData.data.warehouseId === formData.data.toWarehouseId)
+    if (formData.data.outWarehouseId === formData.data.inWarehouseId)
       return ElMessage({
         message: "调出仓库和调入仓库不可一致!",
         type: "info",
       });
 
-    if (!formData.data.list.length > 0)
+    if (!formData.data.stockTransferDetailsList.length > 0)
       return ElMessage({
         message: "请添加调仓明细",
         type: "info",
       });
     loadingDialog.value = true;
-    proxy.post("/stock/stockTransfer", formData.data).then(
+    proxy.post("/stockTransfer/addSt", formData.data).then(
       () => {
         ElMessage({
           message: "提交成功",
@@ -377,7 +380,7 @@ const submitForm = () => {
   });
 };
 const handleDelete = (index) => {
-  formData.data.list.splice(index, 1);
+  formData.data.stockTransferDetailsList.splice(index, 1);
 };
 </script>