fix:快速日志后,打开日志详情
This commit is contained in:
parent
9b00d9205c
commit
6ccdd4f438
|
@ -33,30 +33,37 @@
|
|||
<el-row>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="处理人:">
|
||||
<el-input v-model="form.handle_user" clearable ></el-input>
|
||||
<el-input v-model="form.handle_user_name" clearable ></el-input>
|
||||
<!-- {{ form.handle_user_name }} -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="操作日期:">
|
||||
<el-form-item label="开始时间:">
|
||||
<el-date-picker
|
||||
v-model="form.handle_date"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
v-model="form.work_start_time"
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
style="width: 100%"
|
||||
popper-append-to-body
|
||||
@change="workStartTimeChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="批号:">
|
||||
<el-form-item label="物料批号:">
|
||||
<el-input v-model="form.batch" clearable ></el-input>
|
||||
<!-- {{ form.handle_user_name }} -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="数量:">
|
||||
<el-input v-model="form.count" clearable ></el-input>
|
||||
<el-form-item label="处理日期:">
|
||||
<el-input v-model="form.handle_date" disabled></el-input>
|
||||
<!-- {{ form.handle_user_name }} -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="领用数量:">
|
||||
<el-input v-model="form.count_use" clearable ></el-input>
|
||||
<!-- {{ form.handle_user_name }} -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -146,18 +153,25 @@ export default {
|
|||
route_code:"",
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
userOptions: [],
|
||||
routeOptions: [],
|
||||
materialOptions: [],
|
||||
routeOriginOptions: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.route_code = this.$route.path.split("/")[2];
|
||||
this.form.handle_date = this.$TOOL.dateFormat2(new Date());
|
||||
this.form.work_start_time = this.$TOOL.dateFormat(new Date());
|
||||
this.form.mgroup = this.mgroup;
|
||||
this.getMaterial();
|
||||
this.getRoute();
|
||||
},
|
||||
methods: {
|
||||
//获取
|
||||
getUser() {
|
||||
this.$API.system.user.list.req({ depts: this.dept }).then((res) => {
|
||||
this.userOptions = res.results;
|
||||
getRoute() {
|
||||
let that = this;
|
||||
this.$API.mtm.route.list.req({ process: that.process, page: 0, routepack__state: 30 }).then((res) => {
|
||||
this.routeOriginOptions = res;
|
||||
});
|
||||
},
|
||||
//显示
|
||||
|
@ -172,6 +186,27 @@ export default {
|
|||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
workStartTimeChange(){
|
||||
let date = new Date(this.form.work_start_time);
|
||||
this.form.handle_date = this.$TOOL.dateFormat2(date);
|
||||
},
|
||||
//获取车间物料
|
||||
getMaterial() {
|
||||
let that = this;
|
||||
let obj = {};
|
||||
obj.mgroupx =that.mgroup;
|
||||
obj.tag = 'todo';
|
||||
obj.page =0;
|
||||
this.$API.wpm.wmaterial.list.req(obj).then((res) => {
|
||||
let arr = [];
|
||||
if(res.length>0){
|
||||
arr = res.filter((item)=>{
|
||||
return Number(item.count_cando)>0;
|
||||
})
|
||||
}
|
||||
that.materialOptions = arr;
|
||||
});
|
||||
},
|
||||
//扫描后处理方法
|
||||
// 扫描后会有两种情况,一种是扫描物料,一种是扫描用户;物料扫描后需要判断
|
||||
formWminChange(code){
|
||||
|
@ -185,7 +220,6 @@ export default {
|
|||
if(that.scanKyes=="user"){
|
||||
//请求用户信息
|
||||
that.$API.system.user.item.req(codeId).then((res) => {
|
||||
console.log('userres',res);
|
||||
that.form.handle_user = res.id;
|
||||
that.form.handle_user_name = res.name;
|
||||
})
|
||||
|
@ -201,6 +235,14 @@ export default {
|
|||
that.form.wm_in = arr[0].id;
|
||||
that.form.count_use = arr[0].count;
|
||||
that.wm_in = arr[0].batch;
|
||||
that.routeOriginOptions.forEach((item)=>{
|
||||
if(item.material_in==arr[0].material){
|
||||
that.routeOptions.push(item);
|
||||
}
|
||||
})
|
||||
if(that.routeOptions.length==1){
|
||||
that.form.route = that.routeOptions[0].id;
|
||||
}
|
||||
}else{
|
||||
that.wm_in = '';
|
||||
that.$message.error("批次号不存在");
|
||||
|
@ -271,7 +313,7 @@ export default {
|
|||
that.form.mgroup = that.mgroup;
|
||||
that.$API.wpm.mlog.quick.req(that.form).then((res) => {
|
||||
that.isSaveing = false;
|
||||
that.$emit("success");
|
||||
that.$emit("success",res.mlog);
|
||||
that.visible = false;
|
||||
that.$message.success("操作成功");
|
||||
}).catch(()=>{
|
||||
|
|
|
@ -206,7 +206,7 @@
|
|||
:dept="deptId"
|
||||
:mgroupName = "mgroupName"
|
||||
:mgroupMtype="mgroupMtype"
|
||||
@success="handleSaveSuccess"
|
||||
@success="handleSaveSuccess2"
|
||||
@closed="dialog.save2 = false"
|
||||
>
|
||||
</saves-dialog>
|
||||
|
@ -507,12 +507,21 @@ export default {
|
|||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
},
|
||||
//本地更新数据
|
||||
//新增岗位后更新数据
|
||||
//新增后更新数据
|
||||
handleSaveSuccess(data, mode) {
|
||||
this.dialog.save = true;
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
handleSaveSuccess2(data) {
|
||||
console.log(data);
|
||||
this.dialog.save = true;
|
||||
this.$refs.table.refresh();
|
||||
this.mlogId = data;
|
||||
this.dialog.detail = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.detailDialog.open();
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue