fix:yuanliaofeipinku
This commit is contained in:
parent
554031e0bf
commit
04a468ee7e
|
|
@ -2,8 +2,8 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<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'" @click="table_add(20)">返工交接</el-button>
|
||||
<el-button type="primary" v-auth="'handover.create'" v-if="route_code=='scrap'" @click="table_bsofei(40,30)">合批报废</el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-input
|
||||
|
|
@ -108,7 +108,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
wmState,
|
||||
apiObj: this.$API.wpm.wmaterial.list,
|
||||
apiObj: null,
|
||||
params: {
|
||||
state : 50,
|
||||
state_all: 1
|
||||
|
|
@ -126,6 +126,11 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
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.mgroupOptions = res;
|
||||
res.forEach(item=>{
|
||||
|
|
@ -145,6 +150,13 @@ export default {
|
|||
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() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
|
|
|
|||
|
|
@ -12,8 +12,13 @@
|
|||
type="primary"
|
||||
@click="add('pur_in')"
|
||||
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
|
||||
v-model="query.type"
|
||||
clearable
|
||||
|
|
@ -73,7 +78,8 @@
|
|||
></el-table-column>
|
||||
<el-table-column label="出/入库类型">
|
||||
<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>
|
||||
</el-table-column>
|
||||
<el-table-column label="记录状态">
|
||||
|
|
@ -124,7 +130,7 @@
|
|||
type="primary"
|
||||
@click="table_submit(scope.row)"
|
||||
v-auth="'mio.submit'"
|
||||
v-if="scope.row.state == 10"
|
||||
v-if="scope.row.state == 10&&scope.row.type!=='do_out'"
|
||||
>
|
||||
提交
|
||||
</el-button>
|
||||
|
|
@ -208,17 +214,25 @@ export default {
|
|||
apiObj: this.$API.inm.mio.list,
|
||||
selection: [],
|
||||
type: "",
|
||||
htype: "",
|
||||
cate: "mainso",
|
||||
mioId: "",
|
||||
project_code: "",
|
||||
visibleDrawer: false,
|
||||
};
|
||||
},
|
||||
mounted() {this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code;},
|
||||
methods: {
|
||||
//添加
|
||||
add(type) {
|
||||
add(type,htype) {
|
||||
this.dialog.save = true;
|
||||
this.htype = htype;
|
||||
this.$nextTick(() => {
|
||||
if(htype!==undefined){
|
||||
this.$refs.saveDialog.open("add", type,htype);
|
||||
}else{
|
||||
this.$refs.saveDialog.open("add", type);
|
||||
}
|
||||
});
|
||||
},
|
||||
//编辑
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@
|
|||
</el-form-item>
|
||||
<el-form-item
|
||||
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
|
||||
v-model="form.belong_dept"
|
||||
|
|
@ -132,8 +132,8 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="部门执行人"
|
||||
v-if="form.type == 'do_in' || form.type == 'do_out'|| form.type == 'borrow_out' || form.type == 'return_in'"
|
||||
label="部门执行人" prop="do_user"
|
||||
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-option
|
||||
|
|
@ -144,9 +144,7 @@
|
|||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="仓库执行人"
|
||||
>
|
||||
<el-form-item label="仓库执行人" prop="mio_user">
|
||||
<el-select
|
||||
v-model="form.mio_user"
|
||||
clearable
|
||||
|
|
@ -199,13 +197,16 @@ export default {
|
|||
form: {},
|
||||
rules: {
|
||||
number: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写编号",
|
||||
trigger: "blur",
|
||||
},
|
||||
{required: true,message: "请填写编号",trigger: "blur"},
|
||||
],
|
||||
do_user: [
|
||||
{required: true,message: "请选择部门执行人",trigger: "blur"},
|
||||
],
|
||||
mio_user: [
|
||||
{required: true,message: "请选择仓库执行人",trigger: "blur"},
|
||||
],
|
||||
},
|
||||
htype:"",
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
options: [],
|
||||
|
|
@ -221,10 +222,21 @@ export default {
|
|||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
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: {
|
||||
init() {
|
||||
let that = this;
|
||||
this.getDeptUser();
|
||||
var type = this.form.type;
|
||||
if (type == "pur_in") {
|
||||
|
|
@ -234,9 +246,16 @@ export default {
|
|||
this.getOrderOptions();
|
||||
this.getCustomerOptions();
|
||||
} else if (type == "do_in" || type == "do_out" || type == "borrow_out" || type == "return_in") {
|
||||
if(that.htype=='baofei'){
|
||||
that.$API.mtm.mgroup.list.req({ name:'废品库',page: 0}).then((res) => {
|
||||
that.mgroupOptions = res;
|
||||
that.form.mgroup = res[0].id;
|
||||
});
|
||||
}else{
|
||||
this.getDeptOptions();
|
||||
this.getmgroupOptions();
|
||||
this.getgetDeptUsers();
|
||||
}
|
||||
} else if (type == "other_in") {
|
||||
this.getSupplierOptions();
|
||||
} else if (type == "other_out") {
|
||||
|
|
@ -293,15 +312,18 @@ export default {
|
|||
});
|
||||
},
|
||||
getDeptUser() {
|
||||
this.$API.system.user.list
|
||||
.req({ posts__name: "库管", page: 0 })
|
||||
.then((res) => {
|
||||
this.userOption = res;
|
||||
let that = this;
|
||||
let userOption = [];
|
||||
that.$API.system.user.list.req({ posts__code__contains: "inm", page: 0 }).then((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.htype = htype;
|
||||
this.form.type = type;
|
||||
this.init();
|
||||
this.visible = true;
|
||||
|
|
@ -314,6 +336,9 @@ export default {
|
|||
this.isSaveing = true;
|
||||
try {
|
||||
var res;
|
||||
if(this.htype=='baofei'){
|
||||
this.form.do_user = this.form.mio_user
|
||||
}
|
||||
if (this.mode == "add") {
|
||||
res = await this.$API.inm.mio.create.req(this.form);
|
||||
} else if (this.mode == "edit") {
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</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-input-number
|
||||
v-model="form.count"
|
||||
|
|
@ -270,12 +270,13 @@ const defaultForm = {
|
|||
export default {
|
||||
emits: ["success", "closed"],
|
||||
props: {
|
||||
mioObj: { type: Object },
|
||||
cate: { type: String, default: null },
|
||||
htype: { type: String, default: null },
|
||||
mioId: { type: String, default: null },
|
||||
mgroup: { type: String, default: null },
|
||||
belongDeptName: { type: String, default: null },
|
||||
belongDeptId: { type: String, default: null },
|
||||
mgroup: { type: String, default: null },
|
||||
mioObj: { type: Object },
|
||||
tableDatas: { type: Array ,default:function(){return []}},
|
||||
},
|
||||
data() {
|
||||
|
|
@ -330,13 +331,35 @@ export default {
|
|||
let that = this;
|
||||
let config_base = that.$TOOL.data.get("BASE_INFO").base;
|
||||
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: {
|
||||
init() {
|
||||
this.getMaterialOptions();
|
||||
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() {
|
||||
let that = this;
|
||||
this.$API.inm.warehouse.list.req({ page: 0 }).then((res) => {
|
||||
|
|
@ -541,9 +564,11 @@ export default {
|
|||
} else {
|
||||
this.getBatchOptions();
|
||||
}
|
||||
if(that.project_code=='gx'&&that.type == 'pur_in'){
|
||||
that.form.batch = '无'
|
||||
if(that.type == 'pur_in'){
|
||||
that.batchcount = 99999999999;
|
||||
if(that.project_code=='gx'){
|
||||
that.form.batch = '无'
|
||||
}
|
||||
}
|
||||
},
|
||||
getItem(options, id) {
|
||||
|
|
@ -628,10 +653,8 @@ export default {
|
|||
this.init();
|
||||
}
|
||||
this.visible = true;
|
||||
// console.log('that.type',that.type);
|
||||
if(that.type=='other_in'||that.type=='do_out'){
|
||||
let mioitemSelecObj =JSON.parse(sessionStorage.getItem("mioitemSelecObj"));
|
||||
// console.log('mioitemSelecObj',mioitemSelecObj);
|
||||
if(mioitemSelecObj!==null){
|
||||
that.selectObj = mioitemSelecObj;
|
||||
that.form.material = that.selectObj.id;
|
||||
|
|
|
|||
Loading…
Reference in New Issue