Эх сурвалжийг харах

产品树,过滤可显示子级分类

cz 2 жил өмнө
parent
commit
6fce5c161b

+ 15 - 2
src/components/product/treeList.vue

@@ -114,9 +114,22 @@ const treeChange = (e, data) => {
   }
 };
 
+// const filterNode = (value, data, node) => {
+//   if (!value) return true;
+//   return data.label.indexOf(value) !== -1;
+// };
+const getParents = (node, name, key) => {
+  if (node.parent && node.parent.data[key]) {
+    name += node.parent.data[key];
+    return getParents(node.parent, name, key);
+  }
+  return name;
+};
+// 以下可实现搜索显示子节点
 const filterNode = (value, data, node) => {
-  if (!value) return true;
-  return data.label.indexOf(value) !== -1;
+  let names = getParents(node, node.data.label, "label");
+  let isName = names.indexOf(value) !== -1;
+  return !value || isName ? true : false;
 };
 
 const searchChange = () => {

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

@@ -177,7 +177,7 @@ let rules = ref({
 const { proxy } = getCurrentInstance();
 const selectConfig = reactive([
   {
-    label: "type",
+    label: "数据来源",
     prop: "businessType",
     data: [],
   },
@@ -505,7 +505,7 @@ const outBound = (row) => {
 const warehouseType = ref([]);
 
 const businessType = [
-  { label: "退货出库", value: "4" },
+  { label: "销售订单出库", value: "6" },
   { label: "京东订单出库", value: "5" },
 ];
 

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

@@ -494,7 +494,7 @@ const submitForm = () => {
           });
         }
       }
-      loading.value = true;
+      submitLoading.value = true;
       formData.data.deliverGoodsDetailsList = list.map((x) => ({
         purchaseDetailId: x.purchaseDetailId,
         deliverGoodsQuantity: x.deliverGoodsQuantity,
@@ -505,11 +505,11 @@ const submitForm = () => {
           type: "success",
         });
         dialogVisible.value = false;
-        loading.value = false;
+        submitLoading.value = false;
         getList();
       });
     } else if (modalType.value === "edit") {
-      loading.value = true;
+      submitLoading.value = true;
       formData.data.arrivalDetailList = formData.data.arrivalDetailList.map(
         (x) => ({
           bussinessId: x.bussinessId,
@@ -530,7 +530,7 @@ const submitForm = () => {
           type: "success",
         });
         dialogVisible.value = false;
-        loading.value = false;
+        submitLoading.value = false;
         getList();
       });
     }

+ 92 - 72
src/views/WDLY/purchaseManage/arrival/index.vue

@@ -13,15 +13,14 @@
           //element talbe事件都能传
           select: selectRow,
         }"
-        :action-list="[
-          {
+        :action-list="[]"
+        @get-list="getList"
+      >
+        <!-- {
             text: '质检',
             disabled: selectData.length === 0,
             action: () => start(20),
-          },
-        ]"
-        @get-list="getList"
-      >
+          }, -->
         <template #fileSlot="{ item }">
           <div
             style="cursor: pointer; color: #409eff"
@@ -35,8 +34,9 @@
     <el-dialog
       title="到货质检"
       v-model="dialogVisible"
-      width="800"
-      v-loading="loading"
+      width="80%"
+      v-loading="submitLoading"
+      destroy-on-close
     >
       <byForm
         :formConfig="formConfig"
@@ -47,29 +47,40 @@
       >
         <template #products>
           <div style="width: 100%">
-            <el-table :data="formData.data.stockTransferDetailsList">
-              <el-table-column prop="productCode" label="物品类型" />
+            <el-table :data="formData.data.qualityDetailsList">
+              <el-table-column
+                prop="productDefinition"
+                label="物品类型"
+                :formatter="
+                  (row) =>
+                    row.productDefinition == 1
+                      ? '产品'
+                      : row.productDefinition == 2
+                      ? '物料'
+                      : ''
+                "
+              />
               <el-table-column prop="productCode" label="物品编码" />
               <el-table-column prop="productName" label="物品名称" />
               <el-table-column prop="productSpec" label="规格型号" />
-              <el-table-column prop="productSpec" label="单位" />
-              <el-table-column prop="inQuantity" label="到货数量" />
-              <el-table-column prop="outQuantity" label="已质检" />
+              <el-table-column prop="productUnit" label="单位" />
+              <el-table-column prop="quantity" label="到货数量" />
+              <el-table-column prop="qualityQuantity" label="已质检" />
               <el-table-column
-                prop="outQuantity"
+                prop="qualifiedQuantity"
                 label="质检合格"
                 min-width="150"
               >
                 <template #default="{ row, $index }">
                   <el-form-item
                     :prop="
-                      'stockTransferDetailsList.' + $index + '.outQuantity'
+                      'qualityDetailsList.' + $index + '.qualifiedQuantity'
                     "
-                    :rules="rules.outQuantity"
+                    :rules="rules.qualifiedQuantity"
                     :inline-message="true"
                   >
                     <el-input-number
-                      v-model="row.outQuantity"
+                      v-model="row.qualifiedQuantity"
                       :precision="2"
                       :controls="false"
                       :min="0"
@@ -78,18 +89,22 @@
                 </template>
               </el-table-column>
               <el-table-column
-                prop="inQuantity"
+                prop="disqualificationQuantity"
                 label="质检不合格"
                 min-width="150"
               >
                 <template #default="{ row, $index }">
                   <el-form-item
-                    :prop="'stockTransferDetailsList.' + $index + '.inQuantity'"
-                    :rules="rules.inQuantity"
+                    :prop="
+                      'qualityDetailsList.' +
+                      $index +
+                      '.disqualificationQuantity'
+                    "
+                    :rules="rules.disqualificationQuantity"
                     :inline-message="true"
                   >
                     <el-input-number
-                      v-model="row.inQuantity"
+                      v-model="row.disqualificationQuantity"
                       :precision="2"
                       :controls="false"
                       :min="0"
@@ -130,14 +145,27 @@ const sourceList = ref({
     pageSize: 10,
   },
 });
+const qualityStatusData = [
+  {
+    label: "未质检",
+    value: "0",
+  },
+  {
+    label: "部分质检",
+    value: "1",
+  },
+  {
+    label: "已质检",
+    value: "2",
+  },
+];
 let dialogVisible = ref(false);
 let modalType = ref("add");
 let rules = ref({
-  name: [{ required: true, message: "请输入供应商名称", trigger: "blur" }],
-  qualifiedCount: [
+  qualifiedQuantity: [
     { required: true, message: "请输入质检合格数量", trigger: "blur" },
   ],
-  noQualifiedCount: [
+  disqualificationQuantity: [
     { required: true, message: "请输入质检不合格数量", trigger: "blur" },
   ],
 });
@@ -145,35 +173,22 @@ const { proxy } = getCurrentInstance();
 const selectConfig = reactive([
   {
     label: "质检状态",
-    prop: "status",
-    data: [
-      {
-        label: "未质检",
-        value: "0",
-      },
-      {
-        label: "部分质检",
-        value: "10",
-      },
-      {
-        label: "已质检",
-        value: "20",
-      },
-    ],
+    prop: "qualityStatus",
+    data: qualityStatusData,
   },
 ]);
 const config = computed(() => {
   return [
-    {
-      type: "selection",
-      attrs: {
-        checkAtt: "isCheck",
-      },
-    },
+    // {
+    //   type: "selection",
+    //   attrs: {
+    //     checkAtt: "isCheck",
+    //   },
+    // },
     {
       attrs: {
         label: "采购单号",
-        prop: "code",
+        prop: "purchaseCode",
       },
     },
     {
@@ -185,35 +200,38 @@ const config = computed(() => {
     {
       attrs: {
         label: "物流/快递公司",
-        prop: "productType",
+        prop: "logisticsCompanyName",
       },
     },
 
     {
       attrs: {
         label: "物流/快递单号",
-        prop: "productCode",
+        prop: "logisticsCode",
       },
     },
     {
       attrs: {
         label: "采购员",
-        prop: "productName",
+        prop: "purchaseUserName",
       },
     },
     {
       attrs: {
         label: "采购时间",
-        prop: "productSpec",
+        prop: "purchaseTime",
       },
     },
     {
       attrs: {
         label: "质检状态",
-        prop: "productUnit",
+        prop: "qualityStatus",
+      },
+      render(status) {
+        const current = qualityStatusData.find((x) => x.value == status);
+        if (current) return current.label;
       },
     },
-
     {
       attrs: {
         label: "操作",
@@ -223,7 +241,7 @@ const config = computed(() => {
       // 渲染 el-button,一般用在最后一列。
       renderHTML(row) {
         return [
-          row.status == 20
+          row.qualityStatus < 2
             ? {
                 attrs: {
                   label: "质检",
@@ -258,14 +276,14 @@ const formConfig = reactive([
     title: "到货信息",
   },
   {
-    type: "select",
-    prop: "outWarehouseId",
+    type: "input",
+    prop: "supplyName",
     label: "供应商",
     disabled: true,
   },
   {
-    type: "select",
-    prop: "inWarehouseId",
+    type: "input",
+    prop: "logisticsCompanyName",
     label: "物流快递信息",
     placeholder: "物流/快递公司",
     itemWidth: 20,
@@ -273,7 +291,7 @@ const formConfig = reactive([
   },
   {
     type: "input",
-    prop: "remark",
+    prop: "logisticsCode",
     label: " ",
     itemWidth: 30,
     placeholder: "物流/快递单号",
@@ -294,10 +312,10 @@ const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   proxy
-    .post("/arrivalDetail/page", sourceList.value.pagination)
+    .post("/qualityInfo/page1", sourceList.value.pagination)
     .then((message) => {
       message.rows.forEach((x) => {
-        if (x.status < 20) {
+        if (x.qualityStatus < 2) {
           x.isCheck = true;
         } else {
           x.isCheck = false;
@@ -313,18 +331,20 @@ const getList = async (req) => {
 
 const submitForm = () => {
   byform.value.handleSubmit((valid) => {
-    const list = formData.data.qualityDetailList;
+    const list = formData.data.qualityDetailsList;
     for (let i = 0; i < list.length; i++) {
       const e = list[i];
-      if (!(e.qualifiedCount + e.noQualifiedCount > 0)) {
+      if (!(e.qualifiedQuantity + e.disqualificationQuantity > 0)) {
         return ElMessage({
           message: "质检数量不能为0!",
           type: "info",
         });
       }
       if (
-        e.qualifiedCount + e.noQualifiedCount + Number(e.sumQualityCount) >
-        Number(e.count)
+        e.qualifiedQuantity +
+          e.disqualificationQuantity +
+          Number(e.qualityQuantity) >
+        Number(e.quantity)
       ) {
         return ElMessage({
           message: "质检数量不能大于到货数量!",
@@ -333,7 +353,7 @@ const submitForm = () => {
       }
     }
     submitLoading.value = true;
-    proxy.post("/quality/" + modalType.value, formData.data).then(
+    proxy.post("/qualityInfo/" + modalType.value, formData.data).then(
       (res) => {
         ElMessage({
           message: "质检成功",
@@ -378,17 +398,17 @@ const start = (type) => {
     ids = selectData.value.map((x) => x.id);
     row = selectData.value[0];
   }
-  proxy.post("/arrivalDetail/detail", { ids }).then((res) => {
+  proxy.post("/arrivalStockRecords/detail", { id: ids[0] }).then((res) => {
     formData.data = {
-      arrivalId: row.arrivalId,
-      supplyId: row.supplyId,
+      arrivalStockRecordsId: row.id,
       supplyName: row.supplyName,
-      code: row.code,
-      qualityDetailList: res.map((x) => ({
+      logisticsCompanyName: row.logisticsCompanyName,
+      logisticsCode: row.logisticsCode,
+      qualityDetailsList: res.arrivalStockRecordsDetailsList.map((x) => ({
         ...x,
         arrivalDetailId: x.id,
-        qualifiedCount: 0,
-        noQualifiedCount: 0,
+        qualifiedQuantity: 0,
+        disqualificationQuantity: 0,
       })),
     };
     dialogVisible.value = true;

+ 5 - 3
src/views/WDLY/stockManage/receiptData/index.vue

@@ -445,7 +445,8 @@ const handleChange = (val) => {
         pageNum: 1,
         pageSize: 10,
         total: 0,
-        type: "1,4",
+        // type: "1,4",
+        opType: "1",
       };
       config = configData[0];
       break;
@@ -457,7 +458,8 @@ const handleChange = (val) => {
         pageNum: 1,
         pageSize: 10,
         total: 0,
-        type: "2,5",
+        opType: "2",
+        // type: "2,5",
       };
       config = configData[1];
       break;
@@ -493,7 +495,7 @@ onMounted(() => {
     pageNum: 1,
     pageSize: 10,
     total: 0,
-    type: "1,4",
+    opType: "1",
   };
   getList();
 });