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

View File

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

View File

@ -473,6 +473,9 @@ export default {
that.routeId = data.id;
that.addTemplate.route = data.id;
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(() => {
that.options.forEach((item) => {
if (item.id == data.process) {

View File

@ -10,6 +10,7 @@
<el-select
v-model="params.type"
clearable
style="width: 120px;"
@change="materialTypeChange"
>
<el-option
@ -20,6 +21,19 @@
>
</el-option>
</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
type="primary"
icon="el-icon-search"
@ -67,6 +81,7 @@
id="exportDiv11"
stripe
hideDo
:pageSize="500"
:summary-method="getSummaries2"
show-summary
>
@ -228,16 +243,28 @@ export default {
materialType: "",
params: { is_hidden: false, type: 10, count__gte: 1 },
query: {
material: "",
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,
queryType: "月",
queryType: "",
queryDate: "",
start_date: "",
end_date: "",
currentYear: "",
currentMonth: "",
currentLastDay: "",
material_name: "",
material_type: "",
material_model: "",
material_specification: "",
tableData: [],
tableData1: [],
tableData11: [],
@ -258,7 +285,6 @@ export default {
{ id: 20, name: "半成品" },
{ id: 30, name: "主要原料" },
{ id: 40, name: "辅助材料" },
{ id: 70, name: "办公用品" },
],
};
},
@ -271,9 +297,9 @@ export default {
that.currentYear = year;
that.currentMonth = month > 9 ? month : "0" + month;
that.currentLastDay = lastDay;
that.queryDate = that.currentYear + "-" + that.currentMonth;
that.start_date = that.currentYear + "-" + that.currentMonth + "-01";
that.end_date = that.currentYear + "-" + that.currentMonth + "-" + lastDay;
that.queryDate = that.currentYear+'';
that.start_date = that.currentYear + "-01-01";
that.end_date = that.currentYear + "-12-31";
that.getTableData();
that.getTableData1();
},
@ -340,6 +366,9 @@ export default {
that.modelFilters11 = [];
that.specsFilters11 = [];
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) => {
that.tableData11 = res.results;
if(res.results.length>0){
@ -371,11 +400,14 @@ export default {
},
materialTypeChange(){
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){
that.getTableData1();
}else{
that.getTableData11();
}
that.getTableData();
},
//
weekcountChange(row) {
@ -400,6 +432,18 @@ export default {
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) => {
if (res.data2.ds0) {
let data = res.data2.ds0;
@ -447,6 +491,16 @@ export default {
}
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() {
let that = this;
if (that.queryType == "月") {
@ -523,25 +577,25 @@ export default {
},
filterName1(value, row) {
return row.物料名 == value;
return row.material_name == value;
},
filterSpecs1(value, row) {
return row.规格 == value;
return row.material_specification == value;
},
filterModel1(value, row) {
return row.型号 == value;
return row.material_model == value;
},
filterDept1(value, row) {
return row.完成车间 == value;
return row.dept_name == value;
},
filterName11(value, row) {
return row.物料名 == value;
return row.name == value;
},
filterSpecs11(value, row) {
return row.规格 == value;
return row.specification == value;
},
filterModel11(value, row) {
return row.型号 == value;
return row.model == value;
},
filterName2(value, row) {
return row.物料名 == value;

View File

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

View File

@ -93,7 +93,7 @@
min-width="150"
>
<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>
</template>
</el-table-column>

View File

@ -113,18 +113,18 @@
>
<el-row>
<el-col :span="23">
<el-form-item label="操作日期" required>
<el-form-item label="操作时间" prop="work_start_time">
<el-date-picker
v-model="muserForm.handle_date"
type="date"
placeholder="操作日期"
value-format="YYYY-MM-DD"
v-model="muserForm.work_start_time"
type="datetime"
placeholder="操作时间"
value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="23">
<el-form-item label="操作人" required>
<el-form-item label="操作人" prop="handle_user">
<ehsSelect
v-model="muserForm.handle_user"
:showName="muserForm.handle_user_name"
@ -150,7 +150,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="23">
<!-- <el-col :span="23">
<el-form-item label="关联班次" prop="shift">
<el-select
v-model="muserForm.shift"
@ -166,6 +166,23 @@
</el-option>
</el-select>
</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-row>
</el-form>
@ -509,6 +526,7 @@ export default {
shiftOtions:[],
tableDataWm:[],
qct_defects:[],
equipmentOtions:[],
defectOptions:[],
qct_testitems:[],
processOptions:[],
@ -528,6 +546,10 @@ export default {
count_use: [{required: true,message: "请输入领取数量",trigger: "blur"}],
process:[{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,
handle_date:'',
@ -571,6 +593,7 @@ export default {
that.getMlogItem();
that.getPreocess();
that.getShift();
that.getEquipment();
},
methods: {
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){
let that = this;
@ -640,52 +669,6 @@ export default {
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(){
let that = this;
let params = {};
@ -939,7 +922,7 @@ export default {
that.muserForm.mlog = that.mlogItem.id;
that.muserForm.handle_user = userInfo.id;
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;
},
saveMuserSubmit (){

View File

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