|
@@ -0,0 +1,224 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <div class="filter-container">
|
|
|
+ <el-input v-model="listQuery.mobile" placeholder="手机号" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" />
|
|
|
+ <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">
|
|
|
+ 搜索
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <el-table v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%">
|
|
|
+ <el-table-column align="center" label="ID" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.id }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column width="180px" align="center" label="申请日期">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.create_time }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column class-name="status-col" label="手机号" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.mobile }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column class-name="status-col" label="老店合同人姓名" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.old_partner }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column class-name="status-col" label="老店店名" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.old_store_name }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column class-name="status-col" label="店号">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.store_name }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column class-name="status-col" label="状态" width="80px">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <el-tag :type="row.status | statusFilter">
|
|
|
+ {{ row.status | statusFilterTxt }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="Actions" width="300" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-row>
|
|
|
+ <router-link :to="'/branchJoin/edit/'+scope.row.id">
|
|
|
+ <el-button type="primary" size="mini" icon="el-icon-edit" style="margin-right: 10px;">
|
|
|
+ 查看
|
|
|
+ </el-button>
|
|
|
+ </router-link>
|
|
|
+ <el-button type="primary" size="mini" icon="el-icon-s-check" :disabled="(scope.row.status === 1 || scope.row.status === 3)" @click="handleUpdate(scope)">
|
|
|
+ {{ scope.row.status === 1 || scope.row.status === 3 ? '已处理' : '处理' }}
|
|
|
+ </el-button>
|
|
|
+ <!--<el-button type="danger" size="mini" icon="el-icon-delete" style="margin-left: 10px;" @click="handleDelete(scope)">
|
|
|
+ 删除
|
|
|
+ </el-button>-->
|
|
|
+ </el-row>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.pageSize" @pagination="getList" />
|
|
|
+ <el-dialog title="处理" :visible.sync="dialogFormVisible">
|
|
|
+ <el-form ref="dataForm" :model="temp" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;">
|
|
|
+ <el-form-item label="理由" prop="mark">
|
|
|
+ <el-input v-model="temp.mark" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="处理意见" prop="mark">
|
|
|
+ <template>
|
|
|
+ <el-radio-group v-model="temp.status">
|
|
|
+ <el-radio :label="1">同意</el-radio>
|
|
|
+ <el-radio :label="3">拒绝</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </template>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogFormVisible = false">
|
|
|
+ 取消
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" @click="updateData()">
|
|
|
+ 确定
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { fetchList, deleteBranchJoin, dealBranchJoin, fetchBranchJoin } from '@/api/branchJoin'
|
|
|
+import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
|
|
+import waves from '@/directive/waves'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'ArticleList',
|
|
|
+ components: { Pagination },
|
|
|
+ directives: { waves },
|
|
|
+ filters: {
|
|
|
+ statusFilter(status) {
|
|
|
+ const statusMap = {
|
|
|
+ 1: 'success',
|
|
|
+ 3: 'info',
|
|
|
+ 0: 'danger'
|
|
|
+ }
|
|
|
+ return statusMap[status]
|
|
|
+ },
|
|
|
+ statusFilterTxt(status) {
|
|
|
+ const statusMap = {
|
|
|
+ 1: '同意',
|
|
|
+ 3: '拒绝',
|
|
|
+ 0: '未处理',
|
|
|
+ 2: '删除'
|
|
|
+ }
|
|
|
+ return statusMap[status]
|
|
|
+ },
|
|
|
+ positionFilter(status) {
|
|
|
+ const statusMap = {
|
|
|
+ 'HOME': 'success',
|
|
|
+ draft: 'info',
|
|
|
+ 2: 'danger'
|
|
|
+ }
|
|
|
+ return statusMap[status]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ list: null,
|
|
|
+ total: 0,
|
|
|
+ listLoading: true,
|
|
|
+ listQuery: {
|
|
|
+ page: 1,
|
|
|
+ pageSize: 10
|
|
|
+ },
|
|
|
+ temp: {
|
|
|
+ id: undefined,
|
|
|
+ mark: '',
|
|
|
+ status: ''
|
|
|
+ },
|
|
|
+ dialogFormVisible: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getList() {
|
|
|
+ this.listLoading = true
|
|
|
+ fetchList(this.listQuery).then(response => {
|
|
|
+ this.list = response.data.list
|
|
|
+ this.total = response.data.count
|
|
|
+ this.listLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleFilter() {
|
|
|
+ this.listLoading = true
|
|
|
+ fetchList(this.listQuery).then(response => {
|
|
|
+ this.list = response.data.list
|
|
|
+ this.total = response.data.count
|
|
|
+ this.listLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleDelete({ $index, row }) {
|
|
|
+ console.log(row.id)
|
|
|
+ this.$confirm('您确定要隐藏吗', '警告', {
|
|
|
+ confirmButtonText: '是的',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(async() => {
|
|
|
+ await deleteBranchJoin(row.id)
|
|
|
+ this.list.splice($index, 1)
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '隐藏成功'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async handleUpdate({ $index, row }) {
|
|
|
+ this.temp = Object.assign({}, row) // copy obj
|
|
|
+ this.dialogFormVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs['dataForm'].clearValidate()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async updateData() {
|
|
|
+ const tempData = Object.assign({}, this.temp)
|
|
|
+ await dealBranchJoin(tempData)
|
|
|
+ const rs = await fetchBranchJoin(tempData.id)
|
|
|
+ const index = this.list.findIndex(v => v.id === this.temp.id)
|
|
|
+ this.list.splice(index, 1, rs.data.info)
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.$notify({
|
|
|
+ title: '成功',
|
|
|
+ message: '更新成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.edit-input {
|
|
|
+ padding-right: 100px;
|
|
|
+}
|
|
|
+.cancel-btn {
|
|
|
+ position: absolute;
|
|
|
+ right: 15px;
|
|
|
+ top: 10px;
|
|
|
+}
|
|
|
+.filter-container{
|
|
|
+ margin-bottom: 20px;
|
|
|
+}
|
|
|
+.filter-item {
|
|
|
+ margin-right: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|