feat: 10车间撤回
This commit is contained in:
parent
29330fe515
commit
ae299a4194
|
@ -63,7 +63,7 @@
|
||||||
<span>任务信息</span>
|
<span>任务信息</span>
|
||||||
<span>
|
<span>
|
||||||
<el-button type="primary" link @click="addMtaskInfo"
|
<el-button type="primary" link @click="addMtaskInfo"
|
||||||
v-if="currentMtask && (currentMtask.state == 20||currentMtask.state==10)">编辑</el-button>
|
v-if="currentMtask && (currentMtask.state == 20 || currentMtask.state == 10)">编辑</el-button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -111,7 +111,8 @@
|
||||||
</el-table-column>
|
</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">
|
||||||
|
@ -137,15 +138,20 @@
|
||||||
<el-table-column label="碎料" prop="count_break"> </el-table-column>
|
<el-table-column label="碎料" prop="count_break"> </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>
|
||||||
|
@ -243,43 +249,23 @@
|
||||||
</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" :brothersList="brothersList" :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"
|
|
||||||
:brothersList="brothersList"
|
|
||||||
:activeType="activeName"
|
|
||||||
@success="handleSaveSuccess"
|
|
||||||
@closed="dialogSave = false"
|
|
||||||
></save-dialog>
|
|
||||||
<showDrawer ref="showDrawer"
|
|
||||||
v-if="visibleDrawer"
|
|
||||||
:mlogId="mlogId"
|
|
||||||
@closed="visibleDrawer = false">
|
|
||||||
</showDrawer>
|
</showDrawer>
|
||||||
<el-dialog title="编辑任务" v-model="addMtaskInfoVisible">
|
<el-dialog title="编辑任务" v-model="addMtaskInfoVisible">
|
||||||
<el-form :model="addMtaskInfoForm">
|
<el-form :model="addMtaskInfoForm">
|
||||||
<el-form-item label="配分料数(kg)" width="100">
|
<el-form-item label="配分料数(kg)" width="100">
|
||||||
<el-input-number
|
<el-input-number v-model="addMtaskInfoForm.peifen_kg" controls-position="right" :min="0" :step="1"
|
||||||
v-model="addMtaskInfoForm.peifen_kg"
|
:step-strictly="true" style="width: 100%" placeholder="请输入">
|
||||||
controls-position="right"
|
</el-input-number>
|
||||||
:min="0"
|
</el-form-item>
|
||||||
:step="1"
|
|
||||||
:step-strictly="true"
|
|
||||||
style="width: 100%"
|
|
||||||
placeholder="请输入"
|
|
||||||
>
|
|
||||||
</el-input-number>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-footer>
|
<el-footer>
|
||||||
<el-button type="primary" @click="updateMtaskSubmit"
|
<el-button type="primary" @click="updateMtaskSubmit">确定</el-button>
|
||||||
>确定</el-button
|
<el-button @click="addMtaskInfoVisible = false">取消</el-button>
|
||||||
>
|
</el-footer>
|
||||||
<el-button @click="addMtaskInfoVisible = false">取消</el-button>
|
|
||||||
</el-footer>
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-container>
|
</el-container>
|
||||||
</template>
|
</template>
|
||||||
|
@ -288,14 +274,15 @@ 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 {
|
||||||
|
mlogHandleLoading: false,
|
||||||
addMtaskInfoForm: {},
|
addMtaskInfoForm: {},
|
||||||
addMtaskInfoVisible: false,
|
addMtaskInfoVisible: false,
|
||||||
activeName:'10车间',
|
activeName: '10车间',
|
||||||
mlogs:[],
|
mlogs: [],
|
||||||
currentDept: {},
|
currentDept: {},
|
||||||
currentMtask: {},
|
currentMtask: {},
|
||||||
apiMtask: null,
|
apiMtask: null,
|
||||||
|
@ -307,30 +294,40 @@ export default {
|
||||||
30: "生产中",
|
30: "生产中",
|
||||||
40: "已提交",
|
40: "已提交",
|
||||||
},
|
},
|
||||||
brothersList:[],
|
brothersList: [],
|
||||||
brothersListorigin:[],
|
brothersListorigin: [],
|
||||||
apiObjHandover: null,
|
apiObjHandover: null,
|
||||||
apiObjWm: null,
|
apiObjWm: null,
|
||||||
visibleDrawer:false,
|
visibleDrawer: false,
|
||||||
dialogSave:false,
|
dialogSave: false,
|
||||||
paramsHandover: {},
|
paramsHandover: {},
|
||||||
paramsWm: {},
|
paramsWm: {},
|
||||||
mtask:'',
|
mgroup: '',
|
||||||
mgroup:'',
|
mlogId: '',
|
||||||
mlogId:'',
|
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;
|
||||||
|
})
|
||||||
|
},
|
||||||
addMtaskInfo() {
|
addMtaskInfo() {
|
||||||
this.addMtaskInfoForm.peifen_kg = this.currentMtask.peifen_kg
|
this.addMtaskInfoForm.peifen_kg = this.currentMtask.peifen_kg
|
||||||
this.addMtaskInfoVisible = true
|
this.addMtaskInfoVisible = true
|
||||||
},
|
},
|
||||||
updateMtaskSubmit() {
|
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.currentMtask.peifen_kg = this.addMtaskInfoForm.peifen_kg
|
||||||
this.addMtaskInfoVisible = false
|
this.addMtaskInfoVisible = false
|
||||||
this.$message.success('操作成功')
|
this.$message.success('操作成功')
|
||||||
|
@ -339,7 +336,7 @@ export default {
|
||||||
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" });
|
||||||
},
|
},
|
||||||
initDept() {
|
initDept() {
|
||||||
|
@ -371,25 +368,30 @@ 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.brothersListorigin=[];
|
this.brothersListorigin = [];
|
||||||
this.brothersListorigin = this.currentMtask.material_out_.brothers;
|
this.brothersListorigin = this.currentMtask.material_out_.brothers;
|
||||||
this.getMlogs()
|
this.getMlogs()
|
||||||
},
|
},
|
||||||
addMlog(){
|
addMlog() {
|
||||||
let that = this;
|
let that = this;
|
||||||
if (that.currentMtask && that.currentMtask.id) {
|
if (that.currentMtask && that.currentMtask.id) {
|
||||||
that.mgroup = that.currentMtask.mgroup;
|
that.mgroup = that.currentMtask.mgroup;
|
||||||
that.material_out = that.currentMtask.material_out;
|
that.material_out = that.currentMtask.material_out;
|
||||||
let arr = [];
|
let arr = [];
|
||||||
this.brothersList =[];
|
this.brothersList = [];
|
||||||
this.brothersListorigin.forEach(item=>{
|
this.brothersListorigin.forEach(item => {
|
||||||
let obj = {};
|
let obj = {};
|
||||||
obj.count_ok = null;
|
obj.count_ok = null;
|
||||||
obj.material_out = item;
|
obj.material_out = item;
|
||||||
|
@ -422,15 +424,15 @@ export default {
|
||||||
this.$refs.showDrawer.open();
|
this.$refs.showDrawer.open();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
table_edit(row){
|
table_edit(row) {
|
||||||
let arr = [];
|
let arr = [];
|
||||||
let mlogb = row.mlogb;
|
let mlogb = row.mlogb;
|
||||||
this.brothersListorigin.forEach(item=>{
|
this.brothersListorigin.forEach(item => {
|
||||||
let obj = {};
|
let obj = {};
|
||||||
obj.count_ok = null;
|
obj.count_ok = null;
|
||||||
obj.material_out = item;
|
obj.material_out = item;
|
||||||
for(let i=0;i<mlogb.length;i++){
|
for (let i = 0; i < mlogb.length; i++) {
|
||||||
if(mlogb[i].material_out==item){
|
if (mlogb[i].material_out == item) {
|
||||||
obj.count_ok = mlogb[i].count_ok;
|
obj.count_ok = mlogb[i].count_ok;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -449,22 +451,27 @@ 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;
|
||||||
});
|
});
|
||||||
}).catch(() => { });
|
}).catch(() => { });
|
||||||
},
|
},
|
||||||
handleSaveSuccess(){
|
handleSaveSuccess() {
|
||||||
this.getMlogs();
|
this.getMlogs();
|
||||||
},
|
},
|
||||||
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
|
||||||
|
})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue