Просмотр исходного кода

Merge branch 'redesign‌-260706' of git.huaml.com:zhh/front-end into redesign‌-260706

shizhongqi 1 день назад
Родитель
Сommit
ec6d9298c6

+ 8 - 0
ghsApp/src/api/ghs/index.js

@@ -12,6 +12,14 @@ export const changeGhsName = data => {
 	return https.get('/ghs/modify-name', data)
 }
 
+/**
+ * 按采购挂账单重算并回写供货商待结笔数
+ * @param {{ id: number }} data 供货商 id
+ */
+export const refreshDebtNum = data => {
+	return https.get('/ghs/refresh-debt-num', data)
+}
+
 /** *
  * 供货商列表 姜枫 2021.04.01  ghs/add
  */

+ 6 - 6
ghsApp/src/components/forward-options-popup.vue

@@ -33,14 +33,14 @@ export default {
 			}
 			if (this.mode === 'purchase') {
 				if (this.orderCleared) {
-					return '采购单已结清,本次售后不减实付,只会算今天退款;金额将退回采购账户余额。'
+					return '采购单已结清,本次售后不减实付,只会算今天退款;金额将退回采购账户余额。'
 				}
 				return '本次售后不减采购实付,只会算作今天退款;金额将退回采购账户余额。'
 			}
 			if (this.orderCleared) {
-				return '订单已结账,本次售后不减订单实付,只会算今天退款;资金将原路退回。'
+				return '订单已结账,本次售后不减订单实付,只会算今天退款;资金将原路退回。'
 			}
-			return '本次售后不减订单实付,只会算今天退款;资金将原路退回。'
+			return '本次售后不减订单实付,只会算今天退款;资金将原路退回。'
 		}
 	},
 	methods: {
@@ -82,10 +82,10 @@ export default {
 	margin-bottom: 16upx;
 }
 .tip {
-	font-size: 34upx;
+	font-size: 38upx;
 	color: #666;
-	line-height: 1.5;
-	margin-bottom: 28upx;
+	line-height: 1.6;
+	margin-bottom: 60upx;
 }
 .btns {
 	display: flex;

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

@@ -5,6 +5,8 @@
 			<text class="iconfont iconweixuanzhong" v-else> </text>
 		</view>
 		<view class="details-main">
+			<!-- 右上角脱离文档流,不挤占价格行宽 -->
+			<view class="detail-btn" @click.stop="goToDetai(info)">查看明细</view>
 			<view class="item-header">
 				<text class="name">单号 {{info.orderSn}} </text>
 			</view>
@@ -13,12 +15,18 @@
 			</view>
 			<view class="item-row">
 				<view :class="[Number(info.debtPrice)>Number(info.remainDebtPrice) ? 'price-del' : 'price']">¥{{ parseFloat(info.debtPrice || info.remainDebtPrice) }}</view>
-				<view class="price" style="border:1upx solid #67a0f7;border-radius:10upx;font-weight:normal;color:#3385FF;font-size:32upx;width:180upx;height:80upx;justify-content:center;" @click.stop="goToDetai(info)">查看明细</view>
+			</view>
+			<!-- 售后退款单独成行:当天 / 隔天,对齐 pagesGys/detailsItem -->
+			<view class="item-row" v-if="Number(info.tkPrice)>0">
+				<view class="refund-tip refund-tip-same">当天售后已退¥{{info.tkPrice?parseFloat(info.tkPrice):0}}</view>
+			</view>
+			<view class="item-row" v-if="Number(info.nextDayTkPrice)>0">
+				<view class="refund-tip refund-tip-next">隔天售后已退¥{{parseFloat(info.nextDayTkPrice)}}</view>
 			</view>
 			<view class="item-row" v-if="!$util.isEmpty(info.remark)">
 				<view class="remark">{{ info.remark }}</view>
 			</view>
-			<view class="item-row" v-if="Number(info.debtPrice)>Number(info.remainDebtPrice)">
+			<view class="item-row" v-if="Number(info.debtPrice)>Number(info.remainDebtPrice) && Number(info.clearId)>0">
 				<view class="price" style="color:red;">已清 ¥{{ info.hasPayDebt }},剩余待结 ¥{{ parseFloat(info.remainDebtPrice) }}</view>
 			</view>
 		</view>
@@ -74,6 +82,25 @@ export default {
 	}
 	.details-main {
 		flex: 1;
+		position: relative;
+		// 给右上角「查看明细」留空,避免单号被挡住
+		padding-right: 200upx;
+	}
+	.detail-btn {
+		position: absolute;
+		top: 0;
+		right: 0;
+		z-index: 2;
+		width: 180upx;
+		height: 80upx;
+		border: 1upx solid #67a0f7;
+		border-radius: 10upx;
+		font-size: 32upx;
+		font-weight: normal;
+		color: #3385FF;
+		display: flex;
+		align-items: center;
+		justify-content: center;
 	}
 	.item-header {
 		display: flex;
@@ -126,6 +153,16 @@ export default {
 			color: #333333;
 			text-decoration: line-through;
 		}
+		.refund-tip {
+			font-size: 26upx;
+			font-weight: normal;
+		}
+		.refund-tip-same {
+			color: red;
+		}
+		.refund-tip-next {
+			color: #e67e22;
+		}
 	}
 }
 </style>

+ 38 - 4
ghsApp/src/pagesGys/detailsItem.vue

@@ -5,6 +5,8 @@
 			<text class="iconfont iconweixuanzhong" v-else> </text>
 		</view>
 		<view class="details-main">
+			<!-- 右上角脱离文档流,不挤占价格/售后文案行宽 -->
+			<view class="detail-btn" @click.stop="goToDetai(info)">查看明细</view>
 			<view class="item-header">
 				<text class="name">
 					{{info.orderSn}}
@@ -20,13 +22,16 @@
 				<view class="mark" style="color:red;font-weight:bold;">{{ info.remark }}</view>
 			</view>
 			<view class="item-row">
-				<!-- 仅原欠金额划线;当天/隔天已退文案不带中划线 -->
 				<view class="price" style="color:#3385FF;">
 					<text :class="[hasPartialClear ? 'price-del' : '']">¥{{ parseFloat(displayDebtPrice) }}</text>
-					<text v-if="Number(info.tkPrice)>0" style="margin-left:30upx;color:red;font-weight: normal;">当天已退¥{{info.tkPrice?parseFloat(info.tkPrice):0}}</text>
-					<text v-if="Number(info.nextDayTkPrice)>0" style="margin-left:20upx;color:#e67e22;font-weight: normal;">隔天已退¥{{parseFloat(info.nextDayTkPrice)}}</text>
 				</view>
-				<view class="price" style="border:1upx solid #67a0f7;border-radius:10upx;font-weight:normal;color:#3385FF;font-size:32upx;width:180upx;height:80upx;justify-content:center;" @click.stop="goToDetai(info)">查看明细</view>
+			</view>
+			<!-- 售后退款单独成行,不与挂账价格挤在同一行 -->
+			<view class="item-row" v-if="Number(info.tkPrice)>0">
+				<view class="refund-tip refund-tip-same">当天售后已退¥{{info.tkPrice?parseFloat(info.tkPrice):0}}</view>
+			</view>
+			<view class="item-row" v-if="Number(info.nextDayTkPrice)>0">
+				<view class="refund-tip refund-tip-next">隔天售后已退¥{{parseFloat(info.nextDayTkPrice)}}</view>
 			</view>
 			<view class="item-row" v-if="hasPartialClear">
 				<view class="price" style="color:red;">已清 ¥{{ hasPayDebt }},剩余待结 ¥{{ parseFloat(remainDebtPrice) }}</view>
@@ -113,6 +118,25 @@ export default {
 	}
 	.details-main {
 		flex: 1;
+		position: relative;
+		// 给右上角「查看明细」留空,避免单号被挡住
+		padding-right: 200upx;
+	}
+	.detail-btn {
+		position: absolute;
+		top: 0;
+		right: 0;
+		z-index: 2;
+		width: 180upx;
+		height: 80upx;
+		border: 1upx solid #67a0f7;
+		border-radius: 10upx;
+		font-size: 32upx;
+		font-weight: normal;
+		color: #3385FF;
+		display: flex;
+		align-items: center;
+		justify-content: center;
 	}
 	.item-header {
 		display: flex;
@@ -150,6 +174,16 @@ export default {
 			color: #999 !important;
 			font-weight: 600;
 		}
+		.refund-tip {
+			font-size: 26upx;
+			font-weight: normal;
+		}
+		.refund-tip-same {
+			color: red;
+		}
+		.refund-tip-next {
+			color: #e67e22;
+		}
 	}
 }
 </style>

+ 2 - 2
ghsApp/src/pagesPurchase/refund.vue

@@ -45,8 +45,8 @@
 			<view class="refund-label">订单金额:</view>
 			<view class="list">
 				¥{{parseFloat(orderInfo.actPrice || orderInfo.orderPrice)||0}}
-				<text style="margin-left:25upx;font-size:25upx;color:green;" v-if="Number(orderInfo.tkPrice)>0">当天已退¥{{orderInfo.tkPrice ? parseFloat(orderInfo.tkPrice) : 0}}</text>
-				<text style="margin-left:15upx;font-size:25upx;color:#e6a23c;" v-if="Number(orderInfo.nextDayTkPrice)>0">隔天已退¥{{parseFloat(orderInfo.nextDayTkPrice)}}</text>
+				<text style="margin-left:25upx;font-size:25upx;color:green;" v-if="Number(orderInfo.tkPrice)>0">当天售后已退¥{{orderInfo.tkPrice ? parseFloat(orderInfo.tkPrice) : 0}}</text>
+				<text style="margin-left:15upx;font-size:25upx;color:#e6a23c;" v-if="Number(orderInfo.nextDayTkPrice)>0">隔天售后已退¥{{parseFloat(orderInfo.nextDayTkPrice)}}</text>
 			</view>
 		</view>
 		<view class="flex refund-item">

+ 38 - 15
ghsApp/src/pagesPurchase/supplier.vue

@@ -57,11 +57,12 @@
               <!-- 下拉菜单内容 -->
               <view class="more-dropdown" v-if="activeMenuId === item.id">
                 <view class="dropdown-item" hover-class="none" @click.stop="handleDebtChangeFromMenu(item)">
-                  <text class="dropdown-icon">📋</text>
                   <text class="dropdown-text">挂账变动明细(废弃)</text>
                 </view>
-                <view class="dropdown-item" hover-class="none" @click.stop="handleDeleteFromMenu(item)">
-                  <text class="dropdown-icon">🗑</text>
+                <view class="dropdown-item" hover-class="none" @click.stop="handleRefreshDebtNum(item)">
+                  <text class="dropdown-text">待结笔数刷新</text>
+                </view>
+                <view class="dropdown-item dropdown-item-danger" hover-class="none" @click.stop="handleDeleteFromMenu(item)">
                   <text class="dropdown-text">删除供货商</text>
                 </view>
               </view>
@@ -84,9 +85,9 @@
           <!-- 记录信息区(中部,非删除状态显示) -->
           <view class="record-section" v-if="isNormalList">
             <view class="record-buttons">
+              <view class="record-btn" hover-class="none" @click.stop="cgList(item)">采购记录</view>
               <view class="record-btn" hover-class="none" @click.stop="pageTo({ url: '/admin/clear/list?ghsId='+item.id})">结账记录</view>
               <view class="record-btn" hover-class="none" @click.stop="getBalanceList(item)">余额变动明细</view>
-              <view class="record-btn" hover-class="none" @click.stop="cgList(item)">采购记录</view>
             </view>
           </view>
 
@@ -174,7 +175,7 @@
 <script>
 import Tabs from "@/components/plugin/tabs";
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
-import { getList, changeGhsName, changeLocationFn, changeDelStatus } from "@/api/ghs";
+import { getList, changeGhsName, changeLocationFn, changeDelStatus, refreshDebtNum } from "@/api/ghs";
 import AppSearchModule from "@/components/module/app-search";
 import ModalModule from "@/components/plugin/modal";
 import { list } from "@/mixins";
@@ -257,7 +258,7 @@ export default {
       if (bal < 0) {
         return Math.abs(bal)
       }
-      return parseFloat(item.debtAmount || 0)
+      return 0
     },
     // 是否有待结:金额优先,避免「N 笔 0 元」仍展示
     hasSupplierPending(item) {
@@ -326,6 +327,29 @@ export default {
       this.activeMenuId = null
       this.getDebtList(item)
     },
+    /**
+     * 更多菜单:按采购挂账单重算该供货商待结笔数并更新列表展示
+     */
+    handleRefreshDebtNum(item) {
+      this.activeMenuId = null
+      if (!item || !item.id) {
+        return
+      }
+      const oldNum = parseInt(item.debtNum || 0, 10) || 0
+      refreshDebtNum({ id: item.id }).then(res => {
+        if (res.code != 1) {
+          return
+        }
+        const debtNum = parseInt((res.data && res.data.debtNum) || 0, 10) || 0
+        this.$set(item, 'debtNum', debtNum)
+        // 页头总笔数仅统计有待结金额的供货商,本行无待结金额时不改总笔数
+        if (this.info && this.isNormalList && this.hasSupplierPending(item)) {
+          const total = parseInt(this.info.totalDebtNum || 0, 10) || 0
+          this.$set(this.info, 'totalDebtNum', Math.max(0, total + (debtNum - oldNum)))
+        }
+        this.$msg('已刷新')
+      })
+    },
     init() {
       this.getGhsList()
     },
@@ -711,20 +735,18 @@ export default {
               transition: background-color 0.2s ease;
               
               &:active {
+                background-color: #f5f7fa;
+              }
+
+              // 删除项按压反馈用红色,与普通菜单项区分
+              &.dropdown-item-danger:active {
                 background-color: #ffeef0;
                 
-                .dropdown-text, .dropdown-icon {
+                .dropdown-text {
                   color: #ff4d4f;
                 }
               }
               
-              .dropdown-icon {
-                font-size: 26upx;
-                color: #999;
-                margin-right: 12upx;
-                flex-shrink: 0;
-              }
-              
               .dropdown-text {
                 font-size: 26upx;
                 color: #555;
@@ -818,7 +840,8 @@ export default {
             background-color: #e8f1ff;
             border: 1upx solid #c5daf5;
             border-radius: 8upx;
-            padding: 14upx 0;
+            // 原 padding 14upx,上下各 +2 共增高 4upx,flex 保证文字垂直居中
+            padding: 16upx 0;
             cursor: pointer;
             margin-right: 16upx;
             transition: all 0.2s ease;