Browse Source

2024.08.05
- 商家列表页增加代金券提现比例字段;

zweiqin 8 months ago
parent
commit
3eb65ad8ca

+ 12 - 8
src/views/business/businessList/components/DetailModal.vue

@@ -8,6 +8,17 @@
       <el-form-item label="店铺名称" prop="shopName">
         {{ formData.shopName || '--' }}
       </el-form-item>
+      <el-form-item label="是否支持代金券" prop="isVoucher">
+        <span v-if="formData.isVoucher === 1">允许</span>
+        <span v-else-if="formData.isVoucher === 2">拒绝</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="请输入代金券返还比例" prop="voucherReturn">
+        {{ formData.voucherReturn || '--' }}%
+      </el-form-item>
+      <el-form-item label="代金券提现比例" prop="voucherCoinRatio">
+        {{ formData.voucherCoinRatio || '--' }}
+      </el-form-item>
       <el-form-item label="是否支持消费金" prop="isBeeCoin">
         <span v-if="formData.isBeeCoin === 1">支持</span>
         <span v-else-if="formData.isBeeCoin === 2">不支持</span>
@@ -64,14 +75,6 @@
         <span v-else-if="formData.shopType === 2">本地</span>
         <span v-else>--</span>
       </el-form-item>
-      <el-form-item label="是否支持代金券" prop="isVoucher">
-        <span v-if="formData.isVoucher === 1">允许</span>
-        <span v-else-if="formData.isVoucher === 2">拒绝</span>
-        <span v-else>--</span>
-      </el-form-item>
-      <el-form-item label="请输入代金券返还比例" prop="voucherReturn">
-        {{ formData.voucherReturn || '--' }}%
-      </el-form-item>
       <el-form-item label="惠市宝商家编号" prop="hsbMrchId">
         {{ formData.hsbMrchId || '--' }}
       </el-form-item>
@@ -137,6 +140,7 @@ export default {
       formData: {
         shopId: '',
         shopName: '', // 店铺名称
+        voucherCoinRatio: '', // 代金券提现比例
         isBeeCoin: '', // 是否支持消费金
         beeCoinRatio: '', // 商家消费金提现比例
         chargePersonName: '', // 店铺负责人

+ 45 - 42
src/views/business/businessList/components/EditModal.vue

@@ -2,13 +2,37 @@
   <div>
     <el-dialog :visible.sync="visible" v-bind="modalOptions">
       <div>
-        <el-form ref="formData" :model="formData" :rules="formRules" size="mini" label-suffix=":" label-width="150px">
+        <el-form ref="formData" :model="formData" :rules="formRules" size="mini" label-suffix=":" label-width="160px">
           <div>
             <el-tabs v-model="activeName">
               <el-tab-pane label="授权信息" name="first">
                 <el-form-item label="店铺名称" prop="shopName">
                   <el-input v-model="formData.shopName" maxlength="20" />
                 </el-form-item>
+                <el-form-item label="是否支持代金券" prop="isVoucher">
+                  <el-radio-group v-model="formData.isVoucher">
+                    <el-radio :label="1">
+                      允许
+                    </el-radio>
+                    <el-radio :label="2">
+                      拒绝
+                    </el-radio>
+                  </el-radio-group>
+                </el-form-item>
+                <el-form-item
+                  v-if="formData.isVoucher === 1" :rules="[
+                    { required: true, message: '请输入代金券返还比例', trigger: 'blur' },
+                    { type: 'number', max: 100, min: 0, message: '请输入正确的代金券返还比例,0 ~ 100', trigger: ['blur', 'change'] }
+                  ]" label="代金券返还比例" prop="voucherReturn"
+                >
+                  <el-input v-model.number="formData.voucherReturn" style="width: 200px;" placeholder="请填写代金券返还比例,范围0 ~ 100">
+                    <template #append>%</template>
+                  </el-input>
+                </el-form-item>
+                <el-form-item label="代金券提现比例" prop="voucherCoinRatio">
+                  <el-input-number v-model="formData.voucherCoinRatio" :precision="2" :step="0.01" :max="1"></el-input-number>
+                  <span style="margin-left: 10px;">比例*100</span>
+                </el-form-item>
                 <el-form-item label="是否支持消费金" prop="isBeeCoin">
                   <el-radio-group v-model="formData.isBeeCoin">
                     <el-radio :label="1">支持</el-radio>
@@ -108,26 +132,6 @@
                   >
                   </el-time-select>
                 </el-form-item>
-                <el-form-item label="是否支持代金券" prop="isVoucher">
-                  <el-radio-group v-model="formData.isVoucher">
-                    <el-radio :label="1">
-                      允许
-                    </el-radio>
-                    <el-radio :label="2">
-                      拒绝
-                    </el-radio>
-                  </el-radio-group>
-                </el-form-item>
-                <el-form-item
-                  v-if="formData.isVoucher === 1" :rules="[
-                    { required: true, message: '请输入代金券返还比例', trigger: 'blur' },
-                    { type: 'number', max: 100, min: 0, message: '请输入正确的代金券返还比例,0 ~ 100', trigger: ['blur', 'change'] }
-                  ]" label="代金券返还比例" prop="voucherReturn"
-                >
-                  <el-input v-model.number="formData.voucherReturn" placeholder="请填写代金券返还比例,范围0 ~ 100">
-                    <template #append>%</template>
-                  </el-input>
-                </el-form-item>
                 <el-form-item label="惠市宝商家编号">
                   <el-input v-model="formData.hsbMrchId" maxlength="60" />
                 </el-form-item>
@@ -174,10 +178,10 @@
                     :action="uploadUrl"
                     :on-success="(r) => formData.advertisement.push({ url: r.url, uid: r.url + Math.random() + Date.now() })"
                     :on-remove="(e) => formData.advertisement.filter((item) => item.uid !== e.uid)"
-                  >
+                    >
                     <i class="el-icon-plus avatar-uploader-icon" />
-                  </el-upload> -->
-                  
+                    </el-upload> -->
+
                   <el-upload
                     class="avatar-uploader" list-type="picture-card" :file-list="uploadList"
                     :action="uploadUrl"
@@ -242,6 +246,7 @@ export default {
       formData: {
         shopId: '',
         shopName: '', // 店铺名称
+        voucherCoinRatio: '', // 代金券提现比例
         isBeeCoin: '', // 是否支持消费金
         beeCoinRatio: '', // 商家消费金提现比例
         chargePersonName: '', // 店铺负责人
@@ -329,7 +334,7 @@ export default {
       },
       uploadUrl,
       categoryList: [],
-      uploadList:[]
+      uploadList: []
     }
   },
   watch: {
@@ -390,20 +395,18 @@ export default {
         const res = await businessListGetById({ shopId: id })
         this.formData = Object.assign(this.$options.data().formData, res.data, {
           shopId: res.data.shopId || '',
-          voucherReturn:Number(res.data.voucherReturn)
+          voucherReturn: Number(res.data.voucherReturn)
           // advertisement: res.data.advertisement ? res.data.advertisement.split(',').map((item) => ({ url: item, uid: item + Math.random() + new Date() })) : []
           // advertisement
         })
-        let arr = this.formData.advertisement.split(",");
-        if(arr[0] == ""){
+        const arr = this.formData.advertisement.split(',')
+        if (arr[0] == '') {
           this.uploadList = []
-        }else{
-          this.uploadList = arr.map(item=>{
-          return {
+        } else {
+          this.uploadList = arr.map((item) => ({
             url: item,
             uid: item + Math.random() + new Date()
-          }
-        })
+          }))
         }
         const categoryItem = XeUtils.findTree(this.categoryList, (item) => item.id === String(res.data.classificationId))
         if (categoryItem && Array.isArray(categoryItem.nodes)) {
@@ -428,12 +431,12 @@ export default {
               // advertisement: Array.isArray(advertisement) ? advertisement.map((v) => v.url || v).join(',') : '',
               classificationId: Array.isArray(classificationArr) && classificationArr.length ? classificationArr[classificationArr.length - 1] : ''
             }
-            params.advertisement = this.uploadList.reduce((prev,item,index)=>{
-              prev += item.url + ","
+            params.advertisement = this.uploadList.reduce((prev, item, index) => {
+              prev += item.url + ','
               return prev
-            },"")
+            }, '')
             //  删除最后一个字符
-            params.advertisement = params.advertisement.substring(0,params.advertisement.length - 1)
+            params.advertisement = params.advertisement.substring(0, params.advertisement.length - 1)
             this.formData.shopId ? await businessListUpdate(params) : await businessListSave(params)
             loading.close()
             this.$message({ message: `${this.formData.shopId ? '编辑' : '添加'}成功!`, type: 'success' })
@@ -450,12 +453,12 @@ export default {
         }
       })
     },
-    uploadSuccess(r){
-      console.log(r);
-      this.uploadList.push({url:r.data.url,uid: r.url + Math.random() + Date.now()})
+    uploadSuccess(r) {
+      console.log(r)
+      this.uploadList.push({ url: r.data.url, uid: r.url + Math.random() + Date.now() })
     },
-    removeSuccess(r){
-      this.uploadList = this.uploadList.filter(item => item.uid !== r.uid)
+    removeSuccess(r) {
+      this.uploadList = this.uploadList.filter((item) => item.uid !== r.uid)
     }
   }
 }

+ 5 - 5
src/views/business/businessList/index.vue

@@ -44,11 +44,11 @@
         v-loading="listLoading" height="100%" element-loading-text="正在查询中。。。" :data="list"
         v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
       >
-        <el-table-column label="店铺名称" width="220">
+        <el-table-column width="220" label="店铺名称">
           <template slot-scope="scope">{{ scope.row.shopName }}</template>
         </el-table-column>
-        <el-table-column prop="shopCode" label="店铺编码" />
-        <el-table-column label="是否支持消费金">
+        <el-table-column width="120" prop="shopCode" label="店铺编码" />
+        <el-table-column width="120" label="是否支持消费金">
           <template slot-scope="scope">
             <span v-if="scope.row.isBeeCoin === 1">支持</span>
             <span v-else-if="scope.row.isBeeCoin === 2">不支持</span>
@@ -62,14 +62,14 @@
           </template>
           </el-table-column> -->
         <el-table-column prop="chargePersonName" label="负责人" />
-        <el-table-column prop="chargePersonPhone" label="联系电话" />
+        <el-table-column width="120" prop="chargePersonPhone" label="联系电话" />
         <el-table-column label="合同状态">
           <template slot-scope="scope">
             <span v-if="scope.row.contractState === 0">无效</span>
             <span v-if="scope.row.contractState === 1">有效</span>
           </template>
         </el-table-column>
-        <el-table-column prop="createTime" label="创建时间" />
+        <el-table-column width="150" prop="createTime" label="创建时间" />
         <el-table-column align="center" label="操作" width="280" fixed="right" class-name="small-padding fixed-width">
           <template slot-scope="{ row }">
             <el-button type="warning" size="mini" @click="handleDetail(row)">

+ 1 - 1
src/views/order/pending/pendDetails.vue → src/views/order/pending/components/pendDetails.vue

@@ -284,7 +284,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-@import url("../../../styles/elDialog.scss");
+@import url("../../../../styles/elDialog.scss");
 
 ul {
 	list-style: none;

+ 1 - 1
src/views/order/pending/index.vue

@@ -168,7 +168,7 @@
 </template>
 
 <script>
-import OrderDetail from '@/views/order/pending/pendDetails.vue'
+import OrderDetail from './components/pendDetails'
 import { orderGetAll, orderExport } from '@/api/order'
 export default {
   name: 'Pending',