feat:废品库出库
This commit is contained in:
parent
653f5b0282
commit
010298dd89
|
@ -1,28 +1,11 @@
|
|||
<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="left-panel">
|
||||
<el-button type="primary" v-auth="'handover.create'" @click="table_add(20)">
|
||||
返工交接</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"
|
||||
|
@ -90,47 +73,37 @@
|
|||
prop="create_time"
|
||||
width="150"
|
||||
></el-table-column>
|
||||
<!-- <el-table-column
|
||||
label="操作"
|
||||
fixed="right"
|
||||
align="center"
|
||||
width="70"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-link type="primary" v-auth="'handover.create'" @click="table_add(20,scope.row)">交接</el-link>
|
||||
</template>
|
||||
</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"
|
||||
<save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
:type="type"
|
||||
:mgroupName="mgroupName"
|
||||
:mgroupId="mgroupId"
|
||||
@success="handleScrapSuccess"
|
||||
@closed="dialog.scrap = false"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
>
|
||||
</scrap-dialog>
|
||||
</save-dialog>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
import saveDialog from "../wpm_gx/handover_form.vue";
|
||||
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: {
|
||||
saveDialog
|
||||
},
|
||||
// components: {
|
||||
// materials,
|
||||
// checkDialog,
|
||||
// showDrawer,
|
||||
// scrapDialog
|
||||
// },
|
||||
name: "wmaterial",
|
||||
data() {
|
||||
return {
|
||||
|
@ -140,69 +113,38 @@ export default {
|
|||
state : 50,
|
||||
state_all: 1
|
||||
},
|
||||
query: {
|
||||
dialog: {
|
||||
save: false,
|
||||
},
|
||||
query:{
|
||||
search:''
|
||||
},
|
||||
dialog: {
|
||||
scrap: false,
|
||||
},
|
||||
options:[],
|
||||
tableData: [],
|
||||
selection: [],
|
||||
queryWm: {
|
||||
search: "",
|
||||
material: "",
|
||||
},
|
||||
materialType: "wm",
|
||||
visibleDrawer: false,
|
||||
type:20,
|
||||
mgroupName:'废品库',
|
||||
mgroupId:'',
|
||||
};
|
||||
},
|
||||
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;
|
||||
// }
|
||||
// });
|
||||
that.$API.mtm.mgroup.list.req({ page: 0}).then((res) => {
|
||||
that.mgroupOptions = res;
|
||||
res.forEach(item=>{
|
||||
if(item.name=="废品库"){
|
||||
that.mgroupId = item.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.dialog.save = true;
|
||||
this.type = type;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.scrapDialog.open("add");
|
||||
this.$refs.saveDialog.open("add");
|
||||
});
|
||||
},
|
||||
handleScrapSuccess(){
|
||||
this.dialog.scrap = false;
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
//搜索
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
|
|
|
@ -322,12 +322,16 @@ export default {
|
|||
.then((res) => {
|
||||
that.userList = res;
|
||||
});
|
||||
}else if(that.type==20&&that.mgroupName=='废品库'){//废品交接
|
||||
that.getCkUserList();
|
||||
}else{
|
||||
that.deptID = that.$TOOL.data.get('gx_deptID');
|
||||
that.getUserList();
|
||||
}
|
||||
if(that.type==20||that.type==40){
|
||||
if((that.type==20&&that.mgroupName!=='废品库')||that.type==40){
|
||||
that.getMaterialNotok();
|
||||
}else if(that.type==20&&that.mgroupName=='废品库'){
|
||||
that.getMaterialFP();
|
||||
}else{
|
||||
that.getMaterial();
|
||||
}
|
||||
|
@ -348,15 +352,15 @@ export default {
|
|||
let that = this;
|
||||
that.$API.mtm.mgroup.list.req({ page: 0}).then((res) => {
|
||||
that.mgroupOptions = res;
|
||||
if(that.type==40){
|
||||
res.forEach(item=>{
|
||||
if(item.name=="废品库"){
|
||||
that.form.recive_mgroup = item.id;
|
||||
}
|
||||
})
|
||||
that.getCkUserList();//废品库接收人
|
||||
}
|
||||
});
|
||||
if(that.type==40){
|
||||
res.forEach(item=>{
|
||||
if(item.name=="废品库"){
|
||||
that.form.recive_mgroup = item.id;
|
||||
}
|
||||
})
|
||||
that.getCkUserList();//废品库接收人
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取车间物料
|
||||
getMaterial() {
|
||||
|
@ -366,6 +370,7 @@ export default {
|
|||
notok_sign__isnull : 1,
|
||||
count_xtest__isnull:1
|
||||
};
|
||||
that.materialOptions = [];
|
||||
if(that.mgroupName=="size"){
|
||||
that.$API.system.dept.list.req({name__contains:'尺寸',page:0}).then((res) => {
|
||||
if(res.length>0){
|
||||
|
@ -397,6 +402,7 @@ export default {
|
|||
//获取车间不合格物料
|
||||
getMaterialNotok() {
|
||||
let that = this;
|
||||
that.materialOptions = [];
|
||||
var req = {
|
||||
mgroupx: that.mgroupId,
|
||||
page: 0,
|
||||
|
@ -408,6 +414,19 @@ export default {
|
|||
that.materialOptions = res;
|
||||
});
|
||||
},
|
||||
//获取废品库物料
|
||||
getMaterialFP() {
|
||||
let that = this;
|
||||
that.materialOptions = [];
|
||||
var obj = {
|
||||
page: 0,
|
||||
state : 50,
|
||||
state_all: 1
|
||||
};
|
||||
that.$API.wpm.wmaterial.list.req(obj).then((res) => {
|
||||
that.materialOptions = res;
|
||||
});
|
||||
},
|
||||
//获取交送工段人员
|
||||
getUserList() {
|
||||
let that = this;
|
||||
|
@ -420,7 +439,13 @@ export default {
|
|||
let that = this;
|
||||
this.$API.system.user.list.req({ page: 0, posts__code: "inm&check" })
|
||||
.then((res) => {
|
||||
that.userList2 = res;
|
||||
if(that.type==40){
|
||||
that.userList2 = [];
|
||||
that.userList2 = res;
|
||||
}else if(that.type==20&&that.mgroupName=='废品库'){
|
||||
that.userList = [];
|
||||
that.userList = res;
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取接收工段人员
|
||||
|
|
Loading…
Reference in New Issue