fix:车间库存报废,在库存管理里查看
This commit is contained in:
parent
2eca64bf93
commit
408f83436c
|
|
@ -1869,6 +1869,15 @@ const routes = [
|
||||||
},
|
},
|
||||||
component: "inm/workshop_mio",
|
component: "inm/workshop_mio",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "inmScrap",
|
||||||
|
path: "/inm/inmScrap",
|
||||||
|
meta: {
|
||||||
|
title: "废品库",
|
||||||
|
perms: ["inmScrap"],
|
||||||
|
},
|
||||||
|
component: "inm/inmScrap",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
//采购 pum
|
//采购 pum
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,214 @@
|
||||||
|
<template>
|
||||||
|
<el-container>
|
||||||
|
<el-header>
|
||||||
|
<!-- <div class="left-panel">
|
||||||
|
<el-button type="primary" v-auth="'handover.create'" @click="table_add(40)">
|
||||||
|
报废</el-button>
|
||||||
|
</div> -->
|
||||||
|
<div class="right-panel">
|
||||||
|
<!-- <el-button type="primary" @click="materialsChoses('wm')"
|
||||||
|
>选择物料</el-button
|
||||||
|
> -->
|
||||||
|
<!-- <el-select
|
||||||
|
v-model="query.mgroupx"
|
||||||
|
placeholder="工段"
|
||||||
|
clearable
|
||||||
|
@change="handleQuery"
|
||||||
|
style="width: 250px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select> -->
|
||||||
|
<el-input
|
||||||
|
style="margin-right: 5px;width: 250px"
|
||||||
|
v-model="query.search"
|
||||||
|
placeholder="名称"
|
||||||
|
clearable
|
||||||
|
></el-input>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleQuery"
|
||||||
|
></el-button>
|
||||||
|
</div>
|
||||||
|
</el-header>
|
||||||
|
<el-main class="nopadding">
|
||||||
|
<scTable
|
||||||
|
ref="table"
|
||||||
|
:apiObj="apiObj"
|
||||||
|
row-key="id"
|
||||||
|
:params="params"
|
||||||
|
:query="query"
|
||||||
|
>
|
||||||
|
<el-table-column label="状态" prop="state" width="100" >
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tag :type="wmState[scope.row.state]?.type">
|
||||||
|
{{wmState[scope.row.state]?.text}}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="物料名称"
|
||||||
|
prop="material_name"
|
||||||
|
min-width="150"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
{{ scope.row.material_name }}
|
||||||
|
<span v-if="scope.row.material_origin != null"
|
||||||
|
>({{ scope.row.material_origin_name }})</span
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="批次号"
|
||||||
|
prop="batch"
|
||||||
|
min-width="120"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="部门/工段"
|
||||||
|
prop="belong_dept_name"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
{{scope.row.belong_dept_name}}/{{scope.row.mgroup_name}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="数量"
|
||||||
|
prop="count"
|
||||||
|
min-width="80"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="不合格标记"
|
||||||
|
prop="notok_sign_name"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
prop="create_time"
|
||||||
|
width="150"
|
||||||
|
></el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-main>
|
||||||
|
<el-dialog title="选择物料" v-model="materialsVisible" width="90%">
|
||||||
|
<materials
|
||||||
|
style="height: 500px"
|
||||||
|
:materialType="materialType"
|
||||||
|
ref="materialsChose"
|
||||||
|
@choseChange="choseChange"
|
||||||
|
></materials>
|
||||||
|
</el-dialog>
|
||||||
|
<scrap-dialog
|
||||||
|
v-if="dialog.scrap"
|
||||||
|
ref="scrapDialog"
|
||||||
|
:type="type"
|
||||||
|
:mgroupName="mgroupName"
|
||||||
|
:mgroupId="mgroupId"
|
||||||
|
@success="handleScrapSuccess"
|
||||||
|
@closed="dialog.scrap = false"
|
||||||
|
>
|
||||||
|
</scrap-dialog>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { wmState } from "@/utils/enum.js";
|
||||||
|
// import materials from "./../mtm/materials.vue";
|
||||||
|
// import checkDialog from "./check_form.vue";
|
||||||
|
// import showDrawer from "./check_drawer.vue";
|
||||||
|
// import scrapDialog from "./handover_form.vue";
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
mgroupName: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// components: {
|
||||||
|
// materials,
|
||||||
|
// checkDialog,
|
||||||
|
// showDrawer,
|
||||||
|
// scrapDialog
|
||||||
|
// },
|
||||||
|
name: "wmaterial",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
wmState,
|
||||||
|
apiObj: this.$API.wpm.wmaterial.list,
|
||||||
|
params: {
|
||||||
|
state : 50,
|
||||||
|
state_all: 1
|
||||||
|
},
|
||||||
|
query: {
|
||||||
|
search:''
|
||||||
|
},
|
||||||
|
dialog: {
|
||||||
|
scrap: false,
|
||||||
|
},
|
||||||
|
options:[],
|
||||||
|
tableData: [],
|
||||||
|
selection: [],
|
||||||
|
queryWm: {
|
||||||
|
search: "",
|
||||||
|
material: "",
|
||||||
|
},
|
||||||
|
materialType: "wm",
|
||||||
|
visibleDrawer: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
let that = this;
|
||||||
|
// that.$API.mtm.mgroup.list.req({ page: 0 }).then((res) => {
|
||||||
|
// that.options = res;
|
||||||
|
// if(res.length>0){
|
||||||
|
// that.params.mgroupx = res[0].id;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
materialsChoses(str) {
|
||||||
|
this.materialType = str;
|
||||||
|
this.materialsVisible = true;
|
||||||
|
},
|
||||||
|
choseChange(data) {
|
||||||
|
this.queryWm.material = data;
|
||||||
|
this.$refs.table_wm.queryData(this.queryWm);
|
||||||
|
this.materialsVisible = false;
|
||||||
|
},
|
||||||
|
tomio() {
|
||||||
|
this.$router.push({ name: "halfgood_mio" });
|
||||||
|
},
|
||||||
|
table_Check(row){
|
||||||
|
this.checkItem = row;
|
||||||
|
let mode = this.mgroupName;
|
||||||
|
this.dialog.save = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.saveDialog.open(mode);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//表格选择后回调事件
|
||||||
|
selectionChange(selection) {
|
||||||
|
this.selection = selection;
|
||||||
|
},
|
||||||
|
//添加报废
|
||||||
|
table_add(type) {
|
||||||
|
this.dialog.scrap = true;
|
||||||
|
this.type = type;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.scrapDialog.open("add");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleScrapSuccess(){
|
||||||
|
this.dialog.scrap = false;
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
},
|
||||||
|
//搜索
|
||||||
|
handleQuery() {
|
||||||
|
this.$refs.table.queryData(this.query);
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped></style>
|
||||||
|
|
@ -4,15 +4,15 @@
|
||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="add('do_in')"
|
@click="add('do_out')"
|
||||||
v-auth="'mio.do'"
|
v-auth="'mio.do'"
|
||||||
>生产入库</el-button
|
>生产领料</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="add('sale_out')"
|
@click="add('do_in')"
|
||||||
v-auth="'mio.sale'"
|
v-auth="'mio.do'"
|
||||||
>销售发货</el-button
|
>生产入库</el-button
|
||||||
>
|
>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="query.type"
|
v-model="query.type"
|
||||||
|
|
@ -166,11 +166,11 @@ export default {
|
||||||
{ id: 20, name: "已提交" },
|
{ id: 20, name: "已提交" },
|
||||||
],
|
],
|
||||||
typeDict: {
|
typeDict: {
|
||||||
sale_out: "销售发货",
|
do_out: "生产领料",
|
||||||
do_in: "生产入库",
|
do_in: "生产入库",
|
||||||
},
|
},
|
||||||
cateOptions: [
|
cateOptions: [
|
||||||
{ id: "sale_out", name: "销售发货" },
|
{ id: "do_out", name: "生产领料" },
|
||||||
{ id: "do_in", name: "生产入库" },
|
{ id: "do_in", name: "生产入库" },
|
||||||
],
|
],
|
||||||
dialog: {
|
dialog: {
|
||||||
|
|
|
||||||
|
|
@ -132,17 +132,15 @@
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in materialOptions"
|
v-for="item in materialOptions"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.batch"
|
:label="item.label"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
>
|
>
|
||||||
<span>{{ item.batch }}</span>
|
<span>{{ item.batch }}</span>
|
||||||
<div style="float: right">
|
<div style="float: right">
|
||||||
<span>{{ item.count }}</span>
|
<span>{{ item.count }}</span>
|
||||||
<span
|
<span v-if="item.notok_sign_name !== null" style="color: #aaaaaa">
|
||||||
v-if="item.notok_sign_name !== null"
|
({{ item.notok_sign_name }})
|
||||||
style="color: #aaaaaa"
|
</span>
|
||||||
>({{ item.notok_sign_name }})</span
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
@ -205,11 +203,11 @@ export default {
|
||||||
lists:[],//交接数组
|
lists:[],//交接数组
|
||||||
handle_user: [],
|
handle_user: [],
|
||||||
form: {
|
form: {
|
||||||
send_date: "",
|
send_date: null,
|
||||||
send_user: "",
|
send_user: null,
|
||||||
send_mgroup: "",
|
send_mgroup: null,
|
||||||
recive_user: "",
|
recive_user: null,
|
||||||
recive_mgroup: "",
|
recive_mgroup: null,
|
||||||
handoverb:[{wm:'',count:''}],
|
handoverb:[{wm:'',count:''}],
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
|
@ -294,7 +292,11 @@ export default {
|
||||||
that.deptID = that.$TOOL.data.get('gx_deptID');
|
that.deptID = that.$TOOL.data.get('gx_deptID');
|
||||||
that.getUserList();
|
that.getUserList();
|
||||||
}
|
}
|
||||||
|
if(that.type==40){
|
||||||
|
that.getMaterialNotok();
|
||||||
|
}else{
|
||||||
that.getMaterial();
|
that.getMaterial();
|
||||||
|
}
|
||||||
that.getDeptOptions();
|
that.getDeptOptions();
|
||||||
that.getMgroupOptions();
|
that.getMgroupOptions();
|
||||||
},
|
},
|
||||||
|
|
@ -329,28 +331,42 @@ export default {
|
||||||
}else if(that.mgroupName=="facade"){
|
}else if(that.mgroupName=="facade"){
|
||||||
req.material__process__name="二次超洗";
|
req.material__process__name="二次超洗";
|
||||||
}
|
}
|
||||||
// else{
|
this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||||
// if (this.type == 10) {
|
// that.materialOptions = res;
|
||||||
// req.notok_sign__isnull = 1;
|
let arr = [];
|
||||||
// } else if (this.type == 20) {
|
res.forEach(item=>{
|
||||||
// req.notok_sign__isnull = 0;
|
let obj = {};
|
||||||
// }else if (this.type == 30) {
|
Object.assign(obj,item);
|
||||||
// req.notok_sign__isnull = 1;
|
obj.label = item.batch;
|
||||||
// }
|
arr.push(obj);
|
||||||
// }
|
})
|
||||||
|
that.materialOptions = arr;
|
||||||
this.$API.wpm.wmaterial.list
|
});
|
||||||
.req(req)
|
},
|
||||||
.then((res) => {
|
//获取车间不合格物料
|
||||||
that.materialOptions = res;
|
getMaterialNotok() {
|
||||||
|
let that = this;
|
||||||
|
var req = {
|
||||||
|
mgroupx: that.mgroupId,
|
||||||
|
page: 0,
|
||||||
|
notok_sign__isnull : 0,
|
||||||
|
count_xtest__isnull:1
|
||||||
|
};
|
||||||
|
this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||||
|
let arr = [];
|
||||||
|
res.forEach(item=>{
|
||||||
|
let obj = {};
|
||||||
|
Object.assign(obj,item);
|
||||||
|
obj.label = item.batch+'('+item.notok_sign_name+')';
|
||||||
|
arr.push(obj);
|
||||||
|
})
|
||||||
|
that.materialOptions = arr;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//获取交送工段人员
|
//获取交送工段人员
|
||||||
getUserList() {
|
getUserList() {
|
||||||
let that = this;
|
let that = this;
|
||||||
this.$API.system.user.list
|
this.$API.system.user.list.req({ depts: that.deptID, page: 0 }).then((res) => {
|
||||||
.req({ depts: that.deptID, page: 0 })
|
|
||||||
.then((res) => {
|
|
||||||
that.userList = res;
|
that.userList = res;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
@ -361,9 +377,7 @@ export default {
|
||||||
this.mgroupOptions.forEach(item => {
|
this.mgroupOptions.forEach(item => {
|
||||||
if(item.id==that.form.recive_mgroup){
|
if(item.id==that.form.recive_mgroup){
|
||||||
deptID = item.belong_dept;
|
deptID = item.belong_dept;
|
||||||
this.$API.system.user.list
|
this.$API.system.user.list.req({ depts: deptID, page: 0 }).then((res) => {
|
||||||
.req({ depts: deptID, page: 0 })
|
|
||||||
.then((res) => {
|
|
||||||
that.userList2 = res;
|
that.userList2 = res;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -398,29 +412,40 @@ export default {
|
||||||
},
|
},
|
||||||
//提交
|
//提交
|
||||||
submit() {
|
submit() {
|
||||||
this.$refs.dialogForm.validate(async (valid) => {
|
let that = this;
|
||||||
|
that.$refs.dialogForm.validate(async (valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.mode == "add") {
|
if (that.mode == "add") {
|
||||||
this.$API.wpm.handover.create.req(this.form).then((res) => {
|
that.$API.wpm.handover.create.req(that.form).then((res) => {
|
||||||
this.isSaveing = false;
|
if(that.type==40){
|
||||||
this.$emit("success", this.form, this.mode);
|
//提交
|
||||||
this.visible = false;
|
that.$API.wpm.handover.submit.req(res.id).then((res1) => {
|
||||||
this.$message.success("操作成功");
|
that.isSaveing = false;
|
||||||
|
that.$emit("success");
|
||||||
|
that.visible = false;
|
||||||
|
that.$message.success("操作成功");
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
that.isSaveing = false;
|
||||||
|
that.$emit("success");
|
||||||
|
that.visible = false;
|
||||||
|
that.$message.success("操作成功");
|
||||||
|
}
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
//可以处理校验错误
|
//可以处理校验错误
|
||||||
this.isSaveing = false;
|
that.isSaveing = false;
|
||||||
return err;
|
return err;
|
||||||
});
|
});
|
||||||
} else if (this.mode == "edit") {
|
} else if (that.mode == "edit") {
|
||||||
this.$API.wpm.handover.update.req(this.form.id, this.form).then((res) => {
|
that.$API.wpm.handover.update.req(that.form.id, that.form).then((res) => {
|
||||||
this.isSaveing = false;
|
that.isSaveing = false;
|
||||||
this.$emit("success", this.form, this.mode);
|
that.$emit("success", that.form, that.mode);
|
||||||
this.visible = false;
|
that.visible = false;
|
||||||
this.$message.success("操作成功");
|
that.$message.success("操作成功");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
//可以处理校验错误
|
//可以处理校验错误
|
||||||
this.isSaveing = false;
|
that.isSaveing = false;
|
||||||
return err;
|
return err;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@
|
||||||
<el-button type="primary" @click="tomio" v-auth="'mio.do'"
|
<el-button type="primary" @click="tomio" v-auth="'mio.do'"
|
||||||
>入库</el-button
|
>入库</el-button
|
||||||
>
|
>
|
||||||
|
<el-button type="primary" v-auth="'handover.create'" @click="table_add(40)">
|
||||||
|
报废</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
<!-- <el-button type="primary" @click="materialsChoses('wm')"
|
<!-- <el-button type="primary" @click="materialsChoses('wm')"
|
||||||
|
|
@ -135,6 +137,16 @@
|
||||||
@closed="dialog.save = false"
|
@closed="dialog.save = false"
|
||||||
>
|
>
|
||||||
</check-dialog>
|
</check-dialog>
|
||||||
|
<scrap-dialog
|
||||||
|
v-if="dialog.scrap"
|
||||||
|
ref="scrapDialog"
|
||||||
|
:type="type"
|
||||||
|
:mgroupName="mgroupName"
|
||||||
|
:mgroupId="mgroupId"
|
||||||
|
@success="handleScrapSuccess"
|
||||||
|
@closed="dialog.scrap = false"
|
||||||
|
>
|
||||||
|
</scrap-dialog>
|
||||||
<showDrawer
|
<showDrawer
|
||||||
ref="showDrawer"
|
ref="showDrawer"
|
||||||
v-if="visibleDrawer"
|
v-if="visibleDrawer"
|
||||||
|
|
@ -149,6 +161,7 @@ import { wmState } from "@/utils/enum.js";
|
||||||
import materials from "./../mtm/materials.vue";
|
import materials from "./../mtm/materials.vue";
|
||||||
import checkDialog from "./check_form.vue";
|
import checkDialog from "./check_form.vue";
|
||||||
import showDrawer from "./check_drawer.vue";
|
import showDrawer from "./check_drawer.vue";
|
||||||
|
import scrapDialog from "./handover_form.vue";
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
mgroupName: {
|
mgroupName: {
|
||||||
|
|
@ -159,7 +172,8 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
materials,
|
materials,
|
||||||
checkDialog,
|
checkDialog,
|
||||||
showDrawer
|
showDrawer,
|
||||||
|
scrapDialog
|
||||||
},
|
},
|
||||||
name: "wmaterial",
|
name: "wmaterial",
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -172,6 +186,7 @@ export default {
|
||||||
query: {},
|
query: {},
|
||||||
dialog: {
|
dialog: {
|
||||||
save: false,
|
save: false,
|
||||||
|
scrap: false,
|
||||||
permission: false,
|
permission: false,
|
||||||
},
|
},
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
|
@ -240,6 +255,18 @@ export default {
|
||||||
selectionChange(selection) {
|
selectionChange(selection) {
|
||||||
this.selection = selection;
|
this.selection = selection;
|
||||||
},
|
},
|
||||||
|
//添加报废
|
||||||
|
table_add(type) {
|
||||||
|
this.dialog.scrap = true;
|
||||||
|
this.type = type;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.scrapDialog.open("add");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleScrapSuccess(){
|
||||||
|
this.dialog.scrap = false;
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
},
|
||||||
//搜索
|
//搜索
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.$refs.table.queryData(this.query);
|
this.$refs.table.queryData(this.query);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue