瀏覽代碼

采购入库、到货质检重接

cz 2 年之前
父節點
當前提交
a605605dc7

+ 20 - 2
src/api/inbound-outbound/arrivalInspection.js

@@ -3,8 +3,26 @@ import request from '@/router/axios'
 // 到货质检列表 
 export function qualityTestingList(data = {}) {
   return request({
-    url: '/api/victoriatourist/quality/arrival/page',
+    url: '/api/victoriatourist/qualityInfo/page',
     method: 'post',
     data: data,
   })
-}
+}
+
+//到货质检明细 
+export function qualityTestingDetails(data = {}) {
+  return request({
+    url: '/api/victoriatourist/qualityInfo/detailsList',
+    method: 'post',
+    data: data,
+  })
+}
+
+//质检
+export function addInspection(data = {}) {
+  return request({
+    url: '/api/victoriatourist/qualityDetails/edit',
+    method: 'post',
+    data: data,
+  })
+}

+ 1 - 1
src/api/inbound-outbound/inbound/purchaseInbound.js

@@ -12,7 +12,7 @@ export function purchaseInboundList(data = {}) {
 // 物流单明细
 export function logisticsDetails(data = {}) {
   return request({
-    url: '/api/victoriatourist/purchase/in/stock/logistics/details',
+    url: '/api/victoriatourist/purchase/in/stock/getLogisticsDetails',
     method: 'post',
     data: data,
   })

+ 15 - 10
src/views/inbound-outbound/abnormalManage/index.vue

@@ -19,6 +19,8 @@ export default {
     return {
       warehouseSelectList: [],
       warehouseTypeList: [],
+      abnormalSourceList: [],
+      handleStatusList: [],
       btnForm: {
         otherButton: {
           list: [
@@ -70,20 +72,23 @@ export default {
     const businessDictData = JSON.parse(
       window.localStorage.getItem("businessDict")
     );
-    this.warehouseTypeList = businessDictData.find(
-      (item) => item.code === "warehouseType"
+    this.abnormalSourceList = businessDictData.find(
+      (item) => item.code === "abnormalSource"
+    ).children;
+    this.handleStatusList = businessDictData.find(
+      (item) => item.code === "handleStatus"
     ).children;
     warehouseSelectList().then((res) => {
       this.warehouseSelectList = res.data.data;
-      this.selectConfig[0].data = this.warehouseSelectList.map((item) => ({
-        label: item.name,
-        value: item.id,
-      }));
-      this.selectConfig[1].data = this.warehouseSelectList.map((item) => ({
-        label: item.name,
-        value: item.id,
-      }));
     });
+    this.selectConfig[0].data = this.abnormalSourceList.map((item) => ({
+      label: item.dictValue,
+      value: item.dictKey,
+    }));
+    this.selectConfig[1].data = this.handleStatusList.map((item) => ({
+      label: item.dictValue,
+      value: item.dictKey,
+    }));
     this.getList();
   },
   methods: {

+ 41 - 76
src/views/inbound-outbound/arrivalInspection/addInspection.vue

@@ -10,25 +10,25 @@
       >
         <el-row :gutter="10">
           <el-col :span="4">
-            <el-form-item label="采购单号" prop="code">
-              <el-input v-model="form.code" disabled></el-input>
+            <el-form-item label="采购单号" prop="purchaseCode">
+              <el-input v-model="form.purchaseCode" disabled></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="10">
-            <el-form-item label="供应商" prop="supplyName">
-              <el-input v-model="form.supplyName" disabled></el-input>
+            <el-form-item label="供应商" prop="supplierName">
+              <el-input v-model="form.supplierName" disabled></el-input>
             </el-form-item>
           </el-col>
         </el-row>
         <el-row :gutter="10">
           <el-col :span="4">
-            <el-form-item label="物流公司" prop="code">
-              <el-input v-model="form.code" disabled></el-input>
+            <el-form-item label="物流公司" prop="logisticsCompanyName">
+              <el-input v-model="form.logisticsCompanyName" disabled></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item label="物流/快递单号" prop="supplyName">
-              <el-input v-model="form.supplyName" disabled></el-input>
+            <el-form-item label="物流/快递单号" prop="code">
+              <el-input v-model="form.code" disabled></el-input>
             </el-form-item>
           </el-col>
         </el-row>
@@ -42,18 +42,21 @@
             </el-table-column>
             <el-table-column label="物品名称" prop="productName">
             </el-table-column>
-            <el-table-column label="待质检数量" prop="name"> </el-table-column>
+            <el-table-column label="待质检数量" prop="totalQuantity">
+            </el-table-column>
 
-            <el-table-column label="质检合格" prop="quantity">
+            <el-table-column label="质检合格" prop="qualifiedQuantity">
               <template slot-scope="scope">
                 <el-form-item
-                  :prop="'changeProductList.' + scope.$index + '.quantity'"
-                  :rules="formRules.quantity"
+                  :prop="
+                    'changeProductList.' + scope.$index + '.qualifiedQuantity'
+                  "
+                  :rules="formRules.qualifiedQuantity"
                   :inline-message="true"
                   label-width="0"
                 >
                   <el-input
-                    v-model="scope.row.quantity"
+                    v-model="scope.row.qualifiedQuantity"
                     placeholder="请输入"
                     size="mini"
                   >
@@ -61,16 +64,20 @@
                 </el-form-item>
               </template>
             </el-table-column>
-            <el-table-column label="质检不合格" prop="quantity">
+            <el-table-column label="质检不合格" prop="disqualificationQuantity">
               <template slot-scope="scope">
                 <el-form-item
-                  :prop="'changeProductList.' + scope.$index + '.quantity'"
-                  :rules="formRules.quantity"
+                  :prop="
+                    'changeProductList.' +
+                    scope.$index +
+                    '.disqualificationQuantity'
+                  "
+                  :rules="formRules.disqualificationQuantity"
                   :inline-message="true"
                   label-width="0"
                 >
                   <el-input
-                    v-model="scope.row.quantity"
+                    v-model="scope.row.disqualificationQuantity"
                     placeholder="请输入"
                     size="mini"
                   >
@@ -78,16 +85,6 @@
                 </el-form-item>
               </template>
             </el-table-column>
-
-            <!-- <el-table-column
-              label="操作"
-              width="100"
-              align="left"
-            >
-              <template slot-scope="scope">
-                <el-button type="text" @click="deleteRow(scope.$index)">删除</el-button>
-              </template>
-            </el-table-column> -->
           </el-table>
         </el-form-item>
       </el-form>
@@ -98,27 +95,17 @@
         确定</el-button
       >
     </div>
-    <!-- <el-dialog
-      title="物品选择"
-      v-if="selectDialog"
-      :visible.sync="selectDialog"
-      width="80%"
-      top="60px"
-    >
-      <selectProduct @select="handleSelect"></selectProduct>
-    </el-dialog> -->
   </div>
 </template>
 
 <script>
 import labelTitle from "@/components/label-title/index.vue";
-import selectProduct from "@/components/select-product/index.vue";
 
 import { getToken } from "@/util/auth";
 
 export default {
-  name: "addManualOutbound",
-  components: { labelTitle, selectProduct },
+  name: "addInspection",
+  components: { labelTitle },
   props: {
     form: {
       type: Object,
@@ -138,25 +125,18 @@ export default {
       loading: false,
       selectDialog: false,
       formRules: {
-        quantity: [
+        qualifiedQuantity: [
           {
             required: true,
             message: "请输入质检合格数量",
             trigger: "blur",
           },
         ],
-        outWarehouseId: [
+        disqualificationQuantity: [
           {
             required: true,
-            message: "请选择调出仓库",
-            trigger: "change",
-          },
-        ],
-        inWarehouseId: [
-          {
-            required: true,
-            message: "请选择调入仓库",
-            trigger: "change",
+            message: "请输入质检不合格数量",
+            trigger: "blur",
           },
         ],
       },
@@ -167,8 +147,17 @@ export default {
     handleSubmit() {
       this.$refs.form.validate((valid) => {
         if (valid) {
-          if (!this.form.changeProductList.length > 0)
-            return this.msgInfo("请添加调仓明细");
+          for (let i = 0; i < this.form.changeProductList.length; i++) {
+            if (
+              Number(this.form.changeProductList[i].qualifiedQuantity) +
+                Number(
+                  this.form.changeProductList[i].disqualificationQuantity
+                ) >
+              Number(this.form.changeProductList[i].totalQuantity)
+            ) {
+              return this.msgInfo("质检合格和质检不合格总合不能大于待质检数量");
+            }
+          }
           this.loading = true;
           this.$emit("submit");
         }
@@ -177,30 +166,6 @@ export default {
     handleCancel() {
       this.$emit("cancel");
     },
-    handleAddProduct() {
-      if (this.form.outWarehouseId === this.form.inWarehouseId)
-        return this.msgInfo("调出和调入仓库不可一致");
-      if (!(this.form.outWarehouseId && this.form.inWarehouseId))
-        return this.msgInfo("请先选择要调的仓库");
-      this.selectDialog = true;
-    },
-    handleSelect(row) {
-      const flag = this.form.changeProductList.some(
-        (x) => x.productId === row.id
-      );
-      if (flag) return this.msgInfo("该物品已经选择");
-      const product = {
-        productCode: row.code,
-        productName: row.name,
-        productId: row.id,
-        quantity: "",
-      };
-      this.form.changeProductList.push(product);
-    },
-    deleteRow(index) {
-      this.form.changeProductList.splice(index, 1);
-      this.msgSuccess("删除成功");
-    },
   },
 };
 </script>

+ 35 - 32
src/views/inbound-outbound/arrivalInspection/index.vue

@@ -45,11 +45,11 @@ export default {
       selectConfig: [
         {
           label: "质检状态",
-          prop: "qualityStatus",
+          prop: "status",
           data: [],
         },
       ],
-      tableList: [],
+      tableList: [{}],
       total: 0,
       loading: false,
       titleText: "到货质检",
@@ -114,17 +114,19 @@ export default {
       this.open = true;
     },
     handleCancel() {
-      this.form = {
-        outWarehouseId: "",
-        inWarehouseId: "",
-        remark: "",
-        changeProductList: [],
-      };
       this.open = false;
     },
 
     handleSubmit() {
-      API.addInspection(this.form).then(
+      const arr = this.form.changeProductList.map((x) => {
+        return {
+          id: x.id,
+          qualifiedQuantity: x.qualifiedQuantity,
+          disqualificationQuantity: x.disqualificationQuantity,
+          warehouseId: x.warehouseId,
+        };
+      });
+      API.addInspection(arr).then(
         () => {
           this.msgSuccess("添加成功");
           this.$refs.addInspection.loading = false;
@@ -139,24 +141,27 @@ export default {
     },
     handleReceive(row) {
       this.open = true;
-      // this.$confirm("是否确认接收 ?", {
-      //   confirmButtonText: '确定',
-      //   cancelButtonText: '取消',
-      //   type: "warning",
-      // }).then(() => {
-      //   API.receive({ id: row.id, inQuantity: row.outQuantity }).then(() => {
-      //     this.msgSuccess("接收成功");
-      //     this.getList();
-      //   });
-      // });
-    },
+      this.$nextTick(() => {
+        this.$refs.addInspection.loading = true;
+        API.qualityTestingDetails({ qualityInfoId: row.id }).then(
+          (res) => {
+            let list = res.data.data;
 
-    showAddress(row) {
-      return (
-        <div>
-          {row.countryName} , {row.provinceName} , {row.cityName}
-        </div>
-      );
+            this.form = {
+              purchaseCode: row.code,
+              supplierName: row.supplierName,
+              logisticsCompanyName: row.logisticsCompanyName,
+              code: row.logisticsInfoCode,
+              changeProductList: list,
+            };
+            this.$refs.addInspection.loading = false;
+          },
+          (err) => {
+            console.log("qualityTestingDetails: " + err);
+            this.$refs.addInspection.loading = false;
+          }
+        );
+      });
     },
   },
 };
@@ -188,7 +193,7 @@ export default {
         <el-table-column
           label="物流公司"
           align="left"
-          prop="specs"
+          prop="logisticsCompanyName"
           width="100"
         />
         <el-table-column
@@ -200,7 +205,7 @@ export default {
         <el-table-column
           label="采购员"
           align="left"
-          prop="purchaseName"
+          prop="createUserName"
           width="100"
         />
         <el-table-column
@@ -213,11 +218,9 @@ export default {
         <el-table-column
           label="状态"
           align="left"
-          prop="qualityStatus"
+          prop="status"
           width="100"
-          :formatter="
-            (row) => dictDataEcho(row.qualityStatus, qualityStatusList)
-          "
+          :formatter="(row) => dictDataEcho(row.status, qualityStatusList)"
         />
         <el-table-column label="操作" align="center" width="120">
           <template slot-scope="scope">

+ 7 - 3
src/views/inbound-outbound/inbound/cgInbound/index.vue

@@ -115,6 +115,7 @@ export default {
               changeQuantity: x.shipmentQuantity,
             }));
             this.form = {
+              id: row.id,
               purchaseCode: row.purchaseCode,
               supplierName: row.supplierName,
               logisticsCompanyName: row.logisticsCompanyName,
@@ -148,7 +149,10 @@ export default {
       });
     },
     handleSubmit() {
-      API.purchaseAdd(this.form.changeDetailsList).then(
+      API.purchaseAdd({
+        logisticsInfoId: this.form.id,
+        list: this.form.changeDetailsList,
+      }).then(
         () => {
           this.msgSuccess("入库成功");
           this.$refs.purchaseInbound.loading = false;
@@ -242,7 +246,7 @@ export default {
         <el-table-column
           label="状态"
           align="left"
-          prop="inStockStatus"
+          prop="status"
           width="100"
           :formatter="
             (row) => dictDataEcho(row.inStockStatus, inStockStatusList)
@@ -253,7 +257,7 @@ export default {
             <el-button
               type="text"
               @click="handleInbound(scope.row)"
-              v-if="scope.row.inStockStatus < 30"
+              v-if="scope.row.status < 30"
             >
               入库
             </el-button>

+ 15 - 3
src/views/inbound-outbound/inbound/cgInbound/purchaseInbound.vue

@@ -46,7 +46,8 @@
             </el-table-column>
             <el-table-column label="本次发货" prop="shipmentQuantity">
             </el-table-column>
-
+            <el-table-column label="已入库数量" prop="receiptQuantity">
+            </el-table-column>
             <el-table-column
               label="本次入库"
               prop="changeQuantity"
@@ -171,13 +172,24 @@ export default {
             return sum + Number(x.changeQuantity);
           }, 0);
           if (sum < 1) {
-            return this.msgInfo("入库总数量不能小于0");
+            return this.msgInfo("入库总数量不能小于1");
+          }
+          for (let i = 0; i < this.form.changeDetailsList.length; i++) {
+            if (
+              Number(this.form.changeDetailsList[i].receiptQuantity) +
+                Number(this.form.changeDetailsList[i].changeQuantity) >
+              Number(this.form.changeDetailsList[i].shipmentQuantity)
+            ) {
+              return this.msgInfo(
+                "已入库数量和本次入库数量总合不能大于本次发货数量"
+              );
+            }
           }
           this.loading = true;
           this.form.changeDetailsList = this.form.changeDetailsList.map(
             (x) => ({
               businessId: x.id,
-              warehouseId: x.warehouseId,
+              warehouseId: x.receiptWarehouseId,
               goodsId: x.goodsId,
               changeQuantity: x.changeQuantity,
             })

+ 2 - 0
src/views/purchase-management/deliver-goods/index.vue

@@ -238,6 +238,8 @@ export default {
     handleSubmit1() {
       this.$refs.arriveForm.validate((valid) => {
         if (valid) {
+          delete this.arriveForm.code;
+          delete this.arriveForm.supplierName;
           API.arrivalNotice(this.arriveForm).then(() => {
             this.msgSuccess("操作成功");
             this.getList();