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.
 
 
 
 
 

1953 lines
70 KiB

<template>
<div class="mod-config">
<!-- 收藏 -->
<div>
<span @click="favoriteFunction()">
<icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg>
</span>
</div>
<!-- 条件查询 -->
<el-form :inline="true" label-position="top" :model="searchData" >
<el-form-item :label="'检验单号'">
<el-input v-model="searchData.inspectionNo" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'状态'">
<el-select v-model="searchData.state" style="width: 100px">
<el-option label="全部" value=""></el-option>
<el-option label="待检验" value="待检验"></el-option>
<el-option label="待审核" value="待审核"></el-option>
<el-option label="已完成" value="已完成"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="'检验结论'">
<el-select v-model="searchData.inspectionResult" style="width: 100px">
<el-option label="全部" value=""></el-option>
<el-option label="合格" value="合格"></el-option>
<el-option label="不合格" value="不合格"></el-option>
</el-select>
</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="'物料名称'">
<el-input v-model="searchData.partDesc" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'供应商'">
<el-input v-model="searchData.supplierDesc" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'处置措施'">
<el-select v-model="searchData.disposalMeasures" style="width: 120px">
<el-option label="全部" value=""></el-option>
<el-option label="缺少备件" value="缺少备件"></el-option>
<el-option label="等待售后" value="等待售后"></el-option>
<el-option label="远程协助" value="远程协助"></el-option>
<el-option label="换班换人" value="换班换人"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="'质检员'">
<el-input v-model="searchData.inspectorName" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'检验时间'">
<el-date-picker style="width: 150px" v-model="searchData.startDate" type="datetime" value-format='yyyy-MM-dd HH:mm' format='yyyy-MM-dd HH:mm' placeholder="开始日期"></el-date-picker>
-
<el-date-picker style="width: 150px" v-model="searchData.endDate" type="datetime" value-format='yyyy-MM-dd HH:mm' format='yyyy-MM-dd HH:mm' placeholder="结束日期"></el-date-picker>
</el-form-item>
<el-form-item :label="' '">
<el-button type="primary" @click="getDataList()">查询</el-button>
<el-button type="primary" @click="submitResult()">审核</el-button>
<el-button type="primary" @click="deleteModal()">删除</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
ref="IQCTable"
@row-click="IQCClickRow"
@selection-change="selectionIQC"
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
:selectable="selectFlag"
width="50">
</el-table-column>
<el-table-column
prop="state"
header-align="center"
align="center"
label="状态">
<template slot-scope="scope">
<div :style="{fontWeight:'bold', color: scope.row.state === '待检验' ? 'red' : scope.row.state === '待审核' ? '#ffa500e0' : scope.row.state === '已完成' ? '#3ac252' : ''}">
{{ scope.row.state }}
</div>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in columnList1" :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="200"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="detailModal(scope.row)">检验单</a>
<a type="text" size="small" @click="getFileContentData(scope.row)">工作文件</a>
<!-- <a type="text" size="small" @click="submitResult(scope.row)">审核</a>-->
<!-- <a type="text" size="small" @click="deleteModal(scope.row)">删除</a>-->
</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="detailInformationFlag" width="1200px">
<el-form :inline="true" label-position="top" @keyup.enter.native="getDataList()">
<el-form-item :label="'物料编码'">
<el-input v-model="detailData.partNo" disabled style="width: 100px"></el-input>
</el-form-item>
<el-form-item :label="'物料名称'">
<el-input v-model="detailData.partDesc" disabled style="width: 200px"></el-input>
</el-form-item>
<el-form-item :label="'计量单位'">
<el-input v-model="detailData.umId" disabled style="width: 200px"></el-input>
</el-form-item>
<el-form-item :label="'到货数量'">
<el-input class="numInput" v-model="detailData.rollQty" type="number" disabled style="width: 80px"></el-input>
</el-form-item>
<el-form-item :label="'送检数量'">
<el-input class="numInput" v-model="detailData.rollCount" type="number" disabled style="width: 80px"></el-input>
</el-form-item>
<el-form-item :label="'抽样数量'">
<el-input class="numInput" v-model="detailData.samplingQty" type="number" disabled style="width: 80px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" @keyup.enter.native="getDataList()">
<el-form-item :label="'不合格项目数量'">
<el-input class="numInput" v-if="detailData.submitFlag === 'Y'" v-model="detailData.unqualifiedQty" disabled type="number" style="width: 80px"></el-input>
<el-input class="numInput" @input="handleInput(detailData.unqualifiedQty,1)" v-if="detailData.submitFlag != 'Y'" v-model="detailData.unqualifiedQty" type="number" style="width: 80px"></el-input>
</el-form-item>
<el-form-item :label="'处置措施'">
<el-select v-if="detailData.submitFlag === 'Y'" clearable v-model="detailData.disposalMeasures" disabled style="width: 100px">
<el-option
v-for = "i in disposalMeasuresOptions"
:key = "i.id"
:label = "i.disposalMeasures"
:value = "i.disposalMeasures">
</el-option>
</el-select>
<el-select v-if="detailData.submitFlag != 'Y'" clearable v-model="detailData.disposalMeasures" style="width: 100px">
<el-option
v-for = "i in disposalMeasuresOptions"
:key = "i.id"
:label = "i.disposalMeasures"
:value = "i.disposalMeasures">
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="'处置说明'">
<el-input v-if="detailData.submitFlag === 'Y'" v-model="detailData.disposalRemark" disabled style="width: 200px"></el-input>
<el-input v-if="detailData.submitFlag != 'Y'" v-model="detailData.disposalRemark" style="width: 200px"></el-input>
</el-form-item>
<el-form-item :label="'检验结论'">
<el-select v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectionResult" disabled style="width: 100px" placeholder="请选择">
<el-option label="合格" value="合格"></el-option>
<el-option label="不合格" value="不合格"></el-option>
</el-select>
<el-select v-if="detailData.submitFlag != 'Y'" v-model="detailData.inspectionResult" style="width: 100px" placeholder="请选择">
<el-option label="合格" value="合格"></el-option>
<el-option label="不合格" value="不合格"></el-option>
</el-select>
</el-form-item>
<el-form-item label="检验员">
<el-select v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectorNo" disabled placeholder="请选择" style="width: 100px">
<el-option
v-for = "i in options"
:key = "i.inspectorNo"
:label = "i.inspectorName"
:value = "i.inspectorNo">
</el-option>
</el-select>
<el-select v-if="detailData.submitFlag != 'Y'" v-model="detailData.inspectorNo" disabled placeholder="请选择" style="width: 100px">
<el-option
v-for = "i in options"
:key = "i.inspectorNo"
:label = "i.inspectorName"
:value = "i.inspectorNo">
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="'质检备注'">
<el-input v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectionRemark" disabled style="width: 280px"></el-input>
<el-input v-if="detailData.submitFlag != 'Y'" v-model="detailData.inspectionRemark" style="width: 280px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button type="primary" @click="addUploadFileModal()">上传文件</el-button>
<el-button type="primary" icon="el-icon-upload" @click="subDetailUpload()">明细导入</el-button>
</el-form-item>
<el-form-item :label="' '"></el-form-item>
</el-form>
<!-- 展示列表 -->
<div class="rq ">
<el-table
:height="500"
:data="detailList"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
prop=""
header-align="center"
align="center"
min-width="60"
label="操作">
<template slot-scope="scope">
<el-button class="el-icon-picture" type="primary" @click="uploadImageModal(scope.row)"></el-button>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in detailColumnList" :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
prop=""
header-align="center"
align="right"
min-width="80"
label="实测值">
<template slot-scope="scope">
<el-input :ref="`textValue${scope.$index}`" v-if="scope.row.valueTypeDb === 'T'" v-model="scope.row.textValue" @keyup.enter.native="focusNextInput(scope.$index, 'textValue')" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input>
<el-input :ref="`textValue${scope.$index}`" v-if="scope.row.valueTypeDb === 'N'" v-model="scope.row.numberValue" @keyup.enter.native="focusNextInput(scope.$index, 'textValue')" 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="80"
label="检验明细">
<template slot-scope="scope">
<el-button v-if="scope.row.subDetailRecordNum <= 0" type="primary" @click="subDetailModal(scope.row) ">点击输入</el-button>
<el-button v-if="scope.row.subDetailRecordNum > 0" type="success" @click="subDetailModal(scope.row) ">点击输入</el-button>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="right"
min-width="80"
label="不合格数量">
<template slot-scope="scope">
<el-input class="numInput" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.unqualifiedQuantity" disabled type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input>
<el-input class="numInput" :ref="`unqualifiedQuantity${scope.$index}`" v-if="detailData.submitFlag != 'Y'" v-model="scope.row.unqualifiedQuantity" type="number" @keyup.enter.native="focusNextInput(scope.$index, 'unqualifiedQuantity')" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="right"
min-width="75"
label="项目检验结论">
<template slot-scope="scope">
<el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.itemResult" disabled style="height: 11px;padding: 0px" >
<el-option label="合格" value="Y" style="color: green"></el-option>
<el-option label="不合格" value="N" style="color: red"></el-option>
</el-select>
<el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-if="detailData.submitFlag != 'Y'" v-model="scope.row.itemResult" style="height: 11px;padding: 0px" placeholder="合格">
<el-option label="合格" value="Y" style="color: green"></el-option>
<el-option label="不合格" value="N" style="color: red"></el-option>
</el-select>
</template>
</el-table-column>
</el-table>
</div>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="Transfer()">保存</el-button>
<el-button type="primary" @click="detailInformationFlag=false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 文件清单 -->
<el-dialog title="文件清单" :close-on-click-modal="false" v-drag :visible.sync="fileFlag" width="800px">
<el-table
:height="350"
:data="fileContentList"
border
v-loading="dataListLoading"
style="width: 100%; ">
<el-table-column
v-for="(item,index) in fileColumnList" :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 type="text" size="small" @click="deleteFile(scope.row)">删除</a>
</template>
</el-table-column>
</el-table>
</el-dialog>
<!-- 子明细信息 -->
<el-dialog title="子明细信息" :close-on-click-modal="false" v-drag :visible.sync="subDetailFlag" width="572px">
<el-button type="success" icon="el-icon-plus" size="mini" @click="handleAddBtn(subDetailData)">添加</el-button>
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBtn(subDetailData)">删除</el-button>
<el-button type="primary" icon="el-icon-more" size="mini" @click="batchHandleAdd(subDetailData)">批量新增</el-button>
<div class="rq ">
<el-table
:height="400"
:data="tableData"
border
:row-class-name="rowClassName"
@selection-change="handleDetailSelectionChange"
style="width: 100%;">
<el-table-column type="selection" align="center" width="50"></el-table-column>
<el-table-column label="序号" align="center" prop="xh" width="50"></el-table-column>
<el-table-column prop="samplingLocation" header-align="center" align="center" :required="true" label="抽样位置A" width="150">
<template slot-scope="{row}">
<el-input v-if="tableData[row.xh-1].isSubmit === 'Y'" v-model="tableData[row.xh-1].samplingLocation" readonly placeholder="请输入抽样位置A"></el-input>
<el-input :ref="`${row.xh-1}` + `a`" v-if="tableData[row.xh-1].isSubmit!='Y'" v-model="tableData[row.xh-1].samplingLocation" @keyup.enter.native="nextFocus1(row.xh-1)" placeholder="请输入抽样位置A"></el-input>
</template>
</el-table-column>
<el-table-column prop="samplingLocationB" header-align="center" align="center" :required="true" label="抽样位置B" width="150">
<template slot-scope="{row}">
<el-input v-if="tableData[row.xh-1].isSubmit === 'Y'" v-model="tableData[row.xh-1].samplingLocationB" readonly placeholder="请输入抽样位置B"></el-input>
<el-input :ref="`${row.xh-1}` + `b`" v-if="tableData[row.xh-1].isSubmit!='Y'" v-model="tableData[row.xh-1].samplingLocationB" @keyup.enter.native="nextFocus2(row.xh-1)" placeholder="请输入抽样位置B"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValue" header-align="center" align="center" :required="true" label="实测值" width="200">
<template slot-scope="{row}">
<el-input v-if="tableData[row.xh-1].isSubmit === 'Y'" v-model="tableData[row.xh-1].subDetailValue" readonly placeholder="请输入实测值"></el-input>
<el-input :ref="`${row.xh-1}` + `c`" v-if="tableData[row.xh-1].isSubmit!='Y'" v-model="tableData[row.xh-1].subDetailValue" @keyup.enter.native="nextFocus3(row.xh-1)" placeholder="请输入实测值"></el-input>
</template>
</el-table-column>
</el-table>
</div>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button v-if="detailData.submitFlag !== 'Y'" type="primary" @click="saveSubDetailResult()">保存</el-button>
<el-button type="primary" @click="subDetailFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 批量新增子明细操作-->
<el-dialog title="批量新增" :close-on-click-modal="false" v-drag :visible.sync="batchHandleAddModalFlag" width="510px">
<el-form :inline="true" label-position="top">
<el-form-item :label="'默认抽样位置A'">
<el-input v-model="batchAddData.samplingLocation" style="width: 150px"></el-input>
</el-form-item>
<el-form-item :label="'默认抽样位置B'">
<el-input v-model="batchAddData.samplingLocationB" style="width: 150px"></el-input>
</el-form-item>
<el-form-item :label="'抽样数量'">
<el-input type="number" v-model="batchAddData.samplingNumber" style="width: 150px"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="batchHandleAddModal()">保存</el-button>
<el-button type="primary" @click="batchHandleAddModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
<!-- 上传文件的modal -->
<qcFAIUploadFile ref="qcFAIUploadFile" @refreshPageTables="getDataList()" v-drag></qcFAIUploadFile>
<!-- 上传文件的modal -->
<comQcItemImageUploadFile ref="comQcItemImageUploadFile" @refreshPageTables2="getInspectionFormData()" v-drag></comQcItemImageUploadFile>
<!-- 子明细导入 -->
<subDetailUpload @changeEvent="changeMyString" ref="subDetailUpload" @refreshPageTables="getInspectionFormData()" v-drag></subDetailUpload>
</div>
</template>
<script>
import {
qcIQCInspectionSearch, // IQC检验记录查询
iqcDetailSearch, // iqc检验记录查询
inspectorSearch, // 检验员查询
selectIQCSubDetailedRecord, // 查询子明细记录
checkIQCSubDetailValue, // 检查子明细中的实测值是否在规定范围
saveIQCDetailedRecord, // 新增明细信息
checkIQCIsSubmit, // 检查是否已提交
saveIQCSubDetailed, // 新增子明细信息
saveIQCSubmitResult, // 审核
iqcRecordDelete, // 删除检验记录
disposalMeasuresSearch // 获取处置措施列表
} from "@/api/qc/qc.js"
import {
getTableDefaultListLanguage,
getTableUserListLanguage,
} from "@/api/table.js"
import Chooselist from '@/views/modules/common/Chooselist_eam'
import {getFileContentList, downLoadObjectFile} from '@/api/eam/eam_object_list.js'
import {deleteObjectFile} from '@/api/eam/eam.js'
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
import qcFAIUploadFile from "./qc_FAI_upload_file"
import comQcItemImageUploadFile from "./com_qc_itemImage_upload_file"
import subDetailUpload from "./sub_detail_upload"
export default {
components: {
Chooselist,
qcFAIUploadFile,
comQcItemImageUploadFile,
subDetailUpload
},
watch: {
detailList: {
deep: true,
handler: function (newV, oldV) {
let num = 0
for (let i = 0; i < this.detailList.length; i++) {
if (this.detailList[i].itemResult === 'N') {
num++
}
}
this.detailData.unqualifiedQty = num
}
},
},
data () {
return {
// 是否收藏
favorite: false,
// 导出 start
exportData: [],
exportName: "IQC检验录入" + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ["IQC检验录入"],
exportFooter: [],
exportList:[],
// 导出 end
submitData:{
site: this.$store.state.user.site,
inspectionNo: '',
isQualified: '',
isQualifiedChinese: '',
submitList: [],
},
tagNo:'',
searchData: {
site: this.$store.state.user.site,
inspectionNo: '',
inspectionTypeNo:'105',
isQualified: '',
startDate: '',
endDate: '',
partNo:'',
partDesc:'',
state: '待检验',
inspectionResult: '',
supplierDesc: '',
disposalMeasures: '',
inspectorName: '',
page: 1,
limit: 10,
},
pageIndex: 1,
pageSize: 50,
totalPage: 0,
height: 200,
dataList: [],
dataListLoading: false,
dataListSelections: [],
submitFlag: false,
modalData: {
flag:'',
functionType:'',
site: this.$store.state.user.site,
inspectionNo:'',
workOrderNumber: '',
workOrderQuantity: '',
reelNumber: '',
partNo: '',
rollingQuantity: '',
sampleQuantity: '',
detailCodeNo:'',
detailCodeDesc:'',
inspectionTypeNo:'105',
inspectionTypeName:'IQC',
inspectorNo:'',
inspectorName:'',
isQualified:'',
isQualifiedChinese:''
},
// 展示列集
columnList1: [
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table1InspectionNo',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'inspectionNo',
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: 301006,
serialNumber: '301006Table1InspectionResult',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'inspectionResult',
headerAlign: "center",
align: "center",
columnLabel: '检验结论',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table1TaskDate',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'taskDate',
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: 301006,
serialNumber: '301006Table1InspectionCycle',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'inspectionCycle',
headerAlign: "center",
align: "center",
columnLabel: '检验周期(h)',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table1RollNo',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'rollNo',
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: 301006,
serialNumber: '301006Table1PartNo',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'partNo',
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: 301006,
serialNumber: '301006Table1PartDesc',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'partDesc',
headerAlign: "center",
align: "center",
columnLabel: '物料名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table1Umid',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'umId',
headerAlign: "center",
align: "center",
columnLabel: '计量单位',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table1RollQty',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'rollQty',
headerAlign: "center",
align: "right",
columnLabel: '到货数量',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table1RollCount',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'rollCount',
headerAlign: "center",
align: "right",
columnLabel: '送检数量',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table1SamplingQty',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'samplingQty',
headerAlign: "center",
align: "right",
columnLabel: '抽样数量',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table1PoOrderNo',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'poOrderNo',
headerAlign: "center",
align: "center",
columnLabel: '单据号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 130,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table1PoItemNo',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'poItemNo',
headerAlign: "center",
align: "right",
columnLabel: '单据行号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table1SupplierDesc',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'supplierDesc',
headerAlign: "center",
align: "center",
columnLabel: '供应商',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table1InspectionRemark',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'inspectionRemark',
headerAlign: "center",
align: "center",
columnLabel: '质检备注',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table1DisposalMeasures',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'disposalMeasures',
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: 301006,
serialNumber: '301006Table1DisposalRemark',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'disposalRemark',
headerAlign: "center",
align: "center",
columnLabel: '处置说明',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table1InspectorDate',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'inspectorDate',
headerAlign: "center",
align: "center",
columnLabel: '检验时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 130,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table1InspectorName',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'inspectorName',
headerAlign: "center",
align: "center",
columnLabel: '质检员',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120,
},
],
detailColumnList: [
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table2ItemDesc',
tableId: "301006Table2",
tableName: "检验单明细表",
columnProp: 'itemDesc',
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: 301006,
serialNumber: '301006Table2SamplingLevelDesc',
tableId: "301006Table2",
tableName: "检验单明细表",
columnProp: 'samplingLevelDesc',
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: 301006,
serialNumber: '301006Table2SamplingProgrammeDesc',
tableId: "301006Table2",
tableName: "检验单明细表",
columnProp: 'samplingProgrammeDesc',
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: 301006,
serialNumber: '301006Table2ObjectDesc',
tableId: "301006Table2",
tableName: "检验单明细表",
columnProp: 'objectDesc',
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: 301006,
serialNumber: '301006Table2Aql',
tableId: "301006Table2",
tableName: "检验单明细表",
columnProp: 'aql',
headerAlign: "center",
align: "center",
columnLabel: 'AQL',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table2Ac',
tableId: "301006Table2",
tableName: "检验单明细表",
columnProp: 'ac',
headerAlign: "center",
align: "center",
columnLabel: 'AC',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table2Re',
tableId: "301006Table2",
tableName: "检验单明细表",
columnProp: 're',
headerAlign: "center",
align: "center",
columnLabel: 'RE',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table2DefaultValue',
tableId: "301006Table2",
tableName: "检验单明细表",
columnProp: 'defaultValue',
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: 301006,
serialNumber: '301006Table2MaxValue',
tableId: "301006Table2",
tableName: "检验单明细表",
columnProp: 'maxValue',
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: 301006,
serialNumber: '301006Table2MinValue',
tableId: "301006Table2",
tableName: "检验单明细表",
columnProp: 'minValue',
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: 301006,
serialNumber: '301006Table2ValueType',
tableId: "301006Table2",
tableName: "检验单明细表",
columnProp: 'valueType',
headerAlign: "center",
align: "center",
columnLabel: '检测值类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80,
},
],
fileColumnList: [
{
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
},
],
detailData:{
site: this.$store.state.user.site,
inspectionNo: '',
partNo: '',
partDesc: '',
rollQty: '',
samplingQty: '',
unqualifiedQty: 0,
unqualifiedQuantity: '',
disposalMeasures: '',
disposalRemark: '',
inspectionResult: '',
inspectorNo: '',
inspectionRemark: '',
submitFlag: '',
supplierNo: '',
umId: '',
rollCount: ''
},
detailInformationFlag: false,
detailList:[],
saveInformationData:{
site: this.$store.state.user.site,
inspectionNo:'',
disposalMeasures: '',
disposalRemark: '',
inspectorNo: '',
inspectionRemark: '',
itemList:[],
unqualifiedQty: ''
},
// 子明细数据对象
tableData: [],
checkedDetail: [],
subDetailFlag: false,
subDetailData: {
site: this.$store.state.user.site,
inspectionNo: '',
itemNo: '',
itemDesc: '',
defaultValue: '',
maxValue: '',
minValue: '',
valueTypeDb: '',
subDetailValues:[]
},
options: [],
fileFlag: false,
fileContentList: [],
IQCSelections: [],
batchHandleAddModalFlag: false,
batchAddData: {
samplingLocation: '',
samplingLocationB: '',
samplingNumber: ''
},
disposalMeasuresOptions: []
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 210
})
},
created () {
this.getDataList()
this.favoriteIsOk()
this.disposalMeasuresSearch()
// 动态列
this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
this.getTableUserColumn(this.$route.meta.menuId+'table2',2)
},
methods: {
// ======= 正则校验 =======
handleInput (value, type) {
// 大于等于0,且只能输入4位小数
let val = value.replace(/^\D*([0-9]\d*\.?\d{0,4})?.*$/,'$1')
if (val == null || val == undefined || val == '') {
val = 0
}
if (type === 1) {
this.detailData.unqualifiedQty = val
}
},
// 子明细导入
subDetailUpload () {
let currentData = {
flag: 'IQC',
site: this.$store.state.user.site,
inspectionNo: this.detailData.inspectionNo
}
//打开组件 去做新增业务
this.$nextTick(() => {
this.$refs.subDetailUpload.init(currentData)
})
},
// 获取处置措施列表
disposalMeasuresSearch(){
let tempData = {
inspectionTypeNo: '105'
}
disposalMeasuresSearch(tempData).then(({data}) => {
if (data.code === 0) {
this.disposalMeasuresOptions = data.rows
}
})
},
selectFlag(){
return true;
},
// 单机选中
IQCClickRow(row){
this.$refs.IQCTable.toggleRowSelection(row);
},
// 复选
selectionIQC(val){
this.IQCSelections = val
},
//刷新派设备文档的列表
getFileContentData(row) {
let currentData = {
orderRef1: row.site,
orderRef2: row.inspectionNo
};
getFileContentList(currentData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code === 200) {
this.fileContentList = data.rows;
} else {
this.fileContentList = [];
}
})
this.fileFlag = true;
},
// 新增文件的modal
addUploadFileModal () {
let currentData = {
titleCon: 'IQC文件上传',
site: this.$store.state.user.site,
createBy: this.$store.state.user.name,
inspectionNo: this.detailData.inspectionNo,
remark: '',
folder: 'qcIQC',
};
//打开组件 去做新增业务
this.$nextTick(() => {
this.$refs.qcFAIUploadFile.init(currentData);
})
},
// 上传项目图片
uploadImageModal (row) {
let currentData = {
site: this.$store.state.user.site,
createBy: this.$store.state.user.name,
inspectionNo: this.detailData.inspectionNo,
itemNo: row.itemNo,
folder: 'IQCItemImageFile'
}
//打开组件 去做新增业务
this.$nextTick(() => {
this.$refs.comQcItemImageUploadFile.init(currentData)
})
},
// 文件下载
downloadFile(row){
downLoadObjectFile(row)
.then(({data}) => {
// 不限制文件下载类型
const blob = new Blob([data], {type: "application/octet-stream"})
// 下载文件名称
const fileName = row.fileName
// a标签下载
const linkNode = document.createElement('a')
// a标签的download属性规定下载文件的名称
linkNode.download = fileName
linkNode.style.display = 'none'
// 生成一个Blob URL
linkNode.href = URL.createObjectURL(blob)
document.body.appendChild(linkNode)
// 模拟在按钮上的一次鼠标单击
linkNode.click()
// 释放URL 对象
URL.revokeObjectURL(linkNode.href)
document.body.removeChild(linkNode)
})
},
// 删除文件
deleteFile(row){
let tempData = {
site: row.orderRef1,
inspectionNo: row.orderRef2
}
this.$confirm('确定要删除此文件?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteObjectFile(row).then(({data}) => {
if (data && data.code == 0) {
this.getFileContentData(tempData)
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
},
// 获取基础数据列表S
getBaseList (val,type) {
this.tagNo = val
this.$nextTick(() => {
let strVal = ''
if (val === 1037) {
strVal = this.modalData.detailCodeNo
this.$refs.baseList.init(val, strVal)
}
if (val === 1040) {
strVal = this.modalData.inspectorNo
this.$refs.baseList.init(val, strVal)
}
})
},
/* 列表方法的回调 */
getBaseData (val) {
if (this.tagNo === 1037) {
this.modalData.detailCodeNo = val.code_no
this.modalData.detailCodeDesc = val.code_desc
}
if (this.tagNo === 1040) {
this.modalData.inspectorNo = val.inspector_no
this.modalData.inspectorName = val.inspector_name
}
},
// 获取主信息数据列表
getDataList () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
qcIQCInspectionSearch(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
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 查询检验类型
inspectorSearch(){
inspectorSearch().then(({data}) => {
if (data.code === 0) {
this.options = data.rows
}
})
},
async Transfer(){
if (this.detailData.inspectionResult === '' || this.detailData.inspectionResult == null) {
this.$message.warning('请选择检验结论!')
return
}
// let num = 0 // 记录结论为不合格的项目数
// for (let i = 0; i < this.detailList.length; i++) {
// if(this.detailList[i].valueTypeDb === 'N') { // 如果检验值类型为数字
// await checkIQCSubDetailValue(this.detailList[i]).then(({data}) => {
// if (data.flag === 2 && this.detailList[i].itemResult === 'Y') { // 如果项目实测值超出范围且项目结论为合格
// this.detailList[i].itemResult = 'N'
// num = num + 1
// }
// })
// }
// if(this.detailList[i].itemResult === '' || this.detailList[i].itemResult == null){ // 默认结论为合格
// this.detailList[i].itemResult = 'Y'
// }
// }
// if (this.detailData.inspectionResult === '合格' && num > 0){
// this.$confirm('存在不合格项目,是否将检验记录保存为合格', '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(() => {
// this.saveDetailInformation()
// })
// }else {
// this.saveDetailInformation()
// }
this.saveDetailInformation()
},
// 新增明细信息
saveDetailInformation(){
this.saveInformationData.inspectionNo = this.detailData.inspectionNo
this.saveInformationData.disposalMeasures = this.detailData.disposalMeasures
this.saveInformationData.disposalRemark = this.detailData.disposalRemark
this.saveInformationData.inspectorNo = this.$store.state.user.name
this.saveInformationData.inspectionResult = this.detailData.inspectionResult
this.saveInformationData.inspectionRemark = this.detailData.inspectionRemark
this.saveInformationData.unqualifiedQty = this.detailData.unqualifiedQty
this.saveInformationData.itemList = JSON.parse(JSON.stringify(this.detailList))
saveIQCDetailedRecord(this.saveInformationData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.detailInformationFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
// 明细记录信息查询
detailModal(row){
this.detailData.site = this.$store.state.user.site
this.detailData.inspectionNo = row.inspectionNo
this.detailData.partNo = row.partNo
this.detailData.partDesc = row.partDesc
this.detailData.rollQty = row.rollQty
this.detailData.samplingQty = row.samplingQty
this.detailData.unqualifiedQty = row.unqualifiedQty
this.detailData.unqualifiedQuantity = row.unqualifiedQuantity
this.detailData.submitFlag = row.submitFlag
this.detailData.disposalMeasures = row.disposalMeasures
this.detailData.disposalRemark = row.disposalRemark
this.detailData.inspectionResult = row.inspectionResult
this.detailData.inspectorNo = row.inspectorNo
this.detailData.inspectionRemark = row.inspectionRemark
this.detailData.umId = row.umId
this.detailData.rollCount = row.rollCount
this.getInspectionFormData()
this.inspectorSearch()
this.detailInformationFlag = true
},
// 检验单明细
getInspectionFormData(){
iqcDetailSearch(this.detailData).then(({data}) => {
if (data && data.code === 0) {
this.detailList = data.rows
} else {
this.detailList = []
}
})
},
// 子明细记录信息查询
subDetailModal(row){
// this.subDetailData.inspectionNo = row.inspectionNo;
// this.subDetailData.itemNo = row.itemNo;
// this.subDetailData.itemDesc = row.itemDesc;
// this.subDetailData.defaultValue = row.defaultValue;
// this.subDetailData.maxValue = row.maxValue;
// this.subDetailData.minValue = row.minValue;
this.subDetailData = row
selectIQCSubDetailedRecord(this.subDetailData).then(({data}) => {
this.tableData = data.rows
})
this.batchAddData = {
samplingLocation: '',
samplingLocationB: '',
samplingNumber: ''
}
this.subDetailFlag = true
},
// 删除检验记录
deleteModal () {
if(this.IQCSelections.length === 0){
this.$message.warning('请勾选要删除的检验单!')
return
}
this.$confirm(`是否删除该 `+ this.IQCSelections.length +` 条检验记录?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let tempData = {
site: this.$store.state.user.site,
submitList: this.IQCSelections
}
iqcRecordDelete(tempData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.IQCSelections = []
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
},
// 审核按钮
submitResult(){
let tempData1 = '' // 记录不是待审核状态的单号
let tempData2 = '' // 记录处置措施未填写的单号
if(this.IQCSelections.length === 0){
this.$message.warning('请勾选要审核的检验单!')
return
}
for (let i = 0; i < this.IQCSelections.length; i++) {
if (this.IQCSelections[i].state != '待审核'){
tempData1 = tempData1 + this.IQCSelections[i].inspectionNo + '、'
}
if (this.IQCSelections[i].inspectionResult === '不合格' && (this.IQCSelections[i].disposalMeasures === '' || this.IQCSelections[i].disposalMeasures == null)){
tempData2 = tempData2 + this.IQCSelections[i].inspectionNo + '、'
}
}
if (tempData1 != ''){
tempData1 = tempData1.substring(0, tempData1.length - 1)
this.$message.warning('检验单号 ' + tempData1 + ' 不是待审核状态!')
return
}
if (tempData2 != ''){
tempData2 = tempData2.substring(0, tempData2.length - 1)
this.$message.warning('检验单号 ' + tempData2 + ' 的处置措施未选择!')
return
}
// this.submitData.site = row.site
// this.submitData.inspectionNo = row.inspectionNo
// this.submitData.inspectionResult = row.inspectionResult
// if (row.inspectionResult == '不合格' && (row.disposalMeasures == '' || row.disposalMeasures == null)){
// this.$alert('处置措施未选择!', '错误', {
// confirmButtonText: '确定'
// })
// return false
// }
this.$confirm(`已确认单据信息无误,确定审核该 ` + this.IQCSelections.length + ` 条记录`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.submitData.submitList = this.IQCSelections
saveIQCSubmitResult(this.submitData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.IQCSelections = []
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
},
// 子明细方法
// 表格的新增
rowClassName({ row, rowIndex }) {
row.xh = rowIndex + 1;
},
// 单选框选中数据
handleDetailSelectionChange(selection) {
this.checkedDetail = selection;
},
// 点击新增更多
handleAddBtn (td) {
checkIQCIsSubmit(td).then(({data}) => {
if (data.flag != 1) {
let obj = {};
obj.subDetailValue = "";
obj.samplingLocation = "";
this.tableData.push(obj);
} else {
this.$alert("记录已提交!", '错误', {
confirmButtonText: '确定'
})
}
})
},
// 批量新增操作
batchHandleAdd (td) {
checkIQCIsSubmit(td).then(({data}) => {
if (data.flag != 1) {
this.batchHandleAddModalFlag = true
} else {
this.$alert("记录已提交!", '错误', {
confirmButtonText: '确定'
})
}
})
},
// 批量新增行
batchHandleAddModal () {
for (let i = 0; i < this.batchAddData.samplingNumber; i++) {
let obj = {}
obj.samplingLocation = this.batchAddData.samplingLocation
obj.samplingLocationB = this.batchAddData.samplingLocationB
obj.subDetailValue = ""
this.tableData.push(obj)
}
this.batchHandleAddModalFlag = false
},
// 回车事件
nextFocus1 (index) {
let a1 = `${index + 1}` + `a`
this.$nextTick(() => {
this.$refs[a1].focus()
})
},
nextFocus2 (index) {
let a2 = `${index + 1}` + `b`
this.$nextTick(() => {
this.$refs[a2].focus()
})
},
nextFocus3 (index) {
let a3 = `${index + 1}` + `c`
this.$nextTick(() => {
this.$refs[a3].focus()
})
},
focusNextInput(index, type) {
let aaa = ''
if (this.detailList.length - 1 === index) {
aaa = `${type}0`
} else {
aaa = `${type}${index + 1}`
}
this.$nextTick(() => {
this.$refs[aaa].focus()
})
},
//删除
handleDeleteBtn(td) {
checkIQCIsSubmit(td).then(({data}) => {
if (data.flag != 1) {
if (this.checkedDetail.length === 0) {
this.$alert("请先选择要删除的数据", "提示", {
confirmButtonText: "确定",
})
} else {
this.$confirm("请是否确认删除该子明细记录?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
callback: (action) => {
if (action === "confirm") {
let val = this.checkedDetail;
val.forEach((val, index) => {
this.tableData.forEach((v, i) => {
if (val.xh === v.xh) {
this.tableData.splice(i, 1);
}
});
});
this.$message({
message: "删除成功!",
type: "success",
});
return;
} else {
this.$message({
message: "已取消删除操作",
type: "warning",
});
return;
}
},
});
}
} else {
this.$alert("记录已提交!", '错误', {
confirmButtonText: '确定'
})
}
})
},
// 新增子明细记录
saveSubDetailResult(){
for (let i = 0; i < this.tableData.length; i++) {
if(this.tableData[i].subDetailValue === '' || this.tableData[i].subDetailValue == null){
this.$message.warning('序号' + (i+1) +'未填写实测值!')
return
}
}
this.subDetailData.subDetailValues = this.tableData
saveIQCSubDetailed(this.subDetailData).then(({data}) => {
if (data && data.code === 0) {
if (data.count > 0) {
this.subDetailData.itemResult = 'N'
this.subDetailData.unqualifiedQuantity = data.count
}
if (this.subDetailData.subDetailValues.length > 0) {
this.subDetailData.subDetailRecordNum = 1
} else {
this.subDetailData.subDetailRecordNum = -1
this.subDetailData.unqualifiedQuantity = 0
this.subDetailData.itemResult = 'Y'
}
this.subDetailFlag = false
this.tableData = []
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
// 校验用户是否收藏
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 qcIQCInspectionSearch(this.searchData).then(({data}) => {
this.exportList= data.page.list;
})
return this.exportList;
},
startDownload() {},
finishDownload() {},
fields() {
let json = "{"
this.columnList1.forEach((item, index) => {
if (index == this.columnList1.length - 1) {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
} else {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
}
})
json += "}"
let s = eval("(" + json + ")")
return s
},
// 动态列开始 获取 用户保存的 格式列
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.columnList1 = data.rows
break;
case 2:
this.detailColumnList = 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) {
this.queryTable.tableId = tableId
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.columnList1 = data.rows
break;
case 2:
this.detailColumnList = data.rows
break;
// case 3:
// this.columnList2 = data.rows
// break;
// case 4:
// this.columnList3 = data.rows
// break;
}
} else {
// this.showDefault = true.
}
})
},
/**
* 明细导入后将返回值回传给父组件
* @param val
*/
changeMyString (val) {
for (let i = 0; i < this.detailList.length; i++) {
if (val[this.detailList[i].itemNo] !== undefined) {
this.detailList[i].unqualifiedQuantity = val[this.detailList[i].itemNo]
if (val[this.detailList[i].itemNo] != null) {
this.detailList[i].subDetailRecordNum = 1
}
if (val[this.detailList[i].itemNo] > 0) {
this.detailList[i].itemResult = 'N'
}
}
}
},
}
}
</script>
<style scoped>
/deep/ .redElSelect .el-input--suffix .el-input__inner{
color: red;
font-weight: bold;
}
/deep/ .greenElSelect .el-input--suffix .el-input__inner{
color: rgb(103,194,58);
font-weight: bold;
}
.numInput /deep/ .el-input__inner{
text-align: right;
}
</style>