|
|
<template> <div class="mod-config"> <!-- 条件查询 --> <el-form :inline="true" label-position="top" :model="searchData"> <el-form-item :label="$t('qc.method.colSite')"> <el-select v-model="searchData.site" :placeholder="$t('qc.common.selectPlaceholder')" clearable filterable style="width: 140px"> <el-option v-for="i in siteList" :key="i.site" :label="i.sitename ? (i.site + ' ' + i.sitename) : i.site" :value="i.site"> </el-option> </el-select> </el-form-item> <!-- <el-form-item :label="'BU'"> <el-select v-model="searchData.bu" :placeholder="$t('qc.common.selectPlaceholder')" clearable style="width: 120px"> <el-option v-for="i in buList" :key="i.site + '_' + i.buNo" :label="i.sitename + ' ' + i.buDesc" :value="i.buNo"> <span style="float: left;width: 100px">{{ i.sitename }}</span> <span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px"> {{ i.buDesc }} </span> </el-option> </el-select> </el-form-item> --> <el-form-item :label="$t('qc.table.materialCode')"> <el-input v-model="searchData.partNo" clearable style="width: 100px"></el-input> </el-form-item> <!-- <el-form-item :label="'SKU'"> <el-input v-model="searchData.sku" clearable style="width: 120px"></el-input> </el-form-item> --> <el-form-item :label="$t('qc.table.materialName')"> <el-input v-model="searchData.partDesc" clearable style="width: 180px"></el-input> </el-form-item> <el-form-item :label="$t('qc.table.partType')"> <el-input v-model="searchData.partType" clearable style="width: 120px"></el-input> </el-form-item> <el-form-item :label="$t('qc.table.spec')"> <el-input v-model="searchData.spec" clearable style="width: 120px"></el-input> </el-form-item> <el-form-item :label="' '"> <el-button type="primary" :loading="searchLoading" @click="getDataList()">{{ $t('qc.common.search') }}</el-button> </el-form-item> <el-form-item :label="' '"> <el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{ $t('qc.common.export') }}</el-button> </el-form-item> <el-form-item :label="' '"> <el-button v-if="!authSync" type="primary" :loading="syncLoading" @click="syncPartCatalog()" style="margin-left: 2px">{{ $t('qc.partAttributePage.dataSync') }}</el-button> </el-form-item> <el-form-item :label="' '"> <el-button v-if="!authSave" type="primary" @click="openDieMoldAddModal()" style="margin-left: 2px">{{ $t('qc.partAttributePage.addDieMold') }}</el-button> </el-form-item> <el-form-item :label="' '"> <el-button v-if="!authItemImport" type="primary" icon="el-icon-upload" @click="openPartSpecBatchUpload()" style="margin-left: 2px">{{ $t('qc.partAttributePage.projectImport') }}</el-button> </el-form-item> <el-form-item :label="' '"> <el-button type="primary" icon="el-icon-upload" @click="openPartFileCollectBatchUpload()" style="margin-left: 2px">{{ $t('qc.partAttributePage.fileCollectBatchImport') }}</el-button> </el-form-item> </el-form>
<!-- 展示列表 --> <el-table :height="height" :data="dataList" border v-loading="searchLoading" ref="partTable" class="part-table" :row-style="rowStyle" :row-class-name="partTableRowClassName" @row-click="partClickRow" @current-change="changeCurrentRow" style="width: 100%;"> <el-table-column v-for="(item,index) in columnList" :key="index" :sortable="item.columnSortable" :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip" :align="item.align" :fixed="item.fixed === ''?false:item.fixed" :min-width="item.columnWidth" :label="item.columnLabel"> <template slot-scope="scope"> <span v-if="!item.columnHidden"> <span v-if="columnsProp.includes(item.columnProp)">{{ scope.row[`${item.columnProp}Desc`] }}</span> <span v-else> {{ scope.row[item.columnProp] }} </span> </span> <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px" /></span> </template> </el-table-column> <el-table-column fixed="right" header-align="center" align="center" width="100" :label="$t('qc.common.operation')"> <template slot-scope="scope"> <el-link style="cursor: pointer" @click="updateModal(scope.row)">{{ $t('qc.common.edit') }}</el-link> <el-link style="cursor: pointer" @click="updateModal2(scope.row)">{{ $t('qc.partAttributePage.detail') }}</el-link> <!-- <el-link v-if="!authFile" style="cursor: pointer" @click="sopFileList(scope.row)">SOP文件</el-link>--> </template> </el-table-column> </el-table>
<!-- 分页栏 --> <el-pagination style="margin-top: 0px" @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex" :page-sizes="[20, 50, 100, 200, 500]" :page-size="pageSize" :total="totalPage" layout="total, sizes, prev, pager, next, jumper"> </el-pagination>
<!-- 物料属性新增/修改 --> <el-dialog :title="$t('qc.partAttributePage.dialogPartEdit')" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="900px" class="part-edit-dialog"> <div class="dialog-content"> <el-form :model="modalData" :rules="rules" label-position="top"> <!-- 基本信息区域 --> <div class="form-section"> <div class="section-title">{{ $t('qc.partAttributePage.sectionBasicInfo') }}</div> <el-row :gutter="20"> <el-col :span="6"> <el-form-item :label="$t('qc.table.materialCode')"> <el-input v-model="modalData.partNo" disabled></el-input> </el-form-item> </el-col> <el-col :span="10"> <el-form-item :label="$t('qc.table.materialName')"> <el-input v-model="modalData.partDesc" disabled></el-input> </el-form-item> </el-col> <el-col :span="4"> <el-form-item :label="$t('qc.partAttributePage.umId')"> <el-input v-model="modalData.umId" disabled></el-input> </el-form-item> </el-col> <el-col :span="4"> <el-form-item :label="$t('qc.common.status')"> <el-select v-model="modalData.active" :disabled="modalDisableFlag" style="width: 100%"> <el-option :label="$t('qc.partAttributePage.statusActive')" value="Y"></el-option> <el-option :label="$t('qc.partAttributePage.statusInactive')" value="N"></el-option> </el-select> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="6"> <el-form-item :label="$t('qc.partAttributePage.partCategory')"> <el-input v-model="modalData.partType" disabled></el-input> </el-form-item> </el-col> <el-col :span="10"> <el-form-item :label="$t('qc.partAttributePage.partDescEn')"> <el-input v-model="modalData.partDescEn" disabled></el-input> </el-form-item> </el-col> <el-col :span="8"> <el-form-item :label="$t('qc.table.spec')"> <el-input v-model="modalData.spec" disabled></el-input> </el-form-item> </el-col> </el-row> </div>
<!-- 有效期管理区域 --> <!-- <div class="form-section"> <div class="section-title">有效期管理</div> <el-row :gutter="20"> <el-col :span="8"> <el-form-item label=" "> <el-checkbox v-model="modalData.expirationFlag" :disabled="modalDisableFlag" true-label="Y">启用物料有效期管理</el-checkbox> </el-form-item> </el-col> <el-col :span="8" style="margin-top: 8px"> <el-form-item label="有效期天数"> <el-input-number :controls="false" :step="0" v-model="modalData.expirationDay" :disabled="modalDisableFlag" style="width: 100%"></el-input-number> </el-form-item> </el-col> <el-col :span="8" style="margin-top: 8px"> <el-form-item label="有效期预警天数"> <el-input-number :controls="false" :step="0" v-model="modalData.expirationWarningDay" :disabled="modalDisableFlag" style="width: 100%"></el-input-number> </el-form-item> </el-col> </el-row> <el-row :gutter="20" style="margin-top: -20px"> <el-col :span="8"> <el-form-item label=" "> <el-checkbox v-model="modalData.adhesiveActivePeriodFlag" :disabled="modalDisableFlag" true-label="Y">启用物料活性期管理</el-checkbox> </el-form-item> </el-col> <el-col :span="8" style="margin-top: 8px"> <el-form-item label="解冻时长(h)"> <el-input-number :controls="false" :step="0" v-model="modalData.thawingDuration" :disabled="modalDisableFlag" style="width: 100%"></el-input-number> </el-form-item> </el-col> <el-col :span="8" style="margin-top: 8px"> <el-form-item label="累计暴露时长(h)"> <el-input-number :controls="false" :step="0" v-model="modalData.accumulatedExposureDuration" :disabled="modalDisableFlag" style="width: 100%"></el-input-number> </el-form-item> </el-col> </el-row> </div> -->
<!-- 仓库配置区域 --> <!-- <div class="form-section"> <div class="section-title">仓库配置</div> <el-row :gutter="20"> <el-col :span="4"> <el-form-item label="超入比例%"> <el-input-number :controls="false" :step="0" v-model="modalData.exceedInRatio" :disabled="modalDisableFlag" style="width: 100%"></el-input-number> </el-form-item> </el-col> <el-col :span="10"> <el-form-item> <span v-if="modalDisableFlag" slot="label">入库默认仓库</span> <span v-else style="cursor: pointer" slot="label" @click="getBaseList(20, 1)"><a href="#">入库默认仓库</a></span> <el-input v-model="modalData.inboundWarehouseId" :disabled="modalDisableFlag" @change="inWarehouseBlur(20)" style="width: 25%"></el-input> <el-input v-model="modalData.inboundWarehouseName" disabled style="width: 70%"></el-input> </el-form-item> </el-col> <el-col :span="10"> <el-form-item> <span v-if="modalDisableFlag" slot="label">入库默认库位</span> <span v-else style="cursor: pointer" slot="label" @click="getBaseList(22)"><a href="#">入库默认库位</a></span> <el-input v-model="modalData.inboundLocationId" :disabled="modalDisableFlag" @change="locationBlur(22)" style="width: 25%"></el-input> <el-input v-model="modalData.inboundLocationName" disabled style="width: 70%"></el-input> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="4"> <el-form-item label="超领比例%"> <el-input-number :controls="false" :step="0" v-model="modalData.exceedOutRatio" :disabled="modalDisableFlag" style="width: 100%"></el-input-number> </el-form-item> </el-col> <el-col :span="10"> <el-form-item> <span v-if="modalDisableFlag" slot="label">领料默认仓库</span> <span v-else style="cursor: pointer" slot="label" @click="getBaseList(20, 2)"><a href="#">领料默认仓库</a></span> <el-input-group> <el-input v-model="modalData.outboundWarehouseId" :disabled="modalDisableFlag" @change="outWarehouseBlur(20)" style="width: 25%"></el-input> <el-input v-model="modalData.outboundWarehouseName" disabled style="width: 70%"></el-input> </el-input-group> </el-form-item> </el-col> <el-col :span="4"> <el-form-item label="领料方式"> <el-select v-model="modalData.issueMethod" :disabled="modalDisableFlag" placeholder="请选择" style="width: 100%"> <el-option label="按单领料" value="按单领料"></el-option> <el-option label="入库倒冲" value="入库倒冲"></el-option> </el-select> </el-form-item> </el-col> </el-row> </div> -->
<!-- 检验配置区域 --> <div class="form-section"> <div class="section-title">{{ $t('qc.partAttributePage.sectionInspectionConfig') }}</div> <el-row :gutter="20" style="margin-top: 5px"> <el-col :span="4"> <el-checkbox v-model="modalData.iqcExempt" :disabled="modalDisableFlag" true-label="Y">{{ $t('qc.partAttributePage.iqcInspection') }}</el-checkbox> </el-col> <!-- <el-col :span="4"> <el-checkbox v-model="modalData.faiExempt" :disabled="modalDisableFlag" true-label="Y">{{ $t('qc.partAttributePage.faiInspection') }}</el-checkbox> </el-col> --> <el-col :span="4"> <el-checkbox v-model="modalData.ipqcExempt" :disabled="modalDisableFlag" true-label="Y">{{ $t('qc.partAttributePage.ipqcInspection') }}</el-checkbox> </el-col> <!-- <el-col :span="4"> <el-checkbox v-model="modalData.pqcExempt" :disabled="modalDisableFlag" true-label="Y">{{ $t('qc.partAttributePage.pqcInspection') }}</el-checkbox> </el-col> --> <el-col :span="4"> <el-checkbox v-model="modalData.fqcExempt" :disabled="modalDisableFlag" true-label="Y">{{ $t('qc.partAttributePage.fqcInspection') }}</el-checkbox> </el-col> <el-col :span="4"> <el-checkbox v-model="modalData.oqcExempt" :disabled="modalDisableFlag" true-label="Y">{{ $t('qc.partAttributePage.oqcInspection') }}</el-checkbox> </el-col> <el-col :span="4"> <el-checkbox v-model="modalData.sqcExempt" :disabled="modalDisableFlag" true-label="Y">{{ $t('qc.partAttributePage.sqcInspection') }}</el-checkbox> </el-col> </el-row> <!-- <el-row :gutter="20" style="margin-top: 5px">--> <!-- <el-col :span="6">--> <!-- <el-form-item label="默认值">--> <!-- <el-input v-model="modalData.standardValue" :disabled="modalDisableFlag"></el-input>--> <!-- </el-form-item>--> <!-- </el-col>--> <!-- <el-col :span="6">--> <!-- <el-form-item label="标准值">--> <!-- <el-input v-model="modalData.defaultValue" :disabled="modalDisableFlag"></el-input>--> <!-- </el-form-item>--> <!-- </el-col>--> <!-- <el-col :span="6">--> <!-- <el-form-item label="上限值">--> <!-- <el-input v-model="modalData.maxValue" :disabled="modalDisableFlag"></el-input>--> <!-- </el-form-item>--> <!-- </el-col>--> <!-- <el-col :span="6">--> <!-- <el-form-item label="下限值">--> <!-- <el-input v-model="modalData.minValue" :disabled="modalDisableFlag"></el-input>--> <!-- </el-form-item>--> <!-- </el-col>--> <!-- </el-row>--> </div>
<!-- 巡检配置区域 --> <div class="form-section"> <div class="section-title" style="display: flex; justify-content: space-between; align-items: center;"> <span>{{ $t('qc.partAttributePage.sectionPatrolConfig') }}</span> <el-button type="primary" size="mini" @click="openPatrolConfigDialog" :disabled="modalDisableFlag">{{ $t('qc.partAttributePage.specialPatrolConfig') }}</el-button> </div> <el-row :gutter="20"> <el-col :span="8"> <el-form-item :label="$t('qc.partAttributePage.firstInspectionDurationH')"> <el-input-number :controls="false" :step="0" v-model="modalData.firstInspectionDuration" :disabled="modalDisableFlag" style="width: 100%"></el-input-number> </el-form-item> </el-col> <el-col :span="8"> <el-form-item :label="$t('qc.partAttributePage.nextInspectionDurationH')"> <el-input-number :controls="false" :step="0" v-model="modalData.nextInspectionDuration" :disabled="modalDisableFlag" style="width: 100%"></el-input-number> </el-form-item> </el-col> <el-col :span="8"> <el-form-item :label="$t('qc.partAttributePage.totalInspectionDurationH')"> <el-input-number :controls="false" :step="0" v-model="modalData.totalInspectionDuration" :disabled="modalDisableFlag" style="width: 100%"></el-input-number> </el-form-item> </el-col> </el-row> </div>
<!-- 缺陷跟踪区域 --> <div class="form-section"> <div class="section-title" style="display: flex; justify-content: space-between; align-items: center;"> <span>{{ $t('qc.partAttributePage.sectionDefectTracking') }}</span> </div> <el-row :gutter="20"> <el-col :span="6"> <el-form-item :label="$t('qc.partAttributePage.defectThreshold')"> <el-input-number :controls="false" :step="0" v-model="modalData.defectThreshold" :disabled="modalDisableFlag" style="width: 100%"></el-input-number> </el-form-item> </el-col> <el-col :span="6"> <el-form-item :label="$t('qc.partAttributePage.recoveryBatchCount')"> <el-input-number :controls="false" :step="0" v-model="modalData.recoveryBatchCount" :disabled="modalDisableFlag" style="width: 100%"></el-input-number> </el-form-item> </el-col> <el-col :span="6"> <el-form-item :label="$t('qc.partAttributePage.currentDefectCount')"> <el-input-number :controls="false" :step="0" v-model="modalData.currentDefectCount" disabled style="width: 100%"></el-input-number> </el-form-item> </el-col> <el-col :span="6"> <el-form-item :label="$t('qc.partAttributePage.remainingTrackingBatches')"> <el-input-number :controls="false" :step="0" v-model="modalData.remainingTrackingBatches" disabled style="width: 100%"></el-input-number> </el-form-item> </el-col> </el-row> </div> </el-form> </div> <el-footer style="height:35px;margin-top: 15px;text-align:center"> <el-button v-if="!modalDisableFlag" type="primary" :loading="saveLoading" @click="saveData()">{{ $t('qc.common.save') }}</el-button> <el-button type="primary" @click="modalFlag = false">{{ $t('qc.common.close') }}</el-button> </el-footer> </el-dialog>
<!-- 新增刀模 --> <el-dialog :title="$t('qc.partAttributePage.dialogDieMoldAdd')" :close-on-click-modal="false" v-drag :visible.sync="dieMoldAddModalFlag" width="580px" class="part-edit-dialog"> <div class="dialog-content"> <el-form :model="dieMoldAddData" :rules="dieMoldAddRules" ref="dieMoldAddForm" label-position="top"> <el-row :gutter="20"> <el-col :span="8"> <el-form-item :label="'BU'" prop="bu"> <el-select v-model="dieMoldAddData.bu" :placeholder="$t('qc.common.selectPlaceholder')" clearable style="width: 100%" @change="onDieMoldAddBuChange"> <el-option v-for="i in buList" :key="i.site + '_' + i.buNo" :label="i.sitename + ' ' + i.buDesc" :value="i.buNo"> <span style="float: left;width: 100px">{{ i.sitename }}</span> <span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px"> {{ i.buDesc }} </span> </el-option> </el-select> </el-form-item> </el-col>
<el-col :span="8"> <el-form-item :label="$t('qc.partAttributePage.dieMoldFlag')"> <el-input v-model="dieMoldAddData.handle" disabled></el-input> </el-form-item> </el-col> <el-col :span="8"> <el-form-item :label="$t('qc.table.partType')"> <el-input v-model="dieMoldAddData.partType" disabled></el-input> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="8"> <el-form-item :label="$t('qc.iqcPage.dieMoldCode')" prop="partNo"> <el-input v-model="dieMoldAddData.partNo" clearable></el-input> </el-form-item> </el-col> <el-col :span="16"> <el-form-item :label="$t('qc.iqcPage.dieMoldName')" prop="partDesc"> <el-input v-model="dieMoldAddData.partDesc" clearable></el-input> </el-form-item> </el-col> <el-col :span="8"> <el-form-item :label="$t('qc.partAttributePage.umId')"> <el-select v-model="dieMoldAddData.umId" :placeholder="$t('qc.common.selectPlaceholder')" clearable filterable style="width: 100%"> <el-option v-for="i in umList" :key="i.umId" :label="i.umName" :value="i.umId"> </el-option> </el-select> </el-form-item> </el-col> <el-col :span="8"> <el-form-item :label="$t('qc.table.spec')"> <el-input v-model="dieMoldAddData.spec" clearable></el-input> </el-form-item> </el-col> </el-row> <el-row :gutter="20">
<el-col :span="24"> <el-form-item :label="$t('qc.table.remark')"> <el-input type="textarea" :rows="2" v-model="dieMoldAddData.remark" clearable></el-input> </el-form-item> </el-col> </el-row> </el-form> </div> <el-footer style="height:35px;margin-top: 15px;text-align:center"> <el-button type="primary" :loading="dieMoldAddSaveLoading" @click="saveDieMoldPart()">{{ $t('qc.common.save') }}</el-button> <el-button type="primary" @click="dieMoldAddModalFlag = false">{{ $t('qc.common.close') }}</el-button> </el-footer> </el-dialog>
<!-- 巡检特殊配置对话框 --> <el-dialog :title="$t('qc.partAttributePage.dialogPatrolSpecial')" :close-on-click-modal="false" v-drag :visible.sync="patrolConfigDialogFlag" width="900px" append-to-body> <div style="margin-bottom: 10px;"> <el-button type="primary" size="small" icon="el-icon-plus" @click="addPatrolConfig">{{ $t('qc.common.add') }}</el-button> <el-button type="danger" size="small" icon="el-icon-delete" @click="deletePatrolConfig" :disabled="patrolConfigSelections.length === 0">{{ $t('qc.common.delete') }}</el-button> <el-button type="success" size="small" icon="el-icon-upload2" @click="openPatrolConfigImport">{{ $t('qc.common.upload') }}</el-button> </div> <el-table :data="patrolConfigList" border height="400px" v-loading="patrolConfigLoading" @selection-change="patrolConfigSelectionChange" @row-click="patrolConfigRowClick" highlight-current-row style="width: 100%"> <el-table-column type="selection" width="50" align="center"></el-table-column> <el-table-column prop="operationDesc" :label="$t('qc.table.process')" header-align="center" align="left" min-width="150"> <template slot-scope="scope"> <el-select v-model="scope.row.operationDesc" size="small" :placeholder="$t('qc.partAttributePage.selectOperation')" filterable clearable style="width: 100%"> <el-option v-for="item in operationDescList" :key="item" :label="item" :value="item"></el-option> </el-select> </template> </el-table-column> <el-table-column prop="firstInspectionDuration" :label="$t('qc.partAttributePage.firstInspectionDurationH')" header-align="center" align="right" width="140"> <template slot-scope="scope"> <el-input-number :controls="false" :step="0" v-model="scope.row.firstInspectionDuration" size="small" style="width: 100%"></el-input-number> </template> </el-table-column> <el-table-column prop="nextInspectionDuration" :label="$t('qc.partAttributePage.nextInspectionDurationH')" header-align="center" align="right" width="140"> <template slot-scope="scope"> <el-input-number :controls="false" :step="0" v-model="scope.row.nextInspectionDuration" size="small" style="width: 100%"></el-input-number> </template> </el-table-column> <el-table-column prop="totalInspectionDuration" :label="$t('qc.partAttributePage.totalInspectionDurationH')" header-align="center" align="right" width="140"> <template slot-scope="scope"> <el-input-number :controls="false" :step="0" v-model="scope.row.totalInspectionDuration" size="small" style="width: 100%"></el-input-number> </template> </el-table-column> <el-table-column prop="defaultFlag" :label="$t('qc.partAttributePage.isDefault')" header-align="center" align="center" width="100"> <template slot-scope="scope"> <el-switch v-model="scope.row.defaultFlag" active-value="Y" inactive-value="N" @change="handleDefaultFlagChange(scope.row)"></el-switch> </template> </el-table-column> <el-table-column :label="$t('qc.common.operation')" header-align="center" align="center" width="80"> <template slot-scope="scope"> <el-button type="text" size="small" @click="savePatrolConfigRow(scope.row)">{{ $t('qc.common.save') }}</el-button> </template> </el-table-column> </el-table> <el-footer style="height:35px;margin-top: 15px;text-align:center"> <el-button type="primary" @click="batchSavePatrolConfig" :loading="patrolConfigSaveLoading">{{ $t('qc.common.save') }}</el-button> <el-button @click="patrolConfigDialogFlag = false">{{ $t('qc.common.close') }}</el-button> </el-footer> </el-dialog>
<!-- 巡检配置导入 --> <patrol-config-upload ref="patrolConfigUpload" @refreshPatrolConfig="getPatrolConfigList" v-drag></patrol-config-upload>
<!-- 页签 --> <el-tabs v-model="activeTable" style="width: 100%" :style="{height: secondHeight + 'px'}" type="border-card" @tab-click="tabClick" class="customer-tab"> <!-- BOM页签 --> <!-- <el-tab-pane label="BOM" name="bom"> <bom-list-component v-if="activeTable === 'bom'" :part-no="partCurrentRow.partNo" :site="partCurrentRow.site" :bu-no="partCurrentRow.buNo" :table-height="secondHeight - 78"> </bom-list-component> </el-tab-pane> --> <!-- Routing页签 --> <!-- <el-tab-pane label="Routing" name="routing"> <routing-list-component v-if="activeTable === 'routing'" :part-no="partCurrentRow.partNo" :site="partCurrentRow.site" :bu-no="partCurrentRow.buNo" :table-height="secondHeight - 78"> </routing-list-component> </el-tab-pane> --> <!-- SOP清单 --> <!-- <el-tab-pane label="SOP清单" name="partSop"> <sop-list-component v-if="activeTable === 'partSop'" :part-no="partCurrentRow.partNo" :site="partCurrentRow.site" :bu-no="partCurrentRow.buNo" :table-height="secondHeight - 98"> </sop-list-component> </el-tab-pane> --> <!-- 质量检验模板页签 --> <!-- <el-tab-pane :label="$t('qc.partAttributePage.tabQcTemplate')" name="qcTemplate"> <el-form label-position="top" style="margin-left: 2px;"> <el-button type="primary" @click="addFastModal()" icon="el-icon-plus">{{ $t('qc.partAttributePage.addTemplate') }}</el-button> <el-button v-if="!editBatchVisible" @click="editBatchModel">{{ $t('qc.partAttributePage.batchEdit') }}</el-button> <el-button v-if="editBatchVisible" @click="batchModel" :loading="batchLoading">{{ $t('qc.partAttributePage.batchSave') }}</el-button> <el-button v-if="!editBatchVisible" type="danger" @click="batchDeleteTemplates" :disabled="selectedTemplates.length === 0" :loading="templateDeleteLoading">{{ $t('qc.partAttributePage.batchDeleteTemplates') }}</el-button> </el-form> <el-table ref="templateTable" :data="detailListPaged" :height="secondHeight - 100" border @selection-change="handleTemplateSelectionChange" style="width: 100%;"> <el-table-column type="selection" width="55" align="center"> </el-table-column> <el-table-column v-for="(item,index) in columnDetailList" :key="index" :sortable="item.columnSortable" :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip" :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth" :label="item.columnLabel"> <template slot-scope="scope"> <template v-if="item.columnProp === 'ipqcInspectionMethod'"> <span v-if="editBatchVisible && scope.row.inspectionTypeNo === '101'"> <el-select v-model="scope.row.ipqcInspectionMethod" :placeholder="$t('qc.common.selectPlaceholder')" clearable size="mini" style="width: 100%"> <el-option v-for="method in ipqcMethodOptions" :key="method.value" :label="method.label" :value="method.value"></el-option> </el-select> </span> <span v-else>{{ formatIpqcMethod(scope.row.ipqcInspectionMethod) }}</span> </template> <template v-else> <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span> <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px" /></span> </template> </template> </el-table-column> <el-table-column prop="samplingLevelDesc" header-align="center" align="center" min-width="180" :label="$t('qc.partAttributePage.samplingLevel')"> <template slot-scope="scope"> <span v-if="editBatchVisible"> <el-button type="text" @click="chooseLevel(scope.row)" style="width:18%;padding: 3px 7px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button> <el-input v-model="scope.row.samplingLevelDesc" readonly style="width:77%"></el-input> </span> <span v-else> <span>{{scope.row[scope.column.property]}}</span> </span> </template> </el-table-column> <el-table-column prop="inspectionCycle" header-align="center" align="center" min-width="100" :label="$t('qc.table.inspectionCycleH')"> <template slot-scope="scope"> <span v-if="editBatchVisible"> <el-input :controls="false" v-model="scope.row.inspectionCycle" @input="value=>scope.row.inspectionCycle= value.match(/^[1-9]\d*$/) ? value.match(/^[1-9]\d*$/)[0] : ''" style="height: 11px; width: 98%;"> </el-input> </span> <span v-else> <span>{{scope.row[scope.column.property]}}</span> </span> </template> </el-table-column> <el-table-column prop="samplingProgrammeDesc" header-align="center" align="center" min-width="180" :label="$t('qc.partAttributePage.samplingProgramme')"> <template slot-scope="scope"> <span v-if="editBatchVisible"> <el-button type="text" @click="chooseProgrammeRow(scope.row)" style="width:18%;padding: 3px 7px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button> <el-input v-model="scope.row.samplingProgrammeDesc" readonly style="width:77%"></el-input> </span> <span v-else> <span>{{scope.row[scope.column.property]}}</span> </span> </template> </el-table-column> <el-table-column prop="aql" header-align="center" align="center" min-width="80" label="AQL"> <template slot-scope="scope"> <span v-if="editBatchVisible"> <el-input :controls="false" v-model="scope.row.aql" @input="value=>scope.row.aql= value.match(/^[1-9]\d*$/) ? value.match(/^[1-9]\d*$/)[0] : ''" style="height: 11px; width: 98%;"> </el-input> </span> <span v-else> <span>{{scope.row[scope.column.property]}}</span> </span> </template> </el-table-column> <el-table-column prop="ac" header-align="center" align="center" min-width="80" label="AC"> <template slot-scope="scope"> <span v-if="editBatchVisible"> <el-input :controls="false" v-model="scope.row.ac" @input="value=>scope.row.ac= value.match(/^[1-9]\d*$/) ? value.match(/^[1-9]\d*$/)[0] : ''" style="height: 11px; width: 98%;"> </el-input> </span> <span v-else> <span>{{scope.row[scope.column.property]}}</span> </span> </template> </el-table-column> <el-table-column prop="re" header-align="center" align="center" min-width="80" label="RE"> <template slot-scope="scope"> <span v-if="editBatchVisible"> <el-input :controls="false" v-model="scope.row.re" @input="value=>scope.row.re= value.match(/^[1-9]\d*$/) ? value.match(/^[1-9]\d*$/)[0] : ''" style="height: 11px; width: 98%;"> </el-input> </span> <span v-else> <span>{{scope.row[scope.column.property]}}</span> </span> </template> </el-table-column> <el-table-column prop="templateRemark" header-align="center" align="center" :label="$t('qc.table.remark')"> </el-table-column> <el-table-column fixed="right" header-align="center" align="center" width="80" :label="$t('qc.common.operation')"> <template slot-scope="scope"> <el-button type="text" size="small" @click="deletePartAttributeDetails(scope.row)" style="color: #f56c6c;" :loading="scope.row.deleting">{{ $t('qc.common.delete') }}</el-button> </template> </el-table-column> </el-table> <el-pagination @size-change="templateSizeChangeHandle" @current-change="templateCurrentChangeHandle" :current-page="templatePageIndex" :page-sizes="[10, 20, 50, 100]" :page-size="templatePageSize" :total="detailList.length" layout="total, sizes, prev, pager, next, jumper" style="margin-top: 0px;"> </el-pagination> </el-tab-pane> --> <!-- 检验标准维护 --> <el-tab-pane :label="$t('qc.partAttributePage.tabQcSpec')" name="qcSpec"> <div class="qc-spec-type-bar"> <span v-for="i in qcSpecTypeOptions" :key="i.inspectionTypeNo" class="qc-spec-type-item" :class="{ 'is-active': qcSpecFilterType === String(i.inspectionTypeNo) }" @click="qcSpecFilterType = String(i.inspectionTypeNo)">{{ i.inspectionTypeName }}</span> </div> <el-form :inline="true" label-position="top" class="qc-spec-toolbar-form" style="margin-left: 2px;"> <!-- IQC:供应商 --> <el-form-item v-if="qcSpecFilterShowManufacturer" :label="$t('qc.table.supplier')"> <el-select v-model="qcSpecFilterManufacturer" :placeholder="$t('qc.common.selectPlaceholder')" @change="onQcSpecDimensionFilterChange" clearable filterable style="width: 140px"> <el-option :label="$t('qc.common.all')" value=""></el-option> <el-option v-for="item in qcSpecManufacturerFilterOptions" :key="item" :label="item" :value="item"></el-option> </el-select> </el-form-item> <!-- IPQC:IPQC检验方式 --> <el-form-item v-if="qcSpecFilterShowIpqcMethod" :label="$t('qc.partAttributePage.colIpqcMethod')"> <el-select v-model="qcSpecFilterIpqcMethod" :placeholder="$t('qc.common.selectPlaceholder')" @change="onQcSpecIpqcMethodFilterChange" clearable style="width: 120px"> <el-option :label="$t('qc.common.all')" value=""></el-option> <el-option v-for="method in ipqcMethodOptions" :key="method.value" :label="method.label" :value="method.value"></el-option> </el-select> </el-form-item> <!-- IPQC / FQC / OQC:工序、机台 --> <el-form-item v-if="qcSpecFilterShowOperation" :label="$t('qc.table.process')"> <el-select v-model="qcSpecFilterOperation" :placeholder="$t('qc.common.selectPlaceholder')" @change="onQcSpecOperationFilterChange" clearable filterable style="width: 140px"> <el-option :label="$t('qc.common.all')" value=""></el-option> <el-option v-for="item in qcSpecOperationFilterOptions" :key="item" :label="item" :value="item"></el-option> </el-select> </el-form-item> <el-form-item v-if="qcSpecFilterShowResource" :label="$t('qc.table.machine')"> <el-select v-model="qcSpecFilterResource" :placeholder="$t('qc.common.selectPlaceholder')" @change="onQcSpecDimensionFilterChange" clearable filterable style="width: 140px"> <el-option :label="$t('qc.common.all')" value=""></el-option> <el-option v-for="item in qcSpecResourceFilterOptions" :key="item" :label="item" :value="item"></el-option> </el-select> </el-form-item> <!-- IPQC / FQC / OQC / SQC:客户名称 --> <el-form-item v-if="qcSpecFilterShowCustomer" :label="$t('qc.table.customerName')"> <el-select v-model="qcSpecFilterCustomer" :placeholder="$t('qc.common.selectPlaceholder')" @change="onQcSpecDimensionFilterChange" clearable filterable style="width: 140px"> <el-option :label="$t('qc.common.all')" value=""></el-option> <el-option v-for="item in qcSpecCustomerFilterOptions" :key="item" :label="item" :value="item"></el-option> </el-select> </el-form-item> <el-form-item label=" "> <el-button type="primary" @click="addQcSpecModal()" icon="el-icon-plus">{{ $t('qc.common.add') }}</el-button> <el-button v-if="!authItemImport" type="primary" @click="qcSpecUploadModal()" icon="el-icon-upload">{{ $t('qc.partAttributePage.projectImport') }}</el-button> <el-button @click="openQcSpecCopyDialog()" icon="el-icon-document-copy" :disabled="!partCurrentRow.partNo">{{ $t('qc.common.copy') }}</el-button> <el-button @click="openQcSpecUpdateDialog()" icon="el-icon-refresh" :disabled="!partCurrentRow.partNo">{{ $t('qc.partAttributePage.qcSpecAttributeUpdate') }}</el-button> <el-button v-if="!editQcSpecBatchVisible" type="danger" @click="batchDeleteQcSpec" :disabled="!qcSpecSelections || qcSpecSelections.length === 0" :loading="qcSpecDeleteLoading">{{ $t('qc.partAttributePage.batchDeleteTemplates') }}</el-button> <el-button v-if="!editQcSpecBatchVisible" @click="editQcSpecBatchModel">{{ $t('qc.partAttributePage.batchEdit') }}</el-button> <el-button v-if="!editQcSpecBatchVisible" @click="openQcSpecBatchFillDialog" :disabled="!partCurrentRow.partNo">{{ $t('qc.partAttributePage.qcSpecBatchFill') }}</el-button> <el-button v-if="!editQcSpecBatchVisible" @click="openQcSpecSyncDialog()" :disabled="!partCurrentRow.partNo">{{ $t('qc.partAttributePage.qcSpecDataSync') }}</el-button> <el-button v-if="editQcSpecBatchVisible" @click="batchQcSpecModel" :loading="batchQcSpecLoading">{{ $t('qc.partAttributePage.batchSave') }}</el-button> <el-button v-if="editQcSpecBatchVisible" @click="cancelQcSpecBatchModel" :disabled="batchQcSpecLoading">{{ $t('qc.common.cancel') }}</el-button> </el-form-item> </el-form> <el-table :data="qcSpecTableList" ref="qcSpecTable" @row-click="qcSpecClickRow" highlight-current-row :key="'qc-spec-table-' + qcSpecFilterType + '-' + qcSpecColumnLayoutKey" :row-key="getQcSpecRowKey" :row-class-name="qcSpecRowClassName" v-loading="qcSpecDragSaving" @selection-change="qcSpecSelectionChange" :height="secondHeight - 122" border style="width: 100%;" class="qc-spec-table"> <el-table-column type="selection" width="45" align="center" :selectable="() => !editQcSpecBatchVisible"> </el-table-column> <el-table-column v-for="(item, index) in qcSpecVisibleColumnList" :key="item.columnProp || index" :sortable="item.columnSortable" :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip && !(item.editType && editQcSpecBatchVisible)" :align="item.align" :fixed="item.fixed == '' ? false : item.fixed" :min-width="item.columnWidth" :label="item.columnLabel"> <template slot-scope="scope"> <span v-if="item.editType === 'ipqcSelect' && editQcSpecBatchVisible && scope.row.inspectionTypeNo === '101'"> <el-select v-model="scope.row.ipqcInspectionMethod" :placeholder="$t('qc.common.selectPlaceholder')" clearable size="mini" style="width: 100%"> <el-option v-for="method in ipqcMethodOptions" :key="method.value" :label="method.label" :value="method.value"></el-option> </el-select> </span> <span v-else-if="item.editType === 'valueType'">{{ formatQcValueType(scope.row) }}</span> <span v-else-if="item.editType === 'programmePicker' && editQcSpecBatchVisible" class="qc-spec-cell-picker"> <el-button type="text" class="qc-spec-cell-picker-btn" @click="chooseProgrammeRow(scope.row)">{{ $t('qc.partAttributePage.selectBtn') }}</el-button> <el-input v-model="scope.row.samplingProgrammeDesc" readonly size="mini" class="qc-spec-cell-picker-input"></el-input> </span> <span v-else-if="item.editType === 'levelPicker' && editQcSpecBatchVisible" class="qc-spec-cell-picker"> <el-button type="text" class="qc-spec-cell-picker-btn" @click="chooseLevel(scope.row)">{{ $t('qc.partAttributePage.selectBtn') }}</el-button> <el-input v-model="scope.row.samplingLevelDesc" readonly size="mini" class="qc-spec-cell-picker-input"></el-input> </span> <el-input v-else-if="item.editType === 'samplingQty' && editQcSpecBatchVisible" v-model="scope.row.defaultSamplingQuantity" size="mini" @input="onQcSpecSamplingQtyInput(scope.row)"></el-input> <el-input v-else-if="item.editType === 'samplingRatio' && editQcSpecBatchVisible" v-model="scope.row.defaultSamplingProportion" size="mini" @input="onQcSpecSamplingRatioInput(scope.row)"></el-input> <span v-else-if="item.editType === 'operationPicker' && qcSpecCanSelectOperation(scope.row)"> <el-button type="text" @click="openQcSpecOperationPicker(scope.row)" style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button> <span>{{ scope.row.operation }}</span> </span> <span v-else-if="item.editType === 'resourcePicker' && qcSpecCanSelectResource(scope.row)"> <el-button type="text" @click="openQcSpecResourcePicker(scope.row)" style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button> <span>{{ scope.row.resourceDesc || scope.row.resourceID }}</span> </span> <span v-else-if="item.editType === 'manufacturerPicker' && qcSpecCanSelectManufacturer(scope.row)"> <el-button type="text" @click="openQcSpecManufacturerPicker(scope.row)" style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button> <span>{{ scope.row.manufacturerName || scope.row.manufacturerID }}</span> </span> <span v-else-if="item.editType === 'customerPicker' && qcSpecCanSelectCustomer(scope.row)"> <el-button type="text" @click="openQcSpecCustomerPicker(scope.row)" style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button> <span>{{ scope.row.customerName || scope.row.customerID }}</span> </span> <el-input v-else-if="item.editType === 'textInput' && editQcSpecBatchVisible" v-model="scope.row[item.columnProp]" size="mini"></el-input> <span v-else-if="!item.columnHidden">{{ qcSpecColumnText(scope.row, item) }}</span> </template> </el-table-column> <el-table-column header-align="center" align="center" width="140" :label="$t('qc.common.operation')" fixed="right"> <template slot-scope="scope"> <el-link style="cursor: pointer" @click="openQcSpecWarningDialog(scope.row)">{{ $t('qc.partAttributePage.warningConfig') }}</el-link> <el-link style="cursor: pointer" @click="deleteQcSpec(scope.row)">{{ $t('qc.common.delete') }}</el-link> </template> </el-table-column> </el-table> </el-tab-pane> <!-- 物料缺陷跟踪 --> <el-tab-pane :label="$t('qc.partAttributePage.tabDefectTracking')" name="defectTracking"> <el-form label-position="top" style="margin-left: 2px;"> <el-button type="primary" @click="addDefectTrackingModal()" icon="el-icon-plus">{{ $t('qc.common.add') }}</el-button> <el-button v-if="!editBatchVisible" @click="editDefectTrackingBatchModel">{{ $t('qc.partAttributePage.batchEdit') }}</el-button> <el-button v-if="editBatchVisible" @click="batchDefectTrackingModel" :loading="batchLoading">{{ $t('qc.partAttributePage.batchSave') }}</el-button> <el-button v-if="editBatchVisible" @click="cancelDefectTrackingBatchModel" :disabled="batchLoading">{{ $t('qc.common.cancel') }}</el-button> </el-form> <el-table :data="defectTrackingList" :height="secondHeight - 68" border style="width: 100%;"> <el-table-column v-for="(item,index) in columnDefectTrackingList" :key="index" :sortable="item.columnSortable" :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip" :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth" :label="item.columnLabel"> <template slot-scope="scope"> <span v-if="item.editType === 'positiveInt' && editBatchVisible"> <el-input :controls="false" v-model="scope.row[item.columnProp]" @input="value => onDefectTrackingPositiveIntInput(scope.row, item.columnProp, value)" style="height: 11px; width: 98%;"> </el-input> </span> <span v-else-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span> <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px" /></span> </template> </el-table-column> <el-table-column header-align="center" align="center" width="80" :label="$t('qc.common.operation')"> <template slot-scope="scope"> <el-button type="text" size="small" @click="deleteDefectTracking(scope.row)" style="color: #f56c6c;">{{ $t('qc.common.delete') }}</el-button> </template> </el-table-column> </el-table> </el-tab-pane>
<!-- 文件采集配置 --> <el-tab-pane :label="$t('qc.partAttributePage.tabFileCollect')" name="fileCollect"> <el-form :inline="true" label-position="top" :model="fileCollectQuery" style="margin-left: 2px;"> <el-form-item :label="$t('qc.itemPage.deviceCode')"> <el-input v-model="fileCollectQuery.equipmentNo" clearable style="width: 120px" @keyup.enter.native="searchFileCollect"></el-input> </el-form-item> <el-form-item :label="$t('qc.itemPage.deviceName')"> <el-input v-model="fileCollectQuery.equipmentDesc" clearable style="width: 140px" @keyup.enter.native="searchFileCollect"></el-input> </el-form-item> <el-form-item :label="$t('qc.table.itemCode')"> <el-input v-model="fileCollectQuery.itemNo" clearable style="width: 120px" @keyup.enter.native="searchFileCollect"></el-input> </el-form-item> <el-form-item label=" "> <el-button type="primary" @click="searchFileCollect">{{ $t('qc.common.search') }}</el-button> <el-button type="primary" @click="openFileCollectBatchAdd" icon="el-icon-plus" :disabled="!partCurrentRow.partNo">{{ $t('qc.common.add') }}</el-button> <el-button type="primary" @click="fileCollectUploadModal()" icon="el-icon-upload" :disabled="!partCurrentRow.partNo">{{ $t('qc.partAttributePage.fileCollectImport') }}</el-button> <!-- <el-button type="primary" @click="openFileCollectReplace" :disabled="!partCurrentRow.partNo">{{ $t('qc.partAttributePage.fileCollectReplace') }}</el-button> --> <el-button type="danger" @click="batchDeleteFileCollect" :disabled="fileCollectSelections.length === 0" :loading="fileCollectDeleteLoading">{{ $t('qc.partAttributePage.batchDeleteTemplates') }}</el-button> <el-button v-if="!editFileCollectBatchVisible" :disabled="!partCurrentRow.partNo" @click="editFileCollectBatchModel">{{ $t('qc.partAttributePage.batchEdit') }}</el-button> <el-button v-if="editFileCollectBatchVisible" type="primary" @click="batchFileCollectModel" :loading="fileCollectSaveLoading">{{ $t('qc.partAttributePage.batchSave') }}</el-button> <el-button v-if="editFileCollectBatchVisible" @click="cancelFileCollectBatchModel" :disabled="fileCollectSaveLoading">{{ $t('qc.common.cancel') }}</el-button> <el-button type="primary" icon="el-icon-download" @click="downloadFileCollectorProgram" :loading="fileCollectorDownloadLoading">{{ $t('qc.partAttributePage.downloadFileCollector') }}</el-button> </el-form-item> </el-form> <el-table ref="fileCollectTable" :data="fileCollectList" :height="secondHeight - 100" border v-loading="fileCollectLoading" @selection-change="handleFileCollectSelectionChange" style="width: 100%;"> <el-table-column type="selection" width="50" align="center"></el-table-column> <el-table-column v-for="(item, index) in columnFileCollectList" :key="index" :sortable="item.columnSortable" :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip && !(item.editType && editFileCollectBatchVisible)" :align="item.align" :fixed="item.fixed == '' ? false : item.fixed" :min-width="item.columnWidth" :width="item.fixedWidth || null" :label="item.columnLabel"> <template slot-scope="scope"> <span v-if="item.editType === 'staffPicker' && editFileCollectBatchVisible"> <el-button type="text" @click="openFileCollectStaffPicker(scope.row)" style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button> <span>{{ scope.row.staffAccount }}</span> </span> <span v-else-if="item.editType === 'itemPicker' && editFileCollectBatchVisible"> <el-button type="text" @click="openFileCollectItemPicker(scope.row)" style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button> <span>{{ scope.row.itemNo }}</span> </span> <span v-else-if="item.editType === 'operationPicker' && editFileCollectBatchVisible"> <el-button type="text" @click="openFileCollectOperationPicker(scope.row)" style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button> <span>{{ scope.row.operation }}</span> <el-button v-if="qcSpecHasValue(scope.row.operation)" type="text" icon="el-icon-close" class="qc-spec-pending-clear-btn" @click="clearFileCollectOperation(scope.row)"></el-button> </span> <el-input v-else-if="item.editType === 'textInput' && editFileCollectBatchVisible" v-model="scope.row[item.columnProp]" size="mini"></el-input> <span v-else-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span> <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px" /></span> </template> </el-table-column> </el-table> <el-pagination @size-change="fileCollectSizeChange" @current-change="fileCollectCurrentChange" :current-page="fileCollectPageIndex" :page-sizes="[10, 20, 50, 100]" :page-size="fileCollectPageSize" :total="fileCollectTotal" layout="total, sizes, prev, pager, next, jumper" style="margin-top: 0px;"> </el-pagination> </el-tab-pane> <!-- 标签模版设置 --> <!-- <el-tab-pane label="标签模版设置" name="labelTemplate"> <el-form label-position="top" style="margin-left: 2px;"> <el-button type="primary" @click="addLabelTemplateModal()" icon="el-icon-plus">新增</el-button> </el-form> <el-table :data="labelTemplateList" :height="secondHeight - 68" border style="width: 100%;"> <el-table-column v-for="(item,index) in columnLabelTemplateList" :key="index" :sortable="item.columnSortable" :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip" :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth" :label="item.columnLabel"> <template slot-scope="scope"> <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span> <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> </template> </el-table-column> <el-table-column header-align="center" align="center" width="100" label="操作"> <template slot-scope="scope"> <el-link style="cursor: pointer" @click="updateLabelTemplateModal(scope.row)">编辑</el-link> <el-link style="cursor: pointer" @click="deleteLabelTemplate(scope.row)">删除</el-link> </template> </el-table-column> </el-table> </el-tab-pane> --> </el-tabs>
<!-- 检验模板->快速新增 --> <el-dialog :title="$t('qc.common.add')" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag" width="1100px"> <div style="font-size: 12px"> <el-form :inline="true" label-position="top" :model="detailData"> <el-form-item :label="$t('qc.table.templateCode')"> <el-input v-model="detailData.templateId" clearable style="width: 120px"></el-input> </el-form-item> <el-form-item :label="$t('qc.table.templateName')"> <el-input v-model="detailData.templateName" clearable style="width: 120px"></el-input> </el-form-item> <el-form-item :label="$t('qc.table.inspectionType')"> <el-select v-model="detailData.inspectionTypeNo" @change="checkInspectionType" :placeholder="$t('qc.common.selectPlaceholder')"> <el-option v-for="i in options" :key="i.inspectionTypeNo" :label="i.inspectionTypeName" :value="i.inspectionTypeNo"> </el-option> </el-select> </el-form-item> <el-form-item :label="' '"> <el-button type="primary" @click="checkInspectionType2">{{ $t('qc.common.search') }}</el-button> </el-form-item> <el-form-item :label="' '" style="margin-left: 63px"> <el-button type="primary" @click="getOperationList" v-if="this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '102' || this.detailData.inspectionTypeNo === '103' || this.detailData.inspectionTypeNo === '104' || this.detailData.inspectionTypeNo === '106' || this.detailData.inspectionTypeNo === '107'" style="width: 63px">{{ $t('qc.table.process') }}</el-button> <el-button type="primary" @click="getManufacturerList" v-if="this.detailData.inspectionTypeNo === '105'" style="width: 63px">{{ $t('qc.table.supplier') }}</el-button> <el-button type="primary" @click="getCustomerList" v-if="this.detailData.inspectionTypeNo === '109'" style="width: 63px">{{ $t('qc.table.customerName') }}</el-button> </el-form-item> <el-form-item :label="' '" style="margin-left: 195px"> <el-button type="primary" @click="getAllResourceList" v-if="this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '102' || this.detailData.inspectionTypeNo === '103' || this.detailData.inspectionTypeNo === '104' || this.detailData.inspectionTypeNo === '106' || this.detailData.inspectionTypeNo === '107'" style="width: 63px">{{ $t('qc.table.machine') }}</el-button> </el-form-item> </el-form> </div> <el-container> <el-header style="width: 1080px;height: 200px;padding: 0 0 0 0"> <el-row :gutter="5"> <el-col :span="span1"> <span style="font-size: 12px">{{ $t('qc.partAttributePage.optionalTemplate') }}</span> <el-table height="210px" :data="itemList1" v-loading="itemList1Loading" border ref="itemTable1" @row-click="itemClickRow1" @selection-change="selectionItem1" highlight-current-row style="width: 100%"> <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column> <el-table-column prop="templateId" header-align="center" align="center" min-width="80" :label="$t('qc.table.templateCode')"> </el-table-column> <el-table-column prop="templateName" header-align="center" align="left" min-width="200" :label="$t('qc.table.templateName')"> </el-table-column> <el-table-column prop="inspectionTypeName" header-align="center" align="center" min-width="60" :label="$t('qc.table.inspectionType')"> </el-table-column> </el-table> </el-col> <el-col v-if="detailData.inspectionTypeNo === '105' || detailData.inspectionTypeNo === '101' || detailData.inspectionTypeNo === '109' || detailData.inspectionTypeNo === '107'" :span="span2" style="margin-top: 25px"> <el-table v-if="detailData.inspectionTypeNo === '105'" height="210px" :data="selectionManufacturer2" border highlight-current-row style="width: 100%"> <el-table-column prop="manufacturerID" header-align="center" align="center" min-width="100" :label="$t('qc.partAttributePage.colSupplierId')"> </el-table-column> <el-table-column prop="manufacturerName" header-align="center" align="left" min-width="150" :label="$t('qc.partAttributePage.colSupplierNameCol')"> </el-table-column> </el-table> <el-table v-else-if="detailData.inspectionTypeNo === '109'" height="210px" :data="selectionCustomer2" border highlight-current-row style="width: 100%"> <el-table-column prop="customerID" header-align="center" align="center" min-width="100" :label="$t('qc.table.customerCode')"> </el-table-column> <el-table-column prop="customerName" header-align="center" align="left" min-width="150" :label="$t('qc.table.customerName')"> </el-table-column> </el-table> <el-table v-else height="210px" :data="operationSelections" border highlight-current-row style="width: 100%"> <el-table-column prop="operationDesc" header-align="center" align="center" :label="$t('qc.table.process')"> </el-table-column> </el-table> </el-col> <el-col v-if="detailData.inspectionTypeNo === '101' || detailData.inspectionTypeNo === '107'" :span="span3" style="margin-top: 25px"> <el-table height="210px" :data="resourceSelections" border highlight-current-row style="width: 100%"> <el-table-column prop="resourceId" header-align="center" align="center" min-width="100" :label="$t('qc.partAttributePage.resourceId')"> </el-table-column> <el-table-column prop="resourceDesc" header-align="center" align="left" min-width="150" :label="$t('qc.partAttributePage.resourceName')"> </el-table-column> </el-table> </el-col> </el-row> </el-header> <el-main style="width: 880px;height: 25px;margin-top: 50px;padding: 0 0 0 0;text-align:center"> <div> <el-button type="primary" @click="addItem" :loading="addItemLoading">{{ $t('qc.partAttributePage.addBtn') }}<i class="el-icon-caret-bottom el-icon--right" v-if="!addItemLoading"></i></el-button> <el-button type="primary" @click="deleteItem" :loading="deleteItemLoading">{{ $t('qc.partAttributePage.removeBtn') }}<i class="el-icon-caret-top el-icon--right" v-if="!deleteItemLoading"></i></el-button> </div> </el-main> <el-footer style="width: 1080px;height: 222px;padding: 0 0 0 0;margin-top: -4px"> <span style="font-size: 12px">{{ $t('qc.partAttributePage.existingTemplate') }}</span> <div class="rq"> <el-table height="200px" :data="itemList2" v-loading="itemList2Loading" border ref="itemTable2" @row-click="itemClickRow2" @selection-change="selectionItem2" highlight-current-row style="width: 100%"> <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column> <el-table-column prop="templateId" header-align="center" align="center" min-width="80" :label="$t('qc.table.templateCode')"> </el-table-column> <el-table-column prop="templateName" header-align="center" align="center" min-width="200" :label="$t('qc.table.templateName')"> </el-table-column> <el-table-column prop="operation" header-align="center" align="center" min-width="100" :label="$t('qc.table.process')"> </el-table-column> <el-table-column prop="resourceID" header-align="center" align="center" min-width="100" :label="$t('qc.table.machine')"> </el-table-column> <el-table-column prop="manufacturerName" header-align="center" align="center" min-width="200" :label="$t('qc.table.supplier')"> </el-table-column> <el-table-column prop="customerName" header-align="center" align="center" min-width="200" :label="$t('qc.table.customerName')"> </el-table-column> <el-table-column prop="inspectionTypeName" header-align="center" align="center" min-width="60" :label="$t('qc.table.inspectionType')"> </el-table-column> </el-table> </div> </el-footer> </el-container> <el-footer style="height:35px;margin-top: 18px;text-align:center"> <el-button type="primary" @click="fastAddFlag = false">{{ $t('qc.common.close') }}</el-button> </el-footer> </el-dialog>
<!-- 工序 --> <el-dialog :title="$t('qc.partAttributePage.dialogOperationList')" :close-on-click-modal="false" v-drag :visible.sync="operationModelFlag" width="420px" append-to-body @close="onOperationDialogClose"> <div class="rq"> <el-form :inline="true" label-position="top" :model="operationData"> <el-form-item :label="$t('qc.partAttributePage.operationColon')"> <el-input v-model="operationData.operationDesc" clearable style="width: 120px"></el-input> </el-form-item> <el-form-item :label="' '"> <el-button type="primary" @click="getOperationList2">{{ $t('qc.common.search') }}</el-button> </el-form-item> </el-form> <el-table :height="300" :data="operationList" ref="operationTable" @row-click="operationClickRow" @row-dblclick="operationDblClickRow" @selection-change="selectionOperationChangeHandle" @select="operationSelect" :row-key="getRowKeys" :highlight-current-row="!!qcSpecPickerRow" border style="width: 100%;"> <el-table-column v-if="!qcSpecPickerRow" type="selection" header-align="center" align="center" :reserve-selection="true" width="50"> </el-table-column> <el-table-column prop="operationDesc" header-align="center" align="center" :label="$t('qc.table.process')"> </el-table-column> </el-table> <el-pagination class="operation-dialog-pagination" small :pager-count="5" style="margin-top: 10px" @current-change="operationCurrentChange" :current-page="operationPageIndex" :page-size="operationPageSize" :total="operationTotalPage" layout="total, prev, pager, next"> </el-pagination> </div> <el-footer style="height:40px;margin-top: 20px;text-align:center"> <el-button type="primary" @click="confirmOperation">{{ $t('qc.common.confirm') }}</el-button> </el-footer> </el-dialog>
<!-- 机台 --> <el-dialog :title="$t('qc.partAttributePage.dialogResourceList')" :close-on-click-modal="false" v-drag :visible.sync="resourceModelFlag" width="420px" append-to-body @close="onResourceDialogClose"> <div class="rq"> <el-form :inline="true" label-position="top" :model="resourceData"> <el-form-item :label="$t('qc.partAttributePage.resourceId')"> <el-input v-model="resourceData.resourceId" clearable style="width: 120px"></el-input> </el-form-item> <el-form-item :label="$t('qc.partAttributePage.resourceName')"> <el-input v-model="resourceData.resourceDesc" clearable style="width: 120px"></el-input> </el-form-item> <el-form-item :label="' '"> <el-button type="primary" @click="getAllResourceList2">{{ $t('qc.common.search') }}</el-button> </el-form-item> </el-form> <el-table :height="300" :data="resourceList" ref="resourceTable" @row-click="resourceClickRow" @row-dblclick="resourceDblClickRow" @selection-change="selectionResourceChangeHandle" @select="resourceSelect" :row-key="getRowKeys2" :highlight-current-row="!!qcSpecPickerRow" border style="width: 100%;"> <el-table-column v-if="!qcSpecPickerRow" type="selection" header-align="center" align="center" :reserve-selection="true" width="50"> </el-table-column> <el-table-column prop="resourceId" header-align="center" align="center" :label="$t('qc.partAttributePage.resourceId')"> </el-table-column> <el-table-column prop="resourceDesc" header-align="center" align="center" :label="$t('qc.partAttributePage.resourceName')"> </el-table-column> </el-table> </div> <el-footer style="height:40px;margin-top: 20px;text-align:center"> <el-button type="primary" @click="confirmResource">{{ $t('qc.common.confirm') }}</el-button> </el-footer> </el-dialog>
<!-- 供应商 --> <el-dialog :title="$t('qc.partAttributePage.dialogManufacturerList')" :close-on-click-modal="false" v-drag :visible.sync="manufacturerModelFlag" width="520px" append-to-body> <div class="rq"> <el-form :inline="true" label-position="top" :model="manufacturerData"> <el-form-item :label="$t('qc.partAttributePage.manufacturerIdColon')"> <el-input v-model="manufacturerData.manufacturerID" clearable style="width: 100px"></el-input> </el-form-item> <el-form-item :label="$t('qc.partAttributePage.manufacturerNameColon')"> <el-input v-model="manufacturerData.manufacturerName" clearable style="width: 100px"></el-input> </el-form-item> <el-form-item :label="' '"> <el-button type="primary" @click="getManufacturerList2">{{ $t('qc.common.search') }}</el-button> </el-form-item> </el-form> <el-table :height="300" :data="manufacturerList" ref="manufacturerTable" @row-click="manufacturerClickRow" @row-dblclick="manufacturerDblClickRow" @selection-change="selectionManufacturerChangeHandle" :row-key="getRowKeys3" :highlight-current-row="!!qcSpecPickerRow" border style="width: 100%;"> <el-table-column v-if="!qcSpecPickerRow" type="selection" header-align="center" align="center" :reserve-selection="true" width="50"> </el-table-column> <el-table-column prop="manufacturerID" header-align="center" align="left" width="90" :label="$t('qc.partAttributePage.colSupplierId')" show-overflow-tooltip> </el-table-column> <el-table-column prop="manufacturerName" header-align="center" align="left" min-width="120" :label="$t('qc.partAttributePage.colSupplierNameCol')" show-overflow-tooltip> </el-table-column> </el-table> <el-pagination class="manufacturer-dialog-pagination" small :pager-count="5" style="margin-top: 10px" @current-change="manufacturerCurrentChange" :current-page="manufacturerPageIndex" :page-size="manufacturerPageSize" :total="manufacturerTotalPage" layout="total, prev, pager, next"> </el-pagination> </div> <el-footer style="height:40px;margin-top: 20px;text-align:center"> <el-button type="primary" @click="confirmManufacturer">{{ $t('qc.common.confirm') }}</el-button> <el-button type="primary" @click="manufacturerModelFlag = false">{{ $t('qc.common.close') }}</el-button> </el-footer> </el-dialog>
<!-- 客户 --> <el-dialog :title="$t('qc.partAttributePage.dialogCustomerList')" :close-on-click-modal="false" v-drag :visible.sync="customerModelFlag" width="520px" append-to-body> <div class="rq"> <el-form :inline="true" label-position="top" :model="customerData"> <el-form-item :label="$t('qc.partAttributePage.customerIdColon')"> <el-input v-model="customerData.customerID" clearable style="width: 120px"></el-input> </el-form-item> <el-form-item :label="$t('qc.partAttributePage.customerNameColon')"> <el-input v-model="customerData.customerName" clearable style="width: 120px"></el-input> </el-form-item> <el-form-item :label="' '"> <el-button type="primary" @click="getCustomerList2">{{ $t('qc.common.search') }}</el-button> </el-form-item> </el-form> <el-table :height="300" :data="customerList" ref="customerTable" @row-click="customerClickRow" @row-dblclick="customerDblClickRow" @selection-change="selectionCustomerChangeHandle" :row-key="getRowKeys4" :highlight-current-row="!!qcSpecPickerRow" border style="width: 100%;"> <el-table-column v-if="!qcSpecPickerRow" type="selection" header-align="center" align="center" :reserve-selection="true" width="50"> </el-table-column> <el-table-column prop="customerID" header-align="center" align="center" :label="$t('qc.table.customerCode')"> </el-table-column> <el-table-column prop="customerName" header-align="center" align="center" :label="$t('qc.table.customerName')"> </el-table-column> </el-table> <el-pagination class="customer-dialog-pagination" small :pager-count="5" style="margin-top: 10px" @size-change="customerSizeChange" @current-change="customerCurrentChange" :current-page="customerPageIndex" :page-sizes="[10, 20, 50, 100]" :page-size="customerPageSize" :total="customerTotalPage" layout="total, sizes, prev, pager, next"> </el-pagination> </div> <el-footer style="height:40px;margin-top: 20px;text-align:center"> <el-button type="primary" @click="confirmCustomer">{{ $t('qc.common.confirm') }}</el-button> <el-button type="primary" @click="customerModelFlag = false">{{ $t('qc.common.close') }}</el-button> </el-footer> </el-dialog>
<!-- sop文件清单 --> <el-dialog :title="$t('qc.partAttributePage.dialogSopFileList')" :close-on-click-modal="false" v-drag :visible.sync="sopFileModelFlag" width="800px"> <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> <el-form-item :label="' '"> <el-button type="primary" @click="uploadSopFile">{{ $t('qc.partAttributePage.uploadFile') }}</el-button> </el-form-item> <el-form-item :label="$t('qc.table.inspectionType')" style="margin-left: 448px"> <el-select v-model="sopData.inspectionTypeNo" :placeholder="$t('qc.common.selectPlaceholder')"> <el-option :label="$t('qc.common.all')" value=""></el-option> <el-option v-for="i in options" :key="i.inspectionTypeNo" :label="i.inspectionTypeName" :value="i.inspectionTypeNo"> </el-option> </el-select> </el-form-item> <el-form-item :label="' '"> <el-button type="primary" @click="getFileContentList">{{ $t('qc.common.search') }}</el-button> </el-form-item> </el-form> <el-table :height="350" :data="sopList" border style="width: 100%; "> <el-table-column v-for="(item,index) in sopColumnList" :key="index" :sortable="item.columnSortable" :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip" :align="item.align" :fixed="item.fixed===''?false:item.fixed" :min-width="item.columnWidth" :label="item.columnLabel"> <template slot-scope="scope"> <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span> <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px" /></span> </template> </el-table-column> <el-table-column fixed="right" header-align="center" align="center" width="100" :label="$t('qc.common.operation')"> <template slot-scope="scope"> <el-link style="cursor: pointer" @click="downloadFile(scope.row)">{{ $t('qc.common.download') }}</el-link> <el-link style="cursor: pointer" @click="deleteFile(scope.row)">{{ $t('qc.common.delete') }}</el-link> </template> </el-table-column> </el-table> </el-dialog>
<!-- 物料缺陷跟踪新增 --> <el-dialog :title="$t('qc.partAttributePage.dialogDefectTracking')" :close-on-click-modal="false" v-drag :visible.sync="defectTrackingModal" width="490px"> <el-form :inline="true" label-position="top" :model="defectTrackingData" style="margin-left: 7px;margin-top: -5px;"> <el-form-item> <span v-if="defectTrackingDisableFlag" slot="label">{{ $t('qc.table.supplier') }}</span> <span v-else style="cursor: pointer" slot="label" @click="getBaseList(506)"><a href="#">{{ $t('qc.table.supplier') }}</a></span> <el-input v-model="defectTrackingData.supplierId" :disabled="defectTrackingDisableFlag" @change="supplierBlur(506)" style="width: 100px"></el-input> <el-input v-model="defectTrackingData.supplierName" disabled style="width: 340px"></el-input> </el-form-item> </el-form> <el-form :inline="true" label-position="top" style="margin-left: 7px"> <el-form-item :label="$t('qc.partAttributePage.defectThreshold')"> <el-input-number :controls="false" :step="0" v-model="defectTrackingData.defectThreshold" style="width: 100px"></el-input-number> </el-form-item> <el-form-item :label="$t('qc.partAttributePage.recoveryBatchCount')"> <el-input-number :controls="false" :step="0" v-model="defectTrackingData.recoveryBatchCount" style="width: 100px"></el-input-number> </el-form-item> </el-form> <el-footer style="height:35px;margin-top: 15px;text-align:center"> <el-button type="primary" @click="saveDefectTracking()">{{ $t('qc.common.save') }}</el-button> <el-button type="primary" @click="defectTrackingModal = false">{{ $t('qc.common.close') }}</el-button> </el-footer> </el-dialog>
<!-- 标签模版设置新增 --> <el-dialog :title="$t('qc.partAttributePage.dialogLabelTemplate')" :close-on-click-modal="false" v-drag :visible.sync="labelTemplateModal" width="380px"> <el-form :inline="true" label-position="top" :model="labelTemplateData" style="margin-left: 7px;margin-top: -5px;"> <el-form-item> <span v-if="labelTemplateDisableFlag" slot="label">{{ $t('qc.partAttributePage.colLabelType') }}</span> <span v-else style="cursor: pointer" slot="label" @click="getBaseList(1099, 2)"><a href="#">{{ $t('qc.partAttributePage.colLabelType') }}</a></span> <el-input v-model="labelTemplateData.labelTypeTb" :disabled="labelTemplateDisableFlag" @change="labelTemplateBlur(1099)" style="width: 100px"></el-input> <el-input v-model="labelTemplateData.labelType" disabled style="width: 230px"></el-input> </el-form-item> </el-form> <el-form :inline="true" label-position="top" :model="labelTemplateData" style="margin-left: 7px;"> <el-form-item :label="$t('qc.partAttributePage.colDefaultFlag')"> <el-select v-model="labelTemplateData.defaultFlag" style="width: 100px"> <el-option :label="$t('qc.partAttributePage.defaultOption')" value="1"></el-option> <el-option :label="$t('qc.partAttributePage.nonDefaultOption')" value="0"></el-option> </el-select> </el-form-item> <el-form-item :label="$t('qc.table.process')" style="margin-left: -10px"> <el-select v-model="labelTemplateData.operationDesc" :placeholder="$t('qc.partAttributePage.selectOperation')" filterable clearable style="width: 230px"> <el-option v-for="item in operationDescList" :key="item" :label="item" :value="item"></el-option> </el-select> </el-form-item> </el-form> <el-footer style="height:35px;margin-top: 15px;text-align:center"> <el-button type="primary" @click="saveLabelTemplate()">{{ $t('qc.common.save') }}</el-button> <el-button type="primary" @click="labelTemplateModal = false">{{ $t('qc.common.close') }}</el-button> </el-footer> </el-dialog>
<!-- 检验标准维护新增 --> <el-dialog :title="$t('qc.partAttributePage.dialogAddQcSpec')" :close-on-click-modal="false" v-drag :visible.sync="qcSpecAddFlag" width="92%" top="4vh" append-to-body :before-close="beforeCloseQcSpecAddDialog" @close="onQcSpecAddDialogClose" custom-class="config-dialog qc-spec-copy-dialog qc-spec-add-dialog"> <div class="qc-spec-copy-content"> <el-form :inline="true" size="small" class="qc-spec-copy-search-form"> <el-form-item :label="$t('qc.method.colBu')"> <el-select v-model="qcSpecSearchData.buNo" :placeholder="$t('qc.common.selectPlaceholder')" clearable style="width: 160px"> <el-option v-for="i in qcSpecAddBuList" :key="i.site + '_' + i.buNo" :label="i.sitename + ' ' + i.buDesc" :value="i.buNo"> <span style="float: left;width: 100px">{{ i.sitename }}</span> <span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px"> {{ i.buDesc }} </span> </el-option> </el-select> </el-form-item> <el-form-item :label="$t('qc.table.inspectionType')"> <el-select v-model="qcSpecSearchData.inspectionTypeNo" :placeholder="$t('qc.common.selectPlaceholder')" style="width: 140px"> <el-option :label="$t('qc.common.all')" value=""></el-option> <el-option v-for="i in options" :key="i.inspectionTypeNo" :label="i.inspectionTypeName" :value="i.inspectionTypeNo"></el-option> </el-select> </el-form-item> <el-form-item :label="$t('qc.table.itemCode')"> <el-input v-model="qcSpecSearchData.itemNo" clearable style="width: 140px" @keyup.enter.native="getQcSpecItemList"></el-input> </el-form-item> <el-form-item :label="$t('qc.table.itemName')"> <el-input v-model="qcSpecSearchData.itemDesc" clearable style="width: 180px" @keyup.enter.native="getQcSpecItemList"></el-input> </el-form-item> <el-form-item> <el-button type="primary" icon="el-icon-search" @click="getQcSpecItemList()" size="small">{{ $t('qc.common.search') }}</el-button> </el-form-item> </el-form>
<div class="qc-spec-copy-available"> <div class="qc-spec-copy-section-header"> <span class="qc-spec-copy-section-title">{{ $t('qc.iqcPage.optionalItemList') }}</span> <el-button type="primary" size="small" icon="el-icon-plus" :disabled="!qcSpecItemSelections1 || qcSpecItemSelections1.length === 0" @click="openQcSpecAddFillDialog"> {{ $t('qc.partAttributePage.qcSpecAddSelected', { count: qcSpecItemSelections1.length }) }} </el-button> </div> <div class="qc-spec-copy-table-wrap"> <el-table :data="qcSpecItemList1" ref="qcSpecItemTable1" border height="100%" @row-click="qcSpecItemClickRow1" @selection-change="qcSpecSelectionItem1" :row-key="getQcSpecAddItemKey" highlight-current-row> <el-table-column type="selection" width="45" align="center" :selectable="isQcSpecAddItemSelectable"></el-table-column> <el-table-column prop="buDesc" :label="$t('qc.method.colBu')" min-width="90" show-overflow-tooltip></el-table-column> <el-table-column prop="inspectionTypeName" :label="$t('qc.table.inspectionType')" min-width="90" show-overflow-tooltip></el-table-column> <el-table-column prop="itemNo" :label="$t('qc.table.itemCode')" min-width="110" show-overflow-tooltip></el-table-column> <el-table-column prop="itemDesc" :label="$t('qc.table.itemName')" min-width="160" show-overflow-tooltip></el-table-column> <el-table-column prop="methodName" :label="$t('qc.table.inspectionMethod')" min-width="120" show-overflow-tooltip></el-table-column> <el-table-column prop="methodRemark" :label="$t('qc.method.colMethodRemark')" min-width="140" show-overflow-tooltip></el-table-column> <el-table-column prop="valueType" :label="$t('qc.table.valueType')" min-width="90" align="center" show-overflow-tooltip> <template slot-scope="scope"> {{ formatQcValueType(scope.row) }} </template> </el-table-column> <el-table-column prop="defaultValue" :label="$t('qc.table.standardValue')" min-width="80" align="center"></el-table-column> <el-table-column prop="maxValue" :label="$t('qc.table.upperValue')" min-width="70" align="right"></el-table-column> <el-table-column prop="minValue" :label="$t('qc.table.lowerValue')" min-width="70" align="right"></el-table-column> <el-table-column :label="$t('qc.partAttributePage.qcSpecCopyStatus')" width="90" align="center"> <template slot-scope="scope"> <el-tag v-if="isQcSpecAddItemPending(scope.row)" type="info" size="mini"> {{ $t('qc.partAttributePage.qcSpecCopyAdded') }} </el-tag> </template> </el-table-column> </el-table> </div> </div>
<div class="qc-spec-copy-selected"> <div class="qc-spec-copy-section-header qc-spec-copy-added-header"> <span class="qc-spec-copy-section-title"> {{ $t('qc.partAttributePage.qcSpecAddPendingItems', { count: qcSpecPendingList.length }) }} </span> <el-button type="danger" plain size="small" icon="el-icon-delete" :disabled="qcSpecPendingList.length === 0" @click="clearQcSpecPendingList"> {{ $t('qc.partAttributePage.qcSpecCopyClearAdded') }} </el-button> </div> <div class="qc-spec-copy-table-wrap"> <el-table :data="qcSpecPendingList" ref="qcSpecPendingTable" border height="100%" :row-key="getQcSpecPendingRowKey"> <el-table-column prop="buDesc" :label="$t('qc.method.colBu')" min-width="90" show-overflow-tooltip></el-table-column> <el-table-column prop="itemNo" :label="$t('qc.table.itemCode')" min-width="110" show-overflow-tooltip></el-table-column> <el-table-column prop="itemDesc" :label="$t('qc.table.itemName')" min-width="150" show-overflow-tooltip></el-table-column> <el-table-column prop="inspectionTypeName" :label="$t('qc.table.inspectionType')" min-width="90" show-overflow-tooltip></el-table-column> <el-table-column prop="ipqcInspectionMethod" :label="$t('qc.partAttributePage.colIpqcMethod')" min-width="120" show-overflow-tooltip> <template slot-scope="scope"> <el-select v-if="String(scope.row.inspectionTypeNo) === '101'" v-model="scope.row.ipqcInspectionMethod" :placeholder="$t('qc.common.selectPlaceholder')" clearable size="mini" style="width: 100%"> <el-option v-for="method in ipqcMethodOptions" :key="method.value" :label="method.label" :value="method.value"></el-option> </el-select> <span v-else>{{ formatIpqcMethod(scope.row.ipqcInspectionMethod) }}</span> </template> </el-table-column> <el-table-column prop="valueType" :label="$t('qc.table.valueType')" min-width="90" align="center" show-overflow-tooltip> <template slot-scope="scope"> {{ formatQcValueType(scope.row) }} </template> </el-table-column> <el-table-column prop="defaultValue" :label="$t('qc.table.standardValue')" min-width="100"> <template slot-scope="scope"> <el-input v-model="scope.row.defaultValue" size="mini"></el-input> </template> </el-table-column> <el-table-column prop="maxValue" :label="$t('qc.table.upperValue')" min-width="90"> <template slot-scope="scope"> <el-input v-model="scope.row.maxValue" size="mini"></el-input> </template> </el-table-column> <el-table-column prop="minValue" :label="$t('qc.table.lowerValue')" min-width="90"> <template slot-scope="scope"> <el-input v-model="scope.row.minValue" size="mini"></el-input> </template> </el-table-column> <el-table-column prop="samplingProgrammeDesc" :label="$t('qc.partAttributePage.samplingProgramme')" min-width="180"> <template slot-scope="scope"> <span class="qc-spec-cell-picker"> <el-button type="text" class="qc-spec-cell-picker-btn" @click="chooseProgrammeRow(scope.row)">{{ $t('qc.partAttributePage.selectBtn') }}</el-button> <el-input v-model="scope.row.samplingProgrammeDesc" readonly size="mini" class="qc-spec-cell-picker-input"></el-input> </span> </template> </el-table-column> <el-table-column prop="samplingLevelDesc" :label="$t('qc.partAttributePage.samplingLevel')" min-width="180"> <template slot-scope="scope"> <span class="qc-spec-cell-picker"> <el-button type="text" class="qc-spec-cell-picker-btn" @click="chooseLevel(scope.row)">{{ $t('qc.partAttributePage.selectBtn') }}</el-button> <el-input v-model="scope.row.samplingLevelDesc" readonly size="mini" class="qc-spec-cell-picker-input"></el-input> </span> </template> </el-table-column> <el-table-column prop="defaultSamplingQuantity" :label="$t('qc.template.colDefaultSamplingQty')" min-width="110"> <template slot-scope="scope"> <el-input v-model="scope.row.defaultSamplingQuantity" size="mini" @input="onQcSpecSamplingQtyInput(scope.row)"></el-input> </template> </el-table-column> <el-table-column prop="defaultSamplingProportion" :label="$t('qc.template.colDefaultSamplingRatio')" min-width="110"> <template slot-scope="scope"> <el-input v-model="scope.row.defaultSamplingProportion" size="mini" @input="onQcSpecSamplingRatioInput(scope.row)"></el-input> </template> </el-table-column> <el-table-column prop="operation" :label="$t('qc.table.process')" min-width="130" show-overflow-tooltip> <template slot-scope="scope"> <span v-if="qcSpecRowAllowsOperation(scope.row)"> <el-button type="text" @click="openQcSpecLinkedOperationPicker(scope.row)" style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button> <span>{{ scope.row.operation }}</span> <el-button v-if="qcSpecHasValue(scope.row.operation)" type="text" icon="el-icon-close" class="qc-spec-pending-clear-btn" @click="clearQcSpecPendingLinkedField(scope.row, 'operation')"></el-button> </span> <span v-else>{{ scope.row.operation }}</span> </template> </el-table-column> <el-table-column prop="resourceID" :label="$t('qc.table.machine')" min-width="150" show-overflow-tooltip> <template slot-scope="scope"> <span v-if="qcSpecRowAllowsResource(scope.row)"> <el-button type="text" @click="openQcSpecLinkedResourcePicker(scope.row)" style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button> <span>{{ scope.row.resourceDesc || scope.row.resourceID }}</span> <el-button v-if="qcSpecHasValue(scope.row.resourceID) || qcSpecHasValue(scope.row.resourceDesc)" type="text" icon="el-icon-close" class="qc-spec-pending-clear-btn" @click="clearQcSpecPendingLinkedField(scope.row, 'resource')"></el-button> </span> <span v-else>{{ scope.row.resourceDesc || scope.row.resourceID }}</span> </template> </el-table-column> <el-table-column prop="manufacturerName" :label="$t('qc.table.supplier')" min-width="150" show-overflow-tooltip> <template slot-scope="scope"> <span v-if="qcSpecRowAllowsManufacturer(scope.row)"> <el-button type="text" @click="openQcSpecLinkedManufacturerPicker(scope.row)" style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button> <span>{{ scope.row.manufacturerName || scope.row.manufacturerID }}</span> <el-button v-if="qcSpecHasValue(scope.row.manufacturerID) || qcSpecHasValue(scope.row.manufacturerName)" type="text" icon="el-icon-close" class="qc-spec-pending-clear-btn" @click="clearQcSpecPendingLinkedField(scope.row, 'manufacturer')"></el-button> </span> <span v-else>{{ scope.row.manufacturerName || scope.row.manufacturerID }}</span> </template> </el-table-column> <el-table-column prop="customerName" :label="$t('qc.table.customerName')" min-width="150" show-overflow-tooltip> <template slot-scope="scope"> <span v-if="qcSpecRowAllowsCustomer(scope.row)"> <el-button type="text" @click="openQcSpecLinkedCustomerPicker(scope.row)" style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button> <span>{{ scope.row.customerName || scope.row.customerID }}</span> <el-button v-if="qcSpecHasValue(scope.row.customerID) || qcSpecHasValue(scope.row.customerName)" type="text" icon="el-icon-close" class="qc-spec-pending-clear-btn" @click="clearQcSpecPendingLinkedField(scope.row, 'customer')"></el-button> </span> <span v-else>{{ scope.row.customerName || scope.row.customerID }}</span> </template> </el-table-column> <el-table-column :label="$t('qc.common.operation')" width="80" align="center"> <template slot-scope="scope"> <el-tooltip :content="$t('qc.partAttributePage.qcSpecAddRemovePending')" placement="top"> <el-button type="text" icon="el-icon-delete" class="qc-spec-copy-remove-button" @click="removeQcSpecPendingItem(scope.row)"></el-button> </el-tooltip> </template> </el-table-column> </el-table> </div> </div> </div> <span slot="footer" class="dialog-footer"> <el-button type="primary" @click="confirmQcSpecAdd" :loading="qcSpecAddSaveLoading" size="small">{{ $t('qc.common.confirm') }}</el-button> <el-button @click="qcSpecAddFlag = false" size="small">{{ $t('qc.common.cancel') }}</el-button> </span> </el-dialog>
<!-- 新增质检项目-填写工序/机台/供应商/客户 --> <el-dialog :title="$t('qc.partAttributePage.dialogQcSpecAddFill')" :close-on-click-modal="false" v-drag :visible.sync="qcSpecAddFillDialogFlag" width="720px" append-to-body custom-class="config-dialog"> <div class="qc-spec-batch-fill-content"> <el-form label-position="top" :model="qcSpecAddApplyData"> <el-row :gutter="20"> <el-col :span="8"> <el-form-item :label="$t('qc.table.inspectionType')" required> <el-select v-model="qcSpecAddApplyData.inspectionTypeNo" :placeholder="$t('qc.common.selectPlaceholder')" size="small" disabled style="width: 100%"> <el-option v-for="i in options" :key="i.inspectionTypeNo" :label="i.inspectionTypeName" :value="i.inspectionTypeNo"></el-option> </el-select> </el-form-item> </el-col> <el-col v-if="qcSpecAddApplyIsIpqc" :span="8"> <el-form-item :label="$t('qc.partAttributePage.colIpqcMethod')"> <el-select v-model="qcSpecAddApplyData.ipqcInspectionMethod" :placeholder="$t('qc.common.selectPlaceholder')" size="small" clearable style="width: 100%"> <el-option v-for="method in ipqcMethodOptions" :key="method.value" :label="method.label" :value="method.value"></el-option> </el-select> </el-form-item> </el-col> <el-col :span="8"> <el-form-item> <span slot="label"> <a class="qc-spec-add-apply-link" :class="{ 'is-disabled': !qcSpecAddApplyCanOperation }" @click="openQcSpecAddApplyOperationPicker">{{ $t('qc.table.process') }}</a> </span> <div class="qc-spec-add-apply-input"> <el-input v-model="qcSpecAddApplyData.operation" readonly size="small" :disabled="!qcSpecAddApplyCanOperation" :class="{ 'is-clearable': qcSpecAddApplyCanOperation && qcSpecHasValue(qcSpecAddApplyData.operation) }"></el-input> <i v-if="qcSpecAddApplyCanOperation && qcSpecHasValue(qcSpecAddApplyData.operation)" class="el-icon-circle-close qc-spec-add-apply-clear" @click.stop="clearQcSpecAddApplyOperation"></i> </div> </el-form-item> </el-col> <el-col :span="8"> <el-form-item> <span slot="label"> <a class="qc-spec-add-apply-link" :class="{ 'is-disabled': !qcSpecAddApplyCanResource }" @click="openQcSpecAddApplyResourcePicker">{{ $t('qc.table.machine') }}</a> </span> <div class="qc-spec-add-apply-input"> <el-input :value="qcSpecAddApplyData.resourceDesc || qcSpecAddApplyData.resourceID" readonly size="small" :disabled="!qcSpecAddApplyCanResource" :class="{ 'is-clearable': qcSpecAddApplyCanResource && (qcSpecHasValue(qcSpecAddApplyData.resourceID) || qcSpecHasValue(qcSpecAddApplyData.resourceDesc)) }"></el-input> <i v-if="qcSpecAddApplyCanResource && (qcSpecHasValue(qcSpecAddApplyData.resourceID) || qcSpecHasValue(qcSpecAddApplyData.resourceDesc))" class="el-icon-circle-close qc-spec-add-apply-clear" @click.stop="clearQcSpecAddApplyResource"></i> </div> </el-form-item> </el-col> <el-col :span="12"> <el-form-item> <span slot="label"> <a class="qc-spec-add-apply-link" :class="{ 'is-disabled': !qcSpecAddApplyCanManufacturer }" @click="openQcSpecAddApplyManufacturerPicker">{{ $t('qc.table.supplier') }}</a> </span> <div class="qc-spec-add-apply-input"> <el-input :value="qcSpecAddApplyData.manufacturerName || qcSpecAddApplyData.manufacturerID" readonly size="small" :disabled="!qcSpecAddApplyCanManufacturer" :class="{ 'is-clearable': qcSpecAddApplyCanManufacturer && (qcSpecHasValue(qcSpecAddApplyData.manufacturerID) || qcSpecHasValue(qcSpecAddApplyData.manufacturerName)) }"></el-input> <i v-if="qcSpecAddApplyCanManufacturer && (qcSpecHasValue(qcSpecAddApplyData.manufacturerID) || qcSpecHasValue(qcSpecAddApplyData.manufacturerName))" class="el-icon-circle-close qc-spec-add-apply-clear" @click.stop="clearQcSpecAddApplyManufacturer"></i> </div> </el-form-item> </el-col> <el-col :span="12"> <el-form-item> <span slot="label"> <a class="qc-spec-add-apply-link" :class="{ 'is-disabled': !qcSpecAddApplyCanCustomer }" @click="openQcSpecAddApplyCustomerPicker">{{ $t('qc.table.customerName') }}</a> </span> <div class="qc-spec-add-apply-input"> <el-input :value="qcSpecAddApplyData.customerName || qcSpecAddApplyData.customerID" readonly size="small" :disabled="!qcSpecAddApplyCanCustomer" :class="{ 'is-clearable': qcSpecAddApplyCanCustomer && (qcSpecHasValue(qcSpecAddApplyData.customerID) || qcSpecHasValue(qcSpecAddApplyData.customerName)) }"></el-input> <i v-if="qcSpecAddApplyCanCustomer && (qcSpecHasValue(qcSpecAddApplyData.customerID) || qcSpecHasValue(qcSpecAddApplyData.customerName))" class="el-icon-circle-close qc-spec-add-apply-clear" @click.stop="clearQcSpecAddApplyCustomer"></i> </div> </el-form-item> </el-col> </el-row> </el-form> </div> <span slot="footer" class="dialog-footer"> <el-button type="primary" size="small" @click="confirmQcSpecAddFill">{{ $t('qc.common.confirm') }}</el-button> <el-button size="small" @click="qcSpecAddFillDialogFlag = false">{{ $t('qc.common.cancel') }}</el-button> </span> </el-dialog>
<QcSpecUpload ref="qcSpecUpload" @refreshQcSpecList="refreshQcSpecList()" v-drag></QcSpecUpload>
<!-- 复制/更新质检项目到其它物料 --> <el-dialog :title="qcSpecPartTransferDialogTitle" :close-on-click-modal="false" v-drag :visible.sync="qcSpecCopyDialogFlag" width="92%" top="4vh" append-to-body custom-class="config-dialog qc-spec-copy-dialog"> <div class="qc-spec-copy-content"> <el-form :inline="true" size="small" class="qc-spec-copy-search-form"> <el-form-item :label="$t('qc.table.materialCode')"> <el-input v-model="qcSpecCopySearchData.partNo" clearable style="width: 150px" @keyup.enter.native="searchQcSpecCopyPartList"></el-input> </el-form-item> <el-form-item :label="$t('qc.table.materialName')"> <el-input v-model="qcSpecCopySearchData.partDesc" clearable style="width: 190px" @keyup.enter.native="searchQcSpecCopyPartList"></el-input> </el-form-item> <el-form-item> <el-button type="primary" icon="el-icon-search" :loading="qcSpecCopyLoading" @click="searchQcSpecCopyPartList">{{ $t('qc.common.search') }}</el-button> </el-form-item> </el-form>
<div class="qc-spec-copy-available"> <div class="qc-spec-copy-section-header"> <span class="qc-spec-copy-section-title">{{ $t('qc.partAttributePage.qcSpecCopyAvailableParts') }}</span> <el-button type="primary" size="small" icon="el-icon-plus" :disabled="qcSpecCopyPartSelections.length === 0" @click="addQcSpecCopySelectedParts"> {{ $t('qc.partAttributePage.qcSpecCopyAddSelected', { count: qcSpecCopyPartSelections.length }) }} </el-button> </div> <div class="qc-spec-copy-table-wrap"> <el-table :data="qcSpecCopyPartList" ref="qcSpecCopyPartTable" border height="100%" v-loading="qcSpecCopyLoading" @selection-change="qcSpecCopyPartSelectionChange" @row-click="qcSpecCopyPartClickRow" :row-key="getQcSpecCopyPartRowKey"> <el-table-column type="selection" width="45" align="center" :reserve-selection="true" :selectable="isQcSpecCopyPartSelectable"></el-table-column> <el-table-column prop="partNo" :label="$t('qc.table.materialCode')" min-width="120" show-overflow-tooltip></el-table-column> <el-table-column prop="partDesc" :label="$t('qc.table.materialName')" min-width="180" show-overflow-tooltip></el-table-column> <el-table-column prop="partType" :label="$t('qc.table.partType')" min-width="100" show-overflow-tooltip></el-table-column> <el-table-column prop="spec" :label="$t('qc.table.spec')" min-width="120" show-overflow-tooltip></el-table-column> <el-table-column :label="$t('qc.partAttributePage.qcSpecCopyStatus')" width="110" align="center"> <template slot-scope="scope"> <el-tag v-if="isQcSpecCopyPartAdded(scope.row)" type="info" size="mini"> {{ $t('qc.partAttributePage.qcSpecCopyAdded') }} </el-tag> <el-tag v-else-if="isQcSpecCopySourcePart(scope.row)" type="warning" size="mini"> {{ $t('qc.partAttributePage.qcSpecCopySourcePart') }} </el-tag> </template> </el-table-column> </el-table> </div> <el-pagination class="qc-spec-copy-pagination" @size-change="qcSpecCopySizeChange" @current-change="qcSpecCopyCurrentChange" :current-page="qcSpecCopyPageIndex" :page-sizes="[10, 20, 50, 100]" :page-size="qcSpecCopyPageSize" :total="qcSpecCopyTotalPage" layout="total, sizes, prev, pager, next, jumper"> </el-pagination> </div>
<div class="qc-spec-copy-selected"> <div class="qc-spec-copy-section-header qc-spec-copy-added-header"> <span class="qc-spec-copy-section-title"> {{ $t('qc.partAttributePage.qcSpecCopyAddedParts', { count: qcSpecCopyAddedParts.length }) }} </span> <el-button type="danger" plain size="small" icon="el-icon-delete" :disabled="qcSpecCopyAddedParts.length === 0" @click="clearQcSpecCopyAddedParts"> {{ $t('qc.partAttributePage.qcSpecCopyClearAdded') }} </el-button> </div> <div class="qc-spec-copy-table-wrap"> <el-table :data="qcSpecCopyAddedParts" ref="qcSpecCopyAddedTable" border height="100%" :row-key="getQcSpecCopyPartRowKey"> <el-table-column prop="partNo" :label="$t('qc.table.materialCode')" min-width="120" show-overflow-tooltip></el-table-column> <el-table-column prop="partDesc" :label="$t('qc.table.materialName')" min-width="180" show-overflow-tooltip></el-table-column> <el-table-column prop="partType" :label="$t('qc.table.partType')" min-width="100" show-overflow-tooltip></el-table-column> <el-table-column prop="spec" :label="$t('qc.table.spec')" min-width="120" show-overflow-tooltip></el-table-column> <el-table-column :label="$t('qc.common.operation')" width="80" align="center"> <template slot-scope="scope"> <el-tooltip :content="$t('qc.partAttributePage.qcSpecCopyRemoveAdded')" placement="top"> <el-button type="text" icon="el-icon-delete" class="qc-spec-copy-remove-button" @click="removeQcSpecCopyAddedPart(scope.row)"></el-button> </el-tooltip> </template> </el-table-column> </el-table> </div> </div> </div> <span slot="footer" class="dialog-footer"> <el-button type="primary" @click="confirmQcSpecPartTransfer" :loading="qcSpecCopyConfirmLoading" size="small">{{ $t('qc.common.confirm') }}</el-button> <el-button @click="qcSpecCopyDialogFlag = false" size="small">{{ $t('qc.common.cancel') }}</el-button> </span> </el-dialog>
<!-- 质检项目批量设置 --> <el-dialog :title="$t('qc.partAttributePage.dialogQcSpecBatchFill')" :close-on-click-modal="false" v-drag :visible.sync="qcSpecBatchFillDialogFlag" width="720px" append-to-body custom-class="config-dialog"> <div class="qc-spec-batch-fill-content"> <el-form label-position="top" :model="qcSpecBatchFillData"> <el-row :gutter="20"> <el-col :span="6"> <el-form-item :label="$t('qc.method.colBu')" required> <el-select v-model="qcSpecBatchFillData.buNo" :placeholder="$t('qc.common.selectPlaceholder')" size="small" style="width: 100%"> <el-option v-for="i in buList" :key="i.site + '_' + i.buNo" :label="i.sitename + ' ' + i.buDesc" :value="i.buNo"> <span style="float: left;width: 100px">{{ i.sitename }}</span> <span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px"> {{ i.buDesc }} </span> </el-option> </el-select> </el-form-item> </el-col> <el-col :span="6"> <el-form-item :label="$t('qc.table.inspectionType')" required> <el-select v-model="qcSpecBatchFillData.inspectionTypeNo" :placeholder="$t('qc.common.selectPlaceholder')" size="small" style="width: 100%" @change="onQcSpecBatchFillInspectionTypeChange"> <el-option v-for="i in options" :key="i.inspectionTypeNo" :label="i.inspectionTypeName" :value="i.inspectionTypeNo"></el-option> </el-select> </el-form-item> </el-col> <el-col :span="6"> <el-form-item> <span slot="label" @click="chooseQcSpecBatchFillProgramme"><a>{{ $t('qc.partAttributePage.samplingProgramme') }}</a></span> <el-input v-model="qcSpecBatchFillData.samplingProgrammeDesc" readonly size="small"></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item> <span slot="label" @click="chooseQcSpecBatchFillLevel"><a>{{ $t('qc.partAttributePage.samplingLevel') }}</a></span> <el-input v-model="qcSpecBatchFillData.samplingLevelDesc" readonly size="small"></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item :label="$t('qc.template.colDefaultSamplingQty')"> <el-input v-model="qcSpecBatchFillData.defaultSamplingQuantity" size="small" @input="onQcSpecBatchFillQtyInput"></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item :label="$t('qc.template.colDefaultSamplingRatio')"> <el-input v-model="qcSpecBatchFillData.defaultSamplingProportion" size="small" @input="onQcSpecBatchFillRatioInput"></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item> <span slot="label" @click="openQcSpecBatchFillOperationPicker"><a>{{ $t('qc.table.process') }}</a></span> <el-input v-model="qcSpecBatchFillData.operation" readonly size="small"></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item> <span slot="label" @click="openQcSpecBatchFillResourcePicker"><a>{{ $t('qc.table.machine') }}</a></span> <el-input :value="qcSpecBatchFillData.resourceDesc || qcSpecBatchFillData.resourceID" readonly size="small"></el-input> </el-form-item> </el-col> <el-col :span="12"> <el-form-item> <span slot="label" @click="openQcSpecBatchFillManufacturerPicker"><a>{{ $t('qc.table.supplier') }}</a></span> <el-input :value="qcSpecBatchFillData.manufacturerName || qcSpecBatchFillData.manufacturerID" readonly size="small"></el-input> </el-form-item> </el-col> <el-col :span="12"> <el-form-item> <span slot="label" @click="openQcSpecBatchFillCustomerPicker"><a>{{ $t('qc.table.customerName') }}</a></span> <el-input :value="qcSpecBatchFillData.customerName || qcSpecBatchFillData.customerID" readonly size="small"></el-input> </el-form-item> </el-col> <el-col v-if="qcSpecBatchFillTypeIsIpqc" :span="6"> <el-form-item :label="$t('qc.partAttributePage.colIpqcMethod')"> <el-select v-model="qcSpecBatchFillData.ipqcInspectionMethod" :placeholder="$t('qc.common.selectPlaceholder')" size="small" clearable style="width: 100%"> <el-option v-for="method in ipqcMethodOptions" :key="method.value" :label="method.label" :value="method.value"></el-option> </el-select> </el-form-item> </el-col> </el-row> </el-form> </div> <div slot="footer" class="dialog-footer"> <el-button type="primary" @click="confirmQcSpecBatchFill(true)" :loading="qcSpecBatchFillLoading"> {{ $t('qc.partAttributePage.qcSpecBatchFillSaveOverwrite') }} </el-button> <el-button type="primary" @click="confirmQcSpecBatchFill(false)" :loading="qcSpecBatchFillLoading"> {{ $t('qc.partAttributePage.qcSpecBatchFillSaveSkipExisting') }} </el-button> <el-button @click="qcSpecBatchFillDialogFlag = false">{{ $t('qc.common.cancel') }}</el-button> </div> </el-dialog>
<!-- 质检项目数据同步 --> <el-dialog :title="$t('qc.partAttributePage.dialogQcSpecDataSync')" :close-on-click-modal="false" v-drag :visible.sync="qcSpecSyncDialogFlag" width="720px" append-to-body custom-class="config-dialog"> <div class="qc-spec-sync-content"> <el-form label-position="top" :model="qcSpecSyncData"> <el-row :gutter="20"> <el-col :span="8"> <el-form-item :label="$t('qc.method.colBu')" required> <el-select v-model="qcSpecSyncData.buNo" :placeholder="$t('qc.common.selectPlaceholder')" size="small" style="width: 100%"> <el-option v-for="i in buList" :key="i.site + '_' + i.buNo" :label="i.sitename + ' ' + i.buDesc" :value="i.buNo"> <span style="float: left;width: 100px">{{ i.sitename }}</span> <span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px"> {{ i.buDesc }} </span> </el-option> </el-select> </el-form-item> </el-col> <el-col :span="8"> <el-form-item :label="$t('qc.table.inspectionType')" required> <el-select v-model="qcSpecSyncData.inspectionTypeNo" :placeholder="$t('qc.common.selectPlaceholder')" size="small" style="width: 100%" @change="onQcSpecSyncInspectionTypeChange"> <el-option v-for="i in options" :key="i.inspectionTypeNo" :label="i.inspectionTypeName" :value="i.inspectionTypeNo"></el-option> </el-select> </el-form-item> </el-col> <el-col v-if="qcSpecSyncTypeIsIpqc" :span="8"> <el-form-item :label="$t('qc.partAttributePage.colIpqcMethod')"> <el-select v-model="qcSpecSyncData.ipqcInspectionMethod" :placeholder="$t('qc.common.selectPlaceholder')" size="small" clearable style="width: 100%"> <el-option v-for="method in ipqcMethodOptions" :key="method.value" :label="method.label" :value="method.value"></el-option> </el-select> </el-form-item> </el-col> </el-row> <el-row :gutter="20" class="qc-spec-sync-fields"> <el-col :span="8"> <el-checkbox v-model="qcSpecSyncData.syncValueType"> {{ $t('qc.partAttributePage.qcSpecSyncFieldValueType') }} </el-checkbox> </el-col> <el-col :span="8"> <el-checkbox v-model="qcSpecSyncData.syncDefaultValue"> {{ $t('qc.partAttributePage.qcSpecSyncFieldDefaultValue') }} </el-checkbox> </el-col> <el-col :span="8"> <el-checkbox v-model="qcSpecSyncData.syncSamplingPlanLevel"> {{ $t('qc.partAttributePage.qcSpecSyncFieldSamplingPlanLevel') }} </el-checkbox> </el-col> <el-col :span="8"> <el-checkbox v-model="qcSpecSyncData.syncMaxValue"> {{ $t('qc.partAttributePage.qcSpecSyncFieldMaxValue') }} </el-checkbox> </el-col> <el-col :span="8"> <el-checkbox v-model="qcSpecSyncData.syncMinValue"> {{ $t('qc.partAttributePage.qcSpecSyncFieldMinValue') }} </el-checkbox> </el-col> </el-row> <div v-if="qcSpecSyncData.syncValueType" class="qc-spec-sync-hint"> {{ $t('qc.partAttributePage.qcSpecSyncValueTypeHint') }} </div> </el-form> </div> <div slot="footer" class="dialog-footer"> <el-button type="primary" @click="confirmQcSpecSync(true)" :loading="qcSpecSyncLoading"> {{ $t('qc.partAttributePage.qcSpecBatchFillSaveOverwrite') }} </el-button> <el-button type="primary" @click="confirmQcSpecSync(false)" :loading="qcSpecSyncLoading"> {{ $t('qc.partAttributePage.qcSpecBatchFillSaveSkipExisting') }} </el-button> <el-button @click="qcSpecSyncDialogFlag = false">{{ $t('qc.common.cancel') }}</el-button> </div> </el-dialog>
<!-- 检验标准预警配置 --> <el-dialog :title="$t('qc.partAttributePage.dialogQcSpecWarning')" :close-on-click-modal="false" v-drag :visible.sync="qcSpecWarningDialogFlag" width="1050px" append-to-body custom-class="config-dialog"> <div class="qc-spec-warning-dialog"> <div class="qc-spec-warning-header"> <span class="qc-spec-warning-item-info" v-if="qcSpecWarningCurrentRow"> {{ $t('qc.partAttributePage.qcSpecWarningItemInfo', { itemNo: qcSpecWarningCurrentRow.itemNo, itemDesc: qcSpecWarningCurrentRow.itemDesc }) }} </span> <el-button type="primary" size="small" icon="el-icon-plus" @click="addQcSpecWarningRow">{{ $t('qc.common.add') }}</el-button> </div> <el-table :data="qcSpecWarningList" border height="360px" v-loading="qcSpecWarningLoading" style="width: 100%; margin-top: 10px;"> <el-table-column :label="$t('qc.partAttributePage.warningLevel')" header-align="center" align="center" min-width="120"> <template slot-scope="scope"> <el-select v-model="scope.row.warningLevel" size="small" :placeholder="$t('qc.common.selectPlaceholder')" style="width: 100%"> <el-option v-for="item in qcSpecWarningDictOptions.warningLevel" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"> </el-option> </el-select> </template> </el-table-column> <el-table-column :label="$t('qc.partAttributePage.colorIndicator')" header-align="center" align="center" width="90"> <template slot-scope="scope"> <el-color-picker v-model="scope.row.colorCode" size="small" color-format="hex" :predefine="['#FFB6C1', '#FFD700', '#F56C6C', '#E6A23C', '#67C23A', '#409EFF']"> </el-color-picker> </template> </el-table-column> <el-table-column :label="$t('qc.partAttributePage.triggerMode')" header-align="center" align="center" min-width="130"> <template slot-scope="scope"> <el-select v-model="scope.row.triggerMode" size="small" :placeholder="$t('qc.common.selectPlaceholder')" style="width: 100%" @change="updateQcSpecWarningDesc(scope.row)"> <el-option v-for="item in qcSpecWarningDictOptions.triggerMode" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"> </el-option> </el-select> </template> </el-table-column> <el-table-column :label="$t('qc.partAttributePage.compareLogic')" header-align="center" align="center" min-width="130"> <template slot-scope="scope"> <el-select v-model="scope.row.compareLogic" size="small" :placeholder="$t('qc.common.selectPlaceholder')" style="width: 100%" @change="updateQcSpecWarningDesc(scope.row)"> <el-option v-for="item in qcSpecWarningDictOptions.compareLogic" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"> </el-option> </el-select> </template> </el-table-column> <el-table-column :label="$t('qc.partAttributePage.threshold')" header-align="center" align="center" width="100"> <template slot-scope="scope"> <el-input-number :controls="false" :step="0" v-model="scope.row.thresholdValue" size="small" style="width: 100%" @change="updateQcSpecWarningDesc(scope.row)"> </el-input-number> </template> </el-table-column> <el-table-column :label="$t('qc.partAttributePage.warningDesc')" header-align="center" align="left" min-width="220"> <template slot-scope="scope"> <span>{{ scope.row.warningDesc }}</span> </template> </el-table-column> <el-table-column :label="$t('qc.common.operation')" header-align="center" align="center" width="70"> <template slot-scope="scope"> <el-button type="text" size="small" @click="removeQcSpecWarningRow(scope.$index)" style="color: #f56c6c;">{{ $t('qc.common.delete') }}</el-button> </template> </el-table-column> </el-table> <div class="qc-spec-warning-footer"> <el-button type="primary" @click="saveQcSpecWarningList" :loading="qcSpecWarningSaveLoading">{{ $t('qc.common.save') }}</el-button> <el-button @click="qcSpecWarningDialogFlag = false">{{ $t('qc.common.close') }}</el-button> </div> </div> </el-dialog>
<!-- 文件采集配置-批量新增 --> <el-dialog :title="$t('qc.common.add')" :close-on-click-modal="false" v-drag :visible.sync="fileCollectBatchAddFlag" width="520px" class="file-collect-add-dialog"> <div class="file-collect-add-content"> <el-form :model="fileCollectBatchAddData" label-position="top"> <div class="roll-info-card"> <div class="info-header"> <i class="el-icon-s-operation"></i> <span>{{ $t('qc.partAttributePage.fileCollectAddSectionColumn') }}</span> </div> <div class="info-content"> <el-row :gutter="15"> <el-col :span="8"> <el-form-item :label="$t('qc.partAttributePage.addColumnCount')" required class="form-item-enhanced"> <el-input-number v-model="fileCollectBatchAddData.addColumnCount" :min="1" :max="500" :controls="false" style="width: 100%"></el-input-number> </el-form-item> </el-col> <el-col :span="8"> <el-form-item :label="$t('qc.partAttributePage.startValue')" required class="form-item-enhanced"> <el-input-number v-model="fileCollectBatchAddData.startValue" :min="1" :controls="false" style="width: 100%"></el-input-number> </el-form-item> </el-col> <el-col :span="8"> <el-form-item :label="' '" class="form-item-enhanced form-item-checkbox"> <el-checkbox v-model="fileCollectBatchAddData.autoIncrementColumn"> {{ $t('qc.partAttributePage.autoIncrementColumn') }} </el-checkbox> </el-form-item> </el-col> </el-row> </div> </div>
<div class="roll-info-card"> <div class="info-header"> <i class="el-icon-connection"></i> <span>{{ $t('qc.partAttributePage.fileCollectAddSectionBind') }}</span> </div> <div class="info-content"> <el-form-item required class="form-item-enhanced"> <span slot="label" class="field-link-label" @click="openFileCollectEquipmentPicker"> {{ $t('qc.itemPage.deviceCode') }} </span> <el-row :gutter="12"> <el-col :span="10"> <el-input v-model="fileCollectBatchAddData.equipmentNo" readonly></el-input> </el-col> <el-col :span="14"> <el-input v-model="fileCollectBatchAddData.equipmentDesc" readonly></el-input> </el-col> </el-row> </el-form-item> <el-form-item class="form-item-enhanced"> <span slot="label" class="field-link-label" @click="openFileCollectStaffPicker"> {{ $t('qc.partAttributePage.staffAccount') }} </span> <el-row :gutter="12"> <el-col :span="10"> <el-input v-model="fileCollectBatchAddData.staffAccount" readonly></el-input> </el-col> <el-col :span="14"> <el-input v-model="fileCollectBatchAddData.staffName" readonly></el-input> </el-col> </el-row> </el-form-item> <el-form-item class="form-item-enhanced"> <span slot="label" class="field-link-label" @click="openFileCollectBatchAddOperationPicker"> {{ $t('qc.table.process') }} </span> <el-row :gutter="12"> <el-col :span="10"> <el-input v-model="fileCollectBatchAddData.operation" readonly> <el-button v-if="qcSpecHasValue(fileCollectBatchAddData.operation)" slot="suffix" type="text" icon="el-icon-close" class="qc-spec-pending-clear-btn" @click.stop="fileCollectBatchAddData.operation = ''"></el-button> </el-input> </el-col> </el-row> </el-form-item> </div> </div>
<div class="total-info-card"> <div class="total-row"> <span class="total-label">{{ $t('qc.partAttributePage.fileCollectAddPreview') }}</span> <span class="total-value">{{ fileCollectBatchAddData.addColumnCount || 0 }}</span> </div> </div> </el-form> </div> <span slot="footer" class="file-collect-add-footer"> <button type="button" class="action-btn secondary" :disabled="fileCollectBatchAddLoading" @click="confirmFileCollectBatchAdd"> <i v-if="fileCollectBatchAddLoading" class="el-icon-loading"></i> {{ $t('qc.partAttributePage.addBtn') }} </button> <button type="button" class="action-btn secondary" @click="fileCollectBatchAddFlag = false"> {{ $t('qc.common.close') }} </button> </span> </el-dialog>
<!-- 文件采集配置-替换列名 --> <el-dialog :title="$t('qc.partAttributePage.fileCollectReplace')" :close-on-click-modal="false" v-drag :visible.sync="fileCollectReplaceFlag" width="420px"> <el-form :model="fileCollectReplaceData" label-position="top"> <el-form-item :label="$t('qc.partAttributePage.replaceFrom')"> <el-input v-model="fileCollectReplaceData.replaceFrom" :placeholder="$t('qc.partAttributePage.replaceFromPlaceholder')"></el-input> </el-form-item> <el-form-item :label="$t('qc.partAttributePage.replaceTo')"> <el-input v-model="fileCollectReplaceData.replaceTo"></el-input> </el-form-item> <el-form-item> <span style="font-size: 12px; color: #909399;">{{ $t('qc.partAttributePage.replaceScopeHint') }}</span> </el-form-item> </el-form> <div style="text-align: center; margin-top: 10px;"> <el-button type="primary" @click="confirmFileCollectReplace" :loading="fileCollectReplaceLoading">{{ $t('qc.common.confirm') }}</el-button> <el-button @click="fileCollectReplaceFlag = false">{{ $t('qc.common.cancel') }}</el-button> </div> </el-dialog>
<!-- 文件采集配置-选择设备 --> <el-dialog :title="$t('qc.partAttributePage.selectEquipmentDialog')" :close-on-click-modal="false" v-drag :visible.sync="fileCollectEquipmentFlag" width="900px" append-to-body> <el-form :inline="true" label-position="top" :model="fileCollectEquipmentQuery"> <el-form-item :label="$t('qc.itemPage.deviceCode')"> <el-input v-model="fileCollectEquipmentQuery.equipmentNo" clearable style="width: 120px"></el-input> </el-form-item> <el-form-item :label="$t('qc.itemPage.deviceName')"> <el-input v-model="fileCollectEquipmentQuery.equipmentDesc" clearable style="width: 120px"></el-input> </el-form-item> <el-form-item :label="'IP'"> <el-input v-model="fileCollectEquipmentQuery.IP" clearable style="width: 120px"></el-input> </el-form-item> <el-form-item :label="$t('qc.deviceMaintenancePage.collectMethod')"> <el-input v-model="fileCollectEquipmentQuery.suffix" clearable style="width: 100px"></el-input> </el-form-item> <el-form-item :label="' '"> <el-button type="primary" @click="searchFileCollectEquipment">{{ $t('qc.common.search') }}</el-button> </el-form-item> </el-form> <el-table :height="320" :data="fileCollectEquipmentList" ref="fileCollectEquipmentTable" v-loading="fileCollectEquipmentLoading" @row-click="fileCollectEquipmentClickRow" @row-dblclick="fileCollectEquipmentDblClickRow" @selection-change="fileCollectEquipmentSelectionChange" border style="width: 100%;"> <el-table-column type="selection" width="50" align="center"></el-table-column> <el-table-column prop="equipmentNo" :label="$t('qc.itemPage.deviceCode')" header-align="center" align="center" min-width="100" show-overflow-tooltip></el-table-column> <el-table-column prop="equipmentDesc" :label="$t('qc.itemPage.deviceName')" header-align="center" align="left" min-width="140" show-overflow-tooltip></el-table-column> <el-table-column prop="fileNo" :label="$t('qc.deviceMaintenancePage.collectId')" header-align="center" align="center" width="90"></el-table-column> <el-table-column prop="IP" label="IP" header-align="center" align="center" min-width="110" show-overflow-tooltip></el-table-column> <el-table-column prop="suffix" :label="$t('qc.deviceMaintenancePage.collectMethod')" header-align="center" align="center" width="90"></el-table-column> </el-table> <div style="text-align: center; margin-top: 12px;"> <el-button type="primary" @click="confirmFileCollectEquipment">{{ $t('qc.common.confirm') }}</el-button> <el-button @click="fileCollectEquipmentFlag = false">{{ $t('qc.common.close') }}</el-button> </div> </el-dialog>
<!-- 文件采集配置-选择项目 --> <el-dialog :title="$t('qc.itemPage.uiDialogItemList')" :close-on-click-modal="false" v-drag :visible.sync="fileCollectItemFlag" width="920px" append-to-body @close="fileCollectPickerRow = null"> <el-form :inline="true" label-position="top" :model="fileCollectItemQuery"> <el-form-item :label="$t('qc.method.colBu')"> <el-select v-model="fileCollectItemBuKey" :placeholder="$t('qc.common.selectPlaceholder')" clearable style="width: 160px" @change="onFileCollectItemBuChange"> <el-option v-for="i in buList" :key="i.site + '_' + i.buNo" :label="i.sitename + ' ' + i.buDesc" :value="i.buNo"> <span style="float: left;width: 100px">{{ i.sitename }}</span> <span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px"> {{ i.buDesc }} </span> </el-option> </el-select> </el-form-item> <el-form-item :label="$t('qc.table.inspectionType')" required> <el-select v-model="fileCollectItemQuery.inspectionTypeNo" :placeholder="$t('qc.common.selectPlaceholder')" clearable style="width: 120px"> <el-option v-for="i in options" :key="i.inspectionTypeNo" :label="i.inspectionTypeName" :value="i.inspectionTypeNo"></el-option> </el-select> </el-form-item> <el-form-item :label="$t('qc.table.itemCode')"> <el-input v-model="fileCollectItemQuery.itemNo" clearable style="width: 120px"></el-input> </el-form-item> <el-form-item :label="$t('qc.table.itemName')"> <el-input v-model="fileCollectItemQuery.itemDesc" clearable style="width: 120px"></el-input> </el-form-item> <el-form-item :label="' '"> <el-button type="primary" @click="searchFileCollectItem">{{ $t('qc.common.search') }}</el-button> </el-form-item> </el-form> <el-table :height="300" :data="fileCollectItemList" ref="fileCollectItemTable" v-loading="fileCollectItemLoading" @row-click="fileCollectItemClickRow" @row-dblclick="fileCollectItemDblClickRow" highlight-current-row border style="width: 100%;"> <el-table-column prop="buDesc" :label="$t('qc.method.colBu')" header-align="center" align="left" min-width="90" show-overflow-tooltip></el-table-column> <el-table-column prop="itemNo" :label="$t('qc.table.itemCode')" header-align="center" align="center" min-width="100"></el-table-column> <el-table-column prop="itemDesc" :label="$t('qc.table.itemName')" header-align="center" align="left" min-width="160" show-overflow-tooltip></el-table-column> <el-table-column prop="methodName" :label="$t('qc.table.inspectionMethod')" header-align="center" align="left" min-width="100" show-overflow-tooltip></el-table-column> </el-table> <div style="text-align: center; margin-top: 12px;"> <el-button type="primary" @click="confirmFileCollectItem">{{ $t('qc.common.confirm') }}</el-button> <el-button @click="fileCollectItemFlag = false">{{ $t('qc.common.close') }}</el-button> </div> </el-dialog>
<!-- 文件采集配置-选择责任人 --> <el-dialog :title="$t('qc.iqcPage.personList')" :close-on-click-modal="false" v-drag :visible.sync="fileCollectStaffFlag" width="820px" append-to-body @close="fileCollectPickerRow = null"> <el-form :inline="true" label-position="top" :model="fileCollectStaffQuery"> <el-form-item :label="$t('qc.iqcPage.userCode')"> <el-input v-model="fileCollectStaffQuery.adminID" clearable style="width: 120px"></el-input> </el-form-item> <el-form-item :label="$t('qc.iqcPage.userName')"> <el-input v-model="fileCollectStaffQuery.adminName" clearable style="width: 120px"></el-input> </el-form-item> <el-form-item :label="' '"> <el-button type="primary" @click="searchFileCollectStaff">{{ $t('qc.common.search') }}</el-button> </el-form-item> </el-form> <el-table :height="300" :data="fileCollectStaffList" ref="fileCollectStaffTable" v-loading="fileCollectStaffLoading" @row-click="fileCollectStaffClickRow" @row-dblclick="fileCollectStaffDblClickRow" highlight-current-row border style="width: 100%;"> <el-table-column prop="adminID" :label="$t('qc.iqcPage.userCode')" header-align="center" align="center" min-width="100"></el-table-column> <el-table-column prop="adminName" :label="$t('qc.iqcPage.userName')" header-align="center" align="center" min-width="120"></el-table-column> <el-table-column prop="email" :label="$t('qc.method.email')" header-align="center" align="center" min-width="140" show-overflow-tooltip></el-table-column> </el-table> <div style="text-align: center; margin-top: 12px;"> <el-button type="primary" @click="confirmFileCollectStaff">{{ $t('qc.common.confirm') }}</el-button> <el-button @click="fileCollectStaffFlag = false">{{ $t('qc.common.close') }}</el-button> </div> </el-dialog>
<QcSamplingPickerDialog ref="samplingProgrammePicker" picker-type="programme" :bu-list="buList" @select="onSamplingProgrammeSelect" /> <QcSamplingPickerDialog ref="samplingLevelPicker" picker-type="level" :bu-list="buList" @select="onSamplingLevelSelect" />
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
<!-- 上传sop文件的modal --> <qcSOPUploadFile ref="qcSOPUploadFile" @refreshPageTables="getFileContentList()" v-drag></qcSOPUploadFile>
<!-- 导入 --> <qcUpload ref="qcUpload" @refreshPageTables="getDataList()" v-drag></qcUpload>
<!-- 文件采集配置导入 --> <FileCollectUpload ref="fileCollectUpload" @refreshFileCollectList="refreshFileCollectList()" v-drag></FileCollectUpload>
<!-- 主表多物料质检项目导入 --> <QcPartSpecBatchUpload ref="qcPartSpecBatchUpload" @refreshQcSpecList="onPartSpecBatchImported" v-drag></QcPartSpecBatchUpload>
<!-- 主表多物料文件采集配置导入 --> <QcPartFileCollectBatchUpload ref="qcPartFileCollectBatchUpload" @refreshFileCollectList="onPartFileCollectBatchImported" v-drag></QcPartFileCollectBatchUpload> </div></template>
<script>import { qcPartAttributeSearch, // 查询物料属性
qcPartAttributeEdit, // 修改物料属性
qcPartDieMoldAdd, // 新增刀模
qcPartCatalogSync, // 物料目录数据同步
searchPartAttributeDetails, // 查询物料属性模板
savePartAttributeDetails, // 新增物料属性模板
deletePartAttributeDetails, // 删除物料属性模板
saveAttributeDetailed, // 新增物料属性模板详情
getPartTemplateLists, // 获取模板列表
inspectionTypeSearch, // 搜索所有检验类型
getOperationDescList, // 查询工序列表
getManufacturerList, // 查询供应商列表
getAllResourceList, // 查询机台列表
getSiteAndBuByUserName, getSiteAndBuByUserName2, umSearch, // 查询单位列表
searchPartInfo, // 查询物料信息
getPartDefectTracking, // 查询跟踪缺陷
saveDefectTracking, // 新增跟踪缺陷
deleteDefectTracking, // 删除跟踪缺陷
updateDefectTracking, // 编辑跟踪缺陷
getPartLabelTemplate, // 查询标签模版设置
saveLabelTemplate, // 新增标签模版设置
deleteLabelTemplate, // 删除标签模版设置
updateLabelTemplate, // 编辑标签模版设置
getCustomerList, // 查询客户列表
getPatrolConfigList, // 查询巡检特殊配置列表
savePatrolConfig, // 新增巡检特殊配置
updatePatrolConfig, // 更新巡检特殊配置
deletePatrolConfig, // 删除巡检特殊配置
getAllOperationDescList, // 查询所有工序列表
patrolConfigUpload, // 巡检配置批量导入
qcSpecSearch, qcSpecSave, qcSpecCheckDuplicate, qcSpecUpdate, qcSpecBatchFill, qcSpecSyncFromItem, qcSpecDelete, batchUpdateQcSpecRowNo, copyQcSpecToParts, updateQcSpecToParts, getQcSpecItemList, getQcSpecWarningList, saveQcSpecWarningList, qcPartFileCollectSearch, qcPartFileCollectBatchAdd, qcPartFileCollectBatchSave, qcPartFileCollectBatchDelete, qcPartFileCollectReplace, qcItemSearch, getResponsibleOperatorList, queryEquipmentFolderLocationList, downloadFileCollectorProgram as downloadFileCollectorProgramApi,} from '@/api/qc/qc.js'import { getDictDataByTypes } from '@/api/sys/dict.js'import { getTableDefaultListLanguage, getTableUserListLanguage,} from '@/api/table.js'import { formatQcValueType as formatQcValueTypeLabel, normalizeQcValueTypeDb } from '@/utils/qcValueTypeDisplay'import Chooselist from '@/views/modules/common/Chooselist_eam'import { getFileContentList, downLoadObjectFile,} from '@/api/eam/eam_object_list.js'import { userFavoriteList, saveUserFavorite, removeUserFavorite,} from '@/api/userFavorite.js'import { deleteObjectFile } from '@/api/eam/eam.js'import excel from '@/utils/excel-util.js'import { saveAs } from 'file-saver'import { verifyData } from '@/api/chooselist/chooselist.js'import qcUpload from './qc_upload'import qcSOPUploadFile from './qc_SOP_upload_file'import SopListComponent from './sopListComponent'import BomListComponent from './bomListComponent'import RoutingListComponent from './routingListComponent'import PatrolConfigUpload from './patrol_config_upload'import QcSpecUpload from './qc_spec_upload'import FileCollectUpload from './file_collect_upload'import QcPartSpecBatchUpload from './qc_part_spec_batch_upload'import QcPartFileCollectBatchUpload from './qc_part_file_collect_batch_upload'import QcSamplingPickerDialog from './components/QcSamplingPickerDialog'import Sortable from 'sortablejs'export default { components: { qcSOPUploadFile, Chooselist, qcUpload, SopListComponent, BomListComponent, RoutingListComponent, PatrolConfigUpload, QcSpecUpload, FileCollectUpload, QcPartSpecBatchUpload, QcPartFileCollectBatchUpload, QcSamplingPickerDialog, }, data() { return { // 检验标准维护
qcSpecList: [], qcSpecTableList: [], qcSpecSortable: null, qcSpecSyncTimer: null, qcSpecRowKeyMap: null, qcSpecSortedCache: null, qcSpecSortedCacheSource: null, qcSpecListSkipSchedule: false, qcSpecDragSaving: false, qcSpecFilterType: '105', qcSpecFilterIpqcMethod: '', qcSpecFilterOperation: '', qcSpecFilterResource: '', qcSpecFilterManufacturer: '', qcSpecFilterCustomer: '', qcSpecCurrentRow: null, editQcSpecBatchVisible: false, batchQcSpecLoading: false, qcSpecDeleteLoading: false, qcSpecBatchFillDialogFlag: false, qcSpecBatchFillLoading: false, qcSpecSyncDialogFlag: false, qcSpecSyncLoading: false, qcSpecSyncData: { buNo: '', inspectionTypeNo: '', ipqcInspectionMethod: '', syncValueType: true, syncDefaultValue: true, syncMaxValue: true, syncMinValue: true, syncSamplingPlanLevel: true, }, qcSpecBatchFillData: { buNo: '', inspectionTypeNo: '', ipqcInspectionMethod: '', samplingProgrammeNo: '', samplingProgrammeDesc: '', samplingLevelNo: '', samplingLevelDesc: '', defaultSamplingQuantity: null, defaultSamplingProportion: null, operation: '', resourceID: '', resourceDesc: '', manufacturerID: '', manufacturerName: '', customerID: '', customerName: '', }, qcSpecAddFlag: false, qcSpecSearchData: { inspectionTypeNo: '', itemNo: '', itemDesc: '', site: '', buNo: '', partNo: '', }, qcSpecItemList1: [], qcSpecItemList2: [], qcSpecItemSelections1: [], qcSpecItemSelections2: [], qcSpecPendingList: [], qcSpecAddSaveLoading: false, qcSpecAddFillDialogFlag: false, qcSpecAddSelecting: false, qcSpecAddApplyData: { inspectionTypeNo: '', ipqcInspectionMethod: '', operation: '', resourceID: '', resourceDesc: '', manufacturerID: '', manufacturerName: '', customerID: '', customerName: '', }, qcSpecWarningDialogFlag: false, qcSpecWarningLoading: false, qcSpecWarningSaveLoading: false, qcSpecWarningList: [], qcSpecWarningCurrentRow: null, qcSpecWarningDictOptions: { warningLevel: [], triggerMode: [], compareLogic: [], }, qcSpecPickerRow: null, qcSpecSelections: [], qcSpecPartTransferMode: 'copy', qcSpecCopyDialogFlag: false, qcSpecCopyLoading: false, qcSpecCopyConfirmLoading: false, qcSpecCopySearchData: { site: '', buNo: '', userName: '', partNo: '', partDesc: '', page: 1, limit: 20, }, qcSpecCopyPartList: [], qcSpecCopyPartSelections: [], qcSpecCopyAddedParts: [], qcSpecCopyPageIndex: 1, qcSpecCopyPageSize: 20, qcSpecCopyTotalPage: 0, // 文件采集配置
fileCollectList: [], editFileCollectBatchVisible: false, fileCollectLoading: false, fileCollectSaveLoading: false, fileCollectDeleteLoading: false, fileCollectorDownloadLoading: false, fileCollectBatchAddLoading: false, fileCollectReplaceLoading: false, fileCollectSelections: [], fileCollectPageIndex: 1, fileCollectPageSize: 20, fileCollectTotal: 0, fileCollectQuery: { equipmentNo: '', equipmentDesc: '', itemNo: '', }, fileCollectBatchAddFlag: false, fileCollectReplaceFlag: false, fileCollectBatchAddData: { addColumnCount: 1, autoIncrementColumn: true, startValue: 1, equipmentFolderId: null, equipmentNo: '', equipmentDesc: '', staffAccount: '', staffName: '', operation: '', }, fileCollectReplaceData: { replaceFrom: '', replaceTo: '', }, fileCollectEquipmentFlag: false, fileCollectEquipmentLoading: false, fileCollectEquipmentList: [], fileCollectEquipmentSelections: [], fileCollectEquipmentQuery: { page: 1, pageCount: 500, site: '', buNo: '', equipmentNo: '', equipmentDesc: '', IP: '', suffix: '', }, fileCollectStaffFlag: false, fileCollectStaffLoading: false, fileCollectStaffList: [], fileCollectStaffSelections: [], fileCollectStaffQuery: { flag: '2', bu: '', adminID: '', adminName: '', userName: '', }, fileCollectPickerRow: null, fileCollectItemFlag: false, fileCollectItemLoading: false, fileCollectItemList: [], fileCollectItemSelections: [], fileCollectExcludeItemNos: [], fileCollectItemBuKey: '', fileCollectItemQuery: { site: '', buNo: '', inspectionTypeNo: '', itemNo: '', itemDesc: '', itemType: 'D', userName: '', page: 1, limit: 500, }, columnsProp: ['createBy', 'updateBy'], // 是否收藏
favorite: false, // 导出 start
exportData: [], exportName: '', exportHeader: [], exportFooter: [], exportList: [], // 导出 end
tagNo: '', tagType: '', searchData: { site: '', userName: this.$store.state.user.name, partNo: '', partDesc: '', cinvSourceCode: '', sku: '', familyID: '', partType: '', buDesc: '', buNo: '', bu: '', attributeType: 'A', page: 1, limit: 10, }, height: 200, pageIndex: 1, pageSize: 20, totalPage: 0, modalFlag: false, modalDisableFlag: false, dieMoldAddModalFlag: false, dieMoldAddSaveLoading: false, dieMoldAddData: { bu: '', site: '', buNo: '', partNo: '', partDesc: '', partType: '刀模', spec: '', umId: '', remark: '', handle: 'Y', active: 'Y', createBy: this.$store.state.user.name, }, dieMoldAddRules: { bu: [{ required: true, message: ' ', trigger: ['blur', 'change'] }], partNo: [{ required: true, message: ' ', trigger: ['blur', 'change'] }], partDesc: [{ required: true, message: ' ', trigger: ['blur', 'change'] }], }, // 巡检特殊配置相关
patrolConfigDialogFlag: false, patrolConfigLoading: false, patrolConfigList: [], patrolConfigSelections: [], operationDescList: [], // 工序列表
patrolConfigSaveLoading: false, // 批量保存loading
modalData: { site: '', bu: '', buNo: '', flag: '', partNo: '', partDesc: '', partTypeDB: '', partType: '', umId: '', spec: '', expirationFlag: '', expirationDay: '', expirationWarningDay: '', exceedInRatio: '', exceedOutRatio: '', inboundWarehouseId: '', inboundWarehouseName: '', outboundWarehouseId: '', outboundWarehouseName: '', issueMethod: '', inboundLocationId: '', inboundLocationName: '', active: '', iqcExempt: '', faiExempt: '', ipqcExempt: '', pqcExempt: '', fqcExempt: '', oqcExempt: '', firstInspectionDuration: '', nextInspectionDuration: '', totalInspectionDuration: '', lastUpdateBy: this.$store.state.user.name, partDescEn: '', standardValue: '', defaultValue: '', maxValue: '', minValue: '', adhesiveActivePeriodFlag: '', thawingDuration: '', accumulatedExposureDuration: '', defectThreshold: 0, recoveryBatchCount: 0, currentDefectCount: 0, remainingTrackingBatches: 0, trackingFlag: 'N', lastDefectCount: 0, lastTriggerTime: null, }, detailData: { site: '', buNo: '', partNo: '', attributeNo: '', partDesc: '', cinvSourceCode: '', sku: '', attributeType: 'A', inspectionTypeNo: '', templateId: '', templateName: '', userName: this.$store.state.user.name, createBy: this.$store.state.user.name, }, defectTrackingData: { site: '', buNo: '', partNo: '', supplierId: '', supplierName: '', defectThreshold: '', recoveryBatchCount: '', currentDefectCount: '', lastDefectCount: '', }, labelTemplateData: { flag: '', site: '', buNo: '', partNo: '', labelTypeTb: '', labelType: '', operationDesc: '', defaultFlag: '', createBy: '', }, dataList: [], detailList: [], defectTrackingList: [], labelTemplateList: [], selectedTemplates: [], // 选中的质量检验模板
dataListLoading: false, templateDeleteLoading: false, // 批量删除loading
templatePageIndex: 1, // 质量检验模板当前页
templatePageSize: 20, // 质量检验模板每页条数
// 展示列集
columnList: [ { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table1Site', tableId: '301003Table1', tableName: '物料属性设置表', columnProp: 'site', headerAlign: 'center', align: 'center', columnLabel: '工厂编号', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, /* { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table1BuDesc', tableId: '301003Table1', tableName: '物料属性设置表', columnProp: 'buDesc', headerAlign: 'center', align: 'center', columnLabel: 'BU', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, */ { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table1PartNo', tableId: '301003Table1', tableName: '物料属性设置表', columnProp: 'partNo', headerAlign: 'center', align: 'center', columnLabel: '物料编码', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 120, }, /* { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table1SKU', tableId: '301003Table1', tableName: '物料属性设置表', columnProp: 'sku', headerAlign: 'center', align: 'center', columnLabel: 'SKU', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 120, }, */ { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table1PartDesc', tableId: '301003Table1', tableName: '物料属性设置表', columnProp: 'partDesc', headerAlign: 'center', align: 'left', columnLabel: '物料名称', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 300, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table1FamilyName', tableId: '301003Table1', tableName: '物料属性设置表', columnProp: 'partType', headerAlign: 'center', align: 'left', columnLabel: '物料类别', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 150, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table1Spec', tableId: '301003Table1', tableName: '物料属性设置表', columnProp: 'spec', headerAlign: 'center', align: 'left', columnLabel: '规格型号', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 300, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table1UmName', tableId: '301003Table1', tableName: '物料属性设置表', columnProp: 'umName', headerAlign: 'center', align: 'left', columnLabel: '单位', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table1AttributeRemark', tableId: '301003Table1', tableName: '物料属性设置表', columnProp: 'attributeRemark', headerAlign: 'center', align: 'left', columnLabel: '备注', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 200, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table1CreateTime', tableId: '301003Table1', tableName: '物料属性设置表', columnProp: 'createTime', headerAlign: 'center', align: 'center', columnLabel: '创建时间', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 170, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table1CreateBy', tableId: '301003Table1', tableName: '物料属性设置表', columnProp: 'createBy', headerAlign: 'center', align: 'center', columnLabel: '创建人', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table1UpdateDate', tableId: '301003Table1', tableName: '物料属性设置表', columnProp: 'updateDate', headerAlign: 'center', align: 'center', columnLabel: '更新时间', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 170, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table1UpdateBy', tableId: '301003Table1', tableName: '物料属性设置表', columnProp: 'updateBy', headerAlign: 'center', align: 'center', columnLabel: '更新人', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, ], columnDetailList: [ { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table2TemplateId', tableId: '301003Table2', tableName: '检验模板清单表', columnProp: 'templateId', headerAlign: 'center', align: 'left', columnLabel: '模板编码', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 120, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table2TemplateName', tableId: '301003Table2', tableName: '检验模板清单表', columnProp: 'templateName', headerAlign: 'center', align: 'left', columnLabel: '模板名称', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 200, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table2InspectionTypeName', tableId: '301003Table2', tableName: '检验模板清单表', columnProp: 'inspectionTypeName', headerAlign: 'center', align: 'center', columnLabel: '检验类型', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table2IpqcInspectionMethod', tableId: '301003Table2', tableName: '检验模板清单表', columnProp: 'ipqcInspectionMethod', headerAlign: 'center', align: 'center', columnLabel: 'IPQC检验方式', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 120, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table2TemplateVersion', tableId: '301003Table2', tableName: '检验模板清单表', columnProp: 'templateVersion', headerAlign: 'center', align: 'right', columnLabel: '版本号', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table2DefaultSamplingQuantity', tableId: '301003Table2', tableName: '检验模板清单表', columnProp: 'defaultSamplingQuantity', headerAlign: 'center', align: 'right', columnLabel: '默认抽样数量', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table2DefaultSamplingProportion', tableId: '301003Table2', tableName: '检验模板清单表', columnProp: 'defaultSamplingProportion', headerAlign: 'center', align: 'right', columnLabel: '默认抽样比例', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table2OperationDesc', tableId: '301003Table2', tableName: '检验模板清单表', columnProp: 'operation', headerAlign: 'center', align: 'left', columnLabel: '工序', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 120, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table2ResourceDesc', tableId: '301003Table2', tableName: '检验模板清单表', columnProp: 'resourceID', headerAlign: 'center', align: 'left', columnLabel: '机台', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 120, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table2ManufacturerName', tableId: '301003Table2', tableName: '检验模板清单表', columnProp: 'manufacturerName', headerAlign: 'center', align: 'left', columnLabel: '供应商', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 200, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table2CustomerName', tableId: '301003Table2', tableName: '检验模板清单表', columnProp: 'customerName', headerAlign: 'center', align: 'left', columnLabel: '客户名称', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 200, }, ], columnQcSpecList: [ { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6RowNo', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'rowNo', headerAlign: 'center', align: 'center', columnLabel: '排序', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, sortLv: 0, status: true, fixed: '', columnWidth: 70, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6BuDesc', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'buDesc', headerAlign: 'center', align: 'left', columnLabel: 'BU', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6ItemNo', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'itemNo', headerAlign: 'center', align: 'left', columnLabel: '项目编码', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6ItemDesc', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'itemDesc', headerAlign: 'center', align: 'left', columnLabel: '项目名称', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, sortLv: 0, status: true, fixed: '', columnWidth: 150, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6MethodName', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'methodName', headerAlign: 'center', align: 'left', columnLabel: '检验方法', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6MethodRemark', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'methodRemark', headerAlign: 'center', align: 'left', columnLabel: '方法说明', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, sortLv: 0, status: true, fixed: '', columnWidth: 120, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6InspectionTypeName', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'inspectionTypeName', headerAlign: 'center', align: 'left', columnLabel: '检验类型', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, sortLv: 0, status: true, fixed: '', columnWidth: 90, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6IpqcInspectionMethod', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'ipqcInspectionMethod', headerAlign: 'center', align: 'center', columnLabel: 'IPQC检验方式', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, editType: 'ipqcSelect', visibleWhen: 'ipqcMethod', sortLv: 0, status: true, fixed: '', columnWidth: 110, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6ValueType', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'valueType', headerAlign: 'center', align: 'center', columnLabel: '数据类型', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, editType: 'valueType', sortLv: 0, status: true, fixed: '', columnWidth: 90, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6DefaultValue', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'defaultValue', headerAlign: 'center', align: 'left', columnLabel: '标准值', columnHidden: false, columnImage: false, columnSortable: false, editType: 'textInput', sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6MaxValue', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'maxValue', headerAlign: 'center', align: 'right', columnLabel: '上限值', columnHidden: false, columnImage: false, columnSortable: false, editType: 'textInput', sortLv: 0, status: true, fixed: '', columnWidth: 90, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6MinValue', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'minValue', headerAlign: 'center', align: 'right', columnLabel: '下限值', columnHidden: false, columnImage: false, columnSortable: false, editType: 'textInput', sortLv: 0, status: true, fixed: '', columnWidth: 90, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6SamplingProgrammeDesc', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'samplingProgrammeDesc', headerAlign: 'center', align: 'center', columnLabel: '抽样方案', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, editType: 'programmePicker', sortLv: 0, status: true, fixed: '', columnWidth: 180, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6SamplingLevelDesc', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'samplingLevelDesc', headerAlign: 'center', align: 'center', columnLabel: '检验水平', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, editType: 'levelPicker', sortLv: 0, status: true, fixed: '', columnWidth: 180, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6DefaultSamplingQuantity', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'defaultSamplingQuantity', headerAlign: 'center', align: 'right', columnLabel: '默认抽样数量', columnHidden: false, columnImage: false, columnSortable: false, editType: 'samplingQty', sortLv: 0, status: true, fixed: '', columnWidth: 110, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6DefaultSamplingProportion', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'defaultSamplingProportion', headerAlign: 'center', align: 'right', columnLabel: '默认抽样比例', columnHidden: false, columnImage: false, columnSortable: false, editType: 'samplingRatio', sortLv: 0, status: true, fixed: '', columnWidth: 110, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6Operation', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'operation', headerAlign: 'center', align: 'left', columnLabel: '工序', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, editType: 'operationPicker', visibleWhen: 'operation', sortLv: 0, status: true, fixed: '', columnWidth: 120, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6ResourceID', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'resourceID', headerAlign: 'center', align: 'left', columnLabel: '机台', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, editType: 'resourcePicker', visibleWhen: 'resource', sortLv: 0, status: true, fixed: '', columnWidth: 140, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6ManufacturerName', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'manufacturerName', headerAlign: 'center', align: 'left', columnLabel: '供应商', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, editType: 'manufacturerPicker', visibleWhen: 'manufacturer', sortLv: 0, status: true, fixed: '', columnWidth: 140, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6CustomerName', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'customerName', headerAlign: 'center', align: 'left', columnLabel: '客户名称', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, editType: 'customerPicker', visibleWhen: 'customer', sortLv: 0, status: true, fixed: '', columnWidth: 140, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6Custom1', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'custom1', headerAlign: 'center', align: 'left', columnLabel: '自定义1', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, editType: 'textInput', sortLv: 0, status: true, fixed: '', columnWidth: 120, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6Custom2', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'custom2', headerAlign: 'center', align: 'left', columnLabel: '自定义2', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, editType: 'textInput', sortLv: 0, status: true, fixed: '', columnWidth: 120, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6Custom3', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'custom3', headerAlign: 'center', align: 'left', columnLabel: '自定义3', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, editType: 'textInput', sortLv: 0, status: true, fixed: '', columnWidth: 120, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6CreateBy', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'createBy', headerAlign: 'center', align: 'center', columnLabel: '创建人', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table6CreateTime', tableId: '301003Table6', tableName: '质检项目设置', columnProp: 'createTime', headerAlign: 'center', align: 'center', columnLabel: '创建时间', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 150, }, ], columnDefectTrackingList: [ { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table4SupplierId', tableId: '301003Table4', tableName: '物料缺陷跟踪', columnProp: 'supplierId', headerAlign: 'center', align: 'left', columnLabel: '供应商编码', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table4SupplierName', tableId: '301003Table4', tableName: '物料缺陷跟踪', columnProp: 'supplierName', headerAlign: 'center', align: 'left', columnLabel: '供应商名称', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, sortLv: 0, status: true, fixed: '', columnWidth: 200, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table4DefectThreshold', tableId: '301003Table4', tableName: '物料缺陷跟踪', columnProp: 'defectThreshold', headerAlign: 'center', align: 'center', columnLabel: '缺陷阈值', columnHidden: false, columnImage: false, columnSortable: false, editType: 'positiveInt', sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table4RecoveryBatchCount', tableId: '301003Table4', tableName: '物料缺陷跟踪', columnProp: 'recoveryBatchCount', headerAlign: 'center', align: 'center', columnLabel: '恢复批次数', columnHidden: false, columnImage: false, columnSortable: false, editType: 'positiveInt', sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table4CurrentDefectCount', tableId: '301003Table4', tableName: '物料缺陷跟踪', columnProp: 'currentDefectCount', headerAlign: 'center', align: 'center', columnLabel: '当前缺陷数', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table4LastDefectCount', tableId: '301003Table4', tableName: '物料缺陷跟踪', columnProp: 'lastDefectCount', headerAlign: 'center', align: 'center', columnLabel: '上次缺陷数', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table4RemainingTrackingBatches', tableId: '301003Table4', tableName: '物料缺陷跟踪', columnProp: 'remainingTrackingBatches', headerAlign: 'center', align: 'center', columnLabel: '剩余跟踪批次', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table4LastTriggerTime', tableId: '301003Table4', tableName: '物料缺陷跟踪', columnProp: 'lastTriggerTime', headerAlign: 'center', align: 'center', columnLabel: '最近触发时间', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 140, }, ], columnFileCollectList: [ { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table5BuNo', tableId: '301003Table5', tableName: '文件采集配置', columnProp: 'buNo', headerAlign: 'center', align: 'left', columnLabel: 'BU', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, sortLv: 0, status: true, fixed: '', columnWidth: 90, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table5EquipmentNo', tableId: '301003Table5', tableName: '文件采集配置', columnProp: 'equipmentNo', headerAlign: 'center', align: 'left', columnLabel: '设备编码', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, sortLv: 0, status: true, fixed: '', columnWidth: 110, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table5EquipmentDesc', tableId: '301003Table5', tableName: '文件采集配置', columnProp: 'equipmentDesc', headerAlign: 'center', align: 'left', columnLabel: '设备名称', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, sortLv: 0, status: true, fixed: '', columnWidth: 140, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table5StaffAccount', tableId: '301003Table5', tableName: '文件采集配置', columnProp: 'staffAccount', headerAlign: 'center', align: 'center', columnLabel: '人员账号', columnHidden: false, columnImage: false, columnSortable: false, editType: 'staffPicker', sortLv: 0, status: true, fixed: '', columnWidth: 120, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table5StaffName', tableId: '301003Table5', tableName: '文件采集配置', columnProp: 'staffName', headerAlign: 'center', align: 'center', columnLabel: '人员姓名', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table5ItemNo', tableId: '301003Table5', tableName: '文件采集配置', columnProp: 'itemNo', headerAlign: 'center', align: 'left', columnLabel: '项目编码', columnHidden: false, columnImage: false, columnSortable: false, editType: 'itemPicker', sortLv: 0, status: true, fixed: '', columnWidth: 120, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table5ItemDesc', tableId: '301003Table5', tableName: '文件采集配置', columnProp: 'itemDesc', headerAlign: 'center', align: 'left', columnLabel: '项目名称', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, sortLv: 0, status: true, fixed: '', columnWidth: 130, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table5Operation', tableId: '301003Table5', tableName: '文件采集配置', columnProp: 'operation', headerAlign: 'center', align: 'left', columnLabel: '工序', columnHidden: false, columnImage: false, columnSortable: false, showOverflowTooltip: true, editType: 'operationPicker', sortLv: 0, status: true, fixed: '', columnWidth: 140, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table5FileColumnNo', tableId: '301003Table5', tableName: '文件采集配置', columnProp: 'fileColumnNo', headerAlign: 'center', align: 'right', columnLabel: '文件列号', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 90, fixedWidth: 90, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table5OriginalColumnName', tableId: '301003Table5', tableName: '文件采集配置', columnProp: 'originalColumnName', headerAlign: 'center', align: 'left', columnLabel: '文件原列名', columnHidden: false, columnImage: false, columnSortable: false, editType: 'textInput', sortLv: 0, status: true, fixed: '', columnWidth: 120, }, { userId: this.$store.state.user.name, functionId: 301003, serialNumber: '301003Table5Remark', tableId: '301003Table5', tableName: '文件采集配置', columnProp: 'remark', headerAlign: 'center', align: 'left', columnLabel: '备注', columnHidden: false, columnImage: false, columnSortable: false, editType: 'textInput', sortLv: 0, status: true, fixed: '', columnWidth: 100, }, ], columnLabelTemplateList: [ { columnProp: 'labelTypeTb', headerAlign: 'center', align: 'left', columnLabel: '标签编码', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { columnProp: 'labelType', headerAlign: 'center', align: 'left', columnLabel: '标签类型', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 120, }, { columnProp: 'operationDesc', headerAlign: 'center', align: 'left', columnLabel: '工序', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 120, }, { columnProp: 'defaultFlagDesc', headerAlign: 'center', align: 'center', columnLabel: '默认标识', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, ], // 快速添加
fastAddFlag: false, itemList1: [], itemList2: [], itemList1Loading: false, // 可选模板列表loading
itemList2Loading: false, // 已有模板列表loading
addItemLoading: false, // 添加按钮loading
deleteItemLoading: false, // 删除按钮loading
itemListRow1: {}, itemListRow2: {}, tempLevelRow: {}, tempProgrammeRow: {}, options: [], itemSelections1: [], itemSelections2: [], rules: { partNoType: [ { required: true, message: ' ', trigger: ['blur', 'change'], }, ], partDescType: [ { required: true, message: ' ', trigger: ['blur', 'change'], }, ], bu: [ { required: true, message: ' ', trigger: ['blur', 'change'], }, ], }, // 工序
operationList: [], operationPageIndex: 1, operationPageSize: 20, operationTotalPage: 0, resourceList: [], operationModelFlag: false, resourceModelFlag: false, dataListOperationSelections: [], operationData: { site:'', operationDesc: '', }, resourceData: { site: '', resourceId: '', resourceDesc: '', }, operation: '', resourceId: '', selectionManufacturer: [], selectionManufacturer2: [], // 供应商
manufacturerList: [], manufacturerModelFlag: false, dataListManufacturerSelections: [], manufacturerData: { site: '', manufacturerID: '', manufacturerName: '', }, manufacturerPageIndex: 1, manufacturerPageSize: 20, manufacturerTotalPage: 0, // 单选框绑定的值
operationCurrent: -1, resourceCurrent: -1, sopData: { site: '', buNo: '', partNo: '', inspectionTypeNo: '', inspectionTypeName: '', }, sopList: [], sopFileModelFlag: false, sopColumnList: [ { columnProp: 'fileName', headerAlign: 'center', align: 'center', columnLabel: '文件名称', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', }, { columnProp: 'createdBy', headerAlign: 'center', align: 'center', columnLabel: '上传人', columnHidden: false, columnImage: false, columnSortable: true, sortLv: 0, status: true, fixed: false, }, { columnProp: 'createDate', headerAlign: 'center', align: 'center', columnLabel: '上传时间', columnHidden: false, columnImage: false, columnSortable: true, sortLv: 0, status: true, fixed: false, }, { columnProp: 'orderRef3', headerAlign: 'center', align: 'center', columnLabel: '检验类型', columnHidden: false, columnImage: false, columnSortable: true, sortLv: 0, status: true, fixed: false, }, ], userBuList: [], buList: [], umList: [], partInfoList: [], partDetailData: { bu: '', partNo: '', partDesc: '', seqNo: '', sku: '', cinvSourceCode: '', }, authSearch: false, authSave: false, authUpdate: false, authDelete: false, authDetail: false, authFile: false, authSync: false, authItemImport: false, syncLoading: false, menuId: this.$route.meta.menuId, activeTable: 'qcSpec', partCurrentRow: {}, secondHeight: 200, searchLoading: false, saveLoading: false, editBatchVisible: false, batchLoading: false, defectTrackingModal: false, defectTrackingDisableFlag: false, labelTemplateModal: false, labelTemplateDisableFlag: false, selectionCustomer: [], selectionCustomer2: [], dataListCustomerSelections: [], span1: 12, span2: 12, span3: 12, operationSelections: [], resourceSelections: [], customerData: { site: '', customerID: '', customerName: '', }, customerPageIndex: 1, customerPageSize: 20, customerTotalPage: 0, customerModelFlag: false, customerList: [], } },
mounted() { window.addEventListener('resize', this.handleViewportResize) this.$nextTick(() => { this.handleViewportResize() this.initQcSpecSortable() }) },
activated() { window.addEventListener('resize', this.handleViewportResize) this.$nextTick(() => this.handleViewportResize()) },
deactivated() { window.removeEventListener('resize', this.handleViewportResize) this.clearQcSpecSyncTimers() },
beforeDestroy() { window.removeEventListener('resize', this.handleViewportResize) this.clearQcSpecSyncTimers() this.destroyQcSpecSortable() },
watch: { '$i18n.locale'() { this.initPartAttributeI18n() // 动态列接口带 languageCode,语言切换后需重新拉取
this.reloadDynamicColumns() }, qcSpecList() { this.qcSpecSortedCache = null if (this.qcSpecListSkipSchedule) return this.scheduleQcSpecTableSync() }, qcSpecFilterType() { this.clearQcSpecDimensionFilters() this.resetQcSpecTableSelection() this.scheduleQcSpecTableSync() }, qcSpecFilterIpqcMethod() { this.scheduleQcSpecTableSync() }, qcSpecFilterOperation() { this.scheduleQcSpecTableSync() }, qcSpecFilterResource() { this.scheduleQcSpecTableSync() }, qcSpecFilterManufacturer() { this.scheduleQcSpecTableSync() }, qcSpecFilterCustomer() { this.scheduleQcSpecTableSync() }, activeTable(val) { if (val === 'qcSpec') { this.$nextTick(() => this.initQcSpecSortable()) } else { this.clearQcSpecSyncTimers() this.destroyQcSpecSortable() } }, editQcSpecBatchVisible(val) { if (this.qcSpecSortable) { this.qcSpecSortable.option('disabled', val) } else if (!val) { this.$nextTick(() => this.initQcSpecSortable()) } }, qcSpecColumnLayoutKey() { if (this.activeTable !== 'qcSpec') return this.$nextTick(() => this.initQcSpecSortable()) }, },
created() { // 按钮控制
this.getButtonAuthData() // 获取用户的 site 和 bu
this.getSiteAndBuByUserName() this.getSiteAndBuByUserName2() this.umSearch() // 校验用户是否收藏
// this.favoriteIsOk()
this.initPartAttributeI18n() // 获取检验类型
this.inspectionTypeSearch() // 动态列
// this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
// this.getTableUserColumn(this.$route.meta.menuId+'table2',2)
this.getTableUserColumn(this.$route.meta.menuId + 'table1', 1) // 与 columnDefectTrackingList.tableId(如 301003Table4)保持一致
this.getTableUserColumn(this.$route.meta.menuId + 'Table4', 4) // 与 columnFileCollectList.tableId(如 301003Table5)保持一致
this.getTableUserColumn(this.$route.meta.menuId + 'Table5', 5) // 与 columnQcSpecList.tableId(如 301003Table6)保持一致
this.getTableUserColumn(this.$route.meta.menuId + 'Table6', 6) if (!this.authSearch) { // 获取数据列表
this.getDataList() } },
computed: { ipqcMethodOptions() { return [ { value: '首件检', label: this.$t('qc.table.firstInspection') }, { value: '自检', label: this.$t('qc.table.selfInspection') }, { value: '巡检', label: this.$t('qc.table.patrolInspection') }, { value: '末件检', label: this.$t('qc.table.finalInspection') }, ] }, siteList() { const seen = {} const list = [] ;(this.buList || []).forEach((item) => { const site = item && item.site if (!site || seen[site]) { return } seen[site] = true list.push({ site, sitename: item.sitename || item.siteName || '', }) }) return list }, // 质量检验模板分页数据
detailListPaged() { const start = (this.templatePageIndex - 1) * this.templatePageSize const end = start + this.templatePageSize return this.detailList.slice(start, end) }, qcSpecBatchFillTypeIsIpqc() { return this.qcSpecBatchFillData.inspectionTypeNo === '101' }, qcSpecSyncTypeIsIpqc() { return this.qcSpecSyncData.inspectionTypeNo === '101' }, /** 质检项目新增:仅展示与当前物料同 site 的 BU,避免跨工厂选项目 */ qcSpecAddBuList() { const partSite = this.partCurrentRow && this.partCurrentRow.site if (partSite === undefined || partSite === null || partSite === '') { return [] } return (this.buList || []).filter( (i) => String(i.site) === String(partSite) ) }, qcSpecAddApplyIsIqc() { return String(this.qcSpecAddApplyData.inspectionTypeNo) === '105' }, qcSpecAddApplyIsIpqc() { return String(this.qcSpecAddApplyData.inspectionTypeNo) === '101' }, qcSpecAddApplyCanOperation() { return !!this.qcSpecAddApplyData.inspectionTypeNo && !this.qcSpecAddApplyIsIqc }, qcSpecAddApplyCanResource() { return this.qcSpecAddApplyCanOperation }, qcSpecAddApplyCanManufacturer() { return this.qcSpecAddApplyIsIqc }, qcSpecAddApplyCanCustomer() { return this.qcSpecAddApplyCanOperation }, /** 质检项目筛选:按当前检验类型显示对应条件 */ qcSpecFilterShowManufacturer() { return String(this.qcSpecFilterType) === '105' }, qcSpecFilterShowIpqcMethod() { return String(this.qcSpecFilterType) === '101' }, qcSpecFilterShowOperation() { return ['101', '107', '109'].includes(String(this.qcSpecFilterType)) }, qcSpecFilterShowResource() { return ['101', '107', '109'].includes(String(this.qcSpecFilterType)) }, qcSpecFilterShowCustomer() { return ['101', '107', '109'].includes(String(this.qcSpecFilterType)) }, qcSpecListByFilterType() { const filterType = String(this.qcSpecFilterType || '') const list = this.qcSpecList || [] if (!filterType) return list return list.filter((item) => String(item.inspectionTypeNo || '') === filterType) }, qcSpecOperationFilterOptions() { return this.buildQcSpecFilterOptions(this.qcSpecListByFilterType, (item) => (item.operation || '').trim() ) }, qcSpecResourceFilterOptions() { return this.buildQcSpecFilterOptions(this.qcSpecListByFilterType, (item) => this.getQcSpecResourceFilterValue(item) ) }, qcSpecManufacturerFilterOptions() { return this.buildQcSpecFilterOptions(this.qcSpecListByFilterType, (item) => this.getQcSpecManufacturerFilterValue(item) ) }, qcSpecCustomerFilterOptions() { return this.buildQcSpecFilterOptions(this.qcSpecListByFilterType, (item) => this.getQcSpecCustomerFilterValue(item) ) }, qcSpecVisibleColumnList() { const showMap = { ipqcMethod: this.qcSpecFilterShowIpqcMethod, operation: this.qcSpecFilterShowOperation, resource: this.qcSpecFilterShowResource, manufacturer: this.qcSpecFilterShowManufacturer, customer: this.qcSpecFilterShowCustomer, } return (this.columnQcSpecList || []) .filter((col) => { if (col.status === false || col.columnHidden) return false if (!col.visibleWhen) return true return !!showMap[col.visibleWhen] }) .slice() .sort((a, b) => Number(a.sortLv || 0) - Number(b.sortLv || 0)) }, qcSpecColumnLayoutKey() { return (this.qcSpecVisibleColumnList || []) .map((col) => col.columnProp) .join(',') }, /** 质检项目设置:IQC 与 IPQC 互换位置,IQC 排最前 */ qcSpecTypeOptions() { const opts = [...(this.options || [])] const iqcIdx = opts.findIndex((item) => String(item.inspectionTypeNo) === '105') const ipqcIdx = opts.findIndex((item) => String(item.inspectionTypeNo) === '101') if (iqcIdx < 0 || ipqcIdx < 0 || iqcIdx === ipqcIdx) { return opts } const result = [...opts] const iqc = result[iqcIdx] const ipqc = result[ipqcIdx] result[iqcIdx] = ipqc result[ipqcIdx] = iqc return result }, qcSpecPartTransferDialogTitle() { return this.qcSpecPartTransferMode === 'update' ? this.$t('qc.partAttributePage.dialogQcSpecUpdate') : this.$t('qc.partAttributePage.dialogQcSpecCopy') }, },
methods: { formatQcValueType (row) { return formatQcValueTypeLabel(row, this.$t.bind(this)) }, formatIpqcMethod(value) { const method = this.ipqcMethodOptions.find(option => option.value === value) return method ? method.label : value }, qcSpecColumnText(row, item) { if (!row || !item) return '' if (item.columnProp === 'ipqcInspectionMethod') { return this.formatIpqcMethod(row.ipqcInspectionMethod) } if (item.columnProp === 'resourceID') { return row.resourceDesc || row.resourceID } return row[item.columnProp] }, // Keep both data grids usable on short screens and recalculate after viewport changes.
handleViewportResize() { const viewportHeight = document.documentElement.clientHeight || window.innerHeight const availableHeight = Math.max(viewportHeight - 170, 460) const firstTableHeight = Math.max(180, Math.floor(availableHeight * 0.35))
this.height = firstTableHeight this.secondHeight = Math.max(280, availableHeight - firstTableHeight) },
initPartAttributeI18n() { const t = (k) => this.$t('qc.partAttributePage.' + k) const tt = (k) => this.$t('qc.table.' + k) const tm = (k) => this.$t('qc.method.' + k) const tpl = (k) => this.$t('qc.template.' + k) const mainMap = { site: () => t('colSite'), buDesc: () => 'BU', partNo: () => tt('materialCode'), sku: () => 'SKU', partDesc: () => tt('materialName'), partType: () => tt('partType'), spec: () => tt('spec'), umName: () => tt('unit'), attributeRemark: () => tt('remark'), createTime: () => tm('colCreateTime'), createBy: () => tm('colCreateBy'), updateDate: () => tm('colUpdateTime'), updateBy: () => tm('colUpdateBy'), } const detailMap = { templateId: () => tt('templateCode'), templateName: () => tt('templateName'), inspectionTypeName: () => tt('inspectionType'), ipqcInspectionMethod: () => t('colIpqcMethod'), templateVersion: () => tpl('colVersion'), defaultSamplingQuantity: () => tpl('colDefaultSamplingQty'), defaultSamplingProportion: () => tpl('colDefaultSamplingRatio'), operation: () => tt('process'), resourceID: () => tt('machine'), manufacturerName: () => tt('supplier'), customerName: () => tt('customerName'), } const qcSpecMap = { rowNo: () => t('colSort'), buDesc: () => tm('colBu'), itemNo: () => tt('itemCode'), itemDesc: () => tt('itemName'), methodName: () => tt('inspectionMethod'), methodRemark: () => tm('colMethodRemark'), inspectionTypeName: () => tt('inspectionType'), ipqcInspectionMethod: () => t('colIpqcMethod'), valueType: () => tt('valueType'), defaultValue: () => tt('standardValue'), maxValue: () => tt('upperValue'), minValue: () => tt('lowerValue'), samplingProgrammeDesc: () => t('samplingProgramme'), samplingLevelDesc: () => t('samplingLevel'), defaultSamplingQuantity: () => tpl('colDefaultSamplingQty'), defaultSamplingProportion: () => tpl('colDefaultSamplingRatio'), operation: () => tt('process'), resourceID: () => tt('machine'), manufacturerName: () => tt('supplier'), customerName: () => tt('customerName'), custom1: () => t('colCustom1'), custom2: () => t('colCustom2'), custom3: () => t('colCustom3'), createBy: () => tm('colCreateBy'), createTime: () => tm('colCreateTime'), } const defectMap = { supplierId: () => t('colSupplierId'), supplierName: () => t('colSupplierNameCol'), defectThreshold: () => t('defectThreshold'), recoveryBatchCount: () => t('recoveryBatchCount'), currentDefectCount: () => t('currentDefectCount'), lastDefectCount: () => t('lastDefectCount'), remainingTrackingBatches: () => t('remainingTrackingBatches'), lastTriggerTime: () => t('lastTriggerTime'), } const fileCollectMap = { buNo: () => 'BU', equipmentNo: () => this.$t('qc.itemPage.deviceCode'), equipmentDesc: () => this.$t('qc.itemPage.deviceName'), staffAccount: () => t('staffAccount'), staffName: () => this.$t('qc.iqcPage.userName'), itemNo: () => tt('itemCode'), itemDesc: () => tt('itemName'), operation: () => tt('process'), fileColumnNo: () => t('fileColumnNo'), originalColumnName: () => t('originalFileColumnName'), remark: () => tt('remark'), } const labelMap = { labelTypeTb: () => t('colLabelCode'), labelType: () => t('colLabelType'), operationDesc: () => tt('process'), defaultFlagDesc: () => t('colDefaultFlag'), } const sopMap = { fileName: () => tt('fileName'), createdBy: () => tt('uploadBy'), createDate: () => tt('uploadTime'), orderRef3: () => tt('inspectionType'), } const apply = (list, map, tableName) => { if (!list) return list.forEach((col) => { if (tableName) col.tableName = tableName const fn = map[col.columnProp] if (fn) col.columnLabel = fn() }) } apply(this.columnList, mainMap, t('tableNameMain')) apply(this.columnDetailList, detailMap, t('tableNameTemplate')) apply(this.columnQcSpecList, qcSpecMap, t('tabQcSpec')) apply(this.columnDefectTrackingList, defectMap, t('tabDefectTracking')) apply(this.columnFileCollectList, fileCollectMap, t('tabFileCollect')) apply(this.columnLabelTemplateList, labelMap) apply(this.sopColumnList, sopMap) this.exportName = t('exportPrefix') + this.dayjs().format('YYYYMMDDHHmmss') this.exportHeader = [t('exportHeader')] },
// ================= 文件采集配置 =================
downloadFileCollectorProgram() { const fileName = 'QMS_File_Collector.zip' this.fileCollectorDownloadLoading = true downloadFileCollectorProgramApi(fileName) .then(({ data }) => { saveAs(data, fileName) }) .catch(() => { this.$message.error(this.$t('qc.partAttributePage.downloadFileCollectorFail')) }) .finally(() => { this.fileCollectorDownloadLoading = false }) }, searchFileCollect() { this.fileCollectPageIndex = 1 this.refreshFileCollectList() }, refreshFileCollectList() { if (!this.partCurrentRow || !this.partCurrentRow.partNo) { this.fileCollectList = [] this.fileCollectTotal = 0 this.editFileCollectBatchVisible = false return } this.editFileCollectBatchVisible = false this.fileCollectLoading = true const query = this.fileCollectQuery || {} qcPartFileCollectSearch({ site: this.partCurrentRow.site, buNo: this.partCurrentRow.buNo, partNo: this.partCurrentRow.partNo, equipmentNo: (query.equipmentNo || '').trim(), equipmentDesc: (query.equipmentDesc || '').trim(), itemNo: (query.itemNo || '').trim(), page: this.fileCollectPageIndex, limit: this.fileCollectPageSize, }) .then(({ data }) => { if (data && data.code === 0 && data.page) { this.fileCollectList = data.page.list || [] this.fileCollectTotal = data.page.totalCount || 0 this.fileCollectPageIndex = data.page.currPage || 1 this.fileCollectPageSize = data.page.pageSize || 20 } }) .finally(() => { this.fileCollectLoading = false }) }, fileCollectUploadModal() { if (!this.partCurrentRow || !this.partCurrentRow.partNo) { this.$message.warning(this.$t('qc.partAttributePage.selectPartForTemplate')) return } const currentData = { site: this.partCurrentRow.site, partNo: this.partCurrentRow.partNo, createBy: this.$store.state.user.name, } this.$nextTick(() => { this.$refs.fileCollectUpload.init(currentData) }) }, fileCollectSizeChange(val) { this.fileCollectPageSize = val this.fileCollectPageIndex = 1 this.refreshFileCollectList() }, fileCollectCurrentChange(val) { this.fileCollectPageIndex = val this.refreshFileCollectList() }, handleFileCollectSelectionChange(val) { this.fileCollectSelections = val }, openFileCollectBatchAdd() { if (!this.partCurrentRow.partNo) { this.$message.warning( this.$t('qc.partAttributePage.selectPartForTemplate') ) return } this.fileCollectBatchAddData = { addColumnCount: 1, autoIncrementColumn: true, startValue: 1, equipmentFolderId: null, equipmentNo: '', equipmentDesc: '', staffAccount: '', staffName: '', operation: '', } this.fileCollectBatchAddFlag = true }, openFileCollectBatchAddOperationPicker() { if (!this.partCurrentRow.partNo) return this.openQcSpecLinkedOperationPicker(this.fileCollectBatchAddData) }, openFileCollectEquipmentPicker() { if (!this.partCurrentRow.partNo) return this.fileCollectEquipmentQuery = { page: 1, pageCount: 500, site: this.partCurrentRow.site, buNo: this.partCurrentRow.buNo, equipmentNo: '', equipmentDesc: '', IP: '', suffix: '', } this.fileCollectEquipmentSelections = [] this.fileCollectEquipmentFlag = true this.searchFileCollectEquipment() }, searchFileCollectEquipment() { this.fileCollectEquipmentLoading = true queryEquipmentFolderLocationList(this.fileCollectEquipmentQuery) .then(({ data }) => { if (data && data.code === 0) { this.fileCollectEquipmentList = data.rows || [] this.$nextTick(() => { if (!this.$refs.fileCollectEquipmentTable) return this.$refs.fileCollectEquipmentTable.clearSelection() const selectedNo = this.fileCollectBatchAddData.equipmentNo if (selectedNo) { this.fileCollectEquipmentList.forEach((row) => { if (row.equipmentNo === selectedNo) { this.$refs.fileCollectEquipmentTable.toggleRowSelection(row, true) } }) } }) } else { this.fileCollectEquipmentList = [] } }) .finally(() => { this.fileCollectEquipmentLoading = false }) }, fileCollectEquipmentClickRow(row) { this.$refs.fileCollectEquipmentTable.clearSelection() this.$refs.fileCollectEquipmentTable.toggleRowSelection(row, true) }, fileCollectEquipmentDblClickRow(row) { this.fileCollectEquipmentSelections = [row] this.confirmFileCollectEquipment() }, fileCollectEquipmentSelectionChange(val) { if (val.length > 1) { const last = val[val.length - 1] this.$refs.fileCollectEquipmentTable.clearSelection() this.$refs.fileCollectEquipmentTable.toggleRowSelection(last, true) this.fileCollectEquipmentSelections = [last] } else { this.fileCollectEquipmentSelections = val } }, confirmFileCollectEquipment() { if (this.fileCollectEquipmentSelections.length === 0) { this.$message.warning(this.$t('qc.partAttributePage.selectEquipment')) return } const row = this.fileCollectEquipmentSelections[0] this.fileCollectBatchAddData.equipmentFolderId = row.id this.fileCollectBatchAddData.equipmentNo = row.equipmentNo this.fileCollectBatchAddData.equipmentDesc = row.equipmentDesc this.fileCollectEquipmentFlag = false }, openFileCollectStaffPicker(row) { if (!this.partCurrentRow.partNo) return this.fileCollectPickerRow = row || null this.fileCollectStaffQuery = { flag: '2', bu: this.partCurrentRow.site + '_' + this.partCurrentRow.buNo, adminID: '', adminName: '', userName: this.$store.state.user.name, } this.fileCollectStaffSelections = [] this.fileCollectStaffFlag = true this.searchFileCollectStaff() }, searchFileCollectStaff() { this.fileCollectStaffLoading = true getResponsibleOperatorList(this.fileCollectStaffQuery) .then(({ data }) => { if (data && data.code === 0) { this.fileCollectStaffList = data.rows || [] this.$nextTick(() => { if (!this.$refs.fileCollectStaffTable) return const target = this.fileCollectPickerRow || this.fileCollectBatchAddData const account = target.staffAccount if (account) { const match = this.fileCollectStaffList.find((row) => row.adminID === account) if (match) { this.$refs.fileCollectStaffTable.setCurrentRow(match) this.fileCollectStaffSelections = [match] } } }) } else { this.fileCollectStaffList = [] } }) .finally(() => { this.fileCollectStaffLoading = false }) }, fileCollectStaffClickRow(row) { this.fileCollectStaffSelections = [row] this.$refs.fileCollectStaffTable.setCurrentRow(row) }, fileCollectStaffDblClickRow(row) { this.fileCollectStaffSelections = [row] this.confirmFileCollectStaff() }, confirmFileCollectStaff() { if (this.fileCollectStaffSelections.length === 0) { this.$message.warning(this.$t('qc.entry.selectPersons')) return } const row = this.fileCollectStaffSelections[0] const target = this.fileCollectPickerRow || this.fileCollectBatchAddData target.staffAccount = row.adminID target.staffName = row.adminName this.fileCollectStaffFlag = false this.fileCollectPickerRow = null }, openFileCollectItemPicker(row) { if (!this.partCurrentRow.partNo || !row) return this.fileCollectPickerRow = row const preferredBuNo = row.buNo || this.partCurrentRow.buNo || '' const preferredSite = this.partCurrentRow.site || '' // buList.buNo 本身已是 site_bu(如 41_Flexo)
const preferredKey = preferredBuNo.indexOf('_') >= 0 ? preferredBuNo : preferredBuNo ? `${preferredSite}_${preferredBuNo}` : '' const matchedBu = (this.buList || []).find((i) => i.buNo === preferredKey) || (this.buList || []).find((i) => this.parseBuNo(i.buNo) === preferredBuNo) || null const buKey = matchedBu ? matchedBu.buNo : preferredKey || (this.buList.length > 0 ? this.buList[0].buNo : '') const site = matchedBu ? matchedBu.site : preferredSite || (this.buList.length > 0 ? this.buList[0].site : '') this.fileCollectItemBuKey = buKey this.fileCollectItemQuery = { site: site, buNo: this.parseBuNo(buKey) || preferredBuNo, inspectionTypeNo: '105', itemNo: '', itemDesc: '', itemType: 'D', userName: this.$store.state.user.name, page: 1, limit: 500, } this.fileCollectItemList = [] this.fileCollectItemSelections = [] this.fileCollectItemFlag = true this.loadFileCollectExcludeItemNos().then(() => { this.searchFileCollectItem() }) }, onFileCollectItemBuChange(val) { if (!val) { this.fileCollectItemQuery.buNo = '' return } const matched = (this.buList || []).find((i) => i.buNo === val) if (matched) { this.fileCollectItemQuery.site = matched.site this.fileCollectItemQuery.buNo = this.parseBuNo(matched.buNo) } else { this.fileCollectItemQuery.buNo = this.parseBuNo(val) } }, openFileCollectOperationPicker(row) { if (!this.editFileCollectBatchVisible || !row) return this.openQcSpecLinkedOperationPicker(row) }, clearFileCollectOperation(row) { if (!row) return row.operation = '' }, loadFileCollectExcludeItemNos() { const currentItemNo = ((this.fileCollectPickerRow && this.fileCollectPickerRow.itemNo) || '').trim() return qcPartFileCollectSearch({ site: this.partCurrentRow.site, buNo: this.partCurrentRow.buNo, partNo: this.partCurrentRow.partNo, page: 1, limit: 9999, }).then(({ data }) => { const list = (data && data.code === 0 && data.page && data.page.list) || [] const itemNos = new Set() list.forEach((item) => { const no = (item.itemNo || '').trim() if (no && no !== currentItemNo) { itemNos.add(no) } }) ;(this.fileCollectList || []).forEach((item) => { if (item === this.fileCollectPickerRow) return const no = (item.itemNo || '').trim() if (no && no !== currentItemNo) { itemNos.add(no) } }) this.fileCollectExcludeItemNos = Array.from(itemNos) }) }, searchFileCollectItem() { const inspectionTypeNo = (this.fileCollectItemQuery.inspectionTypeNo || '').trim() if (!inspectionTypeNo) { this.$message.warning(this.$t('qc.method.selectInspectionType')) return } this.fileCollectItemLoading = true qcItemSearch(this.fileCollectItemQuery) .then(({ data }) => { if (data && data.code === 0 && data.page) { const excludeSet = new Set(this.fileCollectExcludeItemNos || []) const currentItemNo = ((this.fileCollectPickerRow && this.fileCollectPickerRow.itemNo) || '').trim() let list = (data.page.list || []).filter((item) => { const itemNo = (item.itemNo || '').trim() if (!itemNo) return false if (itemNo === currentItemNo) return true return !excludeSet.has(itemNo) }) this.fileCollectItemList = list this.$nextTick(() => { if (!this.$refs.fileCollectItemTable) return if (currentItemNo) { const match = this.fileCollectItemList.find((row) => row.itemNo === currentItemNo) if (match) { this.$refs.fileCollectItemTable.setCurrentRow(match) this.fileCollectItemSelections = [match] } } }) } else { this.fileCollectItemList = [] } }) .finally(() => { this.fileCollectItemLoading = false }) }, fileCollectItemClickRow(row) { this.fileCollectItemSelections = [row] this.$refs.fileCollectItemTable.setCurrentRow(row) }, fileCollectItemDblClickRow(row) { this.fileCollectItemSelections = [row] this.confirmFileCollectItem() }, confirmFileCollectItem() { if (this.fileCollectItemSelections.length === 0) { this.$message.warning(this.$t('qc.partAttributePage.selectAvailableItems')) return } const selected = this.fileCollectItemSelections[0] if (this.fileCollectPickerRow) { this.fileCollectPickerRow.itemNo = selected.itemNo this.fileCollectPickerRow.itemDesc = selected.itemDesc || '' this.fileCollectPickerRow.buNo = selected.buNo || '' } this.fileCollectItemFlag = false this.fileCollectPickerRow = null }, confirmFileCollectBatchAdd() { if (!this.fileCollectBatchAddData.equipmentNo) { this.$message.warning(this.$t('qc.partAttributePage.selectEquipment')) return } this.fileCollectBatchAddLoading = true qcPartFileCollectBatchAdd({ site: this.partCurrentRow.site, buNo: this.partCurrentRow.buNo, partNo: this.partCurrentRow.partNo, addColumnCount: this.fileCollectBatchAddData.addColumnCount, autoIncrementColumn: this.fileCollectBatchAddData.autoIncrementColumn, startValue: this.fileCollectBatchAddData.startValue, equipmentFolderId: this.fileCollectBatchAddData.equipmentFolderId, equipmentNo: this.fileCollectBatchAddData.equipmentNo, equipmentDesc: this.fileCollectBatchAddData.equipmentDesc, staffAccount: this.fileCollectBatchAddData.staffAccount, staffName: this.fileCollectBatchAddData.staffName, operation: this.fileCollectBatchAddData.operation, createBy: this.$store.state.user.name, }) .then(({ data }) => { if (data && data.code === 0) { this.$message.success(this.$t('qc.partAttributePage.addSuccess')) this.fileCollectBatchAddFlag = false this.refreshFileCollectList() } else { this.$message.error(data.msg) } }) .finally(() => { this.fileCollectBatchAddLoading = false }) }, editFileCollectBatchModel() { if (!this.partCurrentRow.partNo) { this.$message.warning(this.$t('qc.partAttributePage.selectPartForTemplate')) return } this.editFileCollectBatchVisible = true }, cancelFileCollectBatchModel() { this.refreshFileCollectList() }, lookupFileCollectItem(row) { const itemNo = (row.itemNo || '').trim() if (!itemNo) { row.itemNo = '' row.itemDesc = '' row.buNo = '' return Promise.resolve() } row.itemNo = itemNo return qcItemSearch({ site: this.partCurrentRow.site, userName: this.$store.state.user.name, itemNo, itemType: 'D', buNo: this.partCurrentRow.buNo, page: 1, limit: 50, }) .then(({ data }) => { const list = (data && data.page && data.page.list) || [] const found = list.find((item) => item.itemNo === itemNo) if (found) { row.itemNo = found.itemNo row.itemDesc = found.itemDesc || '' row.buNo = found.buNo || '' } else { row.itemNo = '' row.itemDesc = '' row.buNo = '' } }) .catch(() => { row.itemNo = '' row.itemDesc = '' row.buNo = '' }) }, onFileCollectItemNoBlur(row) { this.lookupFileCollectItem(row) }, batchFileCollectModel() { this.saveFileCollectList() }, saveFileCollectList() { if (!this.partCurrentRow.partNo) return this.fileCollectSaveLoading = true Promise.all(this.fileCollectList.map((row) => this.lookupFileCollectItem(row))) .then(() => qcPartFileCollectBatchSave({ site: this.partCurrentRow.site, buNo: this.partCurrentRow.buNo, partNo: this.partCurrentRow.partNo, updateBy: this.$store.state.user.name, rowList: this.fileCollectList, }) ) .then(({ data }) => { if (data && data.code === 0) { this.editFileCollectBatchVisible = false this.$message.success(this.$t('qc.partAttributePage.batchSaveSuccess')) this.refreshFileCollectList() } else { this.$message.error(data.msg) } }) .finally(() => { this.fileCollectSaveLoading = false }) }, batchDeleteFileCollect() { if (this.fileCollectSelections.length === 0) { this.$message.warning(this.$t('qc.partAttributePage.selectAtLeastOne')) return } this.$confirm( this.$t('qc.partAttributePage.batchDeleteFileCollectCount', { count: this.fileCollectSelections.length, }), this.$t('qc.common.tip'), { confirmButtonText: this.$t('qc.common.confirm'), cancelButtonText: this.$t('qc.common.cancel'), type: 'warning', } ).then(() => { this.fileCollectDeleteLoading = true qcPartFileCollectBatchDelete({ site: this.partCurrentRow.site, //buNo: this.partCurrentRow.buNo,
partNo: this.partCurrentRow.partNo, idList: this.fileCollectSelections.map((r) => r.id), }) .then(({ data }) => { if (data && data.code === 0) { this.$message.success( this.$t('qc.partAttributePage.batchDeleteSuccess') ) this.$refs.fileCollectTable.clearSelection() this.fileCollectSelections = [] this.refreshFileCollectList() } else { this.$message.error(data.msg) } }) .finally(() => { this.fileCollectDeleteLoading = false }) }) }, openFileCollectReplace() { if (!this.partCurrentRow.partNo) { this.$message.warning( this.$t('qc.partAttributePage.selectPartForTemplate') ) return } this.fileCollectReplaceData = { replaceFrom: '', replaceTo: '' } this.fileCollectReplaceFlag = true }, confirmFileCollectReplace() { const idList = this.fileCollectSelections.length > 0 ? this.fileCollectSelections.map((r) => r.id) : null this.fileCollectReplaceLoading = true qcPartFileCollectReplace({ site: this.partCurrentRow.site, buNo: this.partCurrentRow.buNo, partNo: this.partCurrentRow.partNo, replaceFrom: this.fileCollectReplaceData.replaceFrom, replaceTo: this.fileCollectReplaceData.replaceTo, idList: idList, updateBy: this.$store.state.user.name, }) .then(({ data }) => { if (data && data.code === 0) { this.$message.success(this.$t('qc.common.operationSuccess')) this.fileCollectReplaceFlag = false this.refreshFileCollectList() } else { this.$message.error(data.msg) } }) .finally(() => { this.fileCollectReplaceLoading = false }) }, // ================= 检验标准维护相关方法 =================
qcSpecUploadModal() { let currentData = { site: this.partCurrentRow.site, buNo: this.partCurrentRow.buNo, partNo: this.partCurrentRow.partNo, createBy: this.$store.state.user.name, } this.$nextTick(() => { this.$refs.qcSpecUpload.init(currentData) }) }, openPartSpecBatchUpload() { this.$nextTick(() => { this.$refs.qcPartSpecBatchUpload.init({ createBy: this.$store.state.user.name, }) }) }, onPartSpecBatchImported() { this.refreshQcSpecList() }, openPartFileCollectBatchUpload() { this.$nextTick(() => { this.$refs.qcPartFileCollectBatchUpload.init({ createBy: this.$store.state.user.name, }) }) }, onPartFileCollectBatchImported() { this.refreshFileCollectList() }, refreshQcSpecList(skipSearchPartAttributeDetails = false) { if (!this.partCurrentRow || !this.partCurrentRow.partNo) return Promise.resolve() if (!skipSearchPartAttributeDetails) { this.loadDetailListForQcSpec() } return qcSpecSearch({ site: this.partCurrentRow.site, partNo: this.partCurrentRow.partNo, }).then(({ data }) => { if (data && data.code === 0) { this.qcSpecList = data.rows || [] this.assignQcSpecRowKeys(this.qcSpecList) this.validateQcSpecFilters() this.syncQcSpecCurrentRow() } }) }, resetQcSpecFilters() { this.clearQcSpecDimensionFilters() this.qcSpecFilterType = this.getDefaultQcSpecFilterType() this.resetQcSpecTableSelection() }, clearQcSpecDimensionFilters() { this.qcSpecFilterIpqcMethod = '' this.qcSpecFilterOperation = '' this.qcSpecFilterResource = '' this.qcSpecFilterManufacturer = '' this.qcSpecFilterCustomer = '' }, getDefaultQcSpecFilterType() { const opts = this.qcSpecTypeOptions if (!opts.length) return '' const iqc = opts.find((item) => String(item.inspectionTypeNo) === '105') return iqc ? '105' : String(opts[0].inspectionTypeNo) }, ensureDefaultQcSpecFilterType() { const opts = this.options || [] if (!opts.length) { this.qcSpecFilterType = '' return } const current = String(this.qcSpecFilterType || '') const exists = opts.some( (item) => String(item.inspectionTypeNo) === current ) if (!current || !exists) { this.qcSpecFilterType = this.getDefaultQcSpecFilterType() } }, resetFileCollectQuery() { this.fileCollectQuery = { equipmentNo: '', equipmentDesc: '', itemNo: '', } this.fileCollectPageIndex = 1 }, buildQcSpecFilterOptions(list, getter) { const valueSet = new Set() ;(list || []).forEach((item) => { const value = (getter(item) || '').trim() if (value) { valueSet.add(value) } }) return [...valueSet].sort((a, b) => a.localeCompare(b, 'zh-CN')) }, getQcSpecResourceFilterValue(item) { if (!item) return '' return String(item.resourceDesc || item.resourceID || '').trim() }, getQcSpecManufacturerFilterValue(item) { if (!item) return '' return String(item.manufacturerName || item.manufacturerID || '').trim() }, getQcSpecCustomerFilterValue(item) { if (!item) return '' return String(item.customerName || item.customerID || '').trim() }, validateQcSpecFilters() { this.ensureDefaultQcSpecFilterType() if ( this.qcSpecFilterOperation && !this.qcSpecOperationFilterOptions.includes(this.qcSpecFilterOperation) ) { this.qcSpecFilterOperation = '' } if ( this.qcSpecFilterResource && !this.qcSpecResourceFilterOptions.includes(this.qcSpecFilterResource) ) { this.qcSpecFilterResource = '' } if ( this.qcSpecFilterManufacturer && !this.qcSpecManufacturerFilterOptions.includes(this.qcSpecFilterManufacturer) ) { this.qcSpecFilterManufacturer = '' } if ( this.qcSpecFilterCustomer && !this.qcSpecCustomerFilterOptions.includes(this.qcSpecFilterCustomer) ) { this.qcSpecFilterCustomer = '' } }, syncQcSpecCurrentRow() { if (!this.qcSpecCurrentRow) return const currentItemNo = this.qcSpecCurrentRow.itemNo const currentInspectionTypeNo = this.qcSpecCurrentRow.inspectionTypeNo const row = this.qcSpecTableList.find( (item) => item.itemNo === currentItemNo && item.inspectionTypeNo === currentInspectionTypeNo ) this.qcSpecCurrentRow = row || null this.$nextTick(() => { if (this.$refs.qcSpecTable) { this.$refs.qcSpecTable.setCurrentRow(this.qcSpecCurrentRow) } }) }, onQcSpecIpqcMethodFilterChange() { this.resetQcSpecTableSelection() }, onQcSpecOperationFilterChange() { this.resetQcSpecTableSelection() }, onQcSpecDimensionFilterChange() { this.resetQcSpecTableSelection() }, resetQcSpecTableSelection() { this.qcSpecCurrentRow = null this.$nextTick(() => { if (this.$refs.qcSpecTable) { this.$refs.qcSpecTable.setCurrentRow() } }) }, assignQcSpecRowKeys(list) { this.qcSpecRowKeyMap = new WeakMap() const baseCount = {} ;(list || []).forEach((row, index) => { const base = [ row.itemNo || '', row.inspectionTypeNo != null ? row.inspectionTypeNo : '', row.rowNo != null && row.rowNo !== '' ? row.rowNo : index, ].join('_') const count = baseCount[base] || 0 baseCount[base] = count + 1 const key = count === 0 ? base : `${base}__${count}` this.qcSpecRowKeyMap.set(row, key) }) }, getQcSpecRowKey(row) { if (!row) return '' if (this.qcSpecRowKeyMap && this.qcSpecRowKeyMap.has(row)) { return this.qcSpecRowKeyMap.get(row) } if (row.rowNo !== null && row.rowNo !== undefined && row.rowNo !== '') { return `${row.itemNo}_${row.inspectionTypeNo}_${row.rowNo}` } return `${row.itemNo}_${row.inspectionTypeNo}` }, qcSpecRowClassName() { return this.editQcSpecBatchVisible ? '' : 'qc-spec-row-draggable' }, getQcSpecSortRowNo(row) { if (!row || row.rowNo === null || row.rowNo === undefined || row.rowNo === '') { return 99 } return Number(row.rowNo) }, sortQcSpecByRowNo(list) { return [...list].sort((a, b) => { const diff = this.getQcSpecSortRowNo(a) - this.getQcSpecSortRowNo(b) if (diff !== 0) return diff return (a.itemNo || '').localeCompare(b.itemNo || '') }) }, getQcSpecSortedSourceList() { if (this.qcSpecSortedCacheSource === this.qcSpecList && this.qcSpecSortedCache) { return this.qcSpecSortedCache } const sorted = this.sortQcSpecByRowNo(this.qcSpecList || []) this.qcSpecSortedCache = sorted this.qcSpecSortedCacheSource = this.qcSpecList return sorted }, clearQcSpecSyncTimers() { if (this.qcSpecSyncTimer) { clearTimeout(this.qcSpecSyncTimer) this.qcSpecSyncTimer = null } }, scheduleQcSpecTableSync() { if (this.qcSpecSyncTimer) { clearTimeout(this.qcSpecSyncTimer) } this.qcSpecSyncTimer = setTimeout(() => { this.qcSpecSyncTimer = null this.applyQcSpecTableFilter() }, 120) }, applyQcSpecTableFilter() { if (this.activeTable === 'qcSpec') { this.destroyQcSpecSortable() } let list = this.getQcSpecSortedSourceList() const filterType = String(this.qcSpecFilterType || '') if (filterType) { list = list.filter( (item) => String(item.inspectionTypeNo || '') === filterType ) } if (filterType === '101' && this.qcSpecFilterIpqcMethod) { list = list.filter( (item) => item.ipqcInspectionMethod === this.qcSpecFilterIpqcMethod ) } if (this.qcSpecFilterShowOperation && this.qcSpecFilterOperation) { list = list.filter( (item) => (item.operation || '') === this.qcSpecFilterOperation ) } if (this.qcSpecFilterShowResource && this.qcSpecFilterResource) { list = list.filter( (item) => this.getQcSpecResourceFilterValue(item) === this.qcSpecFilterResource ) } if (this.qcSpecFilterShowManufacturer && this.qcSpecFilterManufacturer) { list = list.filter( (item) => this.getQcSpecManufacturerFilterValue(item) === this.qcSpecFilterManufacturer ) } if (this.qcSpecFilterShowCustomer && this.qcSpecFilterCustomer) { list = list.filter( (item) => this.getQcSpecCustomerFilterValue(item) === this.qcSpecFilterCustomer ) } this.qcSpecTableList = list.slice() if (this.activeTable === 'qcSpec' && !this.editQcSpecBatchVisible) { this.$nextTick(() => { this.initQcSpecSortable() }) } }, destroyQcSpecSortable() { if (this.qcSpecSortable) { this.qcSpecSortable.destroy() this.qcSpecSortable = null } }, initQcSpecSortable() { if (this.activeTable !== 'qcSpec' || this.editQcSpecBatchVisible) return const table = this.$refs.qcSpecTable if (!table || !table.$el) return const tbody = table.$el.querySelector('.el-table__body-wrapper tbody') if (!tbody || !tbody.children.length) return if (this.qcSpecSortable) { this.qcSpecSortable.option('disabled', this.editQcSpecBatchVisible) return } this.qcSpecSortable = Sortable.create(tbody, { animation: 150, ghostClass: 'qc-spec-sortable-ghost', draggable: 'tr', filter: '.el-button, .el-input, .el-select, input, textarea, button, a, .el-checkbox', preventOnFilter: true, disabled: this.editQcSpecBatchVisible, onEnd: this.handleQcSpecDragEnd, }) }, buildQcSpecGlobalOrderAfterDrag(reorderedDisplayList) { if (!this.qcSpecFilterType) { return [...reorderedDisplayList] } const rowKey = (row) => { if (row.rowNo !== null && row.rowNo !== undefined && row.rowNo !== '') { return `${row.itemNo}__${row.inspectionTypeNo}__${row.rowNo}` } return `${row.itemNo}__${row.inspectionTypeNo}` } const displayKeys = new Set(reorderedDisplayList.map(rowKey)) const globalSorted = this.sortQcSpecByRowNo(this.qcSpecList) const result = [] let displayIdx = 0 globalSorted.forEach((row) => { if (displayKeys.has(rowKey(row))) { result.push(reorderedDisplayList[displayIdx++]) } else { result.push(row) } }) return result }, applyQcSpecRowOrder(orderedList) { const updates = [] orderedList.forEach((row, idx) => { const newRowNo = idx + 1 const oldRowNo = row.rowNo if (oldRowNo !== newRowNo) { updates.push({ site: row.site, buNo: row.buNo, partNo: row.partNo, itemNo: row.itemNo, inspectionTypeNo: row.inspectionTypeNo, rowNo: newRowNo, oldRowNo: oldRowNo, }) } row.rowNo = newRowNo }) this.qcSpecSortedCache = null this.qcSpecListSkipSchedule = true this.qcSpecList = orderedList this.assignQcSpecRowKeys(this.qcSpecList) this.qcSpecListSkipSchedule = false this.applyQcSpecTableFilter() if (updates.length === 0) { return } this.qcSpecDragSaving = true batchUpdateQcSpecRowNo({ itemList: updates }) .then(({ data }) => { if (data && data.code === 0) { this.$message.success(this.$t('qc.common.operationSuccess')) this.syncQcSpecCurrentRow() } else { this.$message.error((data && data.msg) || this.$t('qc.common.saveFailed')) this.refreshQcSpecList(true) } }) .catch(() => { this.$message.error(this.$t('qc.common.saveFailed')) this.refreshQcSpecList(true) }) .finally(() => { this.qcSpecDragSaving = false }) }, handleQcSpecDragEnd(evt) { if (this.editQcSpecBatchVisible) return const { oldIndex, newIndex } = evt if (oldIndex === newIndex) return const reorderedDisplayList = [...this.qcSpecTableList] const movedItem = reorderedDisplayList.splice(oldIndex, 1)[0] reorderedDisplayList.splice(newIndex, 0, movedItem) const newGlobalOrder = this.buildQcSpecGlobalOrderAfterDrag(reorderedDisplayList) this.applyQcSpecRowOrder(newGlobalOrder) }, qcSpecClickRow(row) { this.qcSpecCurrentRow = row this.$refs.qcSpecTable.setCurrentRow(row) }, qcSpecSelectionChange(val) { this.qcSpecSelections = val || [] }, openQcSpecCopyDialog() { this.openQcSpecPartTransferDialog('copy') }, openQcSpecUpdateDialog() { this.openQcSpecPartTransferDialog('update') }, openQcSpecPartTransferDialog(mode) { if (!this.partCurrentRow || !this.partCurrentRow.partNo) { return } if (!this.qcSpecSelections || this.qcSpecSelections.length === 0) { this.$message.warning( mode === 'update' ? this.$t('qc.partAttributePage.selectQcSpecUpdateRow') : this.$t('qc.partAttributePage.selectQcSpecCopyRow') ) return } this.qcSpecPartTransferMode = mode === 'update' ? 'update' : 'copy' this.qcSpecCopySearchData = { site: this.partCurrentRow.site, buNo: this.partCurrentRow.buNo, userName: this.$store.state.user.name, partNo: '', partDesc: '', page: 1, limit: this.qcSpecCopyPageSize, } this.qcSpecCopyPageIndex = 1 this.qcSpecCopyPartList = [] this.qcSpecCopyPartSelections = [] this.qcSpecCopyAddedParts = [] this.qcSpecCopyDialogFlag = true this.$nextTick(() => { if (this.$refs.qcSpecCopyPartTable) { this.$refs.qcSpecCopyPartTable.clearSelection() this.$refs.qcSpecCopyPartTable.doLayout() } if (this.$refs.qcSpecCopyAddedTable) { this.$refs.qcSpecCopyAddedTable.doLayout() } this.getQcSpecCopyPartList() }) }, getQcSpecCopyPartRowKey(row) { return `${row.site}_${row.buNo}_${row.partNo}` }, isQcSpecCopyPartAdded(row) { const rowKey = this.getQcSpecCopyPartRowKey(row) return this.qcSpecCopyAddedParts.some((item) => this.getQcSpecCopyPartRowKey(item) === rowKey) }, isQcSpecCopySourcePart(row) { return !!( this.partCurrentRow && row && row.partNo === this.partCurrentRow.partNo && (!row.site || !this.partCurrentRow.site || row.site === this.partCurrentRow.site) ) }, isQcSpecCopyPartSelectable(row) { return !this.isQcSpecCopyPartAdded(row) }, qcSpecCopyPartClickRow(row) { if (!this.isQcSpecCopyPartSelectable(row)) { return } this.$refs.qcSpecCopyPartTable.toggleRowSelection(row) }, qcSpecCopyPartSelectionChange(val) { const currentPageKeys = new Set( this.qcSpecCopyPartList.map((item) => this.getQcSpecCopyPartRowKey(item)) ) const selectedCurrentPageRows = (val || []).filter((item) => currentPageKeys.has(this.getQcSpecCopyPartRowKey(item)) && this.isQcSpecCopyPartSelectable(item) ) const otherPageRows = this.qcSpecCopyPartSelections.filter((item) => !currentPageKeys.has(this.getQcSpecCopyPartRowKey(item)) && this.isQcSpecCopyPartSelectable(item) )
this.qcSpecCopyPartSelections = otherPageRows.concat(selectedCurrentPageRows) }, restoreQcSpecCopyPartSelection() { if (!this.$refs.qcSpecCopyPartTable) { return } const selectedKeys = new Set( this.qcSpecCopyPartSelections.map((item) => this.getQcSpecCopyPartRowKey(item)) ) this.qcSpecCopyPartList.forEach((item) => { this.$refs.qcSpecCopyPartTable.toggleRowSelection( item, selectedKeys.has(this.getQcSpecCopyPartRowKey(item)) ) }) }, addQcSpecCopySelectedParts() { const addedKeys = new Set( this.qcSpecCopyAddedParts.map((item) => this.getQcSpecCopyPartRowKey(item)) ) const newParts = this.qcSpecCopyPartSelections.filter((item) => { const rowKey = this.getQcSpecCopyPartRowKey(item) if (addedKeys.has(rowKey)) { return false } addedKeys.add(rowKey) return true })
this.qcSpecCopyAddedParts = this.qcSpecCopyAddedParts.concat(newParts) this.qcSpecCopyPartSelections = [] if (this.$refs.qcSpecCopyPartTable) { this.$refs.qcSpecCopyPartTable.clearSelection() } }, removeQcSpecCopyAddedPart(row) { const rowKey = this.getQcSpecCopyPartRowKey(row) this.qcSpecCopyAddedParts = this.qcSpecCopyAddedParts.filter( (item) => this.getQcSpecCopyPartRowKey(item) !== rowKey ) }, clearQcSpecCopyAddedParts() { this.qcSpecCopyAddedParts = [] }, searchQcSpecCopyPartList() { this.qcSpecCopyPageIndex = 1 this.qcSpecCopySearchData.page = 1 this.getQcSpecCopyPartList() }, getQcSpecCopyPartList() { this.qcSpecCopySearchData.page = this.qcSpecCopyPageIndex this.qcSpecCopySearchData.limit = this.qcSpecCopyPageSize this.qcSpecCopyLoading = true qcPartAttributeSearch(this.qcSpecCopySearchData) .then(({ data }) => { if (data && data.code === 0) { this.qcSpecCopyPartList = data.page.list || [] this.qcSpecCopyPageIndex = data.page.currPage this.qcSpecCopyPageSize = data.page.pageSize this.qcSpecCopyTotalPage = data.page.totalCount this.$nextTick(() => { this.restoreQcSpecCopyPartSelection() if (this.$refs.qcSpecCopyPartTable) { this.$refs.qcSpecCopyPartTable.doLayout() } if (this.$refs.qcSpecCopyAddedTable) { this.$refs.qcSpecCopyAddedTable.doLayout() } }) } else { this.$message.error(data.msg) } }) .finally(() => { this.qcSpecCopyLoading = false }) }, qcSpecCopySizeChange(val) { this.qcSpecCopyPageSize = val this.qcSpecCopyPageIndex = 1 this.getQcSpecCopyPartList() }, qcSpecCopyCurrentChange(val) { this.qcSpecCopyPageIndex = val this.getQcSpecCopyPartList() }, confirmQcSpecPartTransfer() { if (!this.qcSpecCopyAddedParts || this.qcSpecCopyAddedParts.length === 0) { this.$message.warning(this.$t('qc.partAttributePage.selectQcSpecCopyAddedTarget')) return } const isUpdate = this.qcSpecPartTransferMode === 'update' const itemCount = this.qcSpecSelections.length const targetCount = this.qcSpecCopyAddedParts.length this.$confirm( isUpdate ? this.$t('qc.partAttributePage.qcSpecUpdateConfirm', { itemCount, targetCount }) : this.$t('qc.partAttributePage.qcSpecCopyConfirm', { itemCount, targetCount }), this.$t('qc.common.tip'), { confirmButtonText: this.$t('qc.common.confirm'), cancelButtonText: this.$t('qc.common.cancel'), type: 'warning', } ).then(() => { this.qcSpecCopyConfirmLoading = true const payload = { site: this.partCurrentRow.site, buNo: this.partCurrentRow.buNo, partNo: this.partCurrentRow.partNo, createBy: this.$store.state.user.name, targetPartList: this.qcSpecCopyAddedParts.map((item) => ({ partNo: item.partNo, })), itemList: this.qcSpecSelections.map((item) => ({ itemNo: item.itemNo, inspectionTypeNo: item.inspectionTypeNo, buNo: item.buNo, defaultValue: item.defaultValue, maxValue: item.maxValue, minValue: item.minValue, ipqcInspectionMethod: item.ipqcInspectionMethod, samplingLevelNo: item.samplingLevelNo, samplingProgrammeNo: item.samplingProgrammeNo, operation: item.operation, resourceID: item.resourceID, manufacturerID: item.manufacturerID, defaultSamplingQuantity: item.defaultSamplingQuantity, defaultSamplingProportion: item.defaultSamplingProportion, customerID: item.customerID, })), } const request = isUpdate ? updateQcSpecToParts(payload) : copyQcSpecToParts(payload) request .then(({ data }) => { if (data && data.code === 0) { this.$message.success( isUpdate ? this.$t('qc.partAttributePage.qcSpecUpdateSuccess') : this.$t('qc.partAttributePage.qcSpecCopySuccess') ) this.qcSpecCopyDialogFlag = false this.qcSpecSelections = [] if (this.$refs.qcSpecTable) { this.$refs.qcSpecTable.clearSelection() } this.refreshQcSpecList() } else { this.$message.error(data.msg) } }) .finally(() => { this.qcSpecCopyConfirmLoading = false }) }).catch(() => {}) }, confirmQcSpecCopy() { this.confirmQcSpecPartTransfer() }, loadDetailListForQcSpec() { if (!this.partCurrentRow || !this.partCurrentRow.partNo) { this.detailList = [] return Promise.resolve() } return searchPartAttributeDetails({ site: this.partCurrentRow.site, buNo: this.partCurrentRow.buNo, attributeNo: this.partCurrentRow.partNo, attributeType: 'A', userName: this.$store.state.user.name, }).then(({ data }) => { if (data && data.code === 0) { this.detailList = data.rows || [] } }) }, fillQcSpecFromTemplate(item) { const templates = this.detailList || [] if (!templates.length) { return this.normalizeQcSpecSamplingExclusive({ ...item }) } let match = templates.find( (t) => t.inspectionTypeNo === item.inspectionTypeNo ) if (!match) { match = templates[0] } const preferItemLevel = this.qcSpecHasValue(item.samplingLevelNo) const preferItemProgramme = this.qcSpecHasValue(item.samplingProgrammeNo) const preferItemQty = this.qcSpecHasValue(item.defaultSamplingQuantity) const preferItemRatio = this.qcSpecHasValue(item.defaultSamplingProportion) const filled = { ...item, ipqcInspectionMethod: match.ipqcInspectionMethod || item.ipqcInspectionMethod, samplingLevelNo: preferItemLevel ? item.samplingLevelNo : match.samplingLevelNo, samplingLevelDesc: preferItemLevel ? item.samplingLevelDesc : match.samplingLevelDesc, samplingProgrammeNo: preferItemProgramme ? item.samplingProgrammeNo : match.samplingProgrammeNo, samplingProgrammeDesc: preferItemProgramme ? item.samplingProgrammeDesc : match.samplingProgrammeDesc, operation: match.operation, resourceID: match.resourceID, manufacturerID: match.manufacturerID, manufacturerName: match.manufacturerName, customerID: match.customerID, customerName: match.customerName, defaultSamplingQuantity: preferItemQty ? item.defaultSamplingQuantity : match.defaultSamplingQuantity, defaultSamplingProportion: preferItemRatio ? item.defaultSamplingProportion : match.defaultSamplingProportion, } return this.normalizeQcSpecSamplingExclusive(filled) }, qcSpecHasValue(val) { return val !== null && val !== undefined && String(val).trim() !== '' }, isQcSpecNumberValueType(row) { return normalizeQcValueTypeDb(row) === 'N' }, qcSpecHasLevelProgramme(row) { if (!row) return false return ( this.qcSpecHasValue(row.samplingLevelNo) || this.qcSpecHasValue(row.samplingLevelDesc) || this.qcSpecHasValue(row.samplingProgrammeNo) || this.qcSpecHasValue(row.samplingProgrammeDesc) ) }, clearQcSpecSamplingQty(row) { row.defaultSamplingQuantity = null }, clearQcSpecSamplingRatio(row) { row.defaultSamplingProportion = null }, clearQcSpecLevelProgramme(row) { row.samplingLevelNo = '' row.samplingLevelDesc = '' row.samplingProgrammeNo = '' row.samplingProgrammeDesc = '' }, /** 默认抽样数量 / 默认抽样比例 / 检验水平+抽样方案 三者互斥 */ normalizeQcSpecSamplingExclusive(row) { if (!row) return row if (this.qcSpecHasLevelProgramme(row)) { this.clearQcSpecSamplingQty(row) this.clearQcSpecSamplingRatio(row) } else if (this.qcSpecHasValue(row.defaultSamplingQuantity)) { this.clearQcSpecSamplingRatio(row) this.clearQcSpecLevelProgramme(row) } else if (this.qcSpecHasValue(row.defaultSamplingProportion)) { this.clearQcSpecSamplingQty(row) this.clearQcSpecLevelProgramme(row) } return row }, isQcSpecSamplingContext(row) { return ( !!row && ((this.editQcSpecBatchVisible && this.activeTable === 'qcSpec') || this.qcSpecAddFlag) ) }, onQcSpecSamplingQtyInput(row) { if (!this.isQcSpecSamplingContext(row)) return if (this.qcSpecHasValue(row.defaultSamplingQuantity)) { this.clearQcSpecSamplingRatio(row) this.clearQcSpecLevelProgramme(row) } }, onQcSpecSamplingRatioInput(row) { if (!this.isQcSpecSamplingContext(row)) return if (this.qcSpecHasValue(row.defaultSamplingProportion)) { this.clearQcSpecSamplingQty(row) this.clearQcSpecLevelProgramme(row) } }, applyQcSpecExclusiveByLevelProgramme(row) { if (!this.isQcSpecSamplingContext(row)) return if (this.qcSpecHasLevelProgramme(row)) { this.clearQcSpecSamplingQty(row) this.clearQcSpecSamplingRatio(row) } }, /** IQC 检验类型编码 */ isQcSpecIqcType(row) { return row && String(row.inspectionTypeNo) === '105' }, qcSpecRowAllowsOperation(row) { return !!row && !this.isQcSpecIqcType(row) }, qcSpecRowAllowsResource(row) { return this.qcSpecRowAllowsOperation(row) }, qcSpecRowAllowsManufacturer(row) { return this.isQcSpecIqcType(row) }, qcSpecRowAllowsCustomer(row) { return this.qcSpecRowAllowsOperation(row) }, /** 批量编辑:非 IQC 可选工序 */ qcSpecCanSelectOperation(row) { return this.editQcSpecBatchVisible && this.qcSpecRowAllowsOperation(row) }, /** 批量编辑:非 IQC 可选机台 */ qcSpecCanSelectResource(row) { return this.editQcSpecBatchVisible && this.qcSpecRowAllowsResource(row) }, /** 批量编辑:IQC 可选供应商 */ qcSpecCanSelectManufacturer(row) { return this.editQcSpecBatchVisible && this.qcSpecRowAllowsManufacturer(row) }, /** 批量编辑:非 IQC 可选客户 */ qcSpecCanSelectCustomer(row) { return this.editQcSpecBatchVisible && this.qcSpecRowAllowsCustomer(row) }, /** 机台查询 site:模板新增用 detailData,质检项目用 partCurrentRow */ resolveResourceSite() { return ( this.detailData.site || (this.partCurrentRow && this.partCurrentRow.site) || this.resourceData.site || '' ) }, openQcSpecManufacturerPicker(row) { if (!this.qcSpecCanSelectManufacturer(row)) return this.openQcSpecLinkedManufacturerPicker(row) }, openQcSpecCustomerPicker(row) { if (!this.qcSpecCanSelectCustomer(row)) return this.openQcSpecLinkedCustomerPicker(row) }, openQcSpecOperationPicker(row) { if (!this.qcSpecCanSelectOperation(row)) return this.openQcSpecLinkedOperationPicker(row) }, openQcSpecResourcePicker(row) { if (!this.qcSpecCanSelectResource(row)) return this.openQcSpecLinkedResourcePicker(row) }, addQcSpecModal() { const partSite = this.partCurrentRow.site || '' const partBuNo = this.partCurrentRow.buNo || '' const siteBuList = this.qcSpecAddBuList const preferredKey = partBuNo.indexOf('_') >= 0 ? partBuNo : partBuNo ? `${partSite}_${partBuNo}` : '' const matchedBu = siteBuList.find((i) => i.buNo === preferredKey) || siteBuList.find((i) => this.parseBuNo(i.buNo) === partBuNo) || siteBuList[0] || null this.qcSpecSearchData.site = partSite this.qcSpecSearchData.buNo = matchedBu ? matchedBu.buNo : '' this.qcSpecSearchData.partNo = this.partCurrentRow.partNo this.qcSpecSearchData.inspectionTypeNo = '' this.qcSpecSearchData.itemNo = '' this.qcSpecSearchData.itemDesc = '' this.qcSpecItemList1 = [] this.qcSpecItemList2 = [] this.qcSpecItemSelections1 = [] this.qcSpecItemSelections2 = [] this.qcSpecPendingList = [] this.qcSpecAddFillDialogFlag = false this.resetQcSpecAddApplyData() this.loadDetailListForQcSpec().then(() => { this.getQcSpecItemList() this.qcSpecAddFlag = true this.$nextTick(() => { if (this.$refs.qcSpecItemTable1) { this.$refs.qcSpecItemTable1.doLayout() } if (this.$refs.qcSpecPendingTable) { this.$refs.qcSpecPendingTable.doLayout() } }) }) }, getQcSpecAddItemKey(row) { if (!row) return '' return `${row.site || ''}_${row.buNo || ''}_${row.itemNo || ''}_${row.inspectionTypeNo || ''}` }, getQcSpecPendingRowKey(row) { if (!row) return '' return row._pendingKey || this.getQcSpecAddItemKey(row) }, createQcSpecPendingKey(row) { return `${this.getQcSpecAddItemKey(row)}_${Date.now()}_${Math.random().toString(36).slice(2, 8)}` }, isQcSpecAddItemPending(row) { const rowKey = this.getQcSpecAddItemKey(row) return this.qcSpecPendingList.some((item) => this.getQcSpecAddItemKey(item) === rowKey) }, getQcSpecAddLockedInspectionType() { if (this.qcSpecItemSelections1 && this.qcSpecItemSelections1.length) { return this.qcSpecItemSelections1[0].inspectionTypeNo } return '' }, isSameQcSpecAddInspectionType(row, inspectionTypeNo) { return String(row && row.inspectionTypeNo) === String(inspectionTypeNo) }, isQcSpecAddItemSelectable(row) { const lockedType = this.getQcSpecAddLockedInspectionType() if (!lockedType) return true return this.isSameQcSpecAddInspectionType(row, lockedType) }, normalizeQcSpecAddSelection(val) { const rows = val || [] if (rows.length === 0) return [] const lockedType = rows[0].inspectionTypeNo return rows.filter((row) => this.isSameQcSpecAddInspectionType(row, lockedType)) }, restoreQcSpecAddSelection(rows) { this.qcSpecAddSelecting = true this.$nextTick(() => { const table = this.$refs.qcSpecItemTable1 if (table) { table.clearSelection() rows.forEach((row) => table.toggleRowSelection(row, true)) } this.qcSpecItemSelections1 = rows this.$nextTick(() => { this.qcSpecAddSelecting = false }) }) }, getQcSpecItemList() { // 查询始终锁定当前物料 site,防止跨工厂 BU 覆盖条件
this.qcSpecSearchData.site = (this.partCurrentRow && this.partCurrentRow.site) || '' getQcSpecItemList(this.qcSpecSearchData).then(({ data }) => { if (data && data.code === 0) { this.qcSpecItemList1 = data.rows || [] } }) }, qcSpecItemClickRow1(row) { if (!this.isQcSpecAddItemSelectable(row)) { this.$message.warning( this.$t('qc.partAttributePage.qcSpecAddSameInspectionTypeOnly') ) return } this.$refs.qcSpecItemTable1.toggleRowSelection(row) }, qcSpecItemClickRow2(row) { this.$refs.qcSpecItemTable2.toggleRowSelection(row) }, qcSpecSelectionItem1(val) { if (this.qcSpecAddSelecting) return const normalized = this.normalizeQcSpecAddSelection(val) if (normalized.length !== (val || []).length) { this.$message.warning( this.$t('qc.partAttributePage.qcSpecAddSameInspectionTypeOnly') ) this.restoreQcSpecAddSelection(normalized) return } this.qcSpecItemSelections1 = normalized }, qcSpecSelectionItem2(val) { this.qcSpecItemSelections2 = val }, createEmptyQcSpecAddApplyData() { return { inspectionTypeNo: '', ipqcInspectionMethod: '', operation: '', resourceID: '', resourceDesc: '', manufacturerID: '', manufacturerName: '', customerID: '', customerName: '', } }, resetQcSpecAddApplyData() { this.qcSpecAddApplyData = this.createEmptyQcSpecAddApplyData() }, onQcSpecAddApplyTypeChange() { if (!this.qcSpecAddApplyData.inspectionTypeNo) { this.qcSpecAddApplyData.ipqcInspectionMethod = '' this.qcSpecAddApplyData.operation = '' this.qcSpecAddApplyData.resourceID = '' this.qcSpecAddApplyData.resourceDesc = '' this.qcSpecAddApplyData.manufacturerID = '' this.qcSpecAddApplyData.manufacturerName = '' this.qcSpecAddApplyData.customerID = '' this.qcSpecAddApplyData.customerName = '' return } if (!this.qcSpecAddApplyIsIpqc) { this.qcSpecAddApplyData.ipqcInspectionMethod = '' } if (this.qcSpecAddApplyIsIqc) { this.qcSpecAddApplyData.operation = '' this.qcSpecAddApplyData.resourceID = '' this.qcSpecAddApplyData.resourceDesc = '' this.qcSpecAddApplyData.customerID = '' this.qcSpecAddApplyData.customerName = '' } else { this.qcSpecAddApplyData.manufacturerID = '' this.qcSpecAddApplyData.manufacturerName = '' } }, clearQcSpecAddApplyOperation() { this.qcSpecAddApplyData.operation = '' this.clearQcSpecAddApplyResource() }, clearQcSpecAddApplyResource() { this.qcSpecAddApplyData.resourceID = '' this.qcSpecAddApplyData.resourceDesc = '' }, clearQcSpecAddApplyManufacturer() { this.qcSpecAddApplyData.manufacturerID = '' this.qcSpecAddApplyData.manufacturerName = '' }, clearQcSpecAddApplyCustomer() { this.qcSpecAddApplyData.customerID = '' this.qcSpecAddApplyData.customerName = '' }, clearQcSpecPendingLinkedField(row, field) { if (!row) return if (field === 'operation') { this.$set(row, 'operation', '') this.$set(row, 'resourceID', '') this.$set(row, 'resourceDesc', '') return } if (field === 'resource') { this.$set(row, 'resourceID', '') this.$set(row, 'resourceDesc', '') return } if (field === 'manufacturer') { this.$set(row, 'manufacturerID', '') this.$set(row, 'manufacturerName', '') return } if (field === 'customer') { this.$set(row, 'customerID', '') this.$set(row, 'customerName', '') } }, openQcSpecAddApplyOperationPicker() { if (!this.qcSpecAddApplyCanOperation) return this.openQcSpecLinkedOperationPicker(this.qcSpecAddApplyData) }, openQcSpecAddApplyResourcePicker() { if (!this.qcSpecAddApplyCanResource) return this.openQcSpecLinkedResourcePicker(this.qcSpecAddApplyData) }, openQcSpecAddApplyManufacturerPicker() { if (!this.qcSpecAddApplyCanManufacturer) return this.openQcSpecLinkedManufacturerPicker(this.qcSpecAddApplyData) }, openQcSpecAddApplyCustomerPicker() { if (!this.qcSpecAddApplyCanCustomer) return this.openQcSpecLinkedCustomerPicker(this.qcSpecAddApplyData) }, fillQcSpecUnmaintainedFields(row, source) { if (!row || !source) return 0 if ( source.inspectionTypeNo && String(row.inspectionTypeNo) !== String(source.inspectionTypeNo) ) { return 0 } let applied = 0 if ( String(row.inspectionTypeNo) === '101' && this.qcSpecHasValue(source.ipqcInspectionMethod) && !this.qcSpecHasValue(row.ipqcInspectionMethod) ) { this.$set(row, 'ipqcInspectionMethod', source.ipqcInspectionMethod) applied++ } if (this.qcSpecRowAllowsOperation(row) && this.qcSpecHasValue(source.operation) && !this.qcSpecHasValue(row.operation)) { this.$set(row, 'operation', source.operation) applied++ } if ( this.qcSpecRowAllowsResource(row) && this.qcSpecHasValue(source.resourceID) && !this.qcSpecHasValue(row.resourceID) ) { this.$set(row, 'resourceID', source.resourceID) this.$set(row, 'resourceDesc', source.resourceDesc || '') applied++ } if ( this.qcSpecRowAllowsManufacturer(row) && this.qcSpecHasValue(source.manufacturerID) && !this.qcSpecHasValue(row.manufacturerID) ) { this.$set(row, 'manufacturerID', source.manufacturerID) this.$set(row, 'manufacturerName', source.manufacturerName || '') applied++ } if ( this.qcSpecRowAllowsCustomer(row) && this.qcSpecHasValue(source.customerID) && !this.qcSpecHasValue(row.customerID) ) { this.$set(row, 'customerID', source.customerID) this.$set(row, 'customerName', source.customerName || '') applied++ } return applied }, applyQcSpecAddFillFields(row, source) { if (!row || !source) return if ( source.inspectionTypeNo && String(row.inspectionTypeNo) !== String(source.inspectionTypeNo) ) { return } if ( String(row.inspectionTypeNo) === '101' && this.qcSpecHasValue(source.ipqcInspectionMethod) ) { this.$set(row, 'ipqcInspectionMethod', source.ipqcInspectionMethod) } if (this.qcSpecRowAllowsOperation(row) && this.qcSpecHasValue(source.operation)) { this.$set(row, 'operation', source.operation) } if (this.qcSpecRowAllowsResource(row) && this.qcSpecHasValue(source.resourceID)) { this.$set(row, 'resourceID', source.resourceID) this.$set(row, 'resourceDesc', source.resourceDesc || '') } if ( this.qcSpecRowAllowsManufacturer(row) && this.qcSpecHasValue(source.manufacturerID) ) { this.$set(row, 'manufacturerID', source.manufacturerID) this.$set(row, 'manufacturerName', source.manufacturerName || '') } if (this.qcSpecRowAllowsCustomer(row) && this.qcSpecHasValue(source.customerID)) { this.$set(row, 'customerID', source.customerID) this.$set(row, 'customerName', source.customerName || '') } }, resolveQcSpecAddFillInspectionType() { if (this.qcSpecSearchData.inspectionTypeNo) { return this.qcSpecSearchData.inspectionTypeNo } const types = [ ...new Set( (this.qcSpecItemSelections1 || []) .map((item) => item.inspectionTypeNo) .filter((type) => type !== null && type !== undefined && type !== '') ), ] return types.length === 1 ? types[0] : '' }, openQcSpecAddFillDialog() { if (this.qcSpecItemSelections1.length === 0) { this.$message.warning( this.$t('qc.partAttributePage.selectAvailableItems') ) return } const normalized = this.normalizeQcSpecAddSelection(this.qcSpecItemSelections1) if (normalized.length !== this.qcSpecItemSelections1.length) { this.$message.warning( this.$t('qc.partAttributePage.qcSpecAddSameInspectionTypeOnly') ) this.restoreQcSpecAddSelection(normalized) return } this.resetQcSpecAddApplyData() this.qcSpecAddApplyData.inspectionTypeNo = this.resolveQcSpecAddFillInspectionType() this.onQcSpecAddApplyTypeChange() this.qcSpecAddFillDialogFlag = true }, confirmQcSpecAddFill() { this.addQcSpecItem() this.qcSpecAddFillDialogFlag = false this.resetQcSpecAddApplyData() }, addQcSpecItem() { if (this.qcSpecItemSelections1.length === 0) { this.$message.warning( this.$t('qc.partAttributePage.selectAvailableItems') ) return } this.qcSpecItemSelections1.forEach((item) => { const filled = this.fillQcSpecFromTemplate({ ...item }) this.applyQcSpecAddFillFields(filled, this.qcSpecAddApplyData) this.$set(filled, '_pendingKey', this.createQcSpecPendingKey(filled)) this.qcSpecPendingList.push(filled) }) this.qcSpecItemSelections1 = [] this.$nextTick(() => { if (this.$refs.qcSpecItemTable1) { this.$refs.qcSpecItemTable1.clearSelection() } }) }, removeQcSpecPendingItem(row) { const rowKey = this.getQcSpecPendingRowKey(row) this.qcSpecPendingList = this.qcSpecPendingList.filter( (item) => this.getQcSpecPendingRowKey(item) !== rowKey ) }, clearQcSpecPendingList() { if (this.qcSpecPendingList.length === 0) return this.qcSpecPendingList = [] }, confirmQcSpecAdd() { if (this.qcSpecPendingList.length === 0) { this.$message.warning(this.$t('qc.partAttributePage.qcSpecAddEmptyPending')) return } for (let i = 0; i < this.qcSpecPendingList.length; i++) { const item = this.qcSpecPendingList[i] this.normalizeQcSpecSamplingExclusive(item) if (this.isQcSpecNumberValueType(item)) { if ( !this.qcSpecHasValue(item.maxValue) && !this.qcSpecHasValue(item.minValue) ) { this.$message.warning( this.$t('qc.partAttributePage.qcSpecAddNumberLimitRequired', { name: item.itemDesc || item.itemNo, }) ) return } if ( this.qcSpecHasValue(item.maxValue) && this.qcSpecHasValue(item.minValue) && Number(item.maxValue) < Number(item.minValue) ) { this.$message.warning( this.$t('qc.partAttributePage.maxLessThanMin', { name: item.itemDesc || item.itemNo, }) ) return } } const groupCount = [ this.qcSpecHasLevelProgramme(item), this.qcSpecHasValue(item.defaultSamplingQuantity), this.qcSpecHasValue(item.defaultSamplingProportion), ].filter(Boolean).length if (groupCount > 1) { this.$message.warning( this.$t('qc.partAttributePage.qcSpecSamplingExclusive') ) return } } const payload = { site: this.partCurrentRow.site, partNo: this.partCurrentRow.partNo, createBy: this.$store.state.user.name, itemList: this.qcSpecPendingList, } this.qcSpecAddSaveLoading = true // 先按类型维度校验重复(IQC/IPQC/FQC/OQC/SQC),通过后再保存
qcSpecCheckDuplicate(payload) .then(({ data }) => { if (!data || data.code !== 0) { this.qcSpecAddSaveLoading = false if (data && data.msg) { this.$message.error(data.msg) } return Promise.reject(new Error('qcSpecCheckDuplicate failed')) } return qcSpecSave(payload) }) .then((res) => { if (!res) return this.qcSpecAddSaveLoading = false const { data } = res if (data && data.code === 0) { this.qcSpecPendingList = [] this.qcSpecAddFlag = false this.$message.success(this.$t('qc.partAttributePage.qcSpecAddSaveSuccess')) this.refreshQcSpecList() } else if (data && data.msg) { this.$message.error(data.msg) } }) .catch(() => { this.qcSpecAddSaveLoading = false }) }, beforeCloseQcSpecAddDialog(done) { if (!this.qcSpecPendingList.length) { done() return } this.$confirm( this.$t('qc.partAttributePage.qcSpecAddDiscardPending'), this.$t('qc.common.tip'), { confirmButtonText: this.$t('qc.common.confirm'), cancelButtonText: this.$t('qc.common.cancel'), type: 'warning', } ) .then(() => done()) .catch(() => {}) }, onQcSpecAddDialogClose() { this.qcSpecPendingList = [] this.qcSpecAddFillDialogFlag = false this.resetQcSpecAddApplyData() this.refreshQcSpecList() }, resetQcSpecBatchFillData() { this.qcSpecBatchFillData = { buNo: '', inspectionTypeNo: '', ipqcInspectionMethod: '', samplingProgrammeNo: '', samplingProgrammeDesc: '', samplingLevelNo: '', samplingLevelDesc: '', defaultSamplingQuantity: null, defaultSamplingProportion: null, operation: '', resourceID: '', resourceDesc: '', manufacturerID: '', manufacturerName: '', customerID: '', customerName: '', } }, openQcSpecBatchFillDialog() { if (!this.partCurrentRow || !this.partCurrentRow.partNo) { this.$message.warning(this.$t('qc.partAttributePage.selectPartForTemplate')) return } this.resetQcSpecBatchFillData() if (this.buList.length > 0) { this.qcSpecBatchFillData.buNo = this.buList[0].buNo } if (this.qcSpecFilterType) { this.qcSpecBatchFillData.inspectionTypeNo = this.qcSpecFilterType } if ( this.qcSpecBatchFillData.inspectionTypeNo === '101' && this.qcSpecFilterIpqcMethod ) { this.qcSpecBatchFillData.ipqcInspectionMethod = this.qcSpecFilterIpqcMethod } this.qcSpecBatchFillDialogFlag = true }, onQcSpecBatchFillInspectionTypeChange() { if (!this.qcSpecBatchFillTypeIsIpqc) { this.qcSpecBatchFillData.ipqcInspectionMethod = '' } }, chooseQcSpecBatchFillProgramme() { this.openSamplingProgrammePicker(this.qcSpecBatchFillData) }, chooseQcSpecBatchFillLevel() { this.openSamplingLevelPicker(this.qcSpecBatchFillData) }, buildSamplingPickerRow(row) { if (!row) { return null } return { ...row, site: row.site || (this.partCurrentRow && this.partCurrentRow.site) || '' } }, openSamplingProgrammePicker(row) { this.tempProgrammeRow = row this.$refs.samplingProgrammePicker.open({ row: this.buildSamplingPickerRow(row), fallbackBuNo: (this.partCurrentRow && this.partCurrentRow.buNo) || '', defaultNo: (row && row.samplingProgrammeNo) || '' }) }, openSamplingLevelPicker(row) { this.tempLevelRow = row this.$refs.samplingLevelPicker.open({ row: this.buildSamplingPickerRow(row), fallbackBuNo: (this.partCurrentRow && this.partCurrentRow.buNo) || '', defaultNo: (row && row.samplingLevelNo) || '' }) }, onSamplingProgrammeSelect(val) { if (!this.tempProgrammeRow) { return } this.tempProgrammeRow.samplingProgrammeNo = val.samplingProgrammeNo this.tempProgrammeRow.samplingProgrammeDesc = val.samplingProgrammeDesc if ( this.qcSpecBatchFillDialogFlag && this.tempProgrammeRow === this.qcSpecBatchFillData ) { this.onQcSpecBatchFillLevelProgrammeChange() } else { this.applyQcSpecExclusiveByLevelProgramme(this.tempProgrammeRow) } }, onSamplingLevelSelect(val) { if (!this.tempLevelRow) { return } this.tempLevelRow.samplingLevelNo = val.samplingLevelNo this.tempLevelRow.samplingLevelDesc = val.samplingLevelDesc if ( this.qcSpecBatchFillDialogFlag && this.tempLevelRow === this.qcSpecBatchFillData ) { this.onQcSpecBatchFillLevelProgrammeChange() } else { this.applyQcSpecExclusiveByLevelProgramme(this.tempLevelRow) } }, onQcSpecBatchFillLevelProgrammeChange() { if (this.qcSpecHasLevelProgramme(this.qcSpecBatchFillData)) { this.clearQcSpecSamplingQty(this.qcSpecBatchFillData) this.clearQcSpecSamplingRatio(this.qcSpecBatchFillData) } }, onQcSpecBatchFillQtyInput() { if (this.qcSpecHasValue(this.qcSpecBatchFillData.defaultSamplingQuantity)) { this.clearQcSpecSamplingRatio(this.qcSpecBatchFillData) this.clearQcSpecLevelProgramme(this.qcSpecBatchFillData) } }, onQcSpecBatchFillRatioInput() { if (this.qcSpecHasValue(this.qcSpecBatchFillData.defaultSamplingProportion)) { this.clearQcSpecSamplingQty(this.qcSpecBatchFillData) this.clearQcSpecLevelProgramme(this.qcSpecBatchFillData) } }, openQcSpecLinkedOperationPicker(target) { if (!target) return this.qcSpecPickerRow = target this.operationSelections = [] this.operationData.site = this.partCurrentRow.site this.operationData.operationDesc = target.operation || '' this.operationPageIndex = 1 this.fetchOperationList(true, true) }, openQcSpecLinkedResourcePicker(target) { if (!target) return this.qcSpecPickerRow = target this.resourceSelections = [] this.resourceData.site = this.resolveResourceSite() this.resourceData.resourceId = '' this.resourceData.resourceDesc = '' getAllResourceList(this.resourceData).then(({ data }) => { if (data && data.code === 0) { this.resourceList = data.rows || [] this.resourceModelFlag = true this.$nextTick(() => { if (!this.$refs.resourceTable) return if (target.resourceID) { const match = this.resourceList.find( (r) => r.resourceId === target.resourceID ) if (match) { this.$refs.resourceTable.setCurrentRow(match) this.resourceSelections = [match] } } }) } else { this.$message.error(data.msg) } }) }, openQcSpecLinkedManufacturerPicker(target) { if (!target) return this.qcSpecPickerRow = target this.dataListManufacturerSelections = [] this.manufacturerData.site = this.partCurrentRow.site this.manufacturerData.manufacturerID = '' this.manufacturerData.manufacturerName = '' this.manufacturerPageIndex = 1 this.fetchManufacturerList(true, false) }, openQcSpecLinkedCustomerPicker(target) { if (!target) return this.qcSpecPickerRow = target this.dataListCustomerSelections = [] this.customerData.site = this.partCurrentRow.site this.customerData.customerID = '' this.customerData.customerName = '' this.customerPageIndex = 1 this.fetchCustomerList(true, false) }, openQcSpecBatchFillOperationPicker() { this.openQcSpecLinkedOperationPicker(this.qcSpecBatchFillData) }, openQcSpecBatchFillResourcePicker() { this.openQcSpecLinkedResourcePicker(this.qcSpecBatchFillData) }, openQcSpecBatchFillManufacturerPicker() { this.openQcSpecLinkedManufacturerPicker(this.qcSpecBatchFillData) }, openQcSpecBatchFillCustomerPicker() { this.openQcSpecLinkedCustomerPicker(this.qcSpecBatchFillData) }, buildQcSpecBatchFillPayload(overwrite) { const d = this.qcSpecBatchFillData const payload = { site: this.partCurrentRow.site, partNo: this.partCurrentRow.partNo, buNo: d.buNo, inspectionTypeNo: d.inspectionTypeNo, overwriteAll: overwrite, } if (this.qcSpecHasValue(d.samplingProgrammeNo)) { payload.samplingProgrammeNo = d.samplingProgrammeNo } if (this.qcSpecHasValue(d.samplingLevelNo)) { payload.samplingLevelNo = d.samplingLevelNo } if (this.qcSpecHasValue(d.defaultSamplingQuantity)) { payload.defaultSamplingQuantity = d.defaultSamplingQuantity } if (this.qcSpecHasValue(d.defaultSamplingProportion)) { payload.defaultSamplingProportion = d.defaultSamplingProportion } if (this.qcSpecHasValue(d.operation)) { payload.operation = d.operation } if (this.qcSpecHasValue(d.resourceID)) { payload.resourceID = d.resourceID } if (this.qcSpecHasValue(d.manufacturerID)) { payload.manufacturerID = d.manufacturerID } if (this.qcSpecHasValue(d.customerID)) { payload.customerID = d.customerID } if (d.inspectionTypeNo === '101' && this.qcSpecHasValue(d.ipqcInspectionMethod)) { payload.ipqcInspectionMethod = d.ipqcInspectionMethod } return payload }, validateQcSpecBatchFillForm() { const d = this.qcSpecBatchFillData if (!d.buNo) { this.$message.warning(this.$t('qc.common.pleaseSelectBu')) return false } if (!d.inspectionTypeNo) { this.$message.warning(this.$t('qc.method.selectInspectionType')) return false } const groupCount = [ this.qcSpecHasLevelProgramme(d), this.qcSpecHasValue(d.defaultSamplingQuantity), this.qcSpecHasValue(d.defaultSamplingProportion), ].filter(Boolean).length if (groupCount > 1) { this.$message.warning( this.$t('qc.partAttributePage.qcSpecSamplingExclusive') ) return false } const hasFillField = groupCount > 0 || this.qcSpecHasValue(d.operation) || this.qcSpecHasValue(d.resourceID) || this.qcSpecHasValue(d.manufacturerID) || this.qcSpecHasValue(d.customerID) || (d.inspectionTypeNo === '101' && this.qcSpecHasValue(d.ipqcInspectionMethod)) if (!hasFillField) { this.$message.warning(this.$t('qc.partAttributePage.qcSpecBatchFillNoField')) return false } return true }, confirmQcSpecBatchFill(overwrite) { if (!this.validateQcSpecBatchFillForm()) return this.qcSpecBatchFillLoading = true qcSpecBatchFill(this.buildQcSpecBatchFillPayload(overwrite)) .then(({ data }) => { this.qcSpecBatchFillLoading = false if (data && data.code === 0) { this.qcSpecBatchFillDialogFlag = false this.refreshQcSpecList() this.$message.success( this.$t('qc.partAttributePage.batchSaveSuccess') ) } else { this.$message.error(data.msg) } }) .catch(() => { this.qcSpecBatchFillLoading = false }) }, openQcSpecSyncDialog() { if (!this.partCurrentRow || !this.partCurrentRow.partNo) { this.$message.warning(this.$t('qc.partAttributePage.selectPartForTemplate')) return } this.resetQcSpecSyncData() if (this.partCurrentRow.buNo) { this.qcSpecSyncData.buNo = this.partCurrentRow.buNo } if (this.qcSpecFilterType) { this.qcSpecSyncData.inspectionTypeNo = this.qcSpecFilterType } if ( this.qcSpecSyncData.inspectionTypeNo === '101' && this.qcSpecFilterIpqcMethod ) { this.qcSpecSyncData.ipqcInspectionMethod = this.qcSpecFilterIpqcMethod } this.qcSpecSyncDialogFlag = true }, resetQcSpecSyncData() { this.qcSpecSyncData = { buNo: '', inspectionTypeNo: '', ipqcInspectionMethod: '', syncValueType: true, syncDefaultValue: true, syncMaxValue: true, syncMinValue: true, syncSamplingPlanLevel: true, } }, onQcSpecSyncInspectionTypeChange() { if (!this.qcSpecSyncTypeIsIpqc) { this.qcSpecSyncData.ipqcInspectionMethod = '' } }, hasQcSpecSyncEffectiveField() { const d = this.qcSpecSyncData return ( d.syncDefaultValue || d.syncMaxValue || d.syncMinValue || d.syncSamplingPlanLevel ) }, validateQcSpecSyncForm() { const d = this.qcSpecSyncData if (!d.buNo) { this.$message.warning(this.$t('qc.common.pleaseSelectBu')) return false } if (!d.inspectionTypeNo) { this.$message.warning(this.$t('qc.method.selectInspectionType')) return false } if (!this.hasQcSpecSyncEffectiveField()) { this.$message.warning(this.$t('qc.partAttributePage.qcSpecSyncNoField')) return false } return true }, buildQcSpecSyncPayload(overwrite) { const d = this.qcSpecSyncData return { site: this.partCurrentRow.site, partNo: this.partCurrentRow.partNo, buNo: d.buNo, inspectionTypeNo: d.inspectionTypeNo, ipqcInspectionMethod: d.ipqcInspectionMethod, overwriteAll: overwrite, syncValueType: d.syncValueType, syncDefaultValue: d.syncDefaultValue, syncMaxValue: d.syncMaxValue, syncMinValue: d.syncMinValue, syncSamplingPlanLevel: d.syncSamplingPlanLevel, } }, confirmQcSpecSync(overwrite) { if (!this.validateQcSpecSyncForm()) return this.qcSpecSyncLoading = true qcSpecSyncFromItem(this.buildQcSpecSyncPayload(overwrite)) .then(({ data }) => { this.qcSpecSyncLoading = false if (data && data.code === 0) { this.qcSpecSyncDialogFlag = false this.refreshQcSpecList() this.$message.success( this.$t('qc.partAttributePage.qcSpecDataSyncSuccess', { count: data.count != null ? data.count : 0, }) ) } else { this.$message.error( (data && data.msg) || this.$t('qc.partAttributePage.qcSpecDataSyncFail') ) } }) .catch(() => { this.qcSpecSyncLoading = false }) }, editQcSpecBatchModel() { this.editQcSpecBatchVisible = true this.destroyQcSpecSortable() }, cancelQcSpecBatchModel() { this.editQcSpecBatchVisible = false this.refreshQcSpecList() }, batchQcSpecModel() { for (let i = 0; i < this.qcSpecList.length; i++) { let item = this.qcSpecList[i] this.normalizeQcSpecSamplingExclusive(item) const groupCount = [ this.qcSpecHasLevelProgramme(item), this.qcSpecHasValue(item.defaultSamplingQuantity), this.qcSpecHasValue(item.defaultSamplingProportion), ].filter(Boolean).length if (groupCount > 1) { this.$message.warning( this.$t('qc.partAttributePage.qcSpecSamplingExclusive') ) return } if ( item.maxValue !== '' && item.maxValue !== null && item.minValue !== '' && item.minValue !== null ) { if (Number(item.maxValue) < Number(item.minValue)) { this.$message.warning( this.$t('qc.partAttributePage.maxLessThanMin', { name: item.itemDesc, }) ) return } } }
this.batchQcSpecLoading = true let inData = { site: this.partCurrentRow.site, buNo: this.partCurrentRow.buNo, partNo: this.partCurrentRow.partNo, itemList: this.qcSpecList, } qcSpecUpdate(inData) .then(({ data }) => { this.batchQcSpecLoading = false if (data && data.code === 0) { this.editQcSpecBatchVisible = false this.refreshQcSpecList() this.$message.success( this.$t('qc.partAttributePage.batchSaveSuccess') ) } else { this.$message.error(data.msg) } }) .catch(() => { this.batchQcSpecLoading = false }) }, getQcSpecWarningBuNo() { const specRow = this.qcSpecWarningCurrentRow if (specRow && specRow.buNo) { return specRow.buNo } return this.partCurrentRow ? this.partCurrentRow.buNo : '' }, openQcSpecWarningDialog(row) { this.qcSpecWarningCurrentRow = row
this.qcSpecWarningList = [] this.qcSpecWarningDialogFlag = true this.loadQcSpecWarningDictOptions().then(() => { this.loadQcSpecWarningList() }) }, loadQcSpecWarningDictOptions() { const site = this.partCurrentRow ? this.partCurrentRow.site : this.modalData ? this.modalData.site : '' return getDictDataByTypes({ site: site || '', dictTypes: [ 'qc_spec_warning_level', 'qc_spec_trigger_mode', 'qc_spec_compare_logic', ], }) .then(({ data }) => { if (data && data.code === 0) { const dictMap = data.dictMap || {} this.qcSpecWarningDictOptions.warningLevel = dictMap.qc_spec_warning_level || [] this.qcSpecWarningDictOptions.triggerMode = dictMap.qc_spec_trigger_mode || [] this.qcSpecWarningDictOptions.compareLogic = dictMap.qc_spec_compare_logic || [] } }) .catch(() => {}) }, normalizeQcSpecWarningRow(row) { row.warningLevel = this.mapDictValue( row.warningLevel, this.qcSpecWarningDictOptions.warningLevel ) row.triggerMode = this.mapDictValue( row.triggerMode, this.qcSpecWarningDictOptions.triggerMode ) row.compareLogic = this.mapDictValue( row.compareLogic, this.qcSpecWarningDictOptions.compareLogic ) }, mapDictValue(val, options) { if (!val || !options || !options.length) return val if (options.some((item) => item.dictValue === val)) return val const found = options.find((item) => item.dictLabel === val) return found ? found.dictValue : val }, loadQcSpecWarningList() { if (!this.qcSpecWarningCurrentRow || !this.partCurrentRow) return this.qcSpecWarningLoading = true getQcSpecWarningList({ site: this.partCurrentRow.site, buNo: this.getQcSpecWarningBuNo(), partNo: this.partCurrentRow.partNo, itemNo: this.qcSpecWarningCurrentRow.itemNo, inspectionTypeNo: this.qcSpecWarningCurrentRow.inspectionTypeNo, }) .then(({ data }) => { if (data && data.code === 0) { this.qcSpecWarningList = (data.rows || []).map((item) => { this.normalizeQcSpecWarningRow(item) this.updateQcSpecWarningDesc(item) return item }) } else { this.$message.error(data.msg || this.$t('qc.common.queryFailed')) } this.qcSpecWarningLoading = false }) .catch(() => { this.qcSpecWarningLoading = false }) }, addQcSpecWarningRow() { const row = { warningLevel: '', colorCode: '', triggerMode: '', compareLogic: '', thresholdValue: undefined, warningDesc: '', } this.qcSpecWarningList.push(row) }, removeQcSpecWarningRow(index) { this.qcSpecWarningList.splice(index, 1) }, updateQcSpecWarningDesc(row) { row.warningDesc = this.buildQcSpecWarningDesc(row) }, buildQcSpecWarningDesc(row) { if (!row || !row.compareLogic) return '' const threshold = row.thresholdValue if (threshold === '' || threshold === null || threshold === undefined) return '' const logic = row.compareLogic let op = '' let limitType = '' let sign = '' if (logic === 'upper_gt') { op = '>' limitType = '上限' sign = '+' } else if (logic === 'lower_lt') { op = '<' limitType = '下限' sign = '-' } else { op = logic.indexOf('大于') >= 0 ? '>' : logic.indexOf('小于') >= 0 ? '<' : '' limitType = logic.indexOf('上限') >= 0 ? '上限' : logic.indexOf('下限') >= 0 ? '下限' : '' sign = logic.indexOf('上限') >= 0 ? '+' : logic.indexOf('下限') >= 0 ? '-' : '' } const unit = row.triggerMode === 'ratio' || (row.triggerMode && row.triggerMode.indexOf('比例') >= 0) ? '%' : '' if (!op || !limitType) return '' return `当实测值 ${op} (公差${limitType} ${sign} ${threshold}${unit}) 时预警` }, saveQcSpecWarningList() { if (!this.qcSpecWarningCurrentRow || !this.partCurrentRow) return for (let i = 0; i < this.qcSpecWarningList.length; i++) { const item = this.qcSpecWarningList[i] this.updateQcSpecWarningDesc(item) if ( !item.warningLevel || !item.colorCode || !item.triggerMode || !item.compareLogic || item.thresholdValue === '' || item.thresholdValue === null || item.thresholdValue === undefined ) { this.$message.warning( this.$t('qc.partAttributePage.qcSpecWarningRowRequired', { row: i + 1, }) ) return } } this.qcSpecWarningSaveLoading = true saveQcSpecWarningList({ site: this.partCurrentRow.site, buNo: this.getQcSpecWarningBuNo(), partNo: this.partCurrentRow.partNo, itemNo: this.qcSpecWarningCurrentRow.itemNo, inspectionTypeNo: this.qcSpecWarningCurrentRow.inspectionTypeNo, createBy: this.$store.state.user.name, warningList: this.qcSpecWarningList, }) .then(({ data }) => { this.qcSpecWarningSaveLoading = false if (data && data.code === 0) { this.$message.success(this.$t('qc.common.saveSuccess')) this.loadQcSpecWarningList() } else { this.$message.error(data.msg || this.$t('qc.common.saveFailed')) } }) .catch(() => { this.qcSpecWarningSaveLoading = false }) }, deleteQcSpec(row) { this.$confirm( this.$t('qc.partAttributePage.deleteQcSpecConfirm'), this.$t('qc.common.tip'), { confirmButtonText: this.$t('qc.common.confirm'), cancelButtonText: this.$t('qc.common.cancel'), type: 'warning', } ).then(() => { qcSpecDelete({ site: this.partCurrentRow.site, buNo: row.buNo, partNo: this.partCurrentRow.partNo, itemNo: row.itemNo, inspectionTypeNo: row.inspectionTypeNo, rowNo: row.rowNo, }).then(({ data }) => { if (data && data.code === 0) { this.refreshQcSpecList() this.$message.success(this.$t('qc.common.deleteSuccess')) } else { this.$message.error(data.msg) } }) }) }, batchDeleteQcSpec() { if (!this.qcSpecSelections || this.qcSpecSelections.length === 0) { this.$message.warning(this.$t('qc.partAttributePage.selectAtLeastOne')) return } this.$confirm( this.$t('qc.partAttributePage.batchDeleteQcSpecCount', { count: this.qcSpecSelections.length, }), this.$t('qc.common.tip'), { confirmButtonText: this.$t('qc.common.confirm'), cancelButtonText: this.$t('qc.common.cancel'), type: 'warning', } ).then(() => { this.qcSpecDeleteLoading = true const deletePromises = this.qcSpecSelections.map((row) => { return qcSpecDelete({ site: this.partCurrentRow.site, buNo: row.buNo, partNo: this.partCurrentRow.partNo, itemNo: row.itemNo, inspectionTypeNo: row.inspectionTypeNo, rowNo: row.rowNo, }) }) Promise.all(deletePromises) .then((results) => { const allSuccess = results.every( ({ data }) => data && data.code === 0 ) if (allSuccess) { this.$message.success( this.$t('qc.partAttributePage.batchDeleteSuccess') ) } else { this.$message.warning( this.$t('qc.partAttributePage.partialDeleteFail') ) } if (this.$refs.qcSpecTable) { this.$refs.qcSpecTable.clearSelection() } this.qcSpecSelections = [] this.refreshQcSpecList() }) .catch(() => { this.$message.error(this.$t('qc.partAttributePage.batchDeleteFail')) this.refreshQcSpecList() }) .finally(() => { this.qcSpecDeleteLoading = false }) }) }, // ================= 巡检特殊配置相关方法 =================
// 打开巡检特殊配置对话框
openPatrolConfigDialog() { this.patrolConfigDialogFlag = true this.getPatrolConfigList() this.loadOperationDescList() },
// 获取工序列表
loadOperationDescList() { const params = { site: this.partCurrentRow.site || this.modalData.site, } getAllOperationDescList(params).then(({ data }) => { if (data && data.code === 0) { this.operationDescList = data.rows || [] } }) },
// 获取巡检特殊配置列表
getPatrolConfigList() { this.patrolConfigLoading = true const params = { site: this.modalData.site, buNo: this.modalData.buNo, partNo: this.modalData.partNo, } getPatrolConfigList(params) .then(({ data }) => { if (data && data.code === 0) { this.patrolConfigList = data.rows || [] } else { this.$message.error( data.msg || this.$t('qc.common.patrolConfigFail') ) } this.patrolConfigLoading = false }) .catch(() => { this.patrolConfigLoading = false }) },
// 巡检配置选择变化
patrolConfigSelectionChange(selections) { this.patrolConfigSelections = selections },
// 巡检配置行点击
patrolConfigRowClick(row) { // 可以在这里添加行点击逻辑
},
// 新增巡检配置
addPatrolConfig() { this.patrolConfigList.push({ site: this.modalData.site, buNo: this.modalData.buNo, partNo: this.modalData.partNo, operationDesc: '', firstInspectionDuration: 0, nextInspectionDuration: 0, totalInspectionDuration: 0, defaultFlag: 'N', isNew: true, }) },
// 保存单行巡检配置
savePatrolConfigRow(row) { if (!row.operationDesc) { this.$message.warning(this.$t('qc.partAttributePage.enterOperation')) return } const params = { site: row.site, buNo: row.buNo, partNo: row.partNo, operationDesc: row.operationDesc, firstInspectionDuration: row.firstInspectionDuration, nextInspectionDuration: row.nextInspectionDuration, totalInspectionDuration: row.totalInspectionDuration, defaultFlag: row.defaultFlag, } if (row.isNew) { savePatrolConfig(params).then(({ data }) => { if (data && data.code === 0) { this.$message.success(this.$t('qc.common.saveSuccess')) this.getPatrolConfigList() } else { this.$message.error(data.msg || this.$t('qc.common.saveFailed')) } }) } else { updatePatrolConfig(params).then(({ data }) => { if (data && data.code === 0) { this.$message.success(this.$t('qc.partAttributePage.updateSuccess')) this.getPatrolConfigList() } else { this.$message.error( data.msg || this.$t('qc.partAttributePage.updateFail') ) } }) } },
// 删除巡检配置
deletePatrolConfig() { if (this.patrolConfigSelections.length === 0) { this.$message.warning( this.$t('qc.partAttributePage.selectDataToDeletePatrol') ) return } this.$confirm( this.$t('qc.partAttributePage.confirmDeletePatrolConfig'), this.$t('qc.common.tip'), { confirmButtonText: this.$t('qc.common.confirm'), cancelButtonText: this.$t('qc.common.cancel'), type: 'warning', } ) .then(() => { const deleteList = this.patrolConfigSelections.filter( (item) => !item.isNew ) if (deleteList.length === 0) { // 只有新增的未保存数据,直接从列表中移除
this.patrolConfigSelections.forEach((item) => { const index = this.patrolConfigList.indexOf(item) if (index > -1) { this.patrolConfigList.splice(index, 1) } }) this.patrolConfigSelections = [] return } const params = { list: deleteList.map((item) => ({ site: item.site, buNo: item.buNo, partNo: item.partNo, operationDesc: item.operationDesc, })), } deletePatrolConfig(params).then(({ data }) => { if (data && data.code === 0) { this.$message.success(this.$t('qc.common.deleteSuccess')) this.getPatrolConfigList() } else { this.$message.error(data.msg || this.$t('qc.common.deleteFailed')) } }) }) .catch(() => {}) },
// 处理默认标识变化
handleDefaultFlagChange(row) { if (row.defaultFlag === 'Y') { // 如果设置为默认,将其他行的默认标识设为N
this.patrolConfigList.forEach((item) => { if (item !== row) { item.defaultFlag = 'N' } }) } },
// 批量保存巡检配置
batchSavePatrolConfig() { if (this.patrolConfigList.length === 0) { this.$message.warning( this.$t('qc.partAttributePage.noPatrolDataToSave') ) return } // 验证数据
for (let i = 0; i < this.patrolConfigList.length; i++) { const item = this.patrolConfigList[i] if (!item.operationDesc) { this.$message.warning( this.$t('qc.partAttributePage.rowOperationRequired', { row: i + 1 }) ) return } } this.patrolConfigSaveLoading = true let successCount = 0 let errorCount = 0 const promises = this.patrolConfigList.map((row) => { const params = { site: row.site, buNo: row.buNo, partNo: row.partNo, operationDesc: row.operationDesc, firstInspectionDuration: row.firstInspectionDuration, nextInspectionDuration: row.nextInspectionDuration, totalInspectionDuration: row.totalInspectionDuration, defaultFlag: row.defaultFlag || 'N', } if (row.isNew) { return savePatrolConfig(params) .then(({ data }) => { if (data && data.code === 0) { successCount++ row.isNew = false } else { errorCount++ } }) .catch(() => { errorCount++ }) } else { return updatePatrolConfig(params) .then(({ data }) => { if (data && data.code === 0) { successCount++ } else { errorCount++ } }) .catch(() => { errorCount++ }) } }) Promise.all(promises).then(() => { this.patrolConfigSaveLoading = false if (errorCount === 0) { this.$message.success(this.$t('qc.common.saveSuccess')) } else { this.$message.warning( this.$t('qc.partAttributePage.savePartialResult', { success: successCount, fail: errorCount, }) ) } this.getPatrolConfigList() }) },
// 打开巡检配置导入对话框
openPatrolConfigImport() { const params = { site: this.modalData.site, buNo: this.modalData.buNo, partNo: this.modalData.partNo, } this.$refs.patrolConfigUpload.init(params) },
// 获取用户的bu
getSiteAndBuByUserName() { let tempData = { username: this.$store.state.user.name, } getSiteAndBuByUserName(tempData).then(({ data }) => { if (data.code === 0) { this.userBuList = data.rows } }) },
getSiteAndBuByUserName2() { let tempData = { username: this.$store.state.user.name, } getSiteAndBuByUserName2(tempData).then(({ data }) => { if (data.code === 0) { this.buList = data.rows } }) },
umSearch() { umSearch({ active: 'Y' }).then(({ data }) => { if (data && data.code === 0) { this.umList = data.rows || [] } }) },
// 查询检验类型
inspectionTypeSearch() { let tempData = { site: this.$store.state.user.site, } inspectionTypeSearch(tempData).then(({ data }) => { if (data.code === 0) { this.options = data.rows this.ensureDefaultQcSpecFilterType() } }) },
chooseLevel(row) { this.openSamplingLevelPicker(row) },
chooseProgrammeRow(row) { this.openSamplingProgrammePicker(row) },
// 获取数据列表
getDataList() { this.searchData.limit = this.pageSize this.searchData.page = this.pageIndex this.searchLoading = true qcPartAttributeSearch(this.searchData) .then(({ data }) => { if (data.code === 0) { this.dataList = data.page.list this.pageIndex = data.page.currPage this.pageSize = data.page.pageSize this.totalPage = data.page.totalCount // 判断是否全部存在数据
if (this.dataList.length > 0) { // 设置选中行
this.$refs.partTable.setCurrentRow(this.dataList[0]) this.partClickRow(this.dataList[0]) } else { this.partCurrentRow = {} this.refreshCurrentTabTable() } } }) .finally(() => { this.searchLoading = false }) },
// 每页数
sizeChangeHandle(val) { this.pageSize = val this.pageIndex = 1 this.getDataList() },
// 当前页
currentChangeHandle(val) { this.pageIndex = val this.getDataList() },
updateModal(row) { this.modalData = { site: row.site, bu: row.site + '_' + row.buNo, buNo: row.buNo, partNo: row.partNo, partDesc: row.partDesc, partTypeDB: row.partTypeDB, partType: row.partType, umId: row.umId, spec: row.spec, expirationFlag: row.expirationFlag, expirationDay: row.expirationDay, expirationWarningDay: row.expirationWarningDay, exceedInRatio: row.exceedInRatio, exceedOutRatio: row.exceedOutRatio, inboundWarehouseId: row.inboundWarehouseId, inboundWarehouseName: row.inboundWarehouseName, outboundWarehouseId: row.outboundWarehouseId, outboundWarehouseName: row.outboundWarehouseName, inboundLocationId: row.inboundLocationId, inboundLocationName: row.inboundLocationName, active: row.active, iqcExempt: row.iqcExempt, faiExempt: row.faiExempt, ipqcExempt: row.ipqcExempt, pqcExempt: row.pqcExempt, fqcExempt: row.fqcExempt, oqcExempt: row.oqcExempt, firstInspectionDuration: row.firstInspectionDuration, nextInspectionDuration: row.nextInspectionDuration, totalInspectionDuration: row.totalInspectionDuration, lastUpdateBy: this.$store.state.user.name, partDescEn: row.partDescEn, standardValue: row.standardValue, defaultValue: row.defaultValue, maxValue: row.maxValue, minValue: row.minValue, adhesiveActivePeriodFlag: row.adhesiveActivePeriodFlag, thawingDuration: row.thawingDuration, accumulatedExposureDuration: row.accumulatedExposureDuration, issueMethod: row.issueMethod, defectThreshold: row.defectThreshold, recoveryBatchCount: row.recoveryBatchCount, currentDefectCount: row.currentDefectCount, remainingTrackingBatches: row.remainingTrackingBatches, trackingFlag: row.trackingFlag, lastDefectCount: row.lastDefectCount, lastTriggerTime: row.lastTriggerTime, } this.modalDisableFlag = false this.modalFlag = true },
updateModal2(row) { this.modalData = { site: row.site, bu: row.site + '_' + row.buNo, buNo: row.buNo, partNo: row.partNo, partDesc: row.partDesc, partTypeDB: row.partTypeDB, partType: row.partType, umId: row.umId, spec: row.spec, expirationFlag: row.expirationFlag, expirationDay: row.expirationDay, expirationWarningDay: row.expirationWarningDay, exceedInRatio: row.exceedInRatio, exceedOutRatio: row.exceedOutRatio, inboundWarehouseId: row.inboundWarehouseId, inboundWarehouseName: row.inboundWarehouseName, outboundWarehouseId: row.outboundWarehouseId, outboundWarehouseName: row.outboundWarehouseName, inboundLocationId: row.inboundLocationId, inboundLocationName: row.inboundLocationName, active: row.active, iqcExempt: row.iqcExempt, faiExempt: row.faiExempt, ipqcExempt: row.ipqcExempt, pqcExempt: row.pqcExempt, fqcExempt: row.fqcExempt, oqcExempt: row.oqcExempt, firstInspectionDuration: row.firstInspectionDuration, nextInspectionDuration: row.nextInspectionDuration, totalInspectionDuration: row.totalInspectionDuration, lastUpdateBy: this.$store.state.user.name, partDescEn: row.partDescEn, standardValue: row.standardValue, defaultValue: row.defaultValue, maxValue: row.maxValue, minValue: row.minValue, adhesiveActivePeriodFlag: row.adhesiveActivePeriodFlag, thawingDuration: row.thawingDuration, accumulatedExposureDuration: row.accumulatedExposureDuration, issueMethod: row.issueMethod, defectThreshold: row.defectThreshold, recoveryBatchCount: row.recoveryBatchCount, currentDefectCount: row.currentDefectCount, remainingTrackingBatches: row.remainingTrackingBatches, trackingFlag: row.trackingFlag, lastDefectCount: row.lastDefectCount, lastTriggerTime: row.lastTriggerTime, } this.modalDisableFlag = true this.modalFlag = true },
saveData() { if (this.modalData.partDesc === '' || this.modalData.partDesc == null) { this.$message.warning(this.$t('qc.partAttributePage.selectPartName')) return } this.saveLoading = true qcPartAttributeEdit(this.modalData) .then(({ data }) => { if (data && data.code === 0) { this.getDataList() this.modalFlag = false this.$message.success(this.$t('qc.common.operationSuccess')) } else { this.$message.error(data.msg) } }) .finally(() => { this.saveLoading = false }) },
// 列表表格选择替换
tabClick(tab, event) { // 刷新列表数据
this.refreshCurrentTabTable() },
// 当前值发生变化的时候修改
changeCurrentRow(row, oldRow) { // 判断是否是获取焦点的事件
if (row) { const partChanged = !oldRow || row.partNo !== oldRow.partNo || row.site !== oldRow.site this.partCurrentRow = JSON.parse(JSON.stringify(row)) if (partChanged) { this.resetQcSpecFilters() this.resetFileCollectQuery() } //刷新当前页表(主表行点击时不调用 searchPartAttributeDetails)
this.refreshCurrentTabTable(true) } },
partTableRowClassName({ row }) { if (this.partCurrentRow && this.partCurrentRow.partNo === row.partNo) { return 'part-row-selected' } return '' },
rowStyle() { return { cursor: 'pointer' } },
// 单机选中物料信息
partClickRow(row, column) { this.partCurrentRow = JSON.parse(JSON.stringify(row)) },
// 刷新页签的table数据
refreshCurrentTabTable(skipSearchPartAttributeDetails = false) { if (this.activeTable === 'bom') { } else if (this.activeTable === 'routing') { } else if (this.activeTable === 'qcTemplate') { this.detailModal(skipSearchPartAttributeDetails) } else if (this.activeTable === 'defectTracking') { this.getPartDefectTracking() } else if (this.activeTable === 'qcSpec') { this.refreshQcSpecList(skipSearchPartAttributeDetails) } else if (this.activeTable === 'fileCollect') { this.refreshFileCollectList() } else if (this.activeTable === 'labelTemplate') { this.getPartLabelTemplate() } },
// ==================== 物料模板 ====================
// 打开物料模板清单
detailModal(skipSearchPartAttributeDetails = false) { this.detailData.site = this.partCurrentRow.site this.detailData.buNo = this.partCurrentRow.buNo this.detailData.partNo = this.partCurrentRow.partNo this.detailData.attributeNo = this.partCurrentRow.partNo this.detailData.partDesc = this.partCurrentRow.partDesc this.detailData.userName = this.$store.state.user.name if (skipSearchPartAttributeDetails) { // 主表行点击时不调用 searchPartAttributeDetails
return } searchPartAttributeDetails(this.detailData).then(({ data }) => { this.detailList = data.rows this.templatePageIndex = 1 // 重置到第一页
}) },
checkInspectionType() { // 刷新模板列表
this.refreshTemplateLists()
// 根据检验类型调整布局
if ( this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '107' ) { this.span1 = 12 this.span2 = 6 this.span3 = 6 } else if ( this.detailData.inspectionTypeNo === '105' || this.detailData.inspectionTypeNo === '109' ) { this.span1 = 12 this.span2 = 12 } else { this.span1 = 24 } },
checkInspectionType2() { this.refreshTemplateLists() },
// 刷新可选模板列表和已有模板列表(统一方法,带loading)
refreshTemplateLists() { this.itemList1Loading = true this.itemList2Loading = true getPartTemplateLists(this.detailData) .then(({ data }) => { if (data) { this.itemList1 = data.row1 || [] this.itemList2 = data.row2 || [] } }) .catch((err) => { console.error('加载模板列表失败:', err) }) .finally(() => { this.itemList1Loading = false this.itemList2Loading = false }) },
// 批量编辑模态框
editBatchModel() { if (this.editBatchVisible) { this.editBatchVisible = false } else { this.editBatchVisible = true } },
// 批量保存
batchModel() { let params = [] params = this.detailList this.batchLoading = true saveAttributeDetailed(params) .then(({ data }) => { if (data && data.code === 0) { this.detailModal() this.$message.success(data.msg) this.editBatchVisible = false } else { this.$message.error(data.msg) } }) .finally(() => { this.batchLoading = false }) },
// 快速新增
addFastModal() { // 检查是否已选择物料
if (!this.detailData.partNo || !this.detailData.site) { this.$message.warning( this.$t('qc.partAttributePage.selectPartForTemplate') ) return }
// 检查检验类型是否已加载
if (!this.options || this.options.length === 0) { this.$message.warning( this.$t('qc.partAttributePage.inspectionTypeLoading') ) return }
// 初始化选择状态
this.itemSelections1 = [] this.itemSelections2 = []
// 设置默认检验类型为第一个
this.detailData.inspectionTypeNo = this.options[0].inspectionTypeNo
// 根据检验类型调整布局
if ( this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '107' ) { this.span1 = 12 this.span2 = 6 this.span3 = 6 } else if ( this.detailData.inspectionTypeNo === '105' || this.detailData.inspectionTypeNo === '109' ) { this.span1 = 12 this.span2 = 12 } else { this.span1 = 24 }
// 清空工序和机台选择
this.operationSelections = [] this.resourceSelections = [] this.dataListOperationSelections = [] this.operationData.operationDesc = '' this.resourceData.resourceId = '' this.resourceData.resourceDesc = ''
// 清空供应商和客户选择
this.selectionManufacturer = [] this.selectionManufacturer2 = [] this.dataListManufacturerSelections = [] this.selectionCustomer = [] this.selectionCustomer2 = [] this.dataListCustomerSelections = []
// 打开对话框
this.fastAddFlag = true
// 对话框打开后再加载模板列表(使用$nextTick确保对话框已渲染)
this.$nextTick(() => { this.refreshTemplateLists() }) },
// 可选项目
itemClickRow1(row) { this.$refs.itemTable1.toggleRowSelection(row) },
// 已有项目
itemClickRow2(row) { this.$refs.itemTable2.toggleRowSelection(row) },
selectionItem1(val) { this.itemSelections1 = val },
selectionItem2(val) { this.itemSelections2 = val },
// 添加模板
addItem() { if (this.itemSelections1 == null || this.itemSelections1.length === 0) { this.$message.warning( this.$t('qc.partAttributePage.selectOptionalTemplate') ) return } // IPQC/FQC类型:如果想选择机台,必须要选择工序
if ( this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '102' || this.detailData.inspectionTypeNo === '103' || this.detailData.inspectionTypeNo === '104' || this.detailData.inspectionTypeNo === '106' || this.detailData.inspectionTypeNo === '107' ) { if ( this.resourceSelections.length > 0 && this.operationSelections.length === 0 ) { this.$message.warning( this.$t('qc.partAttributePage.machineRequiresOperation') ) return } }
// 开始loading
this.addItemLoading = true
// 构建请求参数
let inData = { site: this.detailData.site, buNo: this.detailData.buNo, attributeNo: this.detailData.partNo, itemList: this.itemSelections1, // IPQC/FQC类型:传递工序列表和机台列表(多选)
operationList: this.operationSelections.map( (item) => item.operationDesc ), resourceIDList: this.resourceSelections.map((item) => item.resourceId), // IQC类型:传递供应商列表(可为空)
manufacturerList: this.selectionManufacturer || [], // OQC类型:传递客户列表(可为空)
customerList: this.selectionCustomer || [], attributeType: this.detailData.attributeType, inspectionTypeNo: this.detailData.inspectionTypeNo, } savePartAttributeDetails(inData) .then(({ data }) => { if (data && data.code === 0) { this.$message.success(this.$t('qc.partAttributePage.addSuccess')) // 刷新可选模板列表和已有模板列表
this.refreshTemplateLists() // 清空选中状态
this.itemSelections1 = [] this.operationSelections = [] this.resourceSelections = [] this.selectionManufacturer = [] this.selectionManufacturer2 = [] this.selectionCustomer = [] this.selectionCustomer2 = [] } else { this.$message.error(data.msg) } }) .catch((err) => { this.$message.error( this.$t('qc.partAttributePage.addFailPrefix') + (err.message || this.$t('qc.common.unknownError')) ) }) .finally(() => { this.addItemLoading = false }) },
// 删除模板
deleteItem() { if (this.itemSelections2 == null || this.itemSelections2.length === 0) { this.$message.warning( this.$t('qc.partAttributePage.selectExistingTemplate') ) return }
// 开始loading
this.deleteItemLoading = true
let inData = { attributeNo: this.detailData.partNo, itemList: this.itemSelections2, attributeType: this.detailData.attributeType, site: this.detailData.site, buNo: this.detailData.buNo, } deletePartAttributeDetails(inData) .then(({ data }) => { if (data && data.code === 0) { this.$message.success(this.$t('qc.common.deleteSuccess')) // 刷新可选模板列表和已有模板列表
this.refreshTemplateLists() this.itemSelections2 = [] } else { this.$message.error(data.msg) } }) .catch((err) => { this.$message.error( this.$t('qc.common.deleteFailed') + ': ' + (err.message || this.$t('qc.common.unknownError')) ) }) .finally(() => { this.deleteItemLoading = false }) },
// 关闭后刷新列表
refreshDetailList() { searchPartAttributeDetails(this.detailData).then(({ data }) => { this.detailList = data.rows }) },
// 删除物料属性中的模板
deletePartAttributeDetails(row) { this.$confirm( this.$t('qc.template.deleteTemplateConfirm'), this.$t('qc.common.tip'), { confirmButtonText: this.$t('qc.common.confirm'), cancelButtonText: this.$t('qc.common.cancel'), type: 'warning', } ).then(() => { this.$set(row, 'deleting', true) deletePartAttributeDetails(row) .then(({ data }) => { if (data && data.code === 0) { searchPartAttributeDetails(this.detailData).then(({ data }) => { this.detailList = data.rows }) this.$message.success(this.$t('qc.common.operationSuccess')) } else { this.$message.error(data.msg) } this.$set(row, 'deleting', false) }) .catch(() => { this.$set(row, 'deleting', false) }) }) },
// 质量检验模板多选变化
handleTemplateSelectionChange(val) { this.selectedTemplates = val },
// 批量删除质量检验模板
batchDeleteTemplates() { if (this.selectedTemplates.length === 0) { this.$message.warning(this.$t('qc.partAttributePage.selectAtLeastOne')) return }
this.$confirm( this.$t('qc.partAttributePage.batchDeleteTemplateCount', { count: this.selectedTemplates.length, }), this.$t('qc.common.tip'), { confirmButtonText: this.$t('qc.common.confirm'), cancelButtonText: this.$t('qc.common.cancel'), type: 'warning', } ).then(() => { this.templateDeleteLoading = true // 创建删除请求的Promise数组
const deletePromises = this.selectedTemplates.map((row) => { return deletePartAttributeDetails(row) })
// 并发执行所有删除请求
Promise.all(deletePromises) .then((results) => { // 检查是否所有请求都成功
const allSuccess = results.every( ({ data }) => data && data.code === 0 )
if (allSuccess) { this.$message.success( this.$t('qc.partAttributePage.batchDeleteSuccess') ) } else { this.$message.warning( this.$t('qc.partAttributePage.partialDeleteFail') ) }
// 刷新列表
searchPartAttributeDetails(this.detailData).then(({ data }) => { this.detailList = data.rows })
// 清空选中状态
this.$refs.templateTable.clearSelection() this.selectedTemplates = [] this.templateDeleteLoading = false }) .catch(() => { this.$message.error(this.$t('qc.partAttributePage.batchDeleteFail')) // 刷新列表
searchPartAttributeDetails(this.detailData).then(({ data }) => { this.detailList = data.rows }) this.templateDeleteLoading = false }) }) },
// 质量检验模板每页数
templateSizeChangeHandle(val) { this.templatePageSize = val this.templatePageIndex = 1 },
// 质量检验模板当前页
templateCurrentChangeHandle(val) { this.templatePageIndex = val },
// ==================== 物料缺陷跟踪 ====================
// 查询物料缺陷跟踪
getPartDefectTracking() { let templateData = { site: this.partCurrentRow.site, buNo: this.partCurrentRow.buNo, partNo: this.partCurrentRow.partNo, } getPartDefectTracking(templateData).then(({ data }) => { this.defectTrackingList = data.rows }) },
// 新增物料缺陷跟踪
addDefectTrackingModal() { this.defectTrackingData = { site: this.partCurrentRow.site, buNo: this.partCurrentRow.buNo, partNo: this.partCurrentRow.partNo, supplierId: '', supplierName: '', defectThreshold: '', recoveryBatchCount: '', currentDefectCount: '', lastDefectCount: '', } this.defectTrackingModal = true this.defectTrackingDisableFlag = false },
// 新增物料缺陷跟踪
saveDefectTracking() { if ( this.defectTrackingData.supplierId === '' || this.defectTrackingData.supplierId == null ) { this.$message.warning(this.$t('qc.partAttributePage.selectSupplier')) return } this.saveLoading = true saveDefectTracking(this.defectTrackingData) .then(({ data }) => { if (data && data.code === 0) { this.getPartDefectTracking() this.defectTrackingModal = false this.$message.success(this.$t('qc.common.operationSuccess')) } else { this.$message.error(data.msg) } }) .finally(() => { this.saveLoading = false }) },
// 删除物料缺陷跟踪
deleteDefectTracking(row) { this.$confirm( this.$t('qc.partAttributePage.deleteDefectTrackingConfirm'), this.$t('qc.common.tip'), { confirmButtonText: this.$t('qc.common.confirm'), cancelButtonText: this.$t('qc.common.cancel'), type: 'warning', } ).then(() => { deleteDefectTracking(row).then(({ data }) => { if (data && data.code === 0) { this.getPartDefectTracking() this.$message.success(this.$t('qc.common.operationSuccess')) } else { this.$message.error(data.msg) } }) }) },
onDefectTrackingPositiveIntInput(row, prop, value) { if (!row || !prop) return const matched = String(value == null ? '' : value).match(/^[1-9]\d*$/) row[prop] = matched ? matched[0] : '' },
// 批量编辑
editDefectTrackingBatchModel() { if (this.editBatchVisible) { this.editBatchVisible = false } else { this.editBatchVisible = true } },
cancelDefectTrackingBatchModel() { this.editBatchVisible = false this.getPartDefectTracking() },
// 批量保存
batchDefectTrackingModel() { let params = [] params = this.defectTrackingList this.batchLoading = true updateDefectTracking(params) .then(({ data }) => { if (data && data.code === 0) { this.getPartDefectTracking() this.$message.success(data.msg) this.editBatchVisible = false } else { this.$message.error(data.msg) } }) .finally(() => { this.batchLoading = false }) },
// ==================== 标签模版设置 ====================
// 查询标签模版设置
getPartLabelTemplate() { let templateData = { site: this.partCurrentRow.site, buNo: this.partCurrentRow.buNo, partNo: this.partCurrentRow.partNo, } getPartLabelTemplate(templateData).then(({ data }) => { this.labelTemplateList = data.rows }) },
// 新增标签模版设置
addLabelTemplateModal() { this.labelTemplateData = { flag: '1', site: this.partCurrentRow.site, buNo: this.partCurrentRow.buNo, partNo: this.partCurrentRow.partNo, labelTypeTb: '', labelType: '', operationDesc: '', defaultFlag: '', createdBy: this.$store.state.user.name, } this.loadOperationDescList() this.labelTemplateModal = true this.labelTemplateDisableFlag = false },
// 编辑标签模版设置
updateLabelTemplateModal(row) { this.labelTemplateData = { flag: '2', site: row.site, buNo: row.buNo, partNo: row.partNo, labelTypeTb: row.labelTypeTb, labelType: row.labelType, operationDesc: row.operationDesc || '', defaultFlag: row.defaultFlag, } this.loadOperationDescList() this.labelTemplateModal = true this.labelTemplateDisableFlag = true },
// 新增标签模版设置
saveLabelTemplate() { if ( this.labelTemplateData.labelTypeTb === '' || this.labelTemplateData.labelTypeTb == null ) { this.$message.warning(this.$t('qc.partAttributePage.selectLabelType')) return }
// 检查是否设置为默认,且已存在其他默认标签
if (this.labelTemplateData.defaultFlag === '1') { // 查找已存在的默认标签(排除当前编辑的记录)
const existingDefault = this.labelTemplateList.find( (item) => item.defaultFlag === '1' && item.labelTypeTb !== this.labelTemplateData.labelTypeTb ) if (existingDefault) { this.$confirm( this.$t('qc.partAttributePage.defaultLabelChangeConfirm', { label: existingDefault.labelType, }), this.$t('qc.common.tip'), { confirmButtonText: this.$t('qc.common.confirm'), cancelButtonText: this.$t('qc.common.cancel'), type: 'warning', } ) .then(() => { // 先将已存在的默认标签改为非默认
const clearDefaultData = { site: existingDefault.site, buNo: existingDefault.buNo, partNo: existingDefault.partNo, labelTypeTb: existingDefault.labelTypeTb, labelType: existingDefault.labelType, defaultFlag: '0', } updateLabelTemplate(clearDefaultData).then(({ data }) => { if (data && data.code === 0) { // 清除成功后再保存当前标签
this.doSaveLabelTemplate() } else { this.$message.error( this.$t('qc.partAttributePage.clearDefaultLabelFail') + data.msg ) } }) }) .catch(() => { // 用户取消
}) return } }
this.doSaveLabelTemplate() },
// 执行保存标签模版
doSaveLabelTemplate() { this.saveLoading = true if (this.labelTemplateData.flag === '1') { saveLabelTemplate(this.labelTemplateData) .then(({ data }) => { if (data && data.code === 0) { this.getPartLabelTemplate() this.labelTemplateModal = false this.$message.success(this.$t('qc.common.operationSuccess')) } else { this.$message.error(data.msg) } }) .finally(() => { this.saveLoading = false }) } else { updateLabelTemplate(this.labelTemplateData) .then(({ data }) => { if (data && data.code === 0) { this.getPartLabelTemplate() this.labelTemplateModal = false this.$message.success(this.$t('qc.common.operationSuccess')) } else { this.$message.error(data.msg) } }) .finally(() => { this.saveLoading = false }) } },
// 删除标签模版设置
deleteLabelTemplate(row) { this.$confirm( this.$t('qc.partAttributePage.deleteLabelTemplateConfirm'), this.$t('qc.common.tip'), { confirmButtonText: this.$t('qc.common.confirm'), cancelButtonText: this.$t('qc.common.cancel'), type: 'warning', } ).then(() => { deleteLabelTemplate(row).then(({ data }) => { if (data && data.code === 0) { this.getPartLabelTemplate() this.$message.success(this.$t('qc.common.operationSuccess')) } else { this.$message.error(data.msg) } }) }) },
// 仓库输入校验
inWarehouseBlur(tagNo) { let tempData = { tagno: tagNo, conditionSql: " and WareHouseID = '" + this.modalData.inboundWarehouseId + "'" + " and site = '" + this.modalData.site + "'" + " and bu_no = '" + this.modalData.buNo + "'", } verifyData(tempData).then(({ data }) => { if (data && data.code === 0) { if (data.baseListData.length > 0) { this.modalData.inboundWarehouseId = data.baseListData[0].WareHouseID this.modalData.inboundWarehouseName = data.baseListData[0].WareHouseName } else { this.modalData.inboundWarehouseName = '' } } }) },
// 仓库输入校验
outWarehouseBlur(tagNo) { let tempData = { tagno: tagNo, conditionSql: " and WareHouseID = '" + this.modalData.outboundWarehouseId + "'" + " and site = '" + this.modalData.site + "'" + " and bu_no = '" + this.modalData.buNo + "'", } verifyData(tempData).then(({ data }) => { if (data && data.code === 0) { if (data.baseListData.length > 0) { this.modalData.outboundWarehouseId = data.baseListData[0].WareHouseID this.modalData.outboundWarehouseName = data.baseListData[0].WareHouseName } else { this.modalData.outboundWarehouseName = '' } } }) },
// 库位输入校验
locationBlur(tagNo) { let tempData = { tagno: tagNo, conditionSql: " and LocationID = '" + this.modalData.inboundLocationId + "'" + " and site = '" + this.modalData.site + "'" + " and bu_no = '" + this.modalData.buNo + "'", } verifyData(tempData).then(({ data }) => { if (data && data.code === 0) { if (data.baseListData.length > 0) { this.modalData.inboundLocationId = data.baseListData[0].LocationID this.modalData.inboundLocationName = data.baseListData[0].LocationName } else { this.modalData.inboundLocationName = '' } } }) },
// 库位输入校验
supplierBlur(tagNo) { let tempData = { tagno: tagNo, conditionSql: " and SupplierID = '" + this.defectTrackingData.supplierId + "'" + " and site = '" + this.defectTrackingData.site + "'", } verifyData(tempData).then(({ data }) => { if (data && data.code === 0) { if (data.baseListData.length > 0) { this.defectTrackingData.supplierId = data.baseListData[0].SupplierID this.defectTrackingData.supplierName = data.baseListData[0].SupplierName } else { this.defectTrackingData.supplierName = '' } } }) },
// 标签类型输入校验
labelTemplateBlur() { let tempData = { tagno: tagNo, conditionSql: " and ReportID = '" + this.labelTemplateData.labelTypeTb + "'", } verifyData(tempData).then(({ data }) => { if (data && data.code === 0) { if (data.baseListData.length > 0) { this.labelTemplateData.labelTypeTb = data.baseListData[0].ReportID this.labelTemplateData.labelType = data.baseListData[0].ReportFamily } else { this.labelTemplateData.labelType = '' } } }) },
// 获取基础数据列表S
getBaseList(val, type) { this.tagNo = val this.tagType = type this.$nextTick(() => { let strVal = '' if (val === 20 && type === 1) { strVal = this.modalData.inboundWarehouseId this.$refs.baseList.init(val, strVal) } if (val === 20 && type === 2) { strVal = this.modalData.outboundWarehouseId this.$refs.baseList.init(val, strVal) } if (val === 506) { strVal = this.defectTrackingData.supplierId this.$refs.baseList.init(val, strVal) } if (val === 1099) { strVal = this.labelTemplateData.labelTypeTb this.$refs.baseList.init(val, strVal) } }) },
// 列表方法的回调
getBaseData(val) { if (this.tagNo === 20 && this.tagType === 1) { this.modalData.inboundWarehouseId = val.WareHouseID this.modalData.inboundWarehouseName = val.WareHouseName } if (this.tagNo === 20 && this.tagType === 2) { this.modalData.outboundWarehouseId = val.WareHouseID this.modalData.outboundWarehouseName = val.WareHouseName } if (this.tagNo === 506) { this.defectTrackingData.supplierId = val.SupplierID this.defectTrackingData.supplierName = val.SupplierName } if (this.tagNo === 1099) { this.labelTemplateData.labelTypeTb = val.ReportID this.labelTemplateData.labelType = val.ReportFamily } },
// 校验用户是否收藏
favoriteIsOk() { let userFavorite = { userId: this.$store.state.user.id, languageCode: this.$i18n.locale, } userFavoriteList(userFavorite).then(({ data }) => { for (let i = 0; i < data.list.length; i++) { if (this.$route.meta.menuId === data.list[i].menuId) { this.favorite = true } } }) },
// 收藏 OR 取消收藏
favoriteFunction() { let userFavorite = { userId: this.$store.state.user.id, functionId: this.$route.meta.menuId, } if (this.favorite) { removeUserFavorite(userFavorite).then(({ data }) => { this.$message.success(data.msg) this.favorite = false }) } else { // 收藏
saveUserFavorite(userFavorite).then(({ data }) => { this.$message.success(data.msg) this.favorite = true }) } },
async exportExcel() { this.searchData.limit = -1 this.searchData.page = 1 excel.exportTable({ url: '/pms/qc/qcPartAttributeSearch', columnMapping: this.columnList, params: this.searchData, fileName: this.exportName + '.xlsx', rowFetcher: (res) => { return res.data }, }) },
// 导入
qcUpload() { let currentData = { flag: 'partAttribute', createBy: this.$store.state.user.name, site: this.$store.state.user.site, } //打开组件 去做新增业务
this.$nextTick(() => { this.$refs.qcUpload.init(currentData) }) },
// 获取工序列表
getOperationList() { this.operationPageIndex = 1 this.fetchOperationList(true, true) },
// 获取机台列表
getAllResourceList() { this.resourceData.site = this.resolveResourceSite() getAllResourceList(this.resourceData).then(({ data }) => { if (data && data.code === 0) { this.resourceList = data.rows this.resourceModelFlag = true } else { this.$message.error(data.msg) } }) },
// 条件查询获取工序列表
getOperationList2() { this.operationPageIndex = 1 this.fetchOperationList(false, false) },
fetchOperationList(openDialog, restoreSelection) { const payload = { ...this.operationData, page: this.operationPageIndex, limit: this.operationPageSize, } getOperationDescList(payload).then(({ data }) => { if (data && data.code === 0) { this.operationList = (data.page && data.page.list) || [] this.operationPageIndex = data.page.currPage this.operationPageSize = data.page.pageSize this.operationTotalPage = data.page.totalCount if (restoreSelection || this.qcSpecPickerRow) { this.$nextTick(() => { if (!this.$refs.operationTable) return if (this.qcSpecPickerRow) { const operationDesc = this.qcSpecPickerRow.operation if (operationDesc) { const match = this.operationList.find( (o) => o.operationDesc === operationDesc ) if (match) { this.$refs.operationTable.setCurrentRow(match) this.operationSelections = [match] } } return } this.$refs.operationTable.clearSelection() if (this.operationSelections && this.operationSelections.length > 0) { const selectedDescs = this.operationSelections.map((o) => o.operationDesc) this.operationList.forEach((val) => { if (selectedDescs.includes(val.operationDesc)) { this.$refs.operationTable.toggleRowSelection(val, true) } }) } }) } if (openDialog) { this.operationModelFlag = true } } else { this.operationList = [] this.operationTotalPage = 0 if (openDialog && data && data.msg) { this.$message.error(data.msg) } } }) },
operationCurrentChange(val) { this.operationPageIndex = val this.fetchOperationList(false, true) },
// 条件查询获取机台列表
getAllResourceList2() { this.resourceData.site = this.resolveResourceSite() getAllResourceList(this.resourceData).then(({ data }) => { if (data && data.code === 0) { this.resourceList = data.rows this.resourceCurrent = -1 } else { this.$message.error(data.msg) } }) },
// 点击行选中工序
operationClickRow(row) { if (this.qcSpecPickerRow) { this.operationSelections = [row] this.$refs.operationTable.setCurrentRow(row) return } this.$refs.operationTable.toggleRowSelection(row) },
operationDblClickRow(row) { if (!this.qcSpecPickerRow) return this.operationSelections = [row] this.confirmOperation() },
// 点击行选中机台
resourceClickRow(row) { if (this.qcSpecPickerRow) { this.resourceSelections = [row] this.$refs.resourceTable.setCurrentRow(row) return } this.$refs.resourceTable.toggleRowSelection(row) },
resourceDblClickRow(row) { if (!this.qcSpecPickerRow) return this.resourceSelections = [row] this.confirmResource() },
// 多选工序
selectionOperationChangeHandle(val) { this.operationSelections = val },
// 工序选择:检验项目设置为单选(无复选框),模板新增仍为多选
operationSelect(selection, row) { if (!this.qcSpecPickerRow || !this.$refs.operationTable) return this.operationSelections = [row] this.$refs.operationTable.setCurrentRow(row) },
getRowKeys(row) { return row.operationDesc },
// 多选机台
selectionResourceChangeHandle(val) { this.resourceSelections = val },
// 机台选择:检验项目设置为单选(无复选框),模板新增仍为多选
resourceSelect(selection, row) { if (!this.qcSpecPickerRow || !this.$refs.resourceTable) return this.resourceSelections = [row] this.$refs.resourceTable.setCurrentRow(row) },
getRowKeys2(row) { return row.resourceId },
operationRowClassName({ row, rowIndex }) { row.index = rowIndex // 在原有的数据上加一个index
},
resourceRowClassName({ row, rowIndex }) { row.index = rowIndex // 在原有的数据上加一个index
},
onOperationDialogClose() { if (this.qcSpecPickerRow) { this.qcSpecPickerRow = null this.operationSelections = [] } }, onResourceDialogClose() { if (this.qcSpecPickerRow) { this.qcSpecPickerRow = null this.resourceSelections = [] } }, // 确认选择工序
confirmOperation() { if (this.qcSpecPickerRow) { const sel = this.operationSelections if (sel && sel.length > 0) { this.qcSpecPickerRow.operation = sel[0].operationDesc } this.qcSpecPickerRow = null this.operationSelections = [] this.operationModelFlag = false return } this.operationModelFlag = false },
// 确认选择机台
confirmResource() { if (this.qcSpecPickerRow) { const sel = this.resourceSelections if (sel && sel.length > 0) { this.qcSpecPickerRow.resourceID = sel[0].resourceId this.qcSpecPickerRow.resourceDesc = sel[0].resourceDesc } this.qcSpecPickerRow = null this.resourceSelections = [] this.resourceModelFlag = false return } this.resourceModelFlag = false },
// 获取供应商列表
getManufacturerList() { this.manufacturerPageIndex = 1 this.fetchManufacturerList(true, true) },
// 搜索供应商列表
getManufacturerList2() { this.manufacturerPageIndex = 1 this.fetchManufacturerList(false, false) },
fetchManufacturerList(openDialog, restoreSelection) { this.manufacturerData.site = this.detailData.site || this.manufacturerData.site const payload = { ...this.manufacturerData, page: this.manufacturerPageIndex, limit: this.manufacturerPageSize, } getManufacturerList(payload).then(({ data }) => { if (data && data.code === 0) { this.manufacturerList = (data.page && data.page.list) || [] this.manufacturerPageIndex = data.page.currPage this.manufacturerPageSize = data.page.pageSize this.manufacturerTotalPage = data.page.totalCount if (restoreSelection || this.qcSpecPickerRow) { this.$nextTick(() => { if (!this.$refs.manufacturerTable) return if (this.qcSpecPickerRow) { const manufacturerID = this.qcSpecPickerRow.manufacturerID if (manufacturerID) { const match = this.manufacturerList.find( (m) => m.manufacturerID === manufacturerID ) if (match) { this.$refs.manufacturerTable.setCurrentRow(match) this.dataListManufacturerSelections = [match] } } return } this.$refs.manufacturerTable.clearSelection() const tempDataList = this.selectionManufacturer this.manufacturerList.forEach((val) => { if (tempDataList.includes(val.manufacturerID)) { this.$refs.manufacturerTable.toggleRowSelection(val, true) } }) }) } if (openDialog) { this.manufacturerModelFlag = true } } else { this.manufacturerList = [] this.manufacturerTotalPage = 0 if (openDialog && data && data.msg) { this.$message.error(data.msg) } } }) },
manufacturerSizeChange(val) { this.manufacturerPageSize = val this.manufacturerPageIndex = 1 this.fetchManufacturerList(false, !this.qcSpecPickerRow) },
manufacturerCurrentChange(val) { this.manufacturerPageIndex = val this.fetchManufacturerList(false, !this.qcSpecPickerRow) },
getRowKeys3(row) { return row.manufacturerID },
// 点击行选中供应商
manufacturerClickRow(row) { if (this.qcSpecPickerRow) { this.dataListManufacturerSelections = [row] this.$refs.manufacturerTable.setCurrentRow(row) return } this.$refs.manufacturerTable.toggleRowSelection(row) },
manufacturerDblClickRow(row) { if (!this.qcSpecPickerRow) return this.dataListManufacturerSelections = [row] this.confirmManufacturer() },
// 多选
selectionManufacturerChangeHandle(val) { this.dataListManufacturerSelections = val },
// 确认多选供应商
confirmManufacturer() { if (this.qcSpecPickerRow) { const sel = this.dataListManufacturerSelections if (sel && sel.length > 0) { this.qcSpecPickerRow.manufacturerID = sel[0].manufacturerID this.qcSpecPickerRow.manufacturerName = sel[0].manufacturerName } this.qcSpecPickerRow = null this.manufacturerModelFlag = false return } this.selectionManufacturer = [] this.selectionManufacturer2 = [] for (let i = 0; i < this.dataListManufacturerSelections.length; i++) { this.selectionManufacturer.push( this.dataListManufacturerSelections[i].manufacturerID ) this.selectionManufacturer2.push(this.dataListManufacturerSelections[i]) } this.manufacturerModelFlag = false },
// 获取客户列表
getCustomerList() { this.customerPageIndex = 1 this.fetchCustomerList(true, true) },
// 搜索客户列表
getCustomerList2() { this.customerPageIndex = 1 this.fetchCustomerList(false, false) },
fetchCustomerList(openDialog, restoreSelection) { this.customerData.site = this.detailData.site || this.customerData.site const payload = { ...this.customerData, page: this.customerPageIndex, limit: this.customerPageSize, } getCustomerList(payload).then(({ data }) => { if (data && data.code === 0) { this.customerList = (data.page && data.page.list) || [] this.customerPageIndex = data.page.currPage this.customerPageSize = data.page.pageSize this.customerTotalPage = data.page.totalCount if (restoreSelection || this.qcSpecPickerRow) { this.$nextTick(() => { if (!this.$refs.customerTable) return if (this.qcSpecPickerRow) { const customerID = this.qcSpecPickerRow.customerID if (customerID) { const match = this.customerList.find( (c) => c.customerID === customerID ) if (match) { this.$refs.customerTable.setCurrentRow(match) this.dataListCustomerSelections = [match] } } return } this.$refs.customerTable.clearSelection() const tempDataList = this.selectionCustomer this.customerList.forEach((val) => { if (tempDataList.includes(val.customerID)) { this.$refs.customerTable.toggleRowSelection(val, true) } }) }) } if (openDialog) { this.customerModelFlag = true } } else { this.customerList = [] this.customerTotalPage = 0 if (openDialog && data && data.msg) { this.$message.error(data.msg) } } }) },
customerSizeChange(val) { this.customerPageSize = val this.customerPageIndex = 1 this.fetchCustomerList(false, !this.qcSpecPickerRow) },
customerCurrentChange(val) { this.customerPageIndex = val this.fetchCustomerList(false, !this.qcSpecPickerRow) },
// 点击行选中客户
customerClickRow(row) { if (this.qcSpecPickerRow) { this.dataListCustomerSelections = [row] this.$refs.customerTable.setCurrentRow(row) return } this.$refs.customerTable.toggleRowSelection(row) },
customerDblClickRow(row) { if (!this.qcSpecPickerRow) return this.dataListCustomerSelections = [row] this.confirmCustomer() },
// 多选客户
selectionCustomerChangeHandle(val) { this.dataListCustomerSelections = val },
getRowKeys4(row) { return row.customerID },
// 确认多选客户
confirmCustomer() { if (this.qcSpecPickerRow) { const sel = this.dataListCustomerSelections if (sel && sel.length > 0) { this.qcSpecPickerRow.customerID = sel[0].customerID this.qcSpecPickerRow.customerName = sel[0].customerName } this.qcSpecPickerRow = null this.customerModelFlag = false return } this.selectionCustomer = [] this.selectionCustomer2 = [] for (let i = 0; i < this.dataListCustomerSelections.length; i++) { this.selectionCustomer.push( this.dataListCustomerSelections[i].customerID ) this.selectionCustomer2.push(this.dataListCustomerSelections[i]) } this.customerModelFlag = false },
// sop文件列表
sopFileList(row) { this.sopData = { site: row.site, buNo: row.buNo, partNo: row.partNo, inspectionTypeNo: '', } this.getFileContentList() },
getFileContentList() { let tempData = { orderRef1: this.sopData.site, orderRef2: this.sopData.partNo, orderRef3: this.sopData.inspectionTypeNo, orderRef4: this.sopData.buNo, } getFileContentList(tempData).then(({ data }) => { if (data && data.code == 200) { this.sopList = data.rows } else { this.sopList = [] } }) this.sopFileModelFlag = true },
// 上传sop文件模态框
uploadSopFile() { let currentData = { titleCon: 'SOP文件上传', site: this.sopData.site, buNo: this.sopData.buNo, createBy: this.$store.state.user.name, partNo: this.sopData.partNo, inspectionTypeNo: '', options: this.options, } //打开组件 去做新增业务
this.$nextTick(() => { this.$refs.qcSOPUploadFile.init(currentData) }) },
// 文件下载
downloadFile(row) { downLoadObjectFile(row).then(({ data }) => { // 不限制文件下载类型
const blob = new Blob([data], { type: 'application/octet-stream' }) // 下载文件名称
const fileName = row.fileName // a标签下载
const linkNode = document.createElement('a') // a标签的download属性规定下载文件的名称
linkNode.download = fileName linkNode.style.display = 'none' // 生成一个Blob URL
linkNode.href = URL.createObjectURL(blob) document.body.appendChild(linkNode) // 模拟在按钮上的一次鼠标单击
linkNode.click() // 释放URL 对象
URL.revokeObjectURL(linkNode.href) document.body.removeChild(linkNode) }) },
// 删除文件
deleteFile(row) { this.$confirm( this.$t('qc.partAttributePage.confirmDeleteFile'), this.$t('qc.common.tip'), { confirmButtonText: this.$t('qc.common.confirm'), cancelButtonText: this.$t('qc.common.cancel'), type: 'warning', } ).then(() => { deleteObjectFile(row).then(({ data }) => { if (data && data.code === 0) { this.getFileContentList() this.$message.success(this.$t('qc.common.operationSuccess')) } else { this.$message.error(data.msg) } }) }) },
// 动态列开始 获取 用户保存的 格式列
reloadDynamicColumns() { this.getTableUserColumn(this.$route.meta.menuId + 'table1', 1) this.getTableUserColumn(this.$route.meta.menuId + 'Table4', 4) this.getTableUserColumn(this.$route.meta.menuId + 'Table5', 5) this.getTableUserColumn(this.$route.meta.menuId + 'Table6', 6) },
async getTableUserColumn(tableId, columnId) { let queryTableUser = { userId: this.$store.state.user.name, functionId: this.$route.meta.menuId, tableId: tableId, status: true, languageCode: this.$i18n.locale, } await getTableUserListLanguage(queryTableUser).then(({ data }) => { if (data.rows.length > 0) { switch (columnId) { case 1: this.columnList = data.rows break case 2: this.columnDetailList = data.rows break case 4: this.columnDefectTrackingList = this.applyDefectTrackingEditType( data.rows ) break case 5: this.columnFileCollectList = this.applyFileCollectEditType(data.rows) break case 6: this.columnQcSpecList = this.applyQcSpecColumnMeta(data.rows) break } // 接口返回会覆盖本地列;用前端 i18n map 再刷一遍表头
this.initPartAttributeI18n() } else { this.getColumnList(tableId, columnId) } }) },
// 获取 tableDefault 列
async getColumnList(tableId, columnId) { let queryTable = { functionId: this.$route.meta.menuId, tableId: tableId, languageCode: this.$i18n.locale, } await getTableDefaultListLanguage(queryTable).then(({ data }) => { if (data.rows.length !== 0) { switch (columnId) { case 1: this.columnList = data.rows break case 2: this.columnDetailList = data.rows break case 4: this.columnDefectTrackingList = this.applyDefectTrackingEditType( data.rows ) break case 5: this.columnFileCollectList = this.applyFileCollectEditType(data.rows) break case 6: this.columnQcSpecList = this.applyQcSpecColumnMeta(data.rows) break } this.initPartAttributeI18n() } }) },
/** 动态列接口不会带回 editType,批量编辑列需补回 */ applyDefectTrackingEditType(list) { const editProps = ['defectThreshold', 'recoveryBatchCount'] return (list || []).map((col) => { if (editProps.includes(col.columnProp)) { return { ...col, editType: 'positiveInt' } } return col }) },
applyFileCollectEditType(list) { const editTypeMap = { staffAccount: 'staffPicker', itemNo: 'itemPicker', operation: 'operationPicker', originalColumnName: 'textInput', remark: 'textInput', } return (list || []).map((col) => { const editType = editTypeMap[col.columnProp] if (editType) { return { ...col, editType } } return col }) },
/** 动态列接口不会带回 editType / visibleWhen,需按列补回 */ applyQcSpecColumnMeta(list) { const editTypeMap = { ipqcInspectionMethod: 'ipqcSelect', valueType: 'valueType', defaultValue: 'textInput', maxValue: 'textInput', minValue: 'textInput', samplingProgrammeDesc: 'programmePicker', samplingLevelDesc: 'levelPicker', defaultSamplingQuantity: 'samplingQty', defaultSamplingProportion: 'samplingRatio', operation: 'operationPicker', resourceID: 'resourcePicker', manufacturerName: 'manufacturerPicker', customerName: 'customerPicker', custom1: 'textInput', custom2: 'textInput', custom3: 'textInput', } const visibleWhenMap = { ipqcInspectionMethod: 'ipqcMethod', operation: 'operation', resourceID: 'resource', manufacturerName: 'manufacturer', customerName: 'customer', } return (list || []).map((col) => { const extra = {} if (editTypeMap[col.columnProp]) extra.editType = editTypeMap[col.columnProp] if (visibleWhenMap[col.columnProp]) extra.visibleWhen = visibleWhenMap[col.columnProp] return Object.keys(extra).length ? { ...col, ...extra } : col }) },
closeDialog() { this.partDetailData = { partNo: '', partDesc: '', seqNo: '', sku: '', } this.partInfoList = [] },
//获取按钮的权限数据
getButtonAuthData() { let searchFlag = this.isAuth(this.menuId + ':search') let saveFlag = this.isAuth(this.menuId + ':save') let updateFlag = this.isAuth(this.menuId + ':update') let deleteFlag = this.isAuth(this.menuId + ':delete') let detailFlag = this.isAuth(this.menuId + ':detail') let fileFlag = this.isAuth(this.menuId + ':file') let syncFlag = this.isAuth(this.menuId + ':sync') let itemImportFlag = this.isAuth(this.menuId + ':itemImport') //处理页面的权限数据
this.authSearch = !searchFlag this.authSave = !saveFlag this.authUpdate = !updateFlag this.authDelete = !deleteFlag this.authDetail = !detailFlag this.authFile = !fileFlag this.authSync = !syncFlag this.authItemImport = !itemImportFlag },
syncPartCatalog() { this.$confirm( this.$t('qc.partAttributePage.dataSyncConfirm'), this.$t('qc.common.tip'), { confirmButtonText: this.$t('qc.common.confirm'), cancelButtonText: this.$t('qc.common.cancel'), type: 'warning', } ) .then(() => { this.syncLoading = true return qcPartCatalogSync() }) .then(({ data }) => { this.syncLoading = false if (data && data.code === 0) { this.$message.success(this.$t('qc.partAttributePage.dataSyncSuccess')) if (!this.authSearch) { this.getDataList() } } else { this.$message.error( (data && data.msg) || this.$t('qc.partAttributePage.dataSyncFail') ) } }) .catch(() => { this.syncLoading = false }) },
openDieMoldAddModal() { const defaultBu = this.buList.length > 0 ? this.buList[0] : null const defaultUm = this.umList.length > 0 ? this.umList[0] : { umId: '' } this.dieMoldAddData = { bu: defaultBu ? defaultBu.buNo : '', site: defaultBu ? defaultBu.site : this.$store.state.user.site || '', buNo: this.parseBuNo(defaultBu ? defaultBu.buNo : ''), partNo: '', partDesc: '', partType: this.$t('qc.partAttributePage.dieMoldPartType'), spec: '', umId: defaultUm.umId, remark: '', handle: 'Y', active: 'Y', createBy: this.$store.state.user.name, } this.dieMoldAddModalFlag = true this.$nextTick(() => { if (this.$refs.dieMoldAddForm) { this.$refs.dieMoldAddForm.clearValidate() } }) },
parseBuNo(buValue) { if (!buValue || buValue.indexOf('_') < 0) { return '' } return buValue.split('_')[1] },
onDieMoldAddBuChange(buValue) { const selected = this.buList.find((item) => item.buNo === buValue) this.dieMoldAddData.site = selected ? selected.site : '' this.dieMoldAddData.buNo = this.parseBuNo(buValue) },
saveDieMoldPart() { this.$refs.dieMoldAddForm.validate((valid) => { if (!valid) { return } this.onDieMoldAddBuChange(this.dieMoldAddData.bu) if (!this.dieMoldAddData.site || !this.dieMoldAddData.buNo) { this.$message.warning(this.$t('qc.common.pleaseSelectBu')) return } this.dieMoldAddSaveLoading = true const submitData = { ...this.dieMoldAddData, partType: '刀模', handle: 'Y', createBy: this.$store.state.user.name, } qcPartDieMoldAdd(submitData) .then(({ data }) => { if (data && data.code === 0) { this.$message.success(this.$t('qc.partAttributePage.dieMoldAddSuccess')) this.dieMoldAddModalFlag = false if (!this.authSearch) { this.getDataList() } } else { this.$message.error(data.msg) } }) .finally(() => { this.dieMoldAddSaveLoading = false }) }) }, },}</script><style scoped>/deep/ .customer-tab .el-tabs__content { padding: 5px !important;}
.el-table /deep/ .cell { height: auto; line-height: 1.5;}
/* 主表去掉行悬停变灰效果,保留选中行高亮 *//deep/ .part-table.el-table--enable-row-hover .el-table__body tr:hover > td { background-color: #fff !important;}
/deep/ .part-table .el-table__body tr.part-row-selected > td,/deep/ .part-table .el-table__body tr.part-row-selected:hover > td { background-color: #cbe2f5 !important;}
/* 物料编辑弹出框样式 - 超紧凑版 */.part-edit-dialog .dialog-content { padding: 8px; max-height: 70vh;}
.part-edit-dialog .form-section { margin-bottom: 12px; padding: 8px; border-radius: 4px; border-left: 2px solid #17b3a3;}
.part-edit-dialog .section-title { font-size: 13px; font-weight: 600; color: #303133; margin-bottom: 2px; padding-bottom: 3px; border-bottom: 1px solid #e4e7ed;}
.part-edit-dialog .el-form-item { margin-bottom: 6px;}
.part-edit-dialog .el-form-item__label { font-weight: 500; color: #606266; font-size: 12px; line-height: 1.2;}
.part-edit-dialog .el-input__inner,.part-edit-dialog .el-input-number .el-input__inner { border-radius: 4px; font-size: 12px; height: 32px; line-height: 32px;}
.part-edit-dialog .el-input-group .el-input:first-child .el-input__inner { border-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0;}
.part-edit-dialog .el-input-group .el-input:last-child .el-input__inner { border-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0;}
.part-edit-dialog .el-checkbox { font-size: 12px; line-height: 1.2;}
.part-edit-dialog .el-select .el-input__inner { height: 32px; line-height: 32px;}
/* 检验模板弹出框样式 - 超紧凑版 */.inspection-template-dialog .template-header { padding: 10px; background: #f5f7fa; border-radius: 4px; margin-bottom: 10px; border: 1px solid #e4e7ed;}
.inspection-template-dialog .template-header .el-form-item { margin-bottom: 0;}
.inspection-template-dialog .template-header .el-form-item__label { font-weight: 600; color: #303133; font-size: 12px;}
.inspection-template-dialog .template-header .el-input__inner { font-size: 12px; height: 32px; line-height: 32px;}
.inspection-template-dialog .template-table-container { border-radius: 6px; overflow: hidden; border: 1px solid #e4e7ed;}
.inspection-template-dialog .inspection-table { font-size: 12px;}
.inspection-template-dialog .inspection-table .el-table__header-wrapper th { background: #f5f7fa; color: #303133; font-weight: 600; font-size: 12px; padding: 8px 0;}
.inspection-template-dialog .input-button-group { display: flex; align-items: center; gap: 8px;}
.inspection-template-dialog .select-button { min-width: 45px; padding: 3px 8px; font-size: 11px; border: 1px solid #dcdfe6; border-radius: 3px; background: #fff; color: #606266; transition: all 0.2s;}
.inspection-template-dialog .select-button:hover { color: #409eff; border-color: #c6e2ff; background-color: #ecf5ff;}
.inspection-template-dialog .readonly-input { flex: 1;}
.inspection-template-dialog .readonly-input .el-input__inner { background-color: #f5f7fa; border-color: #e4e7ed; font-size: 11px; height: 28px; line-height: 28px;}
.inspection-template-dialog .el-input-number { width: 100%;}
.inspection-template-dialog .el-input-number .el-input__inner { text-align: center; font-size: 11px; height: 28px; line-height: 28px;}
.inspection-template-dialog .el-input__inner { font-size: 11px; height: 28px; line-height: 28px;}
/* 按钮样式 - 保持Element UI风格 */
/* 删除按钮样式 */.inspection-template-dialog .el-button[style*='color: #f56c6c'] { color: #f56c6c !important; font-size: 11px; padding: 3px 8px;}
.inspection-template-dialog .el-button[style*='color: #f56c6c']:hover { color: #f78989 !important;}
/* 响应式设计 */@media (max-width: 1200px) { .part-edit-dialog { width: 95% !important; }
.inspection-template-dialog { width: 95% !important; }}
@media (max-width: 768px) { .part-edit-dialog .el-col, .inspection-template-dialog .el-col { margin-bottom: 15px; }
.inspection-template-dialog .input-button-group { flex-direction: column; gap: 5px; }
.inspection-template-dialog .select-button { width: 100%; }}
/* 表格行悬停效果 */.inspection-template-dialog .el-table--enable-row-hover .el-table__body tr:hover > td { background-color: #f5f7fa;}
/* 仓库配置区域特殊样式 */.part-edit-dialog .form-section .el-input-group { display: flex; width: 100%;}
.part-edit-dialog .form-section .el-input-group .el-input:first-child { flex: 0 0 25%;}
.part-edit-dialog .form-section .el-input-group .el-input:last-child { flex: 1;}
.part-edit-dialog .form-section .el-input-group .el-input__inner { border-radius: 0;}
.part-edit-dialog .form-section .el-input-group .el-input:first-child .el-input__inner { border-top-left-radius: 4px; border-bottom-left-radius: 4px; border-right: 0;}
.part-edit-dialog .form-section .el-input-group .el-input:last-child .el-input__inner { border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-left: 0;}
/* 滚动条样式 */.part-edit-dialog .dialog-content::-webkit-scrollbar { width: 6px;}
.part-edit-dialog .dialog-content::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px;}
.part-edit-dialog .dialog-content::-webkit-scrollbar-thumb { background: #c0c4cc; border-radius: 3px;}
.part-edit-dialog .dialog-content::-webkit-scrollbar-thumb:hover { background: #909399;}
/* ==================== 检验标准维护配置对话框样式 ==================== *//deep/ .config-dialog { border-radius: 8px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);}
/deep/ .config-dialog .el-dialog__header { background: linear-gradient(135deg, #9ac3d0 20%, #b6c7dd 80%); padding: 20px 24px; border-radius: 8px 8px 0 0;}
/deep/ .config-dialog .el-dialog__title { color: #ffffff; font-size: 18px; font-weight: 600;}
/deep/ .config-dialog .el-dialog__headerbtn .el-dialog__close { color: #ffffff; font-size: 20px; font-weight: bold;}
/deep/ .config-dialog .el-dialog__headerbtn .el-dialog__close:hover { color: #f0f0f0;}
/deep/ .config-dialog .el-dialog__body { padding: 0; background: #f5f7fa;}
.qc-spec-batch-fill-content { padding: 20px 24px; background: #ffffff;
.el-form-item { margin-bottom: 16px; }
::v-deep .el-form-item__label { line-height: 1.4; padding-bottom: 4px; }
::v-deep .el-form-item__label a { color: #20b2aa; cursor: pointer; text-decoration: none;
&:hover { text-decoration: underline; } }}
.qc-spec-sync-content { padding: 20px 24px; background: #ffffff;
.el-form-item { margin-bottom: 16px; }
.qc-spec-sync-fields { margin-top: 8px;
.el-col { margin-bottom: 12px; } }
.qc-spec-sync-hint { margin-top: 4px; color: #909399; font-size: 12px; line-height: 1.5; }}
/* 查询区域 */.search-section { padding: 16px 24px; background: #ffffff; border-bottom: 1px solid #e8e8e8;}
.search-section .el-form { margin-bottom: 0;}
.search-section .el-form-item { margin-bottom: 0;}
/* 项目操作容器 */.item-operation-content { display: flex; gap: 16px; align-items: stretch; padding: 16px;}
/* 面板样式 */.item-panel { flex: 1; min-width: 0; background: #ffffff; border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); overflow: hidden; transition: all 0.3s ease;}
.item-panel:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);}
.available-panel,.selected-panel { flex: 1;}
/* 面板头部 */.panel-header { padding: 8px 16px; background: linear-gradient(135deg, #9ac3d0 20%, #b6c7dd 80%); border-bottom: 2px solid #9ac3d0; display: flex; align-items: center; gap: 8px;}
.panel-header i { font-size: 18px; color: #ffffff;}
.panel-title { font-size: 15px; font-weight: 600; color: #ffffff; flex: 1;}
.qc-spec-copy-hint { margin-bottom: 12px; font-size: 13px; color: #606266;}
.qc-spec-copy-content { height: 100%; display: flex; flex-direction: column; min-height: 0; padding: 10px 18px 8px; background: #ffffff; overflow: hidden;}
.qc-spec-copy-search-form { display: flex; flex-wrap: wrap; align-items: center; flex-shrink: 0; margin-bottom: 2px;}
.qc-spec-copy-search-form .el-form-item { margin: 0 14px 8px 0;}
.qc-spec-copy-available,.qc-spec-copy-selected { display: flex; flex-direction: column; min-height: 0;}
.qc-spec-copy-available { flex: 1.5;}
.qc-spec-copy-selected { flex: 1;}
.qc-spec-copy-table-wrap { position: relative; flex: 1; min-height: 0;}
.qc-spec-copy-table-wrap .el-table { position: absolute; left: 0; right: 0; top: 0; bottom: 0; height: 100% !important;}
.qc-spec-copy-section-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; flex-shrink: 0; min-height: 36px; margin-bottom: 6px;}
.qc-spec-copy-section-header .el-button { margin-left: 12px;}
.qc-spec-copy-section-title { color: #303133; font-size: 14px; font-weight: 600;}
.qc-spec-copy-pagination { display: flex; flex-wrap: wrap; align-items: center; flex-shrink: 0; margin-top: 8px;}
.qc-spec-copy-added-header { margin-top: 8px; padding-top: 8px; border-top: 1px solid #dcdfe6;}
.qc-spec-copy-remove-button { color: #f56c6c; font-size: 17px;}
.qc-spec-add-apply-link { color: #409eff; cursor: pointer;}
.qc-spec-add-apply-link:hover { text-decoration: underline;}
.qc-spec-add-apply-link.is-disabled { color: #c0c4cc; cursor: not-allowed; text-decoration: none;}
.qc-spec-add-apply-input { position: relative; width: 100%;}
.qc-spec-add-apply-input /deep/ .is-clearable .el-input__inner { padding-right: 28px;}
.qc-spec-add-apply-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 2; font-size: 14px; line-height: 1; cursor: pointer; color: #c0c4cc;}
.qc-spec-add-apply-clear:hover { color: #909399;}
.qc-spec-pending-clear-btn { color: #f56c6c; padding: 0 2px; margin-left: 2px;}
.qc-spec-pending-clear-btn:hover { color: #f78989;}
.qc-spec-warning-dialog { padding: 16px 20px 12px; background: #f5f7fa;}
.qc-spec-warning-header { display: flex; justify-content: space-between; align-items: center;}
.qc-spec-warning-item-info { font-size: 13px; color: #606266;}
.qc-spec-warning-footer { margin-top: 16px; text-align: center;}
/deep/ .qc-spec-warning-dialog .el-color-picker { vertical-align: middle;}
.item-count { font-size: 13px; color: #ffffff; background: rgba(255, 255, 255, 0.2); padding: 2px 10px; border-radius: 12px; font-weight: 500;}
/* 表格样式 */.operation-table { border: none; width: 100%;}
.available-panel /deep/ .operation-table .el-table__body-wrapper { overflow-x: auto;}
/deep/ .operation-table .el-table__body-wrapper { max-height: 420px; overflow-y: auto;}
/deep/ .operation-table .el-table__row { cursor: pointer; transition: background-color 0.2s ease;}
/deep/ .operation-table .el-table__row:hover { background-color: #f0f9ff !important;}
/deep/ .operation-table .current-row > td { background-color: #e6f7ff !important;}
/* 操作按钮 */.operation-buttons { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 20px; padding: 0 8px;}
.operation-buttons .el-button { width: 48px; height: 48px; font-size: 20px; transition: all 0.3s ease; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);}
.operation-buttons .el-button:hover { transform: scale(1.1); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);}
.operation-buttons .el-button.is-disabled { opacity: 0.4; cursor: not-allowed;}
.operation-buttons .el-button--primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border: none;}
.operation-buttons .el-button--danger { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); border: none;}
/* 底部按钮 */.dialog-footer { text-align: center; padding: 16px 0 16px 0;}
.dialog-footer .el-button { min-width: 100px; font-weight: 500;}
/* 响应式优化 */@media (max-width: 1300px) { .item-operation-content { gap: 12px; }
.operation-buttons .el-button { width: 42px; height: 42px; font-size: 18px; }}
/* 文件采集配置-新增弹框(参考合并卷) */.file-collect-add-dialog { ::v-deep .el-dialog { border-radius: 8px; overflow: hidden;
.el-dialog__header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 18px 20px;
.el-dialog__title { color: #fff; font-size: 16px; font-weight: 600; }
.el-dialog__headerbtn .el-dialog__close { color: #fff; font-size: 18px;
&:hover { color: #f0f0f0; } } }
.el-dialog__body { padding: 25px; background-color: #f8f9fa; }
.el-dialog__footer { padding: 15px 20px; background-color: #fff; border-top: 1px solid #e9ecef; } }}
.file-collect-add-content { .form-item-enhanced { margin-bottom: 15px;
::v-deep .el-form-item__label { color: #495057; font-weight: 500; font-size: 14px; margin-bottom: 8px; line-height: 1.4; }
::v-deep .el-input__inner { border-radius: 6px; border: 1px solid #dee2e6; transition: all 0.3s; height: 42px; line-height: 42px; font-size: 15px;
&:focus { border-color: #667eea; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); } }
::v-deep .el-input-number { width: 100%;
.el-input__inner { text-align: left; } } }
.form-item-checkbox { ::v-deep .el-form-item__content { line-height: 42px; }
::v-deep .el-checkbox__label { font-size: 14px; color: #495057; } }
.field-link-label { color: #667eea; cursor: pointer; font-weight: 500;
&:hover { color: #764ba2; text-decoration: underline; } }
.roll-info-card { background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%); border-radius: 8px; padding: 16px; margin-bottom: 15px; border: 1px solid #e3e8f0; box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
.info-header { display: flex; align-items: center; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #dee2e6;
i { font-size: 18px; color: #667eea; margin-right: 8px; }
span { font-size: 14px; font-weight: 600; color: #495057; } }
.info-content { padding-top: 5px; } }
.total-info-card { background: linear-gradient(135deg, #17b3a320 0%, #13998b20 100%); border-radius: 8px; padding: 16px 20px; border: 1px solid #17b3a350; box-shadow: 0 2px 8px rgba(23, 179, 163, 0.1);
.total-row { display: flex; justify-content: space-between; align-items: center;
.total-label { font-size: 16px; font-weight: 600; color: #495057; }
.total-value { font-size: 24px; font-weight: 700; color: #17b3a3; } } }}
.file-collect-add-footer { display: flex; justify-content: center; gap: 12px; padding: 0;
.action-btn { min-width: 80px; padding: 6px 16px; border-radius: 16px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s ease; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
&:disabled { opacity: 0.6; cursor: not-allowed; }
&.secondary { background: white; border: 1px solid #17b3a3; color: #17b3a3;
&:hover:not(:disabled) { background: #17b3a3; color: white; }
&:active:not(:disabled) { transform: scale(0.98); } } }}
.qc-spec-cell-picker { display: flex; align-items: center; width: 100%; gap: 4px;}
.qc-spec-cell-picker-btn { flex-shrink: 0; padding: 3px 4px;}
.qc-spec-cell-picker-input { flex: 1; min-width: 0;}
.qc-spec-type-bar { margin: 0 2px; border-bottom: 2px solid #e4e7ed; line-height: 1;}
.qc-spec-type-item { display: inline-block; padding: 8px 16px 6px; cursor: pointer; color: #303133; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -2px; user-select: none;}
.qc-spec-type-item:hover { color: #17b3a3;}
.qc-spec-type-item.is-active { color: #17b3a3; border-bottom-color: #17b3a3;}
.qc-spec-toolbar-form { margin-top: 2px; margin-bottom: 0;}
.qc-spec-table ::v-deep .qc-spec-row-draggable { cursor: move;}
.qc-spec-sortable-ghost { opacity: 0.4; background: #e8f4ff !important;}</style>
<style>/* The dialog is appended to body, so its size rules must not be scoped. */.qc-spec-copy-dialog { width: 92% !important; max-width: none !important; height: 92vh !important; margin-top: 4vh !important; margin-bottom: 0 !important; display: flex; flex-direction: column;}
.qc-spec-copy-dialog .el-dialog__body { flex: 1; min-height: 0; max-height: none; overflow: hidden; padding: 0;}
.qc-spec-copy-dialog .el-dialog__footer { flex-shrink: 0;}
@media (max-width: 840px) { .qc-spec-copy-dialog { width: 92% !important; max-width: 92% !important; }}</style>
|