shish 13 часов назад
Родитель
Сommit
028a94e8f1
3 измененных файлов с 140 добавлено и 32 удалено
  1. 24 15
      ghsApp/src/admin/clear/info.vue
  2. 11 10
      ghsApp/src/admin/ghs/balanceChange.vue
  3. 105 7
      ghsApp/src/pagesPurchase/info.vue

+ 24 - 15
ghsApp/src/admin/clear/info.vue

@@ -81,21 +81,10 @@
 					</tui-list-cell>
 					</tui-list-cell>
 				</div>
 				</div>
 			</view>
 			</view>
-			<view class="content-box price-detail" v-if="!$util.isEmpty(detailInfo.remark)">
-				<div class="module-com input-line-wrap">
-					<tui-list-cell class="line-cell" :hover="false">
-						<div class="tui-title">备注</div>
-						<input
-							:disabled="true"
-							v-model="detailInfo.remark"
-							placeholder-class="phcolor"
-							class="tui-input"
-							name="name"
-							maxlength="50"
-							type="text"
-						/>
-					</tui-list-cell>
-				</div>
+			<!-- 备注只读展示:多行文本卡片,避免禁用 input 观感差、长文截断 -->
+			<view class="content-box remark-card" v-if="!$util.isEmpty(detailInfo.remark)">
+				<view class="remark-label">备注</view>
+				<text class="remark-text">{{ detailInfo.remark }}</text>
 			</view>
 			</view>
 
 
 			<view class="title">
 			<view class="title">
@@ -345,6 +334,26 @@ export default {
 		margin-top: 20upx;
 		margin-top: 20upx;
 		margin-bottom: 20upx;
 		margin-bottom: 20upx;
 	}
 	}
+	/* 结账单备注:浅底卡片 + 自动换行,与金额区风格区分开 */
+	.remark-card {
+		margin-top: 20upx;
+		margin-bottom: 20upx;
+		padding: 24upx 28upx;
+		.remark-label {
+			color: #999999;
+			font-size: 24upx;
+			line-height: 1.4;
+			margin-bottom: 12upx;
+		}
+		.remark-text {
+			display: block;
+			color: #333333;
+			font-size: 28upx;
+			line-height: 1.55;
+			word-break: break-all;
+			white-space: pre-wrap;
+		}
+	}
 	.detail-price_box {
 	.detail-price_box {
 		color: #333333;
 		color: #333333;
 		font-size: 22upx;
 		font-size: 22upx;

+ 11 - 10
ghsApp/src/admin/ghs/balanceChange.vue

@@ -77,10 +77,6 @@ export default {
 		hasText(val) {
 		hasText(val) {
 			return val !== undefined && val !== null && String(val).trim() !== ''
 			return val !== undefined && val !== null && String(val).trim() !== ''
 		},
 		},
-		isPurchaseClearRow(row) {
-			const event = String(row.event || '')
-			return Number(row.relateId) > 0 && event.indexOf('采购单结账') === 0
-		},
 		mapListItem(item, amountDisplay) {
 		mapListItem(item, amountDisplay) {
 			const row = Object.assign({}, item)
 			const row = Object.assign({}, item)
 			row.amount = amountDisplay
 			row.amount = amountDisplay
@@ -98,8 +94,13 @@ export default {
 				row.timeLine = ''
 				row.timeLine = ''
 			}
 			}
 			row.balanceText = this.formatMoney(row.balance)
 			row.balanceText = this.formatMoney(row.balance)
-			row.showClearLink = this.isPurchaseClearRow(row)
-			row.clearLinkText = row.showClearLink ? '查看结账单' : ''
+			const clearSn = row.clearSn || ''
+			const clearAmt = this.formatMoney(row.clearAmount)
+			// 与客户余额变动一致:有 clearId 或 clearSn 即展示「结账单 · 本单销」
+			row.showClearLink = Number(row.clearId) > 0 || this.hasText(clearSn)
+			row.clearLinkText = row.showClearLink
+				? ('结账单 ' + clearSn + ' · 本单销' + clearAmt + '元')
+				: ''
 			row.showStaff = this.hasText(row.staffName)
 			row.showStaff = this.hasText(row.staffName)
 			row.showRemark = this.hasText(row.remark)
 			row.showRemark = this.hasText(row.remark)
 			row.showExtraRow = row.showClearLink
 			row.showExtraRow = row.showClearLink
@@ -123,13 +124,13 @@ export default {
 			this.completes(res)
 			this.completes(res)
 		},
 		},
 		goDetail(item) {
 		goDetail(item) {
-			if (this.isPurchaseClearRow(item)) {
-				this.$util.pageTo({ url: '/admin/clear/info?id=' + item.relateId })
+			if (Number(item.clearId) > 0) {
+				this.$util.pageTo({ url: '/admin/clear/info?id=' + item.clearId })
 			}
 			}
 		},
 		},
 		goClear(item) {
 		goClear(item) {
-			if (Number(item.relateId) > 0) {
-				this.$util.pageTo({ url: '/admin/clear/info?id=' + item.relateId })
+			if (Number(item.clearId) > 0) {
+				this.$util.pageTo({ url: '/admin/clear/info?id=' + item.clearId })
 			}
 			}
 		}
 		}
 	},
 	},

+ 105 - 7
ghsApp/src/pagesPurchase/info.vue

@@ -71,19 +71,36 @@
 
 
 			<view class="bills-info_box content-box" style="margin-top:18upx;">
 			<view class="bills-info_box content-box" style="margin-top:18upx;">
 				<view class="order-info_box" v-if="detailInfo.debt == 1">
 				<view class="order-info_box" v-if="detailInfo.debt == 1">
-				<view>订单状态:</view>
+					<view>订单状态:</view>
 					<view style="color:red;font-weight:bold;">挂账</view>
 					<view style="color:red;font-weight:bold;">挂账</view>
 					<view class="price">
 					<view class="price">
 						<button class="admin-button-com outline-action" @click="goToClear(detailInfo)">全部挂账</button>
 						<button class="admin-button-com outline-action" @click="goToClear(detailInfo)">全部挂账</button>
 					</view>
 					</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 outline-action">查看结账单</button>
+					<view>订单状态:</view>
+					<!-- clearId=1 仅结账痕迹;真实结账单用 orderClearList 或 clearId>1 -->
+					<view v-if="hasPurchaseCleared">已结清</view>
+					<view class="price" v-if="Number(detailInfo.clearId) > 1 && $util.isEmpty(detailInfo.orderClearList)">
+						<button @click="goClearBill({ clearId: detailInfo.clearId })" class="admin-button-com outline-action">查看结账单</button>
+					</view>
+					<view v-else></view>
+				</view>
+				<!-- 结账信息:列出每笔结账单及金额,点击进结账单详情看操作人 -->
+				<view class="order-info_box order-clear-bills" v-if="!$util.isEmpty(detailInfo.orderClearList)">
+					<view class="order-clear-bills__label">结账信息:</view>
+					<view class="order-clear-bills__links">
+						<view
+							v-for="(bill, billIndex) in detailInfo.orderClearList"
+							:key="billIndex"
+							class="order-clear-bills__link"
+							:class="{ 'order-clear-bills__link--first': billIndex === 0 }"
+							@click.stop="goClearBill(bill)"
+						>
+							<text class="order-clear-bills__sn">{{ formatClearBillLabel(bill) }}</text>
+							<text v-if="Number(bill.amount) > 0" class="order-clear-bills__amt">¥{{ parseFloat(bill.amount) }}</text>
+						</view>
 					</view>
 					</view>
-					<view v-if="detailInfo.clearId == 0"></view>          
 				</view>
 				</view>
 			</view>
 			</view>
 
 
@@ -356,6 +373,19 @@ export default {
 			const tk = Number(this.detailInfo.tkPrice || 0)
 			const tk = Number(this.detailInfo.tkPrice || 0)
 			const next = Number(this.detailInfo.nextDayTkPrice || 0)
 			const next = Number(this.detailInfo.nextDayTkPrice || 0)
 			return parseFloat((tk + next).toFixed(2))
 			return parseFloat((tk + next).toFixed(2))
+		},
+		/**
+		 * 是否展示「已结清」:非挂账,且已有结账单列表结清 / clearId 痕迹 / 剩余待结为 0
+		 */
+		hasPurchaseCleared() {
+			const info = this.detailInfo || {}
+			if (Number(info.debt) === 1) {
+				return false
+			}
+			if (!this.$util.isEmpty(info.orderClearList) && Number(info.remainDebtPrice) <= 0) {
+				return true
+			}
+			return Number(info.clearId) > 0
 		}
 		}
   	},
   	},
 	mixins: [productMins],
 	mixins: [productMins],
@@ -627,6 +657,25 @@ export default {
 				url: '/pagesGys/details?id='+item.ghsId
 				url: '/pagesGys/details?id='+item.ghsId
 			})
 			})
 		},
 		},
+		/**
+		 * 跳转采购结账单详情(看操作人、金额)
+		 */
+		goClearBill(item) {
+			const id = item && item.clearId ? item.clearId : 0
+			// clearId=1 仅为结账痕迹,不是真实结账单主键
+			if (!id || Number(id) <= 1) {
+				return
+			}
+			this.pageTo({ url: '/admin/clear/info', query: { id } })
+		},
+		/**
+		 * 结账单短文案:前缀「结账单」+ clearSn 后四位(对齐 pagesOrder/detail)
+		 */
+		formatClearBillLabel(bill) {
+			const sn = bill && bill.clearSn != null ? String(bill.clearSn) : ''
+			const tail = sn ? sn.slice(-4) : ''
+			return '结账单' + tail
+		},
 		modifyRemark(){
 		modifyRemark(){
 			const self = this;
 			const self = this;
 			let remark = this.detailInfo.remark
 			let remark = this.detailInfo.remark
@@ -814,7 +863,6 @@ export default {
 	}
 	}
 	.bills-info_box {
 	.bills-info_box {
 		padding: 30upx 20upx 30upx;
 		padding: 30upx 20upx 30upx;
-		// border-bottom: 1upx solid #EEEEEE;
 		& > .order-info_box {
 		& > .order-info_box {
 			display: flex;
 			display: flex;
 			align-items: center;
 			align-items: center;
@@ -828,6 +876,8 @@ export default {
 			}
 			}
 			& > view:nth-child(2) {
 			& > view:nth-child(2) {
 				color: #333333;
 				color: #333333;
+				flex: 1;
+				margin-left: 20upx;
 			}
 			}
 			& > .price {
 			& > .price {
 				flex: 1;
 				flex: 1;
@@ -836,6 +886,7 @@ export default {
 				display: flex;
 				display: flex;
 				align-items: center;
 				align-items: center;
 				justify-content: flex-end;
 				justify-content: flex-end;
+				font-weight: 600;
 				& .iconxiangyou {
 				& .iconxiangyou {
 					color: #999999;
 					color: #999999;
 					font-size: 25upx;
 					font-size: 25upx;
@@ -843,6 +894,53 @@ export default {
 				}
 				}
 			}
 			}
 		}
 		}
+		/* 结账信息:与第一条结账单顶对齐 */
+		& > .order-info_box.order-clear-bills {
+			align-items: flex-start;
+			margin-top: 16upx;
+		}
+	}
+	.order-clear-bills__label {
+		font-size: 26upx;
+		line-height: 40upx;
+		font-weight: 400;
+		color: #999999;
+		width: 135upx;
+		text-align: right;
+		flex-shrink: 0;
+	}
+	.order-clear-bills__links {
+		flex: 1;
+		display: flex;
+		flex-direction: column;
+		min-width: 0;
+		margin-left: 20upx;
+	}
+	.order-clear-bills__link {
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		box-sizing: border-box;
+		width: 100%;
+		color: #3385ff;
+		line-height: 40upx;
+		margin-top: 12upx;
+	}
+	.order-clear-bills__link--first {
+		margin-top: 0;
+	}
+	.order-clear-bills__sn {
+		color: #3385ff;
+		font-size: 28upx;
+		font-weight: 400;
+		line-height: 40upx;
+	}
+	.order-clear-bills__amt {
+		color: #3385ff;
+		font-size: 28upx;
+		margin-left: 18upx;
+		font-weight: 400;
+		line-height: 40upx;
 	}
 	}
 	.content-box {
 	.content-box {
 		background-color: #ffffff;
 		background-color: #ffffff;