fix:辅料出入库记录添加生产领料

This commit is contained in:
shijing 2024-04-08 14:22:47 +08:00
parent 3f315818c6
commit d0fef8aa15
1 changed files with 220 additions and 149 deletions

View File

@ -1,156 +1,227 @@
<template> <template>
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" @click="add('pur_in')" v-auth="'mio.pur'">采购入库</el-button> <el-button
<el-select v-model="query.type" clearable style="width: 120px; margin-left: 2px" placeholder="出入库类型" type="primary"
@change="handleQuery"> @click="add('do_out')"
<el-option v-for="item in cateOptions" :key="item.id" :label="item.name" :value="item.id"></el-option> v-auth="'mio.do'"
</el-select> >生产领料</el-button
<el-select v-model="query.state" clearable style="width: 120px; margin-left: 2px" placeholder="状态" >
@change="handleQuery"> <el-button
<el-option v-for="item in stateOptions" :key="item.id" :label="item.name" :value="item.id"></el-option> type="primary"
</el-select> @click="add('pur_in')"
</div> v-auth="'mio.pur'"
<div class="right-panel"> >采购入库</el-button
<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> <el-select
</div> v-model="query.type"
</el-header> clearable
<el-main class="nopadding"> style="width: 120px; margin-left: 2px"
<scTable ref="table" :apiObj="apiObj" row-key="id" :params="params" :query="query" stripe> placeholder="出入库类型"
<el-table-column type="index" width="50" /> @change="handleQuery"
<el-table-column label="记录编号" prop="number"></el-table-column> >
<el-table-column label="出/入库类型"> <el-option
<template #default="scope"> v-for="item in cateOptions"
{{ typeDict[scope.row.type] }} :key="item.id"
</template> :label="item.name"
</el-table-column> :value="item.id"
<el-table-column label="记录状态"> ></el-option>
<template #default="scope"> </el-select>
{{ stateDict[scope.row.state] }} <el-select
</template> v-model="query.state"
</el-table-column> clearable
<el-table-column label="出/入库日期" prop="inout_date"> style="width: 120px; margin-left: 2px"
</el-table-column> placeholder="状态"
<el-table-column label="执行车间" prop="belong_dept_name"> @change="handleQuery"
</el-table-column> >
<el-table-column label="创建人" prop="create_by_name"> <el-option
</el-table-column> v-for="item in stateOptions"
<el-table-column label="创建时间" prop="create_time"> :key="item.id"
</el-table-column> :label="item.name"
<el-table-column label="操作" fixed="right" align="center" width="150px"> :value="item.id"
<template #default="scope"> ></el-option>
<el-button link type="primary" @click="table_detail(scope.row)"> </el-select>
查看 </div>
</el-button> <div class="right-panel">
<el-button link type="primary" @click="table_submit(scope.row)" v-auth="'mio.submit'" <el-input
v-if="scope.row.state == 10"> v-model="query.search"
提交 placeholder="编号"
</el-button> clearable
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'mio.delete'" style="margin-right: 5px"
v-if="scope.row.state == 10"> ></el-input>
删除 <el-button
</el-button> type="primary"
</template> icon="el-icon-search"
</el-table-column> @click="handleQuery"
</scTable> ></el-button>
</el-main> </div>
</el-container> </el-header>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" <el-main class="nopadding">
@closed="dialog.save = false"></save-dialog> <scTable
ref="table"
:apiObj="apiObj"
row-key="id"
:params="params"
:query="query"
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">
</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>
</template> </template>
<script> <script>
import saveDialog from "./mio_form.vue"; import saveDialog from "./mio_form.vue";
export default { export default {
name: "mio", name: "mio",
components: { components: {
saveDialog saveDialog,
}, },
data() { data() {
return { return {
stateDict: { stateDict: {
10: '创建中', 10: "创建中",
20: '已提交' 20: "已提交",
}, },
stateOptions: [ stateOptions: [
{ id: 10, name: '创建中' }, { id: 10, name: "创建中" },
{ id: 20, name: '已提交' }, { id: 20, name: "已提交" },
], ],
typeDict: { 'pur_in': '采购入库' }, typeDict: { pur_in: "采购入库" },
cateOptions: [ cateOptions: [{ id: "pur_in", name: "采购入库" }],
{ id: 'pur_in', name: '采购入库' } dialog: {
], save: false,
dialog: { },
save: false, query: {},
}, params: {
query: { type__in: "pur_in",
materials__type__in: "40, 50, 60, 70",
}, },
params: { form: {},
type__in: 'pur_in', apiObj: this.$API.inm.mio.list,
materials__type__in: '40, 50, 60, 70' selection: [],
}, };
form: { },
methods: {
}, //
apiObj: this.$API.inm.mio.list, add(type) {
selection: [], this.dialog.save = true;
}; this.$nextTick(() => {
}, this.$refs.saveDialog.open("add", type);
methods: { });
// },
add(type) { //
this.dialog.save = true; table_edit(row) {
this.$nextTick(() => { this.dialog.save = true;
this.$refs.saveDialog.open("add", type); this.$nextTick(() => {
}); this.$refs.saveDialog.open("edit", type).setData(row);
}, });
// },
table_edit(row) { //
this.dialog.save = true; table_detail(row) {
this.$nextTick(() => { this.$router.push({
this.$refs.saveDialog.open("edit", type).setData(row); name: "mioitem",
}); query: { mio: row.id, type: row.type, cate: "helpso" },
}, });
// },
table_detail(row) { //
this.$router.push({ table_del(row) {
name: "mioitem", this.$confirm(`确定删除吗?`, "提示", {
query: { mio: row.id, type: row.type, cate: 'helpso' } type: "warning",
})
}); .then(() => {
}, this.$API.inm.mio.delete
// .req(row.id)
table_del(row) { .then((res) => {
this.$confirm(`确定删除吗?`, "提示", { this.$message.success("删除成功");
type: "warning", this.$refs.table.refresh();
}).then(() => { return res;
this.$API.inm.mio.delete.req(row.id).then((res) => { })
this.$message.success("删除成功"); .catch((err) => {
this.$refs.table.refresh(); return err;
return res; });
}).catch((err) => { })
return err; .catch(() => {});
}); },
}).catch(() => { }); table_submit(row) {
}, this.$API.inm.mio.submit.req(row.id).then((res) => {
table_submit(row) { this.$message.success("提交成功");
this.$API.inm.mio.submit.req(row.id).then(res => { this.$refs.table.refresh();
this.$message.success("提交成功"); });
this.$refs.table.refresh() },
}) handleQuery() {
}, this.$refs.table.queryData(this.query);
handleQuery() { },
this.$refs.table.queryData(this.query) resetQuery() {
}, this.query = {};
resetQuery() { },
this.query = {}; handleSaveSuccess() {
}, this.$refs.table.refresh();
handleSaveSuccess() { },
this.$refs.table.refresh() },
}
},
}; };
</script> </script>