fix:其他入库放开检验(半成品检验)
This commit is contained in:
parent
75ea25baa2
commit
52ecdb332b
|
@ -1,202 +1,298 @@
|
|||
<template>
|
||||
<div style="padding: 8px">
|
||||
<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>
|
||||
<!-- <el-button type="primary" @click="mioSubmit" v-auth="'mio.submit'" v-if="mioObj.state == 10">
|
||||
<div style="padding: 8px">
|
||||
<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>
|
||||
<!-- <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>
|
||||
<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>
|
||||
</div>
|
||||
<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 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批次号" prop="batch">
|
||||
</el-table-column>
|
||||
<el-table-column label="仓库" prop="warehouse_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="count">
|
||||
</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>
|
||||
<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>
|
||||
<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>
|
||||
</el-card>
|
||||
</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
|
||||
>
|
||||
</div>
|
||||
<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 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批次号" prop="batch">
|
||||
</el-table-column>
|
||||
<el-table-column label="仓库" prop="warehouse_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="count">
|
||||
</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>
|
||||
<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' ||
|
||||
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>
|
||||
<script>
|
||||
import saveDialog from "./mioitem_form.vue";
|
||||
import checkDialog from "./mioitem_check.vue";
|
||||
export default {
|
||||
name: "mioitem",
|
||||
components: {
|
||||
saveDialog,checkDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialog: {
|
||||
check:false,
|
||||
save: false,
|
||||
},
|
||||
apiObj: null,
|
||||
params: {},
|
||||
mioId: '',
|
||||
mioObj: {},
|
||||
selection: [],
|
||||
stateDict: {
|
||||
10: '创建中',
|
||||
20: '已提交'
|
||||
},
|
||||
typeDict: {
|
||||
'do_out': '生产领料',
|
||||
'sale_out': '销售发货',
|
||||
'pur_in': '采购入库',
|
||||
'do_in': '生产入库',
|
||||
'other_in': '其他入库',
|
||||
'other_out': '其他出库',
|
||||
},
|
||||
mioitemId:'',
|
||||
type:'',
|
||||
cate:'',
|
||||
objitem:{},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.type = this.$route.query.type;
|
||||
this.cate = this.$route.query.cate;
|
||||
this.mioId = this.$route.query.mio;
|
||||
this.params.mio = this.$route.query.mio;
|
||||
this.apiObj = this.$API.inm.mioitem.list;
|
||||
this.getMio();
|
||||
},
|
||||
methods: {
|
||||
getMio() {
|
||||
this.$API.inm.mio.item.req(this.mioId).then((res) => {
|
||||
this.mioObj = res;
|
||||
this.belongDeptId = res.belong_dept
|
||||
})
|
||||
},
|
||||
//添加
|
||||
table_add() {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("add", this.mioObj.type);
|
||||
});
|
||||
},
|
||||
//编辑
|
||||
table_edit(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("edit").setData(row);
|
||||
});
|
||||
},
|
||||
//查看
|
||||
table_show(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("show").setData(row);
|
||||
});
|
||||
},
|
||||
//删除
|
||||
table_del(row) {
|
||||
this.$confirm(`确定删除吗?`, "提示", {
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
this.$API.inm.mioitem.delete.req(row.id).then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
this.$refs.table.refresh();
|
||||
return res;
|
||||
}).catch((err) => {
|
||||
return err;
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
table_check(row){
|
||||
this.mioitemId = row.id;
|
||||
this.objitem = row;
|
||||
this.dialog.check = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.checkDialog.open("add");
|
||||
});
|
||||
},
|
||||
check_Show(row){
|
||||
this.mioitemId = row.id;
|
||||
this.objitem = row;
|
||||
this.dialog.check = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.checkDialog.open("show").setData(row);
|
||||
});
|
||||
},
|
||||
//本地更新数据
|
||||
handleSaveSuccess(data, mode) {
|
||||
if (mode == "add") {
|
||||
this.$refs.table.refresh();
|
||||
} else if (mode == "edit") {
|
||||
this.$refs.table.refresh();
|
||||
}
|
||||
},
|
||||
handleCheckSuccess(){
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query)
|
||||
},
|
||||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
mioSubmit() {
|
||||
this.$API.inm.mio.submit.req(this.mioObj.id).then(res => {
|
||||
this.$message.success("提交成功");
|
||||
this.mioObj = res
|
||||
})
|
||||
}
|
||||
},
|
||||
name: "mioitem",
|
||||
components: {
|
||||
saveDialog,
|
||||
checkDialog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialog: {
|
||||
check: false,
|
||||
save: false,
|
||||
},
|
||||
apiObj: null,
|
||||
params: {},
|
||||
mioId: "",
|
||||
mioObj: {},
|
||||
selection: [],
|
||||
stateDict: {
|
||||
10: "创建中",
|
||||
20: "已提交",
|
||||
},
|
||||
typeDict: {
|
||||
do_out: "生产领料",
|
||||
sale_out: "销售发货",
|
||||
pur_in: "采购入库",
|
||||
do_in: "生产入库",
|
||||
other_in: "其他入库",
|
||||
other_out: "其他出库",
|
||||
},
|
||||
mioitemId: "",
|
||||
type: "",
|
||||
cate: "",
|
||||
objitem: {},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.type = this.$route.query.type;
|
||||
this.cate = this.$route.query.cate;
|
||||
this.mioId = this.$route.query.mio;
|
||||
this.params.mio = this.$route.query.mio;
|
||||
this.apiObj = this.$API.inm.mioitem.list;
|
||||
this.getMio();
|
||||
},
|
||||
methods: {
|
||||
getMio() {
|
||||
this.$API.inm.mio.item.req(this.mioId).then((res) => {
|
||||
this.mioObj = res;
|
||||
this.belongDeptId = res.belong_dept;
|
||||
});
|
||||
},
|
||||
//添加
|
||||
table_add() {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("add", this.mioObj.type);
|
||||
});
|
||||
},
|
||||
//编辑
|
||||
table_edit(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("edit").setData(row);
|
||||
});
|
||||
},
|
||||
//查看
|
||||
table_show(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("show").setData(row);
|
||||
});
|
||||
},
|
||||
//删除
|
||||
table_del(row) {
|
||||
this.$confirm(`确定删除吗?`, "提示", {
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$API.inm.mioitem.delete
|
||||
.req(row.id)
|
||||
.then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
this.$refs.table.refresh();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
table_check(row) {
|
||||
this.mioitemId = row.id;
|
||||
this.objitem = row;
|
||||
this.dialog.check = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.checkDialog.open("add");
|
||||
});
|
||||
},
|
||||
check_Show(row) {
|
||||
this.mioitemId = row.id;
|
||||
this.objitem = row;
|
||||
this.dialog.check = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.checkDialog.open("show").setData(row);
|
||||
});
|
||||
},
|
||||
//本地更新数据
|
||||
handleSaveSuccess(data, mode) {
|
||||
if (mode == "add") {
|
||||
this.$refs.table.refresh();
|
||||
} else if (mode == "edit") {
|
||||
this.$refs.table.refresh();
|
||||
}
|
||||
},
|
||||
handleCheckSuccess() {
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
},
|
||||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
mioSubmit() {
|
||||
this.$API.inm.mio.submit.req(this.mioObj.id).then((res) => {
|
||||
this.$message.success("提交成功");
|
||||
this.mioObj = res;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue