Browse Source

no message

aXin-0810 9 months ago
parent
commit
7f257f6efc

+ 9 - 3
src/packageMaterial/pages/apply/order.vue

@@ -154,9 +154,15 @@ export default {
         websitName: this.websitName,
         websitBuyGoods: this.goodsList,
       }).then(res => {
-        this.$navToPage({
-          url: `/packageMaterial/pages/apply/pay?orderId=${res.data}&websitId=${this.websitId}&goodsType=${this.type}`
-        })
+        this.$navToPage(
+            {
+              url: `/packageMaterial/pages/stock/buyRecord`
+            },
+            'reLaunch'
+          )
+        // this.$navToPage({
+        //   url: `/packageMaterial/pages/apply/pay?orderId=${res.data}&websitId=${this.websitId}&goodsType=${this.type}`
+        // })
       })
     },
   },

+ 11 - 11
src/packageMaterial/pages/apply/pay.vue

@@ -162,14 +162,14 @@ export default {
                 openId: this.$store.state.user.miniOpenId
               })
               .then(res => {
-                uniWebview.navigateTo({
-                  url: `/pages/pay/otherPay?${Object.entries({
-                    appOrderId: res.data.id,
-                    appid: res.data.appid
-                  })
-                    .map(item => item.join('='))
-                    .join('&')}`
-                })
+                // uniWebview.navigateTo({
+                //   url: `/pages/pay/otherPay?${Object.entries({
+                //     appOrderId: res.data.id,
+                //     appid: res.data.appid
+                //   })
+                //     .map(item => item.join('='))
+                //     .join('&')}`
+                // })
               })
           } else {
             this.$api
@@ -181,9 +181,9 @@ export default {
               })
               .then(res => {
                 // 公众号支付
-                weixinPay(JSON.parse(res?.data?.codeUrl || {}), function (res) {
-                  that.paySuccess()
-                })
+                // weixinPay(JSON.parse(res?.data?.codeUrl || {}), function (res) {
+                //   that.paySuccess()
+                // })
               })
           }
         })

+ 152 - 148
src/packageMaterial/pages/stock/buyRecord.vue

@@ -4,23 +4,25 @@
     :isScroll="true"
     :refresherTriggered="refresherTriggered"
     @refresherrefresh="refresherrefresh"
-    @scrolltolower="scrolltolower">
+    @scrolltolower="scrolltolower"
+  >
     <template slot="header">
       <view class="tab-container">
-      	<u-tabs
-      		:scrollable="false"
-      		:list="tabList"
-      		:current="tabCurrent"
-      		@click="changeTab"
-      		lineColor="#3D8FFD"
-      		:activeStyle="{
-      			color: '#3D8FFD'
-      		}"
-      		:inactiveStyle="{
-      			color: '#666666'
-      		}"
-      		itemStyle="padding-left: 0; padding-right: 0; height: 88rpx;">
-      	</u-tabs>
+        <u-tabs
+          :scrollable="false"
+          :list="tabList"
+          :current="tabCurrent"
+          @click="changeTab"
+          lineColor="#3D8FFD"
+          :activeStyle="{
+            color: '#3D8FFD'
+          }"
+          :inactiveStyle="{
+            color: '#666666'
+          }"
+          itemStyle="padding-left: 0; padding-right: 0; height: 88rpx;"
+        >
+        </u-tabs>
       </view>
     </template>
 
@@ -28,185 +30,187 @@
       <view class="item" v-for="(item, index) in dataList" :key="index" @tap="toDetail(item)">
         <view class="row top">
           <view class="label">制单时间</view>
-          <view class="value">{{item.createTime}}</view>
-          <view class="status">{{item.flag | statusFilter}}</view>
+          <view class="value">{{ item.createTime }}</view>
+          <view class="status">{{ item.flag | statusFilter }}</view>
         </view>
         <view class="row">
           <view class="label">申请单号</view>
-          <view class="value">{{item.salesId}}</view>
-          <view class="tag">{{item.goodsType == 'M' ? '辅材' : '配件'}}</view>
+          <view class="value">{{ item.salesId }}</view>
+          <view class="tag">{{ item.goodsType == 'M' ? '辅材' : '配件' }}</view>
         </view>
         <view class="row">
           <view class="label">购买网点</view>
-          <view class="value">{{item.websitName}}</view>
+          <view class="value">{{ item.websitName }}</view>
         </view>
         <view class="row">
           <view class="label">申领人员</view>
-          <view class="value">{{item.workerName}}</view>
+          <view class="value">{{ item.workerName }}</view>
         </view>
         <view class="row">
           <view class="label">订单金额</view>
-          <view class="value price">{{item.totalAmount | priceFilter}}元</view>
+          <view class="value price">{{ item.totalAmount | priceFilter }}元</view>
         </view>
         <view class="btns" @tap.stop v-if="item.flag == 'SUBMIT'">
           <u-button text="取消订单" @click="cancelOrder(item)"></u-button>
-          <u-button type="primary" text="立即支付" @click="toPay(item)"></u-button>
+          <!-- <u-button type="primary" text="立即支付" @click="toPay(item)"></u-button> -->
         </view>
       </view>
     </view>
     <Loading :loadStatus="loadStatus" :dataList="dataList" />
-
   </zj-page-layout>
   <!-- #endif -->
 
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref(`/packageMaterial/pages/stock/buyRecord`, pam, crossPagePam)" @message="crossPage.$listener"></web-view>
+  <web-view
+    :src="webViewHref(`/packageMaterial/pages/stock/buyRecord`, pam, crossPagePam)"
+    @message="crossPage.$listener"
+  ></web-view>
   <!-- #endif -->
 </template>
 
 <script>
-  // #ifdef H5
-  export default {
-    filters: {
-      statusFilter(val) {
-        const MAP = {
-          SAVE: '保存',
-          SUBMIT: '待支付',
-          PAY_NOT_TAKE: '未提货',
-          PAY_TAKE: '已完成',
-          CANCEL: '已取消',
-        }
-        return MAP[val];
+// #ifdef H5
+export default {
+  filters: {
+    statusFilter(val) {
+      const MAP = {
+        SAVE: '保存',
+        SUBMIT: '待支付',
+        PAY_NOT_TAKE: '未提货',
+        PAY_TAKE: '已完成',
+        CANCEL: '已取消',
       }
-    },
-
-    data() {
-      return {
-				dataList: [],
-				pageNum: 1,
-				loadStatus: 0,
-        refresherTriggered: false,
-        tabList: [
-          {name: '全部', value: '', badge: {value: 0}},
-          {name: '待支付', value: 'SUBMIT', badge: {value: 0}},
-          {name: '未提货', value: 'PAY_NOT_TAKE', badge: {value: 0}},
-          {name: '完成/退货', value: 'PAY_TAKE', badge: {value: 0}},
-        ],
-        tabCurrent: 0,
-        status: '',
-      }
-    },
-
-    onLoad() {
-      this.getCount();
-      this.getList();
-    },
+      return MAP[val];
+    }
+  },
 
-    methods: {
-      getCount() {
-      	this.$api.post('/material/salses/count')
-        .then(res => {
-          if(!res.data) return false;
-      		this.tabList[1].badge.value = res.data.waitPayCount || 0;
-      		this.tabList[2].badge.value = res.data.endPayCount || 0;
-      		this.tabList[3].badge.value = res.data.endCount || 0;
-      	})
-      },
+  data() {
+    return {
+		dataList: [],
+		pageNum: 1,
+		loadStatus: 0,
+      refresherTriggered: false,
+      tabList: [
+        {name: '全部', value: '', badge: {value: 0}},
+        {name: '待支付', value: 'SUBMIT', badge: {value: 0}},
+        {name: '未提货', value: 'PAY_NOT_TAKE', badge: {value: 0}},
+        {name: '完成/退货', value: 'PAY_TAKE', badge: {value: 0}},
+      ],
+      tabCurrent: 0,
+      status: '',
+    }
+  },
 
-      getList() {
-      	this.loadStatus = 1;
-      	this.$api.post('/material/salses/buy/list', {
-          pageNum: this.pageNum,
-          pageSize: 10,
-          flag: this.status,
-      	}).then(res => {
-      		this.loadStatus = 0;
-      		let list = res.data.records;
-      		if (list.length < 10) {
-      		  this.loadStatus = 2;
-      		}
-      		this.dataList = this.dataList.concat(list);
-      	}).catch(() => {
-      		this.loadStatus = 2;
-      	}).finally(res => {
-      		this.refresherTriggered = false;
-      	})
-      },
+  onLoad() {
+    this.getCount();
+    this.getList();
+  },
 
-      changeTab(e) {
-      	this.tabCurrent = e.index;
-      	this.status = e.value;
-        this.refreshList();
-      },
+  methods: {
+    getCount() {
+    	this.$api.post('/material/salses/count')
+      .then(res => {
+        if(!res.data) return false;
+    		this.tabList[1].badge.value = res.data.waitPayCount || 0;
+    		this.tabList[2].badge.value = res.data.endPayCount || 0;
+    		this.tabList[3].badge.value = res.data.endCount || 0;
+    	})
+    },
 
-      refreshList() {
-      	this.dataList = [];
-      	this.pageNum = 1;
-      	this.getList();
-      },
+    getList() {
+    	this.loadStatus = 1;
+    	this.$api.post('/material/salses/buy/list', {
+        pageNum: this.pageNum,
+        pageSize: 10,
+        flag: this.status,
+    	}).then(res => {
+    		this.loadStatus = 0;
+    		let list = res.data.records;
+    		if (list.length < 10) {
+    		  this.loadStatus = 2;
+    		}
+    		this.dataList = this.dataList.concat(list);
+    	}).catch(() => {
+    		this.loadStatus = 2;
+    	}).finally(res => {
+    		this.refresherTriggered = false;
+    	})
+    },
 
-      // 滚动到底部
-      scrolltolower(e) {
-      	if (this.loadStatus === 0) {
-      		this.pageNum++;
-      		this.getList();
-      	}
-      },
+    changeTab(e) {
+    	this.tabCurrent = e.index;
+    	this.status = e.value;
+      this.refreshList();
+    },
 
-      // 触发下拉刷新
-      refresherrefresh(e) {
-      	this.refresherTriggered = true;
-        this.getCount();
-      	this.refreshList();
-      },
+    refreshList() {
+    	this.dataList = [];
+    	this.pageNum = 1;
+    	this.getList();
+    },
 
-      toDetail(item) {
-        this.$navToPage({
-          url: `/packageMaterial/pages/stock/buyDetail?id=${item.salesId}`
-        })
-      },
+    // 滚动到底部
+    scrolltolower(e) {
+    	if (this.loadStatus === 0) {
+    		this.pageNum++;
+    		this.getList();
+    	}
+    },
 
-      // 取消订单
-      cancelOrder(item) {
-      	this.$modal({
-      	  content: '确认取消订单吗?'
-      	}).then(() => {
-      	  this.$api.post('/material/salses/cancel', {
-      	    salesId: item.salesId
-      	  }).then(res => {
-      	    this.$successToast();
-      	    this.getCount();
-      	    this.refreshList();
-      	  })
-      	}).catch(() => {})
-      },
+    // 触发下拉刷新
+    refresherrefresh(e) {
+    	this.refresherTriggered = true;
+      this.getCount();
+    	this.refreshList();
+    },
 
-      toPay(item) {
-        this.$navToPage({
-          url: `/packageMaterial/pages/apply/pay?orderId=${item.salesId}`
-        })
-      }
+    toDetail(item) {
+      this.$navToPage({
+        url: `/packageMaterial/pages/stock/buyDetail?id=${item.salesId}`
+      })
     },
-  }
 
-  // #endif
-  // #ifndef H5
-  export default {
-    data() {
-      return {
-        pam: {},
-      }
+    // 取消订单
+    cancelOrder(item) {
+    	this.$modal({
+    	  content: '确认取消订单吗?'
+    	}).then(() => {
+    	  this.$api.post('/material/salses/cancel', {
+    	    salesId: item.salesId
+    	  }).then(res => {
+    	    this.$successToast();
+    	    this.getCount();
+    	    this.refreshList();
+    	  })
+    	}).catch(() => {})
     },
-    onLoad(pam) {
-      this.pam = pam;
+
+    toPay(item) {
+      this.$navToPage({
+        url: `/packageMaterial/pages/apply/pay?orderId=${item.salesId}`
+      })
+    }
+  },
+}
+
+// #endif
+// #ifndef H5
+export default {
+  data() {
+    return {
+      pam: {},
     }
+  },
+  onLoad(pam) {
+    this.pam = pam;
   }
-  // #endif
+}
+// #endif
 </script>
 
 <style lang="scss" scoped>
 .tab-container {
-  background: #FFFFFF;
+  background: #ffffff;
 }
 
 .list-container {