diff --git a/src/api/model/wpm.js b/src/api/model/wpm.js index 42de0095..72f4133d 100644 --- a/src/api/model/wpm.js +++ b/src/api/model/wpm.js @@ -351,6 +351,26 @@ export default { }, }, }, + mloguser: { + list: { + name: "列表", + req: async function (data) { + return await http.get(`${config.API_URL}/wpm/mloguser/`, data); + }, + }, + create: { + name: "创建", + req: async function (data) { + return await http.post(`${config.API_URL}/wpm/mloguser/`, data); + }, + }, + delete: { + name: "删除", + req: async function (id) { + return await http.delete(`${config.API_URL}/wpm/mloguser/${id}/`); + }, + }, + }, handover: { list: { name: "值班记录列表", diff --git a/src/views/wpm_bx/mlog_detail.vue b/src/views/wpm_bx/mlog_detail.vue index 2883daec..d2a06319 100644 --- a/src/views/wpm_bx/mlog_detail.vue +++ b/src/views/wpm_bx/mlog_detail.vue @@ -68,27 +68,152 @@ > + + + 新增 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
- 新增 -
-
+ 新增 @@ -190,12 +315,13 @@ - + @@ -342,7 +468,11 @@ export default { process:{ type: String, default: "", - } + }, + dept:{ + type: String, + default: "", + }, }, components: { editDialog, @@ -358,6 +488,7 @@ export default { loading: false, //表单数据 form: {}, + muserForm:{}, dialog: { save: false, edit: false, @@ -367,6 +498,7 @@ export default { }, apiObj: null, apiObjWm:null, + apiObjMuser:null, paramsWm: { page: 0, search:'', @@ -383,6 +515,9 @@ export default { mlog: "", material_out__isnull: 0, }, + paramsMuser:{ + mlog:"" + }, tracking:10, mlogb:"", mgroup: "", @@ -394,6 +529,7 @@ export default { fileList:[], tableDataWm:[], oinfo_json:[], + processOptions:[], test_file:'', deptId: "", visible: false, @@ -401,19 +537,17 @@ export default { options: [], tableData:[], tableData2:[], + shiftOtions:[], defectOptions:[], isSingle:true, saveInDialog: false, printVisible:false, + saveMuserDialog:false, setFiltersVisible: false, rules: { - count_use: [ - { - required: true, - message: "请输入领取数量", - trigger: "blur", - }, - ], + count_use: [{required: true,message: "请输入领取数量",trigger: "blur"}], + process:[{required: true,message: "请选择工序",trigger: "blur"}], + shift:[{required: true,message: "请选择班次",trigger: "blur"}], }, route_file:null, handle_date:'', @@ -445,6 +579,8 @@ export default { that.tableData = res; }) that.getMlogItem(); + that.getPreocess(); + that.getShift(); }, methods: { open() { @@ -483,7 +619,22 @@ export default { }) }); }, - + getPreocess(){ + let that = this; + that.$API.mtm.process.list.req({page:0,parent:that.process}).then((res) => { + that.processOptions = res; + if(res.length>0){ + that.paramsMuser.mlog = that.mlogId; + that.apiObjMuser = that.$API.wpm.mloguser.list; + } + }) + }, + getShift(){ + let that = this; + that.$API.mtm.shift.list.req({ page: 0 }).then((res) => { + that.shiftOtions = res; + }); + }, //表单注入数据 setData(data) { Object.assign(this.form, data); @@ -582,6 +733,36 @@ export default { that.$message.success("操作成功"); }); }, + table_muser_add(){ + let that = this; + let userInfo = that.$TOOL.data.get("USER_INFO"); + 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.saveMuserDialog = true; + }, + saveMuserSubmit (){ + let that = this; + that.isSaveing = true; + that.$API.wpm.mloguser.create.req(that.muserForm).then((res) => { + that.isSaveing = false; + that.visible = false; + that.$message.success("操作成功"); + that.$refs.tableMuser.refresh(); + }).catch(() => { + that.isSaveing = false; + }) + }, + table_muser_del(row){ + let that = this; + that.$confirm("确定删除吗?").then(res=>{ + that.$API.wpm.mloguser.delete.req(row.id).then((res) => { + that.$message.success("删除成功"); + that.$refs.tableMuser.refresh(); + }) + }) + }, handleSaveSuccess() { this.$refs.tableIn.refresh(); this.$refs.tableOut.refresh(); diff --git a/src/views/wpm_bx/mlogs.vue b/src/views/wpm_bx/mlogs.vue index 478c2cb5..fdfe75de 100644 --- a/src/views/wpm_bx/mlogs.vue +++ b/src/views/wpm_bx/mlogs.vue @@ -171,6 +171,7 @@ :mlogId="mlogId" :process="processId" :mtask="mtask" + :dept = "deptId" @closed="detailClose" > @@ -245,7 +246,6 @@ export default { that.processCate = res.process_cate; that.params.mgroup = res.id; that.apiObj = that.$API.wpm.mlog.list; - // that.$refs.table.refresh(); }); }, getRemaTime(row){ @@ -253,12 +253,8 @@ export default { let times = 0; let nowTime = new Date().getTime(); let startTiem = new Date(row.work_start_time).getTime(); - console.log('nowTime',nowTime) - console.log('startTiem',startTiem) let remaTime = nowTime - startTiem; - console.log('remaTime',remaTime) let temp = Math.floor(remaTime/1000*60); - console.log('temp',temp) if(remaTime>0&&row.reminder_interval_list[0]){ if(temp