From f7bdedf1f3f7600c73f6d5beb46c1d1f4d518822 Mon Sep 17 00:00:00 2001 From: luobisheng <727299681@qq.com> Date: 星期三, 09 十一月 2022 18:15:34 +0800 Subject: [PATCH] 消息管理丶店铺对接 --- src/views/operate/fivepack/threepack/index.vue | 255 +++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 227 insertions(+), 28 deletions(-) diff --git a/src/views/operate/fivepack/threepack/index.vue b/src/views/operate/fivepack/threepack/index.vue index af6d90e..7c4b16e 100644 --- a/src/views/operate/fivepack/threepack/index.vue +++ b/src/views/operate/fivepack/threepack/index.vue @@ -2,43 +2,153 @@ <div class="userList"> <myAside /> <div class="right"> - <myHeader @setDialog="changeDialog" @getSearch="getSearch"></myHeader> - <myMain :refresh="isFresh" :keyword="keyword" @resetFresh="resetFresh" /> + <header> + <div class="headerContent"> + <div class="find"> + <div class="search-item"> + <span>杈撳叆鏌ヨ:</span> + <el-input style="flex: 1" placeholder="璇疯緭鍏ュ簵閾虹紪鍙�" v-model="storeCode" slot="prefix"></el-input> + </div> + <div class="search-item"> + <span>搴楅摵鐘舵��:</span> + <el-select v-model="storeStatus" placeholder="閫夋嫨搴楅摵鐘舵��"> + <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" /> + </el-select> + </div> + <div class="findBtn"> + <el-button type="primary" @click="search" icon="el-icon-search">鏌ヨ</el-button> + <el-button icon="el-icon-delete-solid" @click="handleReset">閲嶇疆</el-button> + </div> + </div> + </div> + </header> + <main> + <!-- 鏁版嵁灞曠ず --> + <el-table ref="multipleTable" + :header-cell-style="{background:'#06122c','font-size':'12px',color:'#4b9bb7','font-weight':'650','line-height':'45px'}" + :data="tableData" style="width: 100%" :row-class-name="tableRowClassName"> + <el-table-column type="selection" min-width="5"> + </el-table-column> + <el-table-column prop="storeNumber" label="搴楅摵缂栧彿" min-width="10"> + </el-table-column> + <el-table-column prop="storeName" label="搴楅摵鍚嶇О" min-width="10"> + </el-table-column> + <el-table-column prop="owner" label="搴楅摵鑱旂郴浜�" min-width="10"> + </el-table-column> + <el-table-column prop="contact" label="搴楅摵鑱旂郴鐢佃瘽" min-width="10"> + </el-table-column> + <el-table-column prop="storeAddress" label="搴楅摵璇︾粏鍦板潃" min-width="10"> + </el-table-column> + <el-table-column prop="relationVideo" label="鍏宠仈鎽勫儚鏈�" min-width="10"> + </el-table-column> + <el-table-column prop="operation" label="鎿嶄綔" min-width="20"> + <template slot-scope="scope"> + <div class="operation"> + <el-link icon="el-icon-edit" :underline="false" @click="handleView(scope.row, 'update')">缂栬緫</el-link> + <el-link class="leftPx" icon="el-icon-delete-solid" :underline="false" @click="handleDelete(scope.row.id)">鍒犻櫎</el-link> + <el-link class="leftPx" icon="el-icon-edit" :underline="false">鎺ㄩ�佷俊鎭�</el-link> + <el-link class="leftPx" icon="el-icon-edit" :underline="false" @click="handleView(scope.row, 'view')">鏌ョ湅</el-link> + </div> + </template> + </el-table-column> + </el-table> + <!-- 鏌ョ湅淇敼椤甸潰 --> + <el-dialog :visible.sync="dialogUpdate" width="45%" + :title="updateFlag ? '淇敼搴楅摵淇℃伅' : '鏌ョ湅搴楅摵淇℃伅'" :before-close="handleClose"> + <updateUser :updateFlag="updateFlag" :storeInfo="storeInfo" @closeDialog="closeDialog" /> + </el-dialog> + <!-- 鍒嗛〉 --> + <div class="pagination"> + <el-pagination background :current-page="currentPage" layout="prev, pager, next" :total="totalNum" + :page-size="pageSize" @current-change="changeCurrentPage"> + </el-pagination> + </div> + </main> </div> </div> </template> <script> -import myHeader from "./components/header" -import myAside from "./components/aside" -import myMain from "./components/main" +import myAside from "./components/aside"; +import updateUser from "@/views/operate/fivepack/threepack/components/updateUser"; +import { getStoreInfoList, deleteStoreInfo } from "@/api/operate/storeManagement"; +import { SUCCESS_CODE } from "@/utils"; + export default { - components: { - myHeader, - myMain, - myAside + components: { myAside, updateUser }, + + created() { + this.search(); }, + data() { - return { - isFresh: false, - keyword: '', - } - }, + return { + storeCode: null, + storeStatus: null, + options: [{ label: '缁忚惀', value: 1 }, { label: '鍊掗棴', value: 2 }], + tableData: [], + dialogUpdate: false, + currentPage: 1, + totalNum: 0, + pageSize: 10, + userInfo: null, + updateFlag: false, + storeInfo: null + } + }, + methods: { - // 鑾峰彇鎼滅储杩斿洖缁撴灉 - getSearch({ text }) { - this.keyword = text; - this.isFresh = true; - }, - // 鑾峰彇鍒锋柊缁撴灉 - changeDialog({ flag }) { - console.log(flag); - this.isFresh = flag; - }, - // 閲嶇疆isFresh - resetFresh({ flag }) { - this.isFresh = flag; - console.log(this.isFresh); + search() { + getStoreInfoList({ keyword: this.storeCode }) + .then(({ list, pageSize, totalPage }) => { + this.tableData = list; + this.pageSize = pageSize; + this.totalNum = totalPage; + }) + .catch(err => this.$message({ type: 'error', message: err })); + }, + + handleReset() { + this.storeCode = ''; + this.storeStatus = null; + this.search(); + }, + + handleView(row, type) { + this.dialogUpdate = true; + this.storeInfo = row; + this.updateFlag = type === 'update'; + }, + + handleDelete(id) { + deleteStoreInfo(id) + .then(() => { + this.$message({ type: 'success', message }); + this.search(); + }) + .catch(err => this.$message({ type: 'error', message: err })); + }, + + handleClose() { + this.dialogUpdate = false; + }, + + closeDialog() { + this.dialogUpdate = false; + this.search(); + }, + + changeCurrentPage(currentPage) { + this.currentPage = currentPage; + this.search(); + }, + + tableRowClassName({ row, rowIndex }) { + if ((rowIndex + 1) % 2 === 0) { + return "warning-row"; + } else { + return "success-row"; } + }, } } </script> @@ -49,10 +159,99 @@ color: #4b9bb7; display: flex; height: 100%; + .right{ flex: 1; height: 100%; padding-left: 20px; + + .headerContent { + display: flex; + line-height: 100px; + justify-content: space-between; + align-items: center; + + .find { + display: flex; + } + + .search-item { + display: flex; + padding: 10px; + } + + .findBtn { + line-height: 100px; + margin-left: 15px; + display: flex; + align-items: center; + + .el-button { + padding: 12px 25px; + } + } + + .addBtn { + padding: 12px 30px; + margin-left: 20%; + } + } + + main { + background-color: #09152f; + margin-top: 20px; + padding-bottom: 50px; + + .mainTitle { + line-height: 60px; + } + + .el-link { + color: #4b9bb7; + } + + .leftPx { + margin-left: 10px; + } + + .pagination { + margin-top: 50px; + display: flex; + line-height: 50px; + justify-content: center; + + .el-pagination { + &::v-deep li, + &::v-deep .btn-prev, + &::v-deep .btn-next { + background-color: #071f39; + color: #4b9bb7; + } + } + } + + .el-table { + color: #4b9bb7; + font-size: 10px; + + &::v-deep .el-table__empty-block { + background-color: #09152f; + color: #4b9bb7; + } + + .operation { + display: flex; + + .el-button { + border: none; + } + + span:hover { + cursor: pointer; + } + } + } + } } &::v-deep .el-dialog__header, &::v-deep .el-dialog__body { -- Gitblit v1.8.0