@@ -275,13 +325,13 @@
import {
getSiteAndBuByUserName, // 获取site、bu
searchSeqInfo2, // 派工单号查询
- getOperationList, // 查询工序列表
umSearch, // 查询单位列表
queryController, // 检查动控
queryTemplateList, // 获取检验模板列表
saveOsInspection, // 新增检验记录
inspectionTypeSearch, // 搜索所有检验类型
getShiftList, // 获取班次
+ batchSaveOsInspection, // 批量新增检验记录
} from "@/api/qc/qc.js"
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
@@ -322,6 +372,7 @@
height: 200,
dataList: [],
modalFlag: false,
+ batchModalFlag: false,
modalDisableFlag: false,
modalData: {
flag: '',
@@ -356,78 +407,113 @@
createBy: '',
importantFlag: ''
},
+ batchModalData: {
+ flag: '',
+ bu: '',
+ inspectionTypeNo: '',
+ inspectionTypeName: '',
+ specialRequirements: '',
+ templateId: '',
+ templateName: '',
+ createBy: '',
+ importantFlag: '',
+ submitList: []
+ },
rules: {
seqNoType: [
{
required: true,
message: ' ',
- trigger: 'change'
+ trigger: ['blur','change']
}
],
orderNoType: [
{
required: true,
message: ' ',
- trigger: 'change'
+ trigger: ['blur','change']
}
],
operationDescType: [
{
required: true,
message: ' ',
- trigger: 'change'
+ trigger: ['blur','change']
}
],
resourceIdType: [
{
required: true,
message: ' ',
- trigger: 'change'
+ trigger: ['blur','change']
}
],
rollQtyType: [
{
required: true,
message: ' ',
- trigger: 'change'
+ trigger: ['blur','change']
}
],
inspectionTypeNoType: [
{
required: true,
message: ' ',
- trigger: 'change'
+ trigger: ['blur','change']
}
],
partNoType: [
{
required: true,
message: ' ',
- trigger: 'change'
+ trigger: ['blur','change']
}
],
umIdType: [
{
required: true,
message: ' ',
- trigger: 'change'
+ trigger: ['blur','change']
}
],
templateId: [
{
required: true,
message: ' ',
- trigger: 'change'
+ trigger: ['blur','change']
}
],
bu:[
{
required: true,
message: ' ',
- trigger: 'change'
+ trigger: ['blur','change']
}
]
},
+ batchRules: {
+ bu: [
+ {
+ required: true,
+ message: ' ',
+ trigger: ['blur','change']
+ }
+ ],
+ inspectionTypeNo: [
+ {
+ required: true,
+ message: ' ',
+ trigger: ['blur','change']
+ }
+ ],
+ templateId: [
+ {
+ required: true,
+ message: ' ',
+ trigger: ['blur','change']
+ }
+ ],
+ },
templateData: {
site: '',
bu: '',
@@ -855,7 +941,6 @@
fixed: '',
},
],
- operationList: [],
userBuList: [],
umList: [],
templateList: [],
@@ -869,6 +954,7 @@
typeOptions: [],
currentRow: {},
shiftList: [],
+ orderSelections: []
}
},
@@ -1033,7 +1119,6 @@
createBy: this.$store.state.user.name,
importantFlag: ''
}
- this.getOperationList()
this.modalDisableFlag = false
this.modalFlag = true
this.checked = false
@@ -1081,7 +1166,6 @@
saveOsInspection(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
- this.operationList = []
this.modalFlag = false
// 跳转IPQC任务
this.checkOutToIPQC(data.no)
@@ -1096,14 +1180,55 @@
})
},
- // 获取工序列表
- getOperationList () {
- getOperationList(this.modalData).then(({data}) => {
+ // 生成检验任务
+ batchDoInspectionModal () {
+ if (this.orderSelections.length === 0) {
+ this.$message.warning('请勾选单据!')
+ return
+ }
+ if (!this.orderSelections.every(item => item.workCenterNo === this.orderSelections[0].workCenterNo)) {
+ this.$message.warning('所选单据的加工中心必须相同!')
+ return
+ }
+ this.batchModalData = {
+ flag: 'doInspection',
+ bu: this.userBuList[0].buNo,
+ inspectionTypeNo: '',
+ inspectionTypeName: '',
+ templateId: '',
+ templateName: '',
+ createBy: this.$store.state.user.name,
+ importantFlag: '',
+ specialRequirements: '',
+ submitList: []
+ }
+ this.batchModalFlag = true
+ },
+
+ // 批量新增IPQC巡检记录
+ batchSaveData () {
+ if (this.batchModalData.bu === '' || this.batchModalData.bu == null) {
+ this.$message.warning('请选择BU!')
+ return
+ }
+ if (this.controlData.baseData === '控制' && (this.batchModalData.templateId == null || this.batchModalData.templateId === '')) {
+ this.$message.warning('请选择检验模板!')
+ return
+ }
+ this.batchModalData.submitList = this.orderSelections
+ this.saveLoading = true
+ batchSaveOsInspection(this.batchModalData).then(({data}) => {
if (data && data.code === 0) {
- this.operationList = data.rows
+ this.getDataList()
+ this.batchModalFlag = false
} else {
- this.operationList = []
+ this.$alert(data.msg, '错误', {
+ confirmButtonText: '确定'
+ })
}
+ this.saveLoading = false
+ }).catch(()=>{
+ this.saveLoading = false
})
},
@@ -1123,7 +1248,11 @@
// 获取检验模板列表
queryTemplateList () {
- this.templateData.bu = this.modalData.bu
+ if (this.batchModalFlag) {
+ this.templateData.bu = this.batchModalData.bu
+ } else {
+ this.templateData.bu = this.modalData.bu
+ }
// 查询所有检验模板
queryTemplateList(this.templateData).then(({data}) => {
if (data && data.code === 0) {
@@ -1135,10 +1264,20 @@
})
},
+ // 复选
+ selectionOrder (val) {
+ this.orderSelections = val
+ },
+
// 选中检验模板
getRowData (row) {
- this.modalData.templateId = row.templateId
- this.modalData.templateName = row.templateName
+ if (this.batchModalFlag) {
+ this.batchModalData.templateId = row.templateId
+ this.batchModalData.templateName = row.templateName
+ } else {
+ this.modalData.templateId = row.templateId
+ this.modalData.templateName = row.templateName
+ }
this.templateModelFlag = false
},
diff --git a/src/views/modules/qc/IPQCResultEntry.vue b/src/views/modules/qc/IPQCResultEntry.vue
index 49485df..1793e33 100644
--- a/src/views/modules/qc/IPQCResultEntry.vue
+++ b/src/views/modules/qc/IPQCResultEntry.vue
@@ -105,6 +105,7 @@
新增
审核
删除
+ 任务重载
val.state === '待检验' || val.state === '未开始')) {
+ this.$confirm(`是否重载该 `+ this.IPQCSelections.length +` 条检验单?`, '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).then(() => {
+ let tempData = {
+ site: '',
+ submitList: this.IPQCSelections
+ }
+ this.overLoading = true
+ ipqcRecordOverLoad(tempData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.getDataList()
+ this.IPQCSelections = []
+ this.$message({
+ message: '操作成功',
+ type: 'success',
+ duration: 1500,
+ onClose: () => {}
+ })
+ this.overLoading = false
+ } else {
+ this.overLoading = false
+ this.$alert(data.msg, '错误', {
+ confirmButtonText: '确定'
+ })
+ }
+ }).catch(() => {
+ this.overLoading = false
+ })
+ })
+ } else {
+ this.$message.warning('检验单必须为待检验状态!')
+ return
+ }
+ },
+
Transfer () {
if (this.detailData.inspectionResult === '' || this.detailData.inspectionResult == null) {
this.$message.warning('请选择检验结论!')