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>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="编号">{{ mioObj.number }}</el-descriptions-item>
<el-descriptions-item label="出入库类型">{{ typeDict[mioObj.type] }}</el-descriptions-item>
<el-descriptions-item label="状态">{{ stateDict[mioObj.state] }}</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-item label="编号">{{
mioObj.number
}}</el-descriptions-item>
<el-descriptions-item label="出入库类型">{{
typeDict[mioObj.type]
}}</el-descriptions-item>
<el-descriptions-item label="状态">{{
stateDict[mioObj.state]
}}</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-button type="primary" @click="mioSubmit" v-auth="'mio.submit'" v-if="mioObj.state == 10">
提交
</el-button> -->
</el-card>
</div>
<div style="height:8px"></div>
<div style="height: 8px"></div>
<div>
<el-card style="width: 100%" header="物料明细" shadow="hover">
<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>
<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 label="物料" prop="material" show-overflow-tooltip>
<template #default="scope">{{ scope.row.material_name }}
<el-table-column
label="物料"
prop="material"
show-overflow-tooltip
>
<template #default="scope"
>{{ scope.row.material_name }}
</template>
</el-table-column>
<el-table-column label="批次号" prop="batch">
@ -39,19 +86,49 @@
</el-table-column>
<el-table-column label="不合格数量" prop="count_notok">
</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 label="操作" fixed="right" align="center" width="100px">
<el-table-column
label="操作"
fixed="right"
align="center"
width="100px"
>
<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')" v-auth="'mioitem.test'">
<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
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
link
type="danger"
@click="table_del(scope.row)"
v-if="mioObj.state == 10"
>
删除
</el-button>
</template>
@ -60,15 +137,28 @@
</el-card>
</div>
</div>
<save-dialog v-if="dialog.save" ref="saveDialog"
:mioId="mioId" :belongDeptId="belongDeptId"
<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">
: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
v-if="dialog.check"
ref="checkDialog"
:mioitemId="mioitemId"
:cate="cate"
:type="type"
:objitem="objitem"
@success="handleCheckSuccess"
@closed="dialog.check = false"
>
</check-dialog>
</template>
<script>
@ -77,35 +167,36 @@ import checkDialog from "./mioitem_check.vue";
export default {
name: "mioitem",
components: {
saveDialog,checkDialog
saveDialog,
checkDialog,
},
data() {
return {
dialog: {
check:false,
check: false,
save: false,
},
apiObj: null,
params: {},
mioId: '',
mioId: "",
mioObj: {},
selection: [],
stateDict: {
10: '创建中',
20: '已提交'
10: "创建中",
20: "已提交",
},
typeDict: {
'do_out': '生产领料',
'sale_out': '销售发货',
'pur_in': '采购入库',
'do_in': '生产入库',
'other_in': '其他入库',
'other_out': '其他出库',
do_out: "生产领料",
sale_out: "销售发货",
pur_in: "采购入库",
do_in: "生产入库",
other_in: "其他入库",
other_out: "其他出库",
},
mioitemId:'',
type:'',
cate:'',
objitem:{},
mioitemId: "",
type: "",
cate: "",
objitem: {},
};
},
mounted() {
@ -120,8 +211,8 @@ mioitemId:'',
getMio() {
this.$API.inm.mio.item.req(this.mioId).then((res) => {
this.mioObj = res;
this.belongDeptId = res.belong_dept
})
this.belongDeptId = res.belong_dept;
});
},
//
table_add() {
@ -148,17 +239,22 @@ mioitemId:'',
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
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.$refs.table.refresh();
return res;
}).catch((err) => {
})
.catch((err) => {
return err;
});
}).catch(() => { });
})
.catch(() => {});
},
table_check(row){
table_check(row) {
this.mioitemId = row.id;
this.objitem = row;
this.dialog.check = true;
@ -166,7 +262,7 @@ mioitemId:'',
this.$refs.checkDialog.open("add");
});
},
check_Show(row){
check_Show(row) {
this.mioitemId = row.id;
this.objitem = row;
this.dialog.check = true;
@ -182,21 +278,21 @@ mioitemId:'',
this.$refs.table.refresh();
}
},
handleCheckSuccess(){
handleCheckSuccess() {
this.$refs.table.refresh();
},
handleQuery() {
this.$refs.table.queryData(this.query)
this.$refs.table.queryData(this.query);
},
resetQuery() {
this.query = {};
},
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.mioObj = res
})
}
this.mioObj = res;
});
},
},
};
</script>

View File

@ -15,7 +15,12 @@
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-form-item label="检验日期" prop="test_date">
<el-date-picker