feat:废品库出库

This commit is contained in:
shijing 2024-12-12 15:47:11 +08:00
parent 653f5b0282
commit 010298dd89
2 changed files with 78 additions and 111 deletions

View File

@ -1,28 +1,11 @@
<template> <template>
<el-container> <el-container>
<el-header> <el-header>
<!-- <div class="left-panel"> <div class="left-panel">
<el-button type="primary" v-auth="'handover.create'" @click="table_add(40)"> <el-button type="primary" v-auth="'handover.create'" @click="table_add(20)">
报废</el-button> 返工交接</el-button>
</div> --> </div>
<div class="right-panel"> <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 <el-input
style="margin-right: 5px;width: 250px" style="margin-right: 5px;width: 250px"
v-model="query.search" v-model="query.search"
@ -90,47 +73,37 @@
prop="create_time" prop="create_time"
width="150" width="150"
></el-table-column> ></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> </scTable>
</el-main> </el-main>
<el-dialog title="选择物料" v-model="materialsVisible" width="90%"> <save-dialog
<materials v-if="dialog.save"
style="height: 500px" ref="saveDialog"
:materialType="materialType"
ref="materialsChose"
@choseChange="choseChange"
></materials>
</el-dialog>
<scrap-dialog
v-if="dialog.scrap"
ref="scrapDialog"
:type="type" :type="type"
:mgroupName="mgroupName" :mgroupName="mgroupName"
:mgroupId="mgroupId" :mgroupId="mgroupId"
@success="handleScrapSuccess" @success="handleSaveSuccess"
@closed="dialog.scrap = false" @closed="dialog.save = false"
> >
</scrap-dialog> </save-dialog>
</el-container> </el-container>
</template> </template>
<script> <script>
import saveDialog from "../wpm_gx/handover_form.vue";
import { wmState } from "@/utils/enum.js"; 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 { export default {
props: { components: {
mgroupName: { saveDialog
type: String,
default: "",
},
}, },
// components: {
// materials,
// checkDialog,
// showDrawer,
// scrapDialog
// },
name: "wmaterial", name: "wmaterial",
data() { data() {
return { return {
@ -140,69 +113,38 @@ export default {
state : 50, state : 50,
state_all: 1 state_all: 1
}, },
query: { dialog: {
save: false,
},
query:{
search:'' search:''
}, },
dialog: { type:20,
scrap: false, mgroupName:'废品库',
}, mgroupId:'',
options:[],
tableData: [],
selection: [],
queryWm: {
search: "",
material: "",
},
materialType: "wm",
visibleDrawer: false,
}; };
}, },
mounted() { mounted() {
let that = this; let that = this;
// that.$API.mtm.mgroup.list.req({ page: 0 }).then((res) => { that.$API.mtm.mgroup.list.req({ page: 0}).then((res) => {
// that.options = res; that.mgroupOptions = res;
// if(res.length>0){ res.forEach(item=>{
// that.params.mgroupx = res[0].id; if(item.name=="废品库"){
// } that.mgroupId = item.id;
// }); }
})
});
}, },
methods: { 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) { table_add(type) {
this.dialog.scrap = true; this.dialog.save = true;
this.type = type; this.type = type;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.scrapDialog.open("add"); this.$refs.saveDialog.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);

View File

@ -322,12 +322,16 @@ export default {
.then((res) => { .then((res) => {
that.userList = res; that.userList = res;
}); });
}else if(that.type==20&&that.mgroupName=='废品库'){//
that.getCkUserList();
}else{ }else{
that.deptID = that.$TOOL.data.get('gx_deptID'); that.deptID = that.$TOOL.data.get('gx_deptID');
that.getUserList(); that.getUserList();
} }
if(that.type==20||that.type==40){ if((that.type==20&&that.mgroupName!=='废品库')||that.type==40){
that.getMaterialNotok(); that.getMaterialNotok();
}else if(that.type==20&&that.mgroupName=='废品库'){
that.getMaterialFP();
}else{ }else{
that.getMaterial(); that.getMaterial();
} }
@ -348,15 +352,15 @@ export default {
let that = this; let that = this;
that.$API.mtm.mgroup.list.req({ page: 0}).then((res) => { that.$API.mtm.mgroup.list.req({ page: 0}).then((res) => {
that.mgroupOptions = res; that.mgroupOptions = res;
if(that.type==40){ if(that.type==40){
res.forEach(item=>{ res.forEach(item=>{
if(item.name=="废品库"){ if(item.name=="废品库"){
that.form.recive_mgroup = item.id; that.form.recive_mgroup = item.id;
} }
}) })
that.getCkUserList();// that.getCkUserList();//
} }
}); });
}, },
// //
getMaterial() { getMaterial() {
@ -366,6 +370,7 @@ export default {
notok_sign__isnull : 1, notok_sign__isnull : 1,
count_xtest__isnull:1 count_xtest__isnull:1
}; };
that.materialOptions = [];
if(that.mgroupName=="size"){ if(that.mgroupName=="size"){
that.$API.system.dept.list.req({name__contains:'尺寸',page:0}).then((res) => { that.$API.system.dept.list.req({name__contains:'尺寸',page:0}).then((res) => {
if(res.length>0){ if(res.length>0){
@ -397,6 +402,7 @@ export default {
// //
getMaterialNotok() { getMaterialNotok() {
let that = this; let that = this;
that.materialOptions = [];
var req = { var req = {
mgroupx: that.mgroupId, mgroupx: that.mgroupId,
page: 0, page: 0,
@ -408,6 +414,19 @@ export default {
that.materialOptions = res; 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() { getUserList() {
let that = this; let that = this;
@ -420,7 +439,13 @@ export default {
let that = this; let that = this;
this.$API.system.user.list.req({ page: 0, posts__code: "inm&check" }) this.$API.system.user.list.req({ page: 0, posts__code: "inm&check" })
.then((res) => { .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;
}
}); });
}, },
// //