diff --git a/src/views/wpm/mlog_dept10.vue b/src/views/wpm/mlog_dept10.vue
index 6509853c..ea2bb284 100644
--- a/src/views/wpm/mlog_dept10.vue
+++ b/src/views/wpm/mlog_dept10.vue
@@ -63,7 +63,7 @@
任务信息
编辑
+ v-if="currentMtask && (currentMtask.state == 20 || currentMtask.state == 10)">编辑
@@ -83,7 +83,7 @@
{{ currentMtask.peifen_kg
}}
-
+
@@ -111,7 +111,8 @@
- {{ Math.floor(scope.row.count_ok / scope.row.count_real*100) }}%
+ {{ Math.floor(scope.row.count_ok / scope.row.count_real * 100)
+ }}%
@@ -137,15 +138,20 @@
- 编辑
-
- 删除
-
- 提交
-
+
+ 删除
+
+ 提交
+
+ 撤回
+
日志记录
@@ -243,43 +249,23 @@
-
-
+
+
-
-
-
+
+
+
- 确定
- 取消
-
+ 确定
+ 取消
+
@@ -288,14 +274,15 @@ import saveDialog from "./worktask_form.vue";
import showDrawer from "./mlog_drawer.vue";
export default {
components: {
- saveDialog,showDrawer
+ saveDialog, showDrawer
},
data() {
return {
+ mlogHandleLoading: false,
addMtaskInfoForm: {},
addMtaskInfoVisible: false,
- activeName:'10车间',
- mlogs:[],
+ activeName: '10车间',
+ mlogs: [],
currentDept: {},
currentMtask: {},
apiMtask: null,
@@ -307,30 +294,40 @@ export default {
30: "生产中",
40: "已提交",
},
- brothersList:[],
- brothersListorigin:[],
+ brothersList: [],
+ brothersListorigin: [],
apiObjHandover: null,
apiObjWm: null,
- visibleDrawer:false,
- dialogSave:false,
+ visibleDrawer: false,
+ dialogSave: false,
paramsHandover: {},
paramsWm: {},
- mtask:'',
- mgroup:'',
- mlogId:'',
- material_out:''
+ mgroup: '',
+ mlogId: '',
+ material_out: ''
}
},
mounted() {
this.initDept()
},
methods: {
+ mlog_revert(row) {
+ this.mlogHandleLoading = true;
+ this.$API.wpm.mlog.revert.req(row.id).then(res => {
+ this.$message.success("撤回成功");
+ this.mtaskClick(this.currentMtask)
+ this.$refs.table_wm.refresh()
+ this.mlogHandleLoading = false;
+ }).catch(e => {
+ this.mlogHandleLoading = false;
+ })
+ },
addMtaskInfo() {
this.addMtaskInfoForm.peifen_kg = this.currentMtask.peifen_kg
this.addMtaskInfoVisible = true
},
updateMtaskSubmit() {
- this.$API.pm.mtask.addInfo.req(this.currentMtask.id, this.addMtaskInfoForm).then(res=>{
+ this.$API.pm.mtask.addInfo.req(this.currentMtask.id, this.addMtaskInfoForm).then(res => {
this.currentMtask.peifen_kg = this.addMtaskInfoForm.peifen_kg
this.addMtaskInfoVisible = false
this.$message.success('操作成功')
@@ -339,7 +336,7 @@ export default {
tomio() {
this.$router.push({ name: "mainso_mio" });
},
- tomioin(){
+ tomioin() {
this.$router.push({ name: "halfgood_mio" });
},
initDept() {
@@ -371,25 +368,30 @@ export default {
})
},
getMlogs() {
- this.$API.wpm.mlog.list.req({ mtask: this.mtask, page: 0 }).then(res => {
+ this.$API.wpm.mlog.list.req({ mtask: this.currentMtask.id, page: 0 }).then(res => {
this.mlogs = res
})
},
+ getMtask() {
+ this.$API.pm.mtask.item.req(this.currentMtask.id).then(res => {
+ this.currentMtask = res
+ })
+ },
mtaskClick(row) {
this.currentMtask = row;
- this.mtask = row.id;
- this.brothersListorigin=[];
+ this.getMtask()
+ this.brothersListorigin = [];
this.brothersListorigin = this.currentMtask.material_out_.brothers;
this.getMlogs()
},
- addMlog(){
+ addMlog() {
let that = this;
if (that.currentMtask && that.currentMtask.id) {
that.mgroup = that.currentMtask.mgroup;
that.material_out = that.currentMtask.material_out;
let arr = [];
- this.brothersList =[];
- this.brothersListorigin.forEach(item=>{
+ this.brothersList = [];
+ this.brothersListorigin.forEach(item => {
let obj = {};
obj.count_ok = null;
obj.material_out = item;
@@ -422,15 +424,15 @@ export default {
this.$refs.showDrawer.open();
});
},
- table_edit(row){
+ table_edit(row) {
let arr = [];
let mlogb = row.mlogb;
- this.brothersListorigin.forEach(item=>{
+ this.brothersListorigin.forEach(item => {
let obj = {};
obj.count_ok = null;
obj.material_out = item;
- for(let i=0;i {
that.$API.wpm.mlog.delete.req(row.id).then((res) => {
- that.$message.success("删除成功");
- that.getMlogs();
- return res;
+ that.$message.success("删除成功");
+ that.getMlogs();
+ return res;
}).catch((err) => {
- return err;
+ return err;
});
}).catch(() => { });
},
- handleSaveSuccess(){
+ handleSaveSuccess() {
this.getMlogs();
},
- mlog_submit(row){
+ mlog_submit(row) {
+ this.mlogHandleLoading = true
this.$API.wpm.mlog.submit.req(row.id).then(res => {
this.$message.success('操作成功')
- this.$refs.table_mlog.refresh()
- }).catch(err => {})
+ this.mtaskClick(this.currentMtask)
+ this.$refs.table_wm.refresh()
+ this.mlogHandleLoading = false
+ }).catch(err => {
+ this.mlogHandleLoading = false
+ })
},
}
}