fix:过程检验关联检验表

This commit is contained in:
shijing 2025-03-11 17:10:05 +08:00
parent fc10c2eee0
commit e439a0d7c3
1 changed files with 217 additions and 274 deletions

View File

@ -17,106 +17,11 @@
style="padding: 0 10px" style="padding: 0 10px"
> >
<el-row> <el-row>
<el-col :md="12" :sm="24">
<el-form-item label="生产设备">
<el-select
v-model="form.equipment"
placeholder="生产设备"
clearable
filterable
class="width100"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.label"
:value="item.id"
>
<span style="float:left">{{item.name}}</span>
<span style="float:right">{{item.number}}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="个人任务">
<el-select
v-model="form.mtaskb"
placeholder="个人任务"
clearable
filterable
class="width100"
>
<el-option
v-for="item in mtaskbOtions"
:key="item.id"
:label="item.handle_user_name"
:value="item.id"
>
<span style="float:left">{{item.handle_user_name}}</span>
<span style="float:right">{{item.count}}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="mgroupName=='成品抛'">
<el-form-item label="批次序号">
<el-input-number
v-model="form.index"
:min="0"
:max="99"
placeholder="第几炉,追加到批次"
style="width: 100%"
controls-position="right"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="开始时间" prop="work_start_time">
<el-date-picker
v-model="form.work_start_time"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
class="width100"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="结束时间" prop="work_end_time">
<el-date-picker
v-model="form.work_end_time"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
class="width100"
:disabledDate="disabledDateFn"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="班次">
<el-select
v-model="form.shift"
placeholder="班次"
clearable
filterable
class="width100"
>
<el-option
v-for="item in shiftOtions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="批次号" prop="wm_in"> <el-form-item label="批次号" prop="wm_in">
<el-select <el-select
v-model="form.wm_in" v-model="form.wm_in"
placeholder="交接物料" placeholder="交接物料"
clearable
class="width100" class="width100"
@change="changeMaterial" @change="changeMaterial"
> >
@ -139,6 +44,86 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24">
<el-form-item label="操作员">
<el-select
v-model="form.handle_user"
placeholder="操作员"
clearable
filterable
class="width100"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="生产设备">
<el-select
v-model="form.equipment"
placeholder="生产设备"
clearable
filterable
class="width100"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.label"
:value="item.id"
>
<span style="float:left">{{item.name}}</span>
<span style="float:right">{{item.number}}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="班次">
<el-select
v-model="form.shift"
placeholder="班次"
clearable
filterable
class="width100"
>
<el-option
v-for="item in shiftOtions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="mgroupName=='成品抛'">
<el-form-item label="批次序号">
<el-input-number
v-model="form.index"
:min="0"
:max="99"
placeholder="第几炉,追加到批次"
style="width: 100%"
controls-position="right"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="工作日期" prop="handle_date">
<el-date-picker
v-model="form.handle_date"
type="date"
value-format="YYYY-MM-DD"
style="width:100%"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="领用数量"> <el-form-item label="领用数量">
<el-input-number <el-input-number
@ -156,8 +141,8 @@
v-model="form.count_pn_jgqbl" v-model="form.count_pn_jgqbl"
:min="0" :min="0"
class="width100" class="width100"
:disabled="true"
controls-position="right" controls-position="right"
@change = "countUseChange"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -168,7 +153,7 @@
:min="0" :min="0"
class="width100" class="width100"
controls-position="right" controls-position="right"
disabled :disabled="true"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -176,8 +161,8 @@
<el-form-item label="合格数量"> <el-form-item label="合格数量">
<el-input-number <el-input-number
v-model="form.count_ok" v-model="form.count_ok"
disabled
class="width100" class="width100"
:disabled="true"
controls-position="right" controls-position="right"
/> />
</el-form-item> </el-form-item>
@ -186,7 +171,7 @@
<el-form-item label="不合格数量"> <el-form-item label="不合格数量">
<el-input-number <el-input-number
v-model="form.count_notok" v-model="form.count_notok"
disabled :disabled="true"
class="width100" class="width100"
controls-position="right" controls-position="right"
/> />
@ -203,126 +188,37 @@
</el-row> </el-row>
<el-divider></el-divider> <el-divider></el-divider>
<el-row> <el-row>
<el-col :md="12" :sm="24"> <el-col :span=12>
<el-form-item label="划伤"> <el-col>加工前不良</el-col>
<el-input-number <el-row>
v-model="form.count_n_hs" <el-col :md="12" :sm="24" v-for="item in qct_defects" :key="item.id">
:min="0" <el-form-item :label="item.defect_name">
class="width100" <el-input-number
controls-position="right" v-model="defectinform[item.defect_name]"
@change="countChange" :min="0"
/> style="width:100%"
</el-form-item> controls-position="right"
@change="countinChange"
/>
</el-form-item>
</el-col>
</el-row>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :span=12>
<el-form-item label="气泡"> <el-col>本工段不良</el-col>
<el-input-number <el-row>
v-model="form.count_n_qp" <el-col :md="12" :sm="24" v-for="item in qct_defects" :key="item.id">
:min="0" <el-form-item :label="item.defect_name">
class="width100" <el-input-number
controls-position="right" v-model="defectform[item.defect_name]"
@change="countChange" :min="0"
/> class="width-100"
</el-form-item> controls-position="right"
</el-col> @change="countChange"
<el-col :md="12" :sm="24"> />
<el-form-item label="水纹"> </el-form-item>
<el-input-number </el-col>
v-model="form.count_n_swen" </el-row>
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="崩边">
<el-input-number
v-model="form.count_n_bb"
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="雾面">
<el-input-number
v-model="form.count_n_wm"
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="小崩边">
<el-input-number
v-model="form.count_n_xbb"
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="麻点">
<el-input-number
v-model="form.count_n_md"
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="线痕">
<el-input-number
v-model="form.count_n_xh"
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="破损">
<el-input-number
v-model="form.count_n_ps"
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<!-- <el-col :md="12" :sm="24">
<el-form-item label="棕圈">
<el-input-number
v-model="form.count_n_zq"
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col> -->
<el-col :md="12" :sm="24">
<el-form-item label="其他">
<el-input-number
v-model="form.count_n_qt"
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
@ -341,29 +237,20 @@
const defaultForm = { const defaultForm = {
batch: null, batch: null,
equipment: null, equipment: null,
mtaskb: null, // mtaskb: null,
shift: null, shift: null,
wm_in: null, wm_in: null,
fmlog:null, fmlog:null,
work_start_time:'', // work_start_time:null,
work_end_time:'', // work_end_time:null,
material_out:'', material_out:'',
count_pn_jgqbl:0, count_pn_jgqbl:0,
count_use:0, count_use:0,
count_real: 0, count_real: 0,
count_ok: 0, count_ok: 0,
count_notok: 0, count_notok: 0,
count_n_hs: 0, mlogdefect:[],
count_n_qp: 0, mlogindefect:[],
count_n_swen: 0,
count_n_bb: 0,
count_n_xbb:0,
count_n_md: 0,
count_n_xh: 0,
count_n_ps: 0,
count_n_qt: 0,
count_n_wm: 0,
count_n_zq:0,
note:'' note:''
}; };
@ -406,15 +293,20 @@ export default {
work_end_time:[{required: true,message: "请选择生产开始时间",trigger: "blur",},], work_end_time:[{required: true,message: "请选择生产开始时间",trigger: "blur",},],
route: [{required: true,message: "请选择工艺路线",trigger: "blur",},] route: [{required: true,message: "请选择工艺路线",trigger: "blur",},]
}, },
qct:'',
codeText:'',
mgroupName:'', mgroupName:'',
materialCount:1,// materialCount:1,//
material_in:'', material_in:'',
material_out:'', material_out:'',
defectinform:{},
defectform:{},
shiftOtions:[], shiftOtions:[],
mtaskbOtions:[], userList:[],
visible: false, visible: false,
isSaveing: false, isSaveing: false,
options: [], options: [],
qct_defects:[],
routeOptions: [], routeOptions: [],
supplierOptions: [], supplierOptions: [],
materialOptions:[], materialOptions:[],
@ -425,10 +317,8 @@ export default {
this.getShift(); this.getShift();
this.getMgroup(); this.getMgroup();
this.getMtask(); this.getMtask();
this.getMtaskb();
console.log('this.fmlog',this.fmlog)
this.form.fmlog = this.fmlog; this.form.fmlog = this.fmlog;
console.log('this.form.fmlog',this.form.fmlog) this.form.handle_date = this.$TOOL.dateFormat2(new Date());;
}, },
methods: { methods: {
disabledDateFn(time) { disabledDateFn(time) {
@ -447,8 +337,24 @@ export default {
that.mgroupName = res.name; that.mgroupName = res.name;
that.process = res.process; that.process = res.process;
that.getEquipment(); that.getEquipment();
that.getUserList();
}); });
}, },
getdefects(){
let that = this;
that.$API.qm.qct.list.req({qctmat__material: that.material_out,page: 0,tags:'process'}).then((res) => {
if(res.length>0){
that.qct = res[0].id;
that.$API.qm.qct.item.req(res[0].id).then((res) => {
res.qct_defects.forEach((item) => {
that.defectform[item.defect_name] = 0;
that.defectinform[item.defect_name] = 0;
})
that.qct_defects=res.qct_defects;
})
}
})
},
getEquipment() { getEquipment() {
let that = this; let that = this;
that.options = []; that.options = [];
@ -466,49 +372,74 @@ export default {
that.$API.pm.mtask.item.req(that.mtask).then(res=>{ that.$API.pm.mtask.item.req(that.mtask).then(res=>{
that.material_in = res.material_in; that.material_in = res.material_in;
that.material_out = that.form.material_out = res.material_out; that.material_out = that.form.material_out = res.material_out;
that.getMaterial(); that.getdefects();
}); });
}, },
getMtaskb() { //
getUserList() {
let that = this; let that = this;
that.$API.pm.mtaskb.list.req({ page: 0, mtask:that.mtask }).then((res) => { let userInfo = that.$TOOL.data.get("USER_INFO");
that.mtaskbOtions = res; this.$API.system.user.list.req({ depts: that.deptId, page: 0 }).then((res) => {
that.userList = res;
let arr = res.filter(item=>{
return item.id==userInfo.id;
})
if(arr.length>0){
that.form.handle_user = userInfo.id;
}else{
let obj = {};
obj.id = userInfo.id;
obj.name = userInfo.name;
that.userList.push(obj)
that.form.handle_user = userInfo.id;
}
}); });
}, },
// getMtaskb() {
// let that = this;
// that.$API.pm.mtaskb.list.req({ page: 0, mtask:that.mtask }).then((res) => {
// that.mtaskbOtions = res;
// });
// },
// //
getMaterial() { getMaterial() {
let that = this; let that = this;
that.$API.wpm.wmaterial.list.req({mtaskx:that.mtask,mgroupx: that.mgroup,material: that.material_in,page: 0,}).then((res) => { that.$API.wpm.wmaterial.list.req({mtaskx:that.mtask,mgroupx: that.mgroup,material: that.material_in,page: 0,}).then((res) => {
that.materialOptions = res; that.materialOptions = res;
if(that.codeText!==''){
that.materialOptions.forEach(item=>{
if(item.batch == that.codeText){
that.form.wm_in = item.id;
that.form.batch = item.batch;
that.materialCount = that.form.count_use = that.form.count_ok = item.count_cando;
that.form.count_real = item.count-that.form.count_pn_jgqbl;
}
})
}
}); });
}, },
changeMaterial(val){ changeMaterial(val){
let that = this; let that = this;
that.materialOptions.forEach(item=>{ that.materialOptions.forEach(item=>{
if(item.id == val){ if(item.id == val){
that.form.count_n_hs = that.qct_defects.forEach((item) => {
that.form.count_n_qp = that.form[item.defect_name] = 0;
that.form.count_n_swen = })
that.form.count_n_bb = that.materialCount = that.form.count_use =
that.form.count_n_xbb = that.form.count_real = that.form.count_ok = item.count;
that.form.count_n_md =
that.form.count_n_xh =
that.form.count_n_ps =
that.form.count_n_zq =
that.form.count_n_qt =
that.form.count_n_wm=0;
that.materialCount =
that.form.count_use =
that.form.count_real =
that.form.count_ok = item.count;
that.form.count_real = item.count-that.form.count_pn_jgqbl; that.form.count_real = item.count-that.form.count_pn_jgqbl;
} }
}) })
}, },
// //
open(mode = "add") { open(mode = "add",codeText) {
this.mode = mode; this.mode = mode;
this.visible = true; this.visible = true;
if(codeText){
this.codeText = codeText;
}
this.getMaterial();
return this; return this;
}, },
// //
@ -522,23 +453,23 @@ export default {
that.form.count_ok = that.form.count_real - that.form.count_notok; that.form.count_ok = that.form.count_real - that.form.count_notok;
}, },
countChange() { countChange() {
this.form.count_notok = let that = this;
this.form.count_n_hs + that.form.count_notok = 0;
this.form.count_n_qp + that.qct_defects.forEach(item => {
this.form.count_n_swen + that.form.count_notok += that.defectform[item.defect_name];
this.form.count_n_bb + })
this.form.count_n_xbb + that.form.count_ok = that.form.count_real - that.form.count_notok;
this.form.count_n_md + },
this.form.count_n_xh + countinChange(){
this.form.count_n_ps + let that = this;
this.form.count_n_zq + that.form.count_pn_jgqbl = 0;
this.form.count_n_qt + that.qct_defects.forEach(item => {
this.form.count_n_wm; that.form.count_pn_jgqbl += that.defectinform[item.defect_name];
this.form.count_ok = this.form.count_real - this.form.count_notok; })
that.form.count_real = that.form.count_use - that.form.count_pn_jgqbl;
that.form.count_ok = that.form.count_real - that.form.count_notok;
}, },
// countChanges(){
// this.form.count_ok = this.form.count_real - this.form.count_notok;
// },
// //
submit() { submit() {
let that = this; let that = this;
@ -546,6 +477,20 @@ export default {
if (valid) { if (valid) {
that.isSaveing = true; that.isSaveing = true;
that.form.mgroup = that.mgroup; that.form.mgroup = that.mgroup;
let mlogdefect = [],mlogindefect =[];
that.qct_defects.forEach(item => {
let objin = {};
objin.defect = item.defect;
objin.count = that.defectinform[item.defect_name];
mlogindefect.push(objin);
let obj = {};
obj.defect = item.defect;
obj.count = that.defectform[item.defect_name];
mlogdefect.push(obj)
})
that.form.qct = that.qct;
that.form.mlogdefect = mlogdefect;
that.form.mlogindefect = mlogindefect;
if (that.mode === "add") { if (that.mode === "add") {
that.$API.wpm.mlog.create.req(that.form).then((res) => { that.$API.wpm.mlog.create.req(that.form).then((res) => {
that.isSaveing = false; that.isSaveing = false;
@ -557,8 +502,6 @@ export default {
}); });
} else { } else {
let obj = {}; let obj = {};
obj.work_end_time = that.form.work_end_time;
obj.handle_user = that.form.handle_user;
obj.note = that.form.note; obj.note = that.form.note;
that.$API.wpm.mlog.update.req(that.form.id, that.form).then((res) => { that.$API.wpm.mlog.update.req(that.form.id, that.form).then((res) => {
that.isSaveing = false; that.isSaveing = false;