fix:交接记录
This commit is contained in:
parent
2c5bd1d103
commit
1b6cf9a66b
|
@ -5,7 +5,7 @@
|
|||
<el-input
|
||||
style="margin-right: 5px"
|
||||
v-model="query.search"
|
||||
placeholder="产品名称"
|
||||
placeholder="工序名称"
|
||||
clearable
|
||||
></el-input>
|
||||
<el-button
|
||||
|
@ -154,7 +154,7 @@ export default {
|
|||
this.$refs.saveDialog.open("edit").setData(row);
|
||||
});
|
||||
},
|
||||
//删除产品
|
||||
//删除
|
||||
async roleDel(row) {
|
||||
var id = row.id;
|
||||
var res = await this.$API.mtm.process.delete.req(id);
|
||||
|
|
|
@ -59,21 +59,11 @@
|
|||
></el-table-column>
|
||||
<el-table-column label="产品" prop="material_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="state"> </el-table-column>
|
||||
<el-table-column label="审批状态">
|
||||
<template #default="scope">
|
||||
<span
|
||||
v-if="scope.row.ticket_ && scope.row.ticket_.state_"
|
||||
style="margin-right: 5px"
|
||||
>{{ 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> -->
|
||||
<el-tag :type="getType(scope.row.state)">
|
||||
{{ state_[scope.row.state] }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
|
@ -181,14 +171,14 @@ export default {
|
|||
value: 20,
|
||||
},
|
||||
{
|
||||
label: "已完成",
|
||||
label: "已确认",
|
||||
value: 30,
|
||||
},
|
||||
],
|
||||
state_: {
|
||||
10: "创建中",
|
||||
20: "审批中",
|
||||
30: "已关闭",
|
||||
30: "已确认",
|
||||
},
|
||||
filterType: "all",
|
||||
};
|
||||
|
@ -198,6 +188,15 @@ export default {
|
|||
this.userId = userInfo.id;
|
||||
},
|
||||
methods: {
|
||||
getType(state) {
|
||||
if (state == 10) {
|
||||
return "warning";
|
||||
} else if (state == 20) {
|
||||
return "primary";
|
||||
} else if (state == 30) {
|
||||
return "success";
|
||||
}
|
||||
},
|
||||
//添加
|
||||
add() {
|
||||
this.dialog.save = true;
|
||||
|
|
|
@ -109,6 +109,8 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="工时" prop="hour_work">
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" prop="sort">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
fixed="right"
|
||||
|
@ -116,6 +118,13 @@
|
|||
width="200"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
text
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="table_edit(scope.row)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-popconfirm
|
||||
title="确定删除该工序吗?"
|
||||
@confirm="delWorker(scope.row)"
|
||||
|
@ -259,7 +268,9 @@ export default {
|
|||
},
|
||||
table_edit(row) {
|
||||
this.dialog.save = true;
|
||||
this.$refs.saveDialog.open("edit").setData(row);
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("edit").setData(row);
|
||||
});
|
||||
},
|
||||
productClick(data) {
|
||||
let materialId = this.selectedProduct.id;
|
||||
|
@ -276,11 +287,12 @@ export default {
|
|||
submitOut() {},
|
||||
//删除工序步骤
|
||||
delWorker(row) {
|
||||
this.$API.delete
|
||||
let that = this;
|
||||
that.$API.mtm.route.delete
|
||||
.req(row.id)
|
||||
.then((res) => {
|
||||
this.$message.success("工序步骤删除成功");
|
||||
this.getmemberList();
|
||||
that.$message.success("工序步骤删除成功");
|
||||
that.$refs.tables.refresh();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-header>
|
||||
<!-- <el-header>
|
||||
<el-segmented
|
||||
v-model="values"
|
||||
:options="options"
|
||||
size="default"
|
||||
></el-segmented>
|
||||
</el-header>
|
||||
</el-header> -->
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
|
@ -25,11 +25,26 @@
|
|||
>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-input
|
||||
style="margin-right: 5px"
|
||||
v-model="query.search"
|
||||
placeholder="名称"
|
||||
<el-select
|
||||
v-model="searchType"
|
||||
placeholder="交接类型"
|
||||
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-button
|
||||
type="primary"
|
||||
|
@ -40,11 +55,11 @@
|
|||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable
|
||||
v-if="values == '交送'"
|
||||
ref="table"
|
||||
:apiObj="apiObj"
|
||||
row-key="id"
|
||||
:params="params_sender"
|
||||
:params="params"
|
||||
:query="query"
|
||||
>
|
||||
<el-table-column
|
||||
label="#"
|
||||
|
@ -76,84 +91,40 @@
|
|||
label="操作"
|
||||
fixed="right"
|
||||
align="center"
|
||||
width="120"
|
||||
width="140"
|
||||
>
|
||||
<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
|
||||
link
|
||||
size="small"
|
||||
@click="table_edit(scope.row)"
|
||||
v-auth="'mgroup.update'"
|
||||
type="primary"
|
||||
v-if="
|
||||
scope.row.send_mgroup == mgroupId &&
|
||||
scope.row.submit_time == null
|
||||
"
|
||||
>编辑</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
|
||||
title="确定删除吗?"
|
||||
@confirm="table_del(scope.row, scope.$index)"
|
||||
|
@ -199,16 +170,27 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
apiObj: null,
|
||||
query: {},
|
||||
|
||||
dialog: {
|
||||
save: false,
|
||||
permission: false,
|
||||
},
|
||||
params_sender: { send_mgroup: "" },
|
||||
params_recive: { recive_mgroup: "" },
|
||||
params: {
|
||||
mgroup: "",
|
||||
},
|
||||
query: {
|
||||
send_mgroup: "",
|
||||
recive_mgroup: "",
|
||||
},
|
||||
typeOptions: [
|
||||
{ name: "交送", value: "send" },
|
||||
{ name: "接收", value: "recive" },
|
||||
],
|
||||
searchType: "",
|
||||
options: ["交送", "接收"],
|
||||
tableData: [],
|
||||
selection: [],
|
||||
handoverItem: {},
|
||||
values: "交送",
|
||||
mtask: "",
|
||||
mlogId: "",
|
||||
|
@ -224,12 +206,46 @@ export default {
|
|||
that.mgroupId = res[0].id;
|
||||
that.processId = res[0].process;
|
||||
that.processCate = res[0].process_cate;
|
||||
that.params_sender.send_mgroup = that.mgroupId;
|
||||
that.params_recive.recive_mgroup = that.mgroupId;
|
||||
that.params.mgroup = that.mgroupId;
|
||||
that.apiObj = that.$API.wpm.handover.list;
|
||||
});
|
||||
},
|
||||
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) {
|
||||
this.dialog.save = true;
|
||||
|
@ -260,10 +276,41 @@ export default {
|
|||
selectionChange(selection) {
|
||||
this.selection = selection;
|
||||
},
|
||||
|
||||
//搜索
|
||||
handleQuery() {
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue