浏览代码

新需求

cz 2 年之前
父节点
当前提交
74e067c71d

+ 10 - 0
src/api/inbound-outbound/arrivalInspection.js

@@ -27,6 +27,16 @@ export function qualityTestingDetails1(data = {}) {
   })
 }
 
+//到货质检明细 
+export function qualityTestingDetails2(data = {}) {
+  return request({
+    url: '/api/victoriatourist/qualityInfo/detailsInfo1',
+    method: 'post',
+    data: data,
+  })
+}
+
+
 //质检
 export function addInspection(data = {}) {
   return request({

+ 114 - 0
src/components/DetailsComponents/QualityDetails1.vue

@@ -0,0 +1,114 @@
+<template>
+  <div>
+    <el-form :model="form" label-position="left" v-loading="loading">
+      <div style="margin-bottom: 20px">
+        <labelTitle content="基本信息"></labelTitle>
+      </div>
+      <div style="padding: 0px 20px">
+        <el-row :gutter="10">
+          <el-col :span="12">
+            <el-form-item label="采购单号:">
+              <span> {{ form.purchase.code }}</span>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="供应商:">
+              <span> {{ form.purchase.supplierName }}</span>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="10">
+          <el-col :span="12">
+            <el-form-item label="物流公司:">
+              <span> {{ form.logisticsInfo.logisticsCompanyName }}</span>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="物流/快递单号:">
+              <span> {{ form.logisticsInfo.code }} </span>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </div>
+      <div style="margin-bottom: 20px">
+        <labelTitle content="质检明细"></labelTitle>
+      </div>
+      <div style="padding: 0px 20px">
+        <el-table :data="form.qualityDetailsList">
+          <el-table-column label="产品编码" prop="productCode" width="150" />
+          <el-table-column label="产品名称" prop="productName" width="150" />
+          <!-- <el-table-column label="质检合格" prop="qualifiedQuantity" width="100" /> -->
+          <el-table-column
+            label="质检合格"
+            prop="qualifiedQuantity"
+            width="100"
+          />
+          <el-table-column
+            label="质检不合格"
+            prop="disqualificationQuantity"
+            width="100"
+          />
+          <el-table-column label="备注" prop="remarks" />
+        </el-table>
+      </div>
+    </el-form>
+  </div>
+</template>
+
+<script>
+import labelTitle from "@/components/label-title/index.vue";
+import { qualityTestingDetails2 } from "@/api/inbound-outbound/arrivalInspection.js";
+// import { supplySelect } from "@/api/product-material/supply/index.js";
+
+export default {
+  name: "QualityDetails",
+  props: {
+    rowData: {
+      type: Object,
+    },
+  },
+  components: {
+    labelTitle,
+  },
+  data() {
+    return {
+      loading: false,
+      form: {
+        purchase: {},
+        logisticsInfo: {},
+      },
+      productTypeList: [],
+    };
+  },
+  created() {
+    const businessDictData = JSON.parse(
+      window.localStorage.getItem("businessDict")
+    );
+    this.productTypeList = businessDictData.find(
+      (item) => item.code === "productType"
+    ).children;
+  },
+  mounted() {
+    if (this.rowData.id) {
+      this.getDetails();
+    }
+  },
+  methods: {
+    async getDetails() {
+      this.loading = true;
+      qualityTestingDetails2({ qualityInfoId: this.rowData.id }).then((res) => {
+        this.form = res.data.data;
+        this.loading = false;
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+::v-deep {
+  .el-form-item {
+    margin-bottom: 5px;
+  }
+}
+</style>

+ 24 - 0
src/views/inbound-outbound/arrivalInspection/index.vue

@@ -8,12 +8,14 @@ import * as API from "@/api/inbound-outbound/arrivalInspection.js";
 
 import { warehouseSelectList } from "@/api/product-material/warehouse/index.js";
 import addInspection from "./addInspection.vue";
+import QualityDetails1 from "@/components/DetailsComponents/QualityDetails1.vue";
 
 export default {
   components: {
     test,
     query,
     addInspection,
+    QualityDetails1,
   },
   data() {
     return {
@@ -58,6 +60,8 @@ export default {
         remark: "",
         changeProductList: [],
       },
+      detailsDialog: false,
+      rowData: {},
     };
   },
   created() {
@@ -161,6 +165,10 @@ export default {
         );
       });
     },
+    openDetails(row) {
+      this.rowData = { ...row };
+      this.detailsDialog = true;
+    },
   },
 };
 </script>
@@ -227,6 +235,12 @@ export default {
               v-if="scope.row.status < 3"
               >质检
             </el-button>
+            <el-button
+              type="text"
+              @click="openDetails(scope.row)"
+              v-if="scope.row.status > 1"
+              >质检明细
+            </el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -253,6 +267,16 @@ export default {
         ref="addInspection"
       ></add-inspection>
     </el-dialog>
+
+    <el-dialog
+      title="质检明细"
+      v-if="detailsDialog"
+      :visible.sync="detailsDialog"
+      width="50%"
+      top="60px"
+    >
+      <QualityDetails1 :rowData="rowData"></QualityDetails1>
+    </el-dialog>
   </div>
 </template>
 

+ 10 - 10
src/views/purchase-management/deliver-goods/sendGoods.vue

@@ -178,20 +178,20 @@ export default {
     handleSubmit() {
       this.$refs.form.validate((valid) => {
         if (valid) {
-          for (let i = 0; i < this.form.details.length; i++) {
-            const x = this.form.details[i];
-            if (
-              Number(x.deliverQuantity) + Number(x.shipmentQuantity) >
-              Number(x.quantity)
-            ) {
-              return this.msgInfo("已发货数量加发货数量不能大于采购数量!");
-            }
-          }
+          // for (let i = 0; i < this.form.details.length; i++) {
+          //   const x = this.form.details[i];
+          //   if (
+          //     Number(x.deliverQuantity) + Number(x.shipmentQuantity) >
+          //     Number(x.quantity)
+          //   ) {
+          //     return this.msgInfo("已发货数量加发货数量不能大于采购数量!");
+          //   }
+          // }
           const sum = this.form.details.reduce((sum, x) => {
             return sum + Number(x.shipmentQuantity);
           }, 0);
           if (sum < 1) {
-            return this.msgInfo("发货总数量不能小于0");
+            return this.msgInfo("发货总数量不能小于1");
           }
           this.loading = true;
           this.$emit("submit");