|
|
@ -11,7 +11,7 @@ |
|
|
|
<el-button type="primary" @click="addStorehouseDialog">新增</el-button> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-table :data="storehouseList.slice((queryInfo.pageNum-1)*queryInfo.pageSize,queryInfo.pageNum*queryInfo.pageSize)" |
|
|
|
<el-table :data="storehouseList.slice((queryInfo.current-1)*queryInfo.size,queryInfo.current*queryInfo.size)" |
|
|
|
style="width: 100%" |
|
|
|
stripe border fixed height="500"> |
|
|
|
<el-table-column |
|
|
@ -50,37 +50,61 @@ |
|
|
|
<el-pagination |
|
|
|
@size-change="handleSizeChange" |
|
|
|
@current-change="handleCurrentChange" |
|
|
|
:current-page="queryInfo.pageNum" |
|
|
|
:current-page="queryInfo.current" |
|
|
|
:page-sizes="[10, 20, 30, 40]" |
|
|
|
:page-size="queryInfo.pageSize" |
|
|
|
:page-size="queryInfo.size" |
|
|
|
layout="total, sizes, prev, pager, next, jumper" |
|
|
|
:total="total"> |
|
|
|
</el-pagination> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
<el-dialog :title="title" :visible.sync="storehouseDialogVisible" width="65%" > |
|
|
|
<el-dialog :title="title" :visible.sync="storehouseDialogVisible" width="75%" > |
|
|
|
|
|
|
|
<el-form :model="form" :rules="rules" ref="form" label-position="right" class="demo-form-inline"> |
|
|
|
<el-row > |
|
|
|
<el-col :span="3.2" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>仓库名称:</span> |
|
|
|
<span><span class="icon">*</span>客户名称:</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="trightb"> |
|
|
|
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="仓库名称" class="addinputw" clearable /></el-form-item> |
|
|
|
<el-col :span="3" class="trightb"> |
|
|
|
<el-form-item prop="custerName"> |
|
|
|
<el-select size="small" v-model="form.custerName" placeholder="请选择" > |
|
|
|
<el-option |
|
|
|
v-for="custName in storehouseListss" |
|
|
|
:key="custName.name" |
|
|
|
:label="custName.name" |
|
|
|
:value="custName.name"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>仓库名称:</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" class="trightb"> |
|
|
|
<el-form-item prop="name"> |
|
|
|
<el-select size="small" v-model="form.name" placeholder="请选择" @change="getSupplier" > |
|
|
|
<el-option |
|
|
|
v-for="(storehouse,i) in storeList" |
|
|
|
:key="i" |
|
|
|
:label="storehouse.name" |
|
|
|
:value="storehouse.name"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>仓库简称:</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="trightb"> |
|
|
|
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="仓库简称" class="addinputw" clearable /></el-form-item> |
|
|
|
<el-col :span="3" class="trightb"> |
|
|
|
<el-form-item prop="simpleName"><el-input size="small" v-model="form.simpleName" placeholder="仓库简称" class="addinputw" clearable /></el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>仓库编码:</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="trightb"> |
|
|
|
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="仓库编码" class="addinputw" clearable /></el-form-item> |
|
|
|
<el-form-item prop="code"><el-input size="small" v-model="form.code" placeholder="仓库编码" class="addinputw" clearable /></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
@ -90,18 +114,18 @@ |
|
|
|
<span><span class="icon">*</span>所属地: </span> |
|
|
|
</el-col> |
|
|
|
<el-form-item prop="simpleName"> |
|
|
|
<el-select size="small" class = "arriveClass" v-model="form.region1" placeholder="请选择省" @change = "provinceChange($event)"> |
|
|
|
<el-option v-for="(item,index) in form.provinceList" :key="index" :label="item.name" :value="item.name"> |
|
|
|
<el-select size="small" class = "arriveClass" v-model="form.provinceName" placeholder="请选择省" @change = "provinceChange($event)"> |
|
|
|
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.name" :value="item.name"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
|
|
|
|
<el-select size="small" class = "arriveClass" v-model="form.region2" placeholder="请选择市" :disabled="changeCity" @change = "cityChange($event)"> |
|
|
|
<el-option v-for="(item,index) in form.cityList" :key="index" :label="item.name" :value="item.name"> |
|
|
|
<el-select size="small" class = "arriveClass" v-model="form.cityName" placeholder="请选择市" :disabled="changeCity" @change = "cityChange($event)"> |
|
|
|
<el-option v-for="(item,index) in cityList" :key="index" :label="item.name" :value="item.name"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
|
|
|
|
<el-select size="small" class = "arriveClass" v-model="form.region3" :disabled="changeCounty" placeholder="请选择区县"> |
|
|
|
<el-option v-for="(item,index) in form.countyList" :key="index" :label="item.name" :value="item.name"> |
|
|
|
<el-select size="small" class = "arriveClass" v-model="form.countyName" :disabled="changeCounty" placeholder="请选择区县"> |
|
|
|
<el-option v-for="(item,index) in countyList" :key="index" :label="item.name" :value="item.name"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
@ -109,68 +133,86 @@ |
|
|
|
|
|
|
|
<el-row > |
|
|
|
<el-col :span="3.2" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>库房面积:</span> |
|
|
|
<span><span class="icon">*</span>详细地址:</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="trightb"> |
|
|
|
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="库房面积" class="addinputw" clearable /></el-form-item> |
|
|
|
<el-form-item prop="address"><el-input size="small" v-model="form.address" placeholder="详细地址" class="addinputw" clearable /></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>库房面积:</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" class="trightb"> |
|
|
|
<el-form-item prop="acreage"><el-input size="small" v-model="form.acreage" placeholder="库房面积" class="addinputw" clearable /></el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>库房高度:</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" class="trightb"> |
|
|
|
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="库房高度" class="addinputw" clearable /></el-form-item> |
|
|
|
<el-form-item prop="storeyHeight"><el-input size="small" v-model="form.storeyHeight" placeholder="库房高度" class="addinputw" clearable /></el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>月租金:</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" class="trightb"> |
|
|
|
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="月租金" class="addinputw" clearable /></el-form-item> |
|
|
|
<el-form-item prop="monthlyPrice"><el-input size="small" v-model="form.monthlyPrice" placeholder="月租金" class="addinputw" clearable /></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row > |
|
|
|
<el-col :span="3.2" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>库房性质编码:</span> |
|
|
|
<span><span class="icon">*</span>库房性质名称:</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6" class="trightb"> |
|
|
|
<el-form-item prop="name"> |
|
|
|
<el-select size="small" class = "arriveClass" v-model="form.region1" placeholder="库房性质编码" @change = "provinceChange($event)"> |
|
|
|
<el-option v-for="(item,index) in form.provinceList" :key="index" :label="item.name" :value="item.name"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
<el-col :span="3" class="trightb"> |
|
|
|
<el-form-item prop="attributeNames"> |
|
|
|
<el-input size="small" v-model="form.attributeNames" placeholder="库房性质名称" class="addinputw" clearable /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<el-col :span="2" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>房源:</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="trightb"> |
|
|
|
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="房源" class="addinputw" clearable /></el-form-item> |
|
|
|
<el-col :span="3" class="trightb"> |
|
|
|
<el-form-item prop="housingResource"><el-input size="small" v-model="form.housingResource" placeholder="房源" class="addinputw" clearable /></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row > |
|
|
|
<el-col :span="3.2" class="tleftb"> |
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>联系人姓名:</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="trightb"> |
|
|
|
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="联系人姓名" class="addinputw" clearable /></el-form-item> |
|
|
|
<el-col :span="3" class="trightb"> |
|
|
|
<el-form-item prop="linkerName"><el-input size="small" v-model="form.linkerName" placeholder="联系人姓名" class="addinputw" clearable /></el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>联系人电话:</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" class="trightb"> |
|
|
|
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="联系人电话" class="addinputw" clearable /></el-form-item> |
|
|
|
<el-form-item prop="linkerPhone"><el-input size="small" v-model="form.linkerPhone" placeholder="联系人电话" class="addinputw" clearable /></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<el-row > |
|
|
|
<el-col :span="3.2" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>附件:</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" class="trightb"> |
|
|
|
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="附件" class="addinputw" clearable /></el-form-item> |
|
|
|
<el-form-item prop="picUrl"> |
|
|
|
<el-upload |
|
|
|
ref="upload" |
|
|
|
class="upload-demo" |
|
|
|
accept=".xls" |
|
|
|
:action="updateAction" |
|
|
|
:file-list="fileList" |
|
|
|
:on-progress="handleProgress" |
|
|
|
:on-success="handleSuccess" |
|
|
|
:multiple="false" |
|
|
|
:show-file-list="false" |
|
|
|
:before-remove="beforeRemove" |
|
|
|
:limit="1"> |
|
|
|
<el-button size="small" type="primary">点击上传</el-button> |
|
|
|
</el-upload> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
@ -189,15 +231,25 @@ export default { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
queryInfo: { |
|
|
|
query: '', |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10 |
|
|
|
total: 0, |
|
|
|
size: 1, |
|
|
|
current: 10, |
|
|
|
params:{ |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
total: 0, |
|
|
|
changeCity: true, |
|
|
|
changeCounty: true, |
|
|
|
storehouseList: [], |
|
|
|
storehouseListss: [], |
|
|
|
storeList: [], |
|
|
|
provinceList: [], |
|
|
|
cityList: [], |
|
|
|
countyList: [], |
|
|
|
updateAction: 'http://8.130.39.13:9050/v1/shstorehouse/upload', |
|
|
|
storehouseDialogVisible: false, |
|
|
|
// myHeaders: { Access-Control-Allow-Origin}, |
|
|
|
title: '新增仓库', |
|
|
|
storehouseForm: { |
|
|
|
name: '', |
|
|
@ -217,17 +269,26 @@ export default { |
|
|
|
] |
|
|
|
}, |
|
|
|
tableData:[], |
|
|
|
fileList: [], |
|
|
|
totalPrice:0, |
|
|
|
form:{ |
|
|
|
name:"", |
|
|
|
region1:'', |
|
|
|
region2:'', |
|
|
|
region3:'', |
|
|
|
xxarrive:'', |
|
|
|
tel:'', |
|
|
|
provinceList:[], |
|
|
|
cityList:[], |
|
|
|
countyList:[] |
|
|
|
name:'', |
|
|
|
custerName:"", |
|
|
|
provinceName:'', |
|
|
|
cityName:'', |
|
|
|
simpleName:'', |
|
|
|
code:'', |
|
|
|
countyName:'', |
|
|
|
address:'', |
|
|
|
acreage:'', |
|
|
|
storeyHeight:'', |
|
|
|
monthlyPrice:'', |
|
|
|
attributeNames:'', |
|
|
|
attributeCodes:'', |
|
|
|
housingResource:'', |
|
|
|
linkerName:'', |
|
|
|
linkerPhone:'', |
|
|
|
picUrl:'' |
|
|
|
}, |
|
|
|
CITY:[], |
|
|
|
XIAN:[], |
|
|
@ -237,15 +298,15 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleSizeChange (val) { |
|
|
|
this.queryInfo.pageSize = val |
|
|
|
this.queryInfo.size = val |
|
|
|
this.getStorehouseList() |
|
|
|
}, |
|
|
|
handleCurrentChange (val) { |
|
|
|
this.queryInfo.pageNum = val |
|
|
|
this.queryInfo.current = val |
|
|
|
this.getStorehouseList() |
|
|
|
}, |
|
|
|
async getStorehouseList () { |
|
|
|
const { data: result } = await this.$http.get('/storehouse/list', { params: this.queryInfo }) |
|
|
|
const { data: result } = await this.$http.get('/v1/shstorehouse/listPage', { params: this.queryInfo },) |
|
|
|
if (result.status !== 200) return this.$message.error('获取列表失败') |
|
|
|
|
|
|
|
this.total = result.data.total |
|
|
@ -255,6 +316,24 @@ export default { |
|
|
|
this.title = '新增仓库' |
|
|
|
this.storehouseDialogVisible = true |
|
|
|
}, |
|
|
|
async getStorehouseLists () { |
|
|
|
const { data: result } = await this.$http.get('/purchase/getStorehouse') |
|
|
|
if (result.status !== 200) return this.$message.error('获取仓库列表失败') |
|
|
|
this.storehouseLists = result.data |
|
|
|
this.storehouseListss = result.data |
|
|
|
for (var i = 0; i < this.storehouseLists.length; i++) { |
|
|
|
|
|
|
|
let item = { |
|
|
|
name: this.storehouseLists[i].name, |
|
|
|
} |
|
|
|
this.storeList.push(item) |
|
|
|
} |
|
|
|
}, |
|
|
|
getSupplier(value) { |
|
|
|
const choose = this.storehouseLists.filter((item) => item.name === value) |
|
|
|
this.form.simpleName = choose[0].simpleName |
|
|
|
this.form.code = choose[0].addr |
|
|
|
}, |
|
|
|
updataStorehousedialog (storehouse) { |
|
|
|
this.storehouseForm.name = storehouse.name |
|
|
|
this.storehouseForm.simpleName = storehouse.simpleName |
|
|
@ -263,14 +342,12 @@ export default { |
|
|
|
this.title = '修改仓库' |
|
|
|
this.storehouseDialogVisible = true |
|
|
|
}, |
|
|
|
addStorehouse () { |
|
|
|
this.$refs.storehouseRuleForm.validate(async valid => { |
|
|
|
const { data: result } = await this.$http.post('/storehouse/addStorehouse', this.storehouseForm) |
|
|
|
if (result.status !== 200) return this.$message.error('添加仓库失败') |
|
|
|
async addStorehouse () { |
|
|
|
const { data: result } = await this.$http.post('/v1/shstorehouse/save', this.form) |
|
|
|
if (result.code !== 200) return this.$message.error('添加仓库失败') |
|
|
|
this.$message.success('成功添加仓库') |
|
|
|
this.getStorehouseList() |
|
|
|
this.storehouseDialogVisible = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
async updataStorehouse () { |
|
|
|
const { data: result } = await this.$http.put('/storehouse/updataStorehouse', this.storehouseForm) |
|
|
@ -307,10 +384,10 @@ export default { |
|
|
|
subdistrict:3 // 要获取的行政区划的级别:省、市、县三级 |
|
|
|
} |
|
|
|
}).then((res)=>{ |
|
|
|
this.form.provinceList = res.data.districts[0].districts /* 省*/ |
|
|
|
this.provinceList = res.data.districts[0].districts /* 省*/ |
|
|
|
/* 进行遍历赋值*/ |
|
|
|
/* 市区和县区*/ |
|
|
|
let newProvince = this.form.provinceList |
|
|
|
let newProvince = this.provinceList |
|
|
|
for(let i = 0; i < newProvince.length; i++){ /* 省级*/ |
|
|
|
for(let j = 0; j < newProvince[i].districts.length; j++){ /* 市级*/ |
|
|
|
let city = newProvince[i].districts[j].name |
|
|
@ -324,58 +401,82 @@ export default { |
|
|
|
for(let m = 0; m < newProvince.length;m++){ |
|
|
|
newProvince[m] = {...newProvince[m],...{code:m+1}} |
|
|
|
} |
|
|
|
this.form.provinceList = newProvince |
|
|
|
this.provinceList = newProvince |
|
|
|
}) |
|
|
|
}, |
|
|
|
provinceChange(that){ |
|
|
|
// 根据选中省,匹配市 |
|
|
|
this.form.region2='' |
|
|
|
this.form.region3='' |
|
|
|
if(this.form.region2==='' || this.form.region3===''){ |
|
|
|
this.form.cityName='' |
|
|
|
this.form.countyName='' |
|
|
|
if(this.form.cityName==='' || this.form.countyName===''){ |
|
|
|
this.changeCounty=true |
|
|
|
} |
|
|
|
let cityCode = 0 |
|
|
|
let newCityArry = [] |
|
|
|
this.form.provinceList.forEach((item,index)=>{ |
|
|
|
this.provinceList.forEach((item,index)=>{ |
|
|
|
if(item.name == that){ |
|
|
|
cityCode = item.code |
|
|
|
} |
|
|
|
}) |
|
|
|
// console.log(cityCode) |
|
|
|
if(cityCode){ |
|
|
|
this.form.cityList = [] |
|
|
|
this.cityList = [] |
|
|
|
this.CITY.forEach((item,index)=>{ |
|
|
|
if(item.code == cityCode){ |
|
|
|
this.form.cityList.push(item) |
|
|
|
this.cityList.push(item) |
|
|
|
this.changeCity=false |
|
|
|
} |
|
|
|
}) /* 市匹配成功*/ |
|
|
|
} |
|
|
|
}, |
|
|
|
cityChange(that){ |
|
|
|
this.form.region3='' |
|
|
|
this.form.countyName='' |
|
|
|
let countyCode = 0 |
|
|
|
let cityname = '' |
|
|
|
let newCountyArry = [] |
|
|
|
this.form.cityList.forEach((item,index)=>{ |
|
|
|
this.cityList.forEach((item,index)=>{ |
|
|
|
if(item.name == that){ |
|
|
|
countyCode = item.id |
|
|
|
cityname = item.name |
|
|
|
} |
|
|
|
}) |
|
|
|
if(countyCode){ |
|
|
|
this.form.countyList = [] |
|
|
|
this.countyList = [] |
|
|
|
this.XIAN.forEach((item,index)=>{ |
|
|
|
if(item.code == countyCode && item.cityCountyName == cityname){ |
|
|
|
this.form.countyList.push(item) |
|
|
|
this.countyList.push(item) |
|
|
|
this.changeCounty=false |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
handleSuccess(resp, file, fileList) { |
|
|
|
this.fileList = [] |
|
|
|
if (resp.success) { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'success', |
|
|
|
message: '导入成功' |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'error', |
|
|
|
message: resp.msg |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
handleProgress(event, file, fileList) { |
|
|
|
|
|
|
|
}, |
|
|
|
beforeRemove(file, fileList) { |
|
|
|
return this.$confirm(`确定移除 ${ file.name }?`); |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
this.getStorehouseList() |
|
|
|
this.getStorehouseLists() |
|
|
|
// this.getStoreList() |
|
|
|
this.getMap() |
|
|
|
}, |
|
|
|
} |
|
|
|