| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004 |
- <template>
- <div class="ele-body">
- <el-card shadow="never">
- <seek-page
- :seekList="seekList"
- @search="search"
- ref="search"
- :keyValue="'qms-inspectionWork-index-search'"
- ></seek-page>
- <ele-pro-table
- ref="table"
- :columns="columns"
- :datasource="datasource"
- :pageSize="20"
- :pageSizes="[20, 30, 40, 50, 100]"
- @columns-change="handleColumnChange"
- :cache-key="cacheKeyUrl"
- row-key="id"
- @selection-change="selectionChangeHandle"
- >
- <!-- 表头工具栏 -->
- <template v-slot:toolbar>
- <el-button
- v-if="$hasPermission('qms:quality_work_order:close')"
- size="small"
- type="primary"
- class="ele-btn-icon"
- @click="batchClose"
- :disabled="selection.length === 0"
- >
- 批量关闭
- </el-button>
- </template>
- <template v-slot:code="{ row }">
- <el-link
- type="primary"
- :underline="false"
- @click="openDetails(row)"
- >{{ row.code }}</el-link
- >
- </template>
- <template v-slot:sourceCode="{ row }">
- <div>
- <el-link
- type="primary"
- :underline="false"
- @click="openWorkDetails(row)"
- >
- {{
- row.qualityPlanCode ? row.qualityPlanCode : row.workOrderCode
- }}</el-link
- >
- </div>
- </template>
- <template v-slot:files="scope">
- <el-link
- v-for="link in scope.row.files"
- :key="link.id"
- type="primary"
- :underline="false"
- @click="downloadFile(link)"
- >{{ link.name }}</el-link
- >
- </template>
- <template v-slot:qualityType="{ row }">{{
- getDictValue('质检计划类型', row.qualityType)
- }}</template>
- <template v-slot:qualityMode="{ row }">{{
- getDictValue('取样类型', row.qualityMode)
- }}</template>
- <template v-slot:accessory="scope">
- <el-link
- v-for="link in scope.row.accessory"
- :key="link.id"
- type="primary"
- :underline="false"
- @click="downloadFile(link)"
- >{{ link.name }}</el-link
- >
- </template>
- <!-- 操作列 -->
- <template v-slot:action="{ row }">
- <el-link
- type="primary"
- :underline="false"
- @click="addSampleOpen(row)"
- v-if="
- $hasPermission('qms:samplingrecord:save') &&
- ![1, 2].includes(row.status) &&
- row.sampleQuantity < row.total &&
- row.isPendingSample != 1
- "
- >请样</el-link
- >
- <el-link
- type="primary"
- :underline="false"
- @click="sampleCollection(row)"
- v-if="![1, 2].includes(row.status) && row.isPendingSample == 1"
- >收样</el-link
- >
- <el-link
- type="primary"
- :underline="false"
- v-if="
- row.status == 0 &&
- $hasPermission('qms:quality_work_order:update') &&
- row.isPendingSample != 1
- "
- @click="openEdit('edit', row)"
- >报工</el-link
- >
- <el-link
- type="primary"
- :underline="false"
- v-if="
- row.status == 0 &&
- $hasPermission('qms:quality_work_order:transfer')
- "
- @click="openTransfer(row.id)"
- >转派</el-link
- >
- <el-link
- type="primary"
- :underline="false"
- v-if="
- row.status == 0 &&
- row.isPendingSample != 1 &&
- $hasPermission('qms:quality_work_order:qualityInspectionSend')
- "
- @click="qualityInspectionSend(row, 1)"
- >质检派单</el-link
- >
- <el-link
- type="primary"
- :underline="false"
- v-if="
- row.status == 0 &&
- row.isPendingSample != 1 &&
- $hasPermission('qms:quality_work_order:request')
- "
- @click="qualityInspectionSend(row, 2)"
- >质检请托</el-link
- >
- <el-link
- v-if="$hasPermission('qms:quality_work_order:certificate')"
- type="primary"
- :underline="false"
- @click="openNumber(row)"
- >合格证</el-link
- >
- <jimureportBrowse
- style="display: inline-block; margin-left: 5px"
- v-if="
- row.status == 1 &&
- $hasPermission('qms:quality_work_order:qualityReport')
- "
- text="质检报告"
- :businessId="row.id"
- businessCode="qmsqualityinspectionprint"
- ></jimureportBrowse>
- <el-dropdown
- trigger="click"
- v-if="
- row.status == 1 &&
- isReportApproval == 1 &&
- (!row.reportApprovalStatus || row.reportApprovalStatus == 0) &&
- isEmptyObject(row.reportTemplateJson) &&
- $hasPermission('qms:quality_work_order:generateReport')
- "
- >
- <el-link type="primary" :underline="false">生成质检报告</el-link>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item
- v-for="item in reportTemplateList"
- :key="item.id"
- @click.native="generateReportApproval(row, item)"
- >{{ item.name
- }}{{
- '(' +
- item.versionSymbol +
- item.bigVersion +
- item.versionMark +
- item.smallVersion +
- ')'
- }}</el-dropdown-item
- >
- </el-dropdown-menu>
- </el-dropdown>
- <el-link
- v-if="
- row.status == 1 &&
- isReportApproval == 1 &&
- row.reportApprovalStatus &&
- !isEmptyObject(row.reportTemplateJson) &&
- $hasPermission('qms:quality_work_order:generateReport')
- "
- type="primary"
- :underline="false"
- @click="openReport(row)"
- >查看质检报告</el-link
- >
- <!-- 质检报告审批 -->
- <el-link
- v-if="
- row.status == 1 &&
- isReportApproval == 1 &&
- !row.reportApprovalStatus &&
- $hasPermission('qms:quality_work_order:qualityReportApproval')
- "
- type="primary"
- :underline="false"
- @click="reportApprovalSubmit(row)"
- >质检报告审批</el-link
- >
- <el-popconfirm
- class="ele-action"
- title="确定要关闭吗?"
- @confirm="close(row)"
- v-if="
- row.status == 0 &&
- row.qualityType == 2 &&
- $hasPermission('qms:quality_work_order:close')
- "
- >
- <template v-slot:reference>
- <el-link type="warning" :underline="false"> 关闭 </el-link>
- </template>
- </el-popconfirm>
- </template>
- <template v-slot:templateList="{ row }">
- <div style="width: 250px; max-height: 60px; overflow: auto">
- <el-tag
- v-for="(item, index) in row.templateList"
- :key="item.inspectionName + index"
- :type="
- inspectionProjectStatus.find(
- (ProjectStatus) => ProjectStatus.value == item.status
- )?.type
- "
- effect="dark"
- style="margin-top: 4px"
- >
- <span
- :title="
- inspectionProjectStatus.find(
- (ProjectStatus) => ProjectStatus.value == item.status
- )?.label
- "
- >
- {{ item.inspectionName }}
- </span>
- </el-tag>
- </div>
- </template>
- </ele-pro-table>
- </el-card>
- <Certificate
- @search="search"
- v-if="addOpen"
- :rowData="rowData"
- :addOpen="addOpen"
- @closeModel="closeModel"
- />
- <Transfer
- v-if="transferVisible"
- :transferVisible.sync="transferVisible"
- @success="transferConfirm"
- :id="transferId"
- ></Transfer>
- <process-submit-dialog
- api-fun-name="qmsReportApprovalAPI"
- :processSubmitDialogFlag.sync="processSubmitDialogFlag"
- :isCloseRefresh="false"
- v-if="processSubmitDialogFlag"
- ref="processSubmitDialogRef"
- @reload="search"
- ></process-submit-dialog>
- <addSample ref="addSampleRef" @reload="search"></addSample>
- <inspectionProjectTaskSend
- ref="inspectionProjectTaskSendRef"
- @reload="search"
- ></inspectionProjectTaskSend>
- <component
- :is="targetComponent"
- ref="targetComponentRef"
- v-if="targetComponent"
- :key="targetComponent"
- :isView="isView"
- :visible.sync="targetVisible"
- :row="currentRow"
- :item="currentItem"
- @reload="search"
- :type="'0'"
- ></component>
- <mesWorkOrder ref="mesWorkOrderRef"></mesWorkOrder>
- </div>
- </template>
- <script>
- import Certificate from './components/Certificate.vue';
- import search from './components/search.vue';
- import addSample from '@/views/sample/sampleRecord/components/addSample.vue';
- import jimureportBrowse from '@/components/jimureport/browseModal.vue';
- import Transfer from './components/transfer.vue';
- import mesWorkOrder from './components/mesWorkOrder.vue';
- import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
- import inspectionProjectTaskSend from '@/views/inspectionProjectTask/components/inspectionProjectTaskSend.vue';
- import {
- getList,
- removeItem,
- getDetailById,
- closeWorkList,
- verificationQualityInspector,
- closeWork,
- sampleCollection,
- checkByQualityWorkOrderId
- } from '@/api/inspectionWork';
- // import { getWorkorderById } from '@/api/inspectionWork';
- import { queryTodo } from '@/api/bpm/task';
- import dictMixins from '@/mixins/dictMixins';
- import { getFile } from '@/api/system/file';
- import { getByCode } from '@/api/system/dictionary-data';
- import { parameterGetByCode } from '@/api/main/index';
- import tabMixins from '@/mixins/tableColumnsMixin';
- import { getCategoryByCode } from '@/api/main/index';
- import { getQmsReportTemplatePageList } from '@/api/inspectionWork';
- import inspection_report1 from '../inspectionReport/template/inspection_report1.vue';
- import inspection_report2 from '../inspectionReport/template/inspection_report2.vue';
- import { inspectionProjectStatus } from '@/enum/dict.js';
- import { recordingMethodList } from '@/utils/util.js';
- export default {
- mixins: [dictMixins, tabMixins],
- components: {
- search,
- jimureportBrowse,
- Certificate,
- Transfer,
- processSubmitDialog,
- addSample,
- inspectionProjectTaskSend,
- inspection_report1,
- inspection_report2,
- mesWorkOrder
- },
- data() {
- return {
- inspectionProjectStatus,
- cacheKeyUrl: 'qsm-c2e9664a-inspectionWork',
- targetComponent: null,
- isView: false,
- targetVisible: false,
- currentRow: {},
- currentItem: {},
- columns: [
- // 新增多选列
- {
- width: 45,
- type: 'selection',
- columnKey: 'selection',
- align: 'center',
- reserveSelection: true
- },
- {
- type: 'index',
- columnKey: 'index',
- align: 'center',
- label: '序号',
- width: 55,
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- prop: 'code',
- label: '质检工单编码',
- slot: 'code',
- align: 'center',
- width: 180,
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- prop: 'name',
- slot: 'name',
- width: 120,
- label: '质检工单名称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- label: '来源单号',
- prop: 'sourceCode',
- slot: 'sourceCode',
- align: 'center',
- width: 160,
- showOverflowTooltip: true
- },
- {
- label: '类型',
- prop: 'qualityType',
- slot: 'qualityType',
- align: 'center',
- width: 120,
- showOverflowTooltip: true
- },
- {
- label: '质检方式',
- prop: 'qualityMode',
- slot: 'qualityMode',
- align: 'center',
- width: 120,
- showOverflowTooltip: true
- },
- {
- prop: 'qualityName',
- label: '接收人',
- align: 'center',
- width: 120,
- showOverflowTooltip: true,
- formatter: (row) => {
- if (row.qualityName) {
- return row.qualityName;
- }
- return row.qualityNames || '';
- }
- },
- {
- prop: 'executeUserName',
- label: '执行人',
- align: 'center',
- width: 120,
- showOverflowTooltip: true,
- formatter: (row) => {
- return row.executeUserName || '';
- }
- },
- {
- prop: 'qualityTime',
- label: '质检时间',
- align: 'center',
- width: 120,
- showOverflowTooltip: true
- },
- {
- prop: 'productCode',
- width: 120,
- label: '编码',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'productName',
- width: 120,
- label: '名称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'batchNo',
- label: '批次号',
- align: 'center',
- width: 120,
- showOverflowTooltip: true
- },
- {
- prop: 'inspectionTeamName',
- label: '送检班组',
- align: 'center',
- width: 120,
- showOverflowTooltip: true
- },
- {
- prop: 'createUserName',
- label: '送检人',
- align: 'center',
- width: 120,
- showOverflowTooltip: true
- },
- {
- prop: 'specification',
- label: '规格',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'brandNo',
- label: '牌号',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'colorKey',
- label: '颜色',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'produceTaskName',
- label: '工序',
- align: 'center',
- width: 120,
- showOverflowTooltip: true
- },
- {
- prop: 'total',
- label: '总数量',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'qualifiedNumber',
- label: '合格数',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'qualificationRate',
- label: '合格率',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'noQualifiedNumber',
- label: '不合格数',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'noQualificationRate',
- label: '不合格率',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'hours',
- label: '工时',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- label: '附件',
- prop: 'accessory',
- align: 'center',
- slot: 'accessory',
- showOverflowTooltip: true
- },
- {
- label: '创建时间',
- prop: 'createTime',
- align: 'center',
- width: 160
- },
- {
- prop: 'recordingMethod',
- label: '记录方法',
- align: 'center',
- formatter: (row) => {
- return (
- recordingMethodList.find(
- (item) => item.value == row.recordingMethod
- )?.label || ''
- );
- },
- width: 130,
- showOverflowTooltip: true
- },
- {
- label: '进度',
- prop: 'templateList',
- slot: 'templateList',
- align: 'center',
- width: 250
- },
- {
- prop: 'status',
- label: '状态',
- align: 'center',
- width: 80,
- formatter: (row, column, cellValue) => {
- // 状态(0未报工;1已报工;2已关闭;3待取样)
- switch (cellValue) {
- case 0:
- return '未报工';
- case 1:
- return '已报工';
- case 2:
- return '已关闭';
- case 3:
- return '待请样';
- default:
- return '';
- }
- },
- fixed: 'right'
- },
- {
- columnKey: 'action',
- label: '操作',
- align: 'center',
- width: 200,
- resizable: false,
- slot: 'action',
- fixed: 'right'
- }
- ],
- formData: {
- certificateNumber: ''
- },
- processSubmitDialogFlag: false,
- rowData: {},
- // typeList: [], //类型列表
- // qualityMode: [], //取样类型
- // 状态(0未报工;1已报工;2已关闭;3待取样)
- statusList: [
- {
- value: 0,
- label: '未报工'
- },
- {
- value: 1,
- label: '已报工'
- }
- // ,
- // {
- // value: 2,
- // label: '已关闭'
- // },
- // {
- // value: 3,
- // label: '待取样'
- // }
- ],
- addOpen: false,
- transferVisible: false,
- transferId: '',
- isReportApproval: 0,
- selection: [], // 存储选中的行数据
- reportTemplateList: [], // 报表模板列表
- templateArr: ['inspection_report1', 'ABBCCC']
- };
- },
- created() {
- this.requestDict('质检计划类型');
- this.requestDict('不良品处理类型');
- this.requestDict('取样类型');
- this.getCode();
- this.getReportTemplateList();
- // this.getTnspectionPlanType();
- // this.getQualityMethodCode();
- },
- computed: {
- seekList() {
- return [
- {
- label: '工单编码:',
- value: 'code',
- type: 'input',
- placeholder: ''
- },
- {
- label: '工单名称:',
- value: 'name',
- type: 'input',
- placeholder: ''
- },
- {
- label: '来源单号:',
- value: 'sourceCode',
- type: 'input',
- placeholder: ''
- },
- {
- label: '类型:',
- value: 'qualityType',
- type: 'DictSelection',
- dictName: '质检计划类型',
- placeholder: ''
- },
- {
- label: '质检方式:',
- value: 'qualityMode',
- type: 'DictSelection',
- dictName: '取样类型',
- placeholder: ''
- },
- {
- label: '编码:',
- value: 'productCode',
- type: 'input',
- placeholder: ''
- },
- {
- label: '名称:',
- value: 'productName',
- type: 'input',
- placeholder: ''
- },
- {
- label: '质检人:',
- value: 'qualityName',
- type: 'input',
- placeholder: ''
- },
- {
- label: '状态:',
- value: 'status',
- type: 'select',
- placeholder: '',
- planList: this.statusList
- },
- {
- label: '记录方法:',
- value: 'recordingMethod',
- type: 'select',
- placeholder: '',
- planList: recordingMethodList
- }
- ];
- },
- clientEnvironmentId() {
- return this.$store.state.user.info.clientEnvironmentId;
- }
- },
- methods: {
- getReportTemplateList() {
- getQmsReportTemplatePageList({
- pageNum: 1,
- pageSize: 999,
- isEnabled: 1
- })
- .then((res) => {
- this.reportTemplateList = res.list;
- console.log('reportTemplateList', this.reportTemplateList);
- })
- .catch((err) => {
- console.error('获取报表模板列表失败:', err);
- // this.$message.error('获取报表模板列表失败:' + (err.message || '操作异常'));
- });
- },
- generateReportApproval(row, item) {
- console.log('item~~~', item);
- console.log('generateReportApproval', row, item);
- this.targetComponent = item.code;
- this.isView = false;
- this.currentRow = row;
- this.currentItem = item;
- // this.$refs.targetComponentRef.open(item, row);
- this.$nextTick(() => {
- // this.$refs.targetComponentRef.open(row, isView);
- this.targetVisible = true;
- console.log('targetVisible~~~~', this.targetVisible);
- });
- },
- async openReport(row) {
- // console.log('openReport', row);
- const data = await getDetailById(row.id);
- console.log(data, 'data');
- this.targetComponent = row.reportTemplateCode;
- this.isView = true;
- this.currentRow = row;
- this.currentRow.reportApprovalTaskVos =
- data.data.reportApprovalTaskVos || {};
- this.$nextTick(() => {
- this.targetVisible = true;
- });
- },
- selectionChangeHandle(val) {
- this.selection = val;
- },
- async addSampleOpen(row) {
- const code = await verificationQualityInspector(row.id);
- if (code == '-1') {
- return;
- }
- const is = await checkByQualityWorkOrderId(row.id);
- if (is) {
- this.$message.warning('此工单存在未处理完的请样记录,请检查!');
- return;
- }
- this.$refs.addSampleRef.open('add', row);
- },
- async sampleCollection(row) {
- const code = await verificationQualityInspector(row.id);
- if (code == '-1') {
- return;
- }
- sampleCollection({ id: row.id }).then((res) => {
- this.$message.success('收样成功');
- this.search();
- });
- },
- // 批量关闭
- batchClose() {
- const validRows = this.selection.filter(
- (row) => row.status === 0 && row.qualityType === 2
- );
- if (validRows.length === 0) {
- this.$message.warning('所选工单中没有可关闭的工单');
- return;
- }
- this.$confirm(`确定关闭选中的 ${validRows.length} 个工单吗?`, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(async () => {
- try {
- await closeWorkList(validRows.map((row) => row.id));
- this.$refs.table.clearSelection();
- this.search();
- } catch (err) {
- this.$message.error('批量关闭失败:' + (err.message || '操作异常'));
- }
- });
- },
- reportApprovalSubmit(res) {
- this.processSubmitDialogFlag = true;
- this.$nextTick(async () => {
- let params = {
- businessId: res.id,
- businessKey: 'qms_report_approval',
- formCreateUserId: res.createUserId,
- variables: {
- businessCode: res.code,
- businessName: res.name,
- businessType: '质检报告单'
- }
- };
- if (this.clientEnvironmentId == 5) {
- const data = await getCategoryByCode(res.productCode);
- if (data && data.categoryLevelCodePath?.includes('W3-209')) {
- params.businessKey = 'qms_report_approval1';
- } else {
- params.businessKey = 'qms_report_approval';
- }
- }
- this.$refs.processSubmitDialogRef.init(params);
- });
- },
- getCode() {
- parameterGetByCode({
- code: 'qms_report_approval'
- }).then((res) => {
- this.isReportApproval = res.value;
- });
- },
- //质检项派单
- async qualityInspectionSend(row, type) {
- const code = await verificationQualityInspector(row.id);
- if (code == '-1') {
- return;
- }
- this.$refs.inspectionProjectTaskSendRef.open(row, type);
- },
- async datasource({ page, where, limit }) {
- try {
- await queryTodo({});
- } catch (err) {
- console.error('调用queryTodo失败:', err);
- }
- return getList({
- ...where,
- pageNum: page,
- size: limit
- });
- },
- search(where) {
- this.$refs.table.reload({
- where: where
- // page: 1
- });
- },
- isEmptyObject(obj) {
- return Object.keys(obj).length === 0;
- },
- async openEdit(type, row) {
- const menusList = this.$store.state.user.menus;
- let found = false;
- if (type == 'edit') {
- const code = await verificationQualityInspector(row.id);
- if (code == '-1') {
- return;
- }
- }
- for (const item of menusList) {
- if (item.children) {
- for (const item2 of item.children) {
- if (item2.path === '/inspectionWork/edit') {
- found = true;
- const id = type !== 'add' ? row.id : '';
- const qualityType = type !== 'add' ? row.qualityType : null;
- const qualityTimeStart = row.qualityTimeStart || '';
- this.$router.push({
- path: '/inspectionWork/edit',
- query: {
- type,
- id,
- qualityType,
- qualityTimeStart
- }
- });
- return;
- }
- }
- }
- }
- if (!found) {
- this.$message.error('请到角色管理配置菜单权限!');
- }
- },
- openDetails(row) {
- let id = row.id;
- this.$router.push({
- path: '/inspectionWork/details',
- query: { id, path: '/inspectionWork', name: '工单' }
- });
- },
- openWorkDetails(row) {
- if (row.qualityPlanCode) {
- } else {
- this.$refs.mesWorkOrderRef.open(row);
- }
- },
- downloadFile(file) {
- getFile({ objectName: file.storePath }, file.name);
- },
- remove(row) {
- removeItem([row.id])
- .then((message) => {
- this.$message.success(message);
- this.done();
- })
- .catch((e) => {});
- },
- done() {
- this.$refs.search.search();
- },
- openNumber(row) {
- this.formData.certificateNumber = row.certificateNumber;
- this.rowData = row;
- this.addOpen = true;
- },
- closeModel() {
- this.addOpen = false;
- },
- async close(row) {
- const code = await verificationQualityInspector(row.id);
- if (code == '-1') {
- return;
- }
- await closeWork(row);
- this.done();
- },
- // async getTnspectionPlanType() {
- // let res = await getByCode('inspection_plan_type');
- // if (res?.code == 0) {
- // let list = res.data.map((item) => {
- // let key = Object.keys(item)[0];
- // return { value: key, label: item[key] };
- // });
- // this.typeList = list;
- // }
- // },
- // async getQualityMethodCode() {
- // let res = await getByCode('quality_method_code');
- // if (res?.code == 0) {
- // let list = res.data.map((item) => {
- // let key = Object.keys(item)[0];
- // return { value: key, label: item[key] };
- // });
- // this.qualityMode = list;
- // }
- // },
- async openTransfer(id) {
- const code = await verificationQualityInspector(id);
- if (code == '-1') {
- return;
- }
- this.transferVisible = true;
- this.transferId = id;
- },
- transferConfirm(id) {
- this.transferVisible = false;
- this.$message.success('转派成功');
- this.done();
- }
- }
- };
- </script>
|