Merge branch 'v2' of https://e.coding.net/ctcdevteam/ehs/ehs_web into v2
This commit is contained in:
commit
29330fe515
|
@ -203,6 +203,15 @@ export default {
|
|||
`${config.API_URL}/wpm/mlog/${id}/submit/`,
|
||||
);
|
||||
}
|
||||
},
|
||||
revert:{
|
||||
name: "撤回",
|
||||
req: async function(id, data){
|
||||
return await http.post(
|
||||
`${config.API_URL}/wpm/mlog/${id}/revert/`,
|
||||
data
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
handover:{
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="60">
|
||||
<template #default="scope">
|
||||
<el-link type="primary" @click="table_submit(scope.row)" v-auth="'mtask.submit'"
|
||||
<el-link type="primary" @click="mtask_submit(scope.row)" v-auth="'mtask.submit'"
|
||||
v-if="scope.row.state != 40">提交
|
||||
</el-link>
|
||||
</template>
|
||||
|
@ -110,7 +110,8 @@
|
|||
<el-table-column label="合格量" prop="count_ok"> </el-table-column>
|
||||
<el-table-column label="合格率" prop="count">
|
||||
<template #default="scope">
|
||||
<span>{{ Math.floor(scope.row.count_ok / scope.row.count_real*100) }}%</span>
|
||||
<span>{{ Math.floor(scope.row.count_ok / scope.row.count_real * 100)
|
||||
}}%</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格原因及数量" align="center">
|
||||
|
@ -136,15 +137,20 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="120" align="center">
|
||||
<template #default="scope">
|
||||
<el-link type="primary" @click="table_edit(scope.row)"
|
||||
<el-button link type="primary" @click="table_edit(scope.row)"
|
||||
v-auth="'mlog.update'" v-if="scope.row.submit_time == null">编辑
|
||||
</el-link>
|
||||
<el-link type="danger" @click="table_del(scope.row)" v-auth="'mlog.delete'"
|
||||
v-if="scope.row.submit_time == null">删除
|
||||
</el-link>
|
||||
<el-link type="primary" @click="mlog_submit(scope.row)"
|
||||
v-auth="'mlog.submit'" v-if="scope.row.submit_time == null">提交
|
||||
</el-link>
|
||||
</el-button>
|
||||
<el-button link type="danger" @click="table_del(scope.row)"
|
||||
v-auth="'mlog.delete'" v-if="scope.row.submit_time == null">删除
|
||||
</el-button>
|
||||
<el-button link type="primary" @click="mlog_submit(scope.row)"
|
||||
v-auth="'mlog.submit'" v-if="scope.row.submit_time == null"
|
||||
:loading="mlogHandleLoading">提交
|
||||
</el-button>
|
||||
<el-button link type="danger" @click="mlog_revert(scope.row)"
|
||||
v-auth="'mlog.submit'" v-if="scope.row.submit_time != null"
|
||||
:loading="mlogHandleLoading">撤回
|
||||
</el-button>
|
||||
<el-button link type="success" @click="table_show(scope.row)">
|
||||
日志记录
|
||||
</el-button>
|
||||
|
@ -244,20 +250,10 @@
|
|||
</el-main>
|
||||
</el-container>
|
||||
</el-main>
|
||||
<save-dialog
|
||||
v-if="dialogSave"
|
||||
ref="saveDialog"
|
||||
:mtask="mtask"
|
||||
:mgroup="mgroup"
|
||||
:material_out="material_out"
|
||||
:activeType="activeName"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialogSave = false"
|
||||
></save-dialog>
|
||||
<showDrawer ref="showDrawer"
|
||||
v-if="visibleDrawer"
|
||||
:mlogId="mlogId"
|
||||
@closed="visibleDrawer = false">
|
||||
<save-dialog v-if="dialogSave" ref="saveDialog" :mtask="currentMtask.id" :mgroup="mgroup"
|
||||
:material_out="material_out" :activeType="activeName" @success="handleSaveSuccess"
|
||||
@closed="dialogSave = false"></save-dialog>
|
||||
<showDrawer ref="showDrawer" v-if="visibleDrawer" :mlogId="mlogId" @closed="visibleDrawer = false">
|
||||
</showDrawer>
|
||||
</el-container>
|
||||
</template>
|
||||
|
@ -270,6 +266,7 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
mlogHandleLoading: false,
|
||||
activeName: '7车间',
|
||||
currentDept: {},
|
||||
currentMtask: {},
|
||||
|
@ -290,7 +287,6 @@ export default {
|
|||
paramsWm: {},
|
||||
mlogs: [],
|
||||
mlogId: '',
|
||||
mtask:'',
|
||||
mgroup: '',
|
||||
material_out: ''
|
||||
}
|
||||
|
@ -299,6 +295,17 @@ export default {
|
|||
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;
|
||||
})
|
||||
},
|
||||
tomio() {
|
||||
this.$router.push({ name: "mainso_mio" });
|
||||
},
|
||||
|
@ -369,24 +376,26 @@ 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.getMtask()
|
||||
this.getMlogs()
|
||||
},
|
||||
table_submit(row) {
|
||||
mtask_submit(row) {
|
||||
this.$API.pm.mtask.submit.req(row.id).then(res => {
|
||||
this.$message.success('操作成功')
|
||||
if (row.id == this.currentMtask.id) {
|
||||
this.mtaskClick(row)
|
||||
}
|
||||
this.$refs.table_mtask.refresh()
|
||||
this.mtaskClick(this.currentMtask)
|
||||
}).catch(err => {
|
||||
|
||||
})
|
||||
},
|
||||
handleSaveSuccess() {
|
||||
|
@ -400,10 +409,15 @@ export default {
|
|||
});
|
||||
},
|
||||
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
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,12 +9,12 @@
|
|||
<span>{{ scope.row.change_time.slice(0, -3) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变更类型" fixed="left">
|
||||
<template #default="scope">
|
||||
<el-table-column label="变更类型" fixed="left" prop="action">
|
||||
<!-- <template #default="scope">
|
||||
<span v-if="scope.row.action=='create'">新建</span>
|
||||
<span v-if="scope.row.action=='update'">更改</span>
|
||||
<span v-if="scope.row.action=='submit'">提交</span>
|
||||
</template>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="变更人" fixed="left" prop="change_user_name">
|
||||
</el-table-column>
|
||||
|
|
Loading…
Reference in New Issue