赫艾前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

3709 lines
136 KiB

<template>
<div class="mod-config">
<!-- 条件查询 -->
<el-form :inline="true" label-position="top" :model="searchData">
<!-- <el-form-item :label="'BU'">-->
<!-- <el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 80px">-->
<!-- <el-option-->
<!-- v-for = "i in userBuList"-->
<!-- :key = "i.buNo"-->
<!-- :label = "i.buDesc"-->
<!-- :value = "i.buDesc">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item :label="'工厂编码'">
<el-input v-model="searchData.site" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'物料编码'">
<el-input v-model="searchData.partNo" clearable style="width: 120px"></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="'物料名称'">
<el-input v-model="searchData.partDesc" clearable style="width: 200px"></el-input>
</el-form-item>
<el-form-item :label="'PN'">
<el-input v-model="searchData.cinvSourceCode" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'类别名称'">
<el-input v-model="searchData.familyName" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="IQC">
<el-select v-model="searchData.iqcFlag" placeholder="全部" clearable style="width: 90px">
<el-option v-for="item in maintainStatusOptions" :key="'iqc-' + item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="IPQC">
<el-select v-model="searchData.ipqcFlag" placeholder="全部" clearable style="width: 90px">
<el-option v-for="item in maintainStatusOptions" :key="'ipqc-' + item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="FQC">
<el-select v-model="searchData.fqcFlag" placeholder="全部" clearable style="width: 90px">
<el-option v-for="item in maintainStatusOptions" :key="'fqc-' + item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="OQC">
<el-select v-model="searchData.oqcFlag" placeholder="全部" clearable style="width: 90px">
<el-option v-for="item in maintainStatusOptions" :key="'oqc-' + item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="SQC">
<el-select v-model="searchData.sqcFlag" placeholder="全部" clearable style="width: 90px">
<el-option v-for="item in maintainStatusOptions" :key="'sqc-' + item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="' '">
<el-button v-if="!authSearch" type="primary" @click="getDataList()">查询</el-button>
<el-button v-if="!authSave" type="primary" @click="addModal()">新增</el-button>
</el-form-item>
<el-form-item :label="' '">
<!-- <el-button type="primary" icon="el-icon-upload" @click="qcUpload()">导入</el-button>-->
<download-excel
:fields="fields()"
:data="exportData"
type="xls"
:name="exportName"
:header="exportHeader"
:footer="exportFooter"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{ "导出" }}
</download-excel>
</el-form-item>
</el-form>
<!-- 展示列表 -->
<el-table
:height="height"
:data="dataList"
border
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="maintainFlagProps.includes(item.columnProp)">
<el-tag :type="isMaintained(scope.row[item.columnProp]) ? 'success' : 'info'" size="small">{{ scope.row[item.columnProp] }}</el-tag>
</span>
<span v-else-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="160"
label="操作">
<template slot-scope="scope">
<a v-if="!authUpdate" type="text" size="small" @click="updateModal(scope.row)">编辑</a>
<a v-if="!authDetail" type="text" size="small" @click="detailModal(scope.row)">检验模板</a>
<el-dropdown
v-if="!authCheckout || !authDelete || !authFile"
trigger="click"
:show-timeout="0"
placement="bottom-end">
<span class="qc-more-dropdown-trigger" @click.stop>
更多<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-if="!authCheckout" @click.native="standardDetailModal(scope.row)">检验标准</el-dropdown-item>
<el-dropdown-item v-if="!authFile" @click.native="sopFileList(scope.row)">文件清单</el-dropdown-item>
<el-dropdown-item @click.native="patrolInspection(scope.row)">巡检配置</el-dropdown-item>
<el-dropdown-item v-if="!authDelete" @click.native="deletePropertiesModel(scope.row)">删除</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<el-pagination
@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="物料属性设置" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="430px">
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
<!-- <el-form-item label="BU" prop="bu" :rules="rules.bu">-->
<!-- <el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 295px">-->
<!-- <el-option-->
<!-- v-for = "i in userBuList"-->
<!-- :key = "i.buNo"-->
<!-- :label = "i.sitename"-->
<!-- :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="工厂编码:" prop="partDesc" :rules="rules.site">
<el-input v-model="modalData.site" disabled style="width: 184px"></el-input>
</el-form-item>
<el-form-item prop="partNo" :rules="rules.partNoType">
<span v-if="modalDisableFlag === false" slot="label" @click="searchPartInfo()"><a herf="#">物料编码:</a></span>
<span v-if="modalDisableFlag === true" slot="label">物料编码:</span>
<el-input v-model="modalData.partNo" :disabled="modalDisableFlag" style="width: 184px"></el-input>
</el-form-item>
<!-- <el-form-item style="margin-top: 23px;margin-left: 2px">
<el-checkbox v-model="modalData.exemptInspection" true-label="Y" false-label="N">是否免检</el-checkbox><br>
</el-form-item> -->
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="物料名称:" prop="partDesc" :rules="rules.partDescType">
<el-input v-model="modalData.partDesc" disabled style="width: 380px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="默认值:" prop="defaultValue" >
<el-input v-model="modalData.defaultValue" style="width: 85px"></el-input>
</el-form-item>
<el-form-item label="标准值:" prop="standardValue" >
<el-input v-model="modalData.standardValue" style="width: 85px"></el-input>
</el-form-item>
<el-form-item label="上限值:" prop="maxValue" >
<el-input v-model="modalData.maxValue" style="width: 85px"></el-input>
</el-form-item>
<el-form-item label="下限值:" prop="minValue" >
<el-input v-model="modalData.minValue" style="width: 85px"></el-input>
</el-form-item>
<el-form-item label="首次巡检时长(h):" prop="firstIPQCPatrolTime" >
<el-input type="number" v-model="modalData.firstIPQCPatrolTime" style="width: 117px"></el-input>
</el-form-item>
<el-form-item label="下次巡检时长(h):" prop="lastIPQCPatrolTime" >
<el-input type="number" v-model="modalData.lastIPQCPatrolTime" style="width: 117px"></el-input>
</el-form-item>
<el-form-item label="累计巡检时长(h):" prop="cycleIPQCPatrolTime" >
<el-input type="number" v-model="modalData.cycleIPQCPatrolTime" style="width: 117px"></el-input>
</el-form-item>
<el-form-item label="检验配置:" >
<el-row :gutter="12">
<el-col :span="6">
<el-checkbox v-model="modalData.iqcExempt" true-label="Y" false-label="N">IQC检验</el-checkbox>
</el-col>
<!-- <el-col :span="6">
<el-checkbox v-model="modalData.faiExempt" true-label="Y" false-label="N">FAI检验</el-checkbox>
</el-col> -->
<el-col :span="6">
<el-checkbox v-model="modalData.ipqcExempt" true-label="Y" false-label="N">IPQC检验</el-checkbox>
</el-col>
<el-col :span="6">
<el-checkbox v-model="modalData.oqcExempt" true-label="Y" false-label="N">OQC检验</el-checkbox>
</el-col>
<el-col :span="6">
<el-checkbox v-model="modalData.fqcExempt" true-label="Y" false-label="N">FQC检验</el-checkbox>
</el-col>
</el-row>
<el-row :gutter="12">
<el-col :span="6">
<el-checkbox v-model="modalData.sqcExempt" true-label="Y" false-label="N">SQC检验</el-checkbox>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="备注:">
<el-input v-model="modalData.attributeRemark" style="width: 385px"></el-input>
</el-form-item>
<!-- <el-form-item label="是否免检">-->
<!-- <input type="checkbox" value="Y" name="isExemptInspection" v-model="modalData.exemptInspection"/>-->
<!-- </el-form-item>-->
</el-form>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="saveData()">保存</el-button>
<el-button type="primary" @click="modalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 检验模板 -->
<el-dialog title="检验模板清单" :close-on-click-modal="false" v-drag :visible.sync="detailModelFlag" width="1400px">
<el-form :inline="true" label-position="top">
<el-form-item :label="'物料编码'">
<el-input v-model="detailData.partNo" readonly style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'物料名称'">
<el-input v-model="detailData.partDesc" readonly style="width: 300px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button type="primary" @click="addFastModal()">新增</el-button>
</el-form-item>
</el-form>
<!-- 检验项目展示列表 -->
<div class="rq ">
<el-table
:height="300"
:data="detailList"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in detailColumnsBeforeIpqc" :key="'before-' + 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
prop="ipqcInspectionMethod"
header-align="center"
align="center"
min-width="180"
label="检验方式">
<template slot-scope="scope">
<el-select
v-model="scope.row.ipqcInspectionMethod"
placeholder="请选择"
size="mini"
style="width: 160px"
:disabled="!isInspectionMethodApplicable(scope.row)">
<el-option
v-for="opt in getInspectionMethodOptions(scope.row)"
:key="opt"
:label="opt"
:value="opt">
</el-option>
</el-select>
<span v-if="isInspectionMethodApplicable(scope.row) && !scope.row.ipqcInspectionMethod" style="color:#F56C6C;margin-left:6px">*</span>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in detailColumnsAfterIpqc" :key="'after-' + 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
prop=""
header-align="center"
align="center"
min-width="170"
label="检验水平">
<template slot-scope="scope">
<el-button type="primary" @click="chooseLevel(scope.row)" style="width:18%;padding: 3px 7px">·&nbsp;·&nbsp;·</el-button>
<el-input v-model="scope.row.samplingLevelDesc" readonly style="width:77%"></el-input>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="center"
min-width="60"
label="检验周期(h)">
<template slot-scope="scope">
<el-input v-model="scope.row.inspectionCycle" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="center"
min-width="170"
label="抽样方案">
<template slot-scope="scope">
<el-button type="primary" @click="chooseProgrammeRow(scope.row)" style="width:18%;padding: 3px 7px" >·&nbsp;·&nbsp;·</el-button>
<el-input v-model="scope.row.samplingProgrammeDesc" readonly style="width:77%"></el-input>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="center"
min-width="60"
label="AQL">
<template slot-scope="scope">
<el-input v-model="scope.row.aql" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="center"
min-width="60"
label="AC">
<template slot-scope="scope">
<el-input v-model="scope.row.ac" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="center"
min-width="60"
label="RE">
<template slot-scope="scope">
<el-input v-model="scope.row.re" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
</template>
</el-table-column>
<el-table-column
prop="templateRemark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="80"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="deletePartAttributeDetails(scope.row)">删除模板</a>
</template>
</el-table-column>
</el-table>
</div>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="saveDetail()">保存</el-button>
<el-button type="primary" @click="detailModelFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 检验模板->快速新增(原实现已注释,现与 boying-vue 一致) -->
<!--
<el-dialog title="新增" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag" width="1100px">
... 原「可选模板 | 添加>> 删除<< | 已有模板」三栏布局与单工序/单机台逻辑已废弃 ...
</el-dialog>
-->
<el-dialog title="新增" @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="'模板编码'">
<el-input v-model="detailData.templateId" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'模板名称'">
<el-input v-model="detailData.templateName" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="检验类型">
<el-select v-model="detailData.inspectionTypeNo" @change="checkInspectionType" placeholder="请选择">
<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">查询</el-button>
</el-form-item>
<el-form-item :label="' '" style="margin-left: 63px">
<el-button type="primary" @click="getOperationList" v-if="detailData.inspectionTypeNo === '101' || detailData.inspectionTypeNo === '102' || detailData.inspectionTypeNo === '103' || detailData.inspectionTypeNo === '104' || detailData.inspectionTypeNo === '106' || detailData.inspectionTypeNo === '107'" style="width: 63px">工序</el-button>
<el-button type="primary" @click="getManufacturerList" v-if="detailData.inspectionTypeNo === '105'" style="width: 63px">供应商</el-button>
<el-button type="primary" @click="getCustomerList" v-if="detailData.inspectionTypeNo === '110'" style="width: 63px">客户</el-button>
</el-form-item>
<el-form-item :label="' '" style="margin-left: 195px">
<el-button type="primary" @click="getAllResourceList" v-if="detailData.inspectionTypeNo === '101' || detailData.inspectionTypeNo === '102' || detailData.inspectionTypeNo === '103' || detailData.inspectionTypeNo === '104' || detailData.inspectionTypeNo === '106' || detailData.inspectionTypeNo === '107'" style="width: 63px">机台</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">可选模板:</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="模板编码"></el-table-column>
<el-table-column prop="templateName" header-align="left" align="left" min-width="200" label="模板名称"></el-table-column>
<el-table-column prop="inspectionTypeName" header-align="center" align="center" min-width="60" label="检验类型"></el-table-column>
</el-table>
</el-col>
<el-col v-if="detailData.inspectionTypeNo === '105' || detailData.inspectionTypeNo === '101' || detailData.inspectionTypeNo === '110' || 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="供应商编码"></el-table-column>
<el-table-column prop="manufacturerName" header-align="left" align="left" min-width="150" label="供应商名称"></el-table-column>
</el-table>
<el-table
v-else-if="detailData.inspectionTypeNo === '110'"
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="客户编码"></el-table-column>
<el-table-column prop="customerName" header-align="left" align="left" min-width="150" label="客户名称"></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="工序"></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="机台编码"></el-table-column>
<el-table-column prop="resourceDesc" header-align="left" align="left" min-width="150" label="机台名称"></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">添加<i class="el-icon-caret-bottom el-icon--right" v-if="!addItemLoading"></i></el-button>
<el-button type="primary" @click="deleteItem" :loading="deleteItemLoading">删除<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">已有模板:</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="模板编码"></el-table-column>
<el-table-column prop="templateName" header-align="center" align="center" min-width="200" label="模板名称"></el-table-column>
<el-table-column prop="operation" header-align="center" align="center" min-width="100" label="工序"></el-table-column>
<el-table-column prop="resourceID" header-align="center" align="center" min-width="100" label="机台"></el-table-column>
<el-table-column prop="manufacturerName" header-align="center" align="center" min-width="200" label="供应商"></el-table-column>
<el-table-column prop="customerName" header-align="center" align="center" min-width="200" label="客户"></el-table-column>
<el-table-column prop="inspectionTypeName" header-align="center" align="center" min-width="60" label="检验类型"></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">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 检验标准(qc_part_attr_detailed) -->
<el-dialog title="检验标准清单" @close="closeStandardDialog" :close-on-click-modal="false" v-drag :visible.sync="standardDetailModelFlag" width="940px">
<el-form :inline="true" label-position="top">
<el-form-item :label="'物料编码'">
<el-input v-model="standardDetailData.partNo" readonly style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'物料名称'">
<el-input v-model="standardDetailData.partDesc" readonly style="width: 240px"></el-input>
</el-form-item>
<!-- <el-form-item label="检验类型">
<el-select v-model="standardDetailData.inspectionTypeNo" @change="syncStandardInspectionTypeName" placeholder="请选择" style="width: 160px">
<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="standardAddFastModal()">新增</el-button> -->
<el-button type="primary" @click="standardSyncFromTemplate()">同步检验项目</el-button>
<!-- <el-button type="primary" @click="standardGoUp()">上移</el-button>
<el-button type="primary" @click="standardGoDown()">下移</el-button> -->
</el-form-item>
</el-form>
<div class="rq">
<el-table
:height="400"
:data="standardDetailList"
@row-click="standardItemClickRow"
ref="standardDetailTable"
highlight-current-row
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in standardColumnDetailList"
:key="'std-col-' + 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>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="right"
min-width="60"
label="标准值">
<template slot-scope="scope">
<el-input v-model="scope.row.defaultValue" style="height: 11px;width:98%"></el-input>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="right"
min-width="60"
label="最大值">
<template slot-scope="scope">
<el-input v-model="scope.row.maxValue" style="height: 11px;width:98%"></el-input>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="right"
min-width="60"
label="最小值">
<template slot-scope="scope">
<el-input v-model="scope.row.minValue" style="height: 11px;width:98%"></el-input>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="100"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="standardDelItemDetails(scope.row)">删除项目</a>
</template>
</el-table-column>
</el-table>
</div>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="saveStandardDetail()">保存</el-button>
<el-button type="primary" @click="standardDetailModelFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 检验标准->快速新增 -->
<el-dialog title="新增检验项目" @close="standardRefreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="standardFastAddFlag" width="1100px">
<div style="font-size: 12px">
<el-form :inline="true" label-position="top" :model="standardDetailData">
<el-form-item :label="'项目编码'">
<el-input v-model="standardDetailData.itemNo" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'项目名称'">
<el-input v-model="standardDetailData.itemDesc" clearable style="width: 200px"></el-input>
</el-form-item>
<el-form-item label="检验类型">
<el-select v-model="standardDetailData.inspectionTypeNo" @change="syncStandardInspectionTypeName" placeholder="请选择" style="width: 160px">
<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="standardGetItem()">查询</el-button>
</el-form-item>
</el-form>
</div>
<el-container style="margin-top: 0px;">
<el-main style="width: 720px; padding: 1px">
<span style="font-size: 12px">可选项目:</span>
<el-table
height="400px"
:data="standardItemList1"
border
ref="standardItemTable1"
@row-click="standardItemClickRow1"
@selection-change="standardSelectionItem1"
highlight-current-row
style="width: 100%">
<el-table-column
type="selection"
header-align="center"
align="center"
:selectable="selectFlag"
width="50">
</el-table-column>
<el-table-column prop="itemNo" header-align="center" align="center" min-width="80" label="项目编码"></el-table-column>
<el-table-column prop="itemDesc" header-align="center" align="center" min-width="120" label="项目名称"></el-table-column>
<el-table-column prop="defaultValue" header-align="center" align="center" min-width="100" label="标准值"></el-table-column>
<el-table-column prop="maxValue" header-align="center" align="center" min-width="60" label="最大值"></el-table-column>
<el-table-column prop="minValue" header-align="center" align="center" min-width="60" label="最小值"></el-table-column>
</el-table>
</el-main>
<el-main style="width: 111px;padding: 1px">
<div style="margin-top: 182px;margin-left: 18px">
<el-button type="primary" @click="standardAddItem()">添加>></el-button>
</div>
<div style="margin-top: 15px;margin-left: 18px">
<el-button type="primary" @click="standardDeleteItem()">删除<<</el-button>
</div>
</el-main>
<el-main style="width: 400px;padding: 1px">
<span style="font-size: 12px">已有项目:</span>
<el-table
height="400px"
:data="standardItemList2"
border
ref="standardItemTable2"
@row-click="standardItemClickRow2"
@selection-change="standardSelectionItem2"
highlight-current-row
style="width: 100%">
<el-table-column
type="selection"
header-align="center"
align="center"
:selectable="selectFlag"
width="50">
</el-table-column>
<el-table-column prop="itemNo" header-align="center" align="center" min-width="80" label="项目编码"></el-table-column>
<el-table-column prop="itemDesc" header-align="center" align="center" min-width="200" label="项目名称"></el-table-column>
</el-table>
</el-main>
</el-container>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="standardFastAddFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 工序(与 boying-vue 一致:多选 + reserve-selection) -->
<el-dialog title="工序清单" :close-on-click-modal="false" v-drag :visible.sync="operationModelFlag" width="420px">
<div class="rq">
<el-form :inline="true" label-position="top" :model="operationData">
<el-form-item :label="'工序:'">
<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">查询</el-button>
</el-form-item>
</el-form>
<el-table
:height="300"
:data="operationList"
ref="operationTable"
@selection-change="selectionOperationChangeHandle"
@select="operationSelect"
:row-key="getRowKeys"
border
style="width: 100%;">
<el-table-column 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="工序"></el-table-column>
</el-table>
</div>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="confirmOperation">确认</el-button>
</el-footer>
</el-dialog>
<!-- 机台 -->
<el-dialog title="机台清单" :close-on-click-modal="false" v-drag :visible.sync="resourceModelFlag" width="420px">
<div class="rq">
<el-form :inline="true" label-position="top" :model="resourceData">
<el-form-item :label="'机台编码'">
<el-input v-model="resourceData.resourceId" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'机台名称'">
<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">查询</el-button>
</el-form-item>
</el-form>
<el-table
:height="300"
:data="resourceList"
ref="resourceTable"
@selection-change="selectionResourceChangeHandle"
@select="resourceSelect"
:row-key="getRowKeys2"
border
style="width: 100%;">
<el-table-column 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="机台编码"></el-table-column>
<el-table-column prop="resourceDesc" header-align="center" align="center" label="机台名称"></el-table-column>
</el-table>
</div>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="confirmResource">确认</el-button>
</el-footer>
</el-dialog>
<!-- 供应商 -->
<el-dialog title="供应商清单" :close-on-click-modal="false" v-drag :visible.sync="manufacturerModelFlag" width="520px">
<div class="rq">
<el-form :inline="true" label-position="top" :model="manufacturerData">
<el-form-item :label="'供应商编码:'">
<el-input v-model="manufacturerData.manufacturerID" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'供应商名称:'">
<el-input v-model="manufacturerData.manufacturerName" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button type="primary" @click="getManufacturerList2">查询</el-button>
</el-form-item>
</el-form>
<el-table
:height="300"
:data="manufacturerList"
ref="manufacturerTable"
@row-click="manufacturerClickRow"
@selection-change="selectionManufacturerChangeHandle"
:row-key="getRowKeys3"
border
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" :reserve-selection="true" width="50"></el-table-column>
<el-table-column prop="manufacturerID" header-align="center" align="center" label="供应商编码"></el-table-column>
<el-table-column prop="manufacturerName" header-align="center" align="center" label="供应商名称"></el-table-column>
</el-table>
</div>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="confirmManufacturer">确认</el-button>
<el-button type="primary" @click="manufacturerModelFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 客户 -->
<el-dialog title="客户清单" :close-on-click-modal="false" v-drag :visible.sync="customerModelFlag" width="520px">
<div class="rq">
<el-form :inline="true" label-position="top" :model="customerData">
<el-form-item :label="'客户编码:'">
<el-input v-model="customerData.customerID" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'客户名称:'">
<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">查询</el-button>
</el-form-item>
</el-form>
<el-table
:height="300"
:data="customerList"
ref="customerTable"
@row-click="customerClickRow"
@selection-change="selectionCustomerChangeHandle"
:row-key="getRowKeys4"
border
style="width: 100%;">
<el-table-column 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="客户编码"></el-table-column>
<el-table-column prop="customerName" header-align="center" align="center" label="客户名称"></el-table-column>
</el-table>
</div>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="confirmCustomer">确认</el-button>
<el-button type="primary" @click="customerModelFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- sop文件清单 -->
<el-dialog title="文件清单" :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">上传文件</el-button>
</el-form-item>
<el-form-item label="检验类型" style="margin-left: 448px">
<el-select v-model="sopData.inspectionTypeNo" placeholder="请选择">
<el-option label="全部" 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">查询</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="操作">
<template slot-scope="scope">
<a @click="downloadFile(scope.row)">下载</a>
<a v-if="scope.row.orderReftype !== 'AttachmentList'" type="text" size="small" @click="deleteFile(scope.row)">删除</a>
</template>
</el-table-column>
</el-table>
</el-dialog>
<!-- 物料编码 -->
<el-dialog title="物料选择" @close="closeDialog" :close-on-click-modal="false" v-drag :visible.sync="partDisableFlag" width="685px" height="273px">
<el-form :inline="true" label-position="top" :model="partDetailData" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="物料编码">
<el-input v-model="partDetailData.partNo" clearable style="width: 137px"></el-input>
</el-form-item>
<el-form-item label="物料名称">
<el-input v-model="partDetailData.partDesc" clearable style="width: 137px"></el-input>
</el-form-item>
<!-- <el-form-item label="SKU">
<el-input v-model="partDetailData.sku" clearable style="width: 100px"></el-input>
</el-form-item> -->
<el-form-item label="规格型号">
<el-input v-model="partDetailData.spec" clearable style="width: 100px"></el-input>
</el-form-item>
<el-form-item label="PN">
<el-input v-model="partDetailData.cinvSourceCode" clearable style="width: 100px"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="searchPartInfo()" style="margin-top: 24px">查询</el-button>
</el-form-item>
</el-form>
<el-table
:height="400"
:data="partInfoList"
@row-dblclick="getRowData1"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
prop="partNo"
header-align="center"
align="center"
label="物料编码">
</el-table-column>
<el-table-column
prop="partDesc"
header-align="center"
align="center"
label="物料名称">
</el-table-column>
<el-table-column
prop="spec"
header-align="center"
align="center"
label="规格型号">
</el-table-column>
<el-table-column
prop="sku"
header-align="center"
align="center"
label="SKU">
</el-table-column>
<el-table-column
prop="cinvSourceCode"
header-align="center"
align="center"
label="PN">
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="partDisableFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 巡检特殊配置(按工序) -->
<el-dialog title="巡检特殊配置" :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">新增</el-button>
<el-button type="danger" size="small" icon="el-icon-delete" @click="deletePatrolConfigRows" :disabled="patrolConfigSelections.length === 0">删除</el-button>
<el-button type="success" size="small" icon="el-icon-upload2" @click="openPatrolConfigImport">导入</el-button>
</div>
<el-table
:data="patrolConfigList"
border
height="400px"
v-loading="patrolConfigLoading"
@selection-change="patrolConfigSelectionChange"
highlight-current-row
style="width: 100%">
<el-table-column type="selection" width="50" align="center"></el-table-column>
<el-table-column prop="operationDesc" label="工序" header-align="center" align="left" min-width="150">
<template slot-scope="scope">
<el-select v-model="scope.row.operationDesc" size="small" placeholder="请选择工序" 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="首次巡检时长(h)" 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="下次巡检时长(h)" 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="累计巡检时长(h)" 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="是否默认" 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="操作" header-align="center" align="center" width="80">
<template slot-scope="scope">
<el-button type="text" size="small" @click="savePatrolConfigRow(scope.row)">保存</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">保存</el-button>
<el-button @click="patrolConfigDialogFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<patrol-config-upload ref="patrolConfigUpload" @refreshPatrolConfig="getPatrolConfigList" v-drag></patrol-config-upload>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
<!-- 上传sop文件的modal -->
<qcSOPUploadFile ref="qcSOPUploadFile" @refreshPageTables="getFileContentList()" v-drag></qcSOPUploadFile>
<!-- 导入 -->
<qcUpload ref="qcUpload" @refreshPageTables="getDataList()" v-drag></qcUpload>
</div>
</template>
<script>
import {
qcPartAttributeSearch, // 查询物料属性
qcPartAttributeSave, // 新增物料属性
qcPartAttributeDelete, // 删除物料属性
qcPartAttributeEdit, // 修改物料属性
searchPartAttributeDetails, // 查询物料属性模板
savePartAttributeDetails, // 新增物料属性模板
deletePartAttributeDetails, // 删除物料属性模板
saveAttributeDetailed, // 新增物料属性模板详情
getPartTemplateLists, // 获取模板列表
inspectionTypeSearch, // 搜索所有检验类型
getOperationDescList, // 查询工序列表
getManufacturerList, // 查询供应商列表
getCustomerList, // 查询客户列表
getAllResourceList, // 查询机台列表
getSiteAndBuByUserName,
searchPartInfo, // 查询物料信息
partAttrDetailedSearch,
getPartAttrItemList,
getPartAttrItem,
addPartAttrItemDetails,
delPartAttrItemDetails,
savePartAttrDetailed,
syncPartAttrDetailedFromTemplate,
goUpPartAttrItem,
goDownPartAttrItem,
getPatrolConfigList as fetchPatrolConfigListApi,
savePatrolConfig as savePatrolConfigApi,
updatePatrolConfig as updatePatrolConfigApi,
deletePatrolConfig as deletePatrolConfigApi,
getPatrolOperationDescList as getPatrolOperationDescListApi,
getPartAttributeFileList
} from "@/api/qc/qc.js"
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
import Chooselist from '@/views/modules/common/Chooselist_eam'
import {downLoadObjectFile} from '@/api/eam/eam_object_list.js'
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
import {deleteObjectFile} from '@/api/eam/eam.js'
import qcUpload from "./qc_upload"
import qcSOPUploadFile from "./qc_SOP_upload_file"
import PatrolConfigUpload from './patrol_config_upload'
export default {
components: {
qcSOPUploadFile,
Chooselist,
qcUpload,
PatrolConfigUpload
},
data () {
return {
columnsProp:['createBy', 'updateBy'],
maintainFlagProps: ['iqcFlag', 'ipqcFlag', 'fqcFlag', 'oqcFlag', 'sqcFlag'],
// 是否收藏
favorite: false,
// 导出 start
exportData: [],
exportName: "根据物料设置检验模板" + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ["根据物料设置检验模板"],
exportFooter: [],
exportList: [],
// 导出 end
tagNo: '',
patrolConfigDialogFlag: false,
patrolConfigLoading: false,
patrolConfigList: [],
patrolConfigSelections: [],
operationDescList: [],
patrolConfigSaveLoading: false,
patrolContextRow: {
site: '',
buNo: '',
partNo: ''
},
searchData: {
site: '',
userName: this.$store.state.user.name,
partNo: '',
partDesc: '',
cinvSourceCode: '',
sku: '',
familyID: '',
familyName: '',
buDesc: '',
iqcFlag: '',
ipqcFlag: '',
fqcFlag: '',
oqcFlag: '',
sqcFlag: '',
attributeType: 'A',
page: 1,
limit: 10,
},
height: 200,
pageIndex: 1,
pageSize: 20,
totalPage: 0,
modalFlag: false,
modalDisableFlag: false,
partDisableFlag: false,
modalData: {
site: '',
bu: '',
flag: '',
partNo: '',
partDesc: '',
familyID: '',
familyName: '',
cinvSourceCode: '',
sku: '',
umid: '',
supplierNo: '',
supplierDesc: '',
attributeRemark: '',
createTime: '',
createBy: this.$store.state.user.name,
attributeType: 'A',
exemptInspection: 'N',
iqcExempt: 'N',
faiExempt: 'N',
ipqcExempt: 'N',
pqcExempt: 'N',
fqcExempt: 'N',
oqcExempt: 'N',
sqcExempt: 'N'
},
detailData: {
site: '',
buNo: '',
partNo: '',
attributeNo: '',
partDesc: '',
cinvSourceCode: '',
sku: '',
attributeType: 'A',
inspectionTypeNo: '',
templateId: '',
templateName: '',
createBy: this.$store.state.user.name
},
standardDetailModelFlag: false,
standardFastAddFlag: false,
standardDetailList: [],
standardItemList1: [],
standardItemList2: [],
standardItemSelections1: [],
standardItemSelections2: [],
standardCurrentRow: {},
standardDetailData: {
site: '',
buNo: '',
partNo: '',
partDesc: '',
attributeNo: '',
attributeType: 'A',
itemType: 'D',
itemNo: '',
itemDesc: '',
inspectionTypeNo: '',
inspectionTypeName: '',
createBy: this.$store.state.user.name
},
standardColumnDetailList: [
{
columnProp: 'itemNo',
headerAlign: 'center',
align: 'center',
columnLabel: '检验项目编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 80
},
{
columnProp: 'itemDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '检验项目名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 250
},
{
columnProp: 'valueType',
headerAlign: 'center',
align: 'center',
columnLabel: '检测值类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 90
}
],
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: '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: '301003Table1DefaultValue',
tableId: "301003Table1",
tableName: "物料属性设置表",
columnProp: 'defaultValue',
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: '301003Table1StandardValue',
tableId: "301003Table1",
tableName: "物料属性设置表",
columnProp: 'standardValue',
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: '301003Table1MaxValue',
tableId: "301003Table1",
tableName: "物料属性设置表",
columnProp: 'maxValue',
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: '301003Table1MinValue',
tableId: "301003Table1",
tableName: "物料属性设置表",
columnProp: 'minValue',
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: '301003Table1FirstIPQCPatrolTime',
tableId: "301003Table1",
tableName: "物料属性设置表",
columnProp: 'firstIPQCPatrolTime',
headerAlign: "center",
align: "left",
columnLabel: '首次巡检时间(h)',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003Table1LastIPQCPatrolTime',
tableId: "301003Table1",
tableName: "物料属性设置表",
columnProp: 'lastIPQCPatrolTime',
headerAlign: "center",
align: "left",
columnLabel: '下次巡检时间(h)',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003Table1CycleIPQCPatrolTime',
tableId: "301003Table1",
tableName: "物料属性设置表",
columnProp: 'cycleIPQCPatrolTime',
headerAlign: "center",
align: "left",
columnLabel: '累计巡检时间(h)',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003Table1IqcFlag',
tableId: "301003Table1",
tableName: "物料属性设置表",
columnProp: 'iqcFlag',
headerAlign: "center",
align: "center",
columnLabel: 'IQC',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 90,
},
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003Table1IpqcFlag',
tableId: "301003Table1",
tableName: "物料属性设置表",
columnProp: 'ipqcFlag',
headerAlign: "center",
align: "center",
columnLabel: 'IPQC',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 90,
},
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003Table1FqcFlag',
tableId: "301003Table1",
tableName: "物料属性设置表",
columnProp: 'fqcFlag',
headerAlign: "center",
align: "center",
columnLabel: 'FQC',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 90,
},
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003Table1OqcFlag',
tableId: "301003Table1",
tableName: "物料属性设置表",
columnProp: 'oqcFlag',
headerAlign: "center",
align: "center",
columnLabel: 'OQC',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 90,
},
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003Table1SqcFlag',
tableId: "301003Table1",
tableName: "物料属性设置表",
columnProp: 'sqcFlag',
headerAlign: "center",
align: "center",
columnLabel: 'SQC',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 90,
},
// {
// userId: this.$store.state.user.name,
// functionId: 301003,
// serialNumber: '301003Table1CinvSourceCode',
// tableId: "301003Table1",
// tableName: "物料属性设置表",
// columnProp: 'cinvSourceCode',
// headerAlign: "center",
// align: "center",
// columnLabel: 'PN',
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: '',
// columnWidth: 120,
// },
// {
// userId: this.$store.state.user.name,
// functionId: 301003,
// serialNumber: '301003Table1FamilyName',
// tableId: "301003Table1",
// tableName: "物料属性设置表",
// columnProp: 'familyName',
// 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: '301003Table1Umid',
// tableId: "301003Table1",
// tableName: "物料属性设置表",
// columnProp: 'umid',
// 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: '301003Table1ExemptInspection',
tableId: "301003Table1",
tableName: "物料属性设置表",
columnProp: 'exemptInspection',
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: '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,
},
],
detailModelFlag: false,
detailList: [],
dataList: [],
dataListLoading: false,
ipqcInspectionMethodOptions: ['首件检', '自检', '巡检', '末件检'],
iqcInspectionMethodOptions: ['材料进货检验', '刀模进货检验-外观', '刀模进货检验-上机', '刀模维修检验-外观', '刀模维修检验-上机'],
// 展示列集
columnDetailList: [
{
userId: this.$store.state.user.name,
functionId: 301003,
serialNumber: '301003Table2TemplateId',
tableId: "301003Table2",
tableName: "检验模板清单表",
columnProp: 'templateId',
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: '301003Table2TemplateName',
tableId: "301003Table2",
tableName: "检验模板清单表",
columnProp: 'templateName',
headerAlign: "center",
align: "left",
columnLabel: '模板名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 250,
},
{
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: '301003Table2TemplateVersion',
tableId: "301003Table2",
tableName: "检验模板清单表",
columnProp: 'templateVersion',
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: '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: '301003Table2Operation',
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: '301003Table2ResourceID',
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,
},
],
// 快速添加
fastAddFlag: false,
itemList1: [],
itemList2: [],
itemList1Loading: false,
itemList2Loading: false,
addItemLoading: false,
deleteItemLoading: false,
itemListRow1: {},
itemListRow2: {},
tempLevelRow: '',
tempProgrammeRow: '',
options: [],
itemSelections1: [],
itemSelections2: [],
rules: {
site:[
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
partNoType:[
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
partDescType:[
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
bu: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
]
},
// 工序
operationList: [],
resourceList: [],
operationModelFlag: false,
resourceModelFlag: false,
dataListOperationSelections: [],
operationData: {
operationDesc: '',
inspectionTypeNo: ''
},
resourceData: {
site: '',
resourceId: '',
resourceDesc: ''
},
operation: '',
resourceId: '',
selectionManufacturer: [],
selectionManufacturer2: [],
selectionCustomer: [],
selectionCustomer2: [],
span1: 12,
span2: 12,
span3: 12,
operationSelections: [],
resourceSelections: [],
// 供应商
manufacturerList: [],
manufacturerModelFlag: false,
dataListManufacturerSelections: [],
manufacturerData: {
site: '',
manufacturerID: '',
manufacturerName: ''
},
customerData: {
site: '',
customerID: '',
customerName: ''
},
customerModelFlag: false,
customerList: [],
dataListCustomerSelections: [],
// 单选框绑定的值
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: [],
partInfoList: [],
partDetailData: {
bu: '',
partNo: '',
partDesc: '',
seqNo: '',
sku: '',
spec:'',
cinvSourceCode:'',
},
authSearch: false,
authSave: false,
authUpdate: false,
authDelete: false,
authDetail: false,
authCheckout: false,
authFile: false,
menuId: this.$route.meta.menuId,
}
},
computed: {
maintainStatusOptions () {
return [
{ label: '已维护', value: '已维护' },
{ label: '未维护', value: '未维护' }
]
},
detailColumnsBeforeIpqc () {
const list = Array.isArray(this.columnDetailList) ? this.columnDetailList : []
const idx = list.findIndex(i => i.columnProp === 'inspectionTypeName')
if (idx === -1) return list
return list.slice(0, idx + 1)
},
detailColumnsAfterIpqc () {
const list = Array.isArray(this.columnDetailList) ? this.columnDetailList : []
const idx = list.findIndex(i => i.columnProp === 'inspectionTypeName')
if (idx === -1) return []
return list.slice(idx + 1)
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 180
})
},
created () {
// 按钮控制
this.getButtonAuthData()
// 获取用户的 site 和 bu
// this.getSiteAndBuByUserName()
// 校验用户是否收藏
// this.favoriteIsOk()
// 获取检验类型
this.inspectionTypeSearch()
// 动态列
// this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
// this.getTableUserColumn(this.$route.meta.menuId+'table2',2)
if (!this.authSearch) {
// 获取数据列表
this.getDataList()
}
},
methods: {
isMaintained (val) {
return val === '已维护'
},
// 获取用户的bu
getSiteAndBuByUserName () {
let tempData = {
username: this.$store.state.user.name,
}
getSiteAndBuByUserName(tempData).then(({data}) => {
if (data.code === 0) {
this.userBuList = data.rows
}
})
},
searchPartInfo () {
this.partDetailData.site = this.modalData.site
if (!this.partDetailData.partNo && !this.partDetailData.partDesc && !this.partDetailData.spec && !this.partDetailData.cinvSourceCode) {
this.partInfoList = []
this.partDisableFlag = true
}else {
searchPartInfo(this.partDetailData).then(({data}) => {
if (data.code === 0) {
this.partInfoList = data.rows
this.partDisableFlag = true
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}
},
// 查询检验类型
inspectionTypeSearch () {
let tempData = {
site: this.$store.state.user.site
}
inspectionTypeSearch(tempData).then(({data}) => {
if (data.code === 0) {
this.options = data.rows
}
})
},
isIPQCInspectionType (row) {
const name = (row && row.inspectionTypeName) ? String(row.inspectionTypeName) : ''
const no = (row && row.inspectionTypeNo) ? String(row.inspectionTypeNo) : ''
return name.toUpperCase().includes('IPQC') || no.toUpperCase().includes('IPQC') || no === '101'
},
isIQCInspectionType (row) {
const name = (row && row.inspectionTypeName) ? String(row.inspectionTypeName) : ''
const no = (row && row.inspectionTypeNo) ? String(row.inspectionTypeNo) : ''
return name.toUpperCase().includes('IQC') || no.toUpperCase().includes('IQC') || no === '105'
},
isInspectionMethodApplicable (row) {
return this.isIPQCInspectionType(row) || this.isIQCInspectionType(row)
},
getInspectionMethodOptions (row) {
if (this.isIQCInspectionType(row)) {
return this.iqcInspectionMethodOptions
}
return this.ipqcInspectionMethodOptions
},
normalizeIpqcInspectionMethod (row) {
if (!row) return
if (this.isIPQCInspectionType(row)) {
if (row.ipqcInspectionMethod && this.ipqcInspectionMethodOptions.indexOf(row.ipqcInspectionMethod) === -1) {
this.$set(row, 'ipqcInspectionMethod', '')
}
} else if (this.isIQCInspectionType(row)) {
if (row.ipqcInspectionMethod && this.iqcInspectionMethodOptions.indexOf(row.ipqcInspectionMethod) === -1) {
this.$set(row, 'ipqcInspectionMethod', '')
}
} else {
if (row.ipqcInspectionMethod) {
this.$set(row, 'ipqcInspectionMethod', '')
}
}
},
normalizeDetailListIpqcInspectionMethod () {
if (!Array.isArray(this.detailList)) return
this.detailList.forEach(r => this.normalizeIpqcInspectionMethod(r))
},
chooseLevel (row) {
this.tempLevelRow = row
this.getBaseList(208)
},
chooseProgrammeRow (row) {
this.tempProgrammeRow = row
this.getBaseList(207)
},
// 获取基础数据列表S
getBaseList (val,type) {
this.tagNo = val
this.$nextTick(() => {
let strVal = ''
// if (val === 507) {
// strVal = this.modalData.partNo
// this.$refs.baseList.init(val, strVal)
// }
if (val === 208) {
strVal = this.tempLevelRow.samplingLevelNo
this.$refs.baseList.init(val, strVal)
}
if (val === 207) {
strVal = this.tempProgrammeRow.samplingProgrammeNo
this.$refs.baseList.init(val, strVal)
}
if (val === 1056) {
strVal = this.modalData.supplierNo
this.$refs.baseList.init(val, strVal)
}
})
},
// 列表方法的回调
getBaseData (val) {
if (this.tagNo === 507) {
this.modalData.partNo = val.part_no
this.modalData.partDesc = val.part_desc
}
if (this.tagNo === 208) {
this.tempLevelRow.samplingLevelNo = val.sampling_level_no
this.tempLevelRow.samplingLevelDesc = val.sampling_level_desc
}
if (this.tagNo === 207) {
this.tempProgrammeRow.samplingProgrammeNo = val.sampling_programme_no
this.tempProgrammeRow.samplingProgrammeDesc = val.sampling_programme_desc
}
if (this.tagNo === 1056) {
this.modalData.supplierNo = val.supplier_id
this.modalData.supplierDesc = val.supplier_name
}
},
// 获取数据列表
getDataList () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
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
}
})
},
patrolInspection (row) {
this.patrolContextRow = {
site: row.site,
buNo: row.buNo,
partNo: row.partNo
}
this.patrolConfigDialogFlag = true
this.getPatrolConfigList()
this.loadPatrolOperationDescList()
},
loadPatrolOperationDescList () {
const params = {
site: this.patrolContextRow.site,
userName: this.$store.state.user.name
}
getPatrolOperationDescListApi(params).then(({ data }) => {
if (data && data.code === 0) {
this.operationDescList = data.rows || []
}
})
},
getPatrolConfigList () {
this.patrolConfigLoading = true
const params = {
site: this.patrolContextRow.site,
buNo: this.patrolContextRow.buNo,
partNo: this.patrolContextRow.partNo
}
fetchPatrolConfigListApi(params).then(({ data }) => {
if (data && data.code === 0) {
this.patrolConfigList = data.rows || []
} else {
this.$message.error((data && data.msg) || '获取巡检配置失败')
}
this.patrolConfigLoading = false
}).catch(() => {
this.patrolConfigLoading = false
})
},
patrolConfigSelectionChange (selections) {
this.patrolConfigSelections = selections
},
addPatrolConfig () {
this.patrolConfigList.push({
site: this.patrolContextRow.site,
buNo: this.patrolContextRow.buNo,
partNo: this.patrolContextRow.partNo,
operationDesc: '',
firstInspectionDuration: 0,
nextInspectionDuration: 0,
totalInspectionDuration: 0,
defaultFlag: 'N',
isNew: true
})
},
savePatrolConfigRow (row) {
if (!row.operationDesc) {
this.$message.warning('请输入工序')
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) {
savePatrolConfigApi(params).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('保存成功')
this.getPatrolConfigList()
} else {
this.$message.error((data && data.msg) || '保存失败')
}
})
} else {
updatePatrolConfigApi(params).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('更新成功')
this.getPatrolConfigList()
} else {
this.$message.error((data && data.msg) || '更新失败')
}
})
}
},
deletePatrolConfigRows () {
if (this.patrolConfigSelections.length === 0) {
this.$message.warning('请选择要删除的数据')
return
}
this.$confirm('确定删除选中的配置吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
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
}))
}
deletePatrolConfigApi(params).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('删除成功')
this.getPatrolConfigList()
} else {
this.$message.error((data && data.msg) || '删除失败')
}
})
}).catch(() => {})
},
handleDefaultFlagChange (row) {
if (row.defaultFlag === 'Y') {
this.patrolConfigList.forEach(item => {
if (item !== row) {
item.defaultFlag = 'N'
}
})
}
},
batchSavePatrolConfig () {
if (this.patrolConfigList.length === 0) {
this.$message.warning('没有需要保存的数据')
return
}
for (let i = 0; i < this.patrolConfigList.length; i++) {
const item = this.patrolConfigList[i]
if (!item.operationDesc) {
this.$message.warning(`第${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 savePatrolConfigApi(params).then(({ data }) => {
if (data && data.code === 0) {
successCount++
row.isNew = false
} else {
errorCount++
}
}).catch(() => {
errorCount++
})
} else {
return updatePatrolConfigApi(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('保存成功')
} else {
this.$message.warning(`保存完成,成功${successCount}条,失败${errorCount}条`)
}
this.getPatrolConfigList()
})
},
openPatrolConfigImport () {
const params = {
site: this.patrolContextRow.site,
buNo: this.patrolContextRow.buNo,
partNo: this.patrolContextRow.partNo
}
this.$refs.patrolConfigUpload.init(params)
},
getRowData1 (row) {
this.modalData.sku = row.sku
this.modalData.cinvSourceCode = row.cinvSourceCode
this.modalData.partNo = row.partNo
this.modalData.partDesc = row.partDesc
this.partDisableFlag = false
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
addModal () {
this.modalData = {
site: this.$store.state.user.site,
buNo: '*',
// bu: this.userBuList[0].buNo,
flag: '1',
partNo: '',
partDesc: '',
familyID: '',
familyName: '',
umid: '',
supplierNo: '',
supplierDesc: '',
attributeRemark: '',
createTime: '',
updateBy: this.$store.state.user.name,
createBy: this.$store.state.user.name,
attributeType: 'A',
defaultValue: '',
standardValue: '',
maxValue: '',
minValue: '',
firstIPQCPatrolTime: '',
lastIPQCPatrolTime: '',
cycleIPQCPatrolTime: '',
exemptInspection: 'N',
iqcExempt: 'N',
faiExempt: 'N',
ipqcExempt: 'N',
pqcExempt: 'N',
fqcExempt: 'N',
oqcExempt: 'N',
sqcExempt: 'N'
}
this.modalDisableFlag = false
this.modalFlag = true
},
updateModal (row) {
this.modalData = {
site: row.site,
bu: row.site + '_' + row.buNo,
flag: '2',
partNo: row.partNo,
partDesc: row.partDesc,
familyID: row.familyID,
familyName: row.familyName,
umid: row.umid,
supplierNo: row.supplierNo,
supplierDesc: row.supplierDesc,
attributeRemark: row.attributeRemark,
updateBy: this.$store.state.user.name,
createBy: this.$store.state.user.name,
attributeType: 'A',
defaultValue: row.defaultValue,
standardValue: row.standardValue,
maxValue: row.maxValue,
minValue: row.minValue,
firstIPQCPatrolTime: row.firstIPQCPatrolTime,
lastIPQCPatrolTime: row.lastIPQCPatrolTime,
cycleIPQCPatrolTime: row.cycleIPQCPatrolTime,
exemptInspection: row.exemptInspection || 'N',
iqcExempt: row.iqcExempt || 'N',
faiExempt: row.faiExempt || 'N',
ipqcExempt: row.ipqcExempt || 'N',
pqcExempt: row.pqcExempt || 'N',
fqcExempt: row.fqcExempt || 'N',
oqcExempt: row.oqcExempt || 'N',
sqcExempt: row.sqcExempt || 'N'
}
this.modalDisableFlag = true
this.modalFlag = true
},
// 删除
deletePropertiesModel (row) {
this.$confirm(`是否删除这个检验模板?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
qcPartAttributeDelete(row).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
},
saveData () {
if (this.modalData.site === '' || this.modalData.site == null) {
this.$message.warning('请填写工厂编码!')
return
}
if (this.modalData.partNo === '' || this.modalData.partNo == null) {
this.$message.warning('请选择物料编码!')
return
}
if (this.modalData.partDesc === '' || this.modalData.partDesc == null) {
this.$message.warning('请选择物料名称!')
return
}
// let obj = document.getElementsByName('isExemptInspection')
// let s = ''
// for (let i = 0; i < obj.length; i++) {
// if (obj[i].checked) {
// s += obj[i].value + ','
// }
// }
// s = s.substring(0, s.length - 1)
// this.modalData.exemptInspection = s
if (this.modalData.flag === '1') {
qcPartAttributeSave(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
} else {
qcPartAttributeEdit(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}
},
// 保存属性模板
saveDetail () {
// IPQC / IQC 的检验方式必填
this.normalizeDetailListIpqcInspectionMethod()
const missingMethod = (this.detailList || []).find(r => this.isInspectionMethodApplicable(r) && !r.ipqcInspectionMethod)
if (missingMethod) {
this.$message.warning('检验类型为IPQC或IQC时,“检验方式”为必填!')
return
}
for (let i = 0; i < this.detailList.length; i++) {
this.detailList[i].updateBy = this.$store.state.user.name
saveAttributeDetailed(this.detailList[i]).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.detailModelFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
}).then(() => {
return false
})
}
})
}
},
// 打开物料模板清单
detailModal (row) {
this.detailData.site = row.site
this.detailData.buNo = row.buNo
this.detailData.partNo = row.partNo
this.detailData.attributeNo = row.partNo
this.detailData.partDesc = row.partDesc
this.$set(this.detailData, 'inspectionTypeNo', '')
searchPartAttributeDetails(this.detailData).then(({data}) => {
this.detailList = data.rows
this.normalizeDetailListIpqcInspectionMethod()
})
this.detailModelFlag = true
},
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 === '110') {
this.span1 = 12
this.span2 = 12
} else {
this.span1 = 24
}
},
checkInspectionType2 () {
this.refreshTemplateLists()
},
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
})
},
// 快速新增(与 boying-vue 一致)
addFastModal () {
if (!this.detailData.partNo || !this.detailData.site) {
this.$message.warning('请先选择要设置模板的物料!')
return
}
if (!this.options || this.options.length === 0) {
this.$message.warning('检验类型数据加载中,请稍后再试')
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 === '110') {
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
this.$nextTick(() => {
this.refreshTemplateLists()
})
},
// 可选项目
itemClickRow1 (row) {
if (this.$refs.itemTable1) {
this.$refs.itemTable1.toggleRowSelection(row)
}
},
// 已有项目
itemClickRow2 (row) {
if (this.$refs.itemTable2) {
this.$refs.itemTable2.toggleRowSelection(row)
}
},
selectFlag () {
return true
},
selectionItem1 (val) {
this.itemSelections1 = val
},
selectionItem2 (val) {
this.itemSelections2 = val
},
// 添加模板
addItem () {
if (this.itemSelections1 == null || this.itemSelections1.length === 0) {
this.$message.warning('请选择可选模板!')
return
}
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('如果选择机台,必须要选择工序!')
return
}
}
this.addItemLoading = true
let inData = {
site: this.detailData.site,
buNo: this.detailData.buNo,
attributeNo: this.detailData.partNo,
itemList: this.itemSelections1,
operationList: this.operationSelections.map(item => item.operationDesc),
resourceIDList: this.resourceSelections.map(item => item.resourceId),
manufacturerList: this.selectionManufacturer || [],
customerList: this.selectionCustomer || [],
attributeType: this.detailData.attributeType || 'A',
inspectionTypeNo: this.detailData.inspectionTypeNo,
updateBy: this.$store.state.user.name
}
savePartAttributeDetails(inData).then(({data}) => {
if (data && data.code === 0) {
this.$message.success('添加成功!')
this.refreshTemplateLists()
this.itemSelections1 = []
this.operationSelections = []
this.resourceSelections = []
this.selectionManufacturer = []
this.selectionManufacturer2 = []
this.selectionCustomer = []
this.selectionCustomer2 = []
} else {
this.$message.error(data && data.msg ? data.msg : '添加失败')
}
}).catch(err => {
this.$message.error('添加失败:' + (err.message || '未知错误'))
}).finally(() => {
this.addItemLoading = false
})
},
// 删除模板
deleteItem () {
if (this.itemSelections2 == null || this.itemSelections2.length === 0) {
this.$message.warning('请选择已有模板!')
return
}
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.refreshTemplateLists()
this.itemSelections2 = []
} else {
this.$message.error(data && data.msg ? data.msg : '删除失败')
}
}).catch(err => {
this.$message.error('删除失败:' + (err.message || '未知错误'))
}).finally(() => {
this.deleteItemLoading = false
})
},
// 关闭后刷新列表
refreshDetailList () {
this.$set(this.detailData, 'inspectionTypeNo', '')
searchPartAttributeDetails(this.detailData).then(({data}) => {
this.detailList = data.rows
this.normalizeDetailListIpqcInspectionMethod()
})
},
syncStandardInspectionTypeName () {
const o = this.options.find(i => i.inspectionTypeNo === this.standardDetailData.inspectionTypeNo)
if (o) {
this.standardDetailData.inspectionTypeName = o.inspectionTypeName
}
},
standardDetailModal (row) {
this.standardDetailData.site = row.site
this.standardDetailData.buNo = row.buNo
this.standardDetailData.partNo = row.partNo
this.standardDetailData.partDesc = row.partDesc
this.standardDetailData.attributeNo = row.partNo
this.standardDetailData.attributeType = 'A'
this.standardDetailData.itemType = 'D'
if (this.options && this.options.length > 0) {
this.standardDetailData.inspectionTypeNo = this.options[0].inspectionTypeNo
this.standardDetailData.inspectionTypeName = this.options[0].inspectionTypeName
}
partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
if (data.code === 0) {
this.standardDetailList = data.rows || []
}
})
this.standardDetailModelFlag = true
},
closeStandardDialog () {
this.standardDetailList = []
this.standardItemList1 = []
this.standardItemList2 = []
},
standardAddFastModal () {
this.syncStandardInspectionTypeName()
this.standardItemSelections1 = null
this.standardItemSelections2 = null
getPartAttrItemList(this.standardDetailData).then(({data}) => {
if (data.code === 0) {
this.standardItemList1 = data.row1 || []
this.standardItemList2 = data.row2 || []
}
})
this.standardFastAddFlag = true
},
standardSyncFromTemplate () {
const queryData = {
site: this.standardDetailData.site,
buNo: this.standardDetailData.buNo,
attributeNo: this.standardDetailData.attributeNo,
attributeType: 'A'
}
searchPartAttributeDetails(queryData).then(({data}) => {
const templates = (data.rows || []).filter(t => t.templateId)
if (templates.length === 0) {
this.$message.warning('没有已维护的检验模板,请先在检验模板清单中维护!')
return
}
const seen = new Set()
const uniqueTemplates = templates.filter(t => {
if (seen.has(t.templateId)) return false
seen.add(t.templateId)
return true
})
this.$confirm(`将根据全部检验类型下 ${uniqueTemplates.length} 个检验模板同步检验项目,已存在的项目将跳过,是否继续?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const syncPromises = uniqueTemplates.map(t => syncPartAttrDetailedFromTemplate({
site: this.standardDetailData.site,
buNo: this.standardDetailData.buNo,
attributeNo: this.standardDetailData.attributeNo,
attributeType: 'A',
templateId: t.templateId,
inspectionTypeNo: t.inspectionTypeNo,
updateBy: this.$store.state.user.name
}))
return Promise.all(syncPromises)
}).then((results) => {
const failed = (results || []).filter(r => r && r.data && r.data.code !== 0)
if (failed.length > 0) {
this.$alert((failed[0].data && failed[0].data.msg) || '部分模板同步失败', '错误', { confirmButtonText: '确定' })
} else {
this.$message.success('同步成功')
}
this.standardRefreshDetailList()
}).catch(() => {})
})
},
standardGetItem () {
this.syncStandardInspectionTypeName()
getPartAttrItem(this.standardDetailData).then(({data}) => {
if (data.code === 0) {
this.standardItemList1 = data.rows || []
}
})
},
standardItemClickRow (row) {
this.standardCurrentRow = JSON.parse(JSON.stringify(row))
},
standardItemClickRow1 (row) {
this.$refs.standardItemTable1.toggleRowSelection(row)
},
standardItemClickRow2 (row) {
this.$refs.standardItemTable2.toggleRowSelection(row)
},
standardSelectionItem1 (val) {
this.standardItemSelections1 = val
},
standardSelectionItem2 (val) {
this.standardItemSelections2 = val
},
standardAddItem () {
if (this.standardItemSelections1 == null || this.standardItemSelections1.length === 0) {
this.$message.warning('请选择可选项目!')
return
}
if (!this.standardDetailData.inspectionTypeName) {
this.syncStandardInspectionTypeName()
}
let inData = {
site: this.standardDetailData.site,
buNo: this.standardDetailData.buNo,
attributeNo: this.standardDetailData.attributeNo,
attributeType: 'A',
inspectionTypeNo: this.standardDetailData.inspectionTypeNo,
itemType: this.standardDetailData.itemType,
updateBy: this.$store.state.user.name,
itemList: this.standardItemSelections1
}
addPartAttrItemDetails(inData).then(({data}) => {
if (data && data.code === 0) {
getPartAttrItemList(this.standardDetailData).then(({data}) => {
if (data.code === 0) {
this.standardItemList1 = data.row1 || []
this.standardItemList2 = data.row2 || []
}
})
this.standardItemSelections1 = []
this.$message.success('操作成功')
} else {
this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
}
})
},
standardDeleteItem () {
if (this.standardItemSelections2 == null || this.standardItemSelections2.length === 0) {
this.$message.warning('请选择已有项目!')
return
}
let inData = {
site: this.standardDetailData.site,
buNo: this.standardDetailData.buNo,
attributeNo: this.standardDetailData.attributeNo,
attributeType: 'A',
updateBy: this.$store.state.user.name,
itemList: this.standardItemSelections2
}
delPartAttrItemDetails(inData).then(({data}) => {
if (data && data.code === 0) {
getPartAttrItemList(this.standardDetailData).then(({data}) => {
if (data.code === 0) {
this.standardItemList1 = data.row1 || []
this.standardItemList2 = data.row2 || []
}
})
this.standardItemSelections2 = []
this.$message.success('操作成功')
} else {
this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
}
})
},
standardRefreshDetailList () {
partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
if (data.code === 0) {
this.standardDetailList = data.rows || []
}
})
},
saveStandardDetail () {
let tempData = {
site: this.standardDetailData.site,
buNo: this.standardDetailData.buNo,
attributeNo: this.standardDetailData.attributeNo,
attributeType: 'A',
inspectionTypeNo: this.standardDetailData.inspectionTypeNo,
updateBy: this.$store.state.user.name,
itemList: this.standardDetailList
}
savePartAttrDetailed(tempData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.standardDetailModelFlag = false
this.$message.success('操作成功')
} else {
this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
}
})
},
standardDelItemDetails (row) {
this.$confirm('是否删除该检验项目?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delPartAttrItemDetails({
site: this.standardDetailData.site,
buNo: this.standardDetailData.buNo,
attributeNo: this.standardDetailData.attributeNo,
attributeType: 'A',
updateBy: this.$store.state.user.name,
itemList: [row]
}).then(({data}) => {
if (data && data.code === 0) {
partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
if (data.code === 0) {
this.standardDetailList = data.rows || []
}
})
this.$message.success('操作成功')
} else {
this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
}
})
}).catch(() => {})
},
standardGoUp () {
if (!this.standardCurrentRow || !this.standardCurrentRow.itemNo) {
this.$message.warning('请先点击表格选择一行')
return
}
const row = {
...this.standardCurrentRow,
site: this.standardDetailData.site,
buNo: this.standardDetailData.buNo,
attributeNo: this.standardDetailData.attributeNo
}
goUpPartAttrItem(row).then(({data}) => {
if (data && data.code === 0) {
partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
if (data.code === 0) {
this.standardDetailList = data.rows || []
for (let i = 0; i < this.standardDetailList.length; i++) {
if (this.standardDetailList[i].itemNo === row.itemNo) {
this.$refs.standardDetailTable.setCurrentRow(this.standardDetailList[i])
this.standardCurrentRow = JSON.parse(JSON.stringify(this.standardDetailList[i]))
break
}
}
this.$message.success('操作成功')
}
})
}
})
},
standardGoDown () {
if (!this.standardCurrentRow || !this.standardCurrentRow.itemNo) {
this.$message.warning('请先点击表格选择一行')
return
}
const row = {
...this.standardCurrentRow,
site: this.standardDetailData.site,
buNo: this.standardDetailData.buNo,
attributeNo: this.standardDetailData.attributeNo
}
goDownPartAttrItem(row).then(({data}) => {
if (data && data.code === 0) {
partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
if (data.code === 0) {
this.standardDetailList = data.rows || []
for (let i = 0; i < this.standardDetailList.length; i++) {
if (this.standardDetailList[i].itemNo === row.itemNo) {
this.$refs.standardDetailTable.setCurrentRow(this.standardDetailList[i])
this.standardCurrentRow = JSON.parse(JSON.stringify(this.standardDetailList[i]))
break
}
}
this.$message.success('操作成功')
}
})
}
})
},
// 删除物料属性中的模板
deletePartAttributeDetails (row) {
this.$confirm(`是否删除这个检验模板?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deletePartAttributeDetails(row).then(({data}) => {
if (data && data.code === 0) {
searchPartAttributeDetails(this.detailData).then(({data}) => {
this.detailList = data.rows
this.normalizeDetailListIpqcInspectionMethod()
})
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
},
// 校验用户是否收藏
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
})
}
},
//导出excel
async createExportData() {
this.searchData.limit = -1
this.searchData.page = 1
await qcPartAttributeSearch(this.searchData).then(({data}) => {
this.exportList= data.page.list
})
return this.exportList
},
startDownload() {},
finishDownload() {},
fields () {
let json = "{"
this.columnList.forEach((item, index) => {
if (index == this.columnList.length - 1) {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
} else {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
}
})
json += "}"
let s = eval("(" + json + ")")
return s
},
// 导入
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.operationData.inspectionTypeNo = this.detailData.inspectionTypeNo
getOperationDescList(this.operationData).then(({data}) => {
if (data && data.code === 0) {
this.operationList = data.rows
this.operationModelFlag = true
} else {
this.$message.error(data.msg)
}
})
},
// 获取机台列表
getAllResourceList () {
this.resourceData.site = this.detailData.site
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.operationData.inspectionTypeNo = this.detailData.inspectionTypeNo
getOperationDescList(this.operationData).then(({data}) => {
if (data && data.code === 0) {
this.operationList = data.rows
} else {
this.$message.error(data.msg)
}
})
},
getAllResourceList2 () {
this.resourceData.site = this.detailData.site
getAllResourceList(this.resourceData).then(({data}) => {
if (data && data.code === 0) {
this.resourceList = data.rows
} else {
this.$message.error(data.msg)
}
})
},
selectionOperationChangeHandle (val) {
this.operationSelections = val
},
operationSelect () {},
getRowKeys (row) {
return row.operationDesc
},
selectionResourceChangeHandle (val) {
this.resourceSelections = val
},
resourceSelect () {},
getRowKeys2 (row) {
return row.resourceId
},
confirmOperation () {
this.operationModelFlag = false
},
confirmResource () {
this.resourceModelFlag = false
},
getManufacturerList () {
this.manufacturerData.site = this.detailData.site
getManufacturerList(this.manufacturerData).then(({data}) => {
if (data && data.code === 0) {
this.manufacturerList = data.rows
this.$nextTick(() => this.$refs.manufacturerTable.clearSelection())
let tempDataList = this.selectionManufacturer
this.manufacturerList.forEach(val => {
if (tempDataList.includes(val.manufacturerID)) {
this.$nextTick(() => this.$refs.manufacturerTable.toggleRowSelection(val, true))
}
})
this.manufacturerModelFlag = true
} else {
this.$message.error(data.msg)
}
})
},
getManufacturerList2 () {
this.manufacturerData.site = this.detailData.site
getManufacturerList(this.manufacturerData).then(({data}) => {
if (data && data.code === 0) {
this.manufacturerList = data.rows
let tempDataList = this.selectionManufacturer
this.manufacturerList.forEach(val => {
if (tempDataList.includes(val.manufacturerID)) {
this.$nextTick(() => this.$refs.manufacturerTable.toggleRowSelection(val, true))
}
})
} else {
this.manufacturerList = []
}
})
},
getRowKeys3 (row) {
return row.manufacturerID
},
manufacturerClickRow (row) {
this.$refs.manufacturerTable.toggleRowSelection(row)
},
selectionManufacturerChangeHandle (val) {
this.dataListManufacturerSelections = val
},
confirmManufacturer () {
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.customerData.site = this.detailData.site
getCustomerList(this.customerData).then(({data}) => {
if (data && data.code === 0) {
this.customerList = data.rows
this.$nextTick(() => this.$refs.customerTable.clearSelection())
let tempDataList = this.selectionCustomer
this.customerList.forEach(val => {
if (tempDataList.includes(val.customerID)) {
this.$nextTick(() => this.$refs.customerTable.toggleRowSelection(val, true))
}
})
this.customerModelFlag = true
} else {
this.$message.error(data.msg)
}
})
},
getCustomerList2 () {
this.customerData.site = this.detailData.site
getCustomerList(this.customerData).then(({data}) => {
if (data && data.code === 0) {
this.customerList = data.rows
let tempDataList = this.selectionCustomer
this.customerList.forEach(val => {
if (tempDataList.includes(val.customerID)) {
this.$nextTick(() => this.$refs.customerTable.toggleRowSelection(val, true))
}
})
} else {
this.customerList = []
}
})
},
customerClickRow (row) {
this.$refs.customerTable.toggleRowSelection(row)
},
selectionCustomerChangeHandle (val) {
this.dataListCustomerSelections = val
},
getRowKeys4 (row) {
return row.customerID
},
confirmCustomer () {
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,
}
getPartAttributeFileList(tempData).then(({data}) => {
if (data && data.code === 200) {
this.sopList = data.rows
} else {
this.sopList = []
}
})
this.sopFileModelFlag = true
},
// 上传sop文件模态框
uploadSopFile () {
let currentData = {
titleCon: '文件上传',
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) {
if (row.orderReftype === 'AttachmentList') {
const linkNode = document.createElement('a')
linkNode.href = this.$store.state.user.padSopUrl + row.url
linkNode.download = row.fileName
linkNode.target = '_blank'
linkNode.style.display = 'none'
document.body.appendChild(linkNode)
linkNode.click()
document.body.removeChild(linkNode)
return
}
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('确定要删除此文件?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteObjectFile(row).then(({data}) => {
if (data && data.code === 0) {
this.getFileContentList()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
},
// 动态列开始 获取 用户保存的 格式列
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) {
//this.columnList1 = []
switch (columnId) {
case 1:
this.columnList = data.rows
break;
case 2:
this.columnDetailList = data.rows
break;
// case 3:
// this.columnList2 = data.rows
// break;
// case 4:
// this.columnList3 = data.rows
// break;
}
} 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 3:
// this.columnList2 = data.rows
// break;
// case 4:
// this.columnList3 = data.rows
// break;
}
} else {
// this.showDefault = true.
}
})
},
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 checkoutFlag = this.isAuth(this.menuId+":checkout")
//处理页面的权限数据
this.authSearch = !searchFlag
this.authSave = !saveFlag
this.authUpdate = !updateFlag
this.authDelete = !deleteFlag
this.authDetail = !detailFlag
this.authFile = !fileFlag
this.authCheckout = !checkoutFlag
},
}
}
</script>
<style scoped>
.el-table /deep/ .cell{
height: auto;
line-height: 1.5;
}
.qc-more-dropdown-trigger {
cursor: pointer;
color: #45C2B5;
margin-left: 1px;
font-size: 12px;
white-space: nowrap;
}
</style>