Browse Source

QMS采集修改

master
shenzhouyu 3 months ago
parent
commit
061b5a808e
  1. 3
      cclqms-vue/src/i18n/locales/qc.cn.js
  2. 3
      cclqms-vue/src/i18n/locales/qc.en.js
  3. 27
      cclqms-vue/src/views/modules/qc/FQCResultEntry.vue
  4. 27
      cclqms-vue/src/views/modules/qc/IPQCResultEntry.vue
  5. 47
      cclqms-vue/src/views/modules/qc/IQCResultEntry.vue
  6. 20
      cclqms-vue/src/views/modules/qc/OQCResultEntry.vue
  7. 108
      cclqms-vue/src/views/modules/qc/QcDataAcquisitionDialog.vue
  8. 27
      cclqms-vue/src/views/modules/qc/SQCResultEntry.vue

3
cclqms-vue/src/i18n/locales/qc.cn.js

@ -445,6 +445,7 @@ module.exports = {
dataCollectSuccess: '数据采集成功',
dataCollectNoEquipment: '未找到开始检验时选择的设备,请先开始检验并选择设备!',
dataCollectSelectEquipment: '请至少选择一台要采集的设备!',
dataCollectSelectMode: '请为已开启采集的设备选择累计采集或删除后采集!',
dataCollectNewBatchConfirm: '检测到设备有新批次数据,是否继续采集?',
reloadSheetsFirst: '请勾选要重载的检验单!',
confirmReloadN: '是否重载该 {n} 条检验单?',
@ -678,6 +679,8 @@ module.exports = {
dataCollectEquipmentTitle: '数据采集设备',
equipmentType: '设备类型',
whetherCollect: '是否采集',
accumulateCollect: '累计采集',
deleteAfterCollect: '删除后采集',
apply: '应用',
fileList: '文件清单',
qcFileTab: 'QC检验文件',

3
cclqms-vue/src/i18n/locales/qc.en.js

@ -445,6 +445,7 @@ module.exports = {
dataCollectSuccess: 'Data collected',
dataCollectNoEquipment: 'No equipment found from start inspection. Please start inspection and select equipment first!',
dataCollectSelectEquipment: 'Please select at least one equipment to collect!',
dataCollectSelectMode: 'Please choose Accumulate or Delete-then-collect for each selected equipment!',
dataCollectNewBatchConfirm: 'New batch data detected for equipment. Continue collection?',
reloadSheetsFirst: 'Select inspection sheet(s) to reload!',
confirmReloadN: 'Reload {n} inspection sheet(s)?',
@ -678,6 +679,8 @@ module.exports = {
dataCollectEquipmentTitle: 'Data collection equipment',
equipmentType: 'Equipment type',
whetherCollect: 'Collect',
accumulateCollect: 'Accumulate',
deleteAfterCollect: 'Delete then collect',
apply: 'Apply',
fileList: 'File list',
qcFileTab: 'QC files',

27
cclqms-vue/src/views/modules/qc/FQCResultEntry.vue

@ -1402,17 +1402,20 @@
detailData: {
deep: true,
handler: function (newV, oldV) {
this.detailData.notPassQty = this.detailData.samplingQty - this.detailData.passQty
const samplingQty = this.toQty(this.detailData.samplingQty)
const passQty = this.toQty(this.detailData.passQty)
const rollQty = this.toQty(this.detailData.rollQty)
this.detailData.notPassQty = samplingQty - passQty
if (this.detailData.inspectionResult === '不合格') {
if (this.detailData.disposalMeasures === '让步接收' || this.detailData.disposalMeasures === '') {
this.detailData.batchQualifiedQty = this.detailData.rollQty
this.detailData.batchQualifiedQty = rollQty
} else if (this.detailData.disposalMeasures === '挑选使用') {
this.detailData.batchQualifiedQty = this.detailData.rollQty - this.detailData.notPassQty
this.detailData.batchQualifiedQty = rollQty - this.toQty(this.detailData.notPassQty)
} else {
this.detailData.batchQualifiedQty = 0
}
} else {
this.detailData.batchQualifiedQty = this.detailData.rollQty
this.detailData.batchQualifiedQty = rollQty
}
}
},
@ -3259,6 +3262,12 @@
qcPrint(this.FAISelections)
},
/** 数量空值/非法值参与计算时按 0 */
toQty (val) {
if (val === null || val === undefined || val === '') return 0
const n = Number(val)
return isNaN(n) ? 0 : n
},
// 数据采集
dataAcquisition () {
this.dataAcquisitionDialogVisible = true
@ -6035,8 +6044,8 @@
.latest-parse-time {
color: #67c23a;
font-size: 13px;
font-weight: 600;
font-size: 11px;
font-weight: 500;
white-space: nowrap;
margin-left: 12px;
display: inline-flex;
@ -6046,11 +6055,11 @@
.latest-parse-time::before {
content: '';
display: inline-block;
width: 8px;
height: 8px;
width: 6px;
height: 6px;
border-radius: 50%;
background-color: #67c23a;
margin-right: 6px;
margin-right: 5px;
flex-shrink: 0;
}

27
cclqms-vue/src/views/modules/qc/IPQCResultEntry.vue

@ -1629,17 +1629,20 @@
detailData: {
deep: true,
handler: function (newV, oldV) {
this.detailData.notPassQty = this.detailData.samplingQty - this.detailData.passQty
const samplingQty = this.toQty(this.detailData.samplingQty)
const passQty = this.toQty(this.detailData.passQty)
const rollQty = this.toQty(this.detailData.rollQty)
this.detailData.notPassQty = samplingQty - passQty
if (this.detailData.inspectionResult === '不合格') {
if (this.detailData.disposalMeasures === '让步接收') {
this.detailData.batchQualifiedQty = this.detailData.rollQty
this.detailData.batchQualifiedQty = rollQty
} else if (this.detailData.disposalMeasures === '返工返修' || this.detailData.disposalMeasures === '拒收退回') {
this.detailData.batchQualifiedQty = 0
} else if (this.detailData.disposalMeasures === '挑选使用') {
this.detailData.batchQualifiedQty = this.detailData.rollQty - this.detailData.notPassQty
this.detailData.batchQualifiedQty = rollQty - this.toQty(this.detailData.notPassQty)
}
} else if (this.detailData.inspectionResult === '合格'){
this.detailData.batchQualifiedQty = this.detailData.rollQty
this.detailData.batchQualifiedQty = rollQty
}
// this.detailData.notPassQty = this.detailData.samplingQty - this.detailData.passQty
// if (this.detailData.inspectionResult === '不合格') {
@ -3560,6 +3563,12 @@
qcPrint(this.IPQCSelections)
},
/** 数量空值/非法值参与计算时按 0 */
toQty (val) {
if (val === null || val === undefined || val === '') return 0
const n = Number(val)
return isNaN(n) ? 0 : n
},
// 数据采集
dataAcquisition () {
this.dataAcquisitionDialogVisible = true
@ -6515,8 +6524,8 @@
.latest-parse-time {
color: #67c23a;
font-size: 13px;
font-weight: 600;
font-size: 11px;
font-weight: 500;
white-space: nowrap;
margin-left: 12px;
display: inline-flex;
@ -6526,11 +6535,11 @@
.latest-parse-time::before {
content: '';
display: inline-block;
width: 8px;
height: 8px;
width: 6px;
height: 6px;
border-radius: 50%;
background-color: #67c23a;
margin-right: 6px;
margin-right: 5px;
flex-shrink: 0;
}

47
cclqms-vue/src/views/modules/qc/IQCResultEntry.vue

@ -1577,15 +1577,17 @@ export default {
.sort((a, b) => (a.sortLv || 0) - (b.sortLv || 0))
},
},
watch: {
watch: {
detailData: {
deep: true,
handler: function (newV, oldV) {
this.detailData.notPassQty =
this.detailData.samplingQty - this.detailData.passQty
const samplingQty = this.toQty(this.detailData.samplingQty)
const passQty = this.toQty(this.detailData.passQty)
const rollQty = this.toQty(this.detailData.rollQty)
this.detailData.notPassQty = samplingQty - passQty
if (this.detailData.inspectionResult === '不合格') {
if (this.detailData.disposalMeasures === '让步接收') {
this.detailData.batchQualifiedQty = this.detailData.rollQty
this.detailData.batchQualifiedQty = rollQty
} else if (
this.detailData.disposalMeasures === '返工返修' ||
this.detailData.disposalMeasures === '拒收退回'
@ -1593,10 +1595,10 @@ export default {
this.detailData.batchQualifiedQty = 0
} else if (this.detailData.disposalMeasures === '挑选使用') {
this.detailData.batchQualifiedQty =
this.detailData.rollQty - this.detailData.notPassQty
rollQty - this.toQty(this.detailData.notPassQty)
}
} else if (this.detailData.inspectionResult === '合格') {
this.detailData.batchQualifiedQty = this.detailData.rollQty
this.detailData.batchQualifiedQty = rollQty
}
},
},
@ -3699,17 +3701,23 @@ export default {
}
},
noBatchQualifiedQtyChange() {
if (this.detailData.noBatchQualifiedQty > this.detailData.rollQty) {
const rollQty = this.toQty(this.detailData.rollQty)
const noBatchQualifiedQty = this.toQty(this.detailData.noBatchQualifiedQty)
if (noBatchQualifiedQty > rollQty) {
// 恢复原值
this.detailData.noBatchQualifiedQty =
this.detailData.rollQty - this.detailData.batchQualifiedQty
rollQty - this.toQty(this.detailData.batchQualifiedQty)
this.$message.warning(this.$t('qc.entry.batchNgGtIncoming'))
return false
}
// 给合格数量赋值
let newValue =
this.detailData.rollQty - this.detailData.noBatchQualifiedQty
this.$set(this.detailData, 'batchQualifiedQty', newValue)
// 给合格数量赋值(未填按 0 参与计算)
this.$set(this.detailData, 'batchQualifiedQty', rollQty - noBatchQualifiedQty)
},
/** 数量空值/非法值参与计算时按 0 */
toQty (val) {
if (val === null || val === undefined || val === '') return 0
const n = Number(val)
return isNaN(n) ? 0 : n
},
// 数据采集
dataAcquisition () {
@ -5035,8 +5043,9 @@ export default {
this.detailData.notPassQty = row.notPassQty
}
this.detailData.batchQualifiedQty = row.batchQualifiedQty
// 给批次不合格数量赋值
this.detailData.noBatchQualifiedQty = this.detailData.notPassQty
// 给批次不合格数量赋值(空值按 0,并据此重算批次合格数)
this.detailData.noBatchQualifiedQty = this.toQty(this.detailData.notPassQty)
this.noBatchQualifiedQtyChange()
this.getInspectionFormData()
this.detailInformationFlag = true
},
@ -6914,8 +6923,8 @@ export default {
.latest-parse-time {
color: #67c23a;
font-size: 13px;
font-weight: 600;
font-size: 11px;
font-weight: 500;
white-space: nowrap;
margin-left: 12px;
display: inline-flex;
@ -6925,11 +6934,11 @@ export default {
.latest-parse-time::before {
content: '';
display: inline-block;
width: 8px;
height: 8px;
width: 6px;
height: 6px;
border-radius: 50%;
background-color: #67c23a;
margin-right: 6px;
margin-right: 5px;
flex-shrink: 0;
}

20
cclqms-vue/src/views/modules/qc/OQCResultEntry.vue

@ -1460,7 +1460,9 @@
detailData: {
deep: true,
handler: function (newV, oldV) {
this.detailData.notPassQty = this.detailData.samplingQty - this.detailData.passQty
const samplingQty = this.toQty(this.detailData.samplingQty)
const passQty = this.toQty(this.detailData.passQty)
this.detailData.notPassQty = samplingQty - passQty
}
},
detailList: {
@ -3109,6 +3111,12 @@
this.detailData.passQty = 0
}
},
/** 数量空值/非法值参与计算时按 0 */
toQty (val) {
if (val === null || val === undefined || val === '') return 0
const n = Number(val)
return isNaN(n) ? 0 : n
},
// 数据采集
dataAcquisition () {
this.dataAcquisitionDialogVisible = true
@ -6130,8 +6138,8 @@
.latest-parse-time {
color: #67c23a;
font-size: 13px;
font-weight: 600;
font-size: 11px;
font-weight: 500;
white-space: nowrap;
margin-left: 12px;
display: inline-flex;
@ -6141,11 +6149,11 @@
.latest-parse-time::before {
content: '';
display: inline-block;
width: 8px;
height: 8px;
width: 6px;
height: 6px;
border-radius: 50%;
background-color: #67c23a;
margin-right: 6px;
margin-right: 5px;
flex-shrink: 0;
}

108
cclqms-vue/src/views/modules/qc/QcDataAcquisitionDialog.vue

@ -2,7 +2,7 @@
<el-dialog
:title="$t('qc.iqcPage.dataCollectEquipmentTitle')"
:visible.sync="innerVisible"
width="520px"
width="780px"
append-to-body
:close-on-click-modal="false"
custom-class="qc-data-acquisition-dialog">
@ -17,7 +17,7 @@
:label="$t('qc.iqcPage.equipmentType')"
header-align="center"
align="left"
min-width="240"
min-width="180"
show-overflow-tooltip>
<template slot-scope="scope">
<span class="equipment-type-text">{{ scope.row.equipmentDesc || scope.row.equipmentNo }}</span>
@ -27,13 +27,46 @@
:label="$t('qc.iqcPage.whetherCollect')"
header-align="center"
align="center"
width="110">
width="100">
<template slot-scope="scope">
<el-switch
v-model="scope.row.collectFlag"
:active-text="$t('qc.common.yes')"
:inactive-text="$t('qc.common.no')"
class="collect-flag-switch">
class="collect-flag-switch"
@change="onCollectFlagChange(scope.row)">
</el-switch>
</template>
</el-table-column>
<el-table-column
:label="$t('qc.iqcPage.accumulateCollect')"
header-align="center"
align="center"
width="110">
<template slot-scope="scope">
<el-switch
v-model="scope.row.accumulateCollect"
:disabled="!scope.row.collectFlag"
:active-text="$t('qc.common.yes')"
:inactive-text="$t('qc.common.no')"
class="collect-flag-switch"
@change="onAccumulateChange(scope.row)">
</el-switch>
</template>
</el-table-column>
<el-table-column
:label="$t('qc.iqcPage.deleteAfterCollect')"
header-align="center"
align="center"
width="120">
<template slot-scope="scope">
<el-switch
v-model="scope.row.deleteAfterCollect"
:disabled="!scope.row.collectFlag"
:active-text="$t('qc.common.yes')"
:inactive-text="$t('qc.common.no')"
class="collect-flag-switch"
@change="onDeleteAfterChange(scope.row)">
</el-switch>
</template>
</el-table-column>
@ -89,6 +122,47 @@ export default {
}
},
methods: {
normalizeCollectMode (item) {
const accumulate = item.accumulateCollect === true || item.accumulateCollect === 1
const deleteAfter = item.deleteAfterCollect === true || item.deleteAfterCollect === 1
if (accumulate && !deleteAfter) {
item.accumulateCollect = true
item.deleteAfterCollect = false
} else {
item.accumulateCollect = false
item.deleteAfterCollect = true
}
return item
},
onCollectFlagChange (row) {
if (row.collectFlag) {
if (!row.accumulateCollect && !row.deleteAfterCollect) {
row.deleteAfterCollect = true
}
}
},
onAccumulateChange (row) {
if (!row.collectFlag) {
row.accumulateCollect = false
return
}
if (row.accumulateCollect) {
row.deleteAfterCollect = false
} else {
row.deleteAfterCollect = true
}
},
onDeleteAfterChange (row) {
if (!row.collectFlag) {
row.deleteAfterCollect = false
return
}
if (row.deleteAfterCollect) {
row.accumulateCollect = false
} else {
row.accumulateCollect = true
}
},
loadEquipmentList () {
this.loading = true
this.equipmentList = []
@ -100,7 +174,7 @@ export default {
this.loading = false
if (data && data.code === 0) {
this.firstTime = !!data.firstTime
this.equipmentList = (data.rows || []).map(item => ({
this.equipmentList = (data.rows || []).map(item => this.normalizeCollectMode({
...item,
collectFlag: item.collectFlag !== false
}))
@ -118,24 +192,34 @@ export default {
})
},
handleCollect () {
const selected = this.equipmentList
.filter(item => item.collectFlag)
.map(item => item.equipmentNo)
.filter(Boolean)
const selectedRows = this.equipmentList.filter(item => item.collectFlag)
const selected = selectedRows.map(item => item.equipmentNo).filter(Boolean)
if (!selected.length) {
this.$message.warning(this.$t('qc.entry.dataCollectSelectEquipment'))
return
}
this.doCollect(selected, false)
const invalid = selectedRows.some(item => !item.accumulateCollect && !item.deleteAfterCollect)
if (invalid) {
this.$message.warning(this.$t('qc.entry.dataCollectSelectMode'))
return
}
this.doCollect(selectedRows, false)
},
doCollect (equipmentNoList, confirmNewBatch) {
doCollect (selectedRows, confirmNewBatch) {
this.submitting = true
const equipmentNoList = selectedRows.map(item => item.equipmentNo).filter(Boolean)
const equipmentCollectList = selectedRows.map(item => ({
equipmentNo: item.equipmentNo,
accumulateCollect: !!item.accumulateCollect,
deleteAfterCollect: !!item.deleteAfterCollect
}))
dataAcquisition({
site: this.site,
buNo: this.buNo,
inspectionNo: this.inspectionNo,
flag: this.flag,
equipmentNoList,
equipmentCollectList,
confirmNewBatch
}).then(({ data }) => {
if (data && data.code === 0 && data.needConfirm) {
@ -149,7 +233,7 @@ export default {
type: 'warning'
}
).then(() => {
this.doCollect(equipmentNoList, true)
this.doCollect(selectedRows, true)
}).catch(() => {})
return
}

27
cclqms-vue/src/views/modules/qc/SQCResultEntry.vue

@ -1576,17 +1576,20 @@
detailData: {
deep: true,
handler: function (newV, oldV) {
this.detailData.notPassQty = this.detailData.samplingQty - this.detailData.passQty
const samplingQty = this.toQty(this.detailData.samplingQty)
const passQty = this.toQty(this.detailData.passQty)
const rollQty = this.toQty(this.detailData.rollQty)
this.detailData.notPassQty = samplingQty - passQty
if (this.detailData.inspectionResult === '不合格') {
if (this.detailData.disposalMeasures === '让步接收') {
this.detailData.batchQualifiedQty = this.detailData.rollQty
this.detailData.batchQualifiedQty = rollQty
} else if (this.detailData.disposalMeasures === '返工返修' || this.detailData.disposalMeasures === '拒收退回') {
this.detailData.batchQualifiedQty = 0
} else if (this.detailData.disposalMeasures === '挑选使用') {
this.detailData.batchQualifiedQty = this.detailData.rollQty - this.detailData.notPassQty
this.detailData.batchQualifiedQty = rollQty - this.toQty(this.detailData.notPassQty)
}
} else if (this.detailData.inspectionResult === '合格'){
this.detailData.batchQualifiedQty = this.detailData.rollQty
this.detailData.batchQualifiedQty = rollQty
}
// this.detailData.notPassQty = this.detailData.samplingQty - this.detailData.passQty
// if (this.detailData.inspectionResult === '不合格') {
@ -3510,6 +3513,12 @@
qcPrint(this.SQCSelections)
},
/** 数量空值/非法值参与计算时按 0 */
toQty (val) {
if (val === null || val === undefined || val === '') return 0
const n = Number(val)
return isNaN(n) ? 0 : n
},
// 数据采集
dataAcquisition () {
this.dataAcquisitionDialogVisible = true
@ -6489,8 +6498,8 @@
.latest-parse-time {
color: #67c23a;
font-size: 13px;
font-weight: 600;
font-size: 11px;
font-weight: 500;
white-space: nowrap;
margin-left: 12px;
display: inline-flex;
@ -6500,11 +6509,11 @@
.latest-parse-time::before {
content: '';
display: inline-block;
width: 8px;
height: 8px;
width: 6px;
height: 6px;
border-radius: 50%;
background-color: #67c23a;
margin-right: 6px;
margin-right: 5px;
flex-shrink: 0;
}

Loading…
Cancel
Save