覅下:废品库更改模式

This commit is contained in:
shijing 2025-12-10 14:12:48 +08:00
parent 066f1013c6
commit 413e5a8c17
2 changed files with 35 additions and 23 deletions

View File

@ -2,7 +2,8 @@
<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(20)">返工交接</el-button> <el-button type="primary" v-auth="'handover.create'">清除</el-button>
<el-button type="primary" v-auth="'handover.create'" @click="table_add(50)">改版</el-button>
<el-button type="primary" v-auth="'handover.create'" v-if="route_code=='scrap'" @click="table_bsofei(40,30)">合批报废</el-button> <el-button type="primary" v-auth="'handover.create'" v-if="route_code=='scrap'" @click="table_bsofei(40,30)">合批报废</el-button>
</div> </div>
<div class="right-panel"> <div class="right-panel">
@ -26,13 +27,15 @@
row-key="id" row-key="id"
:params="params" :params="params"
:query="query" :query="query"
@selection-change="selectionChange"
> >
<el-table-column label="状态" prop="state" width="100" > <el-table-column type="selection" width="50" />
<template #default="scope"> <el-table-column label="状态" prop="state" width="100" >
<el-tag :type="wmState[scope.row.state]?.type"> <template #default="scope">
{{wmState[scope.row.state]?.text}} <el-tag :type="wmState[scope.row.state]?.type">
</el-tag> {{wmState[scope.row.state]?.text}}
</template> </el-tag>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="物料名称" label="物料名称"
@ -41,9 +44,7 @@
> >
<template #default="scope"> <template #default="scope">
{{ scope.row.material_name }} {{ scope.row.material_name }}
<span v-if="scope.row.material_origin != null" <span v-if="scope.row.material_origin != null">{{ scope.row.material_origin_name }}</span>
>{{ scope.row.material_origin_name }}</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -91,6 +92,7 @@
:type="type" :type="type"
:mgroupName="mgroupName" :mgroupName="mgroupName"
:mgroupId="mgroupId" :mgroupId="mgroupId"
:isFeiPinku="isFeiPinku"
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="dialog.save = false"
> >
@ -98,20 +100,27 @@
</el-container> </el-container>
</template> </template>
<script> <script>
import saveDialog from "../wpm_gx/handover_form.vue";
import saveDialog from "../wpm_bx/handover_form.vue";
import { wmState } from "@/utils/enum.js"; import { wmState } from "@/utils/enum.js";
export default { export default {
components: { components: {
saveDialog saveDialog
}, },
props: {
isFeiPinku: {
type: Boolean,
default: false,
},
},
name: "wmaterial", name: "wmaterial",
data() { data() {
return { return {
wmState, wmState,
apiObj: null, apiObj: null,
params: { params: {
state : 10, state_all: 1,
state_all: 1 mgroup:"",
}, },
dialog: { dialog: {
save: false, save: false,
@ -119,6 +128,7 @@ export default {
query:{ query:{
search:'' search:''
}, },
selectiones: [],
type:20, type:20,
mgroupName:'废品库', mgroupName:'废品库',
mgroupId:'', mgroupId:'',
@ -129,25 +139,25 @@ export default {
that.route_code = that.$route.path.split("/")[2]; that.route_code = that.$route.path.split("/")[2];
if(that.route_code=='scrap'){ if(that.route_code=='scrap'){
that.params.material__type = 30; that.params.material__type = 30;
}else{
that.params.state = 50;
} }
that.apiObj = that.$API.wpm.wmaterial.list; that.$API.mtm.mgroup.list.req({ page: 0,name:'废品库'}).then((res) => {
that.$API.mtm.mgroup.list.req({ page: 0}).then((res) => { that.mgroupId = that.params.mgroup = res[0].id;
that.mgroupOptions = res; that.apiObj = that.$API.wpm.wmaterial.list;
res.forEach(item=>{
if(item.name=="废品库"){
that.mgroupId = item.id;
}
})
}); });
}, },
methods: { methods: {
//
selectionChange(selection) {
this.selectiones = selection;
},
// //
table_add(type) { table_add(type) {
this.dialog.save = true; this.dialog.save = true;
this.type = type; this.type = type;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.saveDialog.open("add"); this.$refs.saveDialog.open("add",this.selectiones);
}); });
}, },
table_bsofei(type,mtype) { table_bsofei(type,mtype) {

View File

@ -54,6 +54,7 @@
:mgroupName="mgroupName" :mgroupName="mgroupName"
:mgroupId="mgroupId" :mgroupId="mgroupId"
:deptId="mgroupDept" :deptId="mgroupDept"
:isFeiPinku="isFeiPinku"
:process = "mgroupProcess" :process = "mgroupProcess"
:processType = "mgroupProcessType" :processType = "mgroupProcessType"
:mgroup_code="mgroup_code" :mgroup_code="mgroup_code"
@ -65,6 +66,7 @@
:mgroupName="mgroupName" :mgroupName="mgroupName"
:mgroupId="mgroupId" :mgroupId="mgroupId"
:deptId="mgroupDept" :deptId="mgroupDept"
:isFeiPinku="isFeiPinku"
:process = "mgroupProcess" :process = "mgroupProcess"
:processType = "mgroupProcessType" :processType = "mgroupProcessType"
:mgroup_code="mgroup_code" :mgroup_code="mgroup_code"