fix:交接记录

This commit is contained in:
shijing 2024-07-25 14:58:01 +08:00
parent 2c5bd1d103
commit 1b6cf9a66b
4 changed files with 160 additions and 102 deletions

View File

@ -5,7 +5,7 @@
<el-input <el-input
style="margin-right: 5px" style="margin-right: 5px"
v-model="query.search" v-model="query.search"
placeholder="产品名称" placeholder="工序名称"
clearable clearable
></el-input> ></el-input>
<el-button <el-button
@ -154,7 +154,7 @@ export default {
this.$refs.saveDialog.open("edit").setData(row); this.$refs.saveDialog.open("edit").setData(row);
}); });
}, },
// //
async roleDel(row) { async roleDel(row) {
var id = row.id; var id = row.id;
var res = await this.$API.mtm.process.delete.req(id); var res = await this.$API.mtm.process.delete.req(id);

View File

@ -59,21 +59,11 @@
></el-table-column> ></el-table-column>
<el-table-column label="产品" prop="material_name"> <el-table-column label="产品" prop="material_name">
</el-table-column> </el-table-column>
<el-table-column label="状态" prop="state"> </el-table-column>
<el-table-column label="审批状态"> <el-table-column label="审批状态">
<template #default="scope"> <template #default="scope">
<span <el-tag :type="getType(scope.row.state)">
v-if="scope.row.ticket_ && scope.row.ticket_.state_" {{ state_[scope.row.state] }}
style="margin-right: 5px" </el-tag>
>{{ scope.row.ticket_.state_.name }}</span
>
<!-- <el-tag
v-if="
scope.row.ticket_ && scope.row.ticket_.act_state
"
>
{{ act_states[scope.row.ticket_.act_state] }}
</el-tag> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -181,14 +171,14 @@ export default {
value: 20, value: 20,
}, },
{ {
label: "已完成", label: "已确认",
value: 30, value: 30,
}, },
], ],
state_: { state_: {
10: "创建中", 10: "创建中",
20: "审批中", 20: "审批中",
30: "已关闭", 30: "已确认",
}, },
filterType: "all", filterType: "all",
}; };
@ -198,6 +188,15 @@ export default {
this.userId = userInfo.id; this.userId = userInfo.id;
}, },
methods: { methods: {
getType(state) {
if (state == 10) {
return "warning";
} else if (state == 20) {
return "primary";
} else if (state == 30) {
return "success";
}
},
// //
add() { add() {
this.dialog.save = true; this.dialog.save = true;

View File

@ -109,6 +109,8 @@
</el-table-column> </el-table-column>
<el-table-column label="工时" prop="hour_work"> <el-table-column label="工时" prop="hour_work">
</el-table-column> </el-table-column>
<el-table-column label="排序" prop="sort">
</el-table-column>
<el-table-column <el-table-column
label="操作" label="操作"
fixed="right" fixed="right"
@ -116,6 +118,13 @@
width="200" width="200"
> >
<template #default="scope"> <template #default="scope">
<el-button
text
type="primary"
size="small"
@click="table_edit(scope.row)"
>编辑</el-button
>
<el-popconfirm <el-popconfirm
title="确定删除该工序吗?" title="确定删除该工序吗?"
@confirm="delWorker(scope.row)" @confirm="delWorker(scope.row)"
@ -259,7 +268,9 @@ export default {
}, },
table_edit(row) { table_edit(row) {
this.dialog.save = true; this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row); this.$refs.saveDialog.open("edit").setData(row);
});
}, },
productClick(data) { productClick(data) {
let materialId = this.selectedProduct.id; let materialId = this.selectedProduct.id;
@ -276,11 +287,12 @@ export default {
submitOut() {}, submitOut() {},
// //
delWorker(row) { delWorker(row) {
this.$API.delete let that = this;
that.$API.mtm.route.delete
.req(row.id) .req(row.id)
.then((res) => { .then((res) => {
this.$message.success("工序步骤删除成功"); that.$message.success("工序步骤删除成功");
this.getmemberList(); that.$refs.tables.refresh();
return res; return res;
}) })
.catch((err) => { .catch((err) => {

View File

@ -2,13 +2,13 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-header> <!-- <el-header>
<el-segmented <el-segmented
v-model="values" v-model="values"
:options="options" :options="options"
size="default" size="default"
></el-segmented> ></el-segmented>
</el-header> </el-header> -->
<el-button <el-button
type="primary" type="primary"
icon="el-icon-plus" icon="el-icon-plus"
@ -25,11 +25,26 @@
> >
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-input <el-select
style="margin-right: 5px" v-model="searchType"
v-model="query.search" placeholder="交接类型"
placeholder="名称"
clearable clearable
@change="searchTypeQuery"
style="width: 150px"
>
<el-option
v-for="item in typeOptions"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
<el-input
style="width: 180px; margin-right: 5px"
v-model="query.search"
placeholder="批次号/关键字/id"
clearable
@keydown.enter="handleQuery"
></el-input> ></el-input>
<el-button <el-button
type="primary" type="primary"
@ -40,11 +55,11 @@
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable <scTable
v-if="values == '交送'"
ref="table" ref="table"
:apiObj="apiObj" :apiObj="apiObj"
row-key="id" row-key="id"
:params="params_sender" :params="params"
:query="query"
> >
<el-table-column <el-table-column
label="#" label="#"
@ -76,84 +91,40 @@
label="操作" label="操作"
fixed="right" fixed="right"
align="center" align="center"
width="120" width="140"
> >
<template #default="scope"> <template #default="scope">
<el-button
link
size="small"
v-if="scope.row.send_mgroup == mgroupId"
@click="table_print(scope.row)"
type="success"
>打印</el-button
>
<el-button
link
size="small"
@click="table_receive(scope.row)"
type="success"
v-if="
scope.row.recive_mgroup == mgroupId &&
scope.row.submit_time == null
"
>接收</el-button
>
<el-button <el-button
link link
size="small" size="small"
@click="table_edit(scope.row)" @click="table_edit(scope.row)"
v-auth="'mgroup.update'" v-auth="'mgroup.update'"
type="primary" type="primary"
v-if="
scope.row.send_mgroup == mgroupId &&
scope.row.submit_time == null
"
>编辑</el-button >编辑</el-button
> >
<el-divider direction="vertical"></el-divider>
<el-popconfirm
title="确定删除吗?"
@confirm="table_del(scope.row, scope.$index)"
>
<template #reference>
<el-button
link
size="small"
v-auth="'mgroup.delete'"
type="danger"
>删除</el-button
>
</template>
</el-popconfirm>
</template>
</el-table-column>
</scTable>
<scTable
v-if="values == '接收'"
ref="table"
:apiObj="apiObj"
row-key="id"
:params="params_recive"
>
<el-table-column
label="#"
type="index"
width="50"
></el-table-column>
<el-table-column
label="物料"
prop="material_name"
min-width="120"
></el-table-column>
<el-table-column label="批次" prop="batch" min-width="100">
</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="send_date"
width="120"
></el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="120"
>
<template #default="scope">
<el-button
link
size="small"
@click="table_edit(scope.row)"
v-auth="'mgroup.update'"
type="primary"
>编辑</el-button
>
<el-divider direction="vertical"></el-divider>
<el-popconfirm <el-popconfirm
title="确定删除吗?" title="确定删除吗?"
@confirm="table_del(scope.row, scope.$index)" @confirm="table_del(scope.row, scope.$index)"
@ -199,16 +170,27 @@ export default {
data() { data() {
return { return {
apiObj: null, apiObj: null,
query: {},
dialog: { dialog: {
save: false, save: false,
permission: false, permission: false,
}, },
params_sender: { send_mgroup: "" }, params: {
params_recive: { recive_mgroup: "" }, mgroup: "",
},
query: {
send_mgroup: "",
recive_mgroup: "",
},
typeOptions: [
{ name: "交送", value: "send" },
{ name: "接收", value: "recive" },
],
searchType: "",
options: ["交送", "接收"], options: ["交送", "接收"],
tableData: [], tableData: [],
selection: [], selection: [],
handoverItem: {},
values: "交送", values: "交送",
mtask: "", mtask: "",
mlogId: "", mlogId: "",
@ -224,12 +206,46 @@ export default {
that.mgroupId = res[0].id; that.mgroupId = res[0].id;
that.processId = res[0].process; that.processId = res[0].process;
that.processCate = res[0].process_cate; that.processCate = res[0].process_cate;
that.params_sender.send_mgroup = that.mgroupId; that.params.mgroup = that.mgroupId;
that.params_recive.recive_mgroup = that.mgroupId;
that.apiObj = that.$API.wpm.handover.list; that.apiObj = that.$API.wpm.handover.list;
}); });
}, },
methods: { methods: {
handoverPrint() {
let that = this;
let str = [
"SIZE 70 mm,90 mm",
"GAP 2 mm,0 mm",
"CLS",
"WINTEXT 50,80,36,0,0,0,Simhei,光芯科技——交接单",
'BARCODE 50,140,"128",108,0,0,3,5,"' +
that.handoverItem.id +
'"',
"WINTEXT 50,280,36,0,0,0,Simhei," +
that.handoverItem.material_name,
"WINTEXT 50,340,36,0,0,0,Simhei,批次:" +
that.handoverItem.batch,
"WINTEXT 50,400,36,0,0,0,Simhei,数量:" +
that.handoverItem.count,
"WINTEXT 50,460,36,0,0,0,Simhei,日期:" +
that.handoverItem.send_date,
"WINTEXT 50,520,36,0,0,0,Simhei,送料:" +
that.handoverItem.send_mgroup_name +
"——" +
that.handoverItem.send_user_name,
"WINTEXT 50,580,36,0,0,0,Simhei,收料:" +
that.handoverItem.recive_mgroup_name +
"——" +
that.handoverItem.recive_user_name,
"PRINT 1",
];
// -
// -
let obj = {};
obj.printer_commands = str;
obj.printer_name = "GP-3150TN";
this.$API.wpm.prints.req(obj).then((response) => {});
},
// //
table_add(type) { table_add(type) {
this.dialog.save = true; this.dialog.save = true;
@ -260,10 +276,41 @@ export default {
selectionChange(selection) { selectionChange(selection) {
this.selection = selection; this.selection = selection;
}, },
// //
handleQuery() { handleQuery() {
this.$refs.table.queryData(this.query); this.$refs.table.queryData(this.query);
}, },
searchTypeQuery() {
let that = this;
if (that.searchType == "send") {
that.query.send_mgroup = that.mgroupId;
that.query.recive_mgroup = "";
} else if (that.searchType == "recive") {
that.query.recive_mgroup = that.mgroupId;
that.query.send_mgroup = "";
} else {
that.query.send_mgroup = "";
that.query.recive_mgroup = "";
}
console.log(that.query);
this.$refs.table.queryData(that.query);
},
table_receive(row) {
//
let that = this;
that.$API.wpm.handover.submit.req(row.id).then((res) => {
that.$refs.table.queryData(that.query);
});
},
table_print(row) {
//
let that = this;
that.$API.wpm.handover.item.req(row.id).then((res) => {
that.handoverItem = res;
that.handoverPrint();
});
},
// //
// //
handleSaveSuccess(data, mode) { handleSaveSuccess(data, mode) {