Browse Source

2026-04-14

物料档案管理增加“检验标准维护”功能
master
fengyuan_yang 3 days ago
parent
commit
944436deec
  1. 7
      src/api/qc/qc.js
  2. 295
      src/views/modules/qc/qcPartAttribute.vue

7
src/api/qc/qc.js

@ -77,6 +77,13 @@ export const getOperationDescList = data => createAPI(`/pms/qc/getOperationDescL
export const getManufacturerList = data => createAPI(`/pms/qc/getManufacturerList`,'post',data)
export const getPartTemplateLists = data => createAPI(`/pms/qc/getPartTemplateLists`,'post',data)
export const qcPartAttributeEdit = data => createAPI(`/pms/qc/qcPartAttributeEdit`,'post',data)
// ===================================== 检验标准维护 =====================================
export const qcSpecSearch = data => createAPI(`/pms/qc/qcSpecSearch`,'post',data)
export const qcSpecSave = data => createAPI(`/pms/qc/qcSpecSave`,'post',data)
export const qcSpecUpdate = data => createAPI(`/pms/qc/qcSpecUpdate`,'post',data)
export const qcSpecDelete = data => createAPI(`/pms/qc/qcSpecDelete`,'post',data)
export const getQcSpecItemList = data => createAPI(`/pms/qc/getQcSpecItemList`,'post',data)
export const queryFileId = data => createAPI(`/pms/qc/queryFileId`,'post',data)
export const getPartDefectTracking = data => createAPI(`/pms/qc/getPartDefectTracking`,'post',data)
export const saveDefectTracking = data => createAPI(`/pms/qc/saveDefectTracking`,'post',data)

295
src/views/modules/qc/qcPartAttribute.vue

@ -730,6 +730,54 @@
</el-table-column>
</el-table>
</el-tab-pane>
<!-- 检验标准维护 -->
<el-tab-pane label="检验标准维护" name="qcSpec">
<el-form label-position="top" style="margin-left: 2px;">
<el-button type="primary" @click="addQcSpecModal()" icon="el-icon-plus">新增</el-button>
<el-button v-if="!editQcSpecBatchVisible" @click="editQcSpecBatchModel">批量编辑</el-button>
<el-button v-if="editQcSpecBatchVisible" @click="batchQcSpecModel" :loading="batchQcSpecLoading">批量保存</el-button>
</el-form>
<el-table
:data="qcSpecList"
:height="secondHeight - 68"
border
style="width: 100%;">
<el-table-column prop="inspectionTypeName" header-align="center" align="left" label="检验类型" min-width="80"></el-table-column>
<el-table-column prop="itemNo" header-align="center" align="left" label="项目编码" min-width="100"></el-table-column>
<el-table-column prop="itemDesc" header-align="center" align="left" label="项目名称" min-width="150"></el-table-column>
<el-table-column prop="defaultValue" header-align="center" align="left" label="标准值" min-width="100">
<template slot-scope="scope">
<span v-if="editQcSpecBatchVisible">
<el-input v-model="scope.row.defaultValue" style="height: 11px; width: 98%;"></el-input>
</span>
<span v-else>{{scope.row.defaultValue}}</span>
</template>
</el-table-column>
<el-table-column prop="maxValue" header-align="center" align="right" label="最大值" min-width="100">
<template slot-scope="scope">
<span v-if="editQcSpecBatchVisible">
<el-input v-model="scope.row.maxValue" style="height: 11px; width: 98%;"></el-input>
</span>
<span v-else>{{scope.row.maxValue}}</span>
</template>
</el-table-column>
<el-table-column prop="minValue" header-align="center" align="right" label="最小值" min-width="100">
<template slot-scope="scope">
<span v-if="editQcSpecBatchVisible">
<el-input v-model="scope.row.minValue" style="height: 11px; width: 98%;"></el-input>
</span>
<span v-else>{{scope.row.minValue}}</span>
</template>
</el-table-column>
<el-table-column prop="createBy" header-align="center" align="center" label="创建人" min-width="100"></el-table-column>
<el-table-column prop="createTime" header-align="center" align="center" label="创建时间" min-width="150"></el-table-column>
<el-table-column header-align="center" align="center" width="80" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="deleteQcSpec(scope.row)" style="color: #f56c6c;">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<!-- 标签模版设置 -->
<el-tab-pane label="标签模版设置" name="labelTemplate">
<el-form label-position="top" style="margin-left: 2px;">
@ -1311,6 +1359,63 @@
</el-footer>
</el-dialog>
<!-- 检验标准维护新增 -->
<el-dialog title="新增检验标准" @close="refreshQcSpecList" :close-on-click-modal="false" v-drag :visible.sync="qcSpecAddFlag" width="1100px">
<div style="font-size: 12px">
<el-form :inline="true" label-position="top" :model="qcSpecSearchData">
<el-form-item label="检验类型">
<el-select v-model="qcSpecSearchData.inspectionTypeNo" placeholder="请选择" style="width: 120px">
<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-input v-model="qcSpecSearchData.itemNo" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="项目名称">
<el-input v-model="qcSpecSearchData.itemDesc" clearable style="width: 200px"></el-input>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="getQcSpecItemList()">查询</el-button>
</el-form-item>
</el-form>
</div>
<el-container style="margin-top: 0px;">
<el-main style="width: 640px; padding: 1px">
<span style="font-size: 12px">可选项目</span>
<el-table height="400px" :data="qcSpecItemList1" border ref="qcSpecItemTable1" @row-click="qcSpecItemClickRow1" @selection-change="qcSpecSelectionItem1" 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="inspectionTypeName" header-align="center" align="left" min-width="80" label="检验类型"></el-table-column>
<el-table-column prop="itemNo" header-align="center" align="left" min-width="100" label="项目编码"></el-table-column>
<el-table-column prop="itemDesc" header-align="center" align="left" 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="right" min-width="60" label="最大值"></el-table-column>
<el-table-column prop="minValue" header-align="center" align="right" 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="addQcSpecItem()">添加>></el-button>
</div>
<div style="margin-top: 15px;margin-left: 18px">
<el-button type="primary" @click="deleteQcSpecItem()">删除<<</el-button>
</div>
</el-main>
<el-main style="width: 420px;padding: 1px">
<span style="font-size: 12px">已有项目</span>
<el-table height="400px" :data="qcSpecItemList2" border ref="qcSpecItemTable2" @row-click="qcSpecItemClickRow2" @selection-change="qcSpecSelectionItem2" 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="inspectionTypeName" header-align="center" align="left" min-width="80" label="检验类型"></el-table-column>
<el-table-column prop="itemNo" header-align="center" align="left" min-width="100" label="项目编码"></el-table-column>
<el-table-column prop="itemDesc" header-align="center" align="left" min-width="150" 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="qcSpecAddFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
<!-- 上传sop文件的modal -->
@ -1352,6 +1457,12 @@
deletePatrolConfig, //
getAllOperationDescList, //
patrolConfigUpload, //
qcSpecSearch,
qcSpecSave,
qcSpecUpdate,
qcSpecDelete,
getQcSpecItemList,
} from "@/api/qc/qc.js"
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
import Chooselist from '@/views/modules/common/Chooselist_eam'
@ -1378,6 +1489,23 @@
},
data () {
return {
//
qcSpecList: [],
editQcSpecBatchVisible: false,
batchQcSpecLoading: false,
qcSpecAddFlag: false,
qcSpecSearchData: {
inspectionTypeNo: '',
itemNo: '',
itemDesc: '',
site: '',
buNo: '',
partNo: ''
},
qcSpecItemList1: [],
qcSpecItemList2: [],
qcSpecItemSelections1: [],
qcSpecItemSelections2: [],
columnsProp:['createBy', 'updateBy'],
//
favorite: false,
@ -2222,6 +2350,171 @@
},
methods: {
// ================= =================
refreshQcSpecList() {
if (!this.partCurrentRow || !this.partCurrentRow.partNo) return
qcSpecSearch({
site: this.partCurrentRow.site,
buNo: this.partCurrentRow.buNo,
partNo: this.partCurrentRow.partNo
}).then(({data}) => {
if (data && data.code === 0) {
this.qcSpecList = data.rows || []
}
})
},
addQcSpecModal() {
this.qcSpecSearchData.site = this.partCurrentRow.site
this.qcSpecSearchData.buNo = this.partCurrentRow.buNo
this.qcSpecSearchData.partNo = this.partCurrentRow.partNo
this.qcSpecSearchData.inspectionTypeNo = ''
this.qcSpecSearchData.itemNo = ''
this.qcSpecSearchData.itemDesc = ''
this.qcSpecItemList1 = []
this.qcSpecItemList2 = []
this.qcSpecItemSelections1 = []
this.qcSpecItemSelections2 = []
this.getQcSpecItemList()
this.qcSpecAddFlag = true
},
getQcSpecItemList() {
getQcSpecItemList(this.qcSpecSearchData).then(({data}) => {
if (data && data.code === 0) {
this.qcSpecItemList1 = data.rows || []
}
})
qcSpecSearch({
site: this.partCurrentRow.site,
buNo: this.partCurrentRow.buNo,
partNo: this.partCurrentRow.partNo
}).then(({data}) => {
if (data && data.code === 0) {
this.qcSpecItemList2 = data.rows || []
}
})
},
qcSpecItemClickRow1(row) {
this.$refs.qcSpecItemTable1.toggleRowSelection(row)
},
qcSpecItemClickRow2(row) {
this.$refs.qcSpecItemTable2.toggleRowSelection(row)
},
qcSpecSelectionItem1(val) {
this.qcSpecItemSelections1 = val
},
qcSpecSelectionItem2(val) {
this.qcSpecItemSelections2 = val
},
addQcSpecItem() {
if (this.qcSpecItemSelections1.length === 0) {
this.$message.warning('请选择可选项目!')
return
}
let inData = {
site: this.partCurrentRow.site,
buNo: this.partCurrentRow.buNo,
partNo: this.partCurrentRow.partNo,
createBy: this.$store.state.user.name,
itemList: this.qcSpecItemSelections1
}
qcSpecSave(inData).then(({data}) => {
if (data && data.code === 0) {
this.getQcSpecItemList()
this.qcSpecItemSelections1 = []
} else {
this.$message.error(data.msg)
}
})
},
deleteQcSpecItem() {
if (this.qcSpecItemSelections2.length === 0) {
this.$message.warning('请选择已有项目!')
return
}
this.$confirm('是否删除选中的检验标准?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let count = 0
let successCount = 0
this.qcSpecItemSelections2.forEach(item => {
qcSpecDelete({
site: this.partCurrentRow.site,
buNo: this.partCurrentRow.buNo,
partNo: this.partCurrentRow.partNo,
itemNo: item.itemNo,
inspectionTypeNo: item.inspectionTypeNo
}).then(({data}) => {
count++
if (data && data.code === 0) {
successCount++
}
if (count === this.qcSpecItemSelections2.length) {
this.getQcSpecItemList()
this.qcSpecItemSelections2 = []
this.$message.success(`成功删除 ${successCount} 条数据`)
}
})
})
})
},
editQcSpecBatchModel() {
this.editQcSpecBatchVisible = true
},
batchQcSpecModel() {
for (let i = 0; i < this.qcSpecList.length; i++) {
let item = this.qcSpecList[i];
if (item.maxValue !== '' && item.maxValue !== null && item.minValue !== '' && item.minValue !== null) {
if (Number(item.maxValue) < Number(item.minValue)) {
this.$message.warning(`项目【${item.itemDesc}】的最大值不能小于最小值!`);
return;
}
}
}
this.batchQcSpecLoading = true
let inData = {
site: this.partCurrentRow.site,
buNo: this.partCurrentRow.buNo,
partNo: this.partCurrentRow.partNo,
itemList: this.qcSpecList
}
qcSpecUpdate(inData).then(({data}) => {
this.batchQcSpecLoading = false
if (data && data.code === 0) {
this.editQcSpecBatchVisible = false
this.refreshQcSpecList()
this.$message.success('批量保存成功')
} else {
this.$message.error(data.msg)
}
}).catch(() => {
this.batchQcSpecLoading = false
})
},
deleteQcSpec(row) {
this.$confirm('是否删除该检验标准?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
qcSpecDelete({
site: this.partCurrentRow.site,
buNo: this.partCurrentRow.buNo,
partNo: this.partCurrentRow.partNo,
itemNo: row.itemNo,
inspectionTypeNo: row.inspectionTypeNo
}).then(({data}) => {
if (data && data.code === 0) {
this.refreshQcSpecList()
this.$message.success('删除成功')
} else {
this.$message.error(data.msg)
}
})
})
},
// ================= =================
//
openPatrolConfigDialog() {
@ -2687,6 +2980,8 @@
this.detailModal()
} else if (this.activeTable === 'defectTracking') {
this.getPartDefectTracking()
} else if (this.activeTable === 'qcSpec') {
this.refreshQcSpecList()
} else if (this.activeTable === 'labelTemplate') {
this.getPartLabelTemplate()
}

Loading…
Cancel
Save