Commit d4615d8f by yucheng.jiang

储位工装信息

parent ac9f9fc6
...@@ -255,12 +255,6 @@ export default { ...@@ -255,12 +255,6 @@ export default {
filename: '',//文件名称 filename: '',//文件名称
fileurl:'',//文件路径 fileurl:'',//文件路径
UploadAction: this.axios.publicPath + "config/upload/UploadImage", UploadAction: this.axios.publicPath + "config/upload/UploadImage",
headers: {
token: localStorage.getItem("token"),
timestamp: localStorage.getItem("timestamp"),
nonce: localStorage.getItem("nonce"),
sign: localStorage.getItem("sign"),
},
spinShow:false, spinShow:false,
} }
}, },
......
...@@ -14,19 +14,12 @@ ...@@ -14,19 +14,12 @@
</div> </div>
<div class="filter"> <div class="filter">
<label>{{ $t(5500316) }}</label> <label>{{ $t(5500316) }}</label>
<Select v-model="storageid" label-in-value clearable filterable filter-by-label class="searchSelect"> <Cascader class="searchSelect" :data="storageTree" clearable change-on-select @on-change="changeStorage"></Cascader>
<Option
v-for="(item,index) in storageList"
:value="item.id"
:key="index"
:label="item.name"
>{{ item.name }}</Option>
</Select>
</div> </div>
<div class="searchBtn"> <div class="searchBtn">
<Button type="primary" class="twoWord" icon="ios-search" @click="tosearch()">{{ $t(1001) }}</Button> <Button type="primary" class="twoWord" icon="ios-search" @click="tosearch()">{{ $t(1001) }}</Button>
<Button type="success" class="twoWord" icon="md-add-circle" @click="add()">{{$t('1002')}}</Button> <Button type="success" class="twoWord" icon="md-add-circle" @click="add()">{{$t('1002')}}</Button>
<!-- <Button type="warning" class="twoWord" icon="ios-create-outline" @click="edit()">{{$t('1003')}}</Button> <Button type="warning" class="twoWord" icon="ios-create-outline" @click="edit()">{{$t('1003')}}</Button>
<Button type="error" class="twoWord intervalRight" icon="md-close-circle" @click="dele()">{{ $t(1004) }}</Button> <Button type="error" class="twoWord intervalRight" icon="md-close-circle" @click="dele()">{{ $t(1004) }}</Button>
<Button type="primary" class="fourWord" icon="md-download" @click="loadexcel()">{{$t('1005')}}</Button> <Button type="primary" class="fourWord" icon="md-download" @click="loadexcel()">{{$t('1005')}}</Button>
<Upload <Upload
...@@ -47,7 +40,7 @@ ...@@ -47,7 +40,7 @@
icon="md-cloud-upload" icon="md-cloud-upload"
>{{$t('1006')}}</Button> >{{$t('1006')}}</Button>
</Upload> </Upload>
<Button type="primary" class="fourWord" icon="ios-cloud-download" @click="Export()">{{$t('1007')}}</Button> --> <Button type="primary" class="fourWord" icon="ios-cloud-download" @click="search(1)">{{$t('1007')}}</Button>
</div> </div>
</div> </div>
<div class="divborder newTableDiv"> <div class="divborder newTableDiv">
...@@ -95,17 +88,9 @@ ...@@ -95,17 +88,9 @@
</Select> </Select>
</div> </div>
<div class="filter"> <div class="filter">
<label><i>*</i>{{ $t(5500316) }}</label> <label><i>*</i>{{ $t(5500316) }}</label>
<Select v-model="addstorageid" label-in-value clearable filterable filter-by-label class="searchSelect"> <Cascader class="searchSelect" :data="addstorageTree" v-model="addstorageList" clearable change-on-select @on-change="changeStorage1"></Cascader>
<Option
v-for="(item,index) in storageList1"
:value="item.id"
:key="index"
:label="item.name"
>{{ item.name }}</Option>
</Select>
</div> </div>
<div class="filter"> <div class="filter">
<label><i>*</i>工装类型:</label> <label><i>*</i>工装类型:</label>
<Cascader class="searchSelect" :data="frockTypeTree" v-model="parentType" change-on-select @on-change="changeFrockType1"></Cascader> <Cascader class="searchSelect" :data="frockTypeTree" v-model="parentType" change-on-select @on-change="changeFrockType1"></Cascader>
...@@ -161,7 +146,7 @@ export default { ...@@ -161,7 +146,7 @@ export default {
whdata:[],//仓库列表 whdata:[],//仓库列表
warehouseid:"",//仓库id warehouseid:"",//仓库id
//储位 //储位
storageList:[], storageTree:[],
storageid:"",//储位id storageid:"",//储位id
//列表 //列表
...@@ -183,47 +168,61 @@ export default { ...@@ -183,47 +168,61 @@ export default {
}, },
{ {
title:'仓库名称', title:'仓库名称',
key:'warehouse_name' key:'wavehouse'
}, },
{ {
title:'储位信息', title:'储位信息',
key:'storage_info' key:'location'
}, },
{ {
title:'储位ID', title:'储位ID',
key:'storage_id' key:'locationid'
}, },
{ {
title:'工装类别', title:'工装类别',
key:'frock_type' key:'category'
}, },
{ {
title:'工装编号', title:'工装编号',
key:'frock_code' key:'code'
}, },
{ {
title:'工装名称', title:'工装名称',
key:'frock_name' key:'fixturetool'
}, },
{ {
title:'工装规格', title:'工装规格',
key:'frock_spec' key:'specfication'
}, },
{ {
title:'工件编号', title:'工件编号',
key:'workpiece_code' key:'sn'
}, },
{ {
title:'工序顺序', title:'工序顺序',
key:'process_seq' key:'routenumber'
}, },
{ {
title:'工序名称', title:'工序名称',
key:'process_name' key:'route'
}, },
{ {
title:'物料状态', title:'物料状态',
key:'material_status' key:'materialstate',
render:(h,params)=>{
let str = '';
//materialstate:1:有工装无工件2:有工装有工件3:无工装无工件4:无工装有工件
if(params.row.materialstate===1){
str = '有工装无工件';
}else if(params.row.materialstate===2){
str = '有工装有工件';
}else if(params.row.materialstate===2){
str = '无工装无工件';
}else if(params.row.materialstate===2){
str = '无工装有工件';
}
return h('span',str);
}
}, },
{ {
title:'备注', title:'备注',
...@@ -231,15 +230,32 @@ export default { ...@@ -231,15 +230,32 @@ export default {
}, },
{ {
title:'附件', title:'附件',
key:'file_url' key:'filename',
render:(h,params)=>{
return h('span',{
style:{
color:'#2b85e4',
cursor:'pointer'
},
on:{
click:()=>{
let name = params.row.filename;
let url = params.row.fileurl;
if(url){
this.downFile(url,name);
}
}
}
},params.row.filename);
}
}, },
{ {
title:'维护人', title:'维护人',
key:'user' key:'updator'
}, },
{ {
title:'维护时间', title:'维护时间',
key:'datetime' key:'updatetime'
} }
], ],
...@@ -247,8 +263,11 @@ export default { ...@@ -247,8 +263,11 @@ export default {
addmodal:false, //添加弹窗 addmodal:false, //添加弹窗
addwarehouseid:'',//仓库id addwarehouseid:'',//仓库id
type:1, type:1,
storageList1:[],//储位列表 addstorageTree:[],//储位列表
addstorageList:[],
addstorageid:'',//储位id addstorageid:'',//储位id
storagelevelnum:0,//储位层级数
frockTypeTree:[],//工装类型 frockTypeTree:[],//工装类型
parentType:[], parentType:[],
addfrockList:[],//工装列表 addfrockList:[],//工装列表
...@@ -256,6 +275,7 @@ export default { ...@@ -256,6 +275,7 @@ export default {
addremark:'',//备注 addremark:'',//备注
filename:'', filename:'',
fileurl:'', fileurl:'',
action: this.axios.publicPath + "wms/Upload/Submit?templateName=StorageLocation",
UploadAction: this.axios.publicPath + "config/upload/UploadImage", UploadAction: this.axios.publicPath + "config/upload/UploadImage",
headers: { headers: {
token: localStorage.getItem("token"), token: localStorage.getItem("token"),
...@@ -270,9 +290,11 @@ export default { ...@@ -270,9 +290,11 @@ export default {
created(){ created(){
this.initWarehouse();//仓库 this.initWarehouse();//仓库
this.initStorage(); this.initStorage();
this.tosearch();
this.tableColumns1 = this.$time.initTableTitle(this.tableColumns1); this.tableColumns1 = this.$time.initTableTitle(this.tableColumns1);
}, },
methods:{ methods:{
/*************搜索 start************ */
//仓库下拉框 //仓库下拉框
initWarehouse(){ initWarehouse(){
let params = { let params = {
...@@ -305,60 +327,112 @@ export default { ...@@ -305,60 +327,112 @@ export default {
this.initStorage(); this.initStorage();
} }
}, },
changeWarehouse1(value){
this.storageList1 = [];
this.addstorageid = "";
if(value != undefined){
this.addwarehouseid = value.value;
this.addinitStorage();
}
},
//储位 //储位
initStorage(){ initStorage(){
let params = { let params = {
page: 1, warehouseid: this.warehouseid,
pageSize: 1000000,
id: this.warehouseid, // 仓库id
isWarehouse: 1,
}; };
this.axios.request({ this.axios.request({
url: "/wms/Location/GetLocationList", url: "/wms/Location/GetLocationTree",
params, params,
method: "get", method: "get",
}) })
.then( .then((res) => {
(res) => { if (res.data.ret == 1) {
this.storageList = []; let arr = res.data.data;
let data = res.data.data; this.contentTree(arr);
if (res.data.ret == 1 &&Array.isArray(data)&&data.length) { this.storageTree = arr;
this.storageList = res.data.data;
}
} }
); });
},
contentTree (arr) {
arr.forEach(ele => {
ele.disabled = false;
ele.value = ele.id;
ele.label = ele.name;
if (
ele.children != undefined &&
ele.children != null &&
ele.children.length != 0
) {
this.contentTree(ele.children);
}else{
ele.children = []
}
});
}, },
//切换储位
changeStorage(){
this.storageid = "";
if(value != undefined && value.length){
this.storageid = value[value.length - 1];
}
},
/*************搜索 end************ */
/***************弹窗 start***************** */
//弹窗-切换仓库
changeWarehouse1(value){
this.addstorageTree = [];
this.addstorageid = "";
if(value != undefined){
this.addwarehouseid = value.value;
this.addinitStorage();
}
},
//弹窗-获取储位
addinitStorage(){ addinitStorage(){
let params = { let params = {
page: 1, warehouseid: this.addwarehouseid,
pageSize: 1000000,
id: this.addwarehouseid, // 仓库id
isWarehouse: 1,
}; };
this.axios.request({ this.axios.request({
url: "/wms/Location/GetLocationList", url: "/wms/Location/GetLocationTree",
params, params,
method: "get", method: "get",
}) })
.then( .then((res) => {
(res) => { if (res.data.ret == 1) {
this.storageList1 = []; let arr = res.data.data;
let data = res.data.data; this.contentTree1(arr);
if (res.data.ret == 1 &&Array.isArray(data)&&data.length) { this.addstorageTree = arr;
this.storageList1 = res.data.data;
}
} }
); });
},
contentTree1 (arr) {
let max = 0;
function eachfun(arr,floor){
arr.forEach(ele => {
ele.disabled = false;
ele.value = ele.id;
ele.label = ele.name;
if (floor > max) {
max = floor;
}
if (
ele.children != undefined &&
ele.children != null &&
ele.children.length != 0
) {
eachfun(ele.children,floor+1);
}else{
ele.children = []
}
});
}
eachfun(arr, 1);
this.storagelevelnum = max;
return arr;
}, },
//工装类型 //弹窗-切换储位
changeStorage1(value){
this.addstorageid = "";
if(Array.isArray(value)&&value.length == this.storagelevelnum){
this.addstorageid = value[value.length - 1];
}
else{
this.addstorageList = [];
}
},
//弹窗-工装类型
initFrockType(){ initFrockType(){
this.axios.request({ this.axios.request({
url: "/acc/FixtureTools/GetCategoryList", url: "/acc/FixtureTools/GetCategoryList",
...@@ -367,12 +441,12 @@ export default { ...@@ -367,12 +441,12 @@ export default {
.then((res) => { .then((res) => {
if (res.data.ret == 1) { if (res.data.ret == 1) {
let arr = res.data.data; let arr = res.data.data;
this.contentTree(arr); this.contentTree2(arr);
this.frockTypeTree = arr; this.frockTypeTree = arr;
} }
}); });
}, },
contentTree (arr) { contentTree2(arr) {
arr.forEach(ele => { arr.forEach(ele => {
ele.disabled = false; ele.disabled = false;
if ( if (
...@@ -380,21 +454,23 @@ export default { ...@@ -380,21 +454,23 @@ export default {
ele.children != null && ele.children != null &&
ele.children.length != 0 ele.children.length != 0
) { ) {
this.contentTree(ele.children); this.contentTree2(ele.children);
}else{ }else{
ele.children = [] ele.children = []
} }
}); });
}, },
//弹窗-工装类型变更
changeFrockType1(value){ changeFrockType1(value){
this.parentTypeid = ""; this.parentTypeid = "";//工装类型清空
this.parentType = []; this.addfrockList = [];//工装清空
this.addfrockid = '';//工装id清空
if(value!=undefined && value.length){ if(value!=undefined && value.length){
this.parentTypeid = value[value.length - 1]; this.parentTypeid = value[value.length - 1];
this.parentType = value;
this.getFrocksChange(); this.getFrocksChange();
} }
}, },
//弹窗-获取工装
getFrocksChange(){ getFrocksChange(){
this.addfrockid = ''; this.addfrockid = '';
let params = { let params = {
...@@ -419,6 +495,7 @@ export default { ...@@ -419,6 +495,7 @@ export default {
} }
}); });
}, },
/***************弹窗 end***************** */
tosearch(){ tosearch(){
this.page = 1; this.page = 1;
this.pagesize = 10; this.pagesize = 10;
...@@ -460,17 +537,175 @@ export default { ...@@ -460,17 +537,175 @@ export default {
}, },
add(){ add(){
this.type = 1; this.type = 1;
this.addwarehouseid = '';//仓库id
this.addstorageTree = [];
this.addstorageList = [];
this.addstorageid = '';//储位id
this.initFrockType();//工装类型 this.initFrockType();//工装类型
this.addstorageid = '';//仓库id
this.parentType = [];//工装类型 this.parentType = [];//工装类型
this.parentTypeid = '';//工装类型id this.parentTypeid = '';//工装类型id
this.addfrockid = '';//工装id this.addfrockid = '';//工装id
this.addremark = '';//备注 this.addremark = '';//备注
this.filename = ''; this.filename = '';
this.fileurl = ''; this.fileurl = '';
this.addmodal = true; this.addmodal = true;
}, },
//编辑
edit(){
if(!this.detailobj || !this.detailobj.id){
this.$Message.error(this.$t('1017'));
return false;
}
this.type = 2;
this.addwarehouseid = this.detailobj.wavehouseid;//仓库id
//获取储位
this.addinitStorage();
this.addstorageList = this.detailobj.locationIds;
this.addstorageid = this.detailobj.locationid;
//获取工装类型
this.initFrockType();//工装类型
this.parentType = this.detailobj.categoryIds;//工装类型
let categoryIds = this.detailobj.categoryIds;
if(Array.isArray(categoryIds)&& categoryIds.length){
this.parentTypeid = categoryIds[categoryIds.length -1];
this.getFrocksChange();
}
this.addfrockid = this.detailobj.fixturetoolid;//工装id
this.addremark = this.detailobj.remark?this.detailobj.remark:'';//备注
this.filename = this.detailobj.filename;
this.fileurl = this.detailobj.fileurl;
this.addmodal = true;
},
addPost(){
if(!this.addstorageid){
this.$Message.error("储位信息不能为空");
return false;
}
if(!this.addfrockid){
this.$Message.error("工装名称不能为空");
return false;
}
let url = '';
let id = '';
if(this.type === 1){
url = '/acc/AutomationLocation/Add';
id = 0;
}
else{
url = '/acc/AutomationLocation/Update';
id = this.detailobj.id;
}
let data = {
id:id,
locationid:this.addstorageid,//储位ID,前端填写的那个
fixturetoolid:this.addfrockid,//工装ID
fileurl:this.fileurl,//url
filename:this.filename,//附件名称
remark:this.addremark//备注
}
this.axios.request({
url: url,
data,
method: "post",
}).then((res) => {
if (res.data.ret == 1) {
this.addmodal = false;
if(this.type===1){
this.tosearch();
this.$Message.success(this.$t('1055'));
}
else{
this.$Message.success(this.$t('1060'));
this.search(0);
}
} else {
this.$Message.error(this.$t(res.data.msg+''));
}
});
},
//删除
dele(){
if (
this.detailobj.id === undefined ||
this.detailobj.id === null
) {
this.$Message.error(this.$t("1017"));
return false;
} else {
var params = {
id: this.detailobj.id,
};
this.$Modal.confirm({
title: this.$t("1018"),
content: "",
width: "290px",
closable: true,
okText: this.$t("1004"),
onOk: () => {
this.axios.request({
url: "/acc/AutomationLocation/Delete",
params,
method: "get",
})
.then((res) => {
if (res.data.ret === 1) {
this.$Message.success(this.$t("1058"));
this.search(0);
} else {
this.$Message.error(this.$t(res.data.msg));
}
});
},
});
}
},
//导出模板
loadexcel() {
// this.axios.request({
// url: "/config/Download/GetTemplate?name=StorageLocation",
// method: "get",
// })
// .then((res) => {
// if (res.data.ret === 1) {
// window.location.href =
// this.axios.publicPath + "" + res.data.data;
// } else {
// this.$Message.error(this.$t(res.data.msg));
// }
// });
},
/*********文件上传 start******** */ /*********文件上传 start******** */
//下载文件
downFile(url,fileName){
let params = {
url: url,
name:fileName
};
this.axios.request({
url: "/config/Download/DownloadFileByUrl",
params,
method: "get",
responseType: "blob"
})
.then((res) => {
if (res.status == 200) {
let url;
let link = document.createElement("a");
url = window.URL.createObjectURL(res.data);
link.style.display = "none";
link.href = url;
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
}
}).catch(error=>{
this.$Message.error('请求错误')
});
},
handleBeforeUpload(file){ handleBeforeUpload(file){
this.spinShow = true; this.spinShow = true;
if(!file){ if(!file){
...@@ -509,6 +744,26 @@ export default { ...@@ -509,6 +744,26 @@ export default {
this.page = value; this.page = value;
this.search(0); this.search(0);
}, },
handleFormatError(file) {
this.$Message.error(
this.$t("950396") + file.name + this.$t("950397")
);
},
handleSuccess(res, file) {
if (res.ret == 1) {
this.$Message.success(this.$t("950398"));
this.tosearch();
} else {
if ((res.msg + "").indexOf(",") != -1) {
inittip(res.msg);
} else {
this.$Message.error(this.$t(res.data));
}
}
},
handleError() {
this.$Message.error(this.$t("2010006") + "!");
},
} }
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment