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

View File

@ -6,50 +6,111 @@
<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
placeholder="工作日期" @change="handleQueryMtask" /> v-model="queryMtask.start_date"
type="date"
value-format="YYYY-MM-DD"
placeholder="工作日期"
@change="handleQueryMtask"
/>
<el-checkbox
style="margin-left: 10px"
v-model="queryMtaskState"
label="已终止"
@change="handleQueryMtask"
/>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable ref="table_mtask" :apiObj="apiMtask" row-key="id" stripe :params="paramsMtask" <scTable
:query="queryMtask" @row-click="mtaskClick"> ref="table_mtask"
<el-table-column label="产品名称" prop="material" show-overflow-tooltip> :apiObj="apiMtask"
row-key="id"
stripe
:params="paramsMtask"
:query="queryMtask"
@row-click="mtaskClick"
>
<el-table-column
label="产品名称"
prop="material"
show-overflow-tooltip
>
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.material_out_">{{ <span v-if="scope.row.material_out_">{{
scope.row.material_out_.name scope.row.material_out_.name
}}</span> }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="型号规格" prop="" width="160"> <el-table-column
label="型号规格"
prop=""
width="160"
>
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.material_out_">{{ <span v-if="scope.row.material_out_"
scope.row.material_out_.specification >{{
}}|{{ scope.row.material_out_.model }}</span> scope.row.material_out_
.specification
}}|{{
scope.row.material_out_.model
}}</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="任务编号" prop="number" width="140" show-overflow-tooltip> <el-table-column
label="任务编号"
prop="number"
width="140"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<el-table-column label="任务量" prop="count"> </el-table-column> <el-table-column label="任务量" prop="count">
<el-table-column label="工作日期" prop="start_date"> </el-table-column>
<el-table-column
label="工作日期"
prop="start_date"
>
</el-table-column>
<el-table-column label="合格数" prop="count_ok">
</el-table-column> </el-table-column>
<el-table-column label="合格数" prop="count_ok"> </el-table-column>
<el-table-column label="状态" prop="state"> <el-table-column label="状态" prop="state">
<template #default="scope"> <template #default="scope">
<el-tag v-if="scope.row.state !== 40"> <el-tag v-if="scope.row.state == 20">
{{ state_[scope.row.state] }} {{ state_[scope.row.state] }}
</el-tag> </el-tag>
<el-tag v-else type="success"> <el-tag v-if="scope.row.state == 30">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag
v-if="scope.row.state == 34"
type="danger"
>
{{ state_[scope.row.state] }}
</el-tag>
<el-tag
v-if="scope.row.state == 40"
type="success"
>
{{ state_[scope.row.state] }} {{ state_[scope.row.state] }}
</el-tag> </el-tag>
</template> </template>
</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
v-if="scope.row.state != 40">提交 type="primary"
@click="table_submit(scope.row)"
v-auth="'mtask.submit'"
v-if="
scope.row.state != 40 &&
scope.row.state != 34
"
>提交
</el-link> </el-link>
</template> </template>
</el-table-column> </el-table-column>
@ -59,9 +120,14 @@
</el-aside> </el-aside>
<el-main class="nopadding"> <el-main class="nopadding">
<el-container> <el-container>
<el-header style="height: 30%; padding: 0;"> <el-header style="height: 30%; padding: 0">
<el-card style="width: 100%; height: 100%; overflow-y: auto;"> <el-card
style="
width: 100%;
height: 100%;
overflow-y: auto;
"
>
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span>任务信息</span> <span>任务信息</span>
@ -72,18 +138,34 @@
</div> </div>
</template> </template>
<el-descriptions> <el-descriptions>
<el-descriptions-item label="任务编号">{{ currentMtask.number }}</el-descriptions-item> <el-descriptions-item label="任务编号">{{
<el-descriptions-item label="状态">{{ state_[currentMtask.state] currentMtask.number
}}</el-descriptions-item>
<el-descriptions-item label="状态">{{
state_[currentMtask.state]
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="产品名称"> <el-descriptions-item label="产品名称">
<span v-if="currentMtask.material_out_">{{ currentMtask.material_out_.name <span
}}</span></el-descriptions-item> v-if="currentMtask.material_out_"
<el-descriptions-item label="规格型号"><span v-if="currentMtask.material_out_">{{ >{{
currentMtask.material_out_.specification currentMtask.material_out_.name
}}</span></el-descriptions-item> }}</span
<el-descriptions-item label="合格数">{{ currentMtask.count_ok ></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_ok
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="不合格数">{{ currentMtask.count_notok <el-descriptions-item label="不合格数">{{
currentMtask.count_notok
}}</el-descriptions-item> }}</el-descriptions-item>
<!-- <el-descriptions-item label="配粉料数">{{ currentMtask.peifen_kg <!-- <el-descriptions-item label="配粉料数">{{ currentMtask.peifen_kg
}}</el-descriptions-item> --> }}</el-descriptions-item> -->
@ -94,82 +176,236 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="addMlog" <el-button
v-if="currentMtask && currentMtask.state == 20" type="primary"
v-auth="'mlog.create'">新增</el-button> icon="el-icon-plus"
@click="addMlog"
v-if="
currentMtask &&
currentMtask.state == 20
"
v-auth="'mlog.create'"
>新增</el-button
>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable ref="table_mlog" :data="mlogs" row-key="id" stripe hidePagination hideDo> <scTable
<el-table-column label="班次" prop="shift_name"> </el-table-column> ref="table_mlog"
<el-table-column label="批次号" prop="batch"></el-table-column> :data="mlogs"
<el-table-column label="出管总数" prop="count_real"> row-key="id"
stripe
hidePagination
hideDo
>
<el-table-column
label="班次"
prop="shift_name"
>
</el-table-column> </el-table-column>
<el-table-column label="规格" prop="mlogb" width="300"> <el-table-column
label="批次号"
prop="batch"
></el-table-column>
<el-table-column
label="出管总数"
prop="count_real"
>
</el-table-column>
<el-table-column
label="规格"
prop="mlogb"
width="300"
>
<template #default="scope"> <template #default="scope">
<div v-if="scope.row.mlogb.length > 0"> <div
<div v-for="item in scope.row.mlogb" :key="item" class="cateItem" v-if="
style=""> scope.row.mlogb.length >
<span>{{ item.material_out_name }}|</span> 0
<span style="color:darkblue; font-weight: bold;">{{ "
>
<div
v-for="item in scope.row
.mlogb"
:key="item"
class="cateItem"
style=""
>
<span
>{{
item.material_out_name
}}|</span
>
<span
style="
color: darkblue;
font-weight: bold;
"
>{{
item.count_ok item.count_ok
}}</span> }}</span
>
</div> </div>
</div> </div>
<div v-else>{{ scope.row.material_out_name }}</div> <div v-else>
{{
scope.row
.material_out_name
}}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="合格总数" prop="count_ok"> <el-table-column
label="合格总数"
prop="count_ok"
>
</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
<el-table-column label="椭圆/弯曲" prop="count_n_wq"> label="不合格原因及数量"
align="center"
>
<el-table-column
label="椭圆/弯曲"
prop="count_n_wq"
>
</el-table-column> </el-table-column>
<el-table-column label="条纹" prop="count_n_tw"> <el-table-column
label="条纹"
prop="count_n_tw"
>
</el-table-column> </el-table-column>
<el-table-column label="断裂" prop="count_n_dl"> <el-table-column
label="断裂"
prop="count_n_dl"
>
</el-table-column> </el-table-column>
<el-table-column label="偏壁" prop="count_n_pb"> <el-table-column
label="偏壁"
prop="count_n_pb"
>
</el-table-column> </el-table-column>
<el-table-column label="大小头" prop="count_n_dxt"> <el-table-column
label="大小头"
prop="count_n_dxt"
>
</el-table-column> </el-table-column>
<el-table-column label="结石" prop="count_n_js"> <el-table-column
label="结石"
prop="count_n_js"
>
</el-table-column> </el-table-column>
<el-table-column label="气线" prop="count_n_qx"> <el-table-column
label="气线"
prop="count_n_qx"
>
</el-table-column> </el-table-column>
<el-table-column label="合计" prop="count_notok"> <el-table-column
label="合计"
prop="count_notok"
>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="成型人" prop="handle_user_name"> <el-table-column
label="成型人"
prop="handle_user_name"
>
</el-table-column> </el-table-column>
<el-table-column label="带班长" prop="handle_leader_name"> <el-table-column
label="带班长"
prop="handle_leader_name"
>
</el-table-column> </el-table-column>
<el-table-column label="碎料" prop="count_break"> </el-table-column> <el-table-column
<el-table-column label="操作" fixed="right" width="120" align="center"> label="碎料"
prop="count_break"
>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
width="120"
align="center"
>
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="table_edit(scope.row)" <el-button
v-auth="'mlog.update'" v-if="scope.row.submit_time == null">编辑 link
type="primary"
@click="
table_edit(scope.row)
"
v-auth="'mlog.update'"
v-if="
scope.row.submit_time ==
null
"
>编辑
</el-button> </el-button>
<el-button link type="danger" @click="table_del(scope.row)" <el-button
v-auth="'mlog.delete'" v-if="scope.row.submit_time == null">删除 link
type="danger"
@click="
table_del(scope.row)
"
v-auth="'mlog.delete'"
v-if="
scope.row.submit_time ==
null
"
>删除
</el-button> </el-button>
<el-button link type="primary" @click="mlog_submit(scope.row)" <el-button
v-auth="'mlog.submit'" v-if="scope.row.submit_time == null" link
:loading="mlogHandleLoading">提交 type="primary"
@click="
mlog_submit(scope.row)
"
v-auth="'mlog.submit'"
v-if="
scope.row.submit_time ==
null
"
:loading="mlogHandleLoading"
>提交
</el-button> </el-button>
<el-button link type="danger" @click="mlog_revert(scope.row)" <el-button
v-auth="'mlog.submit'" v-if="scope.row.submit_time != null" link
:loading="mlogHandleLoading">撤回 type="danger"
@click="
mlog_revert(scope.row)
"
v-auth="'mlog.submit'"
v-if="
scope.row.submit_time !=
null
"
:loading="mlogHandleLoading"
>撤回
</el-button> </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>
</template> </template>
@ -192,37 +428,70 @@
</div> </div>
</el-header> </el-header>
<el-main> <el-main>
<scTable ref="table_handover" :apiObj="apiObjHandover" row-key="id" stripe <scTable
:params="paramsHandover"> ref="table_handover"
:apiObj="apiObjHandover"
row-key="id"
stripe
:params="paramsHandover"
>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="送料日期" prop="send_date"> <el-table-column
label="送料日期"
prop="send_date"
>
</el-table-column> </el-table-column>
<el-table-column label="产物" prop="material" show-overflow-tooltip> <el-table-column
label="产物"
<template #default="scope"><span v-if="scope.row.material_">{{ prop="material"
show-overflow-tooltip
>
<template #default="scope"
><span v-if="scope.row.material_">{{
scope.row.material_.name scope.row.material_.name
}}</span> }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column> <el-table-column label="批次" prop="batch">
</el-table-column>
<el-table-column label="数量" prop="count"> <el-table-column label="数量" prop="count">
</el-table-column> </el-table-column>
<el-table-column label="交送人" prop="send_user_name"> <el-table-column
label="交送人"
prop="send_user_name"
>
</el-table-column> </el-table-column>
<el-table-column label="接收人" prop="recive_user_name"> <el-table-column
label="接收人"
prop="recive_user_name"
>
</el-table-column> </el-table-column>
<el-table-column label="是否确认" prop="submit_time"> <el-table-column
label="是否确认"
prop="submit_time"
>
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.submit_time"></span> <span v-if="scope.row.submit_time"
></span
>
<span v-else></span> <span v-else></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="left"> <el-table-column
label="操作"
fixed="right"
align="left"
>
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click.stop="handover_submit(scope.row)" <el-button
v-auth="'handover.submit'" v-if="scope.row.submit_time == null"> link
type="primary"
@click.stop="
handover_submit(scope.row)
"
v-auth="'handover.submit'"
v-if="scope.row.submit_time == null"
>
确认 确认
</el-button> </el-button>
</template> </template>
@ -238,39 +507,59 @@
<span style="font-size: 14px">车间库存</span> <span style="font-size: 14px">车间库存</span>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-button type="primary" @click="tomio" v-auth="'mio.do'">领料</el-button> <el-button
<el-button type="primary" @click="tomioin" v-auth="'mio.do'">入库</el-button> type="primary"
@click="tomio"
v-auth="'mio.do'"
>领料</el-button
>
<el-button
type="primary"
@click="tomioin"
v-auth="'mio.do'"
>入库</el-button
>
</div> </div>
</el-header> </el-header>
<el-main> <el-main>
<scTable ref="table_wm" :apiObj="apiObjWm" row-key="id" :params="paramsWm" stripe <scTable
hidePagination> ref="table_wm"
:apiObj="apiObjWm"
row-key="id"
:params="paramsWm"
stripe
hidePagination
>
<el-table-column label="物料名" prop="material"> <el-table-column label="物料名" prop="material">
<template #default="scope">{{ <template #default="scope">{{
scope.row.material_.name scope.row.material_.name
}}</template> }}</template>
</el-table-column> </el-table-column>
<el-table-column label="规格" prop="material"> <el-table-column label="规格" prop="material">
<template #default="scope">{{ <template #default="scope">{{
scope.row.material_.specification scope.row.material_.specification
}}</template> }}</template>
</el-table-column> </el-table-column>
<el-table-column label="型号" prop="material"> <el-table-column label="型号" prop="material">
<template #default="scope">{{ <template #default="scope">{{
scope.row.material_.model scope.row.material_.model
}}</template> }}</template>
</el-table-column> </el-table-column>
<el-table-column label="已到工序" prop="material"> <el-table-column
label="已到工序"
prop="material"
>
<template #default="scope">{{ <template #default="scope">{{
scope.row.material_.process_name scope.row.material_.process_name
}}</template> }}</template>
</el-table-column> </el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column> <el-table-column label="批次" prop="batch">
<el-table-column label="数量" prop="count" width="80"> </el-table-column>
<el-table-column
label="数量"
prop="count"
width="80"
>
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-main> </el-main>
@ -278,22 +567,46 @@
</el-main> </el-main>
</el-container> </el-container>
</el-main> </el-main>
<save-dialog v-if="dialogSave" ref="saveDialog" :mtask="currentMtask.id" :mgroup="mgroup" :mtaskDate="mtaskDate" <save-dialog
:material_out="material_out" :material_model="material_model" :brothersList="brothersList" v-if="dialogSave"
:material_in="material_in" :activeType="activeName" @success="handleSaveSuccess" ref="saveDialog"
@closed="dialogSave = false"></save-dialog> :mtask="currentMtask.id"
<showDrawer ref="showDrawer" v-if="visibleDrawer" :mlogId="mlogId" @closed="visibleDrawer = false"> :mgroup="mgroup"
:mtaskDate="mtaskDate"
:material_out="material_out"
:material_model="material_model"
:brothersList="brothersList"
:material_in="material_in"
: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 v-model="addMtaskInfoForm.peifen_kg" controls-position="right" :min="0" :step="1" <el-input-number
:step-strictly="true" style="width: 100%" placeholder="请输入"> v-model="addMtaskInfoForm.peifen_kg"
controls-position="right"
:min="0"
:step="1"
:step-strictly="true"
style="width: 100%"
placeholder="请输入"
>
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-footer> <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-button @click="addMtaskInfoVisible = false">取消</el-button>
</el-footer> </el-footer>
</el-dialog> </el-dialog>
@ -305,14 +618,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, mlogHandleLoading: false,
addMtaskInfoForm: {}, addMtaskInfoForm: {},
addMtaskInfoVisible: false, addMtaskInfoVisible: false,
activeName: '10车间', activeName: "10车间",
mlogs: [], mlogs: [],
currentDept: {}, currentDept: {},
currentMtask: {}, currentMtask: {},
@ -323,6 +637,7 @@ export default {
10: "创建中", 10: "创建中",
20: "已下达", 20: "已下达",
30: "生产中", 30: "生产中",
34: "已终止",
40: "已提交", 40: "已提交",
}, },
brothersList: [], brothersList: [],
@ -333,38 +648,45 @@ export default {
dialogSave: false, dialogSave: false,
paramsHandover: {}, paramsHandover: {},
paramsWm: {}, paramsWm: {},
mgroup: '', mgroup: "",
mlogId: '', mlogId: "",
mtaskDate: '', mtaskDate: "",
material_out: '', material_out: "",
material_model: '', material_model: "",
} queryMtaskState: false,
};
}, },
mounted() { mounted() {
this.initDept() this.initDept();
}, },
methods: { methods: {
mlog_revert(row) { mlog_revert(row) {
this.mlogHandleLoading = true; this.mlogHandleLoading = true;
this.$API.wpm.mlog.revert.req(row.id).then(res => { this.$API.wpm.mlog.revert
.req(row.id)
.then((res) => {
this.$message.success("撤回成功"); this.$message.success("撤回成功");
this.mtaskClick(this.currentMtask) this.mtaskClick(this.currentMtask);
this.$refs.table_wm.refresh() this.$refs.table_wm.refresh();
this.mlogHandleLoading = false;
}).catch(e => {
this.mlogHandleLoading = false; 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
this.currentMtask.peifen_kg = this.addMtaskInfoForm.peifen_kg .req(this.currentMtask.id, this.addMtaskInfoForm)
this.addMtaskInfoVisible = false .then((res) => {
this.$message.success('操作成功') this.currentMtask.peifen_kg =
}) this.addMtaskInfoForm.peifen_kg;
this.addMtaskInfoVisible = false;
this.$message.success("操作成功");
});
}, },
tomio() { tomio() {
this.$router.push({ name: "mainso_mio" }); this.$router.push({ name: "mainso_mio" });
@ -373,51 +695,62 @@ export default {
this.$router.push({ name: "halfgood_mio" }); this.$router.push({ name: "halfgood_mio" });
}, },
initDept() { initDept() {
this.$API.system.dept.list.req({ page: 0, name: '10车间' }).then(res => { this.$API.system.dept.list
.req({ page: 0, name: "10车间" })
.then((res) => {
if (res.length == 1) { if (res.length == 1) {
this.currentDept = res[0] this.currentDept = res[0];
this.paramsMtask.mgroup__belong_dept = this.currentDept.id this.paramsMtask.mgroup__belong_dept =
this.paramsMtask.state__in = '20,40' this.currentDept.id;
this.apiMtask = this.$API.pm.mtask.list this.paramsMtask.state__in = "20,40";
this.apiMtask = this.$API.pm.mtask.list;
this.paramsHandover.recive_dept = this.currentDept.id this.paramsHandover.recive_dept = this.currentDept.id;
this.apiObjHandover = this.$API.wpm.handover.list this.apiObjHandover = this.$API.wpm.handover.list;
this.paramsWm.belong_dept = this.currentDept.id this.paramsWm.belong_dept = this.currentDept.id;
this.paramsWm.count__gte = 1 this.paramsWm.count__gte = 1;
this.apiObjWm = this.$API.wpm.wmaterial.list this.apiObjWm = this.$API.wpm.wmaterial.list;
} else { } else {
this.$message.error("未找到车间"); this.$message.error("未找到车间");
} }
}) });
}, },
handleQueryMtask() { handleQueryMtask() {
this.$refs.table_mtask.queryData(this.queryMtask) if (this.queryMtaskState) {
this.queryMtask.state__in = "20,30,34,40";
} else {
this.queryMtask.state__in = "20,30,40";
}
this.$refs.table_mtask.queryData(this.queryMtask);
}, },
handover_submit(row) { handover_submit(row) {
this.$API.wpm.handover.submit.req(row.id).then(res => { this.$API.wpm.handover.submit
this.$refs.table_handover.refresh() .req(row.id)
this.$message.success('操作成功') .then((res) => {
}).catch(e => { this.$refs.table_handover.refresh();
this.$message.success("操作成功");
}) })
.catch((e) => {});
}, },
getMlogs() { getMlogs() {
this.$API.wpm.mlog.list.req({ mtask: this.currentMtask.id, page: 0 }).then(res => { this.$API.wpm.mlog.list
this.mlogs = res .req({ mtask: this.currentMtask.id, page: 0 })
}) .then((res) => {
this.mlogs = res;
});
}, },
getMtask() { getMtask() {
this.$API.pm.mtask.item.req(this.currentMtask.id).then(res => { this.$API.pm.mtask.item.req(this.currentMtask.id).then((res) => {
this.currentMtask = res this.currentMtask = res;
}) });
}, },
mtaskClick(row) { mtaskClick(row) {
this.currentMtask = row; this.currentMtask = row;
this.getMtask() 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;
@ -428,12 +761,12 @@ export default {
that.material_model = that.currentMtask.material_out_.model; that.material_model = that.currentMtask.material_out_.model;
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;
arr.push(obj) arr.push(obj);
}) });
this.brothersList = arr; this.brothersList = arr;
that.dialogSave = true; that.dialogSave = true;
that.$nextTick(() => { that.$nextTick(() => {
@ -444,21 +777,25 @@ export default {
} }
}, },
table_submit(row) { table_submit(row) {
let lengths = row.mlogs.length, infoText = ''; let lengths = row.mlogs.length,
infoText = "";
if (lengths > 0) { if (lengths > 0) {
infoText = '该任务有' + lengths + '条日志,确定提交吗?'; infoText = "该任务有" + lengths + "条日志,确定提交吗?";
} else { } else {
infoText = '该任务没有日志,确定提交吗?'; infoText = "该任务没有日志,确定提交吗?";
} }
this.$confirm(infoText, "提示", { this.$confirm(infoText, "提示", {
type: "warning", type: "warning",
}).then(() => { }).then(() => {
this.$API.pm.mtask.submit.req(row.id).then(res => { this.$API.pm.mtask.submit
this.$message.success('操作成功') .req(row.id)
this.$refs.table_mtask.refresh() .then((res) => {
this.mtaskClick(this.currentMtask) this.$message.success("操作成功");
}).catch(err => { }) this.$refs.table_mtask.refresh();
this.mtaskClick(this.currentMtask);
}) })
.catch((err) => {});
});
}, },
// table_submit(row) { // table_submit(row) {
// this.$API.pm.mtask.submit.req(row.id).then(res => { // this.$API.pm.mtask.submit.req(row.id).then(res => {
@ -490,30 +827,38 @@ export default {
let that = this; let that = this;
this.$confirm(`确定删除吗?`, "提示", { this.$confirm(`确定删除吗?`, "提示", {
type: "warning", type: "warning",
}).then(() => { })
that.$API.wpm.mlog.delete.req(row.id).then((res) => { .then(() => {
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.mlogHandleLoading = true;
this.$API.wpm.mlog.submit.req(row.id).then(res => { this.$API.wpm.mlog.submit
this.$message.success('操作成功') .req(row.id)
this.mtaskClick(this.currentMtask) .then((res) => {
this.$refs.table_wm.refresh() this.$message.success("操作成功");
this.mlogHandleLoading = false this.mtaskClick(this.currentMtask);
}).catch(err => { this.$refs.table_wm.refresh();
this.mlogHandleLoading = false this.mlogHandleLoading = false;
}) })
.catch((err) => {
this.mlogHandleLoading = false;
});
}, },
} },
} };
</script> </script>

View File

@ -7,28 +7,69 @@
<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"
type="date"
value-format="YYYY-MM-DD"
@change="handleQueryMtask"
/>
<el-checkbox
style="margin-left: 10px"
v-model="queryMtaskState"
label="已终止"
@change="handleQueryMtask"
/>
</div> </div>
</el-header> </el-header>
<el-main> <el-main>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="paramsMtask" :query="queryMtask" <scTable
@row-click="rowClick"> ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="paramsMtask"
:query="queryMtask"
@row-click="rowClick"
>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="任务编号" prop="number" width="150"> <el-table-column
label="任务编号"
prop="number"
width="150"
>
</el-table-column> </el-table-column>
<el-table-column label="产物" prop="material_out_name" show-overflow-tooltip width="250"> <el-table-column
label="产物"
prop="material_out_name"
show-overflow-tooltip
width="250"
>
</el-table-column> </el-table-column>
<el-table-column label="计划数量" prop="count"> <el-table-column label="计划数量" prop="count">
</el-table-column> </el-table-column>
<el-table-column label="生产日期" prop="start_date"> <el-table-column
label="生产日期"
prop="start_date"
>
</el-table-column> </el-table-column>
<el-table-column label="状态" prop="state"> <el-table-column label="状态" prop="state">
<template #default="scope"> <template #default="scope">
<el-tag v-if="scope.row.state !== 40"> <el-tag v-if="scope.row.state == 20">
{{ state_[scope.row.state] }} {{ state_[scope.row.state] }}
</el-tag> </el-tag>
<el-tag v-else type="success"> <el-tag v-if="scope.row.state == 30">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag
v-if="scope.row.state == 34"
type="danger"
>
{{ state_[scope.row.state] }}
</el-tag>
<el-tag
v-if="scope.row.state == 40"
type="success"
>
{{ state_[scope.row.state] }} {{ state_[scope.row.state] }}
</el-tag> </el-tag>
</template> </template>
@ -37,7 +78,7 @@
</el-main> </el-main>
</el-container> </el-container>
</el-aside> </el-aside>
<el-main style="padding: 0;"> <el-main style="padding: 0">
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
@ -45,25 +86,60 @@
</div> </div>
</el-header> </el-header>
<el-main> <el-main>
<scTable ref="tableprocess" row-key="id" stripe :hideDo="hideDo" :data="processList" <scTable
@row-click="itemClick"> ref="tableprocess"
<el-table-column label="任务编号" prop="number" width="150"> row-key="id"
stripe
:hideDo="hideDo"
:data="processList"
@row-click="itemClick"
>
<el-table-column
label="任务编号"
prop="number"
width="150"
>
</el-table-column> </el-table-column>
<el-table-column label="日期" prop="start_date" width="120"> <el-table-column
label="日期"
prop="start_date"
width="120"
>
</el-table-column> </el-table-column>
<el-table-column label="工序" prop="mgroup_name"> <el-table-column
label="工序"
prop="mgroup_name"
>
</el-table-column> </el-table-column>
<el-table-column label="计划数量" prop="count"> <el-table-column label="计划数量" prop="count">
</el-table-column> </el-table-column>
<el-table-column label="合格数量" prop="count_ok"> <el-table-column
label="合格数量"
prop="count_ok"
>
</el-table-column> </el-table-column>
<el-table-column label="提交人" prop="submit_user_name"> <el-table-column
label="提交人"
prop="submit_user_name"
>
</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.stop="table_submit(scope.row)" v-auth="'mtask.submit'" <el-link
v-if="scope.row.state != 40">提交 type="primary"
@click.stop="
table_submit(scope.row)
"
v-auth="'mtask.submit'"
v-if="
scope.row.state != 40 &&
scope.row.state != 34
"
>提交
</el-link> </el-link>
</template> </template>
</el-table-column> </el-table-column>
@ -85,30 +161,64 @@
</div> </div>
</el-header> </el-header>
<el-main> <el-main>
<scTable ref="table_handover" :apiObj="apiObjHandover" row-key="id" stripe :params="paramsHandover"> <scTable
<el-table-column label="送料日期" prop="send_date"> ref="table_handover"
:apiObj="apiObjHandover"
row-key="id"
stripe
:params="paramsHandover"
>
<el-table-column
label="送料日期"
prop="send_date"
>
</el-table-column> </el-table-column>
<el-table-column label="产物" prop="material_name" show-overflow-tooltip> <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>
<el-table-column label="批次" prop="batch"> </el-table-column>
<el-table-column label="数量" prop="count"> <el-table-column label="数量" prop="count">
</el-table-column> </el-table-column>
<el-table-column label="交送人" prop="send_user_name"> <el-table-column
label="交送人"
prop="send_user_name"
>
</el-table-column> </el-table-column>
<el-table-column label="接收人" prop="recive_user_name"> <el-table-column
label="接收人"
prop="recive_user_name"
>
</el-table-column> </el-table-column>
<el-table-column label="是否确认" prop="submit_time"> <el-table-column
label="是否确认"
prop="submit_time"
>
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.submit_time"></span> <span v-if="scope.row.submit_time"
></span
>
<span v-else></span> <span v-else></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="left"> <el-table-column
label="操作"
fixed="right"
align="left"
>
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click.stop="handover_submit(scope.row)" v-auth="'handover.submit'" <el-button
v-if="scope.row.submit_time == null"> link
type="primary"
@click.stop="
handover_submit(scope.row)
"
v-auth="'handover.submit'"
v-if="scope.row.submit_time == null"
>
确认 确认
</el-button> </el-button>
</template> </template>
@ -117,7 +227,7 @@
</el-main> </el-main>
</el-container> </el-container>
</el-aside> </el-aside>
<el-main style="padding: 0 0 0 8px;"> <el-main style="padding: 0 0 0 8px">
<!-- 车间库存 --> <!-- 车间库存 -->
<el-container> <el-container>
<el-header> <el-header>
@ -125,38 +235,59 @@
<span style="font-size: 14px">车间库存</span> <span style="font-size: 14px">车间库存</span>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-button type="primary" @click="tomio" v-auth="'mio.do'">领料</el-button> <el-button
<el-button type="primary" @click="tomio" v-auth="'mio.do'">入库</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> </div>
</el-header> </el-header>
<el-main style="padding: 0;"> <el-main style="padding: 0">
<scTable ref="table_wm" :apiObj="apiObjWm" row-key="id" :params="paramsWm" stripe hidePagination> <scTable
ref="table_wm"
:apiObj="apiObjWm"
row-key="id"
:params="paramsWm"
stripe
hidePagination
>
<el-table-column label="物料名" prop="material"> <el-table-column label="物料名" prop="material">
<template #default="scope"> <template #default="scope">
{{ scope.row.material_.name }} {{ scope.row.material_.name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="规格" prop="material"> <el-table-column label="规格" prop="material">
<template #default="scope"> <template #default="scope">
{{ scope.row.material_.specification }} {{ scope.row.material_.specification }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="型号" prop="material"> <el-table-column label="型号" prop="material">
<template #default="scope"> <template #default="scope">
{{ scope.row.material_.model }} {{ scope.row.material_.model }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="已到工序" prop="material"> <el-table-column
label="已到工序"
prop="material"
>
<template #default="scope">{{ <template #default="scope">{{
scope.row.material_.process_name scope.row.material_.process_name
}}</template> }}</template>
</el-table-column> </el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column> <el-table-column label="批次" prop="batch">
<el-table-column label="数量" prop="count" width="80"> </el-table-column>
<el-table-column
label="数量"
prop="count"
width="80"
>
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-main> </el-main>
@ -178,31 +309,35 @@ export default {
query: {}, query: {},
processList: [], // processList: [], //
state_: { state_: {
10: '创建中', 10: "创建中",
20: '已下达', 20: "已下达",
30: '生产中', 30: "生产中",
40: '已提交', 34: "已终止",
40: "已提交",
}, },
hideDo: true, hideDo: true,
queryMtaskState: false,
apiObjWm: this.$API.wpm.wmaterial.list, apiObjWm: this.$API.wpm.wmaterial.list,
paramsMlog: { paramsMlog: {
mtask: '' mtask: "",
}, },
apiObjHandover: this.$API.wpm.handover.list, apiObjHandover: this.$API.wpm.handover.list,
paramsHandover: { paramsHandover: {
recive_dept__name: '6车间' recive_dept__name: "6车间",
}, },
paramsWm: { paramsWm: {
belong_dept__name: '6车间', belong_dept__name: "6车间",
count__gte: 1 count__gte: 1,
}, },
paramsMtask: { paramsMtask: {
mgroup__belong_dept__name: '6车间', mgroup__belong_dept__name: "6车间",
is_count_utask: true, is_count_utask: true,
state__in: "20,40" state__in: "20,30,40",
}, },
queryMtask: {} queryMtask: {
} state__in: "",
},
};
}, },
mounted() { mounted() {
let NowDate = new Date(); let NowDate = new Date();
@ -216,9 +351,16 @@ export default {
// //
rowClick(row) { rowClick(row) {
let that = this; let that = this;
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 => { this.$API.pm.mtask.list
that.processList = res.results; .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;
});
}, },
// //
itemClick(row) { itemClick(row) {
@ -231,39 +373,50 @@ export default {
// this.apiObjMlog = this.$API.wpm.mlog.list; // this.apiObjMlog = this.$API.wpm.mlog.list;
this.$router.push({ this.$router.push({
name: "mlogDept6Detail", name: "mlogDept6Detail",
query: { mtaskId: row.id } query: { mtaskId: row.id },
}); });
}, },
handleQueryMtask() { handleQueryMtask() {
if (this.queryMtaskState) {
this.queryMtask.state__in = "20,30,34,40";
} else {
this.queryMtask.state__in = "20,30,40";
}
this.$refs.table.queryData(this.queryMtask); this.$refs.table.queryData(this.queryMtask);
}, },
table_submit(row) { table_submit(row) {
let lengths = row.mlogs.length, infoText = ''; let lengths = row.mlogs.length,
infoText = "";
if (lengths > 0) { if (lengths > 0) {
infoText = '该任务有' + lengths + '条日志,确定提交吗?'; infoText = "该任务有" + lengths + "条日志,确定提交吗?";
} else { } else {
infoText = '该任务没有日志,确定提交吗?'; infoText = "该任务没有日志,确定提交吗?";
} }
this.$confirm(infoText, "提示", { this.$confirm(infoText, "提示", {
type: "warning", type: "warning",
}).then(() => { }).then(() => {
this.$API.pm.mtask.submit.req(row.id).then(res => { this.$API.pm.mtask.submit
this.$message.success('操作成功') .req(row.id)
this.$refs.table_mtask.refresh() .then((res) => {
this.mtaskClick(this.currentMtask) this.$message.success("操作成功");
}).catch(err => { }) this.$refs.table_mtask.refresh();
this.mtaskClick(this.currentMtask);
}) })
.catch((err) => {});
});
}, },
handover_submit(row) { handover_submit(row) {
this.$API.wpm.handover.submit.req(row.id).then(res => { this.$API.wpm.handover.submit
this.$message.success('操作成功') .req(row.id)
.then((res) => {
this.$message.success("操作成功");
this.$refs.table_handover.refresh(); this.$refs.table_handover.refresh();
this.$refs.table_wm.refresh(); this.$refs.table_wm.refresh();
}).catch(err => { }) })
.catch((err) => {});
}, },
} },
} };
</script> </script>
<style scoped> <style scoped>
@ -272,7 +425,7 @@ export default {
position: absolute; position: absolute;
right: 20px; right: 20px;
margin-top: 4px; margin-top: 4px;
z-index: 100 z-index: 100;
} }
.right-panel > * + * { .right-panel > * + * {
@ -280,7 +433,7 @@ export default {
} }
.el-main.nopadding { .el-main.nopadding {
padding: 0 20px 0 20px padding: 0 20px 0 20px;
} }
.tableTitle { .tableTitle {

View File

@ -6,14 +6,36 @@
<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
placeholder="工作日期" @change="handleQueryMtask" /> v-model="queryMtask.start_date"
type="date"
value-format="YYYY-MM-DD"
placeholder="工作日期"
@change="handleQueryMtask"
/>
<el-checkbox
style="margin-left: 10px"
v-model="queryMtaskState"
label="已终止"
@change="handleQueryMtask"
/>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable ref="table_mtask" :apiObj="apiMtask" row-key="id" stripe :params="paramsMtask" <scTable
:query="queryMtask" @row-click="mtaskClick"> ref="table_mtask"
<el-table-column label="产品名称" prop="material" show-overflow-tooltip> :apiObj="apiMtask"
row-key="id"
stripe
:params="paramsMtask"
:query="queryMtask"
@row-click="mtaskClick"
>
<el-table-column
label="产品名称"
prop="material"
show-overflow-tooltip
>
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.material_out_">{{ <span v-if="scope.row.material_out_">{{
scope.row.material_out_.name scope.row.material_out_.name
@ -22,31 +44,69 @@
</el-table-column> </el-table-column>
<el-table-column label="型号规格" prop=""> <el-table-column label="型号规格" prop="">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.material_out_">{{ <span v-if="scope.row.material_out_"
scope.row.material_out_.specification >{{
}}|{{ scope.row.material_out_.model }}</span> scope.row.material_out_
.specification
}}|{{
scope.row.material_out_.model
}}</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="任务编号" prop="number" width="140" show-overflow-tooltip> <el-table-column
label="任务编号"
prop="number"
width="140"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<el-table-column label="任务量" prop="count"> </el-table-column> <el-table-column label="任务量" prop="count">
<el-table-column label="工作日期" prop="start_date"> </el-table-column>
<el-table-column
label="工作日期"
prop="start_date"
>
</el-table-column>
<el-table-column label="合格数" prop="count_ok">
</el-table-column> </el-table-column>
<el-table-column label="合格数" prop="count_ok"> </el-table-column>
<el-table-column label="状态" prop="state"> <el-table-column label="状态" prop="state">
<template #default="scope"> <template #default="scope">
<el-tag v-if="scope.row.state !== 40"> <el-tag v-if="scope.row.state == 20">
{{ state_[scope.row.state] }} {{ state_[scope.row.state] }}
</el-tag> </el-tag>
<el-tag v-else type="success"> <el-tag v-if="scope.row.state == 30">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag
v-if="scope.row.state == 34"
type="danger"
>
{{ state_[scope.row.state] }}
</el-tag>
<el-tag
v-if="scope.row.state == 40"
type="success"
>
{{ state_[scope.row.state] }} {{ state_[scope.row.state] }}
</el-tag> </el-tag>
</template> </template>
</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="mtask_submit(scope.row)" v-auth="'mtask.submit'" <el-link
v-if="scope.row.state != 40">提交 type="primary"
@click="mtask_submit(scope.row)"
v-auth="'mtask.submit'"
v-if="
scope.row.state != 40 &&
scope.row.state != 34
"
>提交
</el-link> </el-link>
</template> </template>
</el-table-column> </el-table-column>
@ -64,17 +124,34 @@
</div> </div>
</template> </template>
<el-descriptions> <el-descriptions>
<el-descriptions-item label="任务编号">{{ currentMtask.number }}</el-descriptions-item> <el-descriptions-item label="任务编号">{{
<el-descriptions-item label="状态">{{ state_[currentMtask.state] }}</el-descriptions-item> currentMtask.number
<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_ok
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="不合格数">{{ currentMtask.count_notok <el-descriptions-item label="状态">{{
state_[currentMtask.state]
}}</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_ok
}}</el-descriptions-item>
<el-descriptions-item label="不合格数">{{
currentMtask.count_notok
}}</el-descriptions-item> }}</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
@ -83,78 +160,222 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="addMlog" <el-button
v-if="currentMtask && currentMtask.state == 20" type="primary"
v-auth="'mlog.create'">新增</el-button> icon="el-icon-plus"
@click="addMlog"
v-if="
currentMtask &&
currentMtask.state == 20
"
v-auth="'mlog.create'"
>新增</el-button
>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable ref="table_mlog" :data="mlogs" row-key="id" stripe hidePagination hideDo> <scTable
<el-table-column label="锅号" prop="equipment_name"> ref="table_mlog"
:data="mlogs"
row-key="id"
stripe
hidePagination
hideDo
>
<el-table-column
label="锅号"
prop="equipment_name"
>
</el-table-column> </el-table-column>
<el-table-column label="产品名称" prop="material_out_" min-width="120"> <el-table-column
label="产品名称"
prop="material_out_"
min-width="120"
>
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.material_out_">{{ <span
scope.row.material_out_.name v-if="
}}</span> scope.row.material_out_
"
>{{
scope.row.material_out_
.name
}}</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="批次号" prop="batch"> <el-table-column
label="批次号"
prop="batch"
>
</el-table-column> </el-table-column>
<el-table-column label="规格" prop="material_out_"> <el-table-column
label="规格"
prop="material_out_"
>
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.material_out_">{{ <span
scope.row.material_out_.specification v-if="
}}</span> scope.row.material_out_
"
>{{
scope.row.material_out_
.specification
}}</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="生产量" prop="count_real"> <el-table-column
label="生产量"
prop="count_real"
>
</el-table-column> </el-table-column>
<el-table-column label="合格量" prop="count_ok"> </el-table-column> <el-table-column
<el-table-column label="合格率" prop="count"> label="合格量"
prop="count_ok"
>
</el-table-column>
<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
<el-table-column label="炸纹" prop="count_n_zw"> label="不合格原因及数量"
align="center"
>
<el-table-column
label="炸纹"
prop="count_n_zw"
>
</el-table-column> </el-table-column>
<el-table-column label="条纹" prop="count_n_tw"> <el-table-column
label="条纹"
prop="count_n_tw"
>
</el-table-column> </el-table-column>
<el-table-column label="气泡" prop="count_n_qp"> <el-table-column
label="气泡"
prop="count_n_qp"
>
</el-table-column> </el-table-column>
<el-table-column label="弯曲" prop="count_n_wq"> <el-table-column
label="弯曲"
prop="count_n_wq"
>
</el-table-column> </el-table-column>
<el-table-column label="其他" prop="count_n_qt"> <el-table-column
label="其他"
prop="count_n_qt"
>
</el-table-column> </el-table-column>
<el-table-column label="合计" prop="count_n_qt"> <el-table-column
label="合计"
prop="count_n_qt"
>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="退火炉号" prop="equipment_2_name"> <el-table-column
label="退火炉号"
prop="equipment_2_name"
>
</el-table-column> </el-table-column>
<el-table-column label="第几锅" prop="index"> </el-table-column> <el-table-column
<el-table-column label="成型人" prop="handle_user_name"> label="第几锅"
prop="index"
>
</el-table-column> </el-table-column>
<el-table-column label="切料人" prop="handle_user_2_name"> <el-table-column
label="成型人"
prop="handle_user_name"
>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" width="120" align="center"> <el-table-column
label="切料人"
prop="handle_user_2_name"
>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
width="120"
align="center"
>
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="table_edit(scope.row)" <el-button
v-auth="'mlog.update'" v-if="scope.row.submit_time == null">编辑 link
type="primary"
@click="
table_edit(scope.row)
"
v-auth="'mlog.update'"
v-if="
scope.row.submit_time ==
null
"
>编辑
</el-button> </el-button>
<el-button link type="danger" @click="table_del(scope.row)" <el-button
v-auth="'mlog.delete'" v-if="scope.row.submit_time == null">删除 link
type="danger"
@click="
table_del(scope.row)
"
v-auth="'mlog.delete'"
v-if="
scope.row.submit_time ==
null
"
>删除
</el-button> </el-button>
<el-button link type="primary" @click="mlog_submit(scope.row)" <el-button
v-auth="'mlog.submit'" v-if="scope.row.submit_time == null" link
:loading="mlogHandleLoading">提交 type="primary"
@click="
mlog_submit(scope.row)
"
v-auth="'mlog.submit'"
v-if="
scope.row.submit_time ==
null
"
:loading="mlogHandleLoading"
>提交
</el-button> </el-button>
<el-button link type="danger" @click="mlog_revert(scope.row)" <el-button
v-auth="'mlog.submit'" v-if="scope.row.submit_time != null" link
:loading="mlogHandleLoading">撤回 type="danger"
@click="
mlog_revert(scope.row)
"
v-auth="'mlog.submit'"
v-if="
scope.row.submit_time !=
null
"
:loading="mlogHandleLoading"
>撤回
</el-button> </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>
</template> </template>
@ -164,7 +385,6 @@
</el-container> </el-container>
</el-main> </el-main>
</el-container> </el-container>
</el-main> </el-main>
</el-container> </el-container>
</el-header> </el-header>
@ -178,34 +398,70 @@
</div> </div>
</el-header> </el-header>
<el-main> <el-main>
<scTable ref="table_handover" :apiObj="apiObjHandover" row-key="id" stripe <scTable
:params="paramsHandover"> ref="table_handover"
:apiObj="apiObjHandover"
row-key="id"
stripe
:params="paramsHandover"
>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="送料日期" prop="send_date"> <el-table-column
label="送料日期"
prop="send_date"
>
</el-table-column> </el-table-column>
<el-table-column label="产物" prop="material" show-overflow-tooltip> <el-table-column
<template #default="scope"><span v-if="scope.row.material_">{{ label="产物"
prop="material"
show-overflow-tooltip
>
<template #default="scope"
><span v-if="scope.row.material_">{{
scope.row.material_.name scope.row.material_.name
}}</span> }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column> <el-table-column label="批次" prop="batch">
</el-table-column>
<el-table-column label="数量" prop="count"> <el-table-column label="数量" prop="count">
</el-table-column> </el-table-column>
<el-table-column label="交送人" prop="send_user_name"> <el-table-column
label="交送人"
prop="send_user_name"
>
</el-table-column> </el-table-column>
<el-table-column label="接收人" prop="recive_user_name"> <el-table-column
label="接收人"
prop="recive_user_name"
>
</el-table-column> </el-table-column>
<el-table-column label="是否确认" prop="submit_time"> <el-table-column
label="是否确认"
prop="submit_time"
>
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.submit_time"></span> <span v-if="scope.row.submit_time"
></span
>
<span v-else></span> <span v-else></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="left"> <el-table-column
label="操作"
fixed="right"
align="left"
>
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click.stop="handover_submit(scope.row)" <el-button
v-auth="'handover.submit'" v-if="scope.row.submit_time == null"> link
type="primary"
@click.stop="
handover_submit(scope.row)
"
v-auth="'handover.submit'"
v-if="scope.row.submit_time == null"
>
确认 确认
</el-button> </el-button>
</template> </template>
@ -213,7 +469,6 @@
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container>
</el-aside> </el-aside>
<el-main class="nopadding"> <el-main class="nopadding">
<el-container> <el-container>
@ -222,13 +477,29 @@
<span style="font-size: 14px">车间库存</span> <span style="font-size: 14px">车间库存</span>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-button type="primary" @click="tomio" v-auth="'mio.do'">领料</el-button> <el-button
<el-button type="primary" @click="tomioin" v-auth="'mio.do'">入库</el-button> type="primary"
@click="tomio"
v-auth="'mio.do'"
>领料</el-button
>
<el-button
type="primary"
@click="tomioin"
v-auth="'mio.do'"
>入库</el-button
>
</div> </div>
</el-header> </el-header>
<el-main> <el-main>
<scTable ref="table_wm" :apiObj="apiObjWm" row-key="id" :params="paramsWm" stripe <scTable
hidePagination> ref="table_wm"
:apiObj="apiObjWm"
row-key="id"
:params="paramsWm"
stripe
hidePagination
>
<el-table-column label="物料名" prop="material"> <el-table-column label="物料名" prop="material">
<template #default="scope">{{ <template #default="scope">{{
scope.row.material_.name scope.row.material_.name
@ -244,13 +515,21 @@
scope.row.material_.model scope.row.material_.model
}}</template> }}</template>
</el-table-column> </el-table-column>
<el-table-column label="已到工序" prop="material"> <el-table-column
label="已到工序"
prop="material"
>
<template #default="scope">{{ <template #default="scope">{{
scope.row.material_.process_name scope.row.material_.process_name
}}</template> }}</template>
</el-table-column> </el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column> <el-table-column label="批次" prop="batch">
<el-table-column label="数量" prop="count" width="80"> </el-table-column>
<el-table-column
label="数量"
prop="count"
width="80"
>
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-main> </el-main>
@ -258,11 +537,25 @@
</el-main> </el-main>
</el-container> </el-container>
</el-main> </el-main>
<save-dialog v-if="dialogSave" ref="saveDialog" :mtask="currentMtask.id" :mgroup="mgroup" <save-dialog
:material_out="material_out" :material_model="material_model" :material_in="material_in" :activeType="activeName" @success="handleSaveSuccess" v-if="dialogSave"
@closed="dialogSave = false"> ref="saveDialog"
:mtask="currentMtask.id"
:mgroup="mgroup"
:material_out="material_out"
:material_model="material_model"
:material_in="material_in"
:activeType="activeName"
@success="handleSaveSuccess"
@closed="dialogSave = false"
>
</save-dialog> </save-dialog>
<showDrawer ref="showDrawer" v-if="visibleDrawer" :mlogId="mlogId" @closed="visibleDrawer = false"> <showDrawer
ref="showDrawer"
v-if="visibleDrawer"
:mlogId="mlogId"
@closed="visibleDrawer = false"
>
</showDrawer> </showDrawer>
</el-container> </el-container>
</template> </template>
@ -271,12 +564,13 @@ 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, mlogHandleLoading: false,
activeName: '7车间', activeName: "7车间",
currentDept: {}, currentDept: {},
currentMtask: {}, currentMtask: {},
apiMtask: null, apiMtask: null,
@ -286,35 +580,40 @@ export default {
10: "创建中", 10: "创建中",
20: "已下达", 20: "已下达",
30: "生产中", 30: "生产中",
34: "已终止",
40: "已提交", 40: "已提交",
}, },
dialogSave: false, dialogSave: false,
visibleDrawer: false, visibleDrawer: false,
queryMtaskState: false,
apiObjHandover: null, apiObjHandover: null,
paramsHandover: {}, paramsHandover: {},
apiObjWm: null, apiObjWm: null,
paramsWm: {}, paramsWm: {},
mlogs: [], mlogs: [],
mlogId: '', mlogId: "",
mgroup: '', mgroup: "",
material_out: '', material_out: "",
material_model:'' material_model: "",
} };
}, },
mounted() { mounted() {
this.initDept() this.initDept();
}, },
methods: { methods: {
mlog_revert(row) { mlog_revert(row) {
this.mlogHandleLoading = true; this.mlogHandleLoading = true;
this.$API.wpm.mlog.revert.req(row.id).then(res => { this.$API.wpm.mlog.revert
.req(row.id)
.then((res) => {
this.$message.success("撤回成功"); this.$message.success("撤回成功");
this.mtaskClick(this.currentMtask) this.mtaskClick(this.currentMtask);
this.$refs.table_wm.refresh() this.$refs.table_wm.refresh();
this.mlogHandleLoading = false;
}).catch(e => {
this.mlogHandleLoading = false; this.mlogHandleLoading = false;
}) })
.catch((e) => {
this.mlogHandleLoading = false;
});
}, },
tomio() { tomio() {
this.$router.push({ name: "mainso_mio" }); this.$router.push({ name: "mainso_mio" });
@ -350,77 +649,97 @@ export default {
let that = this; let that = this;
this.$confirm(`确定删除吗?`, "提示", { this.$confirm(`确定删除吗?`, "提示", {
type: "warning", type: "warning",
}).then(() => { })
that.$API.wpm.mlog.delete.req(row.id).then((res) => { .then(() => {
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(() => {});
}, },
initDept() { initDept() {
this.$API.system.dept.list.req({ page: 0, name: '7车间' }).then(res => { this.$API.system.dept.list
.req({ page: 0, name: "7车间" })
.then((res) => {
if (res.length == 1) { if (res.length == 1) {
this.currentDept = res[0] this.currentDept = res[0];
this.paramsMtask.mgroup__belong_dept = this.currentDept.id this.paramsMtask.mgroup__belong_dept =
this.paramsMtask.state__in = '20,40' this.currentDept.id;
this.apiMtask = this.$API.pm.mtask.list this.paramsMtask.state__in = "20,40";
this.apiMtask = this.$API.pm.mtask.list;
this.paramsHandover.recive_dept = this.currentDept.id this.paramsHandover.recive_dept = this.currentDept.id;
this.apiObjHandover = this.$API.wpm.handover.list this.apiObjHandover = this.$API.wpm.handover.list;
this.paramsWm.belong_dept = this.currentDept.id this.paramsWm.belong_dept = this.currentDept.id;
this.paramsWm.count__gte = 1 this.paramsWm.count__gte = 1;
this.apiObjWm = this.$API.wpm.wmaterial.list this.apiObjWm = this.$API.wpm.wmaterial.list;
} else { } else {
this.$message.error("未找到车间"); this.$message.error("未找到车间");
} }
}) });
}, },
handleQueryMtask() { handleQueryMtask() {
this.$refs.table_mtask.queryData(this.queryMtask) if (this.queryMtaskState) {
this.queryMtask.state__in = "20,30,34,40";
} else {
this.queryMtask.state__in = "20,30,40";
}
this.$refs.table_mtask.queryData(this.queryMtask);
}, },
handover_submit(row) { handover_submit(row) {
this.$API.wpm.handover.submit.req(row.id).then(res => { this.$API.wpm.handover.submit
this.$refs.table_handover.refresh() .req(row.id)
this.$message.success('操作成功') .then((res) => {
}).catch(e => { this.$refs.table_handover.refresh();
this.$message.success("操作成功");
}) })
.catch((e) => {});
}, },
getMlogs() { getMlogs() {
this.$API.wpm.mlog.list.req({ mtask: this.currentMtask.id, page: 0 }).then(res => { this.$API.wpm.mlog.list
this.mlogs = res .req({ mtask: this.currentMtask.id, page: 0 })
}) .then((res) => {
this.mlogs = res;
});
}, },
getMtask() { getMtask() {
this.$API.pm.mtask.item.req(this.currentMtask.id).then(res => { this.$API.pm.mtask.item.req(this.currentMtask.id).then((res) => {
this.currentMtask = res this.currentMtask = res;
}) });
}, },
mtaskClick(row) { mtaskClick(row) {
this.currentMtask = row; this.currentMtask = row;
this.getMtask() this.getMtask();
this.getMlogs() this.getMlogs();
}, },
mtask_submit(row) { mtask_submit(row) {
let lengths = row.mlogs.length,infoText = ''; let lengths = row.mlogs.length,
infoText = "";
if (lengths > 0) { if (lengths > 0) {
infoText = '该任务有'+lengths+'条日志,确定提交吗?'; infoText = "该任务有" + lengths + "条日志,确定提交吗?";
} else { } else {
infoText = '该任务没有日志,确定提交吗?'; infoText = "该任务没有日志,确定提交吗?";
} }
this.$confirm(infoText, "提示", { this.$confirm(infoText, "提示", {
type: "warning", type: "warning",
}).then(() => { }).then(() => {
this.$API.pm.mtask.submit.req(row.id).then(res => { this.$API.pm.mtask.submit
this.$message.success('操作成功') .req(row.id)
this.$refs.table_mtask.refresh() .then((res) => {
this.mtaskClick(this.currentMtask) this.$message.success("操作成功");
}).catch(err => {}) this.$refs.table_mtask.refresh();
this.mtaskClick(this.currentMtask);
}) })
.catch((err) => {});
});
}, },
handleSaveSuccess() { handleSaveSuccess() {
this.getMlogs(); this.getMlogs();
@ -433,16 +752,19 @@ export default {
}); });
}, },
mlog_submit(row) { mlog_submit(row) {
this.mlogHandleLoading = true this.mlogHandleLoading = true;
this.$API.wpm.mlog.submit.req(row.id).then(res => { this.$API.wpm.mlog.submit
this.$message.success('操作成功') .req(row.id)
this.mtaskClick(this.currentMtask) .then((res) => {
this.$refs.table_wm.refresh() this.$message.success("操作成功");
this.mlogHandleLoading = false this.mtaskClick(this.currentMtask);
}).catch(err => { this.$refs.table_wm.refresh();
this.mlogHandleLoading = false this.mlogHandleLoading = false;
}) })
.catch((err) => {
this.mlogHandleLoading = false;
});
}, },
} },
} };
</script> </script>