浏览代码

对账单

chenrui 2 年之前
父节点
当前提交
2e230c8a78

+ 1 - 1
App.vue

@@ -7,7 +7,7 @@
 			token: '',
 			changeOrg:'',
 			version: '', // 当前版本号
-			buildType: 'uat', // 打包环境对应类型,pro 生产 uat 预发布 dev 本地开发
+			buildType: 'dev', // 打包环境对应类型,pro 生产 uat 预发布 dev 本地开发
 			envTips: '', // 环境文字提示
 			theme: 'default', // 主题,default
 			isIphoneXup: false //是否iphonex以及以上的版本

+ 55 - 0
api/verify.js

@@ -0,0 +1,55 @@
+import axios from '@/libs/axios.js'
+
+//  应收对账单 - 分页查询客户列表数据
+export const queryCustomerPage = (params) => {
+  const url = `verify/queryCustomerPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+//应收对账单 - 查找客户待结算订单列表
+export const queryUnsettleSaleList = (params) => {
+  const url = `verify/queryUnsettleSaleList`
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+//应收对账单 - 发送对账单
+export const insert = (params) => {
+  const url = `verify/insert`
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 应收对账单 - 历史对账单
+export const queryPage = (params) => {
+  const url = `verify/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 应收对账单 - 历史对账单详情
+export const findBySn = (params) => {
+  const url = `verify/findBySn`
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 1 - 1
config/index.js

@@ -6,7 +6,7 @@ const getConfig = (theme) => {
 			themePath: 'default',
 			pro_URL: 'https://iscm.360arrow.com/qpls-md/', // 生产地址
 			uat_URL: 'http://p.iscm.360arrow.com/qpls-md/', // 预发布地址
-			dev_URL: 'http://192.168.0.182:8503/qpls-md/', // 本地地址
+			dev_URL: 'http://192.168.0.215:8503/qpls-md/', // 本地地址
 			appName: 'iSCM智慧供应链', // app 名称
 			company: '陕西山海高科信息技术有限公司',
 			loadText:{

+ 236 - 135
libs/getDate.js

@@ -1,139 +1,240 @@
 // 引入 moment 时间插件
 import moment from 'moment'
-moment.updateLocale('en', { week: {
-  dow: 1, // 星期的第一天是星期一
-  doy: 7 // 年份的第一周必须包含1月1日 (7 + 1 - 1)
-} })
+moment.updateLocale('en', {
+	week: {
+		dow: 1, // 星期的第一天是星期一
+		doy: 7 // 年份的第一周必须包含1月1日 (7 + 1 - 1)
+	}
+})
 // 获取今日/昨日/本周/上周/本月/上月 时间
 export default {
-  // 获取今日的开始结束时间
-  getToday () {
-    const obj = {
-      starttime: '',
-      endtime: ''
-    }
-    obj.starttime = moment(moment().startOf('day').valueOf()).format('YYYY-MM-DD 00:00:00')
-    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD 23:59:59')
-    return obj
-  },
-  // 获取今日的开始结束时间  年月日时分秒
-  getTodayTime () {
-    const obj = {
-      starttime: '',
-      endtime: ''
-    }
-    obj.starttime = moment(moment().startOf('day').valueOf()).format('YYYY-MM-DD HH:mm:ss')
-    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD HH:mm:ss')
-    return obj
-  },
-  //  近7天
-  getRecentday () {
-    const obj = {
-      starttime: '',
-      endtime: ''
-    }
-    obj.starttime = moment().subtract('days', 6).format('YYYY-MM-DD 00:00:00')
-    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD 23:59:59')
-    return obj
-  },
-  //  近7天  年月日时分秒
-  getRecentTime () {
-    const obj = {
-      starttime: '',
-      endtime: ''
-    }
-    obj.starttime = moment().subtract('days', 6).format('YYYY-MM-DD HH:mm:ss')
-    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD HH:mm:ss')
-    return obj
-  },
-  //  近3天
-  getThreeday () {
-    const obj = {
-      starttime: '',
-      endtime: ''
-    }
-    obj.starttime = moment().subtract('days', 2).format('YYYY-MM-DD 00:00:00')
-    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD 23:59:59')
-    return obj
-  },
-  // 获取昨日的开始结束时间
-  getYesterday () {
-    const obj = {
-      starttime: '',
-      endtime: ''
-    }
-    obj.starttime = moment(moment().add(-1, 'days').startOf('day').valueOf()).format('YYYY-MM-DD 00:00:00')
-    obj.endtime = moment(moment().add(-1, 'days').endOf('day').valueOf()).format('YYYY-MM-DD 23:59:59')
-    return obj
-  },
-  // 获取当前周的开始到当天结束时间
-  getCurrWeekDays () {
-    const obj = {
-      starttime: '',
-      endtime: ''
-    }
-    obj.starttime = moment(moment().week(moment().week()).startOf('week').add('days').valueOf()).format('YYYY-MM-DD 00:00:00')
-    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD 23:59:59')
-    return obj
-  },
-  // 获取上一周的开始结束时间
-  getLastWeekDays () {
-    const obj = {
-      starttime: '',
-      endtime: ''
-    }
-    obj.starttime = moment(moment().week(moment().week() - 1).startOf('week').add('days').valueOf()).format('YYYY-MM-DD 00:00:00')
-    obj.endtime = moment(moment().week(moment().week() - 1).endOf('week').add('days').valueOf()).format('YYYY-MM-DD 23:59:59')
-    return obj
-  },
-  // 获取上一月的今天到当月的今天
-  getCurrMonthDays () {
-    const obj = {
-      starttime: '',
-      endtime: ''
-    }
-    obj.starttime = moment(moment().month(moment().month() - 1).valueOf()).format('YYYY-MM-DD 00:00:00')
-    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD 23:59:59')
-    return obj
-  },
-  // 获取当前月的开始到当天结束时间
-  getCurrLastMonthDays () {
-    const obj = {
-      starttime: '',
-      endtime: ''
-    }
-    obj.starttime = moment(moment().month(moment().month()).startOf('month').valueOf()).format('YYYY-MM-DD 00:00:00')
-    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD 23:59:59')
-    return obj
-  },
-  // 获取上一个月的开始结束时间
-  getLastMonthDays () {
-    const obj = {
-      starttime: '',
-      endtime: ''
-    }
-    obj.starttime = moment(moment().month(moment().month() - 1).startOf('month').valueOf()).format('YYYY-MM-DD 00:00:00')
-    obj.endtime = moment(moment().month(moment().month() - 1).endOf('month').valueOf()).format('YYYY-MM-DD 23:59:59')
-    return obj
-  },
-  // 获取三月前的今天到当月的今天
-  getThreeMonthDays () {
-    const obj = {
-      starttime: '',
-      endtime: ''
-    }
-    obj.starttime = moment(moment().month(moment().month() - 3).valueOf()).format('YYYY-MM-DD 00:00:00')
-    obj.endtime = moment(moment().month(moment().month() - 3).endOf('month').valueOf()).format('YYYY-MM-DD 23:59:59')
-    return obj
-  },
-  // 获取近三个月的开始结束时间
-  getThreeMonthCurrDays () {
-    const obj = {
-      starttime: '',
-      endtime: ''
-    }
-    obj.starttime = moment(moment().month(moment().month() - 2).startOf('month').valueOf()).format('YYYY-MM-DD 00:00:00')
-    obj.endtime = moment(moment().month(moment().month() - 2).endOf('month').valueOf()).format('YYYY-MM-DD 23:59:59')
-    return obj
-  }
-}
+	// 获取今日的开始结束时间
+	getToday() {
+		const obj = {
+			starttime: '',
+			endtime: ''
+		}
+		obj.starttime = moment(moment().startOf('day').valueOf()).format('YYYY-MM-DD 00:00:00')
+		obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD 23:59:59')
+		return obj
+	},
+	
+	// 获取今日的开始结束时间  年月日时分秒
+	getTodayTime() {
+		const obj = {
+			starttime: '',
+			endtime: ''
+		}
+		obj.starttime = moment(moment().startOf('day').valueOf()).format('YYYY-MM-DD HH:mm:ss')
+		obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD HH:mm:ss')
+		return obj
+	},
+	//  近7天
+	getRecentday() {
+		const obj = {
+			starttime: '',
+			endtime: ''
+		}
+		obj.starttime = moment().subtract('days', 6).format('YYYY-MM-DD 00:00:00')
+		obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD 23:59:59')
+		return obj
+	},
+	
+	//  近7天  年月日时分秒
+	getRecentTime() {
+		const obj = {
+			starttime: '',
+			endtime: ''
+		}
+		obj.starttime = moment().subtract('days', 6).format('YYYY-MM-DD HH:mm:ss')
+		obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD HH:mm:ss')
+		return obj
+	},
+	//  近3天
+	getThreeday() {
+		const obj = {
+			starttime: '',
+			endtime: ''
+		}
+		obj.starttime = moment().subtract('days', 2).format('YYYY-MM-DD 00:00:00')
+		obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD 23:59:59')
+		return obj
+	},
+	// 获取昨日的开始结束时间
+	getYesterday() {
+		const obj = {
+			starttime: '',
+			endtime: ''
+		}
+		obj.starttime = moment(moment().add(-1, 'days').startOf('day').valueOf()).format('YYYY-MM-DD 00:00:00')
+		obj.endtime = moment(moment().add(-1, 'days').endOf('day').valueOf()).format('YYYY-MM-DD 23:59:59')
+		return obj
+	},
+	// 获取当前周的开始到当天结束时间
+	getCurrWeekDays() {
+		const obj = {
+			starttime: '',
+			endtime: ''
+		}
+		obj.starttime = moment(moment().week(moment().week()).startOf('week').add('days').valueOf()).format(
+			'YYYY-MM-DD 00:00:00')
+		obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD 23:59:59')
+		return obj
+	},
+	// 获取上一周的开始结束时间
+	getLastWeekDays() {
+		const obj = {
+			starttime: '',
+			endtime: ''
+		}
+		obj.starttime = moment(moment().week(moment().week() - 1).startOf('week').add('days').valueOf()).format(
+			'YYYY-MM-DD 00:00:00')
+		obj.endtime = moment(moment().week(moment().week() - 1).endOf('week').add('days').valueOf()).format(
+			'YYYY-MM-DD 23:59:59')
+		return obj
+	},
+	
+	// 获取上一月的今天到当月的今天
+	getCurrMonthDays() {
+		const obj = {
+			starttime: '',
+			endtime: ''
+		}
+		obj.starttime = moment(moment().month(moment().month() - 1).valueOf()).format('YYYY-MM-DD 00:00:00')
+		obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD 23:59:59')
+		return obj
+	},
+	// 获取当前月的开始到当天结束时间
+	getCurrLastMonthDays() {
+		const obj = {
+			starttime: '',
+			endtime: ''
+		}
+		obj.starttime = moment(moment().month(moment().month()).startOf('month').valueOf()).format(
+			'YYYY-MM-DD 00:00:00')
+		obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD 23:59:59')
+		return obj
+	},
+	// 获取上一个月的开始结束时间
+	getLastMonthDays() {
+		const obj = {
+			starttime: '',
+			endtime: ''
+		}
+		obj.starttime = moment(moment().month(moment().month() - 1).startOf('month').valueOf()).format(
+			'YYYY-MM-DD 00:00:00')
+		obj.endtime = moment(moment().month(moment().month() - 1).endOf('month').valueOf()).format(
+			'YYYY-MM-DD 23:59:59')
+		return obj
+	},
+	// 获取三月前的今天到当月的今天
+	getThreeMonthDays() {
+		const obj = {
+			starttime: '',
+			endtime: ''
+		}
+		obj.starttime = moment(moment().month(moment().month() - 3).valueOf()).format('YYYY-MM-DD 00:00:00')
+		obj.endtime = moment(moment().month(moment().month() - 3).endOf('month').valueOf()).format(
+			'YYYY-MM-DD 23:59:59')
+		return obj
+	},
+	// 获取近三个月的开始结束时间
+	getThreeMonthCurrDays() {
+		const obj = {
+			starttime: '',
+			endtime: ''
+		}
+		obj.starttime = moment(moment().month(moment().month() - 2).startOf('month').valueOf()).format(
+			'YYYY-MM-DD 00:00:00')
+		obj.endtime = moment(moment().month(moment().month() - 2).endOf('month').valueOf()).format(
+			'YYYY-MM-DD 23:59:59')
+		return obj
+	},
+	// 获取当前日期前7天日期集合
+	getWeekGather() {
+		let newDate = new Date(); //获取今天日期
+		newDate.setDate(newDate.getDate() - 6); //获取7天前的日期
+		let dateArray = [];
+		let dateTemp;
+		let flag = 1;
+		for (let i = 0; i < 7; i++) {
+			dateTemp = (newDate.getMonth() + 1) + "." + newDate.getDate();
+			dateArray.unshift(dateTemp);
+			newDate.setDate(newDate.getDate() + flag);
+		}
+		return dateArray;
+	},
+	// 获取当前日期前6月集合
+	getMonthGather() {
+		let newDate = new Date(); //获取今天日期
+		let year = newDate.getFullYear()
+		let month = newDate.getMonth() + 1
+		let newYear = 0
+		let newMonth = 0
+		let monthArray = []
+		for (let i = 0; i < 6; i++) { //这里是获取前六个月,所以循环6次,根据需要修改
+			if (month - i < 1) { //这里的判断是如果当前月份往前推到了去年需要做的处理
+				newYear = year - 1
+				newMonth = month - i + 12 >= 10 ? month - i + 12 : '0' + (month - i + 12)
+				monthArray.push(newYear + '.' + newMonth) //这里拼接格式化,在时间中间加了个-,根据实际需求来
+			} else {
+				newMonth = month - i >= 10 ? month - i : '0' + (month - i) //这里是对月份小于10做加前面加0处理
+				monthArray.push(year + '.' + newMonth)
+			}
+		}
+		return monthArray;
+	},
+	//根据所传日期获取当前时间
+	getFullToday(dateInfo) {
+		const obj = {
+			starttime: '',
+			endtime: ''
+		}
+		obj.starttime = moment(dateInfo).startOf("day").format('YYYY-MM-DD 00:00:00')
+		obj.endtime =moment(dateInfo).endOf("day").format('YYYY-MM-DD 23:59:59')
+		return obj
+	},
+	//根据所传日期获取当前月份第一天和最后一天
+	  getFullMonth (month) {
+		const obj = {
+		  starttime: '',
+		  endtime: ''
+		}
+		obj.starttime = moment(month).startOf("month").format('YYYY-MM-DD 00:00:00')
+		obj.endtime = moment(month).endOf("month").format('YYYY-MM-DD 23:59:59')
+		return obj
+	  },
+	  // 获取今日/昨日/本周/上周/本月/上月 年月日时间
+	  getTodayInfo() {
+	  	const date = moment(moment().startOf('day').valueOf()).format('YYYY年MM月DD日')
+	  	return date
+	  },
+	  getYesterdayInfo() {
+	  	date = moment(moment().add(-1, 'days').startOf('day').valueOf()).format('YYYY年MM月DD日')
+	  	return date
+	  },
+	  getCurrWeekDaysInfo() {
+	  	const starttime = moment(moment().week(moment().week()).startOf('week').add('days').valueOf()).format(
+	  		'YYYY年MM月DD日')
+	  	const endtime = moment(moment().valueOf()).format('YYYY年MM月DD日')
+	  	return starttime+ '至'+endtime
+	  },
+	  getLastWeekDaysInfo() {
+	  	const starttime = moment(moment().week(moment().week() - 1).startOf('week').add('days').valueOf()).format(
+	  		'YYYY年MM月DD日')
+	  	const endtime = moment(moment().week(moment().week() - 1).endOf('week').add('days').valueOf()).format(
+	  		'YYYY年MM月DD日')
+	  	return starttime+ '至'+endtime
+	  },
+	  getCurrLastMonthDaysInfo() {
+	  const date = moment(moment().month(moment().month()).startOf('month').valueOf()).format(
+	  		'YYYY年MM月')
+	  	return date
+	  },
+	  getLastMonthDaysInfo() {
+	  	const date= moment(moment().month(moment().month() - 1).startOf('month').valueOf()).format(
+	  		'YYYY年MM月')
+	  	return date
+	  },
+	}
+	

+ 353 - 287
pages/sales/bill.vue

@@ -3,22 +3,22 @@
 		<view class="header">
 			<view class="headerList u-flex">
 				<view class="list_l">
-					<u-icon name="clock" color="#00aaff" size="32"></u-icon>
-					<text>对账周期</text>
-					<u-icon name="question-circle-fill" @click="tipShow = true" :color="wordColor" size="32"></u-icon>
+					<u-icon name="account" color="#00aaff" size="32"></u-icon>
+					<text>客户名称</text>
 				</view>
 				<view class="list_r u-flex">
-					<u-input v-model="brandName" @click="showSearch=true" disabled placeholder="请选择对账日期"  />
+					<u-input v-model="customerObj.customerName" @click="jumpPage('/pages/sales/chooseCustomerBill')" disabled placeholder="请选择客户名称" />
 					<u-icon name="arrow-right" color="#999" size="30"></u-icon>
 				</view>
 			</view>
 			<view class="headerList u-flex">
 				<view class="list_l">
-					<u-icon name="account" color="#00aaff" size="32"></u-icon>
-					<text>客户名称</text>
+					<u-icon name="clock" color="#00aaff" size="32"></u-icon>
+					<text>对账周期</text>
+					<u-icon name="question-circle-fill" @click="tipShow = true" :color="wordColor" size="32"></u-icon>
 				</view>
 				<view class="list_r u-flex">
-					<u-input v-model="brandName" @click="jumpPage('/pages/sales/chooseCustomerBill')" disabled placeholder="请选择客户名称"  />
+					<u-input v-model="cycleName" @click="showSearch = true" disabled placeholder="请选择对账日期" />
 					<u-icon name="arrow-right" color="#999" size="30"></u-icon>
 				</view>
 			</view>
@@ -26,36 +26,37 @@
 		<view class="statistical u-flex">
 			<view class="statisticalList">
 				<text>总单数:</text>
-				<text>34</text>
+				<text>{{bill.length}}</text>
 			</view>
 			<view class="statisticalList">
 				<text>待收金额合计:</text>
-				<text>¥123456.08</text>
+				<text>¥{{totalPayPrice}}</text>
 			</view>
 		</view>
-		<view class="chooseCon">
-			<billList :showCheck="true"></billList>
-		</view>
+		<view class="chooseCon"><billList ref="bill" :showCheck="true" :list="bill"></billList></view>
 		<view class="footer u-flex">
 			<view class="f-left">
-				<u-checkbox  @change="allCheckeChange" v-model="allChecked" shape="circle">{{allChecked?'取消全选':'全选'}}</u-checkbox>
+				<u-checkbox @change="allCheckeChange" v-model="allChecked" shape="circle">{{ allChecked ? '取消全选' : '全选' }}</u-checkbox>
 			</view>
-			<view class="f-mid" @click="isDetailShow=!isDetailShow">
-				<view class="u-flex">
-					<view>待收:<text>¥80.00</text></view>
-					<view style="margin-left: 6rpx;">/ 折后:<text>¥80.00</text></view>
+			<view class="f-mid" @click="isDetailShow = !isDetailShow">
+				<view>
+					待收:
+					<text>¥{{chooseTotalPayPrice}}</text>
+				</view>
+				<view>
+					折后:
+					<text>¥{{settlement}}</text>
 				</view>
 				<view class="u-flex">
 					<view>
-						折让:<text>¥0.00</text>
-					</view>
-					<view class="costBtn" @click="costShow= true">
-						打折
+						折让:
+						<text>¥{{discountVal || 0}}</text>
 					</view>
+					<view class="costBtn" @click="costShow = true">打折</view>
 				</view>
 			</view>
 			<view class="f-btns">
-				<u-button size="medium" @click="submitOrder" :custom-style="customBtnStyle" shape="circle" type="primary" hover-class="none" >发送对账单</u-button>
+				<u-button size="medium" @click="submitOrder" :custom-style="customBtnStyle" shape="circle" type="primary" hover-class="none">发送对账单</u-button>
 			</view>
 		</view>
 		<!-- 对账周期弹窗 -->
@@ -63,12 +64,11 @@
 			<view class="tabBox">
 				<view class="tabs">
 					<view class="flex">
-						<view :class="item.val==curTab?'active':'all'" v-for="item in placeTab" :key="item.val" @click="tabChange(item)">{{item.name}}</view>
+						<view :class="item.val == curTab ? 'active' : 'all'" v-for="item in placeTab" :key="item.val" @click="tabChange(item)">{{ item.name }}</view>
 					</view>
 				</view>
 				<view class="flex align_center form-item-inp" style="padding: 0 30rpx;" v-if="curTab == 6">
-					<u-input clearable v-model="dateArray" disabled placeholder="请选择时间段" @click="showDate=true" />
-					<u-icon name="arrow-down" color="#999"></u-icon>
+					<u-input clearable v-model="dateArray" disabled placeholder="请选择时间段" input-align="center" @click="showDate = true" />
 				</view>
 				<view class="form-footer-btn">
 					<u-button class="handle-btn" shape="circle" size="medium" hover-class="none" @click="handleClean">重置</u-button>
@@ -79,28 +79,23 @@
 		<!-- 选择日期范围 -->
 		<u-calendar v-model="showDate" ref="rangeDate" @change="dateChange" mode="range"></u-calendar>
 		<!-- 打折弹窗 -->
-		<u-popup v-model="costShow" mode="center" :border-radius="20" closeable width="80%">
+		<u-popup v-model="costShow" mode="center" :border-radius="20" closeable width="82%">
 			<view class="costPopup">
-				<view class="costPopupTit">
-					东莞市京步车证汽车服务中心
-				</view>
+				<view class="costPopupTit">东莞市京步车证汽车服务中心</view>
 				<view class="costPopupCon">
 					<view class="costList">
 						<text class="label">待收金额:</text>
-						<text>¥527.00</text>
+						<text>¥{{totalPayPrice}}</text>
 					</view>
 					<view class="costList u-flex">
 						<view class="label">折让金额:</view>
-						<u-input v-model="value" type="number" :border="true" :height="50"/>
-					</view>
-					<view class="costText">
-						折让后金额
-					</view>
-					<view class="costText">
-						¥500.00
+						<u-input v-model="discountVal" @input="onKeyInput" :border="true" :height="50"/>
 					</view>
+					<view class="tip" v-if="discountVal>totalPayPrice">折让金额不能大于待收金额,请重新输入</view>
+					<view class="costText">折让后金额</view>
+					<view class="costText">¥{{settlement}}</view>
 				</view>
-				<u-button type="primary" :custom-style="customStyle" shape="circle">确定</u-button>
+				<u-button type="primary" :custom-style="customStyle" shape="circle" @click="handleDisCount">确定</u-button>
 			</view>
 		</u-popup>
 		<!-- 对账周期弹窗 -->
@@ -109,289 +104,360 @@
 </template>
 
 <script>
-	import billList from './billListComponent.vue'
-	export default {
-		components: { billList },
-		data() {
-			return {
-				params:{//配置时间选项
-					year: true,
-					month: true,
-					day: true,
-					hour: false,
-					minute: false,
-					second: false
+import billList from './billListComponent.vue';
+import { queryUnsettleSaleList,insert } from '@/api/verify.js';
+import getDate from '@/libs/getDate.js';
+export default {
+	components: { billList },
+	data() {
+		return {
+			customBtnStyle: {
+				//  自定义按钮样式
+				borderColor: this.$config('primaryColor'),
+				backgroundColor: this.$config('primaryColor'),
+				color: '#fff',
+				width: '180rpx'
+			},
+			wordColor: this.$config('infoColor'),
+			customStyle: {
+				borderColor: this.$config('primaryColor'),
+				backgroundColor: this.$config('primaryColor'),
+				color: '#fff'
+			},
+			allChecked: false,
+			tipShow: false,
+			discountVal: null,//折让金额
+			tipContent: `账单周期指销售单的创建时间`,
+			placeTab: [
+				{
+					name: '今日',
+					val: '0'
 				},
-				checked:true,
-				brandName:'',
-				timeShow:false,
-				customerShow:false,
-				customBtnStyle: {  //  自定义按钮样式
-					borderColor: this.$config('primaryColor'),
-					backgroundColor: this.$config('primaryColor'),
-					color: '#fff',
-					width:'180rpx'
+				{
+					name: '昨日',
+					val: '1'
 				},
-				wordColor:this.$config('infoColor'),
-				customStyle:{
-					borderColor: this.$config('primaryColor'),
-					backgroundColor: this.$config('primaryColor'),
-					color: '#fff',
+				{
+					name: '本周',
+					val: '2'
 				},
-				allChecked:false,
-				tipShow:false,
-				value:'',
-				tipContent:`账单周期指销售单的创建时间`,
-				placeTab: [
-					{
-						name:'今日',
-						val: '0'
-					},
-					{
-						name:'昨日',
-						val: '1'
-					},
-					{
-						name:'本周',
-						val: '2'
-					},
-					
-					{
-						name:'上周',
-						val: '3'
-					},
-					{
-						name:'本月',
-						val: '4'
-					},
-					{
-						name:'上月',
-						val: '5'
-					},
-					{
-						name:'自定义',
-						val: '6'
-					}
-				],
-				curTab: '4',
-				showSearch:false,
-				showDate:false,
-				costShow:false
+
+				{
+					name: '上周',
+					val: '3'
+				},
+				{
+					name: '本月',
+					val: '4'
+				},
+				{
+					name: '上月',
+					val: '5'
+				},
+				{
+					name: '自定义',
+					val: '6'
+				},
+				{
+					name: '全部',
+					val: '7'
+				}
+			],
+			curTab: '0',
+			
+			showSearch: false,
+			showDate: false,
+			costShow: false,
+			
+			customerObj: {
+				customerName: null
+			},
+			cycleName: '',
+			
+			params: {
+				targetSn: '437705264826884096',
+				bizBeginDate: undefined,
+				bizEndDate: undefined
+			},
+			bill: [],
+			dateArray:''
+		};
+	},
+	onReady() {
+		uni.setNavigationBarColor({
+			frontColor: '#ffffff',
+			backgroundColor: this.$config('primaryColor')
+		});
+	},
+	onLoad(options) {
+		//获取对账周期默认值
+		let systemList = this.$store.state.vuex_systemSetList;
+		let cycleObj = systemList.find(item => {
+			return item.remarks == 'sales_bill_period';
+		});
+		this.curTab = this.placeTab.findIndex(con => con.name == cycleObj.valueShow);
+		this.cycleName = this.changeShowTime();
+		// 获取选择客户
+		if (options && options.data) {
+			this.customerObj = JSON.parse(options.data);
+			// this.params.targetSn = this.customerObj.customerSn;
+		}
+		this.changeTime();
+	},
+	onNavigationBarButtonTap() {
+		uni.navigateTo({
+			url: '/pages/sales/billHistory'
+		});
+	},
+	onBackPress() {
+		if (this.showSearch) {
+			this.showSearch = false;
+			return true;
+		}
+	},
+	computed: {
+		totalPayPrice() {
+			let totalPrice = 0;
+			for (let i = 0; i < this.bill.length; i++) {
+				this.bill[i].unsettleAmount = this.bill[i].unsettleAmount ? this.bill[i].unsettleAmount :0
+				totalPrice += this.bill[i].unsettleAmount;
+			}
+			return totalPrice || 0;
+		},
+		// settlement(){
+		// 	return this.totalPayPrice - this.discountVal || 0;
+		// }
+	},
+	methods: {
+		changeTime() {
+			if (this.curTab != 6 && this.curTab != 7) {
+				this.params.bizBeginDate = this.getQueryDate().beginDate;
+				this.params.bizEndDate = this.getQueryDate().endDate;
+				this.cycleName = this.changeShowTime();
+			}else if(this.curTab == 7){
+				this.cycleName = this.placeTab[this.curTab].name;
+				this.params.bizBeginDate = undefined;
+				this.params.bizEndDate = undefined;
+			}else{
+				this.dateArray = ''
+			}
+			this.getList();
+		},
+		getList() {
+			const _this = this;
+			queryUnsettleSaleList(this.params).then(res => {
+				if (res.status == 200) {
+					this.bill = res.data;
+					this.$refs.bill.setData(res.data);
+				}
+			});
+		},
+		// 时间  change
+		dateChange(date) {
+			this.dateArray = date.startDate + ' ~ ' + date.endDate;
+			this.params.bizBeginDate = date.startDate + ' 00:00:00';
+			this.params.bizEndDate = date.endDate + ' 23:59:59';
+			this.cycleName=date.startDate + '至' + date.endDate;
+		},
+		// 更改日期格式显示
+		changeShowTime(){
+			const fun = [getDate.getTodayInfo, getDate.getYesterdayInfo, getDate.getCurrWeekDaysInfo, getDate.getLastWeekDaysInfo, getDate.getCurrLastMonthDaysInfo, getDate.getLastMonthDaysInfo];
+			return fun[this.curTab]();
+		},
+		tabChange(data) {
+			this.curTab = data.val;
+		},
+		getQueryDate() {
+			const fun = [getDate.getToday, getDate.getYesterday, getDate.getCurrWeekDays, getDate.getLastWeekDays, getDate.getCurrLastMonthDays, getDate.getLastMonthDays];
+			return {
+				beginDate: fun[this.curTab]().starttime,
+				endDate: fun[this.curTab]().endtime
 			};
 		},
-		onReady() {
-			uni.setNavigationBarColor({
-				frontColor: '#ffffff',
-				backgroundColor: this.$config('primaryColor')
-			})
+		handleSearch() {
+			this.showSearch = false;
+			this.changeTime();
 		},
-		onNavigationBarButtonTap() {
-			// this.showSearch = true
+		jumpPage(url) {
 			uni.navigateTo({
-				url:'/pages/sales/billHistory'
-			})
+				url
+			});
 		},
-		onBackPress() {
-			if(this.showSearch){
-				this.showSearch = false
-				return true
-			}
+		handleDisCount(){
+			this.costShow = false
 		},
-		methods:{
-			// 时间  change
-			dateChange(date){
-				this.dateArray = date.startDate + ' ~ ' + date.endDate
-				this.queryPramas.beginDate = date.startDate + ' 00:00:00'
-				this.queryPramas.endDate = date.endDate + ' 23:59:59'
-				//#ifdef APP-PLUS
-				this.webView.setTitleNViewButtonStyle(0, {
-					"text":"\ue626 "+date.startDate.substr(5)+"至"+date.endDate.substr(5),
-					"color": "#00aaff",
-					"width": "130px"
-				});
-				//#endif
-			},
-			tabChange(data){
-				this.curTab = data.val
-				if(data.val != 6){
-					//#ifdef APP-PLUS
-					this.webView.setTitleNViewButtonStyle(0, {
-						"text":"\ue626 "+data.name,
-						"color": "#00aaff",
-						"width": "80px"
-					});
-					//#endif
-				}else{
-					this.dateArray = ''
-					this.queryPramas.beginDate = ''
-					this.queryPramas.endDate = ''
-				}
-			},
-			jumpPage(url){
-				uni.navigateTo({
-					url
-				})
-			}
+		submitOrder(){//发送对账单
+			
+		},
+		allCheckeChange(){
+			this.$refs.bill.allSelect(e.value)
+			const list = this.$refs.bill.getAllData()
 		}
 	}
+};
 </script>
 
 <style lang="scss" scoped>
-	.content{
+.content {
+	width: 100%;
+	height: 100vh;
+	.header {
 		width: 100%;
-		height: 100vh;
-		.header{
+		.headerList {
 			width: 100%;
-			.headerList{
-				width: 100%;
-				box-sizing: border-box;
-				padding:16rpx 20rpx;
-				background: #fff;
-				&:last-child{
-				border-top:1rpx solid #e4e7ed;	
-				}
-				.list_l{
-					width:208rpx;
-					text{
-						font-size: 28rpx;
-						color: #666666;
-						margin-left: 10rpx;
-						margin-right: 10rpx;
-					}
-				}
-				.list_r{
-					width: calc(100% - 208rpx);
-				}
+			box-sizing: border-box;
+			padding: 16rpx 20rpx;
+			background: #fff;
+			&:last-child {
+				border-top: 1rpx solid #e4e7ed;
 			}
-		}
-			.statistical{
-				padding:20rpx;
-				background: #fff;
-				margin:10rpx 0;
-				.statisticalList{
-				&:first-child{
-					width: 210rpx;
-				}
-				}
-				text{
-					&:last-child{
-						color:$uni-color-warning;
-						font-weight: 600;
-					}
+			.list_l {
+				width: 208rpx;
+				text {
+					font-size: 28rpx;
+					color: #666666;
+					margin-left: 10rpx;
+					margin-right: 10rpx;
 				}
 			}
-			.chooseCon{
-				flex-grow: 1;
-				overflow: auto;
-				background-color: #fff;
+			.list_r {
+				width: calc(100% - 208rpx);
 			}
-		.footer{
-			background-color: #f8f8f8;
-			padding: 20rpx;
-			.f-mid{
-				flex-grow: 1;
-				color: #666;
-				font-size: 0.8rem;
-				> view{
-					&:first-child{
-						text{
-							color: $uni-color-warning;
-							vertical-align: middle;
-						}
-					}
-					&:last-child{
-						text{
-							color: $uni-color-primary;
-							vertical-align: middle;
-						}
-					}
-				}
-				.costBtn{
-					width:70rpx;
-					height: 40rpx;
-					line-height: 40rpx;
-					text-align: center;
-					color:#fff;
-					font-size: 20rpx;
-					border-radius: 30rpx;
-					background: #999;
-					margin-left: 20rpx;
-				}
+		}
+	}
+	.statistical {
+		padding: 20rpx;
+		background: #fff;
+		margin: 10rpx 0;
+		.statisticalList {
+			&:first-child {
+				width: 210rpx;
 			}
 		}
-		// 历史对账单弹窗
-		.tabBox{
-			height: 100vh;
-			.tabs{
-				flex-grow: 1;
-				overflow: auto;
-				padding: 20rpx;
-				> view{
-					flex-wrap: wrap;
-					justify-content: space-between;
-					> view{
-						width: 45%;
-						border: 1rpx solid #eee;
-						padding: 15rpx;
-						border-radius: 50rpx;
-						text-align: center;
-						margin-bottom: 15rpx;
+		text {
+			&:last-child {
+				color: $uni-color-warning;
+				font-weight: 600;
+			}
+		}
+	}
+	.chooseCon {
+		flex-grow: 1;
+		overflow: auto;
+		background-color: #fff;
+	}
+	.footer {
+		background-color: #f8f8f8;
+		padding:10rpx 20rpx;
+		.f-mid {
+			flex-grow: 1;
+			color: #666;
+			font-size: 0.8rem;
+			> view {
+				&:first-child {
+					text {
+						color: $uni-color-warning;
+						vertical-align: middle;
 					}
-					.active{
-						border:0;
-						background-color: #0485F6;
-						color: #fff;
+				}
+				&:last-child {
+					text {
+						color: $uni-color-primary;
+						vertical-align: middle;
 					}
 				}
 			}
-			.form-item-inp{
-				border-bottom: 1rpx solid #eee;
+			.costBtn {
+				width: 70rpx;
+				height: 40rpx;
+				line-height: 40rpx;
+				text-align: center;
+				color: #fff;
+				font-size: 20rpx;
+				border-radius: 30rpx;
+				background: #999;
+				margin-left: 20rpx;
 			}
-			.form-footer-btn{
-				margin: 30upx;
-				display: flex;
+		}
+	}
+	// 历史对账单弹窗
+	.tabBox {
+		height: 100vh;
+		.tabs {
+			flex-grow: 1;
+			overflow: auto;
+			padding: 20rpx;
+			> view {
+				flex-wrap: wrap;
 				justify-content: space-between;
-			}
-			.form-footer-btn {
-				display: flex;
-				.handle-btn {
-					font-size: 28upx;
-					margin: 0 10upx;
-					flex: 1;
+				> view {
+					width: 45%;
+					border: 1rpx solid #eee;
+					padding: 15rpx;
+					border-radius: 50rpx;
+					text-align: center;
+					margin-bottom: 15rpx;
+				}
+				.active {
+					border: 0;
+					background-color: #0485f6;
+					color: #fff;
 				}
 			}
 		}
-		//打折弹窗
-		.costPopup{
-			padding:26rpx 20rpx 40rpx;
-			box-sizing: border-box;
-			.costPopupTit{
-				text-align: center;
-				font-weight: bold;
+		.form-item-inp {
+			border-bottom: 1rpx solid #eee;
+		}
+		.form-footer-btn {
+			margin: 30upx;
+			display: flex;
+			justify-content: space-between;
+		}
+		.form-footer-btn {
+			display: flex;
+			.handle-btn {
+				font-size: 28upx;
+				margin: 0 10upx;
+				flex: 1;
 			}
-			.costPopupCon{
-				margin-top:40rpx;
-				.costList{
-					margin-bottom:20rpx;
-					.label{
-						color: $uni-text-color-grey;
-					}
-				}
-				.costText{
-					text-align: center;
+		}
+	}
+	//打折弹窗
+	.costPopup {
+		padding: 26rpx 20rpx 40rpx;
+		box-sizing: border-box;
+		.costPopupTit {
+			text-align: center;
+			font-weight: bold;
+		}
+		.costPopupCon {
+			margin-top: 40rpx;
+			.costList {
+				margin-bottom: 20rpx;
+				.label {
 					color: $uni-text-color-grey;
-					font-size: 22rpx;
-					margin-top:40rpx;
-					&:last-child{
-						font-weight: bold;
-						color:$uni-color-error;
-						font-size: 32rpx;
-						line-height: 60rpx;
-						margin-top:0rpx;
-						margin-bottom: 50rpx;
-					}
+				}
+			}
+			.tip{
+				color: $uni-color-error;
+				font-size: 20rpx;
+				text-align: right;
+			}
+			.costText {
+				text-align: center;
+				color: $uni-text-color-grey;
+				font-size: 22rpx;
+				margin-top: 40rpx;
+				&:last-child {
+					font-weight: bold;
+					color: $uni-color-error;
+					font-size: 32rpx;
+					line-height: 60rpx;
+					margin-top: 0rpx;
+					margin-bottom: 50rpx;
 				}
 			}
 		}
 	}
-</style>
+}
+</style>

+ 55 - 5
pages/sales/billHistory.vue

@@ -4,10 +4,10 @@
 			<text>{{ curCustomerName || '全部客户' }}</text>
 			<u-icon name="arrow-right"></u-icon>
 		</view>
-		<view class="p-content">
-			<view class="list" @click="jumpPage('/pages/sales/billHistoryDetail')">
+		<view class="p-content" v-if="billList && billList.length>0">
+			<view class="list" @click="jumpPage('/pages/sales/billHistoryDetail?billId='+item.verifySn)" v-for="(item,i) in billList" :key="i">
 				<view class="list_t u-flex u-row-between">
-					<view class="u-line-1">东莞市寮步车正汽车服务中心东莞市寮步车正汽车服务中心</view>
+					<view class="u-line-1">{{item.curCustomerName}}</view>
 					<view>¥526.88</view>
 				</view>
 				<view class="list_b u-flex u-row-between">
@@ -19,26 +19,76 @@
 				</view>
 			</view>
 		</view>
+		<view v-if="billList&&billList.length==0">
+			<u-empty v-if="status!='loading'" :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="180" :text="noDataText" mode="list" :margin-top="50"></u-empty>
+		</view>
+		<view style="padding: 20upx;" v-else>
+			<u-loadmore :status="status" />
+		</view>
 	</view>
 </template>
 
 <script>
+	import { queryPage } from '@/api/verify.js';
 	export default {
 		data(){
 			return {
 				wordColor:this.$config('infoColor'),
-				curCustomerName:''
+				curCustomerName:'',
+				pageNo: 1,
+				pageSize: 10,
+				totalNum: 0,
+				status: 'loadmore',
+				noDataText: '暂无数据',
+				billList:[],
+				targetSn:null
 			}
 		},
 		onLoad() {
-			
+			uni.$on('chooseShelfOk',(info)=>{
+				if(info){
+					this.pageNo=1;
+					this.targetSn = info.targetSn
+					this.curCustomerName=info.customerName
+				}
+			})
+			this.getList();
 		},
 		methods:{
 			jumpPage(url){
 				uni.navigateTo({
 					url
 				})
+			},
+			getList(){
+				const _this = this;
+				let params = {targetSn:this.targetSn, pageNo: this.pageNo, pageSize: this.pageSize };
+				this.status = 'loading';
+				queryPage(params).then(res => {
+					if (res.status == 200) {
+						if (this.pageNo > 1) {
+							this.billList = this.billList.concat(res.data.list || []);
+						} else {
+							this.billList = res.data.list || [];
+						}
+						this.totalNum = res.data.count || 0;
+					} else {
+						this.billList = [];
+						this.totalNum = 0;
+						this.noDataText = res.message;
+					}
+					this.status = 'loadmore';
+				});
 			}
+		},
+		onReachBottom() {
+			if (this.billList.length < this.totalNum) {
+				this.pageNo += 1;
+				this.getList();
+			}
+		},
+		onUnload(){
+			uni.$off('chooseShelfOk')
 		}
 	}
 </script>

+ 21 - 1
pages/sales/billHistoryDetail.vue

@@ -50,7 +50,8 @@
 </template>
 
 <script>
-	import billList from './billListComponent.vue'
+import billList from './billListComponent.vue'
+import { findBySn,insert } from '@/api/verify.js';
 export default {
 	components: { billList },
 	data() {
@@ -58,6 +59,9 @@ export default {
 			customStyle:{
 				backgroundColor: this.$config('primaryColor'),
 				color: '#fff',
+				verifySn:'',
+				billInfo:{},
+				billList:[]
 			},
 		};
 	},
@@ -66,6 +70,22 @@ export default {
 			frontColor: '#ffffff',
 			backgroundColor: this.$config('primaryColor')
 		});
+	},
+	onLoad(options) {
+		if(options && options.billId){
+			this.verifySn=options.billId
+			this.loadData()
+		}
+	},
+	methods:{
+		loadData(){
+			queryPage({verifySn:this.verifySn}).then(res => {
+				if (res.status == 200) {
+					this.billInfo=res.data;
+					this.billList=res.data.list;
+				}
+			});
+		}
 	}
 };
 </script>

+ 45 - 12
pages/sales/billListComponent.vue

@@ -1,33 +1,36 @@
 <template>
 	<view class="bill-list-component">
-		<view class="chooseList u-flex" @click="jumpPage('/pages/sales/salesDetail')">
-			<view class="checkbox" v-show="showCheck"><u-checkbox v-model="checked" name="productSn" @change="checkChange" size="40" shape="circle"></u-checkbox></view>
-			<view class="choose_r">
+		<view class="chooseList u-flex" v-for="(item,index) in listData" :key="item.bizSn">
+			<view class="checkbox" v-show="showCheck"><u-checkbox v-model="item.checked" name="item.bizSn" @change.stop="checkChange" size="40" shape="circle"></u-checkbox></view>
+			<view class="choose_r" @click="jumpPage('/pages/sales/salesDetail?salesBillId='+item.bizSn)" >
 				<view class="u-flex u-row-between">
 					<view class="billInfo u-flex">
-						<text>2022-11-23</text>
-						<view>待出库</view>
-						<view>数字货架</view>
+						<text>{{item.bizDate.substr(0,10)}}</text>
+						<view v-if="item.bizStatusDictValue">{{item.bizStatusDictValue}}</view>
+						<view v-if="item.bizSourceTypeDictValue">{{item.bizSourceTypeDictValue}}</view>
 					</view>
-					<view class="billOrder">XS211230001</view>
+					<view class="billOrder">{{item.bizNo}}</view>
 				</view>
 				<view class="rigth_b u-flex u-row-between">
-					<view>应收:¥12.00</view>
-					<view>已收:¥12.00</view>
+					<view>应收:¥{{item.bizAmount ||0}}</view>
+					<view>已收:¥{{item.settledAmount ||0}}</view>
 					<view>
 						待收:
-						<text>¥12.00</text>
+						<text>¥{{item.unsettleAmount|| 0}}</text>
 					</view>
 				</view>
 			</view>
 		</view>
+		<view v-if="listData&&listData.length==0">
+			<u-empty :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="180" :text="noDataText" mode="list" :margin-top="50"></u-empty>
+		</view>
 	</view>
 </template>
 
 <script>
 export default {
 	props: {
-		listData: {
+		list: {
 			type: Array,
 			default: () => {
 				return [];
@@ -40,10 +43,40 @@ export default {
 	},
 	data() {
 		return {
-			checked:true
+			listData:[],
+			noDataText:'暂无数据'
 		};
 	},
 	methods: {
+		setData(list){
+			this.listData = list
+		},
+		checkChange(e){
+			const row = this.listData.find(item => item.bizSn == e.name)
+			if(row){
+				row.checked = !row.checked
+				this.listData.splice()
+			}
+			// 判断是否全选
+			const isAllNoChecked = this.listData.filter(item => !item.checked)
+			this.$emit('allChecked',isAllNoChecked.length == 0,row)
+		},
+		setChecked(id,val){
+			const row = this.partList.find(item => item.id == id)
+			row.checked = val
+			this.partList.splice()
+		},
+		// 获取所有数据
+		getAllData(){
+			return this.listData
+		},
+		// 全选
+		allSelect(val){
+			this.listData.map(item => {
+				item.checked = val
+			})
+			this.listData.splice()
+		},
 		jumpPage(url){
 			uni.navigateTo({
 				url

+ 4 - 3
pages/sales/chooseCustomerBill.vue

@@ -83,7 +83,6 @@ export default {
 			
 			keyword:'',
 			gatherShow:false,
-			systemSetList:null,//系统参数列表
 			params:{
 				allCustomerFlag:0 ,//1全部  0需要查询条件
 				customer:{
@@ -129,8 +128,8 @@ export default {
 		getSetInfo(){
 			// month day all
 			queryVerifySalesParams({}).then(res => {
-				this.systemSetList = res.data;
-				let obj=res.data.find(item=>{return item.remarks == 'verify_default_customer'})
+				let result = res.data;
+				let obj=result.find(item=>{return item.remarks == 'verify_default_customer'})
 				if(obj.paramValue == 'all'){
 					this.params.allCustomerFlag = 1;
 				}else if(obj.paramValue == 'month'){
@@ -139,6 +138,8 @@ export default {
 					this.showType = false
 				}
 				this.momentTime(0)
+				//获取系统对账周期设置
+				this.$store.state.vuex_systemSetList = result
 			});
 		},
 		changeTabs(index) {

+ 4 - 65
pages/sales/customerList.vue

@@ -2,7 +2,7 @@
 	<view class="sales-list-component">
 		<view v-if="listData && listData.length>0">
 			<scroll-view class="sales-list-con" :style="{ height: scrollH + 'px' }"  scroll-y @scrolltolower="onreachBottom">
-				<view class="customer-list" v-for="(item,i) in listData" :key="i">
+				<view class="customer-list" v-for="(item,i) in listData" :key="i" @click="getDetail(item)">
 					<view class="u-line-1">{{item.customer.customerName}}</view>
 					<view class="customer-b u-flex">
 						<view class="customer-box">
@@ -108,71 +108,10 @@ export default {
 				this.getList();
 			}
 		},
-		// 查看详情
 		getDetail(data) {
-			uni.navigateTo({ url: '/pages/sales/edit?pageType=detail&data=' + JSON.stringify(data) });
-		},
-		// 编辑
-		handleEdit(data) {
-			uni.navigateTo({ url: '/pages/sales/edit?pageType=edit&data=' + JSON.stringify(data) });
-		},
-		// 操作
-		handleFun(type, data) {
-			this.dataInfo = data;
-			if (type == 'audit') {
-				// 审核
-				this.auditModal = true;
-			} else if (type == 'out') {
-				// 出库
-				this.outModal = true;
-			} else if (type == 'del') {
-				// 删除
-				this.delText = '确认要删除吗?';
-				this.delModal = true;
-			} else if (type == 'cancel') {
-				// 取消
-				this.delText = '确认要取消吗?';
-				this.delModal = true;
-			}
-		},
-		// 审核通过或不通过
-		handleAudit(billStatus) {
-			salesWriteAudit({
-				id: this.dataInfo.id,
-				billStatus: billStatus
-			}).then(res => {
-				if (res.status == 200) {
-					this.toashMsg(res.message);
-					this.getList(1);
-					this.auditModal = false;
-				} else {
-					this.auditModal = false;
-				}
-			});
-		},
-		// 出库
-		handleOut() {
-			salesWriteStockOut({ salesBillSn: this.dataInfo.salesBillSn }).then(res => {
-				if (res.status == 200) {
-					this.toashMsg(res.message);
-					this.getList(1);
-					this.outModal = false;
-				} else {
-					this.outModal = false;
-				}
-			});
-		},
-		// 删除
-		handleDel() {
-			salesDel({ id: this.dataInfo.id }).then(res => {
-				if (res.status == 200) {
-					this.toashMsg(res.message);
-					this.getList(1);
-					this.delModal = false;
-				} else {
-					this.delModal = false;
-				}
-			});
+			uni.redirectTo({
+				url:'/pages/sales/bill?data='+JSON.stringify(data.customer)
+			})
 		}
 	}
 };

+ 38 - 0
pages/sales/orderInfoModal.vue

@@ -49,6 +49,44 @@
 					<text class="info-item-tit">备注:</text>
 					<text class="info-item-txt">{{infoData && infoData.remarks || '--'}}</text>
 				</view>
+				
+				
+				<view>
+					<text class="info-item-tit">单据来源:</text>
+					<text class="info-item-txt">{{infoData && infoData.sourceTypeDictValue || '--'}}</text>
+				</view>
+				<view>
+					<text class="info-item-tit">创建时间:</text>
+					<text class="info-item-txt">{{infoData && infoData.sourceTypeDictValue || '--'}}</text>
+				</view>
+				<view>
+					<text class="info-item-tit">审核时间:</text>
+					<text class="info-item-txt">{{infoData && infoData.sourceTypeDictValue || '--'}}</text>
+				</view>
+				<view>
+					<text class="info-item-tit">联系人:</text>
+					<text class="info-item-txt">{{infoData && infoData.sourceTypeDictValue || '--'}}</text>
+				</view>
+				<view>
+					<text class="info-item-tit">联系手机:</text>
+					<text class="info-item-txt">{{infoData && infoData.sourceTypeDictValue || '--'}}</text>
+				</view>
+				<view>
+					<text class="info-item-tit">价格类型:</text>
+					<text class="info-item-txt">{{infoData && infoData.sourceTypeDictValue || '--'}}</text>
+				</view>
+				<view>
+					<text class="info-item-tit">配送方式:</text>
+					<text class="info-item-txt">{{infoData && infoData.sourceTypeDictValue || '--'}}</text>
+				</view>
+				<view>
+					<text class="info-item-tit">铺货出库:</text>
+					<text class="info-item-txt">{{infoData && infoData.sourceTypeDictValue || '--'}}</text>
+				</view>
+				<view>
+					<text class="info-item-tit">开单人:</text>
+					<text class="info-item-txt">{{infoData && infoData.operatorName || '--'}}</text>
+				</view>
 			</view>
 			<view class="order-info-footer">
 				<view class="button-cancel" @click="isShow=false">关闭</view>

+ 18 - 22
pages/sales/salesDetail.vue

@@ -5,11 +5,11 @@
 			<u-section @click="infoModal=true" title="基础信息" sub-title="查看更多" :line-color="$config('primaryColor')"></u-section>
 			<view class="info-item-box">
 				<text class="info-item-tit color_6">销售单号</text>
-				<text>XS12454545454</text>
+				<text>{{detailData && detailData.salesBillNo || '--'}}</text>
 			</view>
 			<view class="info-item-box">
 				<text class="info-item-tit color_6">客户名称</text>
-				<text>东莞市寮步车正汽车服务中心</text>
+				<text>{{detailData && detailData.buyerName || '--'}}</text>
 			</view>
 		</view>
 		<!-- 产品列表 -->
@@ -23,10 +23,17 @@
 			<view ref="salesTotal" class="sales-total-box border-b font_13 flex justify_between">
 				<view class="sales-total-con flex_1" :style="{height: toggle ? 'auto' : '44upx'}">
 					<view>
-						总款数:<text class="sales-total-num" :style="{color: $config('warringColor')}">{{detailData && (detailData.totalCategory || detailData.totalCategory==0) ? toThousands(detailData.totalCategory) : '--'}}</text>;总数量:<text class="sales-total-num" :style="{color: $config('warringColor')}">{{detailData && (detailData.totalQty || detailData.totalQty==0) ? toThousands(detailData.totalQty) : '--'}}</text>;
+						总款数:<text class="sales-total-num" :style="{ color: $config('warringColor') }">
+								{{ detailData && (detailData.totalCategory || detailData.totalCategory == 0) ? toThousands(detailData.totalCategory) : '--' }}</text>;总数量:<text class="sales-total-num" :style="{ color: $config('warringColor') }">
+								{{ detailData && (detailData.totalQty || detailData.totalQty == 0) ? toThousands(detailData.totalQty) : '--' }}
+							</text>;
 					</view>
 					<view>
-						总售价:<text class="sales-total-num" :style="{color: $config('warringColor')}">¥{{detailData && (detailData.discountAmount || detailData.discountAmount==0) ? toThousands(detailData.discountAmount, 2) : '--'}}</text>;折后总售价:<text class="sales-total-num" :style="{color: $config('warringColor')}">¥{{detailData && (detailData.discountedAmount || detailData.discountedAmount==0) ? toThousands(detailData.discountedAmount, 2) : '--'}}</text>;
+						总售价:<text class="sales-total-num" :style="{ color: $config('warringColor') }">
+								¥{{ detailData && (detailData.totalAmount || detailData.totalAmount == 0) ? toThousands(detailData.totalAmount, 2) : '--' }}
+							</text>;折后总售价:<text class="sales-total-num" :style="{ color: $config('warringColor') }">
+								¥{{ detailData && (detailData.discountedAmount || detailData.discountedAmount == 0) ? toThousands(detailData.discountedAmount, 2) : '--' }}
+							</text>;
 					</view>
 				</view>
 			</view>
@@ -57,9 +64,6 @@
 								<view class="sales-item-price" v-if="detailData&&detailData.discountAmount">折后:¥{{toThousands(item.discountedAmount||0, 2)}}</view>
 							</view>
 						</view>
-						<!-- <view class="btn-box" style="padding-right: 0;">
-							<u-button v-if="pageData.type=='edit'" @click="handleDel(item)" size="mini" :hair-line="false" shape="circle" plain type="error" hover-class="none">删除</u-button>
-						</view> -->
 					</view>
 					<view v-if="listData && listData.length == 0">
 						<u-empty :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="150" :text="noDataText" mode="list" :margin-top="50"></u-empty>
@@ -143,7 +147,6 @@
 				totalNum: 0,
 				status: 'loadmore',
 				noDataText: '暂无数据',
-				theme: '',
 				scrollH: 916,
 				infoModal: false,
 				discountModal: false,
@@ -157,17 +160,11 @@
 				commonType: 1,  // 公共弹框类型  1删除产品,2删除销售单,3编辑产品时库存不足
 			}
 		},
-		onLoad(opt) {
-			// this.theme = getApp().globalData.theme
-			// if(opt){
-			// 	this.pageData = {
-			// 		type: opt.pageType || 'edit',
-			// 		data: opt.data ? JSON.parse(opt.data) : null
-			// 	}
-			// }
-			// this.init()
-			// // 监听整改完成后刷新事件
-			// uni.$on('refreshEditBL', this.init)
+		onLoad(options) {
+			if(options && options.salesBillId){
+				this.salesBillSn = options.salesBillId;
+				this.init();
+			}
 		},
 		onUnload() {
 			uni.$off('refreshEditBL')
@@ -189,7 +186,7 @@
 				let params = {
 					pageNo: this.pageNo,
 					pageSize: this.pageSize,
-					salesBillSn: this.pageData.data && this.pageData.data.salesBillSn
+					salesBillSn: this.salesBillSn
 				}
 				this.status = "loading"
 				salesDetailList(params).then(res => {
@@ -368,8 +365,7 @@
 			},
 			// 销售单详情
 			getDetail(){
-				salesDetailBySn({ salesBillSn: this.pageData.data.salesBillSn }).then(res => {
-					console.log(res.data)
+				salesDetailBySn({ salesBillSn: this.salesBillSn }).then(res => {
 					if(res.status == 200){
 						this.detailData = res.data
 					}else{

+ 1 - 2
pages/shuntBackManage/addBackOrder.vue

@@ -137,9 +137,8 @@ export default {
 		_this.theme = getApp().globalData.theme;
 		_this.shelfSn = options.shelfSn;
 		_this.shelfName = options.shelfName;
-		_this.recallBillList=_this.$store.state.shuntBackList || []
+		_this.recallBillList=_this.$store.state.vuex_shuntBackList || []
 		uni.$on("chooseBackProduct",function(data){
-			
 			_this.recallBillList = _this.recallBillList.concat(data).sort(function(a,b){
 				return (a.shelfPlaceCode+'').localeCompare(b.shelfPlaceCode+'');
 			});

+ 3 - 2
store/index.js

@@ -110,11 +110,12 @@ const store = new Vuex.Store({
 		vuex_tempPrintList:[], // 临时打印数据
 		vuex_tempData: null, // 临时数据
 		vuex_shelfOrderState: null, // 货架订单状态
-		shuntBackList:null
+		vuex_shuntBackList:null,//调回单临时存储数据
+		vuex_systemSetList:null//对账单系统参数设置临时存储数据
 	},
 	mutations: {
 		setShuntBackList(state,val){
-			state.shuntBackList = val
+			state.vuex_shuntBackList = val
 		},
 		$uStore(state, payload) {
 			// 判断是否多层级调用,state中为对象存在的情况,诸如user.info.score = 1