This commit is contained in:
caoqianming 2025-10-28 12:59:43 +08:00
commit 454294302d
8 changed files with 199 additions and 106 deletions

View File

@ -124,12 +124,16 @@
}, },
// //
select(rows, row){ select(rows, row){
var isSelect = rows.length && rows.indexOf(row) !== -1&& this.defaultValue.indexOf(row) !== -1 var isSelect = rows.length && rows.indexOf(row) !== -1;
if(isSelect){ if(isSelect){//
if(this.defaultValue.indexOf(row) == -1){
this.defaultValue.push(row) this.defaultValue.push(row)
}else{ }
}else{//
if(this.defaultValue.indexOf(row) !== -1){
this.defaultValue.splice(this.defaultValue.findIndex(item => item.id == row.id), 1) this.defaultValue.splice(this.defaultValue.findIndex(item => item.id == row.id), 1)
} }
}
this.$emit('selectChange', this.defaultValue); this.$emit('selectChange', this.defaultValue);
}, },
// //
@ -147,6 +151,11 @@
} }
this.$emit('selectAllChange', this.defaultValue); this.$emit('selectAllChange', this.defaultValue);
}, },
clearSelection(){
let that = this;
that.defaultValue = [];
this.$emit('selectChange', this.defaultValue);
},
setCurrentRows(row){ setCurrentRows(row){
let that = this; let that = this;
that.$nextTick(() => { that.$nextTick(() => {

View File

@ -562,8 +562,8 @@ export default {
// that.getnumberOutLast(); // that.getnumberOutLast();
that.form.batch = items.batch; that.form.batch = items.batch;
that.form.mb = items.id; that.form.mb = items.id;
that.batchcount = Number(items.count); that.batchcount = Number(items.count_canmio);
that.form.count = Number(items.count); that.form.count = Number(items.count_canmio);
that.form.warehouse = items.warehouse; that.form.warehouse = items.warehouse;
that.inputBatchDisable = true; that.inputBatchDisable = true;
} }

View File

@ -473,6 +473,9 @@ export default {
that.routeId = data.id; that.routeId = data.id;
that.addTemplate.route = data.id; that.addTemplate.route = data.id;
that.params_json=that.form.params_json; that.params_json=that.form.params_json;
if((this.project_code=='bxerp'||this.project_code=='tcerp')&&this.form.material_out_tracking==null){
this.form.material_out_tracking = 20;
}
setTimeout(() => { setTimeout(() => {
that.options.forEach((item) => { that.options.forEach((item) => {
if (item.id == data.process) { if (item.id == data.process) {

View File

@ -10,6 +10,7 @@
<el-select <el-select
v-model="params.type" v-model="params.type"
clearable clearable
style="width: 120px;"
@change="materialTypeChange" @change="materialTypeChange"
> >
<el-option <el-option
@ -20,6 +21,19 @@
> >
</el-option> </el-option>
</el-select> </el-select>
<xtSelect
:apiObj="apiObj"
v-model="query.material"
v-model:obj="selectObj"
:labelField="'name'"
style="width: 150px;"
:params="mquery"
@change="selectMaterialChange"
>
<el-table-column label="名称" prop="name"></el-table-column>
<el-table-column label="型号" prop="model"></el-table-column>
<el-table-column label="规格" prop="spcification"></el-table-column>
</xtSelect>
<el-button <el-button
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@ -67,6 +81,7 @@
id="exportDiv11" id="exportDiv11"
stripe stripe
hideDo hideDo
:pageSize="500"
:summary-method="getSummaries2" :summary-method="getSummaries2"
show-summary show-summary
> >
@ -228,16 +243,28 @@ export default {
materialType: "", materialType: "",
params: { is_hidden: false, type: 10, count__gte: 1 }, params: { is_hidden: false, type: 10, count__gte: 1 },
query: { query: {
material: "",
mio_type: mioTypeEnum.values[0].key, mio_type: mioTypeEnum.values[0].key,
}, },
mquery:{
page: 0,
type__in: "10",
is_hidden: false,
is_assemb: false,
},
selectObj: {},
mio_type_name: mioTypeEnum.values[0].text, mio_type_name: mioTypeEnum.values[0].text,
queryType: "月", queryType: "",
queryDate: "", queryDate: "",
start_date: "", start_date: "",
end_date: "", end_date: "",
currentYear: "", currentYear: "",
currentMonth: "", currentMonth: "",
currentLastDay: "", currentLastDay: "",
material_name: "",
material_type: "",
material_model: "",
material_specification: "",
tableData: [], tableData: [],
tableData1: [], tableData1: [],
tableData11: [], tableData11: [],
@ -258,7 +285,6 @@ export default {
{ id: 20, name: "半成品" }, { id: 20, name: "半成品" },
{ id: 30, name: "主要原料" }, { id: 30, name: "主要原料" },
{ id: 40, name: "辅助材料" }, { id: 40, name: "辅助材料" },
{ id: 70, name: "办公用品" },
], ],
}; };
}, },
@ -271,9 +297,9 @@ export default {
that.currentYear = year; that.currentYear = year;
that.currentMonth = month > 9 ? month : "0" + month; that.currentMonth = month > 9 ? month : "0" + month;
that.currentLastDay = lastDay; that.currentLastDay = lastDay;
that.queryDate = that.currentYear + "-" + that.currentMonth; that.queryDate = that.currentYear+'';
that.start_date = that.currentYear + "-" + that.currentMonth + "-01"; that.start_date = that.currentYear + "-01-01";
that.end_date = that.currentYear + "-" + that.currentMonth + "-" + lastDay; that.end_date = that.currentYear + "-12-31";
that.getTableData(); that.getTableData();
that.getTableData1(); that.getTableData1();
}, },
@ -340,6 +366,9 @@ export default {
that.modelFilters11 = []; that.modelFilters11 = [];
that.specsFilters11 = []; that.specsFilters11 = [];
let nameList=[],specsList=[],modelList=[]; let nameList=[],specsList=[],modelList=[];
if(that.material_name!==''&&that.material_name!==null){
that.params.name = that.material_name;
}
this.$API.mtm.material.list.req(that.params).then((res) => { this.$API.mtm.material.list.req(that.params).then((res) => {
that.tableData11 = res.results; that.tableData11 = res.results;
if(res.results.length>0){ if(res.results.length>0){
@ -371,11 +400,14 @@ export default {
}, },
materialTypeChange(){ materialTypeChange(){
let that = this; let that = this;
that.mquery.type__in = that.params.type;
that.material_type = that.params.type;
if(that.params.type == 10 || that.params.type == 20){ if(that.params.type == 10 || that.params.type == 20){
that.getTableData1(); that.getTableData1();
}else{ }else{
that.getTableData11(); that.getTableData11();
} }
that.getTableData();
}, },
// //
weekcountChange(row) { weekcountChange(row) {
@ -400,6 +432,18 @@ export default {
mio_type: that.query.mio_type, mio_type: that.query.mio_type,
}, },
}; };
if(that.material_name!==''&&that.material_name!==null){
obj.query.material_name = that.material_name;
}
if(that.material_type!==''&&that.material_type!==null){
obj.query.material_type = that.material_type;
}
if(that.material_model!==''&&that.material_model!==null){
obj.query.material_model = that.material_model;
}
if(that.material_specification!==''&&that.material_specification!==null){
obj.query.material_specification = that.material_specification;
}
that.$API.bi.dataset.exec.req(exec, obj).then((res) => { that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
if (res.data2.ds0) { if (res.data2.ds0) {
let data = res.data2.ds0; let data = res.data2.ds0;
@ -447,6 +491,16 @@ export default {
} }
this.getTableData(); this.getTableData();
}, },
selectMaterialChange() {
var that = this;
console.log(that.selectObj);
that.query.material = that.selectObj.id;
that.material_name = that.selectObj.name;
that.material_type = that.selectObj.type;
that.material_model = that.selectObj.model;
that.material_specification = that.selectObj.specification;
that.getTableData();
},
handleQuery() { handleQuery() {
let that = this; let that = this;
if (that.queryType == "月") { if (that.queryType == "月") {
@ -523,25 +577,25 @@ export default {
}, },
filterName1(value, row) { filterName1(value, row) {
return row.物料名 == value; return row.material_name == value;
}, },
filterSpecs1(value, row) { filterSpecs1(value, row) {
return row.规格 == value; return row.material_specification == value;
}, },
filterModel1(value, row) { filterModel1(value, row) {
return row.型号 == value; return row.material_model == value;
}, },
filterDept1(value, row) { filterDept1(value, row) {
return row.完成车间 == value; return row.dept_name == value;
}, },
filterName11(value, row) { filterName11(value, row) {
return row.物料名 == value; return row.name == value;
}, },
filterSpecs11(value, row) { filterSpecs11(value, row) {
return row.规格 == value; return row.specification == value;
}, },
filterModel11(value, row) { filterModel11(value, row) {
return row.型号 == value; return row.model == value;
}, },
filterName2(value, row) { filterName2(value, row) {
return row.物料名 == value; return row.物料名 == value;

View File

@ -33,9 +33,9 @@
<span style="margin: 0 0 0 20px;">选择物料:</span> <span style="margin: 0 0 0 20px;">选择物料:</span>
<el-input ref="codeInput" <el-input ref="codeInput"
placeholder="扫描交接物料" placeholder="扫描交接物料"
v-model="wm_in" clearable v-model="listItem.wm_in" clearable
style="width: 120px;margin: 0 10px;" style="width: 120px;margin: 0 10px;"
@change="formWminChange($index,wm_in)" @change="formWminChange($index,listItem.wm_in)"
></el-input> ></el-input>
<el-select <el-select
v-model="listItem.wpr" v-model="listItem.wpr"
@ -177,6 +177,7 @@ export default {
obj.batch = that.batchOrign.batch+"-"+that.addBactchNum; obj.batch = that.batchOrign.batch+"-"+that.addBactchNum;
that.addBactchNum++; that.addBactchNum++;
obj.count = 0; obj.count = 0;
obj.wm_in = "";
obj.handoverbw=[]; obj.handoverbw=[];
that.form.handoverb.push(obj); that.form.handoverb.push(obj);
}) })
@ -208,9 +209,28 @@ export default {
}, },
formWminChange(index,number){ formWminChange(index,number){
let that = this; let that = this;
// console.log('number',number.split(" "));
let arrs = number.split(" ");
that.form.handoverb[index].wm_in = "";
if(arrs.length>1){
that.form.handoverb[index].wpr = '';
arrs.forEach(arr=>{
that.wprOptions.forEach(item=>{
if(item.number.indexOf(arr) > -1&&!item.disabled){
item.disabled = true;
let obj = {};
obj.number = item.number;
obj.wpr = item.id;
that.form.handoverb[index].handoverbw.push(obj);
that.form.handoverb[index].count = that.form.handoverb[index].handoverbw.length;
}
})
})
}else{
//handoverbdisabled //handoverbdisabled
that.wprOptions.forEach(item=>{ that.wprOptions.forEach(item=>{
if(item.number== number){ if(item.number.indexOf(arr) > -1){
if(item.disabled){ if(item.disabled){
that.$message.error("该物料已被分配"); that.$message.error("该物料已被分配");
that.form.handoverb[index].wpr = ''; that.form.handoverb[index].wpr = '';
@ -225,6 +245,7 @@ export default {
} }
} }
}) })
}
this.$refs.codeInput.focus(); this.$refs.codeInput.focus();
}, },
deleteWpr(index1,index2,wpr){ deleteWpr(index1,index2,wpr){
@ -240,6 +261,7 @@ export default {
batchAdd(){ batchAdd(){
let that = this; let that = this;
let obj = { }; let obj = { };
obj.wm_in = "";
obj.wm = that.batchOrign.id; obj.wm = that.batchOrign.id;
obj.batch = that.batchOrign.batch+"-"+that.addBactchNum; obj.batch = that.batchOrign.batch+"-"+that.addBactchNum;
that.addBactchNum++; that.addBactchNum++;
@ -327,6 +349,7 @@ export default {
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
margin-right: 20px; margin-right: 20px;
margin-top: 5px;
} }
.circleCloseFilled{ .circleCloseFilled{
position: absolute; position: absolute;

View File

@ -93,7 +93,7 @@
min-width="150" min-width="150"
> >
<template #default="scope"> <template #default="scope">
<span v-if="route_code=='kaitaijie'" @click="rowClick(scope.row)" style="color:#0052d9;font-weight: 600;cursor: pointer;">{{scope.row.batch}}</span> <span v-if="route_code=='pengma'" @click="rowClick(scope.row)" style="color:#0052d9;font-weight: 600;cursor: pointer;">{{scope.row.batch}}</span>
<span v-else>{{scope.row.batch}}</span> <span v-else>{{scope.row.batch}}</span>
</template> </template>
</el-table-column> </el-table-column>

View File

@ -113,18 +113,18 @@
> >
<el-row> <el-row>
<el-col :span="23"> <el-col :span="23">
<el-form-item label="操作日期" required> <el-form-item label="操作时间" prop="work_start_time">
<el-date-picker <el-date-picker
v-model="muserForm.handle_date" v-model="muserForm.work_start_time"
type="date" type="datetime"
placeholder="操作日期" placeholder="操作时间"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%" style="width: 100%"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="23"> <el-col :span="23">
<el-form-item label="操作人" required> <el-form-item label="操作人" prop="handle_user">
<ehsSelect <ehsSelect
v-model="muserForm.handle_user" v-model="muserForm.handle_user"
:showName="muserForm.handle_user_name" :showName="muserForm.handle_user_name"
@ -150,7 +150,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="23"> <!-- <el-col :span="23">
<el-form-item label="关联班次" prop="shift"> <el-form-item label="关联班次" prop="shift">
<el-select <el-select
v-model="muserForm.shift" v-model="muserForm.shift"
@ -166,6 +166,23 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> -->
<el-col :span="23" v-if="route_code=='pengma'">
<el-form-item label="使用设备" prop="equipment">
<el-select
v-model="muserForm.equipment"
placeholder="设备"
class="width-100"
>
<el-option
v-for="item in equipmentOtions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
@ -509,6 +526,7 @@ export default {
shiftOtions:[], shiftOtions:[],
tableDataWm:[], tableDataWm:[],
qct_defects:[], qct_defects:[],
equipmentOtions:[],
defectOptions:[], defectOptions:[],
qct_testitems:[], qct_testitems:[],
processOptions:[], processOptions:[],
@ -528,6 +546,10 @@ export default {
count_use: [{required: true,message: "请输入领取数量",trigger: "blur"}], count_use: [{required: true,message: "请输入领取数量",trigger: "blur"}],
process:[{required: true,message: "请选择工序",trigger: "blur"}], process:[{required: true,message: "请选择工序",trigger: "blur"}],
shift:[{required: true,message: "请选择班次",trigger: "blur"}], shift:[{required: true,message: "请选择班次",trigger: "blur"}],
work_start_time:[{required: true,message: "请选择开始时间",trigger: "blur"}],
handle_user:[{required: true,message: "请选择操作人",trigger: "blur"}],
process:[{required: true,message: "请选择子工序",trigger: "blur"}],
equipment:[{required: true,message: "请选择设备",trigger: "blur"}],
}, },
route_file:null, route_file:null,
handle_date:'', handle_date:'',
@ -571,6 +593,7 @@ export default {
that.getMlogItem(); that.getMlogItem();
that.getPreocess(); that.getPreocess();
that.getShift(); that.getShift();
that.getEquipment();
}, },
methods: { methods: {
open() { open() {
@ -615,6 +638,12 @@ export default {
}) })
}); });
}, },
getEquipment(){
let that = this;
that.$API.em.equipment.list.req({page:0,belong_dept:that.dept}).then((res) => {
that.equipmentOtions = res;
})
},
// //
getcutCount(material_id){ getcutCount(material_id){
let that = this; let that = this;
@ -640,52 +669,6 @@ export default {
that.shiftOtions = res; that.shiftOtions = res;
}); });
}, },
// getdefects(qct){
// let that = this;
// if(qct!==''&&qct!==null){//
// that.$API.qm.qct.item.req(qct).then((res) => {
// that.qct_defects = [];
// that.testdefectss(res);
// })
// }else{
// that.$API.qm.qct.getQct.req({ material: that.mlogItem.material_out,type:'out',tag:'process' }).then((res) => {
// that.testdefectss(res);
// }).catch(()=>{
// // that.getList();
// })
// }
// },
// testdefectss(res){
// let that = this;
// res.qct_defects.forEach((item) => {
// that.addTemplate[item.defect_name] = false;
// let obj = Object.assign({}, item);
// that.qct_defects.push(obj);
// })
// that.qct_defects_origin = that.qct_defects;
// that.qct_testitems = [];
// res.qct_testitems.forEach((item2) => {
// if(item2.testitem_type!=='20'){
// let obj2 = Object.assign({}, item2);
// obj2.value = '';
// obj2.addto_wpr = item2.addto_wpr;
// if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){
// obj2.value = null;
// that.addTemplate[item2.testitem_name] = null;
// }
// if(item2.testitem_field_type=='select-text'||item2.testitem_field_type=='selects-text'){
// let str = obj2.testitem_choices.replace(/'/g, '"');
// let arr = JSON.parse(str);
// obj2.testitem_choices = arr;
// that.addTemplate[item2.testitem_name] = null;
// }
// that.qct_testitems.push(obj2);
// }
// })
// that.qct_testitems_origin = that.qct_testitems;
// // that.getList();
// },
//mlogbw
getMlogbw(){ getMlogbw(){
let that = this; let that = this;
let params = {}; let params = {};
@ -939,7 +922,7 @@ export default {
that.muserForm.mlog = that.mlogItem.id; that.muserForm.mlog = that.mlogItem.id;
that.muserForm.handle_user = userInfo.id; that.muserForm.handle_user = userInfo.id;
that.muserForm.handle_user_name = userInfo.name; that.muserForm.handle_user_name = userInfo.name;
that.muserForm.handle_date = this.$TOOL.dateFormat2(new Date()); that.muserForm.work_start_time = this.$TOOL.dateFormat(new Date());
that.saveMuserDialog = true; that.saveMuserDialog = true;
}, },
saveMuserSubmit (){ saveMuserSubmit (){

View File

@ -288,6 +288,7 @@
</el-form> </el-form>
<el-row> <el-row>
<el-table :data="selectWpr" border> <el-table :data="selectWpr" border>
<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> <el-switch v-model="item2.value" disabled></el-switch>
@ -489,7 +490,6 @@ export default {
selectChange(rows){ selectChange(rows){
let that = this; let that = this;
that.selectWprList = rows; that.selectWprList = rows;
console.log('selectChangerows',rows);
}, },
selectAllChange(datas){ selectAllChange(datas){
let that = this; let that = this;
@ -632,19 +632,19 @@ export default {
obj.note = row.note; obj.note = row.note;
//qct //qct
if((that.qct!==''&&that.qct!==null)||(that.qctId!==''&&that.qctId!==null)){ if((that.qct!==''&&that.qct!==null)||(that.qctId!==''&&that.qctId!==null)){
that.qct_defects.forEach(item => { // that.qct_defects.forEach(item => {
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){ // if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
let str = item.rule_expression.replace(/`/g, ''); // let str = item.rule_expression.replace(/`/g, '');
str = str.replace(/\${(.*?)}/g, 'row.\$1') // str = str.replace(/\${(.*?)}/g, 'row.\$1')
let judge = false; // let judge = false;
try { // try {
judge = eval(str); // judge = eval(str);
row[index][item.defect_name] = judge; // that.mlogbwlist[editIndex][item.defect_name] = judge;
}catch (error) { // }catch (error) {
console.error('error',error); // console.error('error',error);
} // }
} // }
}); // });
obj.ftest = {}; obj.ftest = {};
obj.ftest.ftestitems = []; obj.ftest.ftestitems = [];
obj.ftest.ftestdefects = []; obj.ftest.ftestdefects = [];
@ -937,10 +937,26 @@ export default {
}, },
getEqData(index){ getEqData(index){
let that = this; let that = this;
let row = that.mlogbwlist[index];
that.$API.em.cd.req({method:that.setForm.cd_req_addr}).then((res) => { that.$API.em.cd.req({method:that.setForm.cd_req_addr}).then((res) => {
that.qct_testitems.forEach(item0 => { that.qct_testitems.forEach(item0 => {
if(item0.testitem_cd_expr!=null){ if(item0.testitem_cd_expr!=null){
that.mlogbwlist[index][item0.testitem_name]= eval(item0.testitem_cd_expr); that.mlogbwlist[index][item0.testitem_name]= eval(item0.testitem_cd_expr);
that.qct_defects.forEach(item => {
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
let str = item.rule_expression.replace(/`/g, '');
str = str.replace(/\${(.*?)}/g, 'row.\$1');
let judge = false;
try {
judge = eval(str);
that.mlogbwlist[index][item.defect_name] = judge;
}catch (error) {
console.error(error);
}
}else{
that.mlogbwlist[index][item.defect_name] = false;
}
});
} }
}) })
}).catch((err) => { }).catch((err) => {
@ -989,6 +1005,11 @@ export default {
}); });
that.$API.wpm.mlogbw.update.req("bulk",that.selectWpr).then((res) => { that.$API.wpm.mlogbw.update.req("bulk",that.selectWpr).then((res) => {
that.setVisible = false; that.setVisible = false;
that.selectWprList = [];
that.$refs.mlogbwTable.clearSelection();
that.defectlists.forEach(item => {
item.value = false;
});
that.getList(); that.getList();
}).catch((err) => { }).catch((err) => {
return err; return err;