Browse Source

为检验执行页面添加图号字段、添加搜索条件、添加导出功能

乐菲 2 weeks ago
parent
commit
dfdd8bc7ed

+ 9 - 0
src/api/wms/quality/iqcInspectionExecute.js

@@ -244,3 +244,12 @@ export function inspectionReBack(query) {
     params: query,
   });
 }
+// 导出质检结果 Excel
+export function exportQualityInspectionResults(query) {
+  return request({
+    url: "/rtkqms/incoming-receipt-inspection/iqcPageExport",
+    method: "get",
+    params: query,
+    responseType: "blob",
+  });
+}

+ 2 - 0
src/views/mes/queryManage/queryNew.vue

@@ -177,6 +177,8 @@
       :total="total"
       :page.sync="pageNo"
       :limit.sync="pageSize"
+      :page-sizes="[10, 20, 50, 100, 200, 500, 1000, 5000]"
+      layout="total, sizes, prev, pager, next, jumper"
       @pagination="handleSearch"
     />
 

+ 204 - 106
src/views/wms/quality/iqcInspection/components/AlreadyIqcInspection.vue

@@ -1,8 +1,26 @@
 <template>
   <!-- 列表 -->
   <div>
+    <!-- 操作工具栏 -->
+    <el-row :gutter="10" class="mb8">
+      <el-col v-if="activeName === 'alreadyIqcInspection'" :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          >质检结果导出</el-button
+        >
+      </el-col>
+      <right-toolbar
+        :show-search.sync="showSearch"
+        :columns="columnsList"
+        @queryTable="handleQuery"
+        @saveSetting="getColumnsList"
+      />
+    </el-row>
     <AutoResizer :given-height="220">
-      <template #default="{height}">
+      <template #default="{ height }">
         <el-table
           v-if="columnsList.length > 0"
           ref="multipleTable"
@@ -25,7 +43,8 @@
                 type="text"
                 size="mini"
                 @click="handleInspectDetails(scope.row)"
-              >{{ scope.row.id }}</el-button>
+                >{{ scope.row.id }}</el-button
+              >
             </template>
           </el-table-column>
           <el-table-column
@@ -71,6 +90,15 @@
             width="120"
             show-overflow-tooltip
           />
+          <el-table-column
+            v-if="columnsList[23].visible"
+            :key="Math.random()"
+            label="图号"
+            align="center"
+            prop="drawingNo"
+            width="150"
+            show-overflow-tooltip
+          />
           <el-table-column
             v-if="columnsList[17].visible"
             :key="Math.random()"
@@ -86,7 +114,10 @@
             prop="testStatus"
           >
             <template slot-scope="scope">
-              <dict-tag :type="DICT_TYPE.WMS_TEST_STATUS" :value="scope.row.testStatus" />
+              <dict-tag
+                :type="DICT_TYPE.WMS_TEST_STATUS"
+                :value="scope.row.testStatus"
+              />
             </template>
           </el-table-column>
           <el-table-column
@@ -98,7 +129,10 @@
             width="120"
           >
             <template slot-scope="scope">
-              <dict-tag :type="DICT_TYPE.WMS_AUDIT_STATUS" :value="scope.row.auditStatus" />
+              <dict-tag
+                :type="DICT_TYPE.WMS_AUDIT_STATUS"
+                :value="scope.row.auditStatus"
+              />
             </template>
           </el-table-column>
           <el-table-column
@@ -126,6 +160,15 @@
             width="120"
             show-overflow-tooltip
           />
+          <el-table-column
+            v-if="columnsList[24].visible"
+            :key="Math.random()"
+            label="采购订单"
+            align="center"
+            prop="purchaseOrderNo"
+            width="120"
+            show-overflow-tooltip
+          />
           <el-table-column
             v-if="columnsList[19].visible"
             :key="Math.random()"
@@ -166,7 +209,10 @@
             prop="auditStatus"
           >
             <template slot-scope="scope">
-              <dict-tag :type="DICT_TYPE.WMS_IQC_APPROVAL_STATUS" :value="scope.row.auditStatus" />
+              <dict-tag
+                :type="DICT_TYPE.WMS_IQC_APPROVAL_STATUS"
+                :value="scope.row.auditStatus"
+              />
             </template>
           </el-table-column>
           <el-table-column
@@ -177,7 +223,10 @@
             prop="noPassType"
           >
             <template slot-scope="scope">
-              <dict-tag :type="DICT_TYPE.WMS_INSPECT_RESULTS" :value="scope.row.noPassType" />
+              <dict-tag
+                :type="DICT_TYPE.WMS_INSPECT_RESULTS"
+                :value="scope.row.noPassType"
+              />
             </template>
           </el-table-column>
           <el-table-column
@@ -193,7 +242,8 @@
                 icon="el-icon-refresh"
                 size="mini"
                 @click="callBack(scope.row)"
-              >撤回</el-button>
+                >撤回</el-button
+              >
               <!-- <el-button
                 type="text"
                 icon="el-icon-view"
@@ -218,30 +268,32 @@
     <!-- 检验详情查看 -->
     <!-- <InspectDetail ref="inspectDetail" /> -->
   </div>
-
 </template>
 
 <script>
-import { getIqcInspectionPage, inspectionReBack } from '@/api/wms/quality/iqcInspectionExecute'
-import { getFormColumnsList } from '@/api/system/saveColumns/index'
-import { mapGetters } from 'vuex'
-import { isArray } from 'min-dash'
+import {
+  getIqcInspectionPage,
+  inspectionReBack,
+} from "@/api/wms/quality/iqcInspectionExecute";
+import { getFormColumnsList } from "@/api/system/saveColumns/index";
+import { mapGetters } from "vuex";
+import { isArray } from "min-dash";
+import { exportQualityInspectionResults } from "@/api/wms/quality/iqcInspectionExecute";
 
 export default {
-  name: 'AlreadyIqcInspection',
-  components: {
-  },
+  name: "AlreadyIqcInspection",
+  components: {},
   props: {
-    'activeName': {
+    activeName: {
       type: String,
-      default: ''
+      default: "",
     },
-    'queryParamspro': {
+    queryParamspro: {
       type: Object,
-      default: () => {}
-    }
+      default: () => {},
+    },
   },
-  inject: ['paramsQuery'],
+  inject: ["paramsQuery"],
   data() {
     return {
       // 遮罩层
@@ -258,10 +310,10 @@ export default {
       // 用户列表
       users: [],
       // 弹出层标题
-      title: '',
+      title: "",
       // 是否显示弹出层
       open: false,
-      baseData: '',
+      baseData: "",
       auditStatusSelect: null,
       //   是否显示查看弹出层
       viewOpen: false,
@@ -274,8 +326,8 @@ export default {
         materialLots: null,
         // type: 3,
         audited: 1,
-        processNo: 'PURCHASE',
-        id: null
+        processNo: "PURCHASE",
+        id: null,
       },
       //   表单参数
       form: {},
@@ -283,66 +335,68 @@ export default {
       rules: {},
       // 显示隐藏列参数
       columns: [
-        { key: 0, label: '物料批次', visible: true },
-        { key: 1, label: '送货批次', visible: true },
-        { key: 2, label: '采购订单', visible: true },
-        { key: 3, label: '采购数量', visible: true },
-        { key: 4, label: '物料编码', visible: true },
-        { key: 5, label: '物料名称', visible: true },
-        { key: 6, label: '到货数量', visible: true },
-        { key: 7, label: '检验状态', visible: true },
-        { key: 8, label: '单位', visible: true },
-        { key: 9, label: '供应商', visible: true },
-        { key: 10, label: '存储条件', visible: true },
-        { key: 11, label: '登记时间', visible: true },
-        { key: 12, label: '登记人', visible: true },
-        { key: 13, label: '累计已到货数量', visible: true },
-        { key: 14, label: '检验单号', visible: true },
-        { key: 15, label: '检验数量', visible: true },
-        { key: 16, label: '审核状态', visible: true },
-        { key: 17, label: '审核人', visible: true },
-        { key: 18, label: '审核时间', visible: true },
-        { key: 19, label: '检验时间', visible: true },
-        { key: 20, label: '检验人', visible: true },
-        { key: 21, label: '处理结果', visible: true },
-        { key: 22, label: '检验结果', visible: true }
+        { key: 0, label: "物料批次", visible: true },
+        { key: 1, label: "送货批次", visible: true },
+        { key: 2, label: "采购订单", visible: true },
+        { key: 3, label: "采购数量", visible: true },
+        { key: 4, label: "物料编码", visible: true },
+        { key: 5, label: "物料名称", visible: true },
+        { key: 6, label: "到货数量", visible: true },
+        { key: 7, label: "检验状态", visible: true },
+        { key: 8, label: "单位", visible: true },
+        { key: 9, label: "供应商", visible: true },
+        { key: 10, label: "存储条件", visible: false },
+        { key: 11, label: "登记时间", visible: true },
+        { key: 12, label: "登记人", visible: true },
+        { key: 13, label: "累计已到货数量", visible: true },
+        { key: 14, label: "检验单号", visible: true },
+        { key: 15, label: "检验数量", visible: true },
+        { key: 16, label: "审核状态", visible: true },
+        { key: 17, label: "审核人", visible: true },
+        { key: 18, label: "审核时间", visible: true },
+        { key: 19, label: "检验时间", visible: true },
+        { key: 20, label: "检验人", visible: true },
+        { key: 21, label: "处理结果", visible: true },
+        { key: 22, label: "检验结果", visible: true },
+        { key: 23, label: "图号", visible: true },
+        { key: 24, label: "采购订单", visible: true },
       ],
       // 显示隐藏持久化参数
-      columnsList: []
-    }
+      columnsList: [],
+    };
   },
   computed: {
-    ...mapGetters([
-      'userId'
-    ])
+    ...mapGetters(["userId"]),
   },
   created() {
     // 获取显隐列列表
-    this.getColumnsList()
-    this.getList()
+    this.getColumnsList();
+    this.getList();
   },
   methods: {
     /** 查询列表 */
     getList() {
-      this.loading = true
+      this.loading = true;
       // 执行查询
       const params = {
         ...this.queryParams,
         ...this.paramsQuery,
-        ...this.advParams
-      }
-      getIqcInspectionPage(params).then(response => {
-        this.list = response.data.list
-        this.users = response.data.users
-        this.total = response.data.total
-      }).finally(() => {
-        this.loading = false
-      })
+        ...this.advParams,
+      };
+      getIqcInspectionPage(params)
+        .then((response) => {
+          this.list = response.data.list;
+          this.users = response.data.users;
+          this.total = response.data.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
     },
     /** 取消按钮 */
     cancel() {
-      this.open = false
-      this.reset()
+      this.open = false;
+      this.reset();
     },
     /** 表单重置 */
     reset() {
@@ -355,32 +409,42 @@ export default {
         wmsStoreId: undefined,
         inQty: undefined,
         funitId: undefined,
-        remark: undefined
-      }
-      this.resetForm('form')
+        remark: undefined,
+      };
+      this.resetForm("form");
     },
     handleName(row, column, cellValue) {
-      const user = this.users.find(item => item.id.toString() === cellValue)
-      return user && user.nickname
+      const user = this.users.find((item) => item.id.toString() === cellValue);
+      return user && user.nickname;
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNo = 1
-      this.getList()
+      this.queryParams.pageNo = 1;
+      this.getList();
     },
     // 撤回
     callBack({ id }) {
-      this.loading = true
-      inspectionReBack({ inspectionId: id }).then(response => {
-        this.$message.success('已撤回')
-        this.getList()
-      }).finally(() => {
-        this.loading = false
-      })
+      this.loading = true;
+      inspectionReBack({ inspectionId: id })
+        .then((response) => {
+          this.$message.success("已撤回");
+          this.getList();
+        })
+        .finally(() => {
+          this.loading = false;
+        });
     },
     // 查看检验详情
     handleInspectDetails(row) {
-      const { materialLots, materialNo, auditStatus, auditor, creator, processNo, unitCode } = row
+      const {
+        materialLots,
+        materialNo,
+        auditStatus,
+        auditor,
+        creator,
+        processNo,
+        unitCode,
+      } = row;
       // this.$refs.inspectDetail.visible = true
       // this.$refs.inspectDetail.queryParams.materialLots = materialLots
       // this.$refs.inspectDetail.queryParams.materialNo = materialNo
@@ -391,34 +455,68 @@ export default {
       // this.$refs.inspectDetail.queryParams.processNo = processNo
 
       // 跳转到检验执行
-      this.$router.push({ path: '/quality/iqcInspection/inspect-details', query: { auditStatus, unitCode, materialLots, materialNo, processNo, type: 0, auditor, creator }})
+      this.$router.push({
+        path: "/quality/iqcInspection/inspect-details",
+        query: {
+          auditStatus,
+          unitCode,
+          materialLots,
+          materialNo,
+          processNo,
+          type: 0,
+          auditor,
+          creator,
+        },
+      });
     },
     // 获取显示隐藏列
     getColumnsList() {
-      const { componentName } = this.$route.meta || null
+      const { componentName } = this.$route.meta || null;
       const params = {
         userId: this.userId,
-        vueForm: componentName
-      }
-      getFormColumnsList(params).then(res => {
-        if (isArray(res.data)) {
-          this.columnsList = res.data.length === 0 ? this.columns : res.data
-        } else {
-          this.columnsList = this.columns
-        }
-      }).catch((err) => {
-        if (err) {
-          this.columnsList = this.columns
-        }
-      }).finally(() => {
-        this.$emit('columns', this.columnsList)
-      })
-    }
-  }
-}
+        vueForm: componentName,
+      };
+      getFormColumnsList(params)
+        .then((res) => {
+          if (isArray(res.data)) {
+            this.columnsList = res.data.length === 0 ? this.columns : res.data;
+          } else {
+            this.columnsList = this.columns;
+          }
+        })
+        .catch((err) => {
+          if (err) {
+            this.columnsList = this.columns;
+          }
+        })
+        .finally(() => {
+          this.$emit("columns", this.columnsList);
+        });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      // 处理查询参数
+      const params = {
+        ...this.queryParams,
+        ...this.paramsQuery,
+        ...this.advParams,
+      };
+      params.pageNo = undefined;
+      params.pageSize = undefined;
+      this.$modal
+        .confirm("是否确认导出质检结果数据?")
+        .then(() => {
+          this.exportLoading = true;
+          return exportQualityInspectionResults(params);
+        })
+        .then((response) => {
+          this.$download.excel(response, "质检结果.xls");
+          this.exportLoading = false;
+        })
+        .catch(() => {});
+    },
+  },
+};
 </script>
 
-      <style>
-
-      </style>
-
+<style></style>

+ 11 - 1
src/views/wms/quality/iqcInspection/components/AwaitIqcInspection.vue

@@ -62,6 +62,15 @@
             width="150"
             show-overflow-tooltip
           />
+          <el-table-column
+            v-if="columnsList[23].visible"
+            :key="Math.random()"
+            label="图号"
+            align="center"
+            prop="drawingNo"
+            width="150"
+            show-overflow-tooltip
+          />
           <el-table-column
             v-if="columnsList[6].visible"
             :key="Math.random()"
@@ -277,7 +286,7 @@ export default {
         { key: 7, label: "检验状态", visible: true },
         { key: 8, label: "单位", visible: true },
         { key: 9, label: "供应商", visible: true },
-        { key: 10, label: "存储条件", visible: true },
+        { key: 10, label: "存储条件", visible: false },
         { key: 11, label: "登记时间", visible: true },
         { key: 12, label: "登记人", visible: true },
         { key: 13, label: "累计已到货数量", visible: true },
@@ -290,6 +299,7 @@ export default {
         { key: 20, label: "检验人", visible: true },
         { key: 21, label: "处理结果", visible: true },
         { key: 22, label: "检验结果", visible: true },
+        { key: 23, label: "图号", visible: true },
       ],
       // 显示隐藏持久化参数
       columnsList: [],

+ 10 - 0
src/views/wms/quality/iqcInspection/components/InspectDetail.vue

@@ -247,6 +247,16 @@
             />
           </el-form-item>
         </el-col>
+        <el-col :span="8">
+          <el-form-item label="图号" prop="drawingNo">
+            <el-input
+              v-model="formParams.drawingNo"
+              placeholder="请输入图号"
+              clearable
+              @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
+        </el-col>
         <el-col :span="8">
           <el-form-item
             v-if="

+ 186 - 137
src/views/wms/quality/iqcInspection/components/inspectionResultApproval.vue

@@ -2,7 +2,7 @@
   <div>
     <!-- 列表 -->
     <AutoResizer :given-height="220">
-      <template #default="{height}">
+      <template #default="{ height }">
         <el-table
           v-if="columnsList.length > 0"
           ref="multipleTable"
@@ -25,7 +25,8 @@
                 type="text"
                 size="mini"
                 @click="handleDetails(scope.row)"
-              >{{ scope.row.id }}</el-button>
+                >{{ scope.row.id }}</el-button
+              >
             </template>
           </el-table-column>
           <el-table-column
@@ -71,6 +72,15 @@
             width="120"
             show-overflow-tooltip
           />
+          <el-table-column
+            v-if="columnsList[23].visible"
+            :key="Math.random()"
+            label="图号"
+            align="center"
+            prop="drawingNo"
+            width="150"
+            show-overflow-tooltip
+          />
           <el-table-column
             v-if="columnsList[7].visible"
             :key="Math.random()"
@@ -79,7 +89,10 @@
             prop="testStatus"
           >
             <template slot-scope="scope">
-              <dict-tag :type="DICT_TYPE.WMS_TEST_STATUS" :value="scope.row.testStatus" />
+              <dict-tag
+                :type="DICT_TYPE.WMS_TEST_STATUS"
+                :value="scope.row.testStatus"
+              />
             </template>
           </el-table-column>
           <el-table-column
@@ -91,7 +104,10 @@
             width="120"
           >
             <template slot-scope="scope">
-              <dict-tag :type="DICT_TYPE.WMS_AUDIT_STATUS" :value="scope.row.auditStatus" />
+              <dict-tag
+                :type="DICT_TYPE.WMS_AUDIT_STATUS"
+                :value="scope.row.auditStatus"
+              />
             </template>
           </el-table-column>
           <el-table-column
@@ -166,7 +182,10 @@
             prop="auditStatus"
           >
             <template slot-scope="scope">
-              <dict-tag :type="DICT_TYPE.WMS_IQC_APPROVAL_STATUS" :value="scope.row.auditStatus" />
+              <dict-tag
+                :type="DICT_TYPE.WMS_IQC_APPROVAL_STATUS"
+                :value="scope.row.auditStatus"
+              />
             </template>
           </el-table-column>
           <el-table-column
@@ -177,7 +196,10 @@
             prop="inspection"
           >
             <template slot-scope="scope">
-              <dict-tag :type="DICT_TYPE.WMS_TEST_RESULT" :value="scope.row.inspection" />
+              <dict-tag
+                :type="DICT_TYPE.WMS_TEST_RESULT"
+                :value="scope.row.inspection"
+              />
             </template>
           </el-table-column>
           <el-table-column
@@ -193,7 +215,8 @@
                 icon="el-icon-refresh"
                 size="mini"
                 @click="callBack(scope.row)"
-              >撤回</el-button>
+                >撤回</el-button
+              >
               <!-- <el-button
                 type="text"
                 icon="el-icon-view"
@@ -234,22 +257,23 @@
     <!-- 检验详情查看 -->
     <!-- <InspectDetail ref="inspectDetail" @resetComplete="resetRefresh" @complete="approvalComplete" /> -->
   </div>
-
 </template>
 
 <script>
-import { getIqcInspectionPage, inspectionReBack } from '@/api/wms/quality/iqcInspectionExecute'
-import { updateAuditStatus } from '@/api/wms/quality/inspectionResultApproval'
+import {
+  getIqcInspectionPage,
+  inspectionReBack,
+} from "@/api/wms/quality/iqcInspectionExecute";
+import { updateAuditStatus } from "@/api/wms/quality/inspectionResultApproval";
 // import InspectDetail from './components/InspectDetail.vue'
-import { getFormColumnsList } from '@/api/system/saveColumns/index'
-import { mapGetters } from 'vuex'
-import { isArray } from 'min-dash'
+import { getFormColumnsList } from "@/api/system/saveColumns/index";
+import { mapGetters } from "vuex";
+import { isArray } from "min-dash";
 
 export default {
-  name: 'InspectionResultApproval',
-  components: {
-  },
-  inject: ['paramsQuery'],
+  name: "InspectionResultApproval",
+  components: {},
+  inject: ["paramsQuery"],
   data() {
     return {
       // 遮罩层
@@ -271,7 +295,7 @@ export default {
       //   用户列表
       users: [],
       // 弹出层标题
-      title: '',
+      title: "",
       //   是否显示查看弹出层
       viewOpen: false,
       advParams: {},
@@ -287,100 +311,103 @@ export default {
         inQty: null,
         funitId: null,
         id: null,
-        processNo: 'PURCHASE'
+        processNo: "PURCHASE",
       },
       excueParams: {},
       //   表单参数
       form: {
-        noPassType: '0'
+        noPassType: "0",
       },
       // 表单校验
       rules: {
         noPassType: [
-          { required: true, message: '请选择处理结果', trigger: 'change' }
-        ]
+          { required: true, message: "请选择处理结果", trigger: "change" },
+        ],
       },
       // 显示隐藏列参数
       columns: [
-        { key: 0, label: '物料批次', visible: true },
-        { key: 1, label: '送货批次', visible: true },
-        { key: 2, label: '采购订单', visible: true },
-        { key: 3, label: '采购数量', visible: true },
-        { key: 4, label: '物料编码', visible: true },
-        { key: 5, label: '物料名称', visible: true },
-        { key: 6, label: '到货数量', visible: true },
-        { key: 7, label: '检验状态', visible: true },
-        { key: 8, label: '单位', visible: true },
-        { key: 9, label: '供应商', visible: true },
-        { key: 10, label: '存储条件', visible: true },
-        { key: 11, label: '登记时间', visible: true },
-        { key: 12, label: '登记人', visible: true },
-        { key: 13, label: '累计已到货数量', visible: true },
-        { key: 14, label: '检验单号', visible: true },
-        { key: 15, label: '检验数量', visible: true },
-        { key: 16, label: '审核状态', visible: true },
-        { key: 17, label: '审核人', visible: true },
-        { key: 18, label: '审核时间', visible: true },
-        { key: 19, label: '检验时间', visible: true },
-        { key: 20, label: '检验人', visible: true },
-        { key: 21, label: '处理结果', visible: true },
-        { key: 22, label: '检验结果', visible: true }
+        { key: 0, label: "物料批次", visible: true },
+        { key: 1, label: "送货批次", visible: true },
+        { key: 2, label: "采购订单", visible: true },
+        { key: 3, label: "采购数量", visible: true },
+        { key: 4, label: "物料编码", visible: true },
+        { key: 5, label: "物料名称", visible: true },
+        { key: 6, label: "到货数量", visible: true },
+        { key: 7, label: "检验状态", visible: true },
+        { key: 8, label: "单位", visible: true },
+        { key: 9, label: "供应商", visible: true },
+        { key: 10, label: "存储条件", visible: false },
+        { key: 11, label: "登记时间", visible: true },
+        { key: 12, label: "登记人", visible: true },
+        { key: 13, label: "累计已到货数量", visible: true },
+        { key: 14, label: "检验单号", visible: true },
+        { key: 15, label: "检验数量", visible: true },
+        { key: 16, label: "审核状态", visible: true },
+        { key: 17, label: "审核人", visible: true },
+        { key: 18, label: "审核时间", visible: true },
+        { key: 19, label: "检验时间", visible: true },
+        { key: 20, label: "检验人", visible: true },
+        { key: 21, label: "处理结果", visible: true },
+        { key: 22, label: "检验结果", visible: true },
+        { key: 23, label: "图号", visible: true },
       ],
       // 显示隐藏持久化参数
-      columnsList: []
-    }
+      columnsList: [],
+    };
   },
   computed: {
-    ...mapGetters([
-      'userId'
-    ])
+    ...mapGetters(["userId"]),
   },
   watch: {
     // 监听路由参数的变化
-    '$route'() {
+    $route() {
       // 判断 id 是否存在并调用 getList 方法
       if (this.$route.query) {
-        this.getList()
+        this.getList();
       }
-    }
+    },
   },
   created() {
     // 获取显隐列列表
-    this.getColumnsList()
-    this.getList()
+    this.getColumnsList();
+    this.getList();
   },
   methods: {
     // 撤回
     callBack({ id }) {
-      this.loading = true
-      inspectionReBack({ inspectionId: id }).then(response => {
-        this.$message.success('已撤回')
-        this.getList()
-      }).finally(() => {
-        this.loading = false
-      })
+      this.loading = true;
+      inspectionReBack({ inspectionId: id })
+        .then((response) => {
+          this.$message.success("已撤回");
+          this.getList();
+        })
+        .finally(() => {
+          this.loading = false;
+        });
     },
     /** 查询列表 */
     getList() {
-      this.loading = true
+      this.loading = true;
       // 执行查询
       const params = {
         ...this.queryParams,
         ...this.paramsQuery,
-        ...this.advParams
-      }
-      getIqcInspectionPage(params).then(response => {
-        this.list = response.data.list
-        this.total = response.data.total
-        this.users = response.data.users
-      }).finally(() => {
-        this.loading = false
-      })
+        ...this.advParams,
+      };
+      getIqcInspectionPage(params)
+        .then((response) => {
+          this.list = response.data.list;
+          this.total = response.data.total;
+          this.users = response.data.users;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
     },
     /** 取消按钮 */
     cancel() {
-      this.open = false
-      this.reset()
+      this.open = false;
+      this.reset();
     },
     /** 表单重置 */
     reset() {
@@ -390,27 +417,35 @@ export default {
         orderType: undefined,
         inQty: undefined,
         funitId: undefined,
-        remark: undefined
-      }
-      this.resetForm('form')
+        remark: undefined,
+      };
+      this.resetForm("form");
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNo = 1
-      this.getList()
+      this.queryParams.pageNo = 1;
+      this.getList();
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm('queryForm')
-      this.handleQuery()
+      this.resetForm("queryForm");
+      this.handleQuery();
     },
     handleName(row, column, cellValue) {
-      const user = this.users.find(item => item.id.toString() === cellValue)
-      return user && user.nickname
+      const user = this.users.find((item) => item.id.toString() === cellValue);
+      return user && user.nickname;
     },
     // 查看检验详情
     handleDetails(row) {
-      const { materialLots, materialNo, auditStatus, id, creator, processNo, unitCode } = row
+      const {
+        materialLots,
+        materialNo,
+        auditStatus,
+        id,
+        creator,
+        processNo,
+        unitCode,
+      } = row;
       // this.$refs.inspectDetail.visible = true
       // this.$refs.inspectDetail.queryParams.materialLots = materialLots
       // this.$refs.inspectDetail.queryParams.materialNo = materialNo
@@ -421,79 +456,93 @@ export default {
       // this.$refs.inspectDetail.queryParams.processNo = processNo
 
       // 跳转到检验执行
-      this.$router.push({ path: '/quality/iqcInspection/inspect-details', query: { id, auditStatus, unitCode, materialLots, materialNo, processNo, type: 0, creator }})
+      this.$router.push({
+        path: "/quality/iqcInspection/inspect-details",
+        query: {
+          id,
+          auditStatus,
+          unitCode,
+          materialLots,
+          materialNo,
+          processNo,
+          type: 0,
+          creator,
+        },
+      });
     },
     handleComplete(qualified, auditStatus) {
       if (qualified === 1) {
-        if (this.form.noPassType === '') {
-          this.$modal.msgWarning('处理结果不能为空~')
-          return
+        if (this.form.noPassType === "") {
+          this.$modal.msgWarning("处理结果不能为空~");
+          return;
         }
       }
-      this.submitLoading = true
+      this.submitLoading = true;
       const params = {
         inspection: qualified,
         materialNo: this.queryParams.materialNo,
         noPassType: this.form.noPassType,
         materialLots: this.queryParams.materialLots,
         id: this.queryParams.id,
-        auditStatus
-      }
-      updateAuditStatus(params).then(res => {
-        const msg = auditStatus === 1 ? '审核通过' : '审核不通过'
-        this.$modal.msgSuccess('审核完成!产品' + msg)
-        this.$emit('complete')
-        this.visible = false
-        this.open = false
-        this.finishOpen = false
-        this.getList()
-        this.reset()
-        this.submitLoading = false
-        this.queryParams.materialLots = undefined
-        this.queryParams.materialNo = undefined
-        this.queryParams.id = undefined
-      }).finally(() => {
-        this.submitLoading = false
-        this.queryParams.materialLots = undefined
-        this.queryParams.materialNo = undefined
-        this.queryParams.id = undefined
-      })
+        auditStatus,
+      };
+      updateAuditStatus(params)
+        .then((res) => {
+          const msg = auditStatus === 1 ? "审核通过" : "审核不通过";
+          this.$modal.msgSuccess("审核完成!产品" + msg);
+          this.$emit("complete");
+          this.visible = false;
+          this.open = false;
+          this.finishOpen = false;
+          this.getList();
+          this.reset();
+          this.submitLoading = false;
+          this.queryParams.materialLots = undefined;
+          this.queryParams.materialNo = undefined;
+          this.queryParams.id = undefined;
+        })
+        .finally(() => {
+          this.submitLoading = false;
+          this.queryParams.materialLots = undefined;
+          this.queryParams.materialNo = undefined;
+          this.queryParams.id = undefined;
+        });
     },
     // 重新检验刷新
     resetRefresh() {
-      this.getList()
-      this.$emit('resetComplete')
+      this.getList();
+      this.$emit("resetComplete");
     },
     approvalComplete() {
-      this.getList()
-      this.$emit('alreadyComplete')
+      this.getList();
+      this.$emit("alreadyComplete");
     },
     // 获取显示隐藏列
     getColumnsList() {
-      const { componentName } = this.$route.meta || null
+      const { componentName } = this.$route.meta || null;
       const params = {
         userId: this.userId,
-        vueForm: componentName
-      }
-      getFormColumnsList(params).then(res => {
-        if (isArray(res.data)) {
-          this.columnsList = res.data.length === 0 ? this.columns : res.data
-        } else {
-          this.columnsList = this.columns
-        }
-      }).catch((err) => {
-        if (err) {
-          this.columnsList = this.columns
-        }
-      }).finally(() => {
-        this.$emit('columns', this.columnsList)
-      })
-    }
-  }
-}
+        vueForm: componentName,
+      };
+      getFormColumnsList(params)
+        .then((res) => {
+          if (isArray(res.data)) {
+            this.columnsList = res.data.length === 0 ? this.columns : res.data;
+          } else {
+            this.columnsList = this.columns;
+          }
+        })
+        .catch((err) => {
+          if (err) {
+            this.columnsList = this.columns;
+          }
+        })
+        .finally(() => {
+          this.$emit("columns", this.columnsList);
+        });
+    },
+  },
+};
 </script>
 
-    <style>
-
-    </style>
-
+<style></style>

+ 106 - 49
src/views/wms/quality/iqcInspection/inspectionExecute.vue

@@ -49,10 +49,64 @@
             />
           </el-form-item>
         </el-col>
+        <!-- <el-col v-show="activeName === 'alreadyIqcInspection'" :span="8"> -->
+        <el-col :span="8">
+          <el-form-item label="检验人" prop="inspector">
+            <el-input
+              v-model="queryParams.inspector"
+              placeholder="请输入检验人"
+              clearable
+              @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
+        </el-col>
+        <!-- <el-col v-show="activeName === 'alreadyIqcInspection'" :span="8"> -->
+        <el-col :span="8">
+          <el-form-item label="检验时间" prop="createTime">
+            <el-date-picker
+              v-model="queryParams.createTime"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              type="daterange"
+              range-separator="-"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              :default-time="['00:00:00', '23:59:59']"
+            />
+          </el-form-item>
+        </el-col>
+        <!-- <el-col v-show="activeName === 'alreadyIqcInspection'" :span="8"> -->
+        <el-col :span="8">
+          <el-form-item label="审核人" prop="auditor">
+            <el-input
+              v-model="queryParams.auditor"
+              placeholder="请输入审核人"
+              clearable
+              @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
+        </el-col>
+        <!-- <el-col v-show="activeName === 'alreadyIqcInspection'" :span="8"> -->
+        <el-col :span="8">
+          <el-form-item label="审核时间" prop="auditTime">
+            <el-date-picker
+              v-model="queryParams.auditTime"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              type="daterange"
+              range-separator="-"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              :default-time="['00:00:00', '23:59:59']"
+            />
+          </el-form-item>
+        </el-col>
         <div slot="right">
           <el-form-item label-width="0" class="text-right" style="word">
-            <EasyAdvancedQuery class="mr10" label-width="98px" @advQuery="advQuery">
-              <template #default="{model}">
+            <EasyAdvancedQuery
+              class="mr10"
+              label-width="98px"
+              @advQuery="advQuery"
+            >
+              <template #default="{ model }">
                 <el-row :gutter="10" type="flex">
                   <el-col :span="12">
                     <el-form-item label="物料名称" prop="materialName">
@@ -110,8 +164,12 @@
                 </el-row>
               </template>
             </EasyAdvancedQuery>
-            <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
-            <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+            <el-button type="primary" icon="el-icon-search" @click="handleQuery"
+              >搜索</el-button
+            >
+            <el-button icon="el-icon-refresh" @click="resetQuery"
+              >重置</el-button
+            >
           </el-form-item>
         </div>
       </QueryFormWrapper>
@@ -155,26 +213,24 @@
       </el-tab-pane>
     </el-tabs>
     <!-- 分页组件 -->
-
   </div>
 </template>
 
 <script>
-import AwaitIqcInspection from './components/AwaitIqcInspection.vue'
-import AlreadyIqcInspection from './components/AlreadyIqcInspection.vue'
-import inspectionResultApproval from './components/inspectionResultApproval.vue'
-
+import AwaitIqcInspection from "./components/AwaitIqcInspection.vue";
+import AlreadyIqcInspection from "./components/AlreadyIqcInspection.vue";
+import inspectionResultApproval from "./components/inspectionResultApproval.vue";
 export default {
-  name: 'InspectionExecute',
+  name: "InspectionExecute",
   components: {
     AwaitIqcInspection,
     AlreadyIqcInspection,
-    inspectionResultApproval
+    inspectionResultApproval,
   },
   provide() {
     return {
-      paramsQuery: this.queryParams
-    }
+      paramsQuery: this.queryParams,
+    };
   },
   data() {
     return {
@@ -185,9 +241,9 @@ export default {
       // 总条数
       total: 0,
       // 显示哪一个表格
-      activeName: 'awaitIqcInspection',
+      activeName: "awaitIqcInspection",
       // 弹出层标题
-      title: '',
+      title: "",
       // 是否显示弹出层
       open: false,
       // 高级查询参数
@@ -204,22 +260,24 @@ export default {
         purchaseOrderNo: null,
         createTime: [],
         materialNo: null,
-        materialName: null
+        materialName: null,
+        inspector: null,
+        auditor: null,
+        auditTime: [],
       },
       // 表单参数
       form: {},
       // 表单校验
-      rules: {
-      },
+      rules: {},
       // 显隐列
-      columnsList: []
-    }
+      columnsList: [],
+    };
   },
   methods: {
     /** 取消按钮 */
     cancel() {
-      this.open = false
-      this.reset()
+      this.open = false;
+      this.reset();
     },
     /** 表单重置 */
     reset() {
@@ -229,56 +287,55 @@ export default {
         wmsStoreAreaId: undefined,
         wmsStoreId: undefined,
         inQty: undefined,
-        funitId: undefined
-      }
-      this.resetForm('form')
+        funitId: undefined,
+      };
+      this.resetForm("form");
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.$refs[this.activeName].getList()
+      this.$refs[this.activeName].getList();
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm('queryForm')
-      this.advParams = {}
-      this.$refs[this.activeName].advParams = {}
-      this.$refs[this.activeName].handleQuery()
+      this.resetForm("queryForm");
+      this.advParams = {};
+      this.$refs[this.activeName].advParams = {};
+      this.$refs[this.activeName].handleQuery();
     },
     handleClick(tab, event) {
-      this.activeName = tab.name
+      this.activeName = tab.name;
       if (this.$refs[this.activeName]) {
-        this.$refs[this.activeName].advParams = this.advParams
-        this.$refs[this.activeName].handleQuery()
+        this.$refs[this.activeName].advParams = this.advParams;
+        this.$refs[this.activeName].handleQuery();
       }
     },
     inspectComplete() {
-      const awaitApproval = this.$refs.awaitApproval
-      awaitApproval && awaitApproval.handleQuery()
+      const awaitApproval = this.$refs.awaitApproval;
+      awaitApproval && awaitApproval.handleQuery();
     },
     resetComplete() {
-      const awaitInspect = this.$refs.awaitIqcInspection
-      awaitInspect && awaitInspect.handleQuery()
+      const awaitInspect = this.$refs.awaitIqcInspection;
+      awaitInspect && awaitInspect.handleQuery();
     },
     alreadyComplete() {
-      const alreadyIqcInspect = this.$refs.alreadyIqcInspection
-      alreadyIqcInspect && alreadyIqcInspect.handleQuery()
+      const alreadyIqcInspect = this.$refs.alreadyIqcInspection;
+      alreadyIqcInspect && alreadyIqcInspect.handleQuery();
     },
     // 高级查询
     advQuery(advQueryParams) {
-      this.advParams = advQueryParams
-      this.$refs[this.activeName].advParams = this.advParams
-      this.handleQuery()
+      this.advParams = advQueryParams;
+      this.$refs[this.activeName].advParams = this.advParams;
+      this.handleQuery();
     },
     getColumns(data) {
-      this.columnsList = data
+      this.columnsList = data;
     },
     // 获取显示隐藏列
     getColumnsList() {
       this.$nextTick(() => {
-        this.$refs[this.activeName].getColumnsList()
-      })
-    }
-  }
-}
+        this.$refs[this.activeName].getColumnsList();
+      });
+    },
+  },
+};
 </script>
-