From 28db820caf0ed90f4326d29cb0fa7a19cba92775 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期五, 27 二月 2026 16:33:03 +0800
Subject: [PATCH] 经销商管理

---
 admin/src/components/business/OperaCouponWindow.vue |   73 ++++++++++++++++++++----------------
 1 files changed, 40 insertions(+), 33 deletions(-)

diff --git a/admin/src/components/business/OperaCouponWindow.vue b/admin/src/components/business/OperaCouponWindow.vue
index 68002b6..2f1df05 100644
--- a/admin/src/components/business/OperaCouponWindow.vue
+++ b/admin/src/components/business/OperaCouponWindow.vue
@@ -28,10 +28,14 @@
           <el-input  v-model="form.price"     placeholder="璇疯緭鍏�"    @input="inputAction(form, 'price')"  >
             <template slot="append" >{{form.couponType ===1?'鎶�':'鍏�'}}</template>
           </el-input>
+          <div class="discrep"  v-if="form.couponType === 1" >锛屾姌鎵d紭鎯犻噾棰濅笂闄�</div>
+          <el-input  v-model="form.maxPrice"     v-if="form.couponType === 1"  placeholder="璇疯緭鍏�"    @input="inputAction(form, 'maxPrice')"  >
+            <template slot="append" >鍏�</template>
+          </el-input>
         </div>
       </el-form-item>
       <el-form-item label="浼樻儬鍒歌鏄�" prop="info">
-        <el-input type="textarea" v-model="form.info" placeholder="璇疯緭鍏ヤ紭鎯犲埜璇存槑"  v-trim/>
+        <el-input type="textarea" v-model="form.info" placeholder="璇疯緭鍏ヤ紭鎯犲埜璇存槑" maxlength="500"  v-trim/>
       </el-form-item>
       <p class="tip-header" >浣跨敤闄愬埗</p>
       <el-form-item label="鏈夋晥鏈�" prop="useType">
@@ -75,7 +79,7 @@
         </el-radio-group>
       </el-form-item>
       <el-form-item v-if="form.applyType===1" label="閫夋嫨鍝佺被" prop="applyCateIdList" >
-        <el-select v-model="form.applyCateIdList"  placeholder="璇烽�夋嫨,鏀寔澶氶��" filterable multiple clearable >
+        <el-select v-model="form.applyCateIdList"  placeholder="璇烽�夋嫨鍟嗗搧鍒嗙被,鏀寔澶氶��" filterable multiple clearable >
           <el-option  v-for="item in categorys" :key="'optCate'+item.id"  :label="item.name"  :value="item.id">  </el-option>
         </el-select>
       </el-form-item>
@@ -86,8 +90,9 @@
       <p class="tip-header" >鍙戞斁瑙勫垯</p>
       <el-form-item label="鍙戞斁鎬婚噺" prop="num">
         <div class="num-style">
-          <el-input-number  v-model="form.num" :controls="false" :min="1" :max="99999" placeholder="璇疯緭鍏ュ彂鏀炬�婚噺(1~99999)" v-trim></el-input-number>
+          <el-input-number  v-model="form.num" :controls="false" :min="0" :max="99999" placeholder="璇疯緭鍏ュ彂鏀炬�婚噺(0~99999)" v-trim></el-input-number>
         </div>
+        <p class="tip-warn" style="margin-bottom: 1px;"><i class="el-icon-warning"></i>鎻愰啋锛氬彂鏀炬�婚噺涓�0琛ㄧず涓嶉檺鍒�</p>
       </el-form-item>
     </el-form>
     <OperaCouponGoodsWindow ref="OperaCouponGoodsWindow" @success="doSelect"/>
@@ -99,18 +104,20 @@
 import { fetchList as shopList } from '@/api/business/shop'
 import GlobalWindow from '@/components/common/GlobalWindow'
 import { findAll as labelList } from '@/api/business/labels'
-import { allList as goodsList} from '@/api/business/goods'
+import { allList as goodsList } from '@/api/business/goods'
 import OperaCouponGoodsWindow from '@/components/business/OperaCouponGoodsWindow'
 export default {
   name: 'OperaCouponWindow',
   extends: BaseOpera,
-  components: { GlobalWindow,OperaCouponGoodsWindow },
+  components: { GlobalWindow, OperaCouponGoodsWindow },
   data () {
     const couponRules = (rule, value, callback) => {
       if (!this.form.limitPrice) {
         callback(new Error('璇疯緭鍏ユ弧棰�'))
       } else if (!this.form.price) {
         callback(new Error('璇峰畬鍠勪紭鎯犺鍒�'))
+      } else if (this.form.couponType == 1 && (this.form.price <= 0 || this.form.price >= 10)) {
+        callback(new Error('浼樻儬鎶樻墸鍙兘涓� (0,10)鑼冨洿鍐�'))
       } else {
         callback()
       }
@@ -134,8 +141,8 @@
     return {
       searchLoading: false,
       getDate: [],
-      applyDataList:[],
-      showGoods:false,
+      applyDataList: [],
+      showGoods: false,
       // 琛ㄥ崟鏁版嵁
       form: {
         id: null,
@@ -180,10 +187,10 @@
         ],
         num: [
           { required: true, validator: numRule, message: '璇疯緭鍏ュ彂鏀炬�绘暟', tigger: 'blur' }
-        ],
-        /*integral: [
+        ]
+        /* integral: [
           { required: true, validator: numRule, message: '璇疯緭鍏ュ厬鎹㈡潯浠�', tigger: 'blur' }
-        ],*/
+        ], */
         // validDays: [
         //   { required: true, message: '璇疯緭鍏ュ彲鐢ㄦ椂闂�', tigger: 'blur' }
         // ],
@@ -203,19 +210,19 @@
     })
   },
   methods: {
-    selectGoods(){
+    selectGoods () {
       this.$refs.OperaCouponGoodsWindow.open('閫夋嫨鍟嗗搧', this.applyDataList)
     },
-    loadLabels(){
+    loadLabels () {
       labelList({
         type: 0 // 鍟嗗搧鍒嗙被
       }).then(res => {
         this.categorys = res || []
       })
     },
-    loadSelectGoods(){
+    loadSelectGoods () {
       console.log(this.form.applyIdList)
-      if(!this.form.applyIdList || !this.form.applyIdList.length){
+      if (!this.form.applyIdList || !this.form.applyIdList.length) {
         return
       }
       goodsList({
@@ -224,11 +231,11 @@
         this.applyDataList = res || []
       })
     },
-    doSelect(rows){
-      console.log(rows,this.applyDataList)
-      this.applyDataList =[]
-      this.form.applyIdList=[]
-      if(rows && rows.length){
+    doSelect (rows) {
+      console.log(rows, this.applyDataList)
+      this.applyDataList = []
+      this.form.applyIdList = []
+      if (rows && rows.length) {
         rows.forEach(item => {
           this.applyDataList.push(item)
           this.form.applyIdList.push(item.id)
@@ -236,22 +243,22 @@
       }
     },
     open (title, target, type) {
-      this.showGoods=false
+      this.showGoods = false
       this.title = title
       this.visible = true
       this.form.type = type
       this.getDate = []
       this.form.startDate = ''
       this.form.endDate = ''
-      this.applyDataList=[]
-      this.form.applyIdList=[]
-      this.form.applyCateIdList=[]
+      this.applyDataList = []
+      this.form.applyIdList = []
+      this.form.applyCateIdList = []
       this.loadLabels()
-      this.form.limitPrice=null
-      this.form.price=null
-      this.form.startDate=null
-      this.form.endDate=null
-      this.form.num=1
+      this.form.limitPrice = null
+      this.form.price = null
+      this.form.startDate = null
+      this.form.endDate = null
+      this.form.num = 1
       // 鏂板缓
       if (target == null) {
         this.$nextTick(() => {
@@ -267,16 +274,16 @@
           this.form[key] = target[key]
         }
         this.getDate = [target.startDate, target.endDate]
-        if(this.form.applyType === 1){
-          this.form.applyCateIdList =[]
+        if (this.form.applyType === 1) {
+          this.form.applyCateIdList = []
           var ta = this.form.applyIds.split(',')
-          if(ta && ta.length){
-            ta.forEach(tt =>{
+          if (ta && ta.length) {
+            ta.forEach(tt => {
               this.form.applyCateIdList.push(parseInt(tt))
             })
           }
         }
-        if(this.form.applyType === 2){
+        if (this.form.applyType === 2) {
           this.form.applyIdList = this.form.applyIds.split(',')
           this.loadSelectGoods()
         }

--
Gitblit v1.9.3