Browse Source

门店排序,改变状态

master
liupopo 2 years ago
parent
commit
e1e044f791
  1. 6
      src/api/pickupPoint/pickupPoint.js
  2. 78
      src/views/pickupPoint/index.vue
  3. 24
      src/views/pickupPoint/indexAdd.vue

6
src/api/pickupPoint/pickupPoint.js

@ -35,6 +35,12 @@ export default {
method: 'delete' method: 'delete'
}); });
}, },
// 修改状态
updateIsEnable: function(sid,isEnable) {
return request({
url: '/lpkstore/updateIsEnable/'+sid+"/"+isEnable
});
},
} }

78
src/views/pickupPoint/index.vue

@ -12,13 +12,20 @@
<el-form-item label="提货点名称"> <el-form-item label="提货点名称">
<el-input v-model="queryParams.params.name" placeholder="" clearable /> <el-input v-model="queryParams.params.name" placeholder="" clearable />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="btn" style="text-align: center;"> <div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search" <el-button
@click="dosearch">查询</el-button> type="primary"
<el-button type="primary" size="small" icon="el-icon-refresh" size="small"
@click="resetQuery">重置</el-button> icon="el-icon-search"
@click="dosearch"
>查询</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-refresh"
@click="resetQuery"
>重置</el-button>
</div> </div>
</div> </div>
</div> </div>
@ -32,25 +39,44 @@
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%" :row-style="{height: '40px'}"> <el-table v-loading="tableLoading" :data="dataList" border style="width: 100%" :row-style="{height: '40px'}">
<!-- <el-table-column fixed width="50" type="selection" align="center" /> --> <!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" /> <el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column label="操作" align="center" width="180"> <el-table-column label="操作" align="center" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button> <el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> <!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="提货点名称" align="center" /> <el-table-column label="是否禁用" align="center" width="140">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isEnable"
active-text="可用"
inactive-text="禁用"
active-value="1"
inactive-value="0"
@change="enableChange(scope.row.sid,scope.row.isEnable)"
/>
</template>
</el-table-column>
<el-table-column prop="name" label="提货点名称" align="center" width="200" />
<!-- <el-table-column prop="code" label="提货点编号" align="center" /> --> <!-- <el-table-column prop="code" label="提货点编号" align="center" /> -->
<el-table-column prop="phone" label="联系电话" align="center" /> <el-table-column prop="phone" label="联系电话" align="center" width="120" />
<el-table-column prop="address" label="提货点地址" align="center" /> <el-table-column prop="address" label="提货点地址" align="center" />
<el-table-column prop="businessHours" label="营业时间" align="center" /> <el-table-column prop="businessHours" label="营业时间" align="center" width="200" />
<el-table-column prop="sort" label="排序" align="center" width="80" />
</el-table> </el-table>
</div> </div>
<!-- End 项目列表 --> <!-- End 项目列表 -->
<div class="pages"> <div class="pages">
<div class="tit" /> <div class="tit" />
<!-- 翻页 --> <!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current" <pagination
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" /> v-show="dataList.length > 0"
:total="queryParams.total"
:page.sync="queryParams.current"
:limit.sync="queryParams.size"
class="pagination"
@pagination="loadList"
/>
</div> </div>
</div> </div>
</div> </div>
@ -63,14 +89,14 @@
import req from '@/api/pickupPoint/pickupPoint.js' import req from '@/api/pickupPoint/pickupPoint.js'
import ButtonBar from '@/components/ButtonBar' import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination' import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye' // import pageye from '@/components/pagination/pageye'
import divAdd from './indexAdd.vue' import divAdd from './indexAdd.vue'
export default { export default {
name: 'SupplierBankInfoIndex', name: 'SupplierBankInfoIndex',
components: { components: {
ButtonBar, ButtonBar,
Pagination, Pagination,
pageye, // pageye,
divAdd divAdd
}, },
data() { data() {
@ -102,8 +128,7 @@
size: 10, size: 10,
total: 0, total: 0,
params: { params: {
name: '', name: ''
} }
}, },
sids: [] sids: []
@ -154,7 +179,6 @@
this.tableLoading = false this.tableLoading = false
}) })
}, },
// //
indexMethod(index) { indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size var pagestart = (this.queryParams.current - 1) * this.queryParams.size
@ -171,7 +195,7 @@
size: 10, size: 10,
total: 0, total: 0,
params: { params: {
name: '', name: ''
} }
} }
this.loadList() this.loadList()
@ -189,7 +213,6 @@
this.$refs['divadd'].showEdit(row) this.$refs['divadd'].showEdit(row)
}, },
toRelevancyInfo(row) { toRelevancyInfo(row) {
const tip = '请确认是否删除所选提货点?' const tip = '请确认是否删除所选提货点?'
this.$confirm(tip, '提示', { this.$confirm(tip, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -221,9 +244,26 @@
}, },
resetState() { resetState() {
this.viewState = 1 this.viewState = 1
},
enableChange(sid, state) {
console.log('sid', sid)
console.log('state', state)
req.updateIsEnable(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: '状态已更新',
showClose: true
})
} else { // resp.code
}
}).catch(e => {
console.log(e)
})
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
</style> </style>

24
src/views/pickupPoint/indexAdd.vue

@ -24,6 +24,10 @@
<span class="item_text">地址</span> <span class="item_text">地址</span>
<el-input v-model="formobj.address" placeholder="" class="item_input" clearable /> <el-input v-model="formobj.address" placeholder="" class="item_input" clearable />
</div> </div>
<div class="item">
<span class="item_text">联系人</span>
<el-input v-model="formobj.linker" placeholder="" class="item_input" clearable />
</div>
<div class="item"> <div class="item">
<span class="item_text">电话</span> <span class="item_text">电话</span>
<el-input v-model="formobj.phone" placeholder="" class="item_input" clearable /> <el-input v-model="formobj.phone" placeholder="" class="item_input" clearable />
@ -32,7 +36,10 @@
<span class="item_text">营业时间</span> <span class="item_text">营业时间</span>
<el-input v-model="formobj.businessHours" placeholder="" class="item_input" clearable /> <el-input v-model="formobj.businessHours" placeholder="" class="item_input" clearable />
</div> </div>
<div class="item">
<span class="item_text">排序</span>
<el-input v-model="formobj.sort" placeholder="" class="item_input" clearable />
</div>
</el-card> </el-card>
@ -49,11 +56,14 @@
return { return {
submitdisabled: false, submitdisabled: false,
formobj: { formobj: {
sid: "", sid: '',
name: '', name: '',
address: '', address: '',
phone: '', phone: '',
businessHours: "", businessHours: '',
sort: 0,
linker: '',
picUrl: ''
} }
} }
}, },
@ -80,11 +90,14 @@
if (isreload === 'true') this.$emit('reloadlist') if (isreload === 'true') this.$emit('reloadlist')
this.imgList = [] this.imgList = []
this.formobj = { this.formobj = {
sid: "", sid: '',
name: '', name: '',
address: '', address: '',
phone: '', phone: '',
businessHours: "", businessHours: '',
sort: 0,
linker: '',
picUrl: ''
} }
this.$emit('doback') this.$emit('doback')
}, },
@ -97,7 +110,6 @@
.then(resp => { .then(resp => {
if (resp.success) { if (resp.success) {
this.formobj = resp.data this.formobj = resp.data
} }
}) })
.catch(e => { .catch(e => {

Loading…
Cancel
Save