Merge branch 'master' of https://e.coding.net/ctcdevteam/ehs/ehs_web
This commit is contained in:
commit
efd82972af
|
|
@ -485,9 +485,17 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
wpr:{
|
wpr:{
|
||||||
name: "动态产品",
|
list: {
|
||||||
req: async function (data) {
|
name: "动态产品",
|
||||||
return await http.get(`${config.API_URL}/wpmw/wpr/`, data);
|
req: async function (data) {
|
||||||
|
return await http.get(`${config.API_URL}/wpmw/wpr/`, data);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
item: {
|
||||||
|
name: "动态产品",
|
||||||
|
req: async function (id) {
|
||||||
|
return await http.get(`${config.API_URL}/wpmw/wpr/${id}/`);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@
|
||||||
v-model="form.belong_dept"
|
v-model="form.belong_dept"
|
||||||
clearable
|
clearable
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@change="deptChange"
|
@change="getgetDeptUsers"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in deptOptions"
|
v-for="item in deptOptions"
|
||||||
|
|
@ -228,6 +228,7 @@ export default {
|
||||||
this.getDeptOptions();
|
this.getDeptOptions();
|
||||||
this.getDeptUser();
|
this.getDeptUser();
|
||||||
this.getmgroupOptions();
|
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") {
|
||||||
|
|
@ -270,12 +271,10 @@ export default {
|
||||||
this.orderOptions = res;
|
this.orderOptions = res;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
deptChange(val) {
|
getgetDeptUsers(){
|
||||||
this.$API.system.user.list
|
this.$API.system.user.list.req({ depts: this.form.belong_dept, page: 0 }).then((res) => {
|
||||||
.req({ depts: val, page: 0 })
|
this.userOptions = res;
|
||||||
.then((res) => {
|
});
|
||||||
this.userOptions = res;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
getDeptUser() {
|
getDeptUser() {
|
||||||
this.$API.system.user.list
|
this.$API.system.user.list
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,8 @@ export default {
|
||||||
this.closed();
|
this.closed();
|
||||||
},
|
},
|
||||||
closed(){
|
closed(){
|
||||||
this.visible = false;
|
this.codeText = '';
|
||||||
|
// this.visible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -547,30 +547,79 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let that = this;
|
let that = this;
|
||||||
|
let keys = data.split('#')[0];
|
||||||
let id = data.split('#')[1];
|
let id = data.split('#')[1];
|
||||||
console.log('id',id);
|
if(keys=='wpr'){
|
||||||
this.$API.cm.labelmat.item.req(id).then((res) => {
|
that.$API.wpm.wpr.item.req(id).then((res) => {
|
||||||
let arr = that.form.handoverb.filter((item) => {
|
if(res){
|
||||||
return item.batch == res.batch;
|
let indexs = 0;
|
||||||
|
let arr = that.form.handoverb.filter((item,index) => {
|
||||||
|
indexs = index;
|
||||||
|
return item.wm == res.wm;
|
||||||
|
})
|
||||||
|
//有handoverb
|
||||||
|
if(arr.length>0){
|
||||||
|
//判断是否有wpr,若无将wpr放进去
|
||||||
|
if(arr[0].handoverbw&&arr[0].handoverbw.length>0){
|
||||||
|
let arr1 = [];
|
||||||
|
arr1 = arr[0].handoverbw.filter((item1) => {
|
||||||
|
item1.wpr = item1.id;
|
||||||
|
})
|
||||||
|
if(arr1.length>0){
|
||||||
|
that.$message.error("该物料已存在");
|
||||||
|
}else{
|
||||||
|
let obj1 = {};
|
||||||
|
obj1.wpr = res.id;
|
||||||
|
that.form.handoverb[indexs].handoverbw.push(obj1);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
that.form.handoverb[indexs].handoverbw = [];
|
||||||
|
let obj1 = {};
|
||||||
|
obj1.wpr = res.id;
|
||||||
|
that.form.handoverb[indexs].handoverbw.push(obj1);
|
||||||
|
}
|
||||||
|
}else{//无handoverb
|
||||||
|
that.materialOptions.forEach((item) => {
|
||||||
|
console.log('item.id',item.id);
|
||||||
|
if(item.id == res.wm){
|
||||||
|
let obj2 = {};
|
||||||
|
obj2.wm = item.id;
|
||||||
|
obj2.batch = item.batch;
|
||||||
|
obj2.counts = item.count;
|
||||||
|
obj2.handoverbw = [];
|
||||||
|
obj2.count = 1;
|
||||||
|
let obj3 = {};
|
||||||
|
obj3.wpr = res.id;
|
||||||
|
obj2.handoverbw.push(obj3);
|
||||||
|
that.form.handoverb.push(obj2);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
if(arr.length>0){
|
}else{
|
||||||
that.$message.error("该批次已存在")
|
this.$API.cm.labelmat.item.req(id).then((res) => {
|
||||||
}else{
|
let arr = that.form.handoverb.filter((item) => {
|
||||||
that.materialOptions.forEach((item) => {
|
return item.batch == res.batch;
|
||||||
if(item.batch == res.batch){
|
|
||||||
let obj = {};
|
|
||||||
obj.wm = item.id;
|
|
||||||
obj.batch = item.batch;
|
|
||||||
obj.counts = item.count;
|
|
||||||
obj.count = item.count;
|
|
||||||
that.form.handoverb.push(obj)
|
|
||||||
that.$refs.scanDialog.closed();
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
if(arr.length>0){
|
||||||
})
|
that.$message.error("该批次已存在")
|
||||||
|
}else{
|
||||||
|
that.materialOptions.forEach((item) => {
|
||||||
|
if(item.batch == res.batch){
|
||||||
|
let obj = {};
|
||||||
|
obj.wm = item.id;
|
||||||
|
obj.batch = item.batch;
|
||||||
|
obj.counts = item.count;
|
||||||
|
obj.count = item.count;
|
||||||
|
that.form.handoverb.push(obj)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
//根据扫描内容,获取物料详情匹配当前库存物料
|
//根据扫描内容,获取物料详情匹配当前库存物料
|
||||||
this.scanVisible = false;
|
// this.scanVisible = false;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-link :underline="false" @click="printMaterial(scope.row,'wm')" type="primary">物料标签</el-link>
|
<el-link :underline="false" @click="printMaterial(scope.row,'wm')" type="primary">物料标签</el-link>
|
||||||
<el-link
|
<el-link
|
||||||
v-if="scope.row.material_&&scope.row.material_.tracking==10"
|
v-if="scope.row.material_&&scope.row.material_.tracking==10&&scope.row.state!==20"
|
||||||
:underline="false"
|
:underline="false"
|
||||||
@click="inmCheck(scope.row)"
|
@click="inmCheck(scope.row)"
|
||||||
type="primary"
|
type="primary"
|
||||||
|
|
@ -280,7 +280,7 @@ export default {
|
||||||
visibleDrawer: false,
|
visibleDrawer: false,
|
||||||
wprVisibleDrawer:false,
|
wprVisibleDrawer:false,
|
||||||
setNameVisible:false,
|
setNameVisible:false,
|
||||||
wprApiObj:this.$API.wpm.wpr,
|
wprApiObj:this.$API.wpm.wpr.list,
|
||||||
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
||||||
printer_name:localStorage.getItem("printer_name"),
|
printer_name:localStorage.getItem("printer_name"),
|
||||||
mgroup_name:'',
|
mgroup_name:'',
|
||||||
|
|
@ -379,9 +379,6 @@ export default {
|
||||||
that.wprParams.wm='';
|
that.wprParams.wm='';
|
||||||
that.wprParams.wm = row.id;
|
that.wprParams.wm = row.id;
|
||||||
that.wprVisibleDrawer = true;
|
that.wprVisibleDrawer = true;
|
||||||
// that.$API.wpm.wpr.req({ wm: row.id,page:0 }).then((res) => {
|
|
||||||
// that.wprList = res;
|
|
||||||
// })
|
|
||||||
},
|
},
|
||||||
//本地更新数据
|
//本地更新数据
|
||||||
handleSaveSuccess(data, mode) {
|
handleSaveSuccess(data, mode) {
|
||||||
|
|
|
||||||
|
|
@ -288,13 +288,14 @@
|
||||||
width="100px"
|
width="100px"
|
||||||
>
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<!-- 批次 -->
|
<!-- 批次 v-if="mlogItem.submit_time == null&&mlogItem.material_out_&&mlogItem.material_out_.tracking==10" -->
|
||||||
<el-link
|
<el-link
|
||||||
:underline="false"
|
:underline="false"
|
||||||
type="primary"
|
type="primary"
|
||||||
v-if="mlogItem.submit_time == null&&mlogItem.material_out_&&mlogItem.material_out_.tracking==10"
|
v-if="mlogItem.submit_time == null"
|
||||||
|
style="margin-right: 10px;"
|
||||||
@click="table_out_check(scope.row)"
|
@click="table_out_check(scope.row)"
|
||||||
>详情</el-link>
|
>编辑</el-link>
|
||||||
<!-- 单个 -->
|
<!-- 单个 -->
|
||||||
<el-link
|
<el-link
|
||||||
:underline="false"
|
:underline="false"
|
||||||
|
|
|
||||||
|
|
@ -182,32 +182,68 @@ export default {
|
||||||
},
|
},
|
||||||
//扫描后处理方法
|
//扫描后处理方法
|
||||||
formWminChange(code){
|
formWminChange(code){
|
||||||
let that = this,codeId='',arr=[];
|
console.log('code',code)
|
||||||
|
let that = this,codeId='',keys="",arr=[];
|
||||||
if(code.indexOf("#")>-1){
|
if(code.indexOf("#")>-1){
|
||||||
let arrs = code.split("#");
|
let arrs = code.split("#");
|
||||||
|
keys = arrs[0];
|
||||||
codeId = arrs[1];
|
codeId = arrs[1];
|
||||||
}
|
if(keys=='wpr'){//个
|
||||||
this.$API.cm.labelmat.item.req(codeId).then((res) => {
|
that.$API.wpm.wpr.item.req(codeId).then((res) => {
|
||||||
if(res){
|
if(res){
|
||||||
arr = that.materialOptions.filter((item) => {
|
arr = that.materialOptions.filter((item) => {
|
||||||
return item.batch == res.batch&&item.material==res.material&&item.state==res.state;
|
return item.id == res.wm;
|
||||||
})
|
})
|
||||||
if (arr.length > 0) {
|
if (arr.length > 0) {
|
||||||
that.form.batch = arr[0].batch;
|
that.form.batch = arr[0].batch;
|
||||||
that.form.wm_in = arr[0].id;
|
that.form.wm_in = arr[0].id;
|
||||||
that.form.count_use = arr[0].count;
|
that.form.count_use = arr[0].count;
|
||||||
that.wm_in = arr[0].batch;
|
that.wm_in = arr[0].batch;
|
||||||
}else{
|
}else{
|
||||||
|
that.wm_in = '';
|
||||||
|
that.$message.error("批次号不存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).catch((err) => {})
|
||||||
|
}else{//批次
|
||||||
|
this.$API.cm.labelmat.item.req(codeId).then((res) => {
|
||||||
|
if(res){
|
||||||
|
arr = that.materialOptions.filter((item) => {
|
||||||
|
return item.batch == res.batch&&item.state==res.state;
|
||||||
|
})
|
||||||
|
if (arr.length > 0) {
|
||||||
|
that.form.batch = arr[0].batch;
|
||||||
|
that.form.wm_in = arr[0].id;
|
||||||
|
that.form.count_use = arr[0].count;
|
||||||
|
that.wm_in = arr[0].batch;
|
||||||
|
}else{
|
||||||
|
that.wm_in = '';
|
||||||
|
that.$message.error("批次号不存在");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
that.wm_in = '';
|
||||||
|
}
|
||||||
|
}).catch((err) => {
|
||||||
that.wm_in = '';
|
that.wm_in = '';
|
||||||
that.$message.error("批次号不存在");
|
that.$message.error("批次号不存在");
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
arr = that.materialOptions.filter((item) => {
|
||||||
|
return item.batch == code;
|
||||||
|
})
|
||||||
|
if (arr.length > 0) {
|
||||||
|
that.form.batch = arr[0].batch;
|
||||||
|
that.form.wm_in = arr[0].id;
|
||||||
|
that.form.count_use = arr[0].count;
|
||||||
|
that.wm_in = arr[0].batch;
|
||||||
}else{
|
}else{
|
||||||
that.wm_in = '';
|
that.wm_in = '';
|
||||||
|
that.$message.error("批次号不存在");
|
||||||
}
|
}
|
||||||
}).catch((err) => {
|
}
|
||||||
that.wm_in = '';
|
|
||||||
that.$message.error("批次号不存在");
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
//表单提交方法
|
//表单提交方法
|
||||||
submit() {
|
submit() {
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@
|
||||||
<el-input v-else v-model="scope.row.note" placeholder="备注"></el-input>
|
<el-input v-else v-model="scope.row.note" placeholder="备注"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="open" label="操作" width="60" align="center">
|
<el-table-column prop="open" label="操作" width="120" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.isEdit"
|
v-if="scope.row.isEdit"
|
||||||
|
|
@ -234,7 +234,7 @@ export default {
|
||||||
},
|
},
|
||||||
getOptions(){
|
getOptions(){
|
||||||
let that = this;
|
let that = this;
|
||||||
that.$API.wpm.wpr.req({wm:that.wm,page:0}).then((res) => {
|
that.$API.wpm.wpr.list.req({wm:that.wm,page:0}).then((res) => {
|
||||||
that.options = res;
|
that.options = res;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -245,6 +245,7 @@ export default {
|
||||||
console.log('item',item);
|
console.log('item',item);
|
||||||
let index = that.mlogbwlist.indexOf(row);
|
let index = that.mlogbwlist.indexOf(row);
|
||||||
that.mlogbwlist[index].number = item.number;
|
that.mlogbwlist[index].number = item.number;
|
||||||
|
// that.mlogbwlist[index].wpr = item.id;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -288,6 +289,7 @@ export default {
|
||||||
let obj = {};
|
let obj = {};
|
||||||
obj.number = row.number;
|
obj.number = row.number;
|
||||||
obj.mlogb = row.mlogb;
|
obj.mlogb = row.mlogb;
|
||||||
|
obj.wpr = row.wpr;
|
||||||
obj.note = row.note;
|
obj.note = row.note;
|
||||||
if(that.qct!==null&&that.qct!==''){
|
if(that.qct!==null&&that.qct!==''){
|
||||||
obj.ftest = {};
|
obj.ftest = {};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue