Commit 77fcff6a by jiawei.su
parents 0e9077ae 8c64b072
......@@ -139,7 +139,7 @@
</div>
</div>
<div slot="footer">
<Button type="text" size="large" @click="this.addmodal=false">{{$t('1033')}}</Button>
<Button type="text" size="large" @click="addmodal=false">{{$t('1033')}}</Button>
<Button type="primary" size="large" @click="addPost()">{{$t('1011')}}</Button>
</div>
</Modal>
......
......@@ -143,7 +143,7 @@
</div>
</div>
<div slot="footer">
<Button type="text" size="large" @click="this.addmodal=false">{{$t('1033')}}</Button>
<Button type="text" size="large" @click="addmodal=false">{{$t('1033')}}</Button>
<Button type="primary" size="large" @click="addPost()">{{$t('1011')}}</Button>
</div>
</Modal>
......
......@@ -9,18 +9,24 @@
:value="item.id"
:key="index"
:label="item.name"
>{{ item.name }}</Option
>
>{{ item.name }}</Option>
</Select>
</div>
<div class="filter">
<label>{{ $t(5500316) }}</label>
<Cascader class="searchSelect" :data="storageTree" change-on-select v-model="storageValue" @on-change="changeStorage"></Cascader>
<Select v-model="storageid" label-in-value clearable filterable filter-by-label class="searchSelect">
<Option
v-for="(item,index) in storageList"
:value="item.id"
:key="index"
:label="item.name"
>{{ item.name }}</Option>
</Select>
</div>
<div class="searchBtn">
<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="warning" class="twoWord" icon="ios-create-outline" @click="edit()">{{$t('1003')}}</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="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>
<Upload
......@@ -68,47 +74,80 @@
</div>
</div>
<Modal class="newModalClass" v-model="addmodal" :styles="{width:'400px'}">
<Modal class="newModalClass" v-model="addmodal" :styles="{width:'650px'}">
<p slot="header">
<span v-show="type==1">{{$t('1002')}}</span>
<span v-show="type==2">{{$t('1003')}}</span>
</p>
<div style="">
<div class="demo-spin-col">
<Spin fix v-if="spinShow">
<div>正在上传...</div>
</Spin>
<div class="filter">
<label><i>*</i>{{ $t(8070) }}</label>
<Select v-model="warehouseid1" label-in-value clearable filterable filter-by-label class="searchSelect">
<Select v-model="addwarehouseid" label-in-value clearable filterable filter-by-label @on-change="changeWarehouse1" class="searchSelect">
<Option
v-for="(item,index) in whdata1"
v-for="(item,index) in whdata"
:value="item.id"
:key="index"
:label="item.name"
>{{ item.name }}</Option
>
>{{ item.name }}</Option>
</Select>
</div>
<div class="filter">
<label><i>*</i>储位信息:</label>
<Input type="text" class="searchInput" v-model="warehouseid1" />
<label><i>*</i>{{ $t(5500316) }}</label>
<Select v-model="addstorageid" label-in-value clearable filterable filter-by-label class="searchSelect">
<Option
v-for="(item,index) in storageList1"
:value="item.id"
:key="index"
:label="item.name"
>{{ item.name }}</Option>
</Select>
</div>
<div class="filter">
<label><i>*</i>工装类</label>
<Input type="text" class="searchInput" v-model="warehouseid1" />
<label><i>*</i>工装类</label>
<Cascader class="searchSelect" :data="frockTypeTree" v-model="parentType" change-on-select @on-change="changeFrockType1"></Cascader>
</div>
<div class="filter">
<label><i>*</i>工装编号:</label>
<Input type="text" class="searchInput" v-model="warehouseid1" />
<label><i>*</i>工装名称:</label>
<Select v-model="addfrockid" label-in-value clearable filterable filter-by-label class="searchSelect">
<Option
v-for="(item,index) in addfrockList"
:value="item.id"
:key="index"
:label="item.name+'#'+item.code"
>{{ item.name+'#'+item.code }}</Option>
</Select>
</div>
<div class="filter">
<label><i>*</i>附件</label>
<Input type="text" class="searchInput" v-model="warehouseid1" />
<label>备注</label>
<Input type="text" class="searchInput" v-model="addremark" />
</div>
<div class="filter">
<label><i>*</i>备注:</label>
<Input type="text" class="searchInput" v-model="warehouseid1" />
<div>
<label>上传文件:</label>
<div class="accountInfoUploadFile">
<Upload
ref="upload"
:show-upload-list="false"
:on-success="handleSuccess1"
:before-upload="handleBeforeUpload"
:on-error="handleError1"
type="drag"
:headers="headers"
:action="UploadAction">
<div class="descicon" style="">
<Icon type="md-cloud-upload" size="15"></Icon>
<span>上传文件</span>
</div>
</Upload>
<div v-show="filename" class="hasfile">{{filename}}<Icon @click.native="delfile" type="ios-close-circle" size="15" /></div>
</div>
</div>
</div>
<div slot="footer">
<Button type="text" size="large" @click="this.modal=false">{{$t('1033')}}</Button>
<Button type="text" size="large" @click="addmodal=false">{{$t('1033')}}</Button>
<Button type="primary" size="large" @click="addPost()">{{$t('1011')}}</Button>
</div>
</Modal>
......@@ -121,11 +160,11 @@ export default {
return{
whdata:[],//仓库列表
warehouseid:"",//仓库id
//储位树形结构
storageTree:[],
storageValue:[],//储位数据
//储位
storageList:[],
storageid:"",//储位id
//列表
total:0,
page:1,
pagesize:10,
......@@ -204,14 +243,33 @@ export default {
}
],
addmodal:true, //添加弹窗
whdata1:[],//仓库数据集合
warehouseid1:'',//仓库id
//弹窗
addmodal:false, //添加弹窗
addwarehouseid:'',//仓库id
type:1,
storageList1:[],//储位列表
addstorageid:'',//储位id
frockTypeTree:[],//工装类型
parentType:[],
addfrockList:[],//工装列表
addfrockid:'',//工装名称
addremark:'',//备注
filename:'',
fileurl:'',
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,
}
},
created(){
this.initWarehouse();//仓库
this.initStorage();
this.tableColumns1 = this.$time.initTableTitle(this.tableColumns1);
},
methods:{
......@@ -240,52 +298,127 @@ export default {
},
//切换仓库
changeWarehouse(value){
this.storageTree = [];
this.storageList = [];
this.storageid = "";
if(value != undefined){
this.warehouseid = value.value;
this.initStorage();
}
},
changeWarehouse1(value){
this.storageList1 = [];
this.addstorageid = "";
if(value != undefined){
this.warehouseid = value.value;
this.addinitStorage();
}
},
//储位
initStorage(){
let params = {
id:this.warehouseid?this.warehouseid:0
}
page: 1,
pageSize: 1000000,
id: this.warehouseid, // 仓库id
isWarehouse: 1,
};
this.axios.request({
url: "/wms/Location/GetLocationList",
params,
method: "get",
})
.then(
(res) => {
this.storageList = [];
let data = res.data.data;
if (res.data.ret == 1 &&Array.isArray(data)&&data.length) {
this.storageList = res.data.data;
}
}
);
},
addinitStorage(){
let params = {
page: 1,
pageSize: 1000000,
id: this.addwarehouseid, // 仓库id
isWarehouse: 1,
};
this.axios.request({
url: "/wms/Location/GetLocationTypeListNoPage",
url: "/wms/Location/GetLocationList",
params,
method: "get",
})
.then(
(res) => {
this.storageList1 = [];
let data = res.data.data;
if (res.data.ret == 1 &&Array.isArray(data)&&data.length) {
this.storageList1 = res.data.data;
}
}
);
},
//工装类型
initFrockType(){
this.axios.request({
url: "/acc/FixtureTools/GetCategoryList",
method: "get",
})
.then((res) => {
if (res.data.ret == 1) {
let arr = res.data.data.children;
this.storageTree = arr;
let arr = res.data.data;
this.contentTree(arr);
this.frockTypeTree = arr;
}
});
},
contentTree (arr) {
arr.forEach(ele => {
ele.disabled = false;
ele.value = ele.id;
ele.label = ele.name;
if (
ele.children.length != 0 &&
ele.children != undefined &&
ele.children != null
ele.children != null &&
ele.children.length != 0
) {
this.contentTree(ele.children);
}else{
ele.children = []
}
});
},
//切换储位
changeStorage(value){
this.storageid = "";
changeFrockType1(value){
this.parentTypeid = "";
this.parentType = [];
if(value!=undefined && value.length){
this.storageid = value[value.length - 1];
this.parentTypeid = value[value.length - 1];
this.parentType = value;
this.getFrocksChange();
}
},
getFrocksChange(){
this.addfrockid = '';
let params = {
category:this.parentTypeid,//工装类型id
code:'',
name:'',
state:1, //0停用 1可用
page:1,
pagesize:1000000,
toexcel:0 //0查询 1导出
}
this.axios.request({
url: "/acc/FixtureTools/GetPageList",
params,
method: "get",
})
.then((res) => {
this.addfrockList = [];
let data = res.data.data;
if (res.data.ret == 1 &&Array.isArray(data)&&data.length) {
this.addfrockList = res.data.data;
}
});
},
tosearch(){
this.page = 1;
this.pagesize = 10;
......@@ -293,15 +426,15 @@ export default {
},
search(toexcel){
let params = {
warehouseid:this.warehouseid,//仓库id
storageid:this.storageid,//储位id
wavehouseid:this.warehouseid,//仓库id
locationid:this.storageid,//储位id
page:this.page,
pagesize:this.pagesize,
toexcel:toexcel //0查询 1导出
}
this.detailobj = {};
this.axios.request({
url: "/wms/storageInfoQuery/search",
url: "/acc/AutomationLocation/GetPageList",
params,
method: "get",
})
......@@ -309,7 +442,7 @@ export default {
if(toexcel === 1){
if (res.data.ret === 1) {
window.location.href =
axios.publicPath + "" + res.data.data;
this.axios.publicPath + "" + res.data.data;
} else {
this.$Message.error(this.$t(res.data.msg));
}
......@@ -325,6 +458,37 @@ export default {
}
});
},
add(){
this.type = 1;
this.addmodal = true;
},
/*********文件上传 start******** */
handleBeforeUpload(file){
this.spinShow = true;
if(!file){
this.spinShow = false;
return false;
}
},
handleSuccess1 (res,file) {
this.spinShow = false;
if (res.ret == 1) {
this.$Message.success(this.$t("100378"));
this.filename = file.name;
this.fileurl = res.data;
} else {
this.$Message.error(this.$t(res.msg+''));
}
},
handleError1(){
this.spinShow = false;
this.$Message.error(this.$t("600512") + "!");
},
delfile(){
this.filename = '';
this.fileurl = '';
},
/*********文件上传 end******** */
handleRowChange(currentRow, oldCurrentRow) {
this.detailobj = currentRow;
},
......@@ -340,6 +504,39 @@ export default {
}
}
</script>
<style>
<style lang="less">
.accountInfoUploadFile{
display:inline-block;
position: relative;
left: 5px;
.ivu-upload{
display: inline-block;
width: 140px;
height: 29px;
vertical-align: middle;
.descicon{
width: 140px;
height:29px;
line-height: 29px;
}
}
.ivu-upload-drag{
border:1px solid #dcdee2!important;
}
.ivu-upload-drag:hover {
border: 1px solid #2d8cf0!important;
}
.hasfile{
display: inline-block;
position: relative;
left: -140px;
top: 29px;
i{
color: red;
font-size: 15px;
cursor: pointer;
vertical-align: top;
}
}
}
</style>
\ No newline at end of file
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