| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522 |
- <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 }">
- <el-table
- v-if="columnsList.length > 0"
- ref="multipleTable"
- v-loading="loading"
- :data="list"
- :height="height"
- border
- >
- <el-table-column
- v-if="columnsList[14].visible"
- :key="Math.random()"
- label="检验单号"
- align="center"
- prop="id"
- fixed="left"
- width="165"
- >
- <template slot-scope="scope">
- <el-button
- type="text"
- size="mini"
- @click="handleInspectDetails(scope.row)"
- >{{ scope.row.id }}</el-button
- >
- </template>
- </el-table-column>
- <el-table-column
- v-if="columnsList[0].visible"
- :key="Math.random()"
- label="物料批次"
- align="center"
- prop="materialLots"
- width="120"
- show-overflow-tooltip
- />
- <el-table-column
- v-if="columnsList[1].visible"
- :key="Math.random()"
- label="送货批次"
- align="center"
- prop="deliverBatch"
- width="150"
- show-overflow-tooltip
- />
- <el-table-column
- v-if="columnsList[15].visible"
- :key="Math.random()"
- label="检验数量"
- align="center"
- prop="receiptQty"
- />
- <el-table-column
- v-if="columnsList[4].visible"
- :key="Math.random()"
- label="物料编码"
- align="center"
- prop="materialNo"
- width="120"
- show-overflow-tooltip
- />
- <el-table-column
- v-if="columnsList[5].visible"
- :key="Math.random()"
- label="物料名称"
- align="center"
- prop="materialName"
- 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()"
- label="审核人"
- align="center"
- prop="auditor"
- />
- <el-table-column
- v-if="columnsList[7].visible"
- :key="Math.random()"
- label="检验状态"
- align="center"
- prop="testStatus"
- >
- <template slot-scope="scope">
- <dict-tag
- :type="DICT_TYPE.WMS_TEST_STATUS"
- :value="scope.row.testStatus"
- />
- </template>
- </el-table-column>
- <el-table-column
- v-if="columnsList[16].visible"
- :key="Math.random()"
- label="审核状态"
- align="center"
- prop="auditStatus"
- width="120"
- >
- <template slot-scope="scope">
- <dict-tag
- :type="DICT_TYPE.WMS_AUDIT_STATUS"
- :value="scope.row.auditStatus"
- />
- </template>
- </el-table-column>
- <el-table-column
- v-if="columnsList[8].visible"
- :key="Math.random()"
- label="单位"
- align="center"
- prop="unitCode"
- />
- <el-table-column
- v-if="columnsList[9].visible"
- :key="Math.random()"
- label="供应商"
- align="center"
- prop="supplierName"
- width="120"
- show-overflow-tooltip
- />
- <el-table-column
- v-if="columnsList[10].visible"
- :key="Math.random()"
- label="存储条件"
- align="center"
- prop="storageEnvironment"
- 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()"
- label="检验时间"
- align="center"
- prop="createTime"
- width="160"
- >
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.createTime) }}</span>
- </template>
- </el-table-column>
- <el-table-column
- v-if="columnsList[18].visible"
- :key="Math.random()"
- label="审核时间"
- align="center"
- prop="auditTime"
- width="160"
- >
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.auditTime) }}</span>
- </template>
- </el-table-column>
- <el-table-column
- v-if="columnsList[20].visible"
- :key="Math.random()"
- label="检验人"
- align="center"
- prop="inspector"
- width="100"
- />
- <el-table-column
- v-if="columnsList[21].visible"
- :key="Math.random()"
- label="处理结果"
- align="center"
- prop="auditStatus"
- >
- <template slot-scope="scope">
- <dict-tag
- :type="DICT_TYPE.WMS_IQC_APPROVAL_STATUS"
- :value="scope.row.auditStatus"
- />
- </template>
- </el-table-column>
- <el-table-column
- v-if="columnsList[22].visible"
- :key="Math.random()"
- label="检验结果"
- align="center"
- prop="noPassType"
- >
- <template slot-scope="scope">
- <dict-tag
- :type="DICT_TYPE.WMS_INSPECT_RESULTS"
- :value="scope.row.noPassType"
- />
- </template>
- </el-table-column>
- <el-table-column
- label="操作"
- align="center"
- class-name="small-padding fixed-width"
- width="160"
- fixed="right"
- >
- <template slot-scope="scope">
- <el-button
- type="text"
- icon="el-icon-refresh"
- size="mini"
- @click="callBack(scope.row)"
- >撤回</el-button
- >
- <!-- <el-button
- type="text"
- icon="el-icon-view"
- size="mini"
- @click="InspectDetails(scope.row)"
- >检验详情</el-button> -->
- </template>
- </el-table-column>
- </el-table>
- </template>
- </AutoResizer>
- <!-- 分页组件 -->
- <pagination
- v-show="total > 0"
- :total="total"
- :page.sync="queryParams.pageNo"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- <!-- 检验详情查看 -->
- <!-- <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 { exportQualityInspectionResults } from "@/api/wms/quality/iqcInspectionExecute";
- export default {
- name: "AlreadyIqcInspection",
- components: {},
- props: {
- activeName: {
- type: String,
- default: "",
- },
- queryParamspro: {
- type: Object,
- default: () => {},
- },
- },
- inject: ["paramsQuery"],
- data() {
- return {
- // 遮罩层
- loading: false,
- // 导出遮罩层
- exportLoading: false,
- // 显示搜索条件
- showSearch: true,
- filePreviewvisible: false,
- // 总条数
- total: 0,
- // 领料单列表
- list: [],
- // 用户列表
- users: [],
- // 弹出层标题
- title: "",
- // 是否显示弹出层
- open: false,
- baseData: "",
- auditStatusSelect: null,
- // 是否显示查看弹出层
- viewOpen: false,
- advParams: {},
- // 查询参数
- queryParams: {
- pageNo: 1,
- pageSize: 10,
- materialNo: null,
- materialLots: null,
- // type: 3,
- audited: 1,
- processNo: "PURCHASE",
- id: null,
- },
- // 表单参数
- form: {},
- // 表单校验
- 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: 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: [],
- };
- },
- computed: {
- ...mapGetters(["userId"]),
- },
- created() {
- // 获取显隐列列表
- this.getColumnsList();
- this.getList();
- },
- methods: {
- /** 查询列表 */
- getList() {
- 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;
- });
- },
- /** 取消按钮 */
- cancel() {
- this.open = false;
- this.reset();
- },
- /** 表单重置 */
- reset() {
- this.form = {
- id: undefined,
- wmsIncomingReceiptId: undefined,
- orderType: undefined,
- erpStockId: undefined,
- wmsStoreAreaId: undefined,
- wmsStoreId: undefined,
- inQty: undefined,
- funitId: undefined,
- remark: undefined,
- };
- this.resetForm("form");
- },
- handleName(row, column, cellValue) {
- const user = this.users.find((item) => item.id.toString() === cellValue);
- return user && user.nickname;
- },
- /** 搜索按钮操作 */
- handleQuery() {
- 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;
- });
- },
- // 查看检验详情
- handleInspectDetails(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
- // this.$refs.inspectDetail.queryParams.type = 0
- // this.$refs.inspectDetail.apiStatus = auditStatus
- // this.$refs.inspectDetail.adjustForm.auditor = auditor
- // this.$refs.inspectDetail.adjustForm.inspector = creator
- // this.$refs.inspectDetail.queryParams.processNo = processNo
- // 跳转到检验执行
- 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 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);
- });
- },
- /** 导出按钮操作 */
- 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>
|