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'
});
},
// 修改状态
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-input v-model="queryParams.params.name" placeholder="" clearable />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search"
@click="dosearch">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh"
@click="resetQuery">重置</el-button>
<el-button
type="primary"
size="small"
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>
@ -32,25 +39,44 @@
<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="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">
<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>
</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="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="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>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
<pagination
v-show="dataList.length > 0"
:total="queryParams.total"
:page.sync="queryParams.current"
:limit.sync="queryParams.size"
class="pagination"
@pagination="loadList"
/>
</div>
</div>
</div>
@ -63,14 +89,14 @@
import req from '@/api/pickupPoint/pickupPoint.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
// import pageye from '@/components/pagination/pageye'
import divAdd from './indexAdd.vue'
export default {
name: 'SupplierBankInfoIndex',
components: {
ButtonBar,
Pagination,
pageye,
// pageye,
divAdd
},
data() {
@ -102,8 +128,7 @@
size: 10,
total: 0,
params: {
name: '',
name: ''
}
},
sids: []
@ -154,7 +179,6 @@
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
@ -171,7 +195,7 @@
size: 10,
total: 0,
params: {
name: '',
name: ''
}
}
this.loadList()
@ -189,7 +213,6 @@
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选提货点?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
@ -221,9 +244,26 @@
},
resetState() {
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>
<style scoped>
</style>

24
src/views/pickupPoint/indexAdd.vue

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

Loading…
Cancel
Save