fix:其他入库放开检验(半成品检验)

This commit is contained in:
shijing 2024-04-03 11:25:04 +08:00
parent 75ea25baa2
commit 52ecdb332b
2 changed files with 295 additions and 194 deletions

View File

@ -1,202 +1,298 @@
<template> <template>
<div style="padding: 8px"> <div style="padding: 8px">
<div> <div>
<el-card style="width: 100%" header="基本信息" shadow="hover"> <el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions> <el-descriptions>
<el-descriptions-item label="编号">{{ mioObj.number }}</el-descriptions-item> <el-descriptions-item label="编号">{{
<el-descriptions-item label="出入库类型">{{ typeDict[mioObj.type] }}</el-descriptions-item> mioObj.number
<el-descriptions-item label="状态">{{ stateDict[mioObj.state] }}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="部门/车间">{{ mioObj.belong_dept_name }}</el-descriptions-item> <el-descriptions-item label="出入库类型">{{
<el-descriptions-item label="执行人">{{ mioObj.do_user_name }}</el-descriptions-item> typeDict[mioObj.type]
<el-descriptions-item label="创建时间">{{ mioObj.create_time }}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="采购订单" v-if="mioObj.type=='pur_in'">{{ mioObj.order_number }}</el-descriptions-item> <el-descriptions-item label="状态">{{
<el-descriptions-item label="供应商" v-if="mioObj.type=='pur_in'">{{ mioObj.supplier_name }}</el-descriptions-item> stateDict[mioObj.state]
<el-descriptions-item label="销售订单" v-if="mioObj.type=='sale_out'">{{ mioObj.pu_order_number }}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="客户" v-if="mioObj.type=='sale_out'">{{mioObj.customer_name }}</el-descriptions-item> <el-descriptions-item label="部门/车间">{{
</el-descriptions> mioObj.belong_dept_name
<!-- <el-button type="primary" @click="mioSubmit" v-auth="'mio.submit'" v-if="mioObj.state == 10"> }}</el-descriptions-item>
<el-descriptions-item label="执行人">{{
mioObj.do_user_name
}}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{
mioObj.create_time
}}</el-descriptions-item>
<el-descriptions-item
label="采购订单"
v-if="mioObj.type == 'pur_in'"
>{{ mioObj.order_number }}</el-descriptions-item
>
<el-descriptions-item
label="供应商"
v-if="mioObj.type == 'pur_in'"
>{{ mioObj.supplier_name }}</el-descriptions-item
>
<el-descriptions-item
label="销售订单"
v-if="mioObj.type == 'sale_out'"
>{{ mioObj.pu_order_number }}</el-descriptions-item
>
<el-descriptions-item
label="客户"
v-if="mioObj.type == 'sale_out'"
>{{ mioObj.customer_name }}</el-descriptions-item
>
</el-descriptions>
<!-- <el-button type="primary" @click="mioSubmit" v-auth="'mio.submit'" v-if="mioObj.state == 10">
提交 提交
</el-button> --> </el-button> -->
</el-card> </el-card>
</div> </div>
<div style="height:8px"></div> <div style="height: 8px"></div>
<div> <div>
<el-card style="width: 100%" header="物料明细" shadow="hover"> <el-card style="width: 100%" header="物料明细" shadow="hover">
<div> <div>
<el-button type="primary" icon="el-icon-plus" @click="table_add" v-if="mioObj.state == 10">新增</el-button> <el-button
</div> type="primary"
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="params" hidePagination hideDo> icon="el-icon-plus"
<el-table-column type="index" width="50" /> @click="table_add"
<el-table-column label="物料" prop="material" show-overflow-tooltip> v-if="mioObj.state == 10"
<template #default="scope">{{ scope.row.material_name }} >新增</el-button
</template> >
</el-table-column> </div>
<el-table-column label="批次号" prop="batch"> <scTable
</el-table-column> ref="table"
<el-table-column label="仓库" prop="warehouse_name"> :apiObj="apiObj"
</el-table-column> row-key="id"
<el-table-column label="数量" prop="count"> stripe
</el-table-column> :params="params"
<el-table-column label="不合格数量" prop="count_notok"> hidePagination
</el-table-column> hideDo
<el-table-column label="创建时间" prop="create_time" show-overflow-tooltip> >
</el-table-column> <el-table-column type="index" width="50" />
<el-table-column label="操作" fixed="right" align="center" width="100px"> <el-table-column
<template #default="scope"> label="物料"
<!-- <el-link type="primary" @click="table_check(scope.row)" v-if="mioObj.state==20&&mioObj.type=='do_in'"> --> prop="material"
<el-button link type="primary" @click="table_check(scope.row)" show-overflow-tooltip
v-if="scope.row.test_date==null&&mioObj.state==20&&(type=='pur_in'||type=='do_in')" v-auth="'mioitem.test'"> >
检验 <template #default="scope"
</el-button> >{{ scope.row.material_name }}
<el-button link type="primary" @click="check_Show(scope.row)" v-if="scope.row.test_date!==null"> </template>
查看 </el-table-column>
</el-button> <el-table-column label="批次号" prop="batch">
<el-button link type="danger" @click="table_del(scope.row)" v-if="mioObj.state==10"> </el-table-column>
删除 <el-table-column label="仓库" prop="warehouse_name">
</el-button> </el-table-column>
</template> <el-table-column label="数量" prop="count">
</el-table-column> </el-table-column>
</scTable> <el-table-column label="不合格数量" prop="count_notok">
</el-card> </el-table-column>
</div> <el-table-column
</div> label="创建时间"
<save-dialog v-if="dialog.save" ref="saveDialog" prop="create_time"
:mioId="mioId" :belongDeptId="belongDeptId" show-overflow-tooltip
:belongDeptName="mioObj.belong_dept_name" >
:mioObj="mioObj" :cate="cate" </el-table-column>
@success="handleSaveSuccess" @closed="dialog.save = false"> <el-table-column
</save-dialog> label="操作"
<check-dialog v-if="dialog.check" ref="checkDialog" :mioitemId="mioitemId" fixed="right"
:cate="cate" :type="type" :objitem="objitem" align="center"
@success="handleCheckSuccess" @closed="dialog.check = false"> width="100px"
</check-dialog> >
<template #default="scope">
<!-- <el-link type="primary" @click="table_check(scope.row)" v-if="mioObj.state==20&&mioObj.type=='do_in'"> -->
<el-button
link
type="primary"
@click="table_check(scope.row)"
v-if="
scope.row.test_date == null &&
mioObj.state == 20 &&
(type == 'pur_in' ||
type == 'do_in' ||
type == 'other_in')
"
v-auth="'mioitem.test'"
>
检验
</el-button>
<el-button
link
type="primary"
@click="check_Show(scope.row)"
v-if="scope.row.test_date !== null"
>
查看
</el-button>
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-if="mioObj.state == 10"
>
删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-card>
</div>
</div>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:mioId="mioId"
:belongDeptId="belongDeptId"
:belongDeptName="mioObj.belong_dept_name"
:mioObj="mioObj"
:cate="cate"
@success="handleSaveSuccess"
@closed="dialog.save = false"
>
</save-dialog>
<check-dialog
v-if="dialog.check"
ref="checkDialog"
:mioitemId="mioitemId"
:cate="cate"
:type="type"
:objitem="objitem"
@success="handleCheckSuccess"
@closed="dialog.check = false"
>
</check-dialog>
</template> </template>
<script> <script>
import saveDialog from "./mioitem_form.vue"; import saveDialog from "./mioitem_form.vue";
import checkDialog from "./mioitem_check.vue"; import checkDialog from "./mioitem_check.vue";
export default { export default {
name: "mioitem", name: "mioitem",
components: { components: {
saveDialog,checkDialog saveDialog,
}, checkDialog,
data() { },
return { data() {
dialog: { return {
check:false, dialog: {
save: false, check: false,
}, save: false,
apiObj: null, },
params: {}, apiObj: null,
mioId: '', params: {},
mioObj: {}, mioId: "",
selection: [], mioObj: {},
stateDict: { selection: [],
10: '创建中', stateDict: {
20: '已提交' 10: "创建中",
}, 20: "已提交",
typeDict: { },
'do_out': '生产领料', typeDict: {
'sale_out': '销售发货', do_out: "生产领料",
'pur_in': '采购入库', sale_out: "销售发货",
'do_in': '生产入库', pur_in: "采购入库",
'other_in': '其他入库', do_in: "生产入库",
'other_out': '其他出库', other_in: "其他入库",
}, other_out: "其他出库",
mioitemId:'', },
type:'', mioitemId: "",
cate:'', type: "",
objitem:{}, cate: "",
}; objitem: {},
}, };
mounted() { },
this.type = this.$route.query.type; mounted() {
this.cate = this.$route.query.cate; this.type = this.$route.query.type;
this.mioId = this.$route.query.mio; this.cate = this.$route.query.cate;
this.params.mio = this.$route.query.mio; this.mioId = this.$route.query.mio;
this.apiObj = this.$API.inm.mioitem.list; this.params.mio = this.$route.query.mio;
this.getMio(); this.apiObj = this.$API.inm.mioitem.list;
}, this.getMio();
methods: { },
getMio() { methods: {
this.$API.inm.mio.item.req(this.mioId).then((res) => { getMio() {
this.mioObj = res; this.$API.inm.mio.item.req(this.mioId).then((res) => {
this.belongDeptId = res.belong_dept this.mioObj = res;
}) this.belongDeptId = res.belong_dept;
}, });
// },
table_add() { //
this.dialog.save = true; table_add() {
this.$nextTick(() => { this.dialog.save = true;
this.$refs.saveDialog.open("add", this.mioObj.type); this.$nextTick(() => {
}); this.$refs.saveDialog.open("add", this.mioObj.type);
}, });
// },
table_edit(row) { //
this.dialog.save = true; table_edit(row) {
this.$nextTick(() => { this.dialog.save = true;
this.$refs.saveDialog.open("edit").setData(row); this.$nextTick(() => {
}); this.$refs.saveDialog.open("edit").setData(row);
}, });
// },
table_show(row) { //
this.dialog.save = true; table_show(row) {
this.$nextTick(() => { this.dialog.save = true;
this.$refs.saveDialog.open("show").setData(row); this.$nextTick(() => {
}); this.$refs.saveDialog.open("show").setData(row);
}, });
// },
table_del(row) { //
this.$confirm(`确定删除吗?`, "提示", { table_del(row) {
type: "warning", this.$confirm(`确定删除吗?`, "提示", {
}).then(() => { type: "warning",
this.$API.inm.mioitem.delete.req(row.id).then((res) => { })
this.$message.success("删除成功"); .then(() => {
this.$refs.table.refresh(); this.$API.inm.mioitem.delete
return res; .req(row.id)
}).catch((err) => { .then((res) => {
return err; this.$message.success("删除成功");
}); this.$refs.table.refresh();
}).catch(() => { }); return res;
}, })
table_check(row){ .catch((err) => {
this.mioitemId = row.id; return err;
this.objitem = row; });
this.dialog.check = true; })
this.$nextTick(() => { .catch(() => {});
this.$refs.checkDialog.open("add"); },
}); table_check(row) {
}, this.mioitemId = row.id;
check_Show(row){ this.objitem = row;
this.mioitemId = row.id; this.dialog.check = true;
this.objitem = row; this.$nextTick(() => {
this.dialog.check = true; this.$refs.checkDialog.open("add");
this.$nextTick(() => { });
this.$refs.checkDialog.open("show").setData(row); },
}); check_Show(row) {
}, this.mioitemId = row.id;
// this.objitem = row;
handleSaveSuccess(data, mode) { this.dialog.check = true;
if (mode == "add") { this.$nextTick(() => {
this.$refs.table.refresh(); this.$refs.checkDialog.open("show").setData(row);
} else if (mode == "edit") { });
this.$refs.table.refresh(); },
} //
}, handleSaveSuccess(data, mode) {
handleCheckSuccess(){ if (mode == "add") {
this.$refs.table.refresh(); this.$refs.table.refresh();
}, } else if (mode == "edit") {
handleQuery() { this.$refs.table.refresh();
this.$refs.table.queryData(this.query) }
}, },
resetQuery() { handleCheckSuccess() {
this.query = {}; this.$refs.table.refresh();
}, },
mioSubmit() { handleQuery() {
this.$API.inm.mio.submit.req(this.mioObj.id).then(res => { this.$refs.table.queryData(this.query);
this.$message.success("提交成功"); },
this.mioObj = res resetQuery() {
}) this.query = {};
} },
}, mioSubmit() {
this.$API.inm.mio.submit.req(this.mioObj.id).then((res) => {
this.$message.success("提交成功");
this.mioObj = res;
});
},
},
}; };
</script> </script>

View File

@ -15,7 +15,12 @@
label-width="140px" label-width="140px"
> >
<!-- 半成品 --> <!-- 半成品 -->
<el-row v-if="type == 'do_in' && cate == 'halfgood'"> <el-row
v-if="
(type == 'do_in' && cate == 'halfgood') ||
type == 'other_in'
"
>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="检验日期" prop="test_date"> <el-form-item label="检验日期" prop="test_date">
<el-date-picker <el-date-picker