This commit is contained in:
shijing 2023-12-18 13:14:34 +08:00
commit 825364b137
1 changed files with 80 additions and 73 deletions

View File

@ -111,7 +111,8 @@
</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">
@ -137,15 +138,20 @@
<el-table-column label="碎料" prop="count_break"> </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>
@ -243,41 +249,21 @@
</el-main>
</el-container>
</el-main>
<save-dialog
v-if="dialogSave"
ref="saveDialog"
:mtask="mtask"
:mgroup="mgroup"
:material_out="material_out"
:brothersList="brothersList"
: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" :brothersList="brothersList" :activeType="activeName" @success="handleSaveSuccess"
@closed="dialogSave = false"></save-dialog>
<showDrawer ref="showDrawer" v-if="visibleDrawer" :mlogId="mlogId" @closed="visibleDrawer = false">
</showDrawer>
<el-dialog title="编辑任务" v-model="addMtaskInfoVisible">
<el-form :model="addMtaskInfoForm">
<el-form-item label="配分料数(kg)" width="100">
<el-input-number
v-model="addMtaskInfoForm.peifen_kg"
controls-position="right"
:min="0"
:step="1"
:step-strictly="true"
style="width: 100%"
placeholder="请输入"
>
<el-input-number v-model="addMtaskInfoForm.peifen_kg" controls-position="right" :min="0" :step="1"
:step-strictly="true" style="width: 100%" placeholder="请输入">
</el-input-number>
</el-form-item>
</el-form>
<el-footer>
<el-button type="primary" @click="updateMtaskSubmit"
>确定</el-button
>
<el-button type="primary" @click="updateMtaskSubmit">确定</el-button>
<el-button @click="addMtaskInfoVisible = false">取消</el-button>
</el-footer>
</el-dialog>
@ -292,6 +278,7 @@ export default {
},
data() {
return {
mlogHandleLoading: false,
addMtaskInfoForm: {},
addMtaskInfoVisible: false,
activeName: '10车间',
@ -315,7 +302,6 @@ export default {
dialogSave: false,
paramsHandover: {},
paramsWm: {},
mtask:'',
mgroup: '',
mlogId: '',
material_out: ''
@ -325,6 +311,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;
})
},
addMtaskInfo() {
this.addMtaskInfoForm.peifen_kg = this.currentMtask.peifen_kg
this.addMtaskInfoVisible = true
@ -371,13 +368,18 @@ 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.brothersListorigin = [];
this.brothersListorigin = this.currentMtask.material_out_.brothers;
this.getMlogs()
@ -461,10 +463,15 @@ export default {
this.getMlogs();
},
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
})
},
}
}