|
|
@ -8,7 +8,7 @@ |
|
|
|
<div v-show="isSearchShow" class="search"> |
|
|
|
<el-form ref="queryInfo" :inline="true" :model="queryInfo" class="tab-header"> |
|
|
|
<el-form-item label="货位名"> |
|
|
|
<el-input v-model="queryInfo.query" placeholder="请输入货位名" clearable /> |
|
|
|
<el-input v-model="queryInfo.params.name" placeholder="请输入货位名" clearable /> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<div class="btn" style="text-align: center;"> |
|
|
@ -17,8 +17,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-table :data="locationList.slice((queryInfo.pageNum-1)*queryInfo.pageSize,queryInfo.pageNum*queryInfo.pageSize)" |
|
|
|
style="width: 100%" |
|
|
|
<el-table :data="locationList" style="width: 100%" |
|
|
|
stripe border > |
|
|
|
<el-table-column |
|
|
|
label="序号" |
|
|
@ -60,11 +59,11 @@ |
|
|
|
</el-table> |
|
|
|
<div class="pages"> |
|
|
|
<div class="tit" /> |
|
|
|
<pagination |
|
|
|
<pagination |
|
|
|
v-show="locationList.length > 0" |
|
|
|
:total="total" |
|
|
|
:page.sync="queryInfo.pageNum" |
|
|
|
:limit.sync="queryInfo.pageSize" |
|
|
|
:total="queryInfo.total" |
|
|
|
:page.sync="queryInfo.current" |
|
|
|
:limit.sync="queryInfo.size" |
|
|
|
class="pagination" |
|
|
|
@pagination="getLocationList" |
|
|
|
/> |
|
|
@ -94,9 +93,12 @@ export default { |
|
|
|
btndisabled: false, |
|
|
|
isSearchShow: false, |
|
|
|
queryInfo: { |
|
|
|
query: '', |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10 |
|
|
|
total: 0, |
|
|
|
size: 10, |
|
|
|
current: 1, |
|
|
|
params: { |
|
|
|
name:'' |
|
|
|
}, |
|
|
|
}, |
|
|
|
total: 0, |
|
|
|
locationList: [], |
|
|
@ -162,26 +164,31 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
dosearch() { |
|
|
|
this.queryInfo.pageNum = 1 |
|
|
|
this.total=0 |
|
|
|
this.getLocationList() |
|
|
|
}, |
|
|
|
resetQuery() { |
|
|
|
this.queryInfo.query = '' |
|
|
|
this.queryInfo={ |
|
|
|
total: 0, |
|
|
|
size: 10, |
|
|
|
current: 1, |
|
|
|
params: { |
|
|
|
name:'' |
|
|
|
}, |
|
|
|
}, |
|
|
|
this.dosearch() |
|
|
|
}, |
|
|
|
async getLocationList () { |
|
|
|
const { data: result } = await this.$http.get('/location/list', { params: this.queryInfo }) |
|
|
|
if (result.status !== 200) return this.$message.error('获取列表失败') |
|
|
|
|
|
|
|
this.total = result.data.total |
|
|
|
this.locationList = result.data.rows |
|
|
|
const { data: result } = await this.$http.post('/location/list', this.queryInfo) |
|
|
|
if (result.code == 200){ |
|
|
|
this.queryInfo.total = result.data.total |
|
|
|
this.locationList = result.data.records |
|
|
|
} |
|
|
|
}, |
|
|
|
closeLocationDialog () { |
|
|
|
this.$refs.locationRuleForm.resetFields() |
|
|
|
}, |
|
|
|
indexMethod(index) { |
|
|
|
var pagestart = (this.queryInfo.pageNum - 1) * this.queryInfo.pageSize; |
|
|
|
var pagestart = (this.queryInfo.current - 1) * this.queryInfo.size; |
|
|
|
var pageindex = index + 1 + pagestart; |
|
|
|
return pageindex; |
|
|
|
}, |
|
|
@ -210,10 +217,13 @@ export default { |
|
|
|
type: 'warning' |
|
|
|
}).catch(error => error) |
|
|
|
if (result !== 'confirm') return this.$message.info('用户取消操作') |
|
|
|
const { data: resultDB } = await this.$http.delete(`/location/delete/${location.locationId}`) |
|
|
|
if (resultDB.status !== 200) return this.$message.error('删除库位失败') |
|
|
|
this.getLocationList() |
|
|
|
this.$message.success('库位删除成功') |
|
|
|
const { data: resultDB } = await this.$http.delete(`location/deleteById/${location.id}`) |
|
|
|
if (resultDB.code == 200){ |
|
|
|
this.getLocationList() |
|
|
|
this.$message.success('库位删除成功') |
|
|
|
}else{ |
|
|
|
this.$message.error('删除库位失败') |
|
|
|
} |
|
|
|
}, |
|
|
|
async getStorehouse () { |
|
|
|
const { data: result } = await this.$http.get('/location/getStorehouse') |
|
|
|