Browse Source

订单列表及详情日期更改

ltx529596 4 years ago
parent
commit
0585d73069
3 changed files with 97 additions and 65 deletions
  1. 3 3
      src/pages/order/order.vue
  2. 1 2
      src/pages/order/orderdetail.vue
  3. 93 60
      src/pages/shop/shopdetail.vue

+ 3 - 3
src/pages/order/order.vue

@@ -110,7 +110,7 @@
             >状态:<text class="message">{{ item.statusName }}</text></view
           >
           <view class="playtime"
-            >游玩时间:<text class="message">{{ item.palyTime }}</text></view
+            >游玩时间:<text class="message">{{ item.palyTime.substring(0,11) }} {{ item.timePart ?item.timePart : ''}}</text></view
           >
         </view>
       </view>
@@ -140,7 +140,7 @@
             >状态:<text class="message">{{ item.statusName }}</text></view
           >
           <view class="playtime"
-            >游玩时间:<text class="message">{{ item.palyTime }}</text></view
+            >游玩时间:<text class="message">{{ item.palyTime.substring(0,11) }} {{ item.timePart ?item.timePart : ''}}</text></view
           >
         </view>
       </view>
@@ -170,7 +170,7 @@
             >状态:<text class="message">{{ item.statusName }}</text></view
           >
           <view class="playtime"
-            >游玩时间:<text class="message">{{ item.palyTime }}</text></view
+            >游玩时间:<text class="message">{{ item.palyTime.substring(0,11) }} {{ item.timePart ?item.timePart : ''}}</text></view
           >
         </view>
       </view>

+ 1 - 2
src/pages/order/orderdetail.vue

@@ -11,10 +11,9 @@
 				<view class="waternum titlebar" v-if="orderMessage.outOrderNo">流水号:<text class="txt">{{orderMessage.outOrderNo}}</text></view>
 				<view class="ordernum titlebar">订单号:<text class="txt">{{orderMessage.ordersNo}}</text></view>
 				<view class="phonenum titlebar">手机号:<text class="txt">{{orderMessage.buyPhone}}</text></view>
-				<!-- <view class="goindate titlebar">入园日期:<text class="txt">{{orderMessage.timePart ? orderMessage.timePart : orderMessage.palyTime}}</text></view> -->
 				<view class="price titlebar">产品价格:<text class="txt">{{orderMessage.price | doMoney}}</text></view>
 				<view class="buynum titlebar">购买数量:<text class="txt">{{orderMessage.playManList.length}}</text></view>
-				<view class="palytime titlebar">游玩时间:<text class="txt">{{orderMessage.timePart ? orderMessage.timePart : orderMessage.palyTime}}</text></view>
+				<view class="palytime titlebar">游玩时间:<text class="txt">{{ orderMessage.palyTime ? orderMessage.palyTime : '' }} {{ orderMessage.timePart ?orderMessage.timePart : ''}}</text></view>
 				<view class="orderstatus titlebar">订单状态:<text class="txt">{{orderMessage.statusName}}</text> </view>
 				<view class="tourist">
 					<view class="title">游客信息</view>

+ 93 - 60
src/pages/shop/shopdetail.vue

@@ -147,7 +147,7 @@
           <view class="name">卖价:</view>
           <input
             class="price"
-            type="text"
+            type="number"
             v-model="price"
             placeholder="请输入卖价"
           />
@@ -157,7 +157,7 @@
           <view class="name">划线价:</view>
           <input
             class="price"
-            type="text"
+            type="number"
             v-model="rateprice"
             placeholder="请输入划线价"
           />
@@ -222,7 +222,7 @@
                         <text class="name">日库存数:</text>
                         <input
                           class="dateInventory"
-                          type="text"
+                          type="number"
                           placeholder="请输入库存数量"
                           v-model="dateInventory"
                         />
@@ -234,7 +234,7 @@
                         <text class="name">总库存数:</text>
                         <input
                           class="dateInventory"
-                          type="text"
+                          type="number"
                           placeholder="请输入库存数量"
                           v-model="sunInventory"
                         />
@@ -256,7 +256,7 @@
                 <input
                   class="bookingnum"
                   v-model="astrictDate.data.bookRule"
-                  type="text"
+                  type="number"
                   placeholder="请输入数量"
                 />
               </view>
@@ -437,8 +437,8 @@ export default {
       ],
       shopNumIndex: 0,
 
-      dateInventory: '',
-      sunInventory: '',
+      dateInventory: 0,
+      sunInventory: 0,
       inventory: '',
 
       bookingnum: '',
@@ -458,14 +458,14 @@ export default {
         data: {
           saleDay: 1, // 限购天数
           saleNum: 1, // 限购票数
-          dateSetting: '', // 有效期模式
-          goodsStockFlag: '', // 库存模式
+          dateSetting: '0', // 有效期模式
+          goodsStockFlag: '0', // 库存模式
           bookRule: '', // 同一天限购
-          usubscribeRule: '', // 可退规则
+          usubscribeRule: '0', // 可退规则
           isRealName: '', // 开启实名制
           isShowQrcode: '', // 显示二维码
         },
-      }
+      },
     };
   },
   onUnload() {
@@ -514,11 +514,10 @@ export default {
       }
 
       if (e.detail.value === '1') {
-        this.inventory = this.dateInventory * 100;
-      } else if (e.detail.value === '2') {
-        this.inventory = this.sunInventory * 100;
-      } else if (e.detail.value == '0') {
-        this.inventory = '';
+        this.sunInventory = 0
+      }
+      if (e.detail.value === '2') {
+        this.dateInventory = 0
       }
       this.astrictDate.data.goodsStockFlag = e.detail.value;
     },
@@ -556,59 +555,61 @@ export default {
         .get('/goods/getById/' + this.SHOPID)
         .then(async (res) => {
           if (res.code === 200 && res.msg === 'OK') {
-            console.log(res);
             this.shopData = res.data;
 
             this.getShopList();
 
-            console.log(this.shopData);
             setTimeout(() => {
               // 判断返回的是否是自营商品
               this.typeProperty = this.shopData.saleRule;
-              console.log(this.typeProperty);
-              this.price = this.shopData.salePrice ;
-              this.rateprice = this.shopData.price ;
+              this.price = this.shopData.salePrice;
+              this.rateprice = this.shopData.price;
 
               if (this.shopData.expiredTime) {
-                this.expirationDate = this.shopData.expiredTime.slice(0, 10) ?  this.shopData.expiredTime.slice(0, 10) : '请选择过期日期';
+                this.expirationDate = this.shopData.expiredTime.slice(0, 10)
+                  ? this.shopData.expiredTime.slice(0, 10)
+                  : '请选择过期日期';
               }
 
               let rule = JSON.parse(this.shopData.saleRuleJson);
 
               if (rule) {
-                this.astrictDate.data.saleDay = rule.data.saleDay ? rule.data.saleDay : 0;
-                this.astrictDate.data.saleNum = rule.data.saleNum ? rule.data.saleNum : 0;
+                this.astrictDate.data.saleDay = rule.data.saleDay
+                  ? rule.data.saleDay
+                  : 0;
+                this.astrictDate.data.saleNum = rule.data.saleNum
+                  ? rule.data.saleNum
+                  : 0;
                 // 有效期模式
-                this.astrictDate.dateSetting = rule.data.dateSetting
-                this.patterIndex = +rule.data.dateSetting
+                this.astrictDate.dateSetting = rule.data.dateSetting;
+                this.patterIndex = +rule.data.dateSetting;
                 // 库存模式
-                this.astrictDate.goodsStockFlag = rule.data.goodsStockFlag
-                this.shopNumIndex = +rule.data.goodsStockFlag
+                this.astrictDate.goodsStockFlag = rule.data.goodsStockFlag;
+                this.shopNumIndex = +rule.data.goodsStockFlag;
                 if (this.shopNumIndex === 1) {
-                  this.dateInventory = this.shopData.inventory
+                  this.dateInventory = this.shopData.inventory;
                 } else if (this.shopNumIndex === 2) {
-                  this.sunInventory = this.shopData.inventory
+                  this.sunInventory = this.shopData.inventory;
                 }
                 // 预订数量
-                this.astrictDate.data.bookRule = rule.data.bookRule
+                this.astrictDate.data.bookRule = rule.data.bookRule;
                 // 实名制
                 if (rule.data.isRealName === '0') {
-                  this.trueNme = true
+                  this.trueNme = true;
                 } else {
-                  this.trueNme = false
+                  this.trueNme = false;
                 }
-                this.astrictDate.data.isRealName = rule.data.isRealName
+                this.astrictDate.data.isRealName = rule.data.isRealName;
                 // 可退规则
-                this.bookingIndex = +rule.data.usubscribeRule
-                this.astrictDate.usubscribeRule = rule.data.usubscribeRule
+                this.bookingIndex = +rule.data.usubscribeRule;
+                this.astrictDate.usubscribeRule = rule.data.usubscribeRule;
                 // 二维码
                 if (rule.data.isShowQrcode === '0') {
-                  this.codeShow = true
+                  this.codeShow = true;
                 } else {
-                  this.codeShow = false
+                  this.codeShow = false;
                 }
-                this.astrictDate.data.isShowQrcode = rule.data.isShowQrcode
-
+                this.astrictDate.data.isShowQrcode = rule.data.isShowQrcode;
               }
               // 限制购票回显
               if (this.shopData.saleRule === '1') {
@@ -704,7 +705,7 @@ export default {
             this.storeDisable = false;
             // 所属店铺回显
             if (this.shopData.shopId) {
-              this.storeDisable = true
+              this.storeDisable = true;
               this.storeList.forEach((item, index) => {
                 if (this.shopData.shopId === item.id) {
                   this.storeIndex = index;
@@ -904,7 +905,6 @@ export default {
     // 内容提交
     submitMesage() {
       let _this = this;
-      this.loading = true;
       // 判断是否限制账号购买
       if (this.showoperat) {
         this.showoperat = '1';
@@ -921,31 +921,63 @@ export default {
         name = this.shopList[this.shopIndex].id;
       }
       if (!this.storeId) {
-        this.$mHelper.toast('请选择所属商铺');
-        this.loading = false;
+        this.$mHelper.toast('请选择所属商铺!');
         return;
       }
       if (!this.typeId) {
-        this.$mHelper.toast('请选择商品类型');
-        this.loading = false;
+        this.$mHelper.toast('请选择商品类型!');
         return;
       }
 
       if (!name) {
-        this.$mHelper.toast('请选择商品名称或者输入商品名称');
-        this.loading = false;
+        this.$mHelper.toast('请选择商品名称或者输入商品名称!');
         return;
       }
-      
-      // if (this.typeProperty === '1') {  // 分销
-      //   this.astrictDate.data.dateSetting = ''
-      //   this.astrictDate.data.goodsStockFlag = ''
-      //   this.astrictDate.data.bookRule = ''
-      //   this.astrictDate.data.usubscribeRule = ''
-      //   this.astrictDate.data.isRealName = ''
-      //   this.astrictDate.data.isShowQrcode = ''
-      // }
 
+      if (this.typeProperty === '0') {
+        if (!this.lineId) {
+          this.$mHelper.toast('请选择商品分类!');
+          return;
+        }
+        if (!this.price) {
+          this.$mHelper.toast('请输入商品卖价!');
+          return;
+        }
+        if (!this.rateprice) {
+          this.$mHelper.toast('请输入商品划线价!');
+          return;
+        }
+        if (!this.expirationDate) {
+          this.$mHelper.toast('请选择商品过期日期')
+          return
+        }
+      
+       console.log(this.shopNumIndex);
+        if (this.shopIndex === 0) {
+         this.inventory = ''
+        }
+        if (this.shopNumIndex === 1) {
+          this.inventory = this.dateInventory 
+          if (!this.inventory) {
+            this.$mHelper.toast('请输入日库存数量!')
+            return
+          }
+        } 
+         if (this.shopNumIndex === 2) {
+          this.inventory = this.sunInventory 
+          if (!this.inventory) {
+            this.$mHelper.toast('请输入总库存数量!')
+            return
+          }
+        }
+       
+        if (!this.astrictDate.data.bookRule) {
+          this.$mHelper.toast('请输入预订数量!');
+          return;
+        }
+       
+      }
+      this.loading = true;
       this.$http
         .post('/goods/add', {
           id: this.shopData.id || '',
@@ -961,9 +993,10 @@ export default {
           saleRuleJson: JSON.stringify(this.astrictDate),
           //  自营
           name: name,
-          salePrice: this.price || '',
-          price: this.rateprice || '',
-          expiredTime: this.expirationDate === '商品过期日期' ? '' : this.expirationDate,
+          salePrice: this.price*100 || '',
+          price: this.rateprice*100  || '',
+          expiredTime:
+            this.expirationDate === '商品过期日期' ? '' : this.expirationDate,
           inventory: this.inventory,
         })
         .then((res) => {