fix:快速日志后,打开日志详情

This commit is contained in:
shijing 2025-08-19 15:50:54 +08:00
parent 9b00d9205c
commit 6ccdd4f438
2 changed files with 68 additions and 17 deletions

View File

@ -33,30 +33,37 @@
<el-row> <el-row>
<el-col :md="12" :sm="12" :xs="24"> <el-col :md="12" :sm="12" :xs="24">
<el-form-item label="处理人:"> <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 }} --> <!-- {{ form.handle_user_name }} -->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="12" :xs="24"> <el-col :md="12" :sm="12" :xs="24">
<el-form-item label="操作日期"> <el-form-item label="开始时间">
<el-date-picker <el-date-picker
v-model="form.handle_date" v-model="form.work_start_time"
type="date" type="datetime"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%" style="width: 100%"
popper-append-to-body popper-append-to-body
@change="workStartTimeChange"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="12" :xs="24"> <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> <el-input v-model="form.batch" clearable ></el-input>
<!-- {{ form.handle_user_name }} --> <!-- {{ form.handle_user_name }} -->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="12" :xs="24"> <el-col :md="12" :sm="12" :xs="24">
<el-form-item label="数量:"> <el-form-item label="处理日期:">
<el-input v-model="form.count" clearable ></el-input> <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 }} --> <!-- {{ form.handle_user_name }} -->
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -146,18 +153,25 @@ export default {
route_code:"", route_code:"",
visible: false, visible: false,
isSaveing: false, isSaveing: false,
userOptions: [], routeOptions: [],
materialOptions: [],
routeOriginOptions: [],
}; };
}, },
mounted() { mounted() {
this.route_code = this.$route.path.split("/")[2]; this.route_code = this.$route.path.split("/")[2];
this.form.handle_date = this.$TOOL.dateFormat2(new Date()); 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: { methods: {
// //
getUser() { getRoute() {
this.$API.system.user.list.req({ depts: this.dept }).then((res) => { let that = this;
this.userOptions = res.results; 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; this.visible = true;
return this; 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){ formWminChange(code){
@ -185,7 +220,6 @@ export default {
if(that.scanKyes=="user"){ if(that.scanKyes=="user"){
// //
that.$API.system.user.item.req(codeId).then((res) => { that.$API.system.user.item.req(codeId).then((res) => {
console.log('userres',res);
that.form.handle_user = res.id; that.form.handle_user = res.id;
that.form.handle_user_name = res.name; that.form.handle_user_name = res.name;
}) })
@ -201,6 +235,14 @@ export default {
that.form.wm_in = arr[0].id; that.form.wm_in = arr[0].id;
that.form.count_use = arr[0].count; that.form.count_use = arr[0].count;
that.wm_in = arr[0].batch; 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{ }else{
that.wm_in = ''; that.wm_in = '';
that.$message.error("批次号不存在"); that.$message.error("批次号不存在");
@ -271,7 +313,7 @@ export default {
that.form.mgroup = that.mgroup; that.form.mgroup = that.mgroup;
that.$API.wpm.mlog.quick.req(that.form).then((res) => { that.$API.wpm.mlog.quick.req(that.form).then((res) => {
that.isSaveing = false; that.isSaveing = false;
that.$emit("success"); that.$emit("success",res.mlog);
that.visible = false; that.visible = false;
that.$message.success("操作成功"); that.$message.success("操作成功");
}).catch(()=>{ }).catch(()=>{

View File

@ -206,7 +206,7 @@
:dept="deptId" :dept="deptId"
:mgroupName = "mgroupName" :mgroupName = "mgroupName"
:mgroupMtype="mgroupMtype" :mgroupMtype="mgroupMtype"
@success="handleSaveSuccess" @success="handleSaveSuccess2"
@closed="dialog.save2 = false" @closed="dialog.save2 = false"
> >
</saves-dialog> </saves-dialog>
@ -507,12 +507,21 @@ export default {
handleQuery() { handleQuery() {
this.$refs.table.queryData(this.query); this.$refs.table.queryData(this.query);
}, },
// //
//
handleSaveSuccess(data, mode) { handleSaveSuccess(data, mode) {
this.dialog.save = true; this.dialog.save = true;
this.$refs.table.refresh(); 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> </script>