Commit 94e31f23 by yucheng.jiang

工装类型

parent 0a6ba9b6
...@@ -123,7 +123,9 @@ ...@@ -123,7 +123,9 @@
<div class="frockUploadFile"> <div class="frockUploadFile">
<Upload <Upload
:before-upload="handleUpload" :before-upload="handleUpload"
:on-success="uploadFile" :on-success="handleSuccess"
:on-error="handleError"
:headers="headers"
:action="fileAction"> :action="fileAction">
<Button class="UFbtn" icon="ios-cloud-upload-outline" :title="filename">{{filename?filename:'上传文件'}}</Button> <Button class="UFbtn" icon="ios-cloud-upload-outline" :title="filename">{{filename?filename:'上传文件'}}</Button>
</Upload> </Upload>
...@@ -233,6 +235,12 @@ export default { ...@@ -233,6 +235,12 @@ export default {
fileurl:'',//文件路径 fileurl:'',//文件路径
loadingStatus: false, loadingStatus: false,
fileAction: this.axios.publicPath + "config/upload/UploadImage", fileAction: this.axios.publicPath + "config/upload/UploadImage",
headers: {
token: localStorage.getItem("token"),
timestamp: localStorage.getItem("timestamp"),
nonce: localStorage.getItem("nonce"),
sign: localStorage.getItem("sign"),
},
} }
}, },
created(){ created(){
...@@ -341,7 +349,7 @@ export default { ...@@ -341,7 +349,7 @@ export default {
this.file = file; this.file = file;
return false; return false;
}, },
uploadFile (res) { handleSuccess (res) {
console.log(222222) console.log(222222)
console.log(res) console.log(res)
this.loadingStatus = true; this.loadingStatus = true;
...@@ -351,6 +359,10 @@ export default { ...@@ -351,6 +359,10 @@ export default {
this.$Message.success('Success') this.$Message.success('Success')
}, 1500); }, 1500);
}, },
handleError(error){
console.log(1111111)
console.log(error)
},
addPost(){ addPost(){
}, },
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
<div class="divborder newSearchDiv"> <div class="divborder newSearchDiv">
<div class="filter"> <div class="filter">
<label>工装类型:</label> <label>工装类型:</label>
<Cascader class="searchSelect" :data="frockTypeTree" clearable change-on-select v-model="frockType" @on-change="changeFrockType"></Cascader> <Cascader class="searchSelect" :data="frockTypeTree" v-model="frockType" clearable change-on-select @on-change="changeFrockType"></Cascader>
</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
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,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>
...@@ -65,7 +65,8 @@ ...@@ -65,7 +65,8 @@
<div style=""> <div style="">
<div class="filter"> <div class="filter">
<label>上级类型:</label> <label>上级类型:</label>
<Cascader class="searchSelect" :data="frockTypeTree" change-on-select v-model="parentType" @on-change="changeFrockType1"></Cascader> <Cascader v-show="type==1" class="searchSelect" :data="frockTypeTree" change-on-select v-model="parentType" @on-change="changeFrockType1"></Cascader>
<Input v-show="type==2" type="text" class="searchInput" v-model="parentTypename" disabled/>
</div> </div>
<div class="filter"> <div class="filter">
<label><i>*</i>工装类型:</label> <label><i>*</i>工装类型:</label>
...@@ -84,6 +85,14 @@ ...@@ -84,6 +85,14 @@
export default { export default {
data(){ data(){
return{ return{
//导入方法
action: this.axios.publicPath + "wms/Upload/Submit?templateName=StorageLocation",
headers: {
token: localStorage.getItem("token"),
timestamp: localStorage.getItem("timestamp"),
nonce: localStorage.getItem("nonce"),
sign: localStorage.getItem("sign"),
},
frockTypeTree:[],//树形结构 frockTypeTree:[],//树形结构
frockType:[],//工装类型 frockType:[],//工装类型
frockTypeid:'', frockTypeid:'',
...@@ -118,6 +127,7 @@ export default { ...@@ -118,6 +127,7 @@ export default {
type:1,//1添加 2编辑 type:1,//1添加 2编辑
parentType:[],//父级类型 parentType:[],//父级类型
parentTypeid:'', parentTypeid:'',
parentTypename:'',
frockTypename:'',//工装类型名称 frockTypename:'',//工装类型名称
} }
}, },
...@@ -135,8 +145,8 @@ export default { ...@@ -135,8 +145,8 @@ 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.frockTypeTree = arr;
this.contentTree(arr); this.contentTree(arr);
this.frockTypeTree = arr;
} }
}); });
}, },
...@@ -144,12 +154,15 @@ export default { ...@@ -144,12 +154,15 @@ export default {
arr.forEach(ele => { arr.forEach(ele => {
ele.disabled = false; ele.disabled = false;
if ( if (
ele.children.length != 0 &&
ele.children != undefined && ele.children != undefined &&
ele.children != null ele.children != null &&
ele.children.length != 0
) { ) {
this.contentTree(ele.children); this.contentTree(ele.children);
} }
else{
ele.children = []
}
}); });
}, },
changeFrockType(value){ changeFrockType(value){
...@@ -186,7 +199,7 @@ export default { ...@@ -186,7 +199,7 @@ export default {
if(toexcel === 1){ if(toexcel === 1){
if (res.data.ret === 1) { if (res.data.ret === 1) {
window.location.href = window.location.href =
axios.publicPath + "" + res.data.data; this.axios.publicPath + "" + res.data.data;
} else { } else {
this.$Message.error(this.$t(res.data.msg)); this.$Message.error(this.$t(res.data.msg));
} }
...@@ -209,6 +222,17 @@ export default { ...@@ -209,6 +222,17 @@ export default {
this.frockTypename = ''; this.frockTypename = '';
this.type = 1; this.type = 1;
}, },
edit(){
if(!this.detailobj || !this.detailobj.id){
this.$Message.error(this.$t('1017'));
return false;
}
this.parentTypeid = this.detailobj.parentid;
this.parentTypename = this.detailobj.parentname;
this.frockTypename = this.detailobj.name;
this.type = 2;
this.addmodal = true;
},
addPost(){ addPost(){
if(!this.frockTypename.trim()){ if(!this.frockTypename.trim()){
this.$Message.error("请输入工装类型"); this.$Message.error("请输入工装类型");
...@@ -250,6 +274,57 @@ export default { ...@@ -250,6 +274,57 @@ export default {
} }
}); });
}, },
//删除
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/FixtureTools/DeleteCategory",
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));
// }
// });
},
handleRowChange(currentRow, oldCurrentRow) { handleRowChange(currentRow, oldCurrentRow) {
this.detailobj = currentRow; this.detailobj = currentRow;
}, },
...@@ -262,6 +337,27 @@ export default { ...@@ -262,6 +337,27 @@ 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.initFrockType();
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