|
|
@ -3,46 +3,60 @@ |
|
|
|
<el-card class="box-card"> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-input clearable v-model="queryInfo.query" placeholder="请输入仓库名" prefix-icon="el-icon-search"> |
|
|
|
<el-button slot="append" icon="el-icon-search" @click="getStorehouseList"></el-button> |
|
|
|
<el-input |
|
|
|
clearable |
|
|
|
v-model="queryInfo.query" |
|
|
|
placeholder="请输入仓库名" |
|
|
|
prefix-icon="el-icon-search" |
|
|
|
> |
|
|
|
<el-button |
|
|
|
slot="append" |
|
|
|
icon="el-icon-search" |
|
|
|
@click="getStorehouseList" |
|
|
|
></el-button> |
|
|
|
</el-input> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-button type="primary" @click="addStorehouseDialog">新增</el-button> |
|
|
|
<el-button type="primary" @click="addStorehouseDialog" |
|
|
|
>新增</el-button |
|
|
|
> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-table :data="storehouseList.slice((queryInfo.current-1)*queryInfo.size,queryInfo.current*queryInfo.size)" |
|
|
|
<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 |
|
|
|
fixed="left" |
|
|
|
type="selection" |
|
|
|
width="55"> |
|
|
|
stripe |
|
|
|
border |
|
|
|
fixed |
|
|
|
height="500" |
|
|
|
> |
|
|
|
<el-table-column fixed="left" type="selection" width="55"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="name" |
|
|
|
label="仓库名称"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="simpleName" |
|
|
|
label="仓库简称"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="addr" |
|
|
|
label="仓库地址"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="remarks" |
|
|
|
label="备 注"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
fixed="right" |
|
|
|
prop="operate" |
|
|
|
label="操作" |
|
|
|
width="180"> |
|
|
|
<template slot-scope="scope" > |
|
|
|
<el-button type="primary" icon="el-icon-edit" size="small" @click="updataStorehousedialog(scope.row)">修改</el-button> |
|
|
|
<el-button type="danger" icon="el-icon-delete" size="small" @click="deleteStorehouse(scope.row)">删除</el-button> |
|
|
|
<el-table-column prop="name" label="仓库名称"> </el-table-column> |
|
|
|
<el-table-column prop="simpleName" label="仓库简称"> </el-table-column> |
|
|
|
<el-table-column prop="custerName" label="客户名称"> </el-table-column> |
|
|
|
<el-table-column prop="remarks" label="备 注"> </el-table-column> |
|
|
|
<el-table-column fixed="right" prop="operate" label="操作" width="180"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
icon="el-icon-edit" |
|
|
|
size="small" |
|
|
|
@click="updataStorehousedialog(scope.row)" |
|
|
|
>修改</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
type="danger" |
|
|
|
icon="el-icon-delete" |
|
|
|
size="small" |
|
|
|
@click="deleteStorehouse(scope.row)" |
|
|
|
>删除</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@ -54,25 +68,40 @@ |
|
|
|
:page-sizes="[10, 20, 30, 40]" |
|
|
|
:page-size="queryInfo.size" |
|
|
|
layout="total, sizes, prev, pager, next, jumper" |
|
|
|
:total="total"> |
|
|
|
:total="total" |
|
|
|
> |
|
|
|
</el-pagination> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
<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-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> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" class="trightb"> |
|
|
|
<el-form-item prop="custerName"> |
|
|
|
<el-select size="small" v-model="form.custerName" placeholder="请选择" > |
|
|
|
<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"> |
|
|
|
:value="custName.name" |
|
|
|
> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
@ -83,12 +112,18 @@ |
|
|
|
</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-select |
|
|
|
size="small" |
|
|
|
v-model="form.name" |
|
|
|
placeholder="请选择" |
|
|
|
@change="getSupplier" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="(storehouse,i) in storeList" |
|
|
|
v-for="(storehouse, i) in storeList" |
|
|
|
:key="i" |
|
|
|
:label="storehouse.name" |
|
|
|
:value="storehouse.name"> |
|
|
|
:value="storehouse.name" |
|
|
|
> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
@ -97,76 +132,157 @@ |
|
|
|
<span><span class="icon">*</span>仓库简称:</span> |
|
|
|
</el-col> |
|
|
|
<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-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="code"><el-input size="small" v-model="form.code" 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> |
|
|
|
|
|
|
|
|
|
|
|
<el-row> |
|
|
|
<el-col :span="3.2" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>所属地: </span> |
|
|
|
</el-col> |
|
|
|
<el-form-item prop="simpleName"> |
|
|
|
<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-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.cityName" placeholder="请选择市" :disabled="changeCity" @change = "cityChange($event)"> |
|
|
|
<el-option v-for="(item,index) in 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.countyName" :disabled="changeCounty" placeholder="请选择区县"> |
|
|
|
<el-option v-for="(item,index) in 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> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row > |
|
|
|
<el-row> |
|
|
|
<el-col :span="3.2" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>详细地址:</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="trightb"> |
|
|
|
<el-form-item prop="address"><el-input size="small" v-model="form.address" 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-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="storeyHeight"><el-input size="small" v-model="form.storeyHeight" 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="monthlyPrice"><el-input size="small" v-model="form.monthlyPrice" 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-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="attributeNames"> |
|
|
|
<el-input size="small" v-model="form.attributeNames" placeholder="库房性质名称" class="addinputw" clearable /> |
|
|
|
<el-input |
|
|
|
size="small" |
|
|
|
v-model="form.attributeNames" |
|
|
|
placeholder="库房性质名称" |
|
|
|
class="addinputw" |
|
|
|
clearable |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
@ -174,25 +290,46 @@ |
|
|
|
<span><span class="icon">*</span>房源:</span> |
|
|
|
</el-col> |
|
|
|
<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-form-item prop="housingResource" |
|
|
|
><el-input |
|
|
|
size="small" |
|
|
|
v-model="form.housingResource" |
|
|
|
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="linkerName"><el-input size="small" v-model="form.linkerName" placeholder="联系人姓名" class="addinputw" clearable /></el-form-item> |
|
|
|
<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"> |
|
|
|
<span><span class="icon">*</span>联系人电话:</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" class="trightb"> |
|
|
|
<el-form-item prop="linkerPhone"><el-input size="small" v-model="form.linkerPhone" 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-row > |
|
|
|
<el-row> |
|
|
|
<el-col :span="3.2" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>附件:</span> |
|
|
|
</el-col> |
|
|
@ -209,7 +346,8 @@ |
|
|
|
:multiple="false" |
|
|
|
:show-file-list="false" |
|
|
|
:before-remove="beforeRemove" |
|
|
|
:limit="1"> |
|
|
|
:limit="1" |
|
|
|
> |
|
|
|
<el-button size="small" type="primary">点击上传</el-button> |
|
|
|
</el-upload> |
|
|
|
</el-form-item> |
|
|
@ -222,21 +360,18 @@ |
|
|
|
<el-button type="primary" @click="operationStorehouse">确 定</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
export default { |
|
|
|
data () { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
queryInfo: { |
|
|
|
total: 0, |
|
|
|
size: 1, |
|
|
|
current: 10, |
|
|
|
params:{ |
|
|
|
|
|
|
|
} |
|
|
|
params: {}, |
|
|
|
}, |
|
|
|
total: 0, |
|
|
|
changeCity: true, |
|
|
@ -247,239 +382,260 @@ export default { |
|
|
|
provinceList: [], |
|
|
|
cityList: [], |
|
|
|
countyList: [], |
|
|
|
updateAction: 'http://8.130.39.13:9050/v1/shstorehouse/upload', |
|
|
|
updateAction: "http://jianguan.yyundong.com/warehouseapi/v1/shstorehouse/upload", |
|
|
|
storehouseDialogVisible: false, |
|
|
|
// myHeaders: { Access-Control-Allow-Origin}, |
|
|
|
title: '新增仓库', |
|
|
|
title: "新增仓库", |
|
|
|
storehouseForm: { |
|
|
|
name: '', |
|
|
|
simpleName: '', |
|
|
|
addr: '', |
|
|
|
remarks: '' |
|
|
|
name: "", |
|
|
|
simpleName: "", |
|
|
|
addr: "", |
|
|
|
remarks: "", |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
name: [ |
|
|
|
{ required: true, message: '请输入仓库名称', trigger: 'blur' } |
|
|
|
], |
|
|
|
name: [{ required: true, message: "请输入仓库名称", trigger: "blur" }], |
|
|
|
simpleName: [ |
|
|
|
{ required: true, message: '请输入仓库简称', trigger: 'blur' } |
|
|
|
{ required: true, message: "请输入仓库简称", trigger: "blur" }, |
|
|
|
], |
|
|
|
addr: [ |
|
|
|
{ required: true, message: '请输入仓库地址', trigger: 'blur' } |
|
|
|
] |
|
|
|
addr: [{ required: true, message: "请输入仓库地址", trigger: "blur" }], |
|
|
|
}, |
|
|
|
tableData:[], |
|
|
|
tableData: [], |
|
|
|
fileList: [], |
|
|
|
totalPrice:0, |
|
|
|
form:{ |
|
|
|
name:'', |
|
|
|
custerName:"", |
|
|
|
provinceName:'', |
|
|
|
cityName:'', |
|
|
|
simpleName:'', |
|
|
|
code:'', |
|
|
|
countyName:'', |
|
|
|
address:'', |
|
|
|
acreage:'', |
|
|
|
storeyHeight:'', |
|
|
|
monthlyPrice:'', |
|
|
|
attributeNames:'', |
|
|
|
attributeCodes:'', |
|
|
|
housingResource:'', |
|
|
|
linkerName:'', |
|
|
|
linkerPhone:'', |
|
|
|
picUrl:'' |
|
|
|
totalPrice: 0, |
|
|
|
form: { |
|
|
|
name: "", |
|
|
|
custerName: "", |
|
|
|
provinceName: "", |
|
|
|
cityName: "", |
|
|
|
simpleName: "", |
|
|
|
code: "", |
|
|
|
countyName: "", |
|
|
|
address: "", |
|
|
|
acreage: "", |
|
|
|
storeyHeight: "", |
|
|
|
monthlyPrice: "", |
|
|
|
attributeNames: "", |
|
|
|
attributeCodes: "", |
|
|
|
housingResource: "", |
|
|
|
linkerName: "", |
|
|
|
linkerPhone: "", |
|
|
|
picUrl: "", |
|
|
|
}, |
|
|
|
CITY:[], |
|
|
|
XIAN:[], |
|
|
|
mapApiKey: 'map', |
|
|
|
shouhuoArrive:{} |
|
|
|
} |
|
|
|
CITY: [], |
|
|
|
XIAN: [], |
|
|
|
mapApiKey: "map", |
|
|
|
shouhuoArrive: {}, |
|
|
|
}; |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleSizeChange (val) { |
|
|
|
this.queryInfo.size = val |
|
|
|
this.getStorehouseList() |
|
|
|
handleSizeChange(val) { |
|
|
|
this.queryInfo.size = val; |
|
|
|
this.getStorehouseList(); |
|
|
|
}, |
|
|
|
handleCurrentChange (val) { |
|
|
|
this.queryInfo.current = val |
|
|
|
this.getStorehouseList() |
|
|
|
handleCurrentChange(val) { |
|
|
|
this.queryInfo.current = val; |
|
|
|
this.getStorehouseList(); |
|
|
|
}, |
|
|
|
async getStorehouseList () { |
|
|
|
const { data: result } = await this.$http.get('/v1/shstorehouse/listPage', { params: this.queryInfo },) |
|
|
|
if (result.status !== 200) return this.$message.error('获取列表失败') |
|
|
|
async getStorehouseList() { |
|
|
|
const { data: result } = await this.$http.post( |
|
|
|
"/v1/shstorehouse/listPage", |
|
|
|
{ params: this.queryInfo } |
|
|
|
); |
|
|
|
if (result.status !== 200) return this.$message.error("获取列表失败"); |
|
|
|
|
|
|
|
this.total = result.data.total |
|
|
|
this.storehouseList = result.data.rows |
|
|
|
this.total = result.data.total; |
|
|
|
this.storehouseList = result.data.rows; |
|
|
|
}, |
|
|
|
addStorehouseDialog () { |
|
|
|
this.title = '新增仓库' |
|
|
|
this.storehouseDialogVisible = true |
|
|
|
addStorehouseDialog() { |
|
|
|
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 |
|
|
|
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) |
|
|
|
}; |
|
|
|
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 |
|
|
|
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 |
|
|
|
this.storehouseForm.addr = storehouse.addr |
|
|
|
this.storehouseForm.remarks = storehouse.remarks |
|
|
|
this.title = '修改仓库' |
|
|
|
this.storehouseDialogVisible = true |
|
|
|
updataStorehousedialog(storehouse) { |
|
|
|
this.storehouseForm.name = storehouse.name; |
|
|
|
this.storehouseForm.simpleName = storehouse.simpleName; |
|
|
|
this.storehouseForm.addr = storehouse.addr; |
|
|
|
this.storehouseForm.remarks = storehouse.remarks; |
|
|
|
this.title = "修改仓库"; |
|
|
|
this.storehouseDialogVisible = true; |
|
|
|
}, |
|
|
|
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 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) |
|
|
|
if (result.status !== 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 |
|
|
|
); |
|
|
|
if (result.status !== 200) return this.$message.error("修改仓库失败"); |
|
|
|
this.$message.success("更新成功"); |
|
|
|
this.getStorehouseList(); |
|
|
|
this.storehouseDialogVisible = false; |
|
|
|
}, |
|
|
|
operationStorehouse () { |
|
|
|
if (this.title === '新增仓库') return this.addStorehouse() |
|
|
|
if (this.title === '修改仓库') { |
|
|
|
this.updataStorehouse() |
|
|
|
operationStorehouse() { |
|
|
|
if (this.title === "新增仓库") return this.addStorehouse(); |
|
|
|
if (this.title === "修改仓库") { |
|
|
|
this.updataStorehouse(); |
|
|
|
} |
|
|
|
}, |
|
|
|
async deleteStorehouse (storehouse) { |
|
|
|
const result = await this.$confirm('此操作将永久删除' + storehouse.name + ', 是否继续?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).catch(error => error) |
|
|
|
if (result !== 'confirm') return this.$message.info('用户取消操作') |
|
|
|
const { data: resultDB } = await this.$http.delete(`/storehouse/delete/${storehouse.name}`) |
|
|
|
if (resultDB.status !== 200) return this.$message.error('删除出库失败') |
|
|
|
this.getStorehouseList() |
|
|
|
this.$message.success('仓库删除成功') |
|
|
|
async deleteStorehouse(storehouse) { |
|
|
|
const result = await this.$confirm( |
|
|
|
"此操作将永久删除" + storehouse.name + ", 是否继续?", |
|
|
|
"提示", |
|
|
|
{ |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning", |
|
|
|
} |
|
|
|
).catch((error) => error); |
|
|
|
if (result !== "confirm") return this.$message.info("用户取消操作"); |
|
|
|
const { data: resultDB } = await this.$http.delete( |
|
|
|
`/storehouse/delete/${storehouse.name}` |
|
|
|
); |
|
|
|
if (resultDB.status !== 200) return this.$message.error("删除出库失败"); |
|
|
|
this.getStorehouseList(); |
|
|
|
this.$message.success("仓库删除成功"); |
|
|
|
}, |
|
|
|
getMap(){ |
|
|
|
getMap() { |
|
|
|
this.$http({ |
|
|
|
method:"get", |
|
|
|
url:"https://restapi.amap.com/v3/config/district?parameters", // apii请求地址 |
|
|
|
params:{ // 携带的参数 |
|
|
|
key:"3a708a4ef5e3af28694b1c861985a5ce", // 在高德开放平台申请的个人key密钥 |
|
|
|
keyWords:"中国", |
|
|
|
subdistrict:3 // 要获取的行政区划的级别:省、市、县三级 |
|
|
|
} |
|
|
|
}).then((res)=>{ |
|
|
|
this.provinceList = res.data.districts[0].districts /* 省*/ |
|
|
|
method: "get", |
|
|
|
url: "https://restapi.amap.com/v3/config/district?parameters", // apii请求地址 |
|
|
|
params: { |
|
|
|
// 携带的参数 |
|
|
|
key: "3a708a4ef5e3af28694b1c861985a5ce", // 在高德开放平台申请的个人key密钥 |
|
|
|
keyWords: "中国", |
|
|
|
subdistrict: 3, // 要获取的行政区划的级别:省、市、县三级 |
|
|
|
}, |
|
|
|
}).then((res) => { |
|
|
|
this.provinceList = res.data.districts[0].districts; /* 省*/ |
|
|
|
/* 进行遍历赋值*/ |
|
|
|
/* 市区和县区*/ |
|
|
|
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 |
|
|
|
this.CITY.push({id:j+1,name:city,code:i+1}) |
|
|
|
for(let k = 0;k<newProvince[i].districts[j].districts.length; k++){/* 县级*/ |
|
|
|
let xian = newProvince[i].districts[j].districts[k].name |
|
|
|
this.XIAN.push({id:k+1,name:xian,code:j+1,cityCountyName:city}) |
|
|
|
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; |
|
|
|
this.CITY.push({ id: j + 1, name: city, code: i + 1 }); |
|
|
|
for ( |
|
|
|
let k = 0; |
|
|
|
k < newProvince[i].districts[j].districts.length; |
|
|
|
k++ |
|
|
|
) { |
|
|
|
/* 县级*/ |
|
|
|
let xian = newProvince[i].districts[j].districts[k].name; |
|
|
|
this.XIAN.push({ |
|
|
|
id: k + 1, |
|
|
|
name: xian, |
|
|
|
code: j + 1, |
|
|
|
cityCountyName: city, |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
for(let m = 0; m < newProvince.length;m++){ |
|
|
|
newProvince[m] = {...newProvince[m],...{code:m+1}} |
|
|
|
for (let m = 0; m < newProvince.length; m++) { |
|
|
|
newProvince[m] = { ...newProvince[m], ...{ code: m + 1 } }; |
|
|
|
} |
|
|
|
this.provinceList = newProvince |
|
|
|
}) |
|
|
|
this.provinceList = newProvince; |
|
|
|
}); |
|
|
|
}, |
|
|
|
provinceChange(that){ |
|
|
|
provinceChange(that) { |
|
|
|
// 根据选中省,匹配市 |
|
|
|
this.form.cityName='' |
|
|
|
this.form.countyName='' |
|
|
|
if(this.form.cityName==='' || this.form.countyName===''){ |
|
|
|
this.changeCounty=true |
|
|
|
this.form.cityName = ""; |
|
|
|
this.form.countyName = ""; |
|
|
|
if (this.form.cityName === "" || this.form.countyName === "") { |
|
|
|
this.changeCounty = true; |
|
|
|
} |
|
|
|
let cityCode = 0 |
|
|
|
let newCityArry = [] |
|
|
|
this.provinceList.forEach((item,index)=>{ |
|
|
|
if(item.name == that){ |
|
|
|
cityCode = item.code |
|
|
|
let cityCode = 0; |
|
|
|
let newCityArry = []; |
|
|
|
this.provinceList.forEach((item, index) => { |
|
|
|
if (item.name == that) { |
|
|
|
cityCode = item.code; |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
// console.log(cityCode) |
|
|
|
if(cityCode){ |
|
|
|
this.cityList = [] |
|
|
|
this.CITY.forEach((item,index)=>{ |
|
|
|
if(item.code == cityCode){ |
|
|
|
this.cityList.push(item) |
|
|
|
this.changeCity=false |
|
|
|
if (cityCode) { |
|
|
|
this.cityList = []; |
|
|
|
this.CITY.forEach((item, index) => { |
|
|
|
if (item.code == cityCode) { |
|
|
|
this.cityList.push(item); |
|
|
|
this.changeCity = false; |
|
|
|
} |
|
|
|
}) /* 市匹配成功*/ |
|
|
|
}); /* 市匹配成功*/ |
|
|
|
} |
|
|
|
}, |
|
|
|
cityChange(that){ |
|
|
|
this.form.countyName='' |
|
|
|
let countyCode = 0 |
|
|
|
let cityname = '' |
|
|
|
let newCountyArry = [] |
|
|
|
this.cityList.forEach((item,index)=>{ |
|
|
|
if(item.name == that){ |
|
|
|
countyCode = item.id |
|
|
|
cityname = item.name |
|
|
|
cityChange(that) { |
|
|
|
this.form.countyName = ""; |
|
|
|
let countyCode = 0; |
|
|
|
let cityname = ""; |
|
|
|
let newCountyArry = []; |
|
|
|
this.cityList.forEach((item, index) => { |
|
|
|
if (item.name == that) { |
|
|
|
countyCode = item.id; |
|
|
|
cityname = item.name; |
|
|
|
} |
|
|
|
}) |
|
|
|
if(countyCode){ |
|
|
|
this.countyList = [] |
|
|
|
this.XIAN.forEach((item,index)=>{ |
|
|
|
if(item.code == countyCode && item.cityCountyName == cityname){ |
|
|
|
this.countyList.push(item) |
|
|
|
this.changeCounty=false |
|
|
|
}); |
|
|
|
if (countyCode) { |
|
|
|
this.countyList = []; |
|
|
|
this.XIAN.forEach((item, index) => { |
|
|
|
if (item.code == countyCode && item.cityCountyName == cityname) { |
|
|
|
this.countyList.push(item); |
|
|
|
this.changeCounty = false; |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
handleSuccess(resp, file, fileList) { |
|
|
|
this.fileList = [] |
|
|
|
this.fileList = []; |
|
|
|
if (resp.success) { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'success', |
|
|
|
message: '导入成功' |
|
|
|
}) |
|
|
|
type: "success", |
|
|
|
message: "导入成功", |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'error', |
|
|
|
message: resp.msg |
|
|
|
}) |
|
|
|
type: "error", |
|
|
|
message: resp.msg, |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
handleProgress(event, file, fileList) { |
|
|
|
|
|
|
|
}, |
|
|
|
handleProgress(event, file, fileList) {}, |
|
|
|
beforeRemove(file, fileList) { |
|
|
|
return this.$confirm(`确定移除 ${ file.name }?`); |
|
|
|
} |
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
this.getStorehouseList() |
|
|
|
this.getStorehouseLists() |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.getStorehouseList(); |
|
|
|
this.getStorehouseLists(); |
|
|
|
// this.getStoreList() |
|
|
|
this.getMap() |
|
|
|
this.getMap(); |
|
|
|
}, |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style> |
|
|
@ -489,8 +645,19 @@ export default { |
|
|
|
color: #606266; |
|
|
|
line-height: 40px !important; |
|
|
|
} |
|
|
|
.trightb{ text-align: right;font-weight: bold;color: #606266; } |
|
|
|
.tleft{ text-align: left; } |
|
|
|
.arriveClass{margin-right: 30px;} |
|
|
|
.icon{color:rgba(255, 0, 0, 0.553);margin-right: 3px;} |
|
|
|
.trightb { |
|
|
|
text-align: right; |
|
|
|
font-weight: bold; |
|
|
|
color: #606266; |
|
|
|
} |
|
|
|
.tleft { |
|
|
|
text-align: left; |
|
|
|
} |
|
|
|
.arriveClass { |
|
|
|
margin-right: 30px; |
|
|
|
} |
|
|
|
.icon { |
|
|
|
color: rgba(255, 0, 0, 0.553); |
|
|
|
margin-right: 3px; |
|
|
|
} |
|
|
|
</style> |
|
|
|