fix:yuanliaofeipinku

This commit is contained in:
shijing 2025-12-04 09:18:44 +08:00
parent 554031e0bf
commit 04a468ee7e
4 changed files with 111 additions and 37 deletions

View File

@ -2,8 +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 type="primary" v-auth="'handover.create'" @click="table_add(20)">返工交接</el-button>
返工交接</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">
<el-input <el-input
@ -108,7 +108,7 @@ export default {
data() { data() {
return { return {
wmState, wmState,
apiObj: this.$API.wpm.wmaterial.list, apiObj: null,
params: { params: {
state : 50, state : 50,
state_all: 1 state_all: 1
@ -126,6 +126,11 @@ export default {
}, },
mounted() { mounted() {
let that = this; let that = this;
that.route_code = that.$route.path.split("/")[2];
if(that.route_code=='scrap'){
that.params.material__type__in = 30;
}
that.apiObj = that.$API.wpm.wmaterial.list;
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;
res.forEach(item=>{ res.forEach(item=>{
@ -145,6 +150,13 @@ export default {
this.$refs.saveDialog.open("add"); this.$refs.saveDialog.open("add");
}); });
}, },
table_bsofei(type,mtype) {
this.dialog.save = true;
this.type = type;
this.$nextTick(() => {
this.$refs.saveDialog.open("add",null,mtype);
});
},
// //
handleQuery() { handleQuery() {
this.$refs.table.queryData(this.query); this.$refs.table.queryData(this.query);

View File

@ -12,8 +12,13 @@
type="primary" type="primary"
@click="add('pur_in')" @click="add('pur_in')"
v-auth="'mio.pur'" v-auth="'mio.pur'"
>采购入库</el-button >采购入库</el-button>
> <el-button
type="primary"
@click="add('do_out','baofei')"
v-auth="'mio.do'"
v-if="project_code=='gx'"
>报废</el-button>
<el-select <el-select
v-model="query.type" v-model="query.type"
clearable clearable
@ -73,7 +78,8 @@
></el-table-column> ></el-table-column>
<el-table-column label="出/入库类型"> <el-table-column label="出/入库类型">
<template #default="scope"> <template #default="scope">
{{ typeDict[scope.row.type] }} <span v-if="scope.row.mgroup_name=='废品库'&&scope.row.type=='do_out'">原料报废</span>
<span v-else>{{ typeDict[scope.row.type] }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="记录状态"> <el-table-column label="记录状态">
@ -124,7 +130,7 @@
type="primary" type="primary"
@click="table_submit(scope.row)" @click="table_submit(scope.row)"
v-auth="'mio.submit'" v-auth="'mio.submit'"
v-if="scope.row.state == 10" v-if="scope.row.state == 10&&scope.row.type!=='do_out'"
> >
提交 提交
</el-button> </el-button>
@ -208,17 +214,25 @@ export default {
apiObj: this.$API.inm.mio.list, apiObj: this.$API.inm.mio.list,
selection: [], selection: [],
type: "", type: "",
htype: "",
cate: "mainso", cate: "mainso",
mioId: "", mioId: "",
project_code: "",
visibleDrawer: false, visibleDrawer: false,
}; };
}, },
mounted() {this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code;},
methods: { methods: {
// //
add(type) { add(type,htype) {
this.dialog.save = true; this.dialog.save = true;
this.htype = htype;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.saveDialog.open("add", type); if(htype!==undefined){
this.$refs.saveDialog.open("add", type,htype);
}else{
this.$refs.saveDialog.open("add", type);
}
}); });
}, },
// //

View File

@ -115,7 +115,7 @@
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="操作部门" label="操作部门"
v-if="form.type == 'do_in' || form.type == 'do_out' || form.type == 'borrow_out' || form.type == 'return_in'" v-if="(form.type == 'do_in' || form.type == 'do_out' || form.type == 'borrow_out' || form.type == 'return_in')&& htype!='baofei'"
> >
<el-select <el-select
v-model="form.belong_dept" v-model="form.belong_dept"
@ -132,8 +132,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="部门执行人" label="部门执行人" prop="do_user"
v-if="form.type == 'do_in' || form.type == 'do_out'|| form.type == 'borrow_out' || form.type == 'return_in'" v-if="(form.type == 'do_in' || form.type == 'do_out'|| form.type == 'borrow_out' || form.type == 'return_in')&& htype!='baofei'"
> >
<el-select v-model="form.do_user" clearable style="width: 100%"> <el-select v-model="form.do_user" clearable style="width: 100%">
<el-option <el-option
@ -144,9 +144,7 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="仓库执行人" prop="mio_user">
label="仓库执行人"
>
<el-select <el-select
v-model="form.mio_user" v-model="form.mio_user"
clearable clearable
@ -199,13 +197,16 @@ export default {
form: {}, form: {},
rules: { rules: {
number: [ number: [
{ {required: true,message: "请填写编号",trigger: "blur"},
required: true, ],
message: "请填写编号", do_user: [
trigger: "blur", {required: true,message: "请选择部门执行人",trigger: "blur"},
}, ],
mio_user: [
{required: true,message: "请选择仓库执行人",trigger: "blur"},
], ],
}, },
htype:"",
visible: false, visible: false,
isSaveing: false, isSaveing: false,
options: [], options: [],
@ -221,10 +222,21 @@ export default {
}; };
}, },
mounted() { mounted() {
let that = this;
this.form.inout_date = this.$TOOL.dateFormat2(new Date()); this.form.inout_date = this.$TOOL.dateFormat2(new Date());
//
if(that.htype=='baofei'){
//
//
that.$API.mtm.mgroup.list.req({ name:'废品库',page: 0}).then((res) => {
that.form.recive_mgroup = item.id;
that.getCkUserList();//
});
}
}, },
methods: { methods: {
init() { init() {
let that = this;
this.getDeptUser(); this.getDeptUser();
var type = this.form.type; var type = this.form.type;
if (type == "pur_in") { if (type == "pur_in") {
@ -234,9 +246,16 @@ export default {
this.getOrderOptions(); this.getOrderOptions();
this.getCustomerOptions(); this.getCustomerOptions();
} else if (type == "do_in" || type == "do_out" || type == "borrow_out" || type == "return_in") { } else if (type == "do_in" || type == "do_out" || type == "borrow_out" || type == "return_in") {
this.getDeptOptions(); if(that.htype=='baofei'){
this.getmgroupOptions(); that.$API.mtm.mgroup.list.req({ name:'废品库',page: 0}).then((res) => {
this.getgetDeptUsers(); that.mgroupOptions = res;
that.form.mgroup = res[0].id;
});
}else{
this.getDeptOptions();
this.getmgroupOptions();
this.getgetDeptUsers();
}
} else if (type == "other_in") { } else if (type == "other_in") {
this.getSupplierOptions(); this.getSupplierOptions();
} else if (type == "other_out") { } else if (type == "other_out") {
@ -293,15 +312,18 @@ export default {
}); });
}, },
getDeptUser() { getDeptUser() {
this.$API.system.user.list let that = this;
.req({ posts__name: "库管", page: 0 }) let userOption = [];
.then((res) => { that.$API.system.user.list.req({ posts__code__contains: "inm", page: 0 }).then((res) => {
this.userOption = res; userOption = Array.from(new Map(res.map(item => [item.id, item])).values());
}); that.userOption = userOption;
// console.log('userOption',userOption);
});
}, },
// //
open(mode = "add", type = "") { open(mode = "add", type = "",htype="") {
this.mode = mode; this.mode = mode;
this.htype = htype;
this.form.type = type; this.form.type = type;
this.init(); this.init();
this.visible = true; this.visible = true;
@ -314,6 +336,9 @@ export default {
this.isSaveing = true; this.isSaveing = true;
try { try {
var res; var res;
if(this.htype=='baofei'){
this.form.do_user = this.form.mio_user
}
if (this.mode == "add") { if (this.mode == "add") {
res = await this.$API.inm.mio.create.req(this.form); res = await this.$API.inm.mio.create.req(this.form);
} else if (this.mode == "edit") { } else if (this.mode == "edit") {

View File

@ -139,7 +139,7 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" v-if="mTracking==20&&form.type == 'sale_out'&&project_code=='bxerp'"> <el-col :md="12" :sm="24" v-else-if="mTracking==20&&form.type == 'sale_out'&&project_code=='bxerp'">
<el-form-item label="数量"> <el-form-item label="数量">
<el-input-number <el-input-number
v-model="form.count" v-model="form.count"
@ -270,12 +270,13 @@ const defaultForm = {
export default { export default {
emits: ["success", "closed"], emits: ["success", "closed"],
props: { props: {
mioObj: { type: Object },
cate: { type: String, default: null }, cate: { type: String, default: null },
htype: { type: String, default: null },
mioId: { type: String, default: null }, mioId: { type: String, default: null },
mgroup: { type: String, default: null },
belongDeptName: { type: String, default: null }, belongDeptName: { type: String, default: null },
belongDeptId: { type: String, default: null }, belongDeptId: { type: String, default: null },
mgroup: { type: String, default: null },
mioObj: { type: Object },
tableDatas: { type: Array ,default:function(){return []}}, tableDatas: { type: Array ,default:function(){return []}},
}, },
data() { data() {
@ -330,13 +331,35 @@ export default {
let that = this; let that = this;
let config_base = that.$TOOL.data.get("BASE_INFO").base; let config_base = that.$TOOL.data.get("BASE_INFO").base;
that.project_code = config_base.base_code; that.project_code = config_base.base_code;
//
if(that.htype=='baofei'){
//
//
that.$API.mtm.mgroup.list.req({ name:'废品库',page: 0}).then((res) => {
that.form.recive_mgroup = item.id;
that.getCkUserList();//
});
}
}, },
methods: { methods: {
init() { init() {
this.getMaterialOptions(); this.getMaterialOptions();
this.getWarehouseOptions(); this.getWarehouseOptions();
}, },
//
getCkUserList() {
let that = this;
this.$API.system.user.list.req({ page: 0, posts__code: "inm&check" })
.then((res) => {
if(that.type==40){
that.userList2 = [];
that.userList2 = res;
}else if(that.type==20&&that.mgroupName=='废品库'){
that.userList = [];
that.userList = res;
}
});
},
getWarehouseOptions() { getWarehouseOptions() {
let that = this; let that = this;
this.$API.inm.warehouse.list.req({ page: 0 }).then((res) => { this.$API.inm.warehouse.list.req({ page: 0 }).then((res) => {
@ -541,9 +564,11 @@ export default {
} else { } else {
this.getBatchOptions(); this.getBatchOptions();
} }
if(that.project_code=='gx'&&that.type == 'pur_in'){ if(that.type == 'pur_in'){
that.form.batch = '无'
that.batchcount = 99999999999; that.batchcount = 99999999999;
if(that.project_code=='gx'){
that.form.batch = '无'
}
} }
}, },
getItem(options, id) { getItem(options, id) {
@ -628,10 +653,8 @@ export default {
this.init(); this.init();
} }
this.visible = true; this.visible = true;
// console.log('that.type',that.type);
if(that.type=='other_in'||that.type=='do_out'){ if(that.type=='other_in'||that.type=='do_out'){
let mioitemSelecObj =JSON.parse(sessionStorage.getItem("mioitemSelecObj")); let mioitemSelecObj =JSON.parse(sessionStorage.getItem("mioitemSelecObj"));
// console.log('mioitemSelecObj',mioitemSelecObj);
if(mioitemSelecObj!==null){ if(mioitemSelecObj!==null){
that.selectObj = mioitemSelecObj; that.selectObj = mioitemSelecObj;
that.form.material = that.selectObj.id; that.form.material = that.selectObj.id;