From bcad3fe1b888ae11d437f6558b7974cfa30cfb2e Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期二, 13 一月 2026 18:24:07 +0800
Subject: [PATCH] 经销商管理
---
admin/src/views/business/platformGoods.vue | 94 ++++++++++++++++++++++------------------------
1 files changed, 45 insertions(+), 49 deletions(-)
diff --git a/admin/src/views/business/platformGoods.vue b/admin/src/views/business/platformGoods.vue
index cad4c97..2c1f3df 100644
--- a/admin/src/views/business/platformGoods.vue
+++ b/admin/src/views/business/platformGoods.vue
@@ -2,11 +2,11 @@
<TableLayout :permissions="['business:goods:query']">
<!-- 鎼滅储琛ㄥ崟 -->
<el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
- <el-tabs v-model="activeName" @tab-click="handleClick">
+<!-- <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="鍏ㄩ儴鍟嗗搧" name="first"></el-tab-pane>
<el-tab-pane label="宸插敭缃勫晢鍝�" name="second"></el-tab-pane>
<el-tab-pane label="鍥炴敹绔欏晢鍝�" name="third"></el-tab-pane>
- </el-tabs>
+ </el-tabs>-->
<el-form-item label="鍟嗗搧鍚嶇О" prop="name">
<el-input v-model="searchForm.name" placeholder="璇疯緭鍏ュ晢鍝佸悕绉�" @keypress.enter.native="search"></el-input>
</el-form-item>
@@ -51,15 +51,14 @@
<section>
<el-button type="primary" @click="search">鎼滅储</el-button>
<el-button @click="reset">閲嶇疆</el-button>
- <el-button @click="$refs.operaPlatformGoodsSkuWindow.open('骞冲彴SKU')">閲嶇疆</el-button>
</section>
</el-form>
<!-- 琛ㄦ牸鍜屽垎椤� -->
<template v-slot:table-wrap>
<ul class="toolbar" v-permissions="['business:goods:create', 'business:goods:delete']">
- <li><el-button type="primary" @click="$refs.operaGoodsWindow.open('鏂板缓鍟嗗搧', null, 0)" v-permissions="['business:goods:create']">鏂板缓</el-button></li>
- <li><el-button type="primary" @click="issued(0)">涓婃灦</el-button></li>
- <li><el-button type="primary" @click="soldOut(1)">涓嬫灦</el-button></li>
+ <li><el-button type="primary" icon="el-icon-plus" @click="$refs.operaGoodsWindow.open('鏂板缓鍟嗗搧', null, 0)" v-permissions="['business:goods:create']">鏂板缓</el-button></li>
+ <li><el-button type="primary" icon="el-icon-edit" @click="issued(0)">涓婃灦</el-button></li>
+ <li><el-button type="danger" icon="el-icon-edit" @click="issued(1)">涓嬫灦</el-button></li>
</ul>
<el-table
v-loading="isWorking.search"
@@ -69,10 +68,9 @@
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55"></el-table-column>
- <el-table-column prop="imgurl" label="鍟嗗搧淇℃伅" min-width="200px">
+ <el-table-column prop="imgurl" label="鍟嗗搧淇℃伅" min-width="100px">
<template slot-scope="{row}">
- <el-image v-if="row.imgurl" :src="row.resourcePath+row.imgurl" :preview-src-list="[row.resourcePath+row.imgurl]"></el-image>
- {{ row.name }}
+ <el-image style="width: 80px;height: 80px;" v-if="row.imgurl && row.imgurl!=''" :src="row.resourcePath+row.imgurl" :preview-src-list="[row.resourcePath+row.imgurl]"></el-image>
</template>
</el-table-column>
<el-table-column prop="id" label="鍟嗗搧ID" min-width="150px" ></el-table-column>
@@ -83,13 +81,18 @@
<el-table-column prop="stockNum" label="鍓╀綑搴撳瓨閲�" min-width="100px"></el-table-column>
<el-table-column prop="salesVolume" label="瀹為檯閿�閲�" min-width="100px"></el-table-column>
<el-table-column prop="skuPrice" label="闆跺敭浠�(鍏�)" min-width="100px"></el-table-column>
+ <el-table-column prop="shopPrice" label="渚涜揣浠疯缃�" min-width="100px" align="center">
+ <template slot-scope="{row}" >
+ <div @click="goPriceSet(row)" style="cursor:pointer;"><span class="red"> {{row.shopPriceNum||0}}</span> / <span class="green"> {{row.shopNum||0}}</span> </div>
+ </template>
+ </el-table-column>
<el-table-column prop="editDate" label="鏈�杩戞洿鏂版椂闂�" min-width="100px"></el-table-column>
- <el-table-column prop="status" label="鐘舵��" min-width="100px">
+ <el-table-column prop="status" label="涓婁笅鏋剁姸鎬�" min-width="100px" fixed="right" align="center">
<template slot-scope="{row}">
<el-switch
v-model="row.status"
- :active-value="1"
- :inactive-value="0"
+ :active-value="0"
+ :inactive-value="1"
active-color="#13ce66"
inactive-color="#ff4949"
@change="statusChange(row)"
@@ -98,13 +101,14 @@
</el-table-column>
<el-table-column
label="鎿嶄綔"
- min-width="120"
+ min-width="250"
fixed="right"
>
<template slot-scope="{row}">
- <el-button type="text" @click="$refs.operaGoodsWindow.open('缂栬緫鍟嗗搧', row, 0)" v-permissions="['business:goods:update']">缂栬緫</el-button>
- <el-button type="text" @click="deleteById(row)" v-permissions="['business:goods:delete']">鍒犻櫎</el-button>
- <el-button type="text" @click="$refs.operaGoodsDetailWindow.open('鍟嗗搧璇︽儏', row, 0)">鏌ョ湅璇︽儏</el-button>
+ <el-button type="text" @click="$refs.operaGoodsWindow.open('缂栬緫鍟嗗搧', row, 0)" v-permissions="['business:goods:update']">缂栬緫</el-button>
+ <el-button type="text" @click="goPriceSet(row)">渚涜揣浠�</el-button>
+ <el-button type="text" style="color: red;" @click="deleteById(row)" v-permissions="['business:goods:delete']">鍒犻櫎</el-button>
+ <!-- <el-button type="text" @click="$refs.operaGoodsDetailWindow.open('鍟嗗搧璇︽儏', row, 0)">鏌ョ湅璇︽儏</el-button>-->
</template>
</el-table-column>
</el-table>
@@ -129,8 +133,7 @@
import OperaGoodsWindow from '@/components/business/OperaGoodsWindow'
import OperaGoodsDetailWindow from '@/components/business/OperaGoodsDetailWindow'
import OperaPlatformGoodsSkuWindow from '@/components/business/OperaPlatformGoodsSkuWindow'
-import { fetchList as labelList } from '@/api/business/labels'
-import { updateById } from '@/api/business/goods'
+import { findAll as labelList } from '@/api/business/labels'
export default {
name: 'Goods',
extends: BaseTable,
@@ -165,13 +168,14 @@
labels: ''
},
labels: [],
- brands: [],
+ serials: [],
+ brands: []
}
},
- provide() {
+ provide () {
return {
labels: () => this.labels,
- brands: () => this.brands,
+ brands: () => this.brands
}
},
created () {
@@ -182,58 +186,50 @@
'field.main': 'id'
})
this.search()
-
labelList({
- capacity: 999,
- model: {
- type: 0 //鍟嗗搧鍒嗙被
- }
+ type: 0 // 鍟嗗搧鍒嗙被
+ }).then(res => {
+ this.labels = res
+ })
+ labelList({
+ type: 1 // 鍟嗗搧鍝佺墝
})
.then(res => {
- this.labels = res.records
- })
- labelList({
- capacity: 999,
- model: {
- type: 1 //鍟嗗搧鍝佺墝
- }
- })
- .then(res => {
- this.brands = res.records
+ this.brands = res
})
},
methods: {
- handleClick(val) {
+ goPriceSet(row){
+ },
+ handleClick (val) {
},
/**
*
* @param {涓婁笅鐘舵�亇 status 0涓婃灦 1涓嬫灦
*/
- issued(status) {
+ issued (status) {
if (this.tableData.selectedRows.length === 0) {
this.$tip.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�')
return
}
- let message = `纭${status==0?'涓婃灦':'涓嬫灦'}閫変腑鐨勫晢鍝佷箞?`
+ const message = `纭${status === 0 ? '涓婃灦' : '涓嬫灦'}閫変腑鐨勫晢鍝佷箞?`
this.$dialog.messageWaring(message)
.then(() => {
-
})
},
-
- statusChange(row) {
- updateById(row)
+ statusChange (row) {
+ this.statusChangeBiz([row])
+ },
+ statusChangeBiz (rows) {
+ this.api.updateStatus(rows)
.then(() => {
- this.$message.success('鎿嶄綔鎴愬姛')
+ this.search()
})
.catch(e => {
- this.$message.error('鎿嶄綔鎴愬姛')
- })
- .then(() => {
- this.handlePageChange()
+ this.search()
})
}
- },
+ }
}
</script>
--
Gitblit v1.9.3