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

@ -3,32 +3,79 @@
<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="部门/车间">{{
mioObj.belong_dept_name
}}</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-descriptions>
<!-- <el-button type="primary" @click="mioSubmit" v-auth="'mio.submit'" v-if="mioObj.state == 10"> <!-- <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
type="primary"
icon="el-icon-plus"
@click="table_add"
v-if="mioObj.state == 10"
>新增</el-button
>
</div> </div>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="params" hidePagination hideDo> <scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
hidePagination
hideDo
>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="物料" prop="material" show-overflow-tooltip> <el-table-column
<template #default="scope">{{ scope.row.material_name }} label="物料"
prop="material"
show-overflow-tooltip
>
<template #default="scope"
>{{ scope.row.material_name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="批次号" prop="batch"> <el-table-column label="批次号" prop="batch">
@ -39,19 +86,49 @@
</el-table-column> </el-table-column>
<el-table-column label="不合格数量" prop="count_notok"> <el-table-column label="不合格数量" prop="count_notok">
</el-table-column> </el-table-column>
<el-table-column label="创建时间" prop="create_time" show-overflow-tooltip> <el-table-column
label="创建时间"
prop="create_time"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="100px"> <el-table-column
label="操作"
fixed="right"
align="center"
width="100px"
>
<template #default="scope"> <template #default="scope">
<!-- <el-link type="primary" @click="table_check(scope.row)" v-if="mioObj.state==20&&mioObj.type=='do_in'"> --> <!-- <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)" <el-button
v-if="scope.row.test_date==null&&mioObj.state==20&&(type=='pur_in'||type=='do_in')" v-auth="'mioitem.test'"> 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>
<el-button link type="primary" @click="check_Show(scope.row)" v-if="scope.row.test_date!==null"> <el-button
link
type="primary"
@click="check_Show(scope.row)"
v-if="scope.row.test_date !== null"
>
查看 查看
</el-button> </el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-if="mioObj.state==10"> <el-button
link
type="danger"
@click="table_del(scope.row)"
v-if="mioObj.state == 10"
>
删除 删除
</el-button> </el-button>
</template> </template>
@ -60,15 +137,28 @@
</el-card> </el-card>
</div> </div>
</div> </div>
<save-dialog v-if="dialog.save" ref="saveDialog" <save-dialog
:mioId="mioId" :belongDeptId="belongDeptId" v-if="dialog.save"
ref="saveDialog"
:mioId="mioId"
:belongDeptId="belongDeptId"
:belongDeptName="mioObj.belong_dept_name" :belongDeptName="mioObj.belong_dept_name"
:mioObj="mioObj" :cate="cate" :mioObj="mioObj"
@success="handleSaveSuccess" @closed="dialog.save = false"> :cate="cate"
@success="handleSaveSuccess"
@closed="dialog.save = false"
>
</save-dialog> </save-dialog>
<check-dialog v-if="dialog.check" ref="checkDialog" :mioitemId="mioitemId" <check-dialog
:cate="cate" :type="type" :objitem="objitem" v-if="dialog.check"
@success="handleCheckSuccess" @closed="dialog.check = false"> ref="checkDialog"
:mioitemId="mioitemId"
:cate="cate"
:type="type"
:objitem="objitem"
@success="handleCheckSuccess"
@closed="dialog.check = false"
>
</check-dialog> </check-dialog>
</template> </template>
<script> <script>
@ -77,35 +167,36 @@ import checkDialog from "./mioitem_check.vue";
export default { export default {
name: "mioitem", name: "mioitem",
components: { components: {
saveDialog,checkDialog saveDialog,
checkDialog,
}, },
data() { data() {
return { return {
dialog: { dialog: {
check:false, check: false,
save: false, save: false,
}, },
apiObj: null, apiObj: null,
params: {}, params: {},
mioId: '', mioId: "",
mioObj: {}, mioObj: {},
selection: [], selection: [],
stateDict: { stateDict: {
10: '创建中', 10: "创建中",
20: '已提交' 20: "已提交",
}, },
typeDict: { typeDict: {
'do_out': '生产领料', do_out: "生产领料",
'sale_out': '销售发货', sale_out: "销售发货",
'pur_in': '采购入库', pur_in: "采购入库",
'do_in': '生产入库', do_in: "生产入库",
'other_in': '其他入库', other_in: "其他入库",
'other_out': '其他出库', other_out: "其他出库",
}, },
mioitemId:'', mioitemId: "",
type:'', type: "",
cate:'', cate: "",
objitem:{}, objitem: {},
}; };
}, },
mounted() { mounted() {
@ -120,8 +211,8 @@ mioitemId:'',
getMio() { getMio() {
this.$API.inm.mio.item.req(this.mioId).then((res) => { this.$API.inm.mio.item.req(this.mioId).then((res) => {
this.mioObj = res; this.mioObj = res;
this.belongDeptId = res.belong_dept this.belongDeptId = res.belong_dept;
}) });
}, },
// //
table_add() { table_add() {
@ -148,17 +239,22 @@ mioitemId:'',
table_del(row) { table_del(row) {
this.$confirm(`确定删除吗?`, "提示", { this.$confirm(`确定删除吗?`, "提示", {
type: "warning", type: "warning",
}).then(() => { })
this.$API.inm.mioitem.delete.req(row.id).then((res) => { .then(() => {
this.$API.inm.mioitem.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功"); this.$message.success("删除成功");
this.$refs.table.refresh(); this.$refs.table.refresh();
return res; return res;
}).catch((err) => { })
.catch((err) => {
return err; return err;
}); });
}).catch(() => { }); })
.catch(() => {});
}, },
table_check(row){ table_check(row) {
this.mioitemId = row.id; this.mioitemId = row.id;
this.objitem = row; this.objitem = row;
this.dialog.check = true; this.dialog.check = true;
@ -166,7 +262,7 @@ mioitemId:'',
this.$refs.checkDialog.open("add"); this.$refs.checkDialog.open("add");
}); });
}, },
check_Show(row){ check_Show(row) {
this.mioitemId = row.id; this.mioitemId = row.id;
this.objitem = row; this.objitem = row;
this.dialog.check = true; this.dialog.check = true;
@ -182,21 +278,21 @@ mioitemId:'',
this.$refs.table.refresh(); this.$refs.table.refresh();
} }
}, },
handleCheckSuccess(){ handleCheckSuccess() {
this.$refs.table.refresh(); this.$refs.table.refresh();
}, },
handleQuery() { handleQuery() {
this.$refs.table.queryData(this.query) this.$refs.table.queryData(this.query);
}, },
resetQuery() { resetQuery() {
this.query = {}; this.query = {};
}, },
mioSubmit() { mioSubmit() {
this.$API.inm.mio.submit.req(this.mioObj.id).then(res => { this.$API.inm.mio.submit.req(this.mioObj.id).then((res) => {
this.$message.success("提交成功"); this.$message.success("提交成功");
this.mioObj = res 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