feat: 6车间mlog撤回

This commit is contained in:
caoqianming 2023-12-18 13:25:42 +08:00
parent ae299a4194
commit 2f2220c5c1
2 changed files with 245 additions and 247 deletions

View File

@ -6,56 +6,56 @@
<el-aside style="width: 50%">
<el-container>
<el-header>
<div class="left-panel">
<el-date-picker v-model="query.date" type="date" value-format="YYYY-MM-DD" />
<el-button type="primary" icon="el-icon-search" @click="handleQueryMtask">查询</el-button>
</div>
</el-header>
<el-main>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" hidePagination
@row-click="rowClick" hideDo>
<el-table-column type="index" width="50" />
<el-table-column label="任务编号" prop="number">
</el-table-column>
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.material_out_">{{ scope.row.material_out_.name }}</span>
</template>
</el-table-column>
<el-table-column label="规格" prop="material">
<template #default="scope">
<span v-if="scope.row.material_out_">{{ scope.row.material_out_.specification }}</span>
</template>
</el-table-column>
<el-table-column label="型号" prop="material">
<template #default="scope">
<span v-if="scope.row.material_out_">{{ scope.row.material_out_.model }}</span>
</template>
</el-table-column>
<el-table-column label="计划数量" prop="count">
</el-table-column>
<el-table-column label="生产日期" prop="start_date">
</el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
<el-tag v-if="scope.row.state !== 40">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column>
</scTable>
</el-main>
<div class="left-panel">
<el-date-picker v-model="query.date" type="date" value-format="YYYY-MM-DD" />
<el-button type="primary" icon="el-icon-search" @click="handleQueryMtask">查询</el-button>
</div>
</el-header>
<el-main>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" hidePagination
@row-click="rowClick" hideDo>
<el-table-column type="index" width="50" />
<el-table-column label="任务编号" prop="number">
</el-table-column>
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.material_out_">{{ scope.row.material_out_.name }}</span>
</template>
</el-table-column>
<el-table-column label="规格" prop="material">
<template #default="scope">
<span v-if="scope.row.material_out_">{{ scope.row.material_out_.specification }}</span>
</template>
</el-table-column>
<el-table-column label="型号" prop="material">
<template #default="scope">
<span v-if="scope.row.material_out_">{{ scope.row.material_out_.model }}</span>
</template>
</el-table-column>
<el-table-column label="计划数量" prop="count">
</el-table-column>
<el-table-column label="生产日期" prop="start_date">
</el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
<el-tag v-if="scope.row.state !== 40">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-aside>
<el-main style="padding: 0;">
<el-container>
<el-header>
<div class="left-panel">
<span style="font-size: 14px">各工序进度</span>
</div>
<div class="left-panel">
<span style="font-size: 14px">各工序进度</span>
</div>
</el-header>
<el-main>
<scTable ref="tableprocess" row-key="id" stripe :hideDo="hideDo" :data="processList" @row-click="itemClick">
@ -73,11 +73,11 @@
<el-table-column label="操作人" prop="">
</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'"
v-if="scope.row.state != 40">提交
</el-link>
</template>
<template #default="scope">
<el-link type="primary" @click="table_submit(scope.row)" v-auth="'mtask.submit'"
v-if="scope.row.state != 40">提交
</el-link>
</template>
</el-table-column>
</scTable>
</el-main>
@ -92,44 +92,43 @@
<!-- 交接记录 -->
<el-container>
<el-header>
<div class="left-panel">
<span style="font-size: 14px">交接记录</span>
</div>
<div class="left-panel">
<span style="font-size: 14px">交接记录</span>
</div>
</el-header>
<el-main>
<scTable ref="table_handover" :apiObj="apiObjHandover" row-key="id" stripe
:params="paramsHandover">
<el-table-column type="index" width="50" />
<el-table-column label="送料日期" prop="send_date">
</el-table-column>
<el-table-column label="产物" prop="material" show-overflow-tooltip>
<template #default="scope"><span v-if="scope.row.material_">{{
scope.row.material_.name
}}</span>
</template>
</el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column>
<el-table-column label="数量" prop="count">
</el-table-column>
<el-table-column label="交送人" prop="send_user_name">
</el-table-column>
<el-table-column label="接收人" prop="recive_user_name">
</el-table-column>
<el-table-column label="是否确认" prop="submit_time">
<template #default="scope">
<span v-if="scope.row.submit_time"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="left">
<template #default="scope">
<el-button link type="primary" @click.stop="handover_submit(scope.row)"
v-auth="'handover.submit'" v-if="scope.row.submit_time == null">
确认
</el-button>
</template>
</el-table-column>
</scTable>
<scTable ref="table_handover" :apiObj="apiObjHandover" row-key="id" stripe :params="paramsHandover">
<el-table-column type="index" width="50" />
<el-table-column label="送料日期" prop="send_date">
</el-table-column>
<el-table-column label="产物" prop="material" show-overflow-tooltip>
<template #default="scope"><span v-if="scope.row.material_">{{
scope.row.material_.name
}}</span>
</template>
</el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column>
<el-table-column label="数量" prop="count">
</el-table-column>
<el-table-column label="交送人" prop="send_user_name">
</el-table-column>
<el-table-column label="接收人" prop="recive_user_name">
</el-table-column>
<el-table-column label="是否确认" prop="submit_time">
<template #default="scope">
<span v-if="scope.row.submit_time"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="left">
<template #default="scope">
<el-button link type="primary" @click.stop="handover_submit(scope.row)" v-auth="'handover.submit'"
v-if="scope.row.submit_time == null">
确认
</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-aside>
@ -146,26 +145,25 @@
</div>
</el-header>
<el-main style="padding: 0;">
<scTable ref="table_wm" :apiObj="apiObjWm" row-key="id" :params="paramsWm" stripe
hidePagination hideDo>
<el-table-column label="物料名" prop="material">
<template #default="scope">
{{scope.row.material_.name}}
</template>
</el-table-column>
<el-table-column label="规格" prop="material">
<template #default="scope">
{{scope.row.material_.specification}}
</template>
</el-table-column>
<el-table-column label="型号" prop="material">
<template #default="scope">
{{scope.row.material_.model}}
</template>
</el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column>
<el-table-column label="数量" prop="count" width="80">
</el-table-column>
<scTable ref="table_wm" :apiObj="apiObjWm" row-key="id" :params="paramsWm" stripe hidePagination>
<el-table-column label="物料名" prop="material">
<template #default="scope">
{{ scope.row.material_.name }}
</template>
</el-table-column>
<el-table-column label="规格" prop="material">
<template #default="scope">
{{ scope.row.material_.specification }}
</template>
</el-table-column>
<el-table-column label="型号" prop="material">
<template #default="scope">
{{ scope.row.material_.model }}
</template>
</el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column>
<el-table-column label="数量" prop="count" width="80">
</el-table-column>
</scTable>
</el-main>
</el-container>
@ -177,37 +175,37 @@
<script>
export default {
data() {
return {
dialog: {
save: false,
},
apiObj:null,
query: {
page: 1,
page_size: 20,
belong_dept_name: '6车间',
date: '2023-10-24'
},
processList: [],//
state_: {
10: '创建中',
20: '已下达',
30: '生产中',
40: '已提交',
},
hideDo: true,
apiObjWm: this.$API.wpm.wmaterial.list,
paramsMlog:{
mtask:''
},
apiObjHandover:this.$API.wpm.handover.list,
paramsHandover:{
recive_dept__name:'6车间'
},
paramsWm: {
belong_dept__name: '6车间'
},
}
return {
dialog: {
save: false,
},
apiObj: null,
query: {
page: 1,
page_size: 20,
belong_dept_name: '6车间',
date: '2023-10-24'
},
processList: [],//
state_: {
10: '创建中',
20: '已下达',
30: '生产中',
40: '已提交',
},
hideDo: true,
apiObjWm: this.$API.wpm.wmaterial.list,
paramsMlog: {
mtask: ''
},
apiObjHandover: this.$API.wpm.handover.list,
paramsHandover: {
recive_dept__name: '6车间'
},
paramsWm: {
belong_dept__name: '6车间'
},
}
},
mounted() {
let NowDate = new Date();
@ -216,7 +214,7 @@ export default {
},
methods: {
tomio() {
this.$router.push({ name: "halfgood_mio" });
this.$router.push({ name: "halfgood_mio" });
},
//
rowClick(row) {
@ -226,7 +224,7 @@ export default {
})
},
//
itemClick(row){
itemClick(row) {
// this.currentMtask = row;
// this.mgroup = row.mgroup;
// this.mtask = row.id;
@ -240,7 +238,7 @@ export default {
});
},
handleQueryMtask(){
handleQueryMtask() {
this.$refs.table.refresh();
},
handleQuery() {
@ -251,14 +249,14 @@ export default {
},
table_submit(row) {
this.$API.pm.mtask.submit.req(row.id).then(res => {
this.$message.success('操作成功')
this.rowClick(row);
this.$message.success('操作成功')
this.rowClick(row);
}).catch(err => { })
},
handover_submit(row){
handover_submit(row) {
this.$API.wpm.handover.submit.req(row.id).then(res => {
this.$message.success('操作成功')
this.$refs.table_handover.refresh();
this.$message.success('操作成功')
this.$refs.table_handover.refresh();
}).catch(err => { })
},
}

View File

@ -1,23 +1,23 @@
<template>
<el-container>
<!-- 任务信息 -->
<el-header style="height: 20%; padding: 0">
<el-header style="height: 20%; padding: 0">
<el-card style="width: 100%; height: 100%">
<template #header>
<div class="card-header">
<span>任务信息</span>
</div>
<div class="card-header">
<span>任务信息</span>
</div>
</template>
<el-descriptions>
<el-descriptions-item label="任务编号">{{ currentMtask.number }}</el-descriptions-item>
<el-descriptions-item label="产品名称">
<span v-if="currentMtask.material_out_">{{ currentMtask.material_out_.name}}</span>
</el-descriptions-item>
<el-descriptions-item label="规格型号">
<span v-if="currentMtask.material_out_">{{currentMtask.material_out_.specification}}</span>
</el-descriptions-item>
<el-descriptions-item label="计划数量">{{ currentMtask.count}}</el-descriptions-item>
<el-descriptions-item label="计划日期">{{ currentMtask.start_date}}</el-descriptions-item>
<el-descriptions-item label="任务编号">{{ currentMtask.number }}</el-descriptions-item>
<el-descriptions-item label="产品名称">
<span v-if="currentMtask.material_out_">{{ currentMtask.material_out_.name }}</span>
</el-descriptions-item>
<el-descriptions-item label="规格型号">
<span v-if="currentMtask.material_out_">{{ currentMtask.material_out_.specification }}</span>
</el-descriptions-item>
<el-descriptions-item label="计划数量">{{ currentMtask.count }}</el-descriptions-item>
<el-descriptions-item label="计划日期">{{ currentMtask.start_date }}</el-descriptions-item>
</el-descriptions>
</el-card>
</el-header>
@ -27,68 +27,59 @@
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="addMlog"
v-if="currentMtask && currentMtask.state == 20">新增</el-button>
v-if="currentMtask && currentMtask.state == 20">新增</el-button>
</div>
</el-header>
<el-main style="padding: 0;">
<scTable ref="mtaskMlogs" :apiObj="apiObj" row-key="id" :params="params" stripe
hidePagination hideDo>
<el-table-column label="工序" prop="mgroup_name"></el-table-column>
<el-table-column label="产品编号">
<template #default="scope">
<span v-if="scope.row.material_out_">{{scope.row.material_out_.number}}</span>
</template>
</el-table-column>
<el-table-column label="加工设备" prop="equipment_name"></el-table-column>
<el-table-column label="领用数量" prop="count_use"> </el-table-column>
<el-table-column label="加工数量" prop="count_real"> </el-table-column>
<el-table-column label="合格数量" prop="count_ok"></el-table-column>
<el-table-column label="不合格数量" align="center">
<el-table-column prop="count_n_wq" label="弯曲"/>
<el-table-column prop="count_n_zw" label="炸纹"/>
<el-table-column prop="count_n_tw" label="条纹"/>
<el-table-column prop="count_n_qp" label="气泡"/>
<el-table-column prop="count_n_dl" label="断裂"/>
<el-table-column prop="count_n_pb" label="偏壁"/>
<el-table-column prop="count_n_dxt" label="大小头"/>
<el-table-column prop="count_n_jsqx" label="结石气绒"/>
<el-table-column prop="count_n_qt" label="其他"/>
</el-table-column>
<el-table-column label="操作人" prop="count_ok"></el-table-column>
<el-table-column label="操作" fixed="right" width="130">
<template #default="scope">
<el-button link type="primary" @click="table_edit(scope.row)">
编辑
</el-button>
<el-link type="danger" @click="table_del(scope.row)" v-auth="'mlog.delete'"
<scTable ref="mtaskMlogs" :apiObj="apiObj" row-key="id" :params="params" stripe hidePagination hideDo>
<el-table-column label="工序" prop="mgroup_name"></el-table-column>
<el-table-column label="产品编号">
<template #default="scope">
<span v-if="scope.row.material_out_">{{ scope.row.material_out_.number }}</span>
</template>
</el-table-column>
<el-table-column label="加工设备" prop="equipment_name"></el-table-column>
<el-table-column label="领用数量" prop="count_use"> </el-table-column>
<el-table-column label="加工数量" prop="count_real"> </el-table-column>
<el-table-column label="合格数量" prop="count_ok"></el-table-column>
<el-table-column label="不合格数量" align="center">
<el-table-column prop="count_n_wq" label="弯曲" />
<el-table-column prop="count_n_zw" label="炸纹" />
<el-table-column prop="count_n_tw" label="条纹" />
<el-table-column prop="count_n_qp" label="气泡" />
<el-table-column prop="count_n_dl" label="断裂" />
<el-table-column prop="count_n_pb" label="偏壁" />
<el-table-column prop="count_n_dxt" label="大小头" />
<el-table-column prop="count_n_jsqx" label="结石气绒" />
<el-table-column prop="count_n_qt" label="其他" />
</el-table-column>
<el-table-column label="操作人" prop="update_by_name"></el-table-column>
<el-table-column label="操作" fixed="right" width="130">
<template #default="scope">
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'mlog.update'"
v-if="scope.row.submit_time == null">编辑
</el-button>
<el-button 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 link type="success" @click="table_show(scope.row)">
</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>
</template>
</el-table-column>
</scTable>
</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-main>
<save-dialog
v-if="dialogSave"
ref="saveDialog"
:mtask="mtask"
:mgroup="mgroup"
:handledate="handledate"
:material_out="material_out"
@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="mtask" :mgroup="mgroup" :handledate="handledate"
:material_out="material_out" @success="handleSaveSuccess" @closed="dialogSave = false"></save-dialog>
<showDrawer ref="showDrawer" v-if="visibleDrawer" :mlogId="mlogId" @closed="visibleDrawer = false">
</showDrawer>
</el-container>
</template>
@ -97,30 +88,31 @@ import saveDialog from "./mlog6_form.vue";
import showDrawer from "./mlog_drawer.vue";
export default {
components: {
saveDialog,showDrawer
saveDialog, showDrawer
},
data() {
return {
dialog: {
save: false,
},
state_: {
10: '创建中',
20: '已下达',
30: '生产中',
40: '已提交',
},
hideDo: true,
currentMtask:{},
apiObj:null,
params:{
mtask:''
},
mlogId:'',
handledate:'',
dialogSave:false,
visibleDrawer:false,
}
return {
mlogHandleLoading: false,
dialog: {
save: false,
},
state_: {
10: '创建中',
20: '已下达',
30: '生产中',
40: '已提交',
},
hideDo: true,
currentMtask: {},
apiObj: null,
params: {
mtask: ''
},
mlogId: '',
handledate: '',
dialogSave: false,
visibleDrawer: false,
}
},
mounted() {
this.mtaskId = this.$route.query.mtaskId;
@ -129,7 +121,7 @@ export default {
this.getMtask(this.mtaskId);
},
methods: {
getMtask(id){
getMtask(id) {
let that = this;
this.$API.pm.mtask.item.req(id).then(res => {
that.currentMtask = res;
@ -137,7 +129,7 @@ export default {
this.mtask = res.id;
this.material_out = res.material_out_.id;
this.handledate = res.start_date;
this.params.mtask = this.mtaskId;
this.apiObj = this.$API.wpm.mlog.list;
})
@ -146,11 +138,11 @@ export default {
this.visibleDrawer = true;
this.mlogId = row.id;
this.$nextTick(() => {
this.$refs.showDrawer.open();
this.$refs.showDrawer.open();
});
},
handleQueryMtask(){
handleQueryMtask() {
this.$refs.table.refresh();
},
//
@ -160,7 +152,7 @@ export default {
that.material_out = that.currentMtask.material_out;
that.dialogSave = true;
that.$nextTick(() => {
that.$refs.saveDialog.open("add");
that.$refs.saveDialog.open("add");
});
},
//
@ -177,6 +169,7 @@ export default {
}).then(() => {
this.$API.wpm.mlog.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
this.$refs.mtaskMlogs.refresh();
return res;
}).catch((err) => {
return err;
@ -188,17 +181,24 @@ export default {
handleSaveSuccess(data, mode) {
this.$refs.mtaskMlogs.refresh();
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},
mlog_submit(row){
mlog_submit(row) {
this.$API.wpm.mlog.submit.req(row.id).then(res => {
this.$message.success('操作成功')
this.$refs.mtaskMlogs.refresh()
}).catch(err => {})
this.$message.success('操作成功')
this.$refs.mtaskMlogs.refresh()
}).catch(err => { })
},
mlog_revert(row) {
this.mlogHandleLoading = true;
this.$API.wpm.mlog.revert.req(row.id).then(res => {
this.$message.success("撤回成功");
this.$refs.mtaskMlogs.refresh()
this.mlogHandleLoading = false;
}).catch(e => {
this.mlogHandleLoading = false;
})
},
}
}