Browse Source

记账时间

shish 9 hours ago
parent
commit
84d7925954

+ 2 - 2
ghs/src/views/custom/yj.vue

@@ -1,11 +1,11 @@
 <!--
-  PC 客户业绩:按账时间汇总开单;跨天售后按通过日扣实际金额并计入退款(与小程序 customSale 对齐)。
+  PC 客户业绩:按账时间汇总开单;跨天售后按通过日扣实际金额并计入退款(与小程序 customSale 对齐)。
 -->
 <template>
 	<div class="shop-list">
 		<x-crud @load="onLoad">
 			<template #slot-date-select>
-                账时间:<el-date-picker v-model="currentDateList" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" @change="getSearchDate" value-format="yyyy-MM-dd"
+                账时间:<el-date-picker v-model="currentDateList" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" @change="getSearchDate" value-format="yyyy-MM-dd"
                 end-placeholder="结束日期" :picker-options="pickerOptions" size="mini"> </el-date-picker>
 			</template>
 

+ 4 - 4
ghs/src/views/order/list.vue

@@ -202,7 +202,7 @@
         <el-button-group style="margin-left:9px;margin-right:4px;">
           <el-button size="mini" :type="searchTimeType === 0 ? 'primary' : 'default'" @click="changeSearchTimeType(0)">开单时间</el-button>
           <el-button size="mini" :type="searchTimeType === 2 ? 'primary' : 'default'" @click="changeSearchTimeType(2)">发货时间</el-button>
-          <el-button size="mini" :type="searchTimeType === 1 ? 'primary' : 'default'" @click="changeSearchTimeType(1)">账时间</el-button>
+          <el-button size="mini" :type="searchTimeType === 1 ? 'primary' : 'default'" @click="changeSearchTimeType(1)">账时间</el-button>
         </el-button-group>
         <el-date-picker v-model="currentDateList" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" @change="getSearchDate" value-format="yyyy-MM-dd"
           class="custom-date-picker" end-placeholder="结束日期" :picker-options="pickerOptions" size="mini" style="margin-right:8px;">
@@ -424,7 +424,7 @@ export default {
         return '发货时间'
       }
       if (this.searchTimeType === 1) {
-        return '账时间'
+        return '账时间'
       }
       return '开单时间'
     }
@@ -469,7 +469,7 @@ export default {
         searchTimeType: this.searchTimeType
       }, extra)
     },
-    /** 切换开单 / 发货 / 账时间筛选,列表排序跟着当前类型走 */
+    /** 切换开单 / 发货 / 账时间筛选,列表排序跟着当前类型走 */
     changeSearchTimeType(type) {
       if (this.searchTimeType === type) {
         return
@@ -1032,7 +1032,7 @@ export default {
               },
               {
                 prop: 'payTime',
-                label: '账时间',
+                label: '账时间',
                 align: 'center',
                 width: 90
               }

+ 29 - 3
ghsApp/src/admin/expend/addExpend.vue

@@ -1,3 +1,7 @@
+<!--
+  新增支出:备注下可选业务时间(sendTime);空则默认当天。
+  payTime 由后端写登记时刻且不可改;列表筛选/修改与利润「发货时间」按 sendTime。
+-->
 <template>
   <view class="app-content">
     <view>
@@ -22,6 +26,13 @@
             </view>
           </tui-list-cell>
 
+          <!-- 业务时间写入 sendTime;空则后端按当天登记 -->
+          <tui-list-cell class="line-cell" :hover="false" :arrow="true">
+            <view class="tui-title">时间</view>
+            <view class="uni-input" v-if="!form.sendTime" style="color:#CCCCCC;width:400upx;" @click="bindSendTimeChange">默认当天</view>
+            <view class="uni-input" v-else style="width:400upx;" @click="bindSendTimeChange">{{ form.sendTime }}</view>
+          </tui-list-cell>
+
           <tui-list-cell class="line-cell" :arrow="true">
             <div class="tui-title">付款人</div>
             <picker mode="selector" :value="form.getStaffId" :range="staffList" range-key="name" @change="payManChange" class="tui-input" >
@@ -113,7 +124,8 @@ export default {
         getStaffId:0,
         getStaffName:'',
         bx:-1,
-        historyDate:""
+        // 业务时间 Y-m-d,提交写入 sendTime;空则后端当天
+        sendTime:''
       },
       payWayList:[{name:"线下微信",id:0},{name:"现金",id:4},{name:"线下支付宝",id:1},{name:"银行卡",id:5}],
       payWayindex:0,
@@ -123,17 +135,31 @@ export default {
       showPicker: false
     };
   },
+  computed: {
+    /** 日期控件默认值:已选 sendTime,否则今天 */
+    defaultPickerDate() {
+      if (this.form.sendTime) {
+        return this.form.sendTime
+      }
+      const d = new Date()
+      const m = d.getMonth() + 1
+      const day = d.getDate()
+      return d.getFullYear() + '-' + (m < 10 ? '0' + m : m) + '-' + (day < 10 ? '0' + day : day)
+    }
+  },
   onLoad () {
 			currentShop().then(res => {
 				this.shopInfo = res.data
 			})
   },
   methods: {
-    bindHistoryDateChange(){
+    /** 打开业务时间选择(sendTime) */
+    bindSendTimeChange(){
 			this.showPicker = true
     },
 		confirmPicker(e) {
-			this.form.historyDate = e.value
+			// 统一成 Y-m-d,后端拼成 datetime 写入 sendTime
+			this.form.sendTime = String(e.value || '').replace(/\//g, '-')
       this.showPicker = false
 		},
     payManChange(e){

+ 107 - 10
ghsApp/src/admin/expend/list.vue

@@ -1,3 +1,6 @@
+<!--
+  支出列表:DateSelect 旁可选记账时间(payTime,默认) / 发生时间(sendTime);「修改」仍改 sendTime。
+-->
 <template>
 <view class="app-content">
 	<view style="padding:20upx 0 30upx 50upx;font-size:32upx;">
@@ -7,9 +10,22 @@
 			<text style="margin-left:70upx;" @click="changePayMan()">{{ getStaffName }}</text>
 		</view>
 	</view>
-	<view style="margin-left:50upx;margin-bottom:26upx;position:relative;">
-        <DateSelect class="bar" top="0" @selectDateFn="selectDateFn" defaultShowName='今年' />
-    </view>
+	<view class="date-filter-row">
+		<!-- 记账时间 / 发生时间:只切换筛字段,共用同一 DateSelect -->
+		<view class="time-type-row">
+			<view
+				class="time-type-item"
+				:class="{ active: timeType === 'pay' }"
+				@click="changeTimeType('pay')"
+			>记账时间</view>
+			<view
+				class="time-type-item"
+				:class="{ active: timeType === 'send' }"
+				@click="changeTimeType('send')"
+			>发生时间</view>
+		</view>
+		<DateSelect class="bar" top="0" @selectDateFn="selectDateFn" defaultShowName='今年' />
+	</view>
 	<block v-if="!$util.isEmpty(list.data)">
 		<view v-for="(item, index) in list.data" :key="index">
 			<view style="background-color: white;margin-bottom:15upx;padding:18upx 0 18upx 30upx;font-size:28upx;position:relative;">
@@ -19,10 +35,11 @@
 				</view>
 				<view v-if="item.remark!=''" style="color:red;margin-top:8upx;">备注:{{ item.remark }}</view>
 				<view style="margin-top:8upx;">付款:<text>{{item.staffName?item.staffName:''}}</text></view>
+				<!-- 展示/修改发生时间 sendTime;payTime 仅登记时间不可改 -->
 				<view style="margin-top:8upx;" @click="openPicker(item)">
-					时间:{{ item.payTime.substr(5,11) }}
+					发生时间:{{ displaySendTime(item) }}
 					<text style="margin-left:35upx;color:#409eff;">修改</text>
-					<text style="margin-left:35upx;color:#969292;" v-if="item.payTime!='0000-00-00 00:00:00' && item.addTime.substr(5,5)!=item.payTime.substr(5,5)">
+					<text style="margin-left:35upx;color:#969292;" v-if="showAddTimeTip(item)">
 						添加时间 {{ item.addTime.substr(5,11) }}
 					</text>
 				</view>
@@ -69,7 +86,7 @@
 
 <script>
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
-import { getExpendList,getTypeList,changePayTime,deleteExpend } from '@/api/expend'
+import { getExpendList,getTypeList,changeSendTime,deleteExpend } from '@/api/expend'
 import list from '@/mixins/list'
 import { getAllStaff } from "@/api/shop-admin"
 import DateSelect from "@/components/module/dateSelect"
@@ -94,8 +111,11 @@ export default {
 			searchTime:'',
 			startTime:'',
 			endTime:'',
+			// pay=记账时间(默认) / send=发生时间
+			timeType: 'pay',
 			showPicker:false,
 			currentInfo:{},
+			defaultPickerDate:'',
 			pageAction:{refresh:0}
 		};
 	},
@@ -119,11 +139,43 @@ export default {
 		})
 	},
 	methods: {
+		/** 切换记账时间 / 发生时间后刷新列表 */
+		changeTimeType(type) {
+			if (this.timeType === type) {
+				return
+			}
+			this.timeType = type
+			this.resetList()
+			this.init()
+		},
+		/** 列表展示 sendTime;历史空值回退 payTime */
+		displaySendTime(item) {
+			const t = (item && item.sendTime) ? item.sendTime : ''
+			if (t && t.indexOf('0000-00-00') !== 0) {
+				return t.substr(5, 11)
+			}
+			const pay = (item && item.payTime) ? item.payTime : ''
+			return pay ? pay.substr(5, 11) : ''
+		},
+		/** 业务日与添加日不同时提示添加时间 */
+		showAddTimeTip(item) {
+			if (!item || !item.addTime) {
+				return false
+			}
+			const t = (item.sendTime && item.sendTime.indexOf('0000-00-00') !== 0)
+				? item.sendTime
+				: (item.payTime || '')
+			if (!t || t.indexOf('0000-00-00') === 0) {
+				return false
+			}
+			return item.addTime.substr(5, 5) !== t.substr(5, 5)
+		},
+		/** 修改支出业务时间 sendTime */
 		confirmPicker(e) {
 			let that = this
 			that.$util.confirmModal({content:'确认修改?'},() => {
 				that.showPicker = false
-				changePayTime({id:that.currentInfo.id,date:e.value}).then(res=>{
+				changeSendTime({id:that.currentInfo.id,date:e.value}).then(res=>{
 					if(res.code == 1){
 						that.$msg(res.msg)
 						that.resetList()
@@ -134,6 +186,11 @@ export default {
 		},
 		openPicker(info){
 			this.currentInfo = info
+			// 修改弹窗默认落到当前发生日(sendTime,空则 payTime)
+			const t = (info.sendTime && String(info.sendTime).indexOf('0000-00-00') !== 0)
+				? info.sendTime
+				: (info.payTime || '')
+			this.defaultPickerDate = t ? String(t).substr(0, 10) : ''
 			this.showPicker = true
 		},
 		selectDateFn(val) {
@@ -212,8 +269,16 @@ export default {
 			this.$util.pageTo({url: '/admin/expend/addExpend'})
 		},
 		async init(){
-			const res = await getExpendList({ page:this.list.page,bx:this.bx,type:this.type,staffId:this.getStaffId,searchTime: this.searchTime,
-				startTime: this.startTime,endTime: this.endTime,})
+			const res = await getExpendList({
+				page: this.list.page,
+				bx: this.bx,
+				type: this.type,
+				staffId: this.getStaffId,
+				searchTime: this.searchTime,
+				startTime: this.startTime,
+				endTime: this.endTime,
+				timeType: this.timeType
+			})
 			if (this.$util.isEmpty(res.data.list)){
 				this.completes(res)
 				return
@@ -253,6 +318,38 @@ export default {
 .app-content{
 	padding-bottom:120upx;
 }
+.date-filter-row {
+	margin: 0 20upx 26upx 20upx;
+	display: flex;
+	align-items: center;
+	.time-type-row {
+		display: flex;
+		align-items: center;
+		flex-shrink: 0;
+		margin-right: 12upx;
+	}
+	.time-type-item {
+		height: 56upx;
+		line-height: 56upx;
+		padding: 0 16upx;
+		font-size: 24upx;
+		color: #666;
+		background: #f5f5f5;
+		border-radius: 8upx;
+		margin-right: 10upx;
+		&:last-child {
+			margin-right: 0;
+		}
+		&.active {
+			color: #fff;
+			background: #3385ff;
+		}
+	}
+	.bar {
+		flex: 1;
+		min-width: 0;
+	}
+}
 .class-popup-style{
 	z-index:99999;
 }
@@ -270,4 +367,4 @@ export default {
 	font-size: 30upx;
 	line-height: 56rpx;
 }
-</style>
+</style>

+ 1 - 1
ghsApp/src/admin/home/order.vue

@@ -360,7 +360,7 @@ export default {
       timeTypeOptions: [
         { label: '开单时间', value: 0 },
         { label: '发货时间', value: 2 },
-        { label: '账时间', value: 1 }
+        { label: '账时间', value: 1 }
       ],
       sendTypeOptions: [
         { label: '全部', value: -1 },

+ 54 - 7
ghsApp/src/admin/stat/profit.vue

@@ -1,11 +1,25 @@
 <!--
   经营利润:收入含「采购跨天退货」(通过日,退货并退款+仅退款合计);花材采购仍按入库日实付。
+  时间维度:记账时间(销售/支出 payTime、采购 entryTime)与发货时间(销售/采购/支出 sendTime),共用同一 DateSelect。
 -->
 <template>
 <view class="app-content">
 	<view class="ex-page">
 		<view class="top-bar">
-			 <DateSelect class="bar" top="0" @selectDateFn="selectDateFn" /> 
+			<!-- 记账时间 / 发货时间:只切换筛字段,不另开时间选择器 -->
+			<view class="time-type-row">
+				<view
+					class="time-type-item"
+					:class="{ active: params.timeType === 'bill' }"
+					@click="changeTimeType('bill')"
+				>记账时间</view>
+				<view
+					class="time-type-item"
+					:class="{ active: params.timeType === 'send' }"
+					@click="changeTimeType('send')"
+				>发货时间</view>
+			</view>
+			<DateSelect class="bar" top="0" @selectDateFn="selectDateFn" />
 		</view>
 		<scroll-view scroll-y scroll-with-animation class="main-view">
 			<view class="space-view ex-table">
@@ -91,7 +105,8 @@ export default {
 				startTime: "",
 				endTime: "",
 				shopId: "",
-				
+				// bill=记账时间(默认) / send=发货时间
+				timeType: 'bill',
 			},
 			profit:[],
 		};
@@ -119,6 +134,14 @@ export default {
 			this.params = {...this.params,...val}
 			this.init();			
 		},
+		/** 切换记账时间 / 发货时间,刷新利润 */
+		changeTimeType(type) {
+			if (this.params.timeType === type) {
+				return
+			}
+			this.params.timeType = type
+			this.init()
+		},
 		goClassProfit(){
 			this.$util.pageTo({url: "/admin/stat/classProfit"})
 		},
@@ -146,19 +169,43 @@ export default {
 		left: 0;
 		top:18upx;
 		display: flex;
+		align-items: center;
 		width: 100%;
 		z-index: 20;
+		padding: 0 16upx;
+		box-sizing: border-box;
+		.time-type-row {
+			display: flex;
+			align-items: center;
+			flex-shrink: 0;
+			margin-right: 12upx;
+		}
+		.time-type-item {
+			height: 56upx;
+			line-height: 56upx;
+			padding: 0 18upx;
+			font-size: 26upx;
+			color: #666;
+			background: #f5f5f5;
+			border-radius: 8upx;
+			margin-right: 10upx;
+			&:last-child {
+				margin-right: 0;
+			}
+			&.active {
+				color: #fff;
+				background: #08b955;
+			}
+		}
 		.bar{
-			width: 50%;
+			flex: 1;
+			min-width: 0;
 			height: 100%;
 			text-align: center;
-			&:nth-child(1){
-				border-right: 1upx solid #eeeeec;
-			}
 		}
 	}
 	.main-view {
-		margin-top: 50upx;
+		margin-top: 70upx;
 		flex: 1;
 		background-color: #f9fbfc;
 		.space-view {

+ 5 - 0
ghsApp/src/api/expend/index.js

@@ -39,3 +39,8 @@ export const deleteExpend = data => {
 export const changePayTime = data => {
 	return https.get('/expend/change-pay-time', data)
 }
+
+/** 修改支出业务时间 sendTime */
+export const changeSendTime = data => {
+	return https.get('/expend/change-send-time', data)
+}

+ 1 - 1
ghsApp/src/api/gys/index.js

@@ -21,7 +21,7 @@ export const clearOrderApi = id => {
 };
 
 /**
- * 供货商采购挂账明细。searchTime 筛账时间 entryTime;sendSearchTime 筛发货时间 sendTime。
+ * 供货商采购挂账明细。searchTime 筛账时间 entryTime;sendSearchTime 筛发货时间 sendTime。
  * 对应 PurchaseController::actionDebtList
  */
 export const getDebtList = data => {

+ 1 - 1
ghsApp/src/api/purchase/index.js

@@ -70,7 +70,7 @@ export const getCgSalt = data => {
 
 
 /**
- * 采购入库单列表。searchTime 筛账时间 entryTime;sendSearchTime 筛发货时间 sendTime;可同时生效。
+ * 采购入库单列表。searchTime 筛账时间 entryTime;sendSearchTime 筛发货时间 sendTime;可同时生效。
  * 对应 PurchaseOrderController::actionList
  */
 export const getPurchaseListApi = async data => {

+ 2 - 2
ghsApp/src/pagesArrears/details.vue

@@ -69,7 +69,7 @@
 				ref="billDateSelect"
 				class="bar date-select-gap"
 				top="0"
-				defaultShowName="开单时间"
+				defaultShowName="记账时间"
 				@selectDateFn="selectBillDateFn"
 				@overlay-change="onBillDateOverlayChange"
 			/>
@@ -547,7 +547,7 @@ export default {
 	margin-left: 48upx;
 }
 .date-reset-text {
-	margin-right: 16upx;
+	margin-right: 25upx;
 	font-size: 26upx;
 	color: #3385FF;
 	flex-shrink: 0;

+ 1 - 1
ghsApp/src/pagesArrears/detailsItem.vue

@@ -23,7 +23,7 @@
 				<view
 					v-if="info.addTime && info.addTime.indexOf('0000-00-00') < 0 && (!info.sendTime || info.sendTime.indexOf('0000-00-00') === 0 || info.addTime.substr(5, 5) != info.sendTime.substr(5, 5))"
 					class="bill-date"
-				>开单时间 {{ info.addTime.substr(5, 11) }}</view>
+				>记账时间 {{ info.addTime.substr(5, 11) }}</view>
 			</view>
 			<!-- 售后退款单独成行:当天 / 跨天,对齐 pagesGys/detailsItem -->
 			<view class="item-row" v-if="Number(info.tkPrice)>0">

+ 4 - 4
ghsApp/src/pagesGys/details.vue

@@ -8,11 +8,11 @@
 						{{ ghsInfo.name}}
 					</text>
 				</view>
-				<!-- 重置靠发货时间左边;发货时间在左、入库时间在右 -->
+				<!-- 重置靠发货时间左边;发货时间在左、记账时间在右 -->
 				<view class="date-filter">
 					<text class="date-reset-text" @click="resetDateFilters">重置</text>
 					<DateSelect ref="sendDateSelect" class="bar" top="0" @selectDateFn="selectSendDateFn" defaultShowName="发货时间" />
-					<DateSelect ref="billDateSelect" class="bar date-filter-gap" top="0" @selectDateFn="selectDateFn" defaultShowName="入库时间" />
+					<DateSelect ref="billDateSelect" class="bar date-filter-gap" top="0" @selectDateFn="selectDateFn" defaultShowName="记账时间" />
 				</view>
 			</view>
 		</view>
@@ -203,7 +203,7 @@ export default {
 				uni.stopPullDownRefresh()
 			})
 		},
-		// 发货时间筛 sendTime,可与入库时间(entryTime)同时生效
+		// 发货时间筛 sendTime,可与记账时间(entryTime)同时生效
 		selectSendDateFn(val){
 			this.sendSearchTime = val.searchTime
 			this.sendStartTime = val.startTime
@@ -407,7 +407,7 @@ export default {
 				margin-left: 24upx;
 			}
 			.date-reset-text {
-				margin-right: 16upx;
+				margin-right: 25upx;
 				font-size: 26upx;
 				color: #3385FF;
 				flex-shrink: 0;

+ 2 - 2
ghsApp/src/pagesGys/detailsItem.vue

@@ -25,7 +25,7 @@
 				<view class="price" style="color:#3385FF;">
 					<text :class="[hasPartialClear ? 'price-del' : '']">¥{{ parseFloat(displayDebtPrice) }}</text>
 				</view>
-				<!-- 发货时间与账时间(entryTime)不完全相同时才贴右侧 -->
+				<!-- 发货时间与账时间(entryTime)不完全相同时才贴右侧 -->
 				<view v-if="showSendTime" class="send-date">发货时间 {{ info.sendTime.substr(2, 14) }}</view>
 			</view>
 			<!-- 售后退款单独成行,不与挂账价格挤在同一行 -->
@@ -85,7 +85,7 @@ export default {
 			return this.displayDebtPrice > this.remainDebtPrice
 		},
 		/**
-		 * 金额行右侧发货时间:sendTime 有效,且与账时间 entryTime(含时分秒)不完全相同才展示。
+		 * 金额行右侧发货时间:sendTime 有效,且与账时间 entryTime(含时分秒)不完全相同才展示。
 		 */
 		showSendTime() {
 			const send = this.info.sendTime

+ 5 - 5
ghsApp/src/pagesPurchase/order.vue

@@ -1,6 +1,6 @@
 <!--
   供货商采购入库单列表。
-  顶栏:搜索 + 采购人;筛选条:发货时间、账时间(入库日 entryTime)两套 DateSelect + 重置。
+  顶栏:搜索 + 采购人;筛选条:发货时间、账时间(入库日 entryTime)两套 DateSelect + 重置。
   日历不嵌进列表滚动区,避免 App 端被订单卡片盖住。
 -->
 <template>
@@ -72,8 +72,8 @@
 </template>
 <script>
 /**
- * 采购入库列表页:按状态 Tab + 发货/账时间筛选拉 /purchase-order/list。
- * 账时间对应 xhGhsCgOrder.entryTime(入库/记账日);发货时间对应 sendTime。
+ * 采购入库列表页:按状态 Tab + 发货/账时间筛选拉 /purchase-order/list。
+ * 账时间对应 xhGhsCgOrder.entryTime(入库/记账日);发货时间对应 sendTime。
  */
 import Tabs from "@/components/plugin/tabs";
 import OrderItem from "./orderItem";
@@ -218,7 +218,7 @@ export default {
 				that.getCgList()
 			},700)
 		},
-		// 账时间筛入库日 entryTime,可与发货时间同时生效
+		// 账时间筛入库日 entryTime,可与发货时间同时生效
 		selectBillDateFn(val) {
 			this.searchTime = val.searchTime
 			this.startTime = val.startTime
@@ -226,7 +226,7 @@ export default {
 			this.resetList();
 			this.getCgList();
 		},
-		// 发货时间筛 sendTime,可与账时间同时生效
+		// 发货时间筛 sendTime,可与账时间同时生效
 		selectSendDateFn(val) {
 			this.sendSearchTime = val.searchTime
 			this.sendStartTime = val.startTime

+ 56 - 5
hdApp/src/admin/stat/profit.vue

@@ -1,7 +1,24 @@
+<!--
+  经营利润(花店):与 ghs 共用 /stat/profit。
+  时间维度:记账时间(销售/支出 payTime、采购 entryTime)与发货时间(销售/采购/支出 sendTime),共用同一 DateSelect。
+-->
 <template>
 <view class="app-content">
 	<view class="ex-page">
 		<view class="top-bar">
+			<!-- 记账时间 / 发货时间:只切换筛字段,不另开时间选择器 -->
+			<view class="time-type-row">
+				<view
+					class="time-type-item"
+					:class="{ active: params.timeType === 'bill' }"
+					@click="changeTimeType('bill')"
+				>记账时间</view>
+				<view
+					class="time-type-item"
+					:class="{ active: params.timeType === 'send' }"
+					@click="changeTimeType('send')"
+				>发货时间</view>
+			</view>
 			<DateSelect class="bar" top="0" @selectDateFn="selectDateFn" />
 		</view>
 		<scroll-view scroll-y scroll-with-animation class="main-view">
@@ -79,6 +96,8 @@ export default {
 				startTime: "",
 				endTime: "",
 				shopId: "",
+				// bill=记账时间(默认) / send=发货时间
+				timeType: 'bill',
 			},
 			profit:[],
 		};
@@ -106,6 +125,14 @@ export default {
 			this.params = {...this.params,...val}
 			this.init();			
 		},
+		/** 切换记账时间 / 发货时间,刷新利润 */
+		changeTimeType(type) {
+			if (this.params.timeType === type) {
+				return
+			}
+			this.params.timeType = type
+			this.init()
+		},
 		async init() {
 			this._list();
 		},
@@ -128,20 +155,44 @@ export default {
 		position: absolute;
 		left: 0;
 		display: flex;
+		align-items: center;
 		width: 100%;
 		top:20upx;
 		z-index: 20;
+		padding: 0 16upx;
+		box-sizing: border-box;
+		.time-type-row {
+			display: flex;
+			align-items: center;
+			flex-shrink: 0;
+			margin-right: 12upx;
+		}
+		.time-type-item {
+			height: 56upx;
+			line-height: 56upx;
+			padding: 0 18upx;
+			font-size: 26upx;
+			color: #666;
+			background: #f5f5f5;
+			border-radius: 8upx;
+			margin-right: 10upx;
+			&:last-child {
+				margin-right: 0;
+			}
+			&.active {
+				color: #fff;
+				background: #3385ff;
+			}
+		}
 		.bar{
-			width: 50%;
+			flex: 1;
+			min-width: 0;
 			height: 100%;
 			text-align: center;
-			&:nth-child(1){
-				border-right: 1upx solid #eeeeec;
-			}
 		}
 	}
 	.main-view {
-		margin-top: 80upx;
+		margin-top: 90upx;
 		flex: 1;
 		background-color: #f9fbfc;
 		.space-view {

+ 1 - 1
hdApp/src/pagesPurchase/shopping.vue

@@ -185,7 +185,7 @@ export default {
       this.getMyPurchase()
 		},
 		/**
-		 * 切换开单 / 发货 / 账时间筛选,列表排序跟着当前类型走。
+		 * 切换开单 / 发货 / 账时间筛选,列表排序跟着当前类型走。
 		 */
 		onSelectTimeType(type) {
 			if (this.searchTimeType === type) {