shish 3 лет назад
Родитель
Сommit
56912d4da7
1 измененных файлов с 47 добавлено и 11 удалено
  1. 47 11
      hdApp/src/pagesPurchase/purDetails.vue

+ 47 - 11
hdApp/src/pagesPurchase/purDetails.vue

@@ -110,18 +110,24 @@
 
 
       <view v-if="detailInfo.debt == 1 || detailInfo.clearId > 0" class="bills-info_box content-box">
       <view v-if="detailInfo.debt == 1 || detailInfo.clearId > 0" class="bills-info_box content-box">
         <view class="order-info_box" v-if="detailInfo.debt == 1">
         <view class="order-info_box" v-if="detailInfo.debt == 1">
-          <view>赊账状态:</view>
-            <view style="font-weight:bold;color:red;">是</view>
-            <view class="price">
-                <text @click="goToSettle(detailInfo)" style="font-weight:normal;color:#3385FF;">全部赊账</text>
-            </view>
+          <view>本单赊账:</view>
+          <view style="font-weight:bold;color:red;">是</view>
         </view>
         </view>
         <view class="order-info_box" v-else>
         <view class="order-info_box" v-else>
-          <view>赊账状态:</view>
-						<view v-if="detailInfo.clearId > 0">已结清</view>
-            <view class="price" v-if="detailInfo.clearId > 0">
-              <button @click="pageTo({url: '/admin/clear/info',query: {id: detailInfo.clearId}})" class="admin-button-com">查看结账单</button>
-            </view>
+          <view>本单赊账:</view>
+          <view v-if="detailInfo.clearId > 0" style="font-weight:bold;color:#3385FF;">已结清</view>
+          <view class="price" v-if="detailInfo.clearId > 0">
+            <button @click="pageTo({url: '/admin/clear/info',query: {id: detailInfo.clearId}})" class="admin-button-com">查看结账单</button>
+          </view>
+        </view>
+        <view class="order-info_box" style="margin-top:35upx;" v-if="Number(detailInfo.debtAmount)>0">
+          <view>累计赊账:</view>
+          <view>¥{{detailInfo.debtAmount?parseFloat(detailInfo.debtAmount):0}}</view>
+          <view class="price" v-if="loginStyle != 0">
+          <button @click="pageTo({url: '/admin/clear/info',query: {id: detailInfo.clearId}})" class="admin-button-com">
+          去结清赊账
+          </button>
+          </view>
         </view>
         </view>
       </view>
       </view>
 
 
@@ -257,6 +263,7 @@
   </view>
   </view>
 </template>
 </template>
 <script>
 <script>
+import { mapGetters } from "vuex";
 import { purchaseDetail, purchaseDebtPay,purchaseClearCreateOrder } from "@/api/purchase";
 import { purchaseDetail, purchaseDebtPay,purchaseClearCreateOrder } from "@/api/purchase";
 import TuiListCell from "@/components/plugin/list-cell";
 import TuiListCell from "@/components/plugin/list-cell";
 export default {
 export default {
@@ -282,7 +289,9 @@ export default {
       },
       },
       loading: false,
       loading: false,
       id: '',
       id: '',
-      settlePrice:0
+      settlePrice:0,
+      //登录状态 0未登录 1登录仅用到了采购 2登录用到完整功能
+      loginStyle :0
     };
     };
   },
   },
   onShareAppMessage(res) {
   onShareAppMessage(res) {
@@ -298,6 +307,33 @@ export default {
 				uni.stopPullDownRefresh()
 				uni.stopPullDownRefresh()
 			})
 			})
 	},
 	},
+  computed: {
+    ...mapGetters({loginInfo:"getLoginInfo"})
+  },
+	watch: {
+		loginInfo(newVal) {
+      if(!this.$util.isEmpty(newVal.admin) && newVal.admin.currentShopId > 0){
+          if(!this.$util.isEmpty(newVal.onlyCg)){
+            if(Number(newVal.onlyCg) == 1){
+              this.loginStyle  = 1
+            }else{
+              this.loginStyle  = 2
+            }
+          }
+      }
+		}
+	},
+  onShow () {
+    if(!this.$util.isEmpty(this.loginInfo.admin) && this.loginInfo.admin.currentShopId > 0){
+        if(!this.$util.isEmpty(this.loginInfo.onlyCg)){
+          if(Number(this.loginInfo.onlyCg) == 1){
+            this.loginStyle  = 1
+          }else{
+            this.loginStyle  = 2
+          }
+        }
+    }
+  },
   methods: {
   methods: {
 		copyWl(val){
 		copyWl(val){
 			const self = this;
 			const self = this;