| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475 |
- <?php
- ?>
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <span>自提点管理</span>
- <el-button type="primary" size="small" style="padding: 9px 15px !important; float: right; position: relative; bottom: 8px;" @click="add">+添加自提点</el-button>
- </div>
- <div class="table-body">
- <div style="padding-bottom: 20px;">
- <div class="flex" style="flex-wrap:wrap;">
- <div class="flex" style="margin-right: 20px;">
- <el-date-picker v-model="addTime" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" @change="addTimeChange" :default-time="['00:00:00', '23:59:59']">
- </el-date-picker>
- </div>
- <div class="flex" style="margin-right: 20px;">
- <el-input size="small" style="width: 140px;" placeholder="请输入团长会员ID" v-model="searchData.user_id">
- </el-input>
- </div>
- <div class="flex" style="margin-right: 20px;">
- <el-input size="small" style="width: 130px;" placeholder="团长昵称" v-model="searchData.nickname">
- </el-input>
- </div>
- <div class="flex" style="margin-right: 20px;">
- <el-input size="small" style="width: 130px;" placeholder="手机号" v-model="searchData.mobile">
- </el-input>
- </div>
- <div class="flex" style="margin-right: 20px;">
- <el-input size="small" style="width: 130px;" placeholder="自提点名称" v-model="searchData.name">
- </el-input>
- </div>
- <div class="flex" style="margin-right: 20px;">
- <el-input size="small" style="width: 130px;" placeholder="自提点地址" v-model="searchData.address">
- </el-input>
- </div>
- <div class="flex" style="margin-top:8px;">
- <el-button style="padding: 9px 15px !important;" size="small" type="primary" @click="searchs">搜索</el-button>
- <el-button type="warning" @click="clereSearch" v-if="searchData.user_id || searchData.name || searchData.nickname || searchData.address || searchData.start_at || searchData.address.end_at" style="font-size:12px;padding: 9px 15px !important;">清除搜索条件</el-button>
- </div>
- </div>
- </div>
- <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px; width: 100%">
- <el-table-column prop="id" label="序号" width="100" align="center"></el-table-column>
- <el-table-column label="团长昵称" width="200" prop="user_id" align="center">
- <template slot-scope="scope">
- <com-image v-if="scope.row.user" style="float: left;" mode="aspectFill" :src="scope.row.user.avatar_url"></com-image>
- <div v-if="scope.row.user">{{scope.row.user.nickname}}</div>
- <div v-if="scope.row.user">{{scope.row.user.id}}</div>
- </template>
- </el-table-column>
- <el-table-column label="手机号" prop="mobile" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.mobile}}</div>
- </template>
- </el-table-column>
- <el-table-column label="自提点名称" prop="name" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.name}}</div>
- </template>
- </el-table-column>
- <el-table-column label="自提点地址" prop="address" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.address}}</div>
- </template>
- </el-table-column>
- <el-table-column label="身份证" prop="idcard_img" align="center">
- <template slot-scope="scope">
- <el-image v-for="(img, index) in scope.row.idcard_img" :key="index" mode="aspectFill" :width="'auto'" style="width: 50px; height: 50px; margin-right: 5px" :src="img" :preview-src-list="scope.row.idcard_img">
- </el-image>
- </template>
- </el-table-column>
- <el-table-column label="营业执照" prop="license_img" align="center">
- <template slot-scope="scope">
- <el-image mode="aspectFill" :width="'auto'" style="width: 50px; height: 50px" :src="scope.row.license_img" :preview-src-list="[scope.row.license_img]">
- </el-image>
- </template>
- </el-table-column>
- <el-table-column label="开启" prop="status" width="80" align="center">
- <template slot-scope="scope">
- <el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" @change="handleStatusChange(scope.row.status, scope.row.id, scope.$index)"></el-switch>
- </template>
- </el-table-column>
- <el-table-column label="入驻时间" prop="created_at" align="center">
- <template slot-scope="scope">
- <div>
- {{scope.row.created_at | dateTimeFormat('Y-m-d H:i:s')}}
- </div>
- </template>
- </el-table-column>
- <el-table-column label="操作" style="width: 200px;" fixed="right" align="center">
- <template slot-scope="scope">
- <el-button type="text" size="small" @click="goToDetail(scope.row.id)">编辑</el-button>
- <el-button type="text" size="small" @click="deleteOne(scope.row, scope.$index)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div style="text-align: right;margin: 20px 0;">
- <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
- </div>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data: {
- searchData: {
- user_id: '',
- nickname: '',
- start_at: '',
- end_at: '',
- name: '',
- address: '',
- mobile: '',
- },
- currPage: 1,
- pageCount: 0,
- loading: false,
- dialogVisible: false,
- list: [],
- dialogLoading: false,
- addTime: '', //注册时间
- storeStatus: {
- 1: '正常',
- 2: '禁用'
- },
- },
- mounted() {
- this.loadData();
- },
- methods: {
- searchs() {
- this.currPage = 1;
- this.loadData();
- },
- addTimeChange(v) {
- this.searchData.start_at = v ? v[0] : '';
- this.searchData.end_at = v ? v[1] : '';
- },
- clereSearch() {
- this.searchData.nickname = '';
- this.searchData.user_id = '';
- this.searchData.start_at = '';
- this.searchData.end_at = '';
- this.searchData.name = '';
- this.searchData.address = '';
- this.currPage = 1;
- this.loadData();
- },
- handleStatusChange(status, id, index) {
- let self = this;
- let tip = status == 1 ? '开启' : '关闭';
- self.$confirm(tip + '该自提点, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- self.loading = true;
- request({
- params: {
- r: 'community/community-head/switch-status',
- },
- data: {
- id: id,
- status: status,
- },
- method: 'post'
- }).then(e => {
- self.loading = false;
- if (e.data.code == 0) {
- this.list[index].status = status;
- self.$message.success('操作成功');
- } else {
- self.$message.error('操作失败');
- }
- }).catch(e => {
- self.loading = false;
- console.log(e);
- self.$message.error('网络错误');
- });
- }).catch(() => {
- });
- },
- deleteOne(row, index) {
- let self = this;
- self.$confirm('删除该自提点, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- self.listLoading = true;
- request({
- params: {
- r: 'community/community-head/delete',
- },
- method: 'post',
- data: {
- id: row.id,
- }
- }).then(e => {
- self.listLoading = false;
- if (e.data.code === 0) {
- self.$message.success(e.data.msg);
- self.list.splice(index, 1);
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- console.log(e);
- });
- }).catch(() => {
- self.$message.info('已取消删除')
- });
- },
- loadData() {
- this.loading = true;
- request({
- params: {
- r: 'community/community-head/index',
- page: this.currPage,
- ...this.searchData,
- },
- method: 'get',
- }).then(e => {
- this.loading = false;
- if (e.data.code == 0) {
- this.list = e.data.data.list;
- this.pageCount = e.data.data.page_count;
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.loading = false;
- });
- },
- pagination(currentPage) {
- let self = this;
- self.currPage = currentPage;
- self.loadData();
- },
- add(id) {
- navigateTo({
- r: 'community/community-head/storage',
- });
- },
- // 跳转门店详情页
- goToDetail(id) {
- navigateTo({
- r: 'community/community-head/storage',
- id: id,
- });
- },
- }
- });
- </script>
- <style>
- .el-tabs__header {
- font-size: 16px;
- }
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .input-item {
- width: 250px;
- margin-right: 40px;
- }
- .input-item .el-input__inner {
- border-right: 0;
- }
- .input-item .el-input__inner:hover {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input__inner:focus {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input-group__append {
- background-color: #fff;
- border-left: 0;
- width: 10%;
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- margin: 0;
- }
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .table-body .el-button {
- padding: 0 !important;
- border: 0;
- margin: 0 5px;
- }
- .input-item {
- width: 250px;
- margin: 0 0 20px;
- display: inline-block;
- }
- .input-item .el-input__inner {
- border-right: 0;
- }
- .input-item .el-input__inner:hover {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input__inner:focus {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input-group__append {
- background-color: #fff;
- border-left: 0;
- width: 10%;
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- margin: 0;
- }
- .batch {
- margin: 0 0 20px;
- display: inline-block;
- }
- .batch .el-button {
- padding: 9px 15px !important;
- }
- .el-table th>.cell {
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .el-table__footer-wrapper,
- .el-table__header-wrapper {
- border-bottom: 1.4px solid #D6D6D6;
- }
- .el-table .el-button {
- padding: 0 !important;
- border: 0;
- margin: 0 5px;
- }
- #app .copy .el-input-group__append {
- background-color: #409EFF;
- border-color: #409EFF;
- padding: 0 10px;
- }
- #app .table-body .copybtn {
- color: #fff;
- padding: 0 30px;
- }
- .el-alert {
- padding: 0;
- padding-left: 5px;
- padding-bottom: 5px;
- }
- .el-alert--info .el-alert__description {
- color: #606266;
- }
- .el-alert .el-button {
- margin-left: 20px;
- }
- .el-alert__content {
- display: flex;
- align-items: center;
- }
- .table-body .el-alert__title {
- margin-top: 5px;
- font-weight: 400;
- }
- .el-table th>.cell {
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .el-table__footer-wrapper,
- .el-table__header-wrapper {
- border-bottom: 1.4px solid #D6D6D6;
- }
- .item-box {
- margin-right: 20px;
- }
- .flex {
- display: flex;
- align-items: center;
- }
- .input-title {
- margin-right: 15px;
- }
- .item-box .label {
- margin-right: 8px;
- }
- .com-share-pop {
- display: inline-block;
- }
- .grid-icon {
- color: #999;
- cursor: pointer;
- font-size: 18px;
- }
- .el-input__inner {
- height: 32px;
- line-height: 32px;
- }
- .el-range-editor.el-input__inner {
- padding: 0 15px;
- }
- .el-date-editor .el-range-input,
- .el-date-editor .el-range-separator {
- font-size: 13px;
- height: auto;
- }
- </style>
|