shish 5 лет назад
Родитель
Сommit
cc22be18e2

+ 5 - 0
ghsApp/src/admin/home/workbench.vue

@@ -239,6 +239,11 @@ export default {
 					name: "业绩",
 					img: `${this.$constant.imgUrl}/ghs/home/icon_ygyj.png`,
 					url: "/admin/staff/achieve"
+				},
+				{
+					name: "报损单",
+					img: `${this.$constant.imgUrl}/ghs/home/kcyjs.png`,
+					url: "/admin/breakage/list"
 				}
 			],
 			// 总览

+ 9 - 2
ghsApp/src/common/pageSuccess.vue

@@ -1,6 +1,6 @@
 <template>
   <appResult :title="title?title:'成功'">
-    <button class="admin-button-com big" @click="closeLayer">关闭</button>
+    <button class="admin-button-com big" @click="goBackHome">返回首页</button>
   </appResult>
 </template>
 <script>
@@ -23,7 +23,14 @@ export default {
 	},
 		methods: {
     closeLayer() {
-					uni.navigateBack({delta: 3});
+		uni.navigateBack({delta: 3});
+    },
+	goBackHome() {
+      this.$util.pageTo({
+        url: "/admin/home/workbench",
+        type: 4,
+        query: { tabIndex: 0 },
+      });
     },
   },
 };

+ 4 - 13
ghsApp/src/pagesArrears/details.vue

@@ -1,19 +1,11 @@
 <template>
 	<view class="order-page">
 		<view class="top-view">
-			<view class="top-row">
-				<text class="header-item"> 客户</text>
-				<text class="header-item">总欠款 </text>
-			</view>
 			<view class="top-row">
 				<view class="info-item">
+					<text class="name">客户:</text>
 					<image class="logo" :src="customInfo.smallAvatar"/>
-					<text class="name">
-						{{ customInfo.name || "" }}
-					</text>
-				</view>
-				<view class="price-item">
-					{{ customInfo.debtAmount || "0.00" }}
+					<text class="name">{{ customInfo.name || "" }}</text>
 				</view>
 			</view>
 		</view>
@@ -79,7 +71,6 @@
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import DetailsItem from "./detailsItem";
 import { getOrderDebtListApi,clearOrderApi } from "@/api/arrears/index";
-import wexinPay from "@/utils/pay/wxPay";
 import ModalModule from "@/components/plugin/modal";
 
 export default {
@@ -282,8 +273,8 @@ export default {
 				align-items: center;
 				.logo {
 					margin-right: 10upx;
-					width: 50upx;
-					height: 50upx;
+					width: 35upx;
+					height: 35upx;
 					border-radius: 50%;
 				}
 				.name {

+ 8 - 2
ghsApp/src/pagesArrears/detailsItem.vue

@@ -12,8 +12,8 @@
 				<view class="mark">{{ info.addTime }}</view>
 			</view>
 			<view class="item-row">
-				<view class="mark">金额:{{ info.realPrice }}</view>
-				<view class="price">{{ info.realPrice }}</view>
+				<view class="price">金额:{{ info.realPrice }}</view>
+				<view class="price" style="font-weight:normal;color:#3385FF;font-size:30rpx;" @click.stop="goToDetai(info)">查看明细</view>
 			</view>
 		</view>
 	</view>
@@ -38,6 +38,12 @@ export default {
 			if (this.isEdit) {
 				this.$emit("click", this.info);
 			}
+		},
+		goToDetai(item){
+			this.$util.pageTo({
+				url: "/pagesOrder/detail",
+				query: {id:item.id}
+			});
 		}
 	}
 };

+ 76 - 25
ghsApp/src/pagesOrder/detail.vue

@@ -5,13 +5,10 @@
 			<view class="title">
 				客户
 			</view>
-			<view class="address-des_bx content-box"
-			@click='pageTo({url:"/pagesClient/member/detail",query: {id: detailInfo.customId}})'>
+			<view class="address-des_bx content-box" @click='pageTo({url:"/pagesArrears/details",query: {id: detailInfo.customId}})'>
 				<view>
 					<view> {{ detailInfo.customName }} {{ detailInfo.customMobile }} </view>
-					<view class="">
-						{{ detailInfo.customAddress}}
-					</view>
+					<view>{{ detailInfo.customAddress}}</view>
 				</view>
 				<view>
 				<i @click.stop="callUp(detailInfo.customMobile)" class="iconfont icondianhua1"></i>
@@ -23,19 +20,14 @@
 			</view>
 			<view class="bills-info_box content-box">
 				<view class="order-info_box">
-					<view>日期:</view>
+					<view>订单日期:</view>
 					<view>{{ detailInfo.addTime }}</view>
 				</view>
 				<view class="order-info_box">
 					<view>单号编码:</view>
 					<view>{{ detailInfo.orderSn }}</view>
 					<view class="price">
-						<button
-							@click="copy(detailInfo.orderSn)"
-							class="admin-button-com default"
-						>
-							复制
-						</button>
+						<button @click="copy(detailInfo.orderSn)" class="admin-button-com default">复制</button>
 					</view>
 				</view>
 				<view class="order-info_box">
@@ -44,29 +36,23 @@
 				</view>
 				<view class="order-info_box">
 					<view>出货时间:</view>
-					<view v-if="detailInfo.outTime == '0000-00-00 00:00:00'">-</view>
+					<view v-if="detailInfo.outTime == '0000-00-00 00:00:00'">--</view>
 					<view v-else>{{ detailInfo.outTime }}</view>
 				</view>
 				<view class="order-info_box">
 					<view>客户下单:</view>
-					<view v-if="detailInfo.customShopAdminId == 0">-</view>
-					<view v-else>✔</view>
-				</view>
-				<view class="order-info_box">
-					<view>欠款:</view>
-					<view v-if="detailInfo.debt==1">是</view>
+					<view v-if="detailInfo.customShopAdminId == 0">--</view>
 					<view v-else>
-						<view v-if="detailInfo.clearId > 0">已结清 <span style="color:blue;margin-left:10rpx;" @click="pageTo({url: '/admin/clear/customInfo',query: {id: detailInfo.clearId}})">结账单</span></view>
-						<view v-else>-</view>
+						<i class="iconfont icondagou" style="font-size:35rpx;"></i>
 					</view>
 				</view>
 				<view class="order-info_box">
 					<view>支付方式:</view>
-					<view>{{ detailInfo.payWay==0?'微信':detailInfo.payWay==1?'支付宝':detailInfo.payWay==4?'现金':detailInfo.payWay==5?'银行卡':'未知' }}</view>
+					<view>{{ detailInfo.payWay==0?'微信':detailInfo.payWay==1?'支付宝':detailInfo.payWay==4?'现金':detailInfo.payWay==5?'银行卡':'--' }}</view>
 				</view>
 				<view class="order-info_box">
 					<view>配送方式:</view>
-					<view>{{ detailInfo.sendType==1?'待确认':detailInfo.sendType==2?'自取':detailInfo.sendType==3?'本店送':detailInfo.sendType==4?'快递配送':'未知' }}</view>
+					<view>{{ detailInfo.sendType==1?'待确认':detailInfo.sendType==2?'自取':detailInfo.sendType==3?'本店送':detailInfo.sendType==4?'快递配送':'--' }}</view>
 				</view>
 				<view class="order-info_box">
 					<view>订单状态:</view>
@@ -84,8 +70,27 @@
 					<view>退款方式:</view>
 					<view style="color:red;font-weight:bold;font-size:30rpx;">{{detailInfo.tkExplain||''}}</view>
 				</view>
+			</view>
 
+			<view class="bills-info_box content-box" style="margin-top:25rpx;">
+				<view class="order-info_box" v-if="detailInfo.debt == 1">
+				<view>欠款状态:</view>
+					<view>是</view>
+					<view class="price">
+						<text v-if="detailInfo.debtAmount > 0" @click='pageTo({url:"/pagesArrears/details",query: {id: detailInfo.customId}})' style="margin-right:38rpx;color:#3385FF;font-size:26rpx;">全部欠款</text>
+						<button @click="settleOrder(detailInfo)" class="admin-button-com">结清</button>
+					</view>
+				</view>
+				<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/customInfo',query: {id: detailInfo.clearId}})" class="admin-button-com">查看帐单</button>
+					</view>
+					<view v-if="detailInfo.clearId == 0">--</view>          
+				</view>
 			</view>
+
 			<view class="content-box shipping-address" v-if="detailInfo.expressProgress!=''">
 				<view> 配送进展:<text>{{ detailInfo.expressProgress.progressName }}</text> </view>
 				<i class="iconfont iconqishouyinying"></i>
@@ -93,8 +98,8 @@
 			<view class="flex-space title">
 				商品信息
 				<view class="flex" style="color: #3385ff;font-weight: 400" v-if="detailInfo.status == 4">
-						<navigator v-if="detailInfo.refund==2" :url="`/pagesOrder/refundMsg?orderSn=${detailInfo.orderSn}`">有退款</navigator>
-						<navigator v-if="detailInfo.refund==1" :url="`/pagesOrder/refund?id=${option.id}`" style="margin-left: 20rpx;">发起退款</navigator>
+					<navigator v-if="detailInfo.refund==2" :url="`/pagesOrder/refundMsg?orderSn=${detailInfo.orderSn}`">有退款</navigator>
+					<navigator v-if="detailInfo.refund==1" :url="`/pagesOrder/refund?id=${option.id}`" style="margin-left: 20rpx;">发起退款</navigator>
 				</view>
 			</view>
 			<view class="module-com content-box">
@@ -197,6 +202,7 @@ import stepStatus from "./components/stepStatus";
 import TuiListCell from "@/components/plugin/list-cell";
 import { getDetail,debtPay,hasPay, freeShipping,confirmFinish,cancel } from "@/api/order/index";
 import { getOrderProduct } from "@/api/order-item/index";
+import { clearOrderApi } from "@/api/arrears/index";
 import productMins from "@/mixins/product";
 import { ORDER_STATUS } from "@/utils/declare";
 import BLE from "@/mixins/BLE";
@@ -233,6 +239,51 @@ export default {
 		this.init();
 	},
 	methods: {
+		//结帐(单个结帐没有优惠)
+		settleOrder(item) {
+			let id = item.id
+			let customId = item.customId
+			let actPrice = item.actPrice
+			let that = this
+			let payWay = 0
+			uni.showActionSheet({
+				itemList: ['请选择收款方式:', '微信', '支付宝','现金','银行卡'],
+				success: function (respond) {
+					let currentIndex = respond.tapIndex
+					let inWay = [{name:"未选择",id:-1},{name:"微信",id:0},{name:"支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}]
+					if(currentIndex > 0){
+
+						payWay = inWay[currentIndex].id
+						let params = {
+							id:JSON.stringify([{id:id}]),
+							customId:customId,
+							payWay:payWay,
+							modifyPrice:actPrice
+						}
+
+						uni.showModal({
+							title: "提示",
+							content: "确认结清欠款?",
+							confirmText: "确认",
+							success: function (res) {
+								if (res.confirm) {
+									clearOrderApi(params).then(res => {
+										if(res.code == 1) {
+											that.pageTo({url:'/common/pageSuccess?title=操作成功', type: 2});
+										}
+									}).catch(err => {
+										console.log('err', err)
+									})
+								}
+							},
+						});
+
+					}else{
+						this.$msg("请选择收款方式");
+					}
+				}
+			})
+		},
 		navigate(latitude, longitude, address) {   
 			// 将经纬度转换成Number
 			let latituded = Number(latitude);

+ 11 - 14
hdApp/src/pagesPurchase/components/gatheringList.vue

@@ -1,17 +1,8 @@
 <template>
   <view class="details-item">
-    <view
-      class="details-select"
-      v-if="isEdit"
-    >
-      <text
-        class="iconfont iconxuanzhong"
-        v-if="isCheck"
-      > </text>
-      <text
-        class="iconfont iconweixuanzhong"
-        v-else
-      > </text>
+    <view class="details-select" v-if="isEdit">
+      <text class="iconfont iconxuanzhong" v-if="isCheck"> </text>
+      <text class="iconfont iconweixuanzhong" v-else> </text>
     </view>
     <view class="details-main">
       <view class="item-header">
@@ -21,8 +12,8 @@
         <view class="mark">{{ info.addTime }}</view>
       </view>
       <view class="item-row">
-        <view class="mark">金额:{{ info.realPrice }}</view>
-        <view class="price">欠款: {{ info.realPrice }}</view>
+        <view class="price">金额:{{ info.realPrice }}</view>
+        <view class="price" style="font-weight:normal;color:#3385FF;font-size:30rpx;" @click.stop="goToDetai(info)">查看明细</view>
       </view>
     </view>
   </view>
@@ -47,6 +38,12 @@ export default {
     }
   },
   methods: {
+    goToDetai(item){
+      this.$util.pageTo({
+        url: "/pagesPurchase/purDetails",
+        query: {id:item.id}
+      });
+    }
   }
 };
 </script>

+ 4 - 12
hdApp/src/pagesPurchase/gathering.vue

@@ -1,19 +1,11 @@
 <template>
   <view class="order-page">
     <view class="top-view">
-      <view class="top-row">
-        <text class="header-item">供应商</text>
-        <text class="header-item">总欠款 </text>
-      </view>
       <view class="top-row">
         <view class="info-item">
+          <text class="name">供应商:</text>
           <image class="logo" :src="customInfo.avatar" />
-          <text class="name">
-            {{ customInfo.name}}
-          </text>
-        </view>
-        <view class="price-item">
-          {{ customInfo.debtAmount }}
+          <text class="name">{{ customInfo.name}}</text>
         </view>
       </view>
     </view>
@@ -239,8 +231,8 @@ export default {
         align-items: center;
         .logo {
           margin-right: 10upx;
-          width: 50upx;
-          height: 50upx;
+          width: 35upx;
+          height: 35upx;
           border-radius: 50%;
         }
         .name {

+ 2 - 0
hdApp/src/pagesPurchase/orderItem.vue

@@ -11,6 +11,7 @@
           {{ info.ghsName}}
         </text>
       </view>
+      <view v-if="info.debt == 1" class="status" style="color:red;border:1px solid red;border-radius:20rpx;font-size:20rpx;padding:5rpx 12rpx;margin-right:50rpx;">欠款 </view>
       <view class="status">{{ getStatusName }} </view>
     </view>
     <view
@@ -33,6 +34,7 @@
           <text class="info-label"> 数量:</text>
           <text class="info-value">{{ info.bigNum }}/{{info.smallNum}}<text v-if="info.refund == 2" style="color:red;font-weight:bold;margin-left:30rpx;">有退款</text></text>
         </view>
+
       </view>
       <view class="item-price">¥{{ info.realPrice }} <text class="iconfont iconxiangyou"></text>
       </view>

+ 69 - 29
hdApp/src/pagesPurchase/purDetails.vue

@@ -4,20 +4,17 @@
       <view class="title">
         供应商
       </view>
-      <view class="address-des_bx content-box">
+      <view class="address-des_bx content-box" @click="goToSettle(detailInfo)">
         <view>
           <view> {{ detailInfo.ghsName }} {{ detailInfo.ghsMobile }} </view>
-          <view class="">
-            {{ detailInfo.ghsFullAddress}}
-          </view>
+          <view>{{ detailInfo.ghsFullAddress}}</view>
         </view>
         <view>
-          <i
-            @click="callUp(detailInfo.ghsMobile)"
-            class="iconfont icondianhua1"
-          ></i>
+          <i @click.stop="callUp(detailInfo.ghsMobile)" class="iconfont icondianhua1"></i>
+        	<i @click.stop="navigate(detailInfo.lat,detailInfo.long,detailInfo.supplierName)" class="iconfont icondianhua" style="font-size:53rpx;margin-left:15px;margin-right:9rpx;color:#3385ff;"></i>
         </view>
       </view>
+
       <view class="bills-info_box content-box">
         <view class="order-info_box">
           <view>订单日期:</view>
@@ -27,18 +24,15 @@
           <view>订单编号:</view>
           <view>{{ detailInfo.orderSn }}</view>
           <view class="price">
-            <button
-              @click="copy(detailInfo.orderSn)"
-              class="admin-button-com default"
-            >
-              复制
-            </button>
+            <button @click="copy(detailInfo.orderSn)" class="admin-button-com default">复制</button>
           </view>
         </view>
 
         <view v-if="detailInfo.ghsShopAdminId != 0" class="order-info_box">
           <view>商家开单:</view>
-          <view>✔</view>
+          <view>
+            <i class="iconfont icondagou" style="font-size:35rpx;"></i>
+          </view>
         </view>
 
         <view class="order-info_box">
@@ -48,9 +42,9 @@
 						:detailInfo.payWay==1?'支付宝'
 						:detailInfo.payWay==2?'余额'
 						:detailInfo.payWay==4?'现金'
-            			:detailInfo.payWay==5?'银行卡'
+            :detailInfo.payWay==5?'银行卡'
 						:'--'
-						 }}</view>
+						}}</view>
         </view>
 
         <view class="order-info_box">
@@ -59,16 +53,7 @@
         </view>
 
         <view class="order-info_box">
-          <view>欠款:</view>
-          <view v-if="detailInfo.debt == 1">是</view>
-          <view v-else>
-						<view v-if="detailInfo.clearId > 0">已结清 <span style="color:blue;margin-left:10rpx;" @click="pageTo({url: '/admin/clear/info',query: {id: detailInfo.clearId}})">帐单</span></view>
-						<view v-else>-</view>
-          </view>
-        </view>
-
-        <view class="order-info_box">
-          <view>状态:</view>
+          <view>订单状态:</view>
           <view>{{
 						detailInfo.status==1?'待付款'
 						:detailInfo.status==2?'待配送'
@@ -89,6 +74,26 @@
         </view>
 
       </view>
+
+      <view class="bills-info_box content-box">
+        <view class="order-info_box" v-if="detailInfo.debt == 1">
+          <view>欠款状态:</view>
+            <view>是</view>
+            <view class="price">
+              <text v-if="detailInfo.debtAmount > 0" @click="goToSettle(detailInfo)" style="margin-right:38rpx;color:#3385FF;font-size:26rpx;">全部欠款</text>
+              <button @click="settleOrder(detailInfo.id,detailInfo.supplierId)" class="admin-button-com">结帐</button>
+            </view>
+        </view>
+        <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 v-if="detailInfo.clearId == 0">--</view>          
+        </view>
+      </view>
+
       <view
         class="module-com content-box proInfo distribution"
         v-if="detailInfo.sendProgress.title"
@@ -182,13 +187,15 @@
       </view>
 
     </view>
-    <view class="footer_bar" v-if="detailInfo.status == 1"><view @click="toPay">付款</view></view>
+    <view class="footer_bar" v-if="detailInfo.status == 1">
+      <view @click="toPay">付款</view>
+    </view>
   </view>
 </template>
 
 <script>
 
-import { purchaseDetail, purchaseClearWxPay, purchaseDebtPay, purchaseWxPay } from "@/api/purchase/index";
+import { purchaseDetail, purchaseClearWxPay, purchaseDebtPay, purchaseWxPay,purchaseClearCreateOrder } from "@/api/purchase/index";
 import TuiListCell from "@/components/plugin/list-cell";
 export default {
   name: "info",
@@ -224,6 +231,39 @@ export default {
 			})
 		},
   methods: {
+		navigate(latitude, longitude, address) {   
+			// 将经纬度转换成Number
+			let latituded = Number(latitude);
+			let longituded = Number(longitude);					
+			uni.openLocation({
+				latitude: latituded,
+				longitude: longituded,
+				address: address,
+				success: function() {
+					console.log('success');
+				}
+			});
+		},
+    //结帐
+    settleOrder(id,ghsId) {
+        let that = this
+        purchaseClearCreateOrder({ purchaseIds:id,ghsId:ghsId }).then(res => {
+          if(res.code == 1) {
+            that.pageTo({
+              url: '/pagesPurchase/gatherPay?orderSn=' + res.data.orderSn + '&actPrice=' + res.data.actPrice+'&remainSecond='+res.data.remainSecond,
+              type: 2
+            })
+          }
+        }).catch(err => {
+          console.log('err', err)
+        })
+    },
+    //跳转到结账页
+    goToSettle (item) {
+      this.pageTo({
+        url: '/pagesPurchase/gathering?id='+item.supplierId
+      })
+    },
     copy (val) {
       const self = this;
       uni.setClipboardData({