From f93f02d8cc15732652c751f69e7319858ca6f0a4 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期三, 21 一月 2026 17:19:26 +0800
Subject: [PATCH] 经销商管理
---
admin/src/views/business/shop.vue | 2
admin/src/views/business/platformGoods.vue | 17 +++++---
server/dmmall_service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java | 41 ++++++++++++++++----
admin/src/components/business/OperaShopGoodsWindow.vue | 2
admin/src/components/business/OperaGoodsShopWindow.vue | 17 ++++++--
5 files changed, 58 insertions(+), 21 deletions(-)
diff --git a/admin/src/components/business/OperaGoodsShopWindow.vue b/admin/src/components/business/OperaGoodsShopWindow.vue
index a050866..0030c5c 100644
--- a/admin/src/components/business/OperaGoodsShopWindow.vue
+++ b/admin/src/components/business/OperaGoodsShopWindow.vue
@@ -109,7 +109,10 @@
<el-input v-if="scope.row.isPriceSelected" v-model="scope.row.shopPrice"
@focus="focusEvent(scope.row,scope.$index,scope.column)"
@blur="blurEvent(scope.row,scope.$index,scope.column)" v-focus></el-input>
- <p style="cursor: pointer" class="blue" title="鐐瑰嚮缂栬緫" @click="cellClick(scope.row, scope.column)" v-else>{{scope.row.shopPrice || '鏈缃�' }}</p>
+ <p :style="'cursor: pointer;'+((scope.row.skuPrice||0) <= (scope.row.shopPrice||0)?'color: red':'')+';'" class="blue" title="鐐瑰嚮缂栬緫" @click="cellClick(scope.row, scope.column)" v-else>
+ {{scope.row.shopPrice || '鏈缃�' }}
+ <i v-if="(scope.row.skuPrice||0) <= (scope.row.shopPrice||0)" class="el-icon-warning" style="color: red"></i>
+ </p>
</template>
</el-table-column>
<!-- <el-table-column
@@ -163,7 +166,7 @@
brandId: '',
// 绫诲瀷 0骞冲彴鍟嗗煄 1鍜栬眴鍟嗗煄 2鍜栧暋璁″垝鍟嗗搧
type: '0', // 骞冲彴鍟嗗搧
- status: '',
+ status: 0,
labels: ''
},
labels: [],
@@ -255,8 +258,14 @@
row.oldShopsPrice = row.shopPrice
},
blurEvent (row, curIndex, column) {
- if ( !this.skuPrice || this.skuPrice <= row.shopPrice) {
- this.$tip.error('渚涜揣浠蜂笉鑳戒綆浜庨攢鍞环')
+ if ( !row.skuPrice) {
+ this.$tip.error('鍟嗗搧閿�鍞环鏈缃紒')
+ row.isPriceSelected = !row.isPriceSelected
+ row.shopPrice = row.oldShopsPrice// 浠锋牸杩樺師
+ return
+ }
+ if ( row.skuPrice <= row.shopPrice) {
+ this.$tip.error('渚涜揣浠蜂笉鑳藉ぇ浜庨攢鍞环')
row.isPriceSelected = !row.isPriceSelected
row.shopPrice = row.oldShopsPrice// 浠锋牸杩樺師
return
diff --git a/admin/src/components/business/OperaShopGoodsWindow.vue b/admin/src/components/business/OperaShopGoodsWindow.vue
index 121181f..d8fdbb5 100644
--- a/admin/src/components/business/OperaShopGoodsWindow.vue
+++ b/admin/src/components/business/OperaShopGoodsWindow.vue
@@ -181,7 +181,7 @@
},
blurEvent (row, curIndex, column) {
if(this.price <= row.goodsPrice) {
- this.$tip.error('渚涜揣浠蜂笉鑳戒綆浜庨攢鍞环')
+ this.$tip.error('渚涜揣浠蜂笉鑳藉ぇ浜庨攢鍞环')
row.isPriceSelected = !row.isPriceSelected
row.goodsPrice = row.oldGoodsPrice// 浠锋牸杩樺師
return
diff --git a/admin/src/views/business/platformGoods.vue b/admin/src/views/business/platformGoods.vue
index b4d7273..885cc8c 100644
--- a/admin/src/views/business/platformGoods.vue
+++ b/admin/src/views/business/platformGoods.vue
@@ -62,7 +62,7 @@
<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>
- <li><p class="tip-warn" style="width: 100%;margin-left: 20px;"><i class="el-icon-warning"></i>鎻愮ず锛氥�愪緵璐т环璁剧疆銆戝彧缁熻鍚敤鐘舵�佺殑渚涢攢鍟嗚缃暟鎹�</p></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"
@@ -143,7 +143,7 @@
export default {
name: 'Goods',
extends: BaseTable,
- components: { TableLayout, Pagination, OperaGoodsWindow, OperaGoodsDetailWindow, OperaPlatformGoodsSkuWindow ,OperaShopGoodsWindow},
+ components: { TableLayout, Pagination, OperaGoodsWindow, OperaGoodsDetailWindow, OperaPlatformGoodsSkuWindow, OperaShopGoodsWindow },
data () {
return {
activeName: 'first',
@@ -190,15 +190,15 @@
})
},
methods: {
- priceSuccess(){
+ priceSuccess () {
this.handlePageChange()
},
- goPriceSet(row){
- if(row.skuPrice == null){
+ goPriceSet (row) {
+ if (row.skuPrice == null) {
this.$tip.warning('璇峰厛璁剧疆鍟嗗搧閿�鍞环锛�')
return
}
- this.$refs.OperaShopGoodsWindow.open('璁剧疆渚涜揣浠� - '+row.name, row )
+ this.$refs.OperaShopGoodsWindow.open('璁剧疆渚涜揣浠� - ' + row.name, row)
},
handleClick (val) {
@@ -215,6 +215,11 @@
const message = `纭${status === 0 ? '涓婃灦' : '涓嬫灦'}閫変腑鐨勫晢鍝佷箞?`
this.$dialog.messageWaring(message)
.then(() => {
+ var temp = []
+ this.tableData.selectedRows.forEach(item => {
+ temp.push({ id: item.id, name: item.name, status: status })
+ })
+ this.statusChangeBiz(temp)
})
},
statusChange (row) {
diff --git a/admin/src/views/business/shop.vue b/admin/src/views/business/shop.vue
index 1f91fc3..7bf74de 100644
--- a/admin/src/views/business/shop.vue
+++ b/admin/src/views/business/shop.vue
@@ -32,7 +32,7 @@
<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>
+ <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"
diff --git a/server/dmmall_service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java b/server/dmmall_service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java
index 43968bc..ec2bf51 100644
--- a/server/dmmall_service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java
+++ b/server/dmmall_service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java
@@ -372,6 +372,7 @@
if(goodsSkuList==null || goodsSkuList.size() == 0){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "鍟嗗搧灏氭湭璁剧疆闆跺敭浠凤紝璇峰厛璁剧疆浠锋牸锛� ");
}
+ List<Integer> idList2 = new ArrayList<>();
for(Goods param: list){
Goods goods = getGoodsFromListById(param.getId(),goodsList,goodsSkuList);
if(goods ==null ){
@@ -379,25 +380,47 @@
}
//濡傛灉鏄笂鏋�
goods.setGoodsSkuList(goodsSkuList);
+ boolean s =true;
if(goods.getSkuPrice() == null || goods.getSkuPrice().compareTo(new BigDecimal(0)) <=0){
//榛樿sku淇℃伅
- throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), goods.getName()+":鍟嗗搧鍟嗗搧灏氭湭璁剧疆闆跺敭浠凤紝鏃犳硶涓婃灦");
+ s =false;
+ if(idList.size()==1) {
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), goods.getName()+":鍟嗗搧鍟嗗搧灏氭湭璁剧疆闆跺敭浠凤紝鏃犳硶涓婃灦");
+ }
}
- if(Constants.formatLongNum(goods.getPricedShopNum()) <= shopNum){
+ if(Constants.formatLongNum(goods.getPricedShopNum()) < shopNum){
//榛樿sku淇℃伅
- throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), goods.getName()+":鏈夋湭璁剧疆渚涜揣浠风殑缁忛攢鍟嗭紝鏃犳硶涓婃灦");
+ s =false;
+ if(idList.size()==1){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), goods.getName()+":鏈夋湭璁剧疆渚涜揣浠风殑缁忛攢鍟嗭紝鏃犳硶涓婃灦");
+ }
+
+ }
+ if(s){
+ idList2.add(param.getId());
}
}
- goodsMapper.update(null,new UpdateWrapper<Goods>().lambda()
- .set(Goods::getEditDate,new Date() )
- .set(Goods::getEditor,user.getId())
- .set(Goods::getStatus,Constants.ZERO )
- .in(Goods::getId,idList));
+ int successNum = 0;
+ if(idList2.size()>0){
+ successNum = goodsMapper.update(null,new UpdateWrapper<Goods>().lambda()
+ .set(Goods::getEditDate,new Date() )
+ .set(Goods::getEditor,user.getId())
+ .set(Goods::getStatus,Constants.ZERO )
+ .in(Goods::getId,idList2));
+ }
+
+ if(successNum != idList.size()){
+ if( idList.size()>1){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "鎴愬姛涓婃灦鍟嗗搧鏁帮細銆�"+successNum+"銆戯紝涓婃灦澶辫触锛氥��"+(idList.size()-successNum)+"銆戜釜鍟嗗搧,璇风‘淇濆緟涓婃灦鍟嗗搧鐨勫潎閿�鍞环鍜屼緵璐т环宸茶缃�");
+ }else {
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode()," 涓婃灦澶辫触");
+ }
+ }
}
private Goods getGoodsFromListById(Integer id, List<Goods> goodsList, List<GoodsSku> skuList) {
for(Goods model: goodsList){
- if(Constants.equalsObject(model.getIdList(),id)){
+ if(Constants.equalsInteger(model.getId(),id)){
for(GoodsSku sku :skuList){
if(Constants.equalsInteger(sku.getGoodsId(),id)){
model.setSkuPrice(sku.getPrice());
--
Gitblit v1.9.3