This commit is contained in:
shijing 2023-12-18 12:36:23 +08:00
commit 29330fe515
3 changed files with 95 additions and 72 deletions

View File

@ -203,6 +203,15 @@ export default {
`${config.API_URL}/wpm/mlog/${id}/submit/`, `${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:{ handover:{

View File

@ -45,7 +45,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" width="60"> <el-table-column label="操作" fixed="right" width="60">
<template #default="scope"> <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">提交 v-if="scope.row.state != 40">提交
</el-link> </el-link>
</template> </template>
@ -110,7 +110,8 @@
<el-table-column label="合格量" prop="count_ok"> </el-table-column> <el-table-column label="合格量" prop="count_ok"> </el-table-column>
<el-table-column label="合格率" prop="count"> <el-table-column label="合格率" prop="count">
<template #default="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="不合格原因及数量" align="center"> <el-table-column label="不合格原因及数量" align="center">
@ -136,15 +137,20 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" width="120" align="center"> <el-table-column label="操作" fixed="right" width="120" align="center">
<template #default="scope"> <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">编辑 v-auth="'mlog.update'" v-if="scope.row.submit_time == null">编辑
</el-link> </el-button>
<el-link type="danger" @click="table_del(scope.row)" v-auth="'mlog.delete'" <el-button link type="danger" @click="table_del(scope.row)"
v-if="scope.row.submit_time == null">删除 v-auth="'mlog.delete'" v-if="scope.row.submit_time == null">删除
</el-link> </el-button>
<el-link type="primary" @click="mlog_submit(scope.row)" <el-button link type="primary" @click="mlog_submit(scope.row)"
v-auth="'mlog.submit'" v-if="scope.row.submit_time == null">提交 v-auth="'mlog.submit'" v-if="scope.row.submit_time == null"
</el-link> :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 link type="success" @click="table_show(scope.row)">
日志记录 日志记录
</el-button> </el-button>
@ -244,20 +250,10 @@
</el-main> </el-main>
</el-container> </el-container>
</el-main> </el-main>
<save-dialog <save-dialog v-if="dialogSave" ref="saveDialog" :mtask="currentMtask.id" :mgroup="mgroup"
v-if="dialogSave" :material_out="material_out" :activeType="activeName" @success="handleSaveSuccess"
ref="saveDialog" @closed="dialogSave = false"></save-dialog>
:mtask="mtask" <showDrawer ref="showDrawer" v-if="visibleDrawer" :mlogId="mlogId" @closed="visibleDrawer = false">
: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> </showDrawer>
</el-container> </el-container>
</template> </template>
@ -266,11 +262,12 @@ import saveDialog from "./worktask_form.vue";
import showDrawer from "./mlog_drawer.vue"; import showDrawer from "./mlog_drawer.vue";
export default { export default {
components: { components: {
saveDialog,showDrawer saveDialog, showDrawer
}, },
data() { data() {
return { return {
activeName:'7车间', mlogHandleLoading: false,
activeName: '7车间',
currentDept: {}, currentDept: {},
currentMtask: {}, currentMtask: {},
apiMtask: null, apiMtask: null,
@ -282,27 +279,37 @@ export default {
30: "生产中", 30: "生产中",
40: "已提交", 40: "已提交",
}, },
dialogSave:false, dialogSave: false,
visibleDrawer:false, visibleDrawer: false,
apiObjHandover: null, apiObjHandover: null,
paramsHandover: {}, paramsHandover: {},
apiObjWm: null, apiObjWm: null,
paramsWm: {}, paramsWm: {},
mlogs:[], mlogs: [],
mlogId:'', mlogId: '',
mtask:'', mgroup: '',
mgroup:'', material_out: ''
material_out:''
} }
}, },
mounted() { mounted() {
this.initDept() this.initDept()
}, },
methods: { 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() { tomio() {
this.$router.push({ name: "mainso_mio" }); this.$router.push({ name: "mainso_mio" });
}, },
tomioin(){ tomioin() {
this.$router.push({ name: "halfgood_mio" }); this.$router.push({ name: "halfgood_mio" });
}, },
// //
@ -319,7 +326,7 @@ export default {
that.$message.warning("请选择任务"); that.$message.warning("请选择任务");
} }
}, },
table_edit(row){ table_edit(row) {
this.dialogSave = true; this.dialogSave = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row); this.$refs.saveDialog.open("edit").setData(row);
@ -332,9 +339,9 @@ export default {
type: "warning", type: "warning",
}).then(() => { }).then(() => {
that.$API.wpm.mlog.delete.req(row.id).then((res) => { that.$API.wpm.mlog.delete.req(row.id).then((res) => {
that.$message.success("删除成功"); that.$message.success("删除成功");
that.getMlogs(); that.getMlogs();
return res; return res;
}).catch((err) => { }).catch((err) => {
return err; return err;
}); });
@ -369,27 +376,29 @@ export default {
}) })
}, },
getMlogs() { 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 this.mlogs = res
}) })
}, },
getMtask() {
this.$API.pm.mtask.item.req(this.currentMtask.id).then(res => {
this.currentMtask = res
})
},
mtaskClick(row) { mtaskClick(row) {
this.currentMtask = row; this.currentMtask = row;
this.mtask = row.id; this.getMtask()
this.getMlogs() this.getMlogs()
}, },
table_submit(row) { mtask_submit(row) {
this.$API.pm.mtask.submit.req(row.id).then(res => { this.$API.pm.mtask.submit.req(row.id).then(res => {
this.$message.success('操作成功') this.$message.success('操作成功')
if (row.id == this.currentMtask.id) {
this.mtaskClick(row)
}
this.$refs.table_mtask.refresh() this.$refs.table_mtask.refresh()
this.mtaskClick(this.currentMtask)
}).catch(err => { }).catch(err => {
}) })
}, },
handleSaveSuccess(){ handleSaveSuccess() {
this.getMlogs(); this.getMlogs();
}, },
table_show(row) { table_show(row) {
@ -399,11 +408,16 @@ export default {
this.$refs.showDrawer.open(); this.$refs.showDrawer.open();
}); });
}, },
mlog_submit(row){ mlog_submit(row) {
this.mlogHandleLoading = true
this.$API.wpm.mlog.submit.req(row.id).then(res => { this.$API.wpm.mlog.submit.req(row.id).then(res => {
this.$message.success('操作成功') this.$message.success('操作成功')
this.$refs.table_mlog.refresh() this.mtaskClick(this.currentMtask)
}).catch(err => {}) this.$refs.table_wm.refresh()
this.mlogHandleLoading = false
}).catch(err => {
this.mlogHandleLoading = false
})
}, },
} }
} }

View File

@ -6,92 +6,92 @@
<!-- <el-table-column type="index" fixed="left" width="40" /> --> <!-- <el-table-column type="index" fixed="left" width="40" /> -->
<el-table-column label="变更时间" fixed="left"> <el-table-column label="变更时间" fixed="left">
<template #default="scope"> <template #default="scope">
<span>{{scope.row.change_time.slice(0, -3)}}</span> <span>{{ scope.row.change_time.slice(0, -3) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="变更类型" fixed="left"> <el-table-column label="变更类型" fixed="left" prop="action">
<template #default="scope"> <!-- <template #default="scope">
<span v-if="scope.row.action=='create'">新建</span> <span v-if="scope.row.action=='create'">新建</span>
<span v-if="scope.row.action=='update'">更改</span> <span v-if="scope.row.action=='update'">更改</span>
<span v-if="scope.row.action=='submit'">提交</span> <span v-if="scope.row.action=='submit'">提交</span>
</template> </template> -->
</el-table-column> </el-table-column>
<el-table-column label="变更人" fixed="left" prop="change_user_name"> <el-table-column label="变更人" fixed="left" prop="change_user_name">
</el-table-column> </el-table-column>
<el-table-column label="工序"> <el-table-column label="工序">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.mgroup_name}}</span> <span v-if="scope.row.val_new">{{ scope.row.val_new.mgroup_name }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="产品编号"> <el-table-column label="产品编号">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.batch}}</span> <span v-if="scope.row.val_new">{{ scope.row.val_new.batch }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="加工设备"> <el-table-column label="加工设备">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.equipment_name}}</span> <span v-if="scope.row.val_new">{{ scope.row.val_new.equipment_name }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="领用数量"> <el-table-column label="领用数量">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_use}}</span> <span v-if="scope.row.val_new">{{ scope.row.val_new.count_use }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="加工数量"> <el-table-column label="加工数量">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_real}}</span> <span v-if="scope.row.val_new">{{ scope.row.val_new.count_real }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="合格数量"> <el-table-column label="合格数量">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_ok}}</span> <span v-if="scope.row.val_new">{{ scope.row.val_new.count_ok }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="不合格数量" align="center"> <el-table-column label="不合格数量" align="center">
<el-table-column label="弯曲"> <el-table-column label="弯曲">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_n_wq}}</span> <span v-if="scope.row.val_new">{{ scope.row.val_new.count_n_wq }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="炸纹"> <el-table-column label="炸纹">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_n_zw}}</span> <span v-if="scope.row.val_new">{{ scope.row.val_new.count_n_zw }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="条纹"> <el-table-column label="条纹">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_n_tw}}</span> <span v-if="scope.row.val_new">{{ scope.row.val_new.count_n_tw }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="" label="气泡"> <el-table-column prop="" label="气泡">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_n_qp}}</span> <span v-if="scope.row.val_new">{{ scope.row.val_new.count_n_qp }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="断裂"> <el-table-column label="断裂">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_n_dl}}</span> <span v-if="scope.row.val_new">{{ scope.row.val_new.count_n_dl }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="偏壁"> <el-table-column label="偏壁">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_n_pb}}</span> <span v-if="scope.row.val_new">{{ scope.row.val_new.count_n_pb }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="" label="大小头"> <el-table-column prop="" label="大小头">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_n_dxt}}</span> <span v-if="scope.row.val_new">{{ scope.row.val_new.count_n_dxt }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="结石气绒"> <el-table-column label="结石气绒">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_n_jsqx}}</span> <span v-if="scope.row.val_new">{{ scope.row.val_new.count_n_jsqx }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="其他"> <el-table-column label="其他">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_n_qt}}</span> <span v-if="scope.row.val_new">{{ scope.row.val_new.count_n_qt }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -104,15 +104,15 @@
export default { export default {
emits: ["closed"], emits: ["closed"],
props: { props: {
mlogId:{ type: String, default:''} mlogId: { type: String, default: '' }
}, },
data() { data() {
return { return {
visible: false, visible: false,
apiObj: null, apiObj: null,
paramsObj: { paramsObj: {
model_name:'wpm.mlog', model_name: 'wpm.mlog',
instance_id:'' instance_id: ''
}, },
state_: { state_: {
10: "创建中", 10: "创建中",