From c384e04f81caf681647c602d5896cc10b289582e Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期五, 27 二月 2026 14:59:16 +0800
Subject: [PATCH] 经销商管理
---
admin/src/views/business/shop.vue | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 105 insertions(+), 9 deletions(-)
diff --git a/admin/src/views/business/shop.vue b/admin/src/views/business/shop.vue
index 3f77ae9..8a7ad1c 100644
--- a/admin/src/views/business/shop.vue
+++ b/admin/src/views/business/shop.vue
@@ -5,19 +5,52 @@
<el-form-item label="鍚嶇О" prop="name">
<el-input v-model="searchForm.name" placeholder="璇疯緭鍏ュ悕绉�" @keypress.enter.native="search"></el-input>
</el-form-item>
+ <el-form-item label="闂ㄥ簵ID" prop="code">
+ <el-input v-model="searchForm.code" placeholder="璇疯緭鍏ラ棬搴桰D" @keypress.enter.native="search"></el-input>
+ </el-form-item>
<el-form-item label="鐧诲綍璐﹀彿" prop="name">
<el-input v-model="searchForm.username" placeholder="璇疯緭鍏ョ櫥褰曡处鍙�" @keypress.enter.native="search"></el-input>
</el-form-item>
<el-form-item label="閿�鍞ā寮�" prop="saleType" >
<!-- 0姝e父 1绂佺敤 -->
- <el-select v-model="searchForm.saleType" placeholder="閿�鍞ā寮�" @change="search" >
+ <el-select v-model="searchForm.saleType" placeholder="閿�鍞ā寮�" style="width: 100px" @change="search" >
<el-option :key="0" :value="0" label="骞冲彴閾鸿揣" ></el-option>
<el-option :key="1" :value="1" label="鑷富閲囪喘" ></el-option>
</el-select>
</el-form-item>
+ <el-form-item label="鐪佸競鍖�" prop="provinceId" >
+ <el-select v-model="searchForm.provinceId" placeholder="鐪佷唤" style="width: 100px" filterable @change="selectProvince">
+ <el-option
+ v-for="item in provinces"
+ :key="item.id"
+ :value="item.id"
+ :label="item.name"
+ ></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="" prop="cityId" >
+ <el-select v-model="searchForm.cityId" filterable placeholder="鍩庡競" @change="selectCity" style="width: 100px" >
+ <el-option
+ v-for="item in cities"
+ :key="item.id"
+ :value="item.id"
+ :label="item.name"
+ ></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="" prop="areaId" >
+ <el-select v-model="searchForm.areaId" filterable placeholder="鍖哄煙" style="width: 100px" >
+ <el-option
+ v-for="item in areas"
+ :key="item.id"
+ :value="item.id"
+ :label="item.name"
+ ></el-option>
+ </el-select>
+ </el-form-item>
<el-form-item label="鐘舵��" prop="status">
<!-- 0姝e父 1绂佺敤 -->
- <el-select v-model="searchForm.status" placeholder="璇烽�夋嫨鐘舵��" @change="search" >
+ <el-select v-model="searchForm.status" placeholder="璇烽�夋嫨鐘舵��" style="width: 100px" @change="search" >
<el-option :key="0" :value="0" label="姝e父" ></el-option>
<el-option :key="1" :value="1" label="绂佺敤" ></el-option>
</el-select>
@@ -29,9 +62,10 @@
</el-form>
<!-- 琛ㄦ牸鍜屽垎椤� -->
<template v-slot:table-wrap>
- <ul class="toolbar" v-permissions="['business:shop:create', 'business:shop:delete']">
+ <ul class="toolbar" >
<li><el-button type="primary" @click="$refs.operaShopWindow.open('鏂板缓缁忛攢鍟�')" icon="el-icon-plus" v-permissions="['business:shop:create']">鏂板缓</el-button></li>
<!-- <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:shop:delete']">鍒犻櫎</el-button></li> -->
+ <li><p class="tip-warn" style="width: 100%;margin-left: 20px;"><i class="el-icon-warning"></i>鎻愮ず锛氥�愪緵璐т环璁剧疆銆戝彧缁熻涓婃灦鐘舵�佺殑鍟嗗搧浠锋牸璁剧疆鏁版嵁,(宸插畾浠峰晢鍝佹暟/鍏ㄩ儴鍟嗗搧鏁�)</p></li>
</ul>
<el-table
v-loading="isWorking.search"
@@ -77,6 +111,11 @@
{{ row.saleType == 1?'鑷富閲囪喘':'骞冲彴閾鸿揣'}}
</template>
</el-table-column>
+ <el-table-column prop="shopPrice" label="渚涜揣浠疯缃�" min-width="100px" align="center">
+ <template slot-scope="{row}" >
+ <div title="閽堝涓婃灦鍟嗗搧浠锋牸璁剧疆缁熻" @click="goPriceSet(row)" style="cursor:pointer;"><span class="red"> {{row.pricedGoodsNum||0}}</span> / <span class="green"> {{row.goodsNum||0}}</span> </div>
+ </template>
+ </el-table-column>
<el-table-column prop="createDate" label="鍒涘缓鏃堕棿" align="center" min-width="140px"></el-table-column>
<el-table-column prop="status" label="鐘舵��" align="center" min-width="100px" fixed="right">
<template slot-scope="{row}">
@@ -93,15 +132,15 @@
<el-table-column
v-if="containPermissions(['business:shop:update', 'business:shop:delete'])"
label="鎿嶄綔"
- min-width="200"
+ min-width="280"
fixed="right"
align="center"
>
<template slot-scope="{row}">
<el-button type="text" @click="$refs.operaShopWindow.open('缂栬緫缁忛攢鍟�', row)" icon="el-icon-edit" v-permissions="['business:shop:update']">缂栬緫</el-button>
+ <el-button type="text" v-permissions="['business:shop:update']" icon="el-icon-edit" @click="goPriceSet(row)">渚涜揣浠�</el-button>
<el-button type="text" @click="resetPwd(row)" icon="el-icon-edit" v-permissions="['business:shop:update']">閲嶇疆瀵嗙爜</el-button>
<el-button type="text" style="color: red" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:shop:delete']">鍒犻櫎</el-button>
-
</template>
</el-table-column>
</el-table>
@@ -116,6 +155,7 @@
<OperaShopWindow ref="operaShopWindow" @success="handlePageChange"/>
<OperaShopInfoWindow ref="OperaShopInfoWindow" />
<ResetPwdShopWindow ref="resetPwdWindow"/>
+ <OperaGoodsShopWindow ref="OperaGoodsShopWindow" @success="handlePageChange"/>
</TableLayout>
</template>
@@ -125,23 +165,32 @@
import Pagination from '@/components/common/Pagination'
import OperaShopWindow from '@/components/business/OperaShopWindow'
import OperaShopInfoWindow from '@/components/business/OperaShopInfoWindow'
+import OperaGoodsShopWindow from '@/components/business/OperaGoodsShopWindow'
import { resetPwd, updateIsRecById } from '@/api/business/shop'
import ResetPwdShopWindow from '@/components/business/ResetPwdShopWindow'
+import { listByParentId } from '@/api/business/areas'
export default {
name: 'Shop',
extends: BaseTable,
- components: { TableLayout, Pagination, OperaShopWindow, OperaShopInfoWindow, ResetPwdShopWindow },
+ components: { TableLayout, Pagination, OperaShopWindow, OperaShopInfoWindow, ResetPwdShopWindow, OperaGoodsShopWindow },
data () {
return {
// 鎼滅储
searchForm: {
name: '',
+ code: '',
username: '',
status: '',
saleType: '',
- isrec: ''
- }
+ isrec: '',
+ provinceId: '',
+ cityId: '',
+ areaId: ''
+ },
+ provinces: [],
+ cities: [],
+ areas: []
}
},
created () {
@@ -151,9 +200,56 @@
'field.id': 'id',
'field.main': 'id'
})
+ listByParentId({ type: 0, parentId: '' })
+ .then(data => {
+ this.provinces = data
+ })
this.search()
},
methods: {
+ selectProvince (val) {
+ this.searchForm.cityId = null
+ this.searchForm.areaId = null
+ this.cities = []
+ this.areas = []
+ listByParentId({ type: 1, parentId: val })
+ .then(data => {
+ this.cities = data
+ })
+ .catch(e => {
+ this.$tip.error(e)
+ })
+ },
+ selectCity (val) {
+ this.searchForm.areaId = null
+ this.areas = []
+ listByParentId({ type: 2, parentId: val })
+ .then(data => {
+ this.areas = data
+ })
+ .catch(e => {
+ this.$tip.error(e)
+ })
+ },
+ initCityArea (proid, cityid) {
+ listByParentId({ type: 1, parentId: proid })
+ .then(data => {
+ this.cities = data
+ })
+ .catch(e => {
+ this.$tip.error(e)
+ })
+ listByParentId({ type: 2, parentId: cityid })
+ .then(data => {
+ this.areas = data
+ })
+ .catch(e => {
+ this.$tip.error(e)
+ })
+ },
+ goPriceSet (row) {
+ this.$refs.OperaGoodsShopWindow.open('璁剧疆渚涜揣浠� - ' + row.name, row)
+ },
resetPwd (row) {
this.$dialog.messageWaring('纭閲嶇疆璇ョ粡閿�鍟嗐��' + row.name + '銆戠殑鐧诲綍瀵嗙爜鍚楋紵')
.then(() => {
@@ -184,7 +280,7 @@
})
},
showDetail (row) {
- this.$refs.OperaShopInfoWindow.open('缁忛攢鍟嗚鎯�', row)
+ this.$refs.OperaShopInfoWindow.open('缁忛攢鍟嗚鎯呫��' + row.name + '銆�', row)
}
}
}
--
Gitblit v1.9.3