This commit is contained in:
TianyangZhang 2025-12-03 09:37:58 +08:00
commit b25d87ea89
6 changed files with 65 additions and 48 deletions

View File

@ -291,13 +291,13 @@ export default {
}, },
// //
refresh() { refresh() {
this.$refs.scTable.clearSelection(); // this.$refs.scTable.clearSelection();
this.getData(); this.getData();
}, },
// query // query
upData(query, page = 1) { upData(query, page = 1) {
this.currentPage = page; this.currentPage = page;
this.$refs.scTable.clearSelection(); // this.$refs.scTable.clearSelection();
Object.assign(this.tableParams, query); Object.assign(this.tableParams, query);
this.getData(); this.getData();
}, },
@ -305,7 +305,7 @@ export default {
queryData(query, page = 1) { queryData(query, page = 1) {
this.currentPage = page; this.currentPage = page;
Object.assign(this.tableParams, query); Object.assign(this.tableParams, query);
this.$refs.scTable.clearSelection(); // this.$refs.scTable.clearSelection();
this.$refs.scTable.clearFilter(); this.$refs.scTable.clearFilter();
this.getData(); this.getData();
}, },

View File

@ -321,15 +321,21 @@ export default {
that.initChartOptions(); that.initChartOptions();
}, },
initChartOptions() { initChartOptions() {
this.$API.bi.dataset.exec.req("materialCount", {query: { let that = this;
let query = {
"select_dept": "", "select_dept": "",
"groupby_dept": "", "groupby_dept": "",
"material_types": this.params.type, "material_types": this.params.type,
"select_material": "material.cate as cate", "select_material": "",
"groupby_material": "material.cate", "groupby_material": ""
"select_material_name": "", };
"groupby_material_name": "" if(that.params.type==40){
}}).then((res) => { query.select_material="material.cate as cate";
query.groupby_material="material.cate";
query.select_material_name = "";
query.groupby_material_name = "";
}
this.$API.bi.dataset.exec.req("materialCount", {query:query }).then((res) => {
if (res.echart_options) { if (res.echart_options) {
this.echartsOptions = JSON.parse(res.echart_options); this.echartsOptions = JSON.parse(res.echart_options);
} }

View File

@ -613,7 +613,7 @@ export default {
that.change_batch = true; that.change_batch = true;
} }
that.form.handoverb = data?data:[]; that.form.handoverb = data?data:[];
if(data.length>0){ if(data&&data!==''&&data.length>0){
that.totalCount = 0; that.totalCount = 0;
data.forEach((item,index)=>{ data.forEach((item,index)=>{
that.totalCount += Number(item.count); that.totalCount += Number(item.count);

View File

@ -882,7 +882,8 @@ export default {
saveMuserSubmit(row){ saveMuserSubmit(row){
let that = this; let that = this;
that.isSaveing = true; that.isSaveing = true;
that.$API.wpm.mloguser.create.req(that.addTemplate).then((res) => { row.mlog = that.mlogId;
that.$API.wpm.mloguser.create.req(row).then((res) => {
that.isSaveing = false; that.isSaveing = false;
that.$message.success("操作成功"); that.$message.success("操作成功");
that.getProcessList(); that.getProcessList();
@ -895,7 +896,7 @@ export default {
that.$confirm("确定删除吗?").then(res=>{ that.$confirm("确定删除吗?").then(res=>{
that.$API.wpm.mloguser.delete.req(row.id).then((res) => { that.$API.wpm.mloguser.delete.req(row.id).then((res) => {
that.$message.success("删除成功"); that.$message.success("删除成功");
that.$refs.tableMuser.refresh(); that.getProcessList();
}) })
}) })
}, },

View File

@ -36,6 +36,7 @@
:addTemplate="addTemplate" :addTemplate="addTemplate"
placeholder="暂无数据" placeholder="暂无数据"
:hideAdd="hideAdd" :hideAdd="hideAdd"
:pushType="pushType"
:canMultiple = "canMultiple" :canMultiple = "canMultiple"
@selectChange="selectChange" @selectChange="selectChange"
@selectAllChange="selectAllChange" @selectAllChange="selectAllChange"
@ -46,10 +47,11 @@
<span v-if="mode == 'outs'">{{ scope.row.number }}</span> <span v-if="mode == 'outs'">{{ scope.row.number }}</span>
<span v-if="mode == 'outs'&&scope.row.wpr_number_out!==null&&scope.row.wpr_number_out!==undefined">{{ scope.row.wpr_number_out }}</span> <span v-if="mode == 'outs'&&scope.row.wpr_number_out!==null&&scope.row.wpr_number_out!==undefined">{{ scope.row.wpr_number_out }}</span>
<el-select <el-select
v-if="scope.row.isEdit&&mode == 'ins'&&route_code!=='niuzhuan'" v-if="scope.row.isEdit&&mode == 'ins'"
v-model="scope.row.wpr" v-model="scope.row.wpr"
placeholder="动态成品" placeholder="动态成品"
clearable clearable
filterable
style="width: 100%" style="width: 100%"
@change="optionChange(scope.row)" @change="optionChange(scope.row)"
> >
@ -507,6 +509,7 @@ export default {
wprNumber:"", wprNumber:"",
route_code:"", route_code:"",
wprInputText:"", wprInputText:"",
pushType:"unshift",
params: {mlogb:'',page:0}, params: {mlogb:'',page:0},
insInput:false, insInput:false,
canMultiple:false, canMultiple:false,
@ -582,7 +585,9 @@ export default {
} }
if(that.mode == 'ins'){ if(that.mode == 'ins'){
if(that.route_code=='niuzhuan'){ if(that.route_code=='niuzhuan'){
that.getEquipment4();
that.gettestitem(); that.gettestitem();
that.getOptions();
}else{ }else{
that.getOptions(); that.getOptions();
that.getList(); that.getList();
@ -910,9 +915,9 @@ export default {
}, },
formTableEdit(row) { formTableEdit(row) {
let that = this; let that = this;
if(that.route_code=='niuzhuan'&&that.optionsEq.length==0){ // if(that.route_code=='niuzhuan'&&that.optionsEq.length==0){
that.getEquipment4(); // that.getEquipment4();
} // }
that.mlogbwlist.forEach((item, index) => { that.mlogbwlist.forEach((item, index) => {
if (item.id == row.id) { if (item.id == row.id) {
that.mlogbwlist[index].isEdit = true; that.mlogbwlist[index].isEdit = true;
@ -1170,9 +1175,9 @@ export default {
that.mlogbwlist[0].work_start_time = that.$TOOL.dateFormat(date, 'yyyy-MM-dd hh:mm:ss'); that.mlogbwlist[0].work_start_time = that.$TOOL.dateFormat(date, 'yyyy-MM-dd hh:mm:ss');
that.timeChange(that.mlogbwlist[0]); that.timeChange(that.mlogbwlist[0]);
} }
if(that.optionsEq.length==0){ // if(that.optionsEq.length==0){
that.getEquipment4(); // that.getEquipment4();
} // }
} }
if(that.setForm.cd_req_addr!==null&&!that.insInput){ if(that.setForm.cd_req_addr!==null&&!that.insInput){
//cd_req_addr, //cd_req_addr,

View File

@ -204,7 +204,7 @@
<el-row> <el-row>
<el-col v-for="item2 in defectlists" :key="item2.id" :span="12"> <el-col v-for="item2 in defectlists" :key="item2.id" :span="12">
<el-form-item :label="item2.defect_name"> <el-form-item :label="item2.defect_name">
<el-switch v-model="item2.value"></el-switch> <el-switch v-model="item2.value" @change="defect_change(item2)"></el-switch>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col> <el-col>
@ -216,11 +216,13 @@
</el-row> </el-row>
</el-form> </el-form>
<el-row> <el-row>
<el-table :data="selectWpr" border> <el-table :data="selectWprList" border>
<el-table-column type="index"></el-table-column> <el-table-column type="index"></el-table-column>
<el-table-column prop="number" label="物料编号"></el-table-column> <el-table-column prop="number" label="物料编号"></el-table-column>
<el-table-column v-for="item2 in defectlists" :key="item2.id" :label="item2.defect_name"> <el-table-column v-for="item2 in defectlists" :key="item2.id" :label="item2.defect_name">
<el-switch v-model="item2.value" disabled></el-switch> <template #default="scope">
<el-switch v-model="scope.row[item2.defect_name]" disabled></el-switch>
</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="90" align="center" fixed="right"> <el-table-column label="操作" width="90" align="center" fixed="right">
<template #default="scope"> <template #default="scope">
@ -231,7 +233,7 @@
</el-row> </el-row>
<el-footer> <el-footer>
<el-button type="primary" :loading="isSaveing" @click.stop="saveSetting" save>保存</el-button> <el-button type="primary" :loading="isSaveing" @click.stop="saveSetting" save>保存</el-button>
<el-button @click="saveCancel">取消</el-button> <el-button @click="saveSettingCancel">取消</el-button>
</el-footer> </el-footer>
</el-main> </el-main>
</el-container> </el-container>
@ -366,7 +368,6 @@ export default {
selectWprList:[], selectWprList:[],
selectedindexes:[], selectedindexes:[],
qct_defects_origin:[], qct_defects_origin:[],
selectWpr:[],
tableHeight:500, tableHeight:500,
apiObjPrint:this.$API.cm.labelmat.fromWm, apiObjPrint:this.$API.cm.labelmat.fromWm,
printer_name:localStorage.getItem("printer_name") printer_name:localStorage.getItem("printer_name")
@ -488,15 +489,6 @@ export default {
that.options = res; that.options = res;
}) })
}, },
optionChange(row){
let that = this;
that.options.forEach((item) => {
if(item.id == row.wpr){
let index = that.mlogbwlist.indexOf(row);
that.mlogbwlist[index].number = item.number;
}
})
},
getList(){ getList(){
let that = this; let that = this;
let params = {}; let params = {};
@ -766,7 +758,7 @@ export default {
that.qct_defects.forEach(item => { that.qct_defects.forEach(item => {
if(that.form.defectids.indexOf(item.defect) > -1){ if(that.form.defectids.indexOf(item.defect) > -1){
item.canEdit = true; item.canEdit = true;
item.value=null; item.value=false;
that.defectlists.push(item); that.defectlists.push(item);
} }
}) })
@ -783,7 +775,7 @@ export default {
if(that.checkAll){ if(that.checkAll){
that.qct_defects.forEach(item => { that.qct_defects.forEach(item => {
item.canEdit = true; item.canEdit = true;
item.value=null; item.value=false;
that.defectlists.push(item); that.defectlists.push(item);
that.form.defectids.push(item.defect); that.form.defectids.push(item.defect);
}) })
@ -823,7 +815,6 @@ export default {
that.qct_testitems = []; that.qct_testitems = [];
that.qct_testitems = that.testitemlists; that.qct_testitems = that.testitemlists;
that.tableHeight = document.getElementById('mlogbwMain').clientHeight-80; that.tableHeight = document.getElementById('mlogbwMain').clientHeight-80;
// that.getList();
}).catch(() => { }).catch(() => {
that.isSaveing = false; that.isSaveing = false;
}) })
@ -838,13 +829,11 @@ export default {
this.form.defectids = []; this.form.defectids = [];
this.checkVisible = false; this.checkVisible = false;
}, },
//
check_set(){ check_set(){
this.wprNumber = ""; let that = this;
this.selectWpr = []; that.wprNumber = "";
if(this.selectWprList.length>0){ that.setVisible=true;
this.selectWpr = this.selectWprList;
}
this.setVisible=true;
}, },
// //
wprinputChange(){ wprinputChange(){
@ -912,24 +901,30 @@ export default {
let that = this; let that = this;
that.mlogbwlist.forEach(item => { that.mlogbwlist.forEach(item => {
if(item.number == wprNumber){ if(item.number == wprNumber){
that.selectWpr.push(item); that.selectWprList.push(item);
that.wprNumber = ""; that.wprNumber = "";
} }
}); });
}, },
selectWprDel(row){ selectWprDel(row){
let that = this; let that = this;
that.selectWpr.forEach((item,index) => { that.selectWprList.forEach((item,index) => {
if(item.number == row.number){ if(item.number == row.number){
that.selectWpr.splice(index,1); that.selectWprList.splice(index,1);
} }
}); });
}, },
defect_change(item){
let that = this;
that.selectWprList.forEach(row => {
row[item.defect_name] = item.value;
});
},
saveSetting(){ saveSetting(){
let that = this; let that = this;
that.$refs.dialogForm.validate((valid) => { that.$refs.dialogForm.validate((valid) => {
if (valid) { if (valid) {
that.selectWpr.forEach(item => { that.selectWprList.forEach(item => {
if(!item.ftest){ if(!item.ftest){
item.ftest = {}; item.ftest = {};
} }
@ -938,12 +933,12 @@ export default {
that.defectlists.forEach((item1) => { that.defectlists.forEach((item1) => {
let obj = {}; let obj = {};
obj.defect = item1.defect; obj.defect = item1.defect;
obj.has = item1.value; obj.has = item[item1.defect_name]?item[item1.defect_name]:false;
item.ftest.ftestdefects.push(obj); item.ftest.ftestdefects.push(obj);
}) })
} }
}); });
that.$API.wpm.mlogbw.update.req("bulk",that.selectWpr).then((res) => { that.$API.wpm.mlogbw.update.req("bulk",that.selectWprList).then((res) => {
that.setVisible = false; that.setVisible = false;
that.selectedAll = false; that.selectedAll = false;
that.selectWprList = []; that.selectWprList = [];
@ -958,6 +953,16 @@ export default {
} }
}); });
}, },
saveSettingCancel(){
let that = this;
that.setVisible = false;
that.selectedAll = false;
that.selectWprList = [];
that.selectedindexes = [];
// that.defectlists.forEach(item => {
// item.value = false;
// });
},
}, },
}; };
</script> </script>