Quellcode durchsuchen

订单期数可选

kevin vor 1 Jahr
Ursprung
Commit
85d198025a

+ 9 - 0
src/api/bonus.js

@@ -53,3 +53,12 @@ export function fetchTeamInquiry() {
     params: {}
   })
 }
+
+// 期数查询
+export function fetchPeriod() {
+  return request({
+    url: '/v1/bonus/period',
+    method: 'get',
+    params: {}
+  })
+}

+ 16 - 1
src/views/shop/reconsume.vue

@@ -109,6 +109,11 @@
                 <el-col :xs="24" :sm="24" :lg="24">
                   <span style="font-weight: bold; word-break: normal; white-space: normal; line-height: 28px;">{{ $t('shop.customerInfo') }}:</span>
                 </el-col>
+                <el-form-item :label="$t('atlas.periodNumber')">
+                  <el-select v-model="period" :placeholder="$t('atlas.periodNumber')" style="width: 100%;">
+                    <el-option v-for="item in periodList" :key="item" :label="item" :value="item" />
+                  </el-select>
+                </el-form-item>
                 <el-form-item>
                   <el-col :xs="24" :sm="24" :lg="15">
                     <span>{{ $t('shop.reconsumeUserCode') }}</span>
@@ -268,6 +273,7 @@ import { getScreenWidth } from '@/utils'
 import tool from '@/utils/tool'
 import usersInfo from '@/utils/usersInfo'
 import paystack from 'vue-paystack'
+import { fetchPeriod } from '@/api/bonus'
 
 export default {
   name: 'StandardProducts',
@@ -314,6 +320,8 @@ export default {
       visibleShoppingCart: false,
       loading: false,
 
+      periodList: [],
+      period: '',
       goods: [],
       payList: [],
       cashCurrency: '',
@@ -411,6 +419,7 @@ export default {
   },
   created() {
     this.getList()
+    this.getPeriod()
   },
   mounted() {
     // 支付方式、账户信息、余额
@@ -462,6 +471,11 @@ export default {
         })
       }
     },
+    getPeriod() {
+      fetchPeriod(this.listQuery).then(response => {
+        this.periodList = response.data
+      })
+    },
     // 选择商品计数
     handleInputNumber(current, row) {
       const pageList = this.multipleSelection[this.listQuery.page]
@@ -651,7 +665,8 @@ export default {
           province: this.newOrder.areaSelected,
           lgaName: this.newOrder.lgaName,
           cityName: this.newOrder.cityName,
-          detailaddress: this.newOrder.address
+          detailaddress: this.newOrder.address,
+          period: this.period
         }
         if (this.payType === 'pay_stack') {
           // PayStack支付

+ 40 - 19
src/views/shop/standard-products.vue

@@ -106,8 +106,13 @@
               <el-form-item :label="$t('shop.declarationCenterNumber')">
                 <el-input v-model="recUserName" :disabled="isDec == '1'" />
               </el-form-item>
+              <el-form-item :label="$t('atlas.periodNumber')">
+                <el-select v-model="period" :placeholder="$t('atlas.periodNumber')" style="width: 100%;">
+                  <el-option v-for="item in periodList" :key="item" :label="item" :value="item" />
+                </el-select>
+              </el-form-item>
             </el-form>
-            
+
             <!-- 支付方式/账户余额 {{ cashCurrency }}:  -->
             <div class="" style="margin: 15px 0;">
               <el-row :gutter="20" type="flex" style="flex-wrap: wrap;">
@@ -228,7 +233,15 @@
 </template>
 
 <script>
-import { createApproachOrder, createOrder, deleteApproachOrder, fetchProductList, fetchShoppingCart } from '@/api/shop'
+import {
+  createApproachOrder,
+  createOrder,
+  deleteApproachOrder,
+  fetchProductList,
+  fetchReconsumeProductList,
+  fetchShoppingCart
+} from '@/api/shop'
+import { fetchPeriod } from '@/api/bonus'
 import Pagination from '@/components/Pagination'
 import waves from '@/directive/waves'
 import { getScreenWidth } from '@/utils'
@@ -276,7 +289,7 @@ export default {
       display: false,
       currentPage: 1,
       shoppingCartGoods: [],
-
+      periodList: [],
       shoppingCartLoading: false,
       visibleShoppingCart: false,
       loading: false,
@@ -327,8 +340,8 @@ export default {
               value: 'userOrder'
             }
           ]
-        },
-        
+        }
+
       },
       payStackScreenWidth: getScreenWidth() > 500 ? '450px' : getScreenWidth() + 'px',
 
@@ -352,10 +365,11 @@ export default {
         taxAmount: 0
       },
       imageStyle: 'margin-top: -50px;',
-      recRealName:null,
+      recRealName: null,
       // recUserName:usersInfo.userName(),
-      recUserName:null,
-      isDec:null
+      recUserName: null,
+      isDec: null,
+      period: ''
     }
   },
   computed: {
@@ -369,17 +383,18 @@ export default {
       return text
     }
   },
-     watch: {
-     isDec: {
-       handler(newValue, old) {
-         if (newValue == '1') {
-            this.recUserName = usersInfo.userName();
-         }
-       },
-     }
-   },
+  watch: {
+    isDec: {
+      handler(newValue, old) {
+        if (newValue == '1') {
+          this.recUserName = usersInfo.userName()
+        }
+      }
+    }
+  },
   created() {
     this.getList()
+    this.getPeriod()
   },
   mounted() {
     // 支付方式、账户信息、余额
@@ -454,6 +469,11 @@ export default {
         this.display = true
       }
     },
+    getPeriod() {
+      fetchPeriod(this.listQuery).then(response => {
+        this.periodList = response.data
+      })
+    },
     // 选择商品
     handleSelectionChange(val) {
       let idx = -1; let num
@@ -542,7 +562,7 @@ export default {
         this.freeShipping = response.data.freeShipping
         // 运费
         this.freight = response.data.freight
-        //是否是报单中心
+        // 是否是报单中心
         this.isDec = response.data.isDec
       })
     },
@@ -596,7 +616,8 @@ export default {
           addressId: this.addressId,
           address: this.address,
           payType: this.payType,
-          userName:this.recUserName
+          userName: this.recUserName,
+          period: this.period
         }
         if (this.payType === 'pay_stack') {
           // PayStack支付

+ 16 - 2
src/views/user/member-upgrade.vue

@@ -25,6 +25,11 @@
                 <el-option v-for="item in upgradeOption" :key="item.ID" :label="item.LEVEL_NAME" :value="{value:item.ID, diffPv:item.REPAIR_PV}" />
               </el-select>
             </el-form-item>
+            <el-form-item v-if="!isMax" :label="$t('atlas.periodNumber')">
+              <el-select v-model="period" :placeholder="$t('atlas.periodNumber')" style="width: 100%;">
+                <el-option v-for="item in periodList" :key="item" :label="item" :value="item" />
+              </el-select>
+            </el-form-item>
             <el-form-item v-if="!isMax" :label="$t('profile.topUpBV')">
               <el-input v-model="needDiffPv" disabled />
             </el-form-item>
@@ -182,6 +187,7 @@ import { getScreenWidth } from '@/utils'
 import tool from '@/utils/tool'
 import usersInfo from '@/utils/usersInfo'
 import paystack from 'vue-paystack'
+import { fetchPeriod } from '@/api/bonus'
 
 export default {
   name: 'UpgradeManagement',
@@ -320,7 +326,9 @@ export default {
         cash: 0
       },
 
-      activeName: 'product'
+      activeName: 'product',
+      periodList: [],
+      period: ''
     }
   },
   computed: {
@@ -406,6 +414,11 @@ export default {
         }, 0.5 * 1000)
       })
     },
+    getPeriod() {
+      fetchPeriod(this.listQuery).then(response => {
+        this.periodList = response.data
+      })
+    },
     // 商品详情
     handleProduct(row) {
       this.product = row
@@ -599,7 +612,8 @@ export default {
         cityName: this.form.cityName,
         nowPerf: this.nowPerf,
         nextPerf: this.nextPerf,
-        payType: this.form.payType
+        payType: this.form.payType,
+        period: this.period
       }
       fetchSendUpgrade(params).then(response => {
         if (this.form.payType !== 'pay_stack') {

+ 28 - 15
src/views/user/welcome-pack.vue

@@ -22,7 +22,12 @@
               </el-select>
             </el-form-item>
             <el-form-item :label="$t('user.stockistCode')">
-              <el-input v-model="form.decUserName"  :disabled="isDec == 1"/>
+              <el-input v-model="form.decUserName" :disabled="isDec == 1" />
+            </el-form-item>
+            <el-form-item :label="$t('atlas.periodNumber')">
+              <el-select v-model="period" :placeholder="$t('atlas.periodNumber')" style="width: 100%;">
+                <el-option v-for="item in periodList" :key="item" :label="item" :value="item" />
+              </el-select>
             </el-form-item>
 
             <el-form-item>
@@ -105,7 +110,6 @@
             <el-form-item :label="$t('shop.memberName')">
               <el-input v-model="form.realName" />
             </el-form-item>
-         
 
             <el-form-item :label="$t('shop.phoneNumber')">
               <el-input v-model="form.mobile" />
@@ -247,6 +251,7 @@ import { getScreenWidth } from '@/utils'
 import tool from '@/utils/tool'
 import usersInfo from '@/utils/usersInfo'
 import paystack from 'vue-paystack'
+import { fetchPeriod } from '@/api/bonus'
 
 export default {
   name: 'WelcomePack',
@@ -315,7 +320,8 @@ export default {
       userBalance: {
         cash: 0
       },
-
+      periodList: [],
+      period: '',
       payType: 'cash',
       payStackLoading: false,
       channels: ['card', 'bank', 'ussd', 'qr'],
@@ -409,7 +415,7 @@ export default {
       allOpenBank: [],
 
       activeName: 'product',
-      isDec:null
+      isDec: null
     }
   },
   computed: {
@@ -423,19 +429,20 @@ export default {
       return text
     }
   },
-     watch: {
-     isDec: {
+  watch: {
+    isDec: {
       handler(newValue, old) {
-         if (newValue == '1') {
-            this.form.decUserName = usersInfo.userName();
-         }
-       },
-     }
-   },
+        if (newValue == '1') {
+          this.form.decUserName = usersInfo.userName()
+        }
+      }
+    }
+  },
   created() {
     const regionInfo = this.$store.getters.regionInfo
     // console.log(this.$store.state.region)
     this.fetchWelcomePack()
+    this.getPeriod()
   },
   methods: {
     // 会员报单/BA升级
@@ -448,8 +455,8 @@ export default {
         this.allGoods = response.data.allGoods
         this.userBalance = response.data.userBalance
         this.categoryType = 1
-          //是否是报单中心
-          this.isDec = response.data.isDec
+        // 是否是报单中心
+        this.isDec = response.data.isDec
         const settingObj = this.allGoods
         for (const i in this.allGoods) {
           this.storeNums[i] = 1
@@ -486,6 +493,11 @@ export default {
       this.product.taxAmount = tool.calculateTax(row.SELL_PRICE, row.TAX_RATE)
       this.visibleProduct = true
     },
+    getPeriod() {
+      fetchPeriod(this.listQuery).then(response => {
+        this.periodList = response.data
+      })
+    },
     // 选择商品计数
     handleInputNumber(current, row) {
       const pageList = this.multipleSelection
@@ -682,7 +694,8 @@ export default {
         goodsNum: this.form.goodsNum,
         location: this.form.location,
         decWay: this.decWay,
-        payType: this.form.payType
+        payType: this.form.payType,
+        period: this.period
       }
       createWelcomePack(params).then(response => {
         if (this.form.payType !== 'pay_stack') {