fix:6、7、10车间可以显示已终止的任务

This commit is contained in:
shijing 2024-03-28 17:02:10 +08:00
parent d4809de933
commit 4c935cb4a2
3 changed files with 2040 additions and 1220 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,293 +1,446 @@
<template> <template>
<el-container> <el-container>
<!-- 当天任务列表 --> <!-- 当天任务列表 -->
<el-header style="height:55%; padding: 0"> <el-header style="height: 55%; padding: 0">
<el-container> <el-container>
<el-aside style="width: 50%"> <el-aside style="width: 50%">
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-date-picker v-model="queryMtask.start_date" type="date" value-format="YYYY-MM-DD" <el-date-picker
@change="handleQueryMtask" /> v-model="queryMtask.start_date"
</div> type="date"
</el-header> value-format="YYYY-MM-DD"
<el-main> @change="handleQueryMtask"
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="paramsMtask" :query="queryMtask" />
@row-click="rowClick"> <el-checkbox
<el-table-column type="index" width="50" /> style="margin-left: 10px"
<el-table-column label="任务编号" prop="number" width="150"> v-model="queryMtaskState"
</el-table-column> label="已终止"
<el-table-column label="产物" prop="material_out_name" show-overflow-tooltip width="250"> @change="handleQueryMtask"
</el-table-column> />
<el-table-column label="计划数量" prop="count"> </div>
</el-table-column> </el-header>
<el-table-column label="生产日期" prop="start_date"> <el-main>
</el-table-column> <scTable
<el-table-column label="状态" prop="state"> ref="table"
<template #default="scope"> :apiObj="apiObj"
<el-tag v-if="scope.row.state !== 40"> row-key="id"
{{ state_[scope.row.state] }} stripe
</el-tag> :params="paramsMtask"
<el-tag v-else type="success"> :query="queryMtask"
{{ state_[scope.row.state] }} @row-click="rowClick"
</el-tag> >
</template> <el-table-column type="index" width="50" />
</el-table-column> <el-table-column
</scTable> label="任务编号"
</el-main> prop="number"
</el-container> width="150"
</el-aside> >
<el-main style="padding: 0;"> </el-table-column>
<el-container> <el-table-column
<el-header> label="产物"
<div class="left-panel"> prop="material_out_name"
<span style="font-size: 14px">各工序进度</span> show-overflow-tooltip
</div> width="250"
</el-header> >
<el-main> </el-table-column>
<scTable ref="tableprocess" row-key="id" stripe :hideDo="hideDo" :data="processList" <el-table-column label="计划数量" prop="count">
@row-click="itemClick"> </el-table-column>
<el-table-column label="任务编号" prop="number" width="150"> <el-table-column
</el-table-column> label="生产日期"
<el-table-column label="日期" prop="start_date" width="120"> prop="start_date"
</el-table-column> >
<el-table-column label="工序" prop="mgroup_name"> </el-table-column>
</el-table-column> <el-table-column label="状态" prop="state">
<el-table-column label="计划数量" prop="count"> <template #default="scope">
</el-table-column> <el-tag v-if="scope.row.state == 20">
<el-table-column label="合格数量" prop="count_ok"> {{ state_[scope.row.state] }}
</el-table-column> </el-tag>
<el-table-column label="提交人" prop="submit_user_name"> <el-tag v-if="scope.row.state == 30">
</el-table-column> {{ state_[scope.row.state] }}
<el-table-column label="操作" fixed="right" width="60"> </el-tag>
<el-tag
<template #default="scope"> v-if="scope.row.state == 34"
<el-link type="primary" @click.stop="table_submit(scope.row)" v-auth="'mtask.submit'" type="danger"
v-if="scope.row.state != 40">提交 >
</el-link> {{ state_[scope.row.state] }}
</template> </el-tag>
</el-table-column> <el-tag
</scTable> v-if="scope.row.state == 40"
</el-main> type="success"
</el-container> >
</el-main> {{ state_[scope.row.state] }}
</el-container> </el-tag>
</el-header> </template>
<!-- 交接记录&车间库存 --> </el-table-column>
<el-main class="nopadding"> </scTable>
<el-container> </el-main>
<el-aside style="width: 50%"> </el-container>
<!-- 交接记录 --> </el-aside>
<el-container> <el-main style="padding: 0">
<el-header> <el-container>
<div class="left-panel"> <el-header>
<span style="font-size: 14px">交接记录</span> <div class="left-panel">
</div> <span style="font-size: 14px">各工序进度</span>
</el-header> </div>
<el-main> </el-header>
<scTable ref="table_handover" :apiObj="apiObjHandover" row-key="id" stripe :params="paramsHandover"> <el-main>
<el-table-column label="送料日期" prop="send_date"> <scTable
</el-table-column> ref="tableprocess"
<el-table-column label="产物" prop="material_name" show-overflow-tooltip> row-key="id"
</el-table-column> stripe
<el-table-column label="批次" prop="batch"> </el-table-column> :hideDo="hideDo"
<el-table-column label="数量" prop="count"> :data="processList"
</el-table-column> @row-click="itemClick"
<el-table-column label="交送人" prop="send_user_name"> >
</el-table-column> <el-table-column
<el-table-column label="接收人" prop="recive_user_name"> label="任务编号"
</el-table-column> prop="number"
<el-table-column label="是否确认" prop="submit_time"> width="150"
>
<template #default="scope"> </el-table-column>
<span v-if="scope.row.submit_time"></span> <el-table-column
<span v-else></span> label="日期"
</template> prop="start_date"
</el-table-column> width="120"
<el-table-column label="操作" fixed="right" align="left"> >
</el-table-column>
<template #default="scope"> <el-table-column
<el-button link type="primary" @click.stop="handover_submit(scope.row)" v-auth="'handover.submit'" label="工序"
v-if="scope.row.submit_time == null"> prop="mgroup_name"
确认 >
</el-button> </el-table-column>
</template> <el-table-column label="计划数量" prop="count">
</el-table-column> </el-table-column>
</scTable> <el-table-column
</el-main> label="合格数量"
</el-container> prop="count_ok"
</el-aside> >
<el-main style="padding: 0 0 0 8px;"> </el-table-column>
<!-- 车间库存 --> <el-table-column
<el-container> label="提交人"
<el-header> prop="submit_user_name"
<div class="left-panel"> >
<span style="font-size: 14px">车间库存</span> </el-table-column>
</div> <el-table-column
<div class="right-panel"> label="操作"
<el-button type="primary" @click="tomio" v-auth="'mio.do'">领料</el-button> fixed="right"
<el-button type="primary" @click="tomio" v-auth="'mio.do'">入库</el-button> width="60"
</div> >
</el-header> <template #default="scope">
<el-main style="padding: 0;"> <el-link
<scTable ref="table_wm" :apiObj="apiObjWm" row-key="id" :params="paramsWm" stripe hidePagination> type="primary"
<el-table-column label="物料名" prop="material"> @click.stop="
table_submit(scope.row)
<template #default="scope"> "
{{ scope.row.material_.name }} v-auth="'mtask.submit'"
</template> v-if="
</el-table-column> scope.row.state != 40 &&
<el-table-column label="规格" prop="material"> scope.row.state != 34
"
<template #default="scope"> >提交
{{ scope.row.material_.specification }} </el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="型号" prop="material"> </scTable>
</el-main>
<template #default="scope"> </el-container>
{{ scope.row.material_.model }} </el-main>
</template> </el-container>
</el-table-column> </el-header>
<el-table-column label="已到工序" prop="material"> <!-- 交接记录&车间库存 -->
<el-main class="nopadding">
<template #default="scope">{{ <el-container>
scope.row.material_.process_name <el-aside style="width: 50%">
}}</template> <!-- 交接记录 -->
</el-table-column> <el-container>
<el-table-column label="批次" prop="batch"> </el-table-column> <el-header>
<el-table-column label="数量" prop="count" width="80"> <div class="left-panel">
</el-table-column> <span style="font-size: 14px">交接记录</span>
</scTable> </div>
</el-main> </el-header>
</el-container> <el-main>
</el-main> <scTable
</el-container> ref="table_handover"
</el-main> :apiObj="apiObjHandover"
</el-container> row-key="id"
stripe
:params="paramsHandover"
>
<el-table-column
label="送料日期"
prop="send_date"
>
</el-table-column>
<el-table-column
label="产物"
prop="material_name"
show-overflow-tooltip
>
</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>
<el-main style="padding: 0 0 0 8px">
<!-- 车间库存 -->
<el-container>
<el-header>
<div class="left-panel">
<span style="font-size: 14px">车间库存</span>
</div>
<div class="right-panel">
<el-button
type="primary"
@click="tomio"
v-auth="'mio.do'"
>领料</el-button
>
<el-button
type="primary"
@click="tomio"
v-auth="'mio.do'"
>入库</el-button
>
</div>
</el-header>
<el-main style="padding: 0">
<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="material"
>
<template #default="scope">{{
scope.row.material_.process_name
}}</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>
</el-main>
</el-container>
</el-main>
</el-container>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
dialog: { dialog: {
save: false, save: false,
}, },
apiObj: null, apiObj: null,
query: {}, query: {},
processList: [],// processList: [], //
state_: { state_: {
10: '创建中', 10: "创建中",
20: '已下达', 20: "已下达",
30: '生产中', 30: "生产中",
40: '已提交', 34: "已终止",
}, 40: "已提交",
hideDo: true, },
apiObjWm: this.$API.wpm.wmaterial.list, hideDo: true,
paramsMlog: { queryMtaskState: false,
mtask: '' apiObjWm: this.$API.wpm.wmaterial.list,
}, paramsMlog: {
apiObjHandover: this.$API.wpm.handover.list, mtask: "",
paramsHandover: { },
recive_dept__name: '6车间' apiObjHandover: this.$API.wpm.handover.list,
}, paramsHandover: {
paramsWm: { recive_dept__name: "6车间",
belong_dept__name: '6车间', },
count__gte: 1 paramsWm: {
}, belong_dept__name: "6车间",
paramsMtask: { count__gte: 1,
mgroup__belong_dept__name: '6车间', },
is_count_utask: true, paramsMtask: {
state__in: "20,40" mgroup__belong_dept__name: "6车间",
}, is_count_utask: true,
queryMtask: {} state__in: "20,30,40",
} },
}, queryMtask: {
mounted() { state__in: "",
let NowDate = new Date(); },
// this.queryMtask.start_date = NowDate.getFullYear() + '-' + (NowDate.getMonth() + 1) + '-' + NowDate.getDate(); };
this.apiObj = this.$API.pm.mtask.list; },
}, mounted() {
methods: { let NowDate = new Date();
tomio() { // this.queryMtask.start_date = NowDate.getFullYear() + '-' + (NowDate.getMonth() + 1) + '-' + NowDate.getDate();
this.$router.push({ name: "halfgood_mio" }); this.apiObj = this.$API.pm.mtask.list;
}, },
// methods: {
rowClick(row) { tomio() {
let that = this; this.$router.push({ name: "halfgood_mio" });
this.$API.pm.mtask.list.req({ start_date: row.start_date, end_date: row.end_date, mgroup__belong_dept__name: '6车间', utask: row.utask }).then(res => { },
that.processList = res.results; //
}) rowClick(row) {
}, let that = this;
// this.$API.pm.mtask.list
itemClick(row) { .req({
// this.currentMtask = row; start_date: row.start_date,
// this.mgroup = row.mgroup; end_date: row.end_date,
// this.mtask = row.id; mgroup__belong_dept__name: "6车间",
// this.material_out = row.material_out_.id; utask: row.utask,
// this.handledate = row.start_date; })
// this.paramsMlog.mtask = this.mtask; .then((res) => {
// this.apiObjMlog = this.$API.wpm.mlog.list; that.processList = res.results;
this.$router.push({ });
name: "mlogDept6Detail", },
query: { mtaskId: row.id } //
itemClick(row) {
}); // this.currentMtask = row;
}, // this.mgroup = row.mgroup;
handleQueryMtask() { // this.mtask = row.id;
this.$refs.table.queryData(this.queryMtask); // this.material_out = row.material_out_.id;
}, // this.handledate = row.start_date;
table_submit(row) { // this.paramsMlog.mtask = this.mtask;
let lengths = row.mlogs.length, infoText = ''; // this.apiObjMlog = this.$API.wpm.mlog.list;
if (lengths > 0) { this.$router.push({
infoText = '该任务有' + lengths + '条日志,确定提交吗?'; name: "mlogDept6Detail",
} else { query: { mtaskId: row.id },
infoText = '该任务没有日志,确定提交吗?'; });
} },
this.$confirm(infoText, "提示", { handleQueryMtask() {
type: "warning", if (this.queryMtaskState) {
}).then(() => { this.queryMtask.state__in = "20,30,34,40";
this.$API.pm.mtask.submit.req(row.id).then(res => { } else {
this.$message.success('操作成功') this.queryMtask.state__in = "20,30,40";
this.$refs.table_mtask.refresh() }
this.mtaskClick(this.currentMtask) this.$refs.table.queryData(this.queryMtask);
}).catch(err => { }) },
}) table_submit(row) {
}, let lengths = row.mlogs.length,
handover_submit(row) { infoText = "";
this.$API.wpm.handover.submit.req(row.id).then(res => { if (lengths > 0) {
this.$message.success('操作成功') infoText = "该任务有" + lengths + "条日志,确定提交吗?";
this.$refs.table_handover.refresh(); } else {
this.$refs.table_wm.refresh(); infoText = "该任务没有日志,确定提交吗?";
}).catch(err => { }) }
}, this.$confirm(infoText, "提示", {
} type: "warning",
} }).then(() => {
this.$API.pm.mtask.submit
.req(row.id)
.then((res) => {
this.$message.success("操作成功");
this.$refs.table_mtask.refresh();
this.mtaskClick(this.currentMtask);
})
.catch((err) => {});
});
},
handover_submit(row) {
this.$API.wpm.handover.submit
.req(row.id)
.then((res) => {
this.$message.success("操作成功");
this.$refs.table_handover.refresh();
this.$refs.table_wm.refresh();
})
.catch((err) => {});
},
},
};
</script> </script>
<style scoped> <style scoped>
.tabsHeader { .tabsHeader {
display: inline-block; display: inline-block;
position: absolute; position: absolute;
right: 20px; right: 20px;
margin-top: 4px; margin-top: 4px;
z-index: 100 z-index: 100;
} }
.right-panel>*+* { .right-panel > * + * {
margin-left: 10px; margin-left: 10px;
} }
.el-main.nopadding { .el-main.nopadding {
padding: 0 20px 0 20px padding: 0 20px 0 20px;
} }
.tableTitle { .tableTitle {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
font-size: 14px; font-size: 14px;
box-sizing: border-box; box-sizing: border-box;
border-bottom: 1px solid #eeeeee; border-bottom: 1px solid #eeeeee;
} }
</style> </style>

File diff suppressed because it is too large Load Diff