fix:添加车间出入库记录中间页
This commit is contained in:
parent
b69038d369
commit
1a291c6a2e
|
@ -1851,6 +1851,24 @@ const routes = [
|
|||
},
|
||||
component: "inm/mioitem",
|
||||
},
|
||||
{
|
||||
name: "workshop",
|
||||
path: "/inm/workshop",
|
||||
meta: {
|
||||
title: "车间库存",
|
||||
hidden: true,
|
||||
},
|
||||
component: "inm/workshop",
|
||||
},
|
||||
{
|
||||
name: "workshop_mio",
|
||||
path: "/inm/workshop_mio",
|
||||
meta: {
|
||||
title: "车间出入库记录",
|
||||
hidden: true,
|
||||
},
|
||||
component: "inm/workshop_mio",
|
||||
},
|
||||
],
|
||||
},
|
||||
//采购 pum
|
||||
|
|
|
@ -0,0 +1,105 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-select
|
||||
v-model="query.mgroup"
|
||||
clearable
|
||||
placeholder="所在工段"
|
||||
@change="handleQuery"
|
||||
style="margin-left: 10px; width: 150px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in mgroupOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
placeholder="物料名/批次号"
|
||||
clearable
|
||||
style="margin-right: 5px"
|
||||
></el-input>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable
|
||||
ref="table_wm"
|
||||
:apiObj="apiObjWm"
|
||||
row-key="id"
|
||||
:params="paramsWm"
|
||||
stripe
|
||||
>
|
||||
<el-table-column label="批次" prop="batch">
|
||||
</el-table-column>
|
||||
<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="belong_dept_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="count" width="80">
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "halfgood",
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.inm.warehouse.batch,
|
||||
params: { count__gte: 1, material__type: 10 },
|
||||
selection: [],
|
||||
query: {},
|
||||
mgroupOptions: [],
|
||||
apiObjWm: this.$API.wpm.wmaterial.list,
|
||||
paramsWm: { count__gte: 1, material__type: 10 },
|
||||
queryWm: {},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getMgroup();
|
||||
},
|
||||
methods: {
|
||||
getMgroup() {
|
||||
let that = this;
|
||||
this.$API.mtm.mgroup.list.req({ page: 0 }).then((res) => {
|
||||
this.mgroupOptions = res;
|
||||
});
|
||||
},
|
||||
getProcessOptions() {
|
||||
this.$API.mtm.process.list.req({ page: 0 }).then((res) => {
|
||||
this.processOptions = res;
|
||||
});
|
||||
},
|
||||
handleQueryWm() {
|
||||
this.$refs.table_wm.queryData(this.queryWm);
|
||||
},
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
},
|
||||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,254 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="add('do_in')"
|
||||
v-auth="'mio.do'"
|
||||
>生产入库</el-button
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="add('sale_out')"
|
||||
v-auth="'mio.sale'"
|
||||
>销售发货</el-button
|
||||
>
|
||||
<el-select
|
||||
v-model="query.type"
|
||||
clearable
|
||||
style="width: 120px; margin-left: 2px"
|
||||
placeholder="出入库类型"
|
||||
@change="handleQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in cateOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="query.state"
|
||||
clearable
|
||||
style="width: 120px; margin-left: 2px"
|
||||
placeholder="状态"
|
||||
@change="handleQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in stateOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
placeholder="编号"
|
||||
clearable
|
||||
style="margin-right: 5px"
|
||||
></el-input>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable
|
||||
ref="table"
|
||||
:apiObj="apiObj"
|
||||
:params="params"
|
||||
:query="query"
|
||||
row-key="id"
|
||||
stripe
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column
|
||||
label="记录编号"
|
||||
prop="number"
|
||||
></el-table-column>
|
||||
<el-table-column label="出/入库类型">
|
||||
<template #default="scope">
|
||||
{{ typeDict[scope.row.type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="记录状态">
|
||||
<template #default="scope">
|
||||
{{ stateDict[scope.row.state] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="出/入库日期" prop="inout_date">
|
||||
</el-table-column>
|
||||
<el-table-column label="执行部门" prop="belong_dept_name">
|
||||
<template #default="scope">
|
||||
{{ scope.row.belong_dept_name }} - {{ scope.row.mgroup_name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建人" prop="create_by_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="create_time">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
fixed="right"
|
||||
align="center"
|
||||
width="150px"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="table_detail(scope.row)"
|
||||
>
|
||||
查看
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="table_submit(scope.row)"
|
||||
v-auth="'mio.submit'"
|
||||
v-if="scope.row.state == 10"
|
||||
>
|
||||
提交
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="table_del(scope.row)"
|
||||
v-auth="'mio.delete'"
|
||||
v-if="scope.row.state == 10"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
<save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
></save-dialog>
|
||||
<record-dialog
|
||||
ref="showDrawer"
|
||||
v-if="visibleDrawer"
|
||||
:type="type"
|
||||
:cate="cate"
|
||||
:mioId="mioId"
|
||||
@closed="visibleDrawer = false"
|
||||
>
|
||||
</record-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import saveDialog from "./mio_form.vue";
|
||||
import recordDialog from "./mioitem.vue";
|
||||
|
||||
export default {
|
||||
name: "mio",
|
||||
components: {
|
||||
saveDialog,
|
||||
recordDialog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
stateDict: {
|
||||
10: "创建中",
|
||||
20: "已提交",
|
||||
},
|
||||
stateOptions: [
|
||||
{ id: 10, name: "创建中" },
|
||||
{ id: 20, name: "已提交" },
|
||||
],
|
||||
typeDict: {
|
||||
sale_out: "销售发货",
|
||||
do_in: "生产入库",
|
||||
},
|
||||
cateOptions: [
|
||||
{ id: "sale_out", name: "销售发货" },
|
||||
{ id: "do_in", name: "生产入库" },
|
||||
],
|
||||
dialog: {
|
||||
save: false,
|
||||
record: false,
|
||||
},
|
||||
query: {},
|
||||
params: {
|
||||
type__in: "sale_out,do_in",
|
||||
materials__type: 10,
|
||||
},
|
||||
form: {},
|
||||
apiObj: this.$API.inm.mio.list,
|
||||
selection: [],
|
||||
type: "",
|
||||
cate: "good",
|
||||
mioId: "",
|
||||
visibleDrawer: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//添加
|
||||
add(type) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("add", type);
|
||||
});
|
||||
},
|
||||
//编辑
|
||||
table_edit(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("edit", type).setData(row);
|
||||
});
|
||||
},
|
||||
//查看
|
||||
table_detail(row) {
|
||||
this.type = row.type;
|
||||
this.mioId = row.id;
|
||||
this.visibleDrawer = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.showDrawer.open();
|
||||
});
|
||||
},
|
||||
//删除
|
||||
table_del(row) {
|
||||
this.$confirm(`确定删除吗?`, "提示", {
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$API.inm.mio.delete
|
||||
.req(row.id)
|
||||
.then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
this.$refs.table.refresh();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
table_submit(row) {
|
||||
this.$API.inm.mio.submit.req(row.id).then((res) => {
|
||||
this.$message.success("提交成功");
|
||||
this.$refs.table.refresh();
|
||||
});
|
||||
},
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
},
|
||||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
handleSaveSuccess() {
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue