fix:过程检验关联检验表
This commit is contained in:
parent
fc10c2eee0
commit
e439a0d7c3
|
|
@ -17,106 +17,11 @@
|
|||
style="padding: 0 10px"
|
||||
>
|
||||
<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-form-item label="批次号" prop="wm_in">
|
||||
<el-select
|
||||
v-model="form.wm_in"
|
||||
placeholder="交接物料"
|
||||
clearable
|
||||
class="width100"
|
||||
@change="changeMaterial"
|
||||
>
|
||||
|
|
@ -139,6 +44,86 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</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-form-item label="领用数量">
|
||||
<el-input-number
|
||||
|
|
@ -156,8 +141,8 @@
|
|||
v-model="form.count_pn_jgqbl"
|
||||
:min="0"
|
||||
class="width100"
|
||||
:disabled="true"
|
||||
controls-position="right"
|
||||
@change = "countUseChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
@ -168,7 +153,7 @@
|
|||
:min="0"
|
||||
class="width100"
|
||||
controls-position="right"
|
||||
disabled
|
||||
:disabled="true"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
@ -176,8 +161,8 @@
|
|||
<el-form-item label="合格数量">
|
||||
<el-input-number
|
||||
v-model="form.count_ok"
|
||||
disabled
|
||||
class="width100"
|
||||
:disabled="true"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
|
@ -186,7 +171,7 @@
|
|||
<el-form-item label="不合格数量">
|
||||
<el-input-number
|
||||
v-model="form.count_notok"
|
||||
disabled
|
||||
:disabled="true"
|
||||
class="width100"
|
||||
controls-position="right"
|
||||
/>
|
||||
|
|
@ -203,126 +188,37 @@
|
|||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="划伤">
|
||||
<el-input-number
|
||||
v-model="form.count_n_hs"
|
||||
:min="0"
|
||||
class="width100"
|
||||
controls-position="right"
|
||||
@change="countChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-col :span=12>
|
||||
<el-col>加工前不良</el-col>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24" v-for="item in qct_defects" :key="item.id">
|
||||
<el-form-item :label="item.defect_name">
|
||||
<el-input-number
|
||||
v-model="defectinform[item.defect_name]"
|
||||
:min="0"
|
||||
style="width:100%"
|
||||
controls-position="right"
|
||||
@change="countinChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="气泡">
|
||||
<el-input-number
|
||||
v-model="form.count_n_qp"
|
||||
: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_swen"
|
||||
: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 :span=12>
|
||||
<el-col>本工段不良</el-col>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24" v-for="item in qct_defects" :key="item.id">
|
||||
<el-form-item :label="item.defect_name">
|
||||
<el-input-number
|
||||
v-model="defectform[item.defect_name]"
|
||||
:min="0"
|
||||
class="width-100"
|
||||
controls-position="right"
|
||||
@change="countChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
|
@ -341,29 +237,20 @@
|
|||
const defaultForm = {
|
||||
batch: null,
|
||||
equipment: null,
|
||||
mtaskb: null,
|
||||
// mtaskb: null,
|
||||
shift: null,
|
||||
wm_in: null,
|
||||
fmlog:null,
|
||||
work_start_time:'',
|
||||
work_end_time:'',
|
||||
// work_start_time:null,
|
||||
// work_end_time:null,
|
||||
material_out:'',
|
||||
count_pn_jgqbl:0,
|
||||
count_use:0,
|
||||
count_real: 0,
|
||||
count_ok: 0,
|
||||
count_notok: 0,
|
||||
count_n_hs: 0,
|
||||
count_n_qp: 0,
|
||||
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,
|
||||
mlogdefect:[],
|
||||
mlogindefect:[],
|
||||
note:''
|
||||
};
|
||||
|
||||
|
|
@ -406,15 +293,20 @@ export default {
|
|||
work_end_time:[{required: true,message: "请选择生产开始时间",trigger: "blur",},],
|
||||
route: [{required: true,message: "请选择工艺路线",trigger: "blur",},]
|
||||
},
|
||||
qct:'',
|
||||
codeText:'',
|
||||
mgroupName:'',
|
||||
materialCount:1,//领料批次现有库存数
|
||||
material_in:'',
|
||||
material_out:'',
|
||||
defectinform:{},
|
||||
defectform:{},
|
||||
shiftOtions:[],
|
||||
mtaskbOtions:[],
|
||||
userList:[],
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
options: [],
|
||||
qct_defects:[],
|
||||
routeOptions: [],
|
||||
supplierOptions: [],
|
||||
materialOptions:[],
|
||||
|
|
@ -425,10 +317,8 @@ export default {
|
|||
this.getShift();
|
||||
this.getMgroup();
|
||||
this.getMtask();
|
||||
this.getMtaskb();
|
||||
console.log('this.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: {
|
||||
disabledDateFn(time) {
|
||||
|
|
@ -447,8 +337,24 @@ export default {
|
|||
that.mgroupName = res.name;
|
||||
that.process = res.process;
|
||||
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() {
|
||||
let that = this;
|
||||
that.options = [];
|
||||
|
|
@ -466,49 +372,74 @@ export default {
|
|||
that.$API.pm.mtask.item.req(that.mtask).then(res=>{
|
||||
that.material_in = res.material_in;
|
||||
that.material_out = that.form.material_out = res.material_out;
|
||||
that.getMaterial();
|
||||
that.getdefects();
|
||||
|
||||
});
|
||||
},
|
||||
getMtaskb() {
|
||||
//获取工段人员
|
||||
getUserList() {
|
||||
let that = this;
|
||||
that.$API.pm.mtaskb.list.req({ page: 0, mtask:that.mtask }).then((res) => {
|
||||
that.mtaskbOtions = res;
|
||||
let userInfo = that.$TOOL.data.get("USER_INFO");
|
||||
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() {
|
||||
let that = this;
|
||||
that.$API.wpm.wmaterial.list.req({mtaskx:that.mtask,mgroupx: that.mgroup,material: that.material_in,page: 0,}).then((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){
|
||||
let that = this;
|
||||
that.materialOptions.forEach(item=>{
|
||||
if(item.id == val){
|
||||
that.form.count_n_hs =
|
||||
that.form.count_n_qp =
|
||||
that.form.count_n_swen =
|
||||
that.form.count_n_bb =
|
||||
that.form.count_n_xbb =
|
||||
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.qct_defects.forEach((item) => {
|
||||
that.form[item.defect_name] = 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;
|
||||
}
|
||||
})
|
||||
},
|
||||
//显示
|
||||
open(mode = "add") {
|
||||
open(mode = "add",codeText) {
|
||||
this.mode = mode;
|
||||
this.visible = true;
|
||||
if(codeText){
|
||||
this.codeText = codeText;
|
||||
}
|
||||
this.getMaterial();
|
||||
return this;
|
||||
},
|
||||
//表单注入数据
|
||||
|
|
@ -522,23 +453,23 @@ export default {
|
|||
that.form.count_ok = that.form.count_real - that.form.count_notok;
|
||||
},
|
||||
countChange() {
|
||||
this.form.count_notok =
|
||||
this.form.count_n_hs +
|
||||
this.form.count_n_qp +
|
||||
this.form.count_n_swen +
|
||||
this.form.count_n_bb +
|
||||
this.form.count_n_xbb +
|
||||
this.form.count_n_md +
|
||||
this.form.count_n_xh +
|
||||
this.form.count_n_ps +
|
||||
this.form.count_n_zq +
|
||||
this.form.count_n_qt +
|
||||
this.form.count_n_wm;
|
||||
this.form.count_ok = this.form.count_real - this.form.count_notok;
|
||||
let that = this;
|
||||
that.form.count_notok = 0;
|
||||
that.qct_defects.forEach(item => {
|
||||
that.form.count_notok += that.defectform[item.defect_name];
|
||||
})
|
||||
that.form.count_ok = that.form.count_real - that.form.count_notok;
|
||||
},
|
||||
countinChange(){
|
||||
let that = this;
|
||||
that.form.count_pn_jgqbl = 0;
|
||||
that.qct_defects.forEach(item => {
|
||||
that.form.count_pn_jgqbl += that.defectinform[item.defect_name];
|
||||
})
|
||||
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() {
|
||||
let that = this;
|
||||
|
|
@ -546,6 +477,20 @@ export default {
|
|||
if (valid) {
|
||||
that.isSaveing = true;
|
||||
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") {
|
||||
that.$API.wpm.mlog.create.req(that.form).then((res) => {
|
||||
that.isSaveing = false;
|
||||
|
|
@ -557,8 +502,6 @@ export default {
|
|||
});
|
||||
} else {
|
||||
let obj = {};
|
||||
obj.work_end_time = that.form.work_end_time;
|
||||
obj.handle_user = that.form.handle_user;
|
||||
obj.note = that.form.note;
|
||||
that.$API.wpm.mlog.update.req(that.form.id, that.form).then((res) => {
|
||||
that.isSaveing = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue