Browse Source

2026-06-26

优化
master
fengyuan_yang 1 month ago
parent
commit
d1cf689a1f
  1. 115
      src/views/modules/qualityAssurance/unqualifiedInspectionReasons.vue
  2. 1
      src/views/modules/yieldReport/com_produce_down.vue

115
src/views/modules/qualityAssurance/unqualifiedInspectionReasons.vue

@ -46,7 +46,8 @@
:min-width="item.columnWidth" :min-width="item.columnWidth"
:label="item.columnLabel"> :label="item.columnLabel">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
<span v-if="!item.columnHidden && item.columnProp !== 'workCenterNo'"> {{scope.row[item.columnProp]}}</span>
<span v-if="!item.columnHidden && item.columnProp === 'workCenterNo'"> {{getWorkCenterDesc(scope.row[item.columnProp])}}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span> style="width: 100px; height: 80px"/></span>
</template> </template>
@ -77,6 +78,16 @@
<el-form-item :label="labels.defectDesc"> <el-form-item :label="labels.defectDesc">
<el-input v-model="modelData.defectDesc" style="width: 130px"></el-input> <el-input v-model="modelData.defectDesc" style="width: 130px"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="labels.workCenterNo">
<el-select v-model="modelData.workCenterNo" clearable filterable placeholder="请选择加工中心" style="width: 130px">
<el-option
v-for="i in workCenterList"
:key="i.workCenterNo"
:label="i.workCenterDesc"
:value="i.workCenterNo">
</el-option>
</el-select>
</el-form-item>
</el-form> </el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center"> <el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="ModelSave()">{{buttons.save}}</el-button> <el-button type="primary" @click="ModelSave()">{{buttons.save}}</el-button>
@ -102,6 +113,7 @@
saveUnqualifiedInspectionReasonsData, saveUnqualifiedInspectionReasonsData,
deleteUnqualifiedInspectionReasonsData deleteUnqualifiedInspectionReasonsData
} from "@/api/qualityAssurance/unqualifiedInspectionReasons.js" } from "@/api/qualityAssurance/unqualifiedInspectionReasons.js"
import { getWorkCenterList } from "@/api/orderIssure/soIssueNotify.js"
import { import {
searchFunctionButtonList, searchFunctionButtonList,
@ -147,6 +159,7 @@
site:'', site:'',
inspectionType:'', inspectionType:'',
inspectionTypeDb:'', inspectionTypeDb:'',
workCenterNo:'',
defectCode:'', defectCode:'',
defectDesc:'', defectDesc:'',
active:'', active:'',
@ -154,6 +167,7 @@
}, },
dataList:[], dataList:[],
dataListLoading: false, dataListLoading: false,
workCenterList: [],
columnList: [ columnList: [
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
@ -209,6 +223,24 @@
fixed: '', fixed: '',
columnWidth: 300 columnWidth: 300
}, },
{
userId: this.$store.state.user.name,
functionId: 101001,
serialNumber: '101001TableWorkCenterNo',
tableId: "101001Table",
tableName: "检验不合格原因表",
columnProp: "workCenterNo",
headerAlign: "center",
align: "left",
columnLabel: "加工中心",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 35,
status: true,
fixed: '',
columnWidth: 120
},
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 101001, functionId: 101001,
@ -260,6 +292,7 @@
active:'在用:', active:'在用:',
defectCode:'原因代码:', defectCode:'原因代码:',
defectDesc:'原因描述', defectDesc:'原因描述',
workCenterNo:'加工中心:',
inspectionBuy:'采购进料检验', inspectionBuy:'采购进料检验',
inspectionProduct:'生产过程检验', inspectionProduct:'生产过程检验',
}, },
@ -290,7 +323,9 @@
modelData: { modelData: {
deep: true, deep: true,
handler: function (newV, oldV) { handler: function (newV, oldV) {
this.modelData.defectCode = this.modelData.defectCode.toUpperCase()
if (this.modelData.defectCode) {
this.modelData.defectCode = this.modelData.defectCode.toUpperCase()
}
} }
} }
}, },
@ -308,17 +343,42 @@
this.dataList = data.rows this.dataList = data.rows
}) })
}, },
loadWorkCenterList() {
const inData = {
username: this.$store.state.user.name
}
getWorkCenterList(inData).then(({data}) => {
if (data && data.code === 0) {
this.workCenterList = data.rows || []
}
})
},
getWorkCenterDesc(workCenterNo) {
if (!workCenterNo) {
return ''
}
const target = this.workCenterList.find(item => item.workCenterNo === workCenterNo)
return target ? target.workCenterDesc : workCenterNo
},
addModal(){ addModal(){
this.modelData={};
this.modelData.site=this.$store.state.user.site;
this.modelData.add=0;
this.modelData = {
add: 0,
site: this.$store.state.user.site,
inspectionType: '',
inspectionTypeDb: '',
workCenterNo: '',
defectCode: '',
defectDesc: '',
active: 'Y',
user: ''
};
this.modelInputFlag=false; this.modelInputFlag=false;
this.modelData.active='Y';
this.modelFlag=true; this.modelFlag=true;
}, },
editModel(row){ editModel(row){
this.modelData=JSON.parse(JSON.stringify(row)); this.modelData=JSON.parse(JSON.stringify(row));
this.modelData.add=1; this.modelData.add=1;
this.modelData.workCenterNo = this.modelData.workCenterNo || '';
this.modelInputFlag=true; this.modelInputFlag=true;
this.modelFlag=true; this.modelFlag=true;
}, },
@ -341,6 +401,12 @@
}) })
return false; return false;
} }
if(this.modelData.workCenterNo==''||this.modelData.workCenterNo==null){
this.$alert("请选择加工中心!",'错误',{
confirmButtonText:'确定'
})
return false;
}
if(this.modelData.active==''||this.modelData.active==null){ if(this.modelData.active==''||this.modelData.active==null){
this.$alert("请选择是否在用!",'错误',{ this.$alert("请选择是否在用!",'错误',{
confirmButtonText:'确定' confirmButtonText:'确定'
@ -383,7 +449,8 @@
}).then(() => { }).then(() => {
let inData = { let inData = {
defectCode: row.defectCode, defectCode: row.defectCode,
site:row.site
site:row.site,
workCenterNo: row.workCenterNo
} }
deleteUnqualifiedInspectionReasonsData(inData).then(({data}) => { deleteUnqualifiedInspectionReasonsData(inData).then(({data}) => {
if (data && data.code == 200) { if (data && data.code == 200) {
@ -449,7 +516,7 @@
// //
searchFunctionButtonList(this.queryButton).then(({data}) => { searchFunctionButtonList(this.queryButton).then(({data}) => {
if (data.code == 0) { if (data.code == 0) {
this.buttons = data.data
this.buttons = Object.assign({}, this.buttons, data.data)
} else { } else {
// saveButtonList(this.buttonList).then(({data}) => { // saveButtonList(this.buttonList).then(({data}) => {
// }) // })
@ -458,7 +525,7 @@
// //
searchFunctionButtonList(this.queryLabel).then(({data}) => { searchFunctionButtonList(this.queryLabel).then(({data}) => {
if (data.code == 0) { if (data.code == 0) {
this.labels = data.data
this.labels = Object.assign({}, this.labels, data.data)
} else { } else {
// saveButtonList(this.buttonList).then(({data}) => { // saveButtonList(this.buttonList).then(({data}) => {
// }) // })
@ -484,7 +551,7 @@
getTableUserListLanguage(this.queryTableUser).then(({data}) => { getTableUserListLanguage(this.queryTableUser).then(({data}) => {
if (data.rows.length > 0) { if (data.rows.length > 0) {
//this.columnList = [] //this.columnList = []
this.columnList = data.rows
this.columnList = this.ensureWorkCenterColumn(data.rows)
} else { } else {
this.getColumnList() this.getColumnList()
} }
@ -495,16 +562,42 @@
getTableDefaultListLanguage(this.queryTable).then(({data}) => { getTableDefaultListLanguage(this.queryTable).then(({data}) => {
if (!data.rows.length == 0) { if (!data.rows.length == 0) {
// this.showDefault = false // this.showDefault = false
this.columnList = data.rows
this.columnList = this.ensureWorkCenterColumn(data.rows)
} else { } else {
// this.showDefault = true // this.showDefault = true
} }
}) })
}, },
ensureWorkCenterColumn(columnList = []) {
const hasWorkCenter = columnList.some(item => item.columnProp === 'workCenterNo')
if (hasWorkCenter) {
return columnList
}
const workCenterColumn = {
userId: this.$store.state.user.name,
functionId: 101001,
serialNumber: '101001TableWorkCenterNo',
tableId: "101001Table",
tableName: "检验不合格原因表",
columnProp: "workCenterNo",
headerAlign: "center",
align: "left",
columnLabel: "加工中心",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 35,
status: true,
fixed: '',
columnWidth: 120
}
return [...columnList, workCenterColumn]
},
}, },
created() { created() {
this.getMultiLanguageList()// this.getMultiLanguageList()//
this.getData(); this.getData();
this.loadWorkCenterList();
// //
this.getButtonAuthData(); this.getButtonAuthData();
this.getTableUserColumn() this.getTableUserColumn()

1
src/views/modules/yieldReport/com_produce_down.vue

@ -251,7 +251,6 @@ export default {
// //
init(scheduleData, operatorData) { init(scheduleData, operatorData) {
console.log(scheduleData)
// //
this.scheduleData = scheduleData; this.scheduleData = scheduleData;
// //

Loading…
Cancel
Save