소스 검색

修改bug

liujun 2 년 전
부모
커밋
c2a640f0cf

+ 54 - 48
pages/sales/bill.vue

@@ -41,11 +41,11 @@
 			<view class="f-mid" @click="isDetailShow = !isDetailShow">
 				<view>
 					待收:
-					<text>¥{{ chooseTotalPayPrice }}</text>
+					<text class="fontColor">¥{{ chooseTotalPayPrice }}</text>
 				</view>
-				<view v-if="chooseList.length > 0">
+				<view v-if="chooseList.length > 0 && discountVal!=0">
 					折后:
-					<text>¥{{ settlement }}</text>
+					<text class="fontColor">¥{{ backDiscountPrice }}</text>
 				</view>
 				<view class="u-flex" v-if="chooseList.length > 0">
 					<view>
@@ -91,7 +91,7 @@
 					</view>
 					<view class="costList u-flex">
 						<view class="label">折让金额:</view>
-						<u-input v-model="discountVal" :border="true" :height="50" />
+						<u-input type="number" :custom-style="{color:'#ffa500'}" v-model="discountVal" :border="true" :height="50" />
 					</view>
 					<view class="tip" v-if="discountVal*1 > chooseTotalPayPrice*1">折让金额不能大于待收金额,请重新输入</view>
 					<view class="costText">折让后金额</view>
@@ -113,7 +113,7 @@
 import billList from './billListComponent.vue';
 import { queryUnsettleSaleList, insert } from '@/api/verify.js';
 import getDate from '@/libs/getDate.js';
-import { toThousands,formatDecimal} from '@/libs/tools'
+import { toThousands,formatDecimal} from '@/libs/tools.js'
 export default {
 	components: { billList },
 	data() {
@@ -193,7 +193,8 @@ export default {
 			isDetailShow: false,
 			submitLoading: false,
 			shareShow: false,
-			verifySn:''
+			verifySn:'',
+			backDiscountPrice:'0.00'
 		};
 	},
 	onReady() {
@@ -224,8 +225,13 @@ export default {
 		uni.$on('customerInfo', res => {
 			this.customerObj = res;
 			this.params.targetSn = res.customerSn;
+			this.changeTime();
 		});
-		this.changeTime();
+	},
+	onReady() {
+		setTimeout(()=>{
+			this.changeTime();
+		},500)
 	},
 	onBackPress() {
 		if (this.showSearch) {
@@ -292,12 +298,11 @@ export default {
 				this.params.bizBeginDate = this.getQueryDate().beginDate;
 				this.params.bizEndDate = this.getQueryDate().endDate;
 				this.cycleName = this.changeShowTime();
+				this.dateArray = '';
 			} 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();
 		},
@@ -360,7 +365,7 @@ export default {
 			});
 		},
 		handleDisCount() {
-			if (this.discountVal > this.chooseTotalPayPrice) {
+			if (this.discountVal*1 > this.chooseTotalPayPrice*1) {
 				uni.showToast({
 					title: '折让金额不能大于待收金额,请重新输入',
 					icon: 'none'
@@ -376,6 +381,7 @@ export default {
 				return;
 			}
 			this.costShow = false;
+			this.backDiscountPrice = this.settlement
 		},
 		submitOrder() {
 			//发送对账单
@@ -386,27 +392,8 @@ export default {
 				});
 				return;
 			}
-			let obj = {
-				detailNum: this.chooseList.length,
-				totalAmount: this.chooseTotalPayPrice,
-				discountAmount: this.discountVal || 0,
-				settleAmount: this.settlement,
-				detailList: this.chooseList
-			};
-			let ajaxData = Object.assign(this.params, obj);
+			this.shareShow = true;
 			this.submitLoading = true;
-			insert(ajaxData).then(res => {
-				if (res.status == 200) {
-					this.submitLoading = false;
-					this.shareShow = true;
-					this.verifySn  = res.data.verifySn
-				} else {
-					uni.showToast({
-						title: res.message,
-						icon: 'none'
-					});
-				}
-			});
 		},
 		allCheckeChange(e) {
 			this.$refs.bill.allSelect(e.value);
@@ -414,6 +401,7 @@ export default {
 			list.map(item => {
 				this.allCheckedCallback(true,item)
 			})
+			
 		},
 		// 选中事件
 		allCheckedCallback(isAllChecked, row) {
@@ -429,11 +417,14 @@ export default {
 					this.chooseList.push(row);
 				}
 			}
+			this.discountVal = ''
+			this.backDiscountPrice = this.settlement
 			// 是否全选
 			this.allChecked = isAllChecked;
 		},
 		// 分享图文
 		handleShare() {
+			this.submitLoading = false;
 			let url = 'http://p.iscm.360arrow.com/dzd/index.html?userSn=' + this.userData.orgSn + '&verifySn='+this.verifySn + '&name='+this.userData.orgName;
 			if (uni.getSystemInfoSync().platform == 'ios') {
 				uni.share({
@@ -444,10 +435,11 @@ export default {
 					title: this.customerObj.customerName,
 					summary: '共' + this.settlement + '元,请您查阅',
 					imageUrl: '../../static/logo.png',
-					success: function(res) {
+					success: (res)=> {
+						this.setBillOrder();
 						console.log('success:' + JSON.stringify(res));
 					},
-					fail: function(err) {
+					fail: (err)=> {
 						console.log('fail:' + JSON.stringify(err));
 					}
 				});
@@ -455,14 +447,37 @@ export default {
 				uni.shareWithSystem({
 					summary: this.customerObj.customerName + '您好,您有一个对账单共' + this.settlement + '元,请您查阅',
 					href: url,
-					success() {
+					success:()=> {
+						this.setBillOrder();
 						console.log('调取微信列表成功,分享不一定成功')
 					},
-					fail() {
+					fail:()=> {
 						console.log('分享失败')
 					}
 				});
 			}
+		},
+		// 生成历史对账单
+		setBillOrder(){
+			let obj = {
+				detailNum: this.chooseList.length,
+				totalAmount: this.chooseTotalPayPrice,
+				discountAmount: this.discountVal || 0,
+				settleAmount: this.settlement,
+				detailList: this.chooseList
+			};
+			let ajaxData = Object.assign(this.params, obj);
+			insert(ajaxData).then(res => {
+				this.shareShow = false;
+				if (res.status == 200) {
+					this.verifySn  = res.data.verifySn
+				} else {
+					uni.showToast({
+						title: res.message,
+						icon: 'none'
+					});
+				}
+			});
 		}
 	}
 };
@@ -528,19 +543,10 @@ export default {
 			flex: 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;
-					}
-				}
+			font-weight: 600;
+			.fontColor {
+				color: $uni-color-warning;
+				vertical-align: middle;
 			}
 			.costBtn {
 				width: 70rpx;
@@ -616,7 +622,7 @@ export default {
 			.tip {
 				color: $uni-color-error;
 				font-size: 20rpx;
-				text-align: right;
+				margin-left: 140rpx;
 			}
 			.costText {
 				text-align: center;

+ 14 - 10
pages/sales/billHistory.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="content flex flex_column">
-		<view class="p-header" @click="jumpPage('/pages/statistics/chooseShelf')">
+		<view class="p-header" @click="jumpPage('/pages/statistics/chooseShelf?customerSn='+(targetSn?targetSn:''))">
 			<text>{{ curCustomerName || '全部客户' }}</text>
 			<u-icon name="arrow-right"></u-icon>
 		</view>
@@ -23,7 +23,7 @@
 			<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" />
+			<u-loadmore :status="status" v-if="status=='loading'"/>
 		</view>
 	</view>
 </template>
@@ -45,14 +45,17 @@
 			}
 		},
 		onLoad() {
-			uni.$on('chooseShelfOk',(info)=>{
-				if(info){
-					this.pageNo=1;
-					this.targetSn = info.targetSn
-					this.curCustomerName=info.customerName
-				}
+			uni.$on('chooseShelfOk',(data)=>{
+				this.pageNo=1;
+				this.targetSn = data.customerSn
+				this.curCustomerName=data.customerName
+				this.getList();
 			})
-			this.getList();
+		},
+		onReady() {
+			setTimeout(()=>{
+				this.getList();
+			},500)
 		},
 		methods:{
 			jumpPage(url){
@@ -61,7 +64,6 @@
 				})
 			},
 			getList(){
-				const _this = this;
 				let params = {targetSn:this.targetSn, pageNo: this.pageNo, pageSize: this.pageSize };
 				this.status = 'loading';
 				queryPage(params).then(res => {
@@ -85,6 +87,8 @@
 			if (this.billList.length < this.totalNum) {
 				this.pageNo += 1;
 				this.getList();
+			}else{
+				this.status = 'nomore'
 			}
 		},
 		onUnload(){

+ 9 - 7
pages/sales/billHistoryDetail.vue

@@ -5,7 +5,7 @@
 				<text>分享时间</text>
 				<text>{{ billInfo.createDate }}</text>
 			</view>
-			<view class="head_list" v-if="billArr.customer">
+			<view class="head_list" v-if="billInfo.customer">
 				<text>客户名称</text>
 				<text>{{ billInfo.customer.customerName }}</text>
 			</view>
@@ -15,7 +15,7 @@
 			</view>
 			<view class="head_list">
 				<text>付款状态</text>
-				<text>{{ billInfo.billStatus != 'UNSETTLE' ? '未付款' : billInfo.settleStyleSnDictValue ? '已付款(' + billInfo.settleStyleSnDictValue + ')' : '已付款' }}</text>
+				<text>{{ billInfo.billStatus == 'UNSETTLE' ? '未付款' : billInfo.settleStyleSnDictValue ? '已付款(' + billInfo.settleStyleSnDictValue + ')' : '已付款' }}</text>
 			</view>
 		</view>
 		<view class="b_detail">
@@ -26,22 +26,22 @@
 				</view>
 				<view class="detail_box">
 					<text>待收金额合计:</text>
-					<text>{{ billInfo.totalAmount }}</text>
+					<text>{{ billInfo.totalAmount ||billInfo.totalAmount == 0 ? toThousands(billInfo.totalAmount,2):'--' }}</text>
 				</view>
 			</view>
 			<view class="detail_list u-flex">
 				<view class="detail_box">
 					<text>折让金额:</text>
-					<text>{{ billInfo.discountAmount }}</text>
+					<text>{{ billInfo.discountAmount||billInfo.discountAmount==0? toThousands(billInfo.discountAmount,2):'--'}}</text>
 				</view>
 				<view class="detail_box">
 					<text>折让后待收金额:</text>
-					<text>{{ billInfo.settleAmount }}</text>
+					<text>{{ billInfo.settleAmount||billInfo.settleAmount ==0? toThousands(billInfo.settleAmount,2):'--' }}</text>
 				</view>
 			</view>
 		</view>
 		<view class="detail_con"><billList ref="billBox" :list="billArr"></billList></view>
-		<view class="footer" v-if="billInfo.billStatus != 'UNSETTLE'">
+		<view class="footer" v-if="billInfo.billStatus == 'UNSETTLE'">
 			<u-button type="primary" :loading="btnLoading" @click="submitOrder" :custom-style="customStyle" shape="circle">再次发送对账单</u-button>
 		</view>
 		<!-- 分享询问弹窗 -->
@@ -53,6 +53,7 @@
 import billList from './billListComponent.vue';
 import { findBySn, insert } from '@/api/verify.js';
 import getDate from '@/libs/getDate.js';
+import { toThousands } from '@/libs/tools.js'
 export default {
 	components: { billList },
 	data() {
@@ -66,7 +67,8 @@ export default {
 			billArr: [],
 			timeInfo: '',
 			btnLoading: false,
-			shareShow: false
+			shareShow: false,
+			toThousands
 		};
 	},
 	onReady() {

+ 6 - 4
pages/sales/billListComponent.vue

@@ -12,11 +12,11 @@
 					<view class="billOrder">{{item.bizNo}}</view>
 				</view>
 				<view class="rigth_b u-flex u-row-between">
-					<view>应收:¥{{item.bizAmount ||0}}</view>
-					<view>已收:¥{{item.settledAmount ||0}}</view>
+					<view>应收:¥{{toThousands(item.bizAmount||0,2)}}</view>
+					<view>已收:¥{{toThousands(item.settledAmount ||0,2)}}</view>
 					<view>
 						待收:
-						<text>¥{{item.unsettleAmount|| 0}}</text>
+						<text>¥{{toThousands(item.unsettleAmount||0,2)}}</text>
 					</view>
 				</view>
 			</view>
@@ -28,6 +28,7 @@
 </template>
 
 <script>
+	import { toThousands } from '@/libs/tools.js'
 export default {
 	props: {
 		list: {
@@ -44,7 +45,8 @@ export default {
 	data() {
 		return {
 			listData:[],
-			noDataText:'暂无数据'
+			noDataText:'暂无数据',
+			toThousands
 		};
 	},
 	methods: {

+ 3 - 1
pages/sales/chooseCustomerBill.vue

@@ -43,7 +43,7 @@
 					@custom="getSearchCon"
 					@clear="clearSearch"
 					:show-action="false"
-					placeholder="请输入客户名称"
+					placeholder="请输入客户名称/拼音首字母查询"
 				></u-search>
 			</view>
 		</view>
@@ -163,6 +163,8 @@ export default {
 				this.$refs.customer.getList(1);
 			}else{
 				this.momentTime(0)
+				this.keyword = ''
+				this.params.customer.queryWord = ''
 			}
 		},
 		handleDate(i) {

+ 4 - 0
pages/sales/customerList.vue

@@ -77,6 +77,10 @@ export default {
 			if (pageNo) {
 				this.pageNo = pageNo;
 			}
+			uni.pageScrollTo({
+				scrollTop:0,
+				duration:300
+			})
 			let params = Object.assign(this.params, { pageNo: this.pageNo, pageSize: this.pageSize });
 			this.status = 'loading';
 			queryCustomerPage(params).then(res => {

+ 7 - 2
pages/sales/index.vue

@@ -22,7 +22,7 @@
 				</view>
 			</view>
 			<!-- 产品报价及新增销售单 -->
-			<view class="nav-cont flex align_center justify_between">
+			<view class="nav-cont flex align_center">
 				<view class="nav-item" @click="toPage('/pages/sales/productPricing')" v-if="$hasPermissions('M_productPrice_mobile')">
 					<u-image class="nav-pic" style="margin-top: 5upx;" :src="`../../static/${theme}/navIcon/price_icon.png`" width="60" height="60"></u-image>
 					<text class="nav-txt" style="margin-top: 5upx;">产品报价</text>
@@ -35,7 +35,8 @@
 					<u-image class="nav-pic" :src="`../../static/${theme}/navIcon/pfind.png`" width="64" height="64"></u-image>
 					<text class="nav-txt">产品查询</text>
 				</view>
-				<view class="nav-item" @click="toPage('/pages/sales/chooseCustomerBill')" v-if="$hasPermissions('M_queryProduct_mobile')">
+				
+				<view class="nav-item" @click="toPage('/pages/sales/chooseCustomerBill')" v-if="$hasPermissions('M_ARStatement_mobile')">
 					<u-image class="nav-pic" :src="`../../static/${theme}/navIcon/billImg.png`" width="64" height="64"></u-image>
 					<text class="nav-txt">应收对账单</text>
 				</view>
@@ -264,6 +265,7 @@
 		.nav-cont{
 			.nav-item{
 				width: 32%;
+				margin-right: 2%;
 				border-radius: 25upx;
 				background-color: #ffffff;
 				padding: 14upx 0;
@@ -278,6 +280,9 @@
 					color: #666666;
 				}
 			}
+			.nav-item:last-child{
+				margin-right: 0 !important;
+			}
 		}
 		.sales-list{
 			.title{

+ 41 - 237
pages/sales/salesDetail.vue

@@ -3,14 +3,14 @@
 		<!-- 基础信息 -->
 		<view class="sales-info-con">
 			<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>{{detailData && detailData.salesBillNo || '--'}}</text>
-			</view>
 			<view class="info-item-box">
 				<text class="info-item-tit color_6">客户名称</text>
 				<text>{{detailData && detailData.buyerName || '--'}}</text>
 			</view>
+			<view class="info-item-box">
+				<text class="info-item-tit color_6">销售单号</text>
+				<text>{{detailData && detailData.salesBillNo || '--'}}</text>
+			</view>
 		</view>
 		<!-- 产品列表 -->
 		<view class="sales-product-con">
@@ -20,19 +20,21 @@
 			</view>
 			<view class="flex flex_column" v-show="current == 0">
 			<!-- 合计 -->
-			<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 ref="salesTotal" v-if="detailData" class="sales-total-box border-b font_13 flex justify_between">
+				<view class="sales-total-con flex_1">
 					<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) : '--' }}
+								{{ (detailData.totalCategory || detailData.totalCategory == 0) ? toThousands(detailData.totalCategory) : '--' }}</text>;
+						总数量:<text class="sales-total-num" :style="{ color: $config('warringColor') }">
+								{{ (detailData.totalQty || detailData.totalQty == 0) ? toThousands(detailData.totalQty) : '--' }}
 							</text>;
 					</view>
 					<view>
 						总售价:<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) : '--' }}
+								¥{{ detailData.totalAmount || detailData.totalAmount == 0 ? toThousands(detailData.totalAmount, 2) : '--' }}
+							</text>;
+						折后总售价:<text class="sales-total-num" :style="{ color: $config('warringColor') }">
+								¥{{ detailData.discountedAmount || detailData.discountedAmount == 0 ? toThousands(detailData.discountedAmount, 2) : '--' }}
 							</text>;
 					</view>
 				</view>
@@ -51,24 +53,24 @@
 							<view class="sales-item-main flex_1">
 								<view class="sales-item-name">{{item.productName || '--'}}</view>
 								<view class="sales-item-txt">{{item.productCode || '--'}}</view>
-								<view class="sales-item-txt color_6" style="font-size: 24upx;" v-if="item.warehouseEntity&&item.warehouseEntity.name || item.warehouseLocationEntity&&item.warehouseLocationEntity.name">{{item.warehouseEntity&&item.warehouseEntity.name}} > {{item.warehouseLocationEntity&&item.warehouseLocationEntity.name}}</view>
+								<!-- <view class="sales-item-txt color_6" style="font-size: 24upx;" v-if="item.warehouseEntity&&item.warehouseEntity.name || item.warehouseLocationEntity&&item.warehouseLocationEntity.name">{{item.warehouseEntity&&item.warehouseEntity.name}} > {{item.warehouseLocationEntity&&item.warehouseLocationEntity.name}}</view> -->
 								<view class="sales-item-txt flex align_center justify_between">
 									<view class="sales-item-priceInfo">
 										<view :style="{color: $config('errorColor'), display: 'inline-block'}">¥<text style="font-size: 30upx;">{{toThousands(item.price||0, 2)}}</text></view>
 										<text style="display: inline-block;margin: 0 10upx;">X</text> 
 										<text style="font-size: 30upx;">{{toThousands(item.qty||0)}}</text>
-										{{item.productUnit}}
+										<!-- {{item.productUnit}} -->
 									</view>
-									<view class="sales-item-price">¥{{toThousands(item.totalAmount||0, 2)}}</view>
+									<view class="sales-item-price">¥{{item.totalAmount || item.totalAmount == 0?toThousands(item.totalAmount, 2):0}}</view>
 								</view>
-								<view class="sales-item-price" v-if="detailData&&detailData.discountAmount">折后:¥{{toThousands(item.discountedAmount||0, 2)}}</view>
+								<!-- <view class="sales-item-price" v-if="detailData&&detailData.discountAmount">折后:¥{{toThousands(item.discountedAmount||0, 2)}}</view> -->
 							</view>
 						</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>
 					</view>
-					<view style="padding: 20upx;">
+					<view style="padding: 20upx;" v-else>
 						<u-loadmore v-if="totalNum>listData.length || status=='loading'" :status="status" />
 					</view>
 				</scroll-view>
@@ -76,28 +78,20 @@
 			</view>
 			<!-- 收款记录列表 -->
 			<view class="flex flex_column" v-show="current == 1">
-			<!-- <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'}">
-					应收:<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.discountAmount || detailData.discountAmount==0) ? toThousands(detailData.discountAmount, 2) : '--'}}</text>;
-				</view>
-			</view> -->
 			<view class="sales-list-box">
 				<scroll-view class="sales-list-con" :style="{height:scrollH+'upx'}" scroll-y>
 					<view class="sales-list-item flex align_center justify_between" v-for="(con,i) in payRecode" :key="">
 						<view class="sales-list-l">
 							<view>{{con.createDate}}</view>
-							<view>微信支付(线上)</view>
+							<view>{{con.payType}}</view>
 						</view>
 						<view class="sales-list-r income" >
-							+¥32.00
+							{{con.price *1 > 0?'+':'-'}}¥{{con.price}}
 						</view>
 					</view>
-					<view v-if="false">
+					<view v-if="payRecode.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>
 					</view>
-					<view style="padding: 20upx;">
-						<u-loadmore v-if="totalNum>listData.length || status=='loading'" :status="status" />
-					</view>
 				</scroll-view>
 			</view>
 			</view>
@@ -108,15 +102,12 @@
 </template>
 
 <script>
-	import commonModal from '@/pages/common/commonModal.vue'
+	
 	import OrderInfoModal from './orderInfoModal.vue'
-	import DiscountModal from './discountModal.vue'
-	import ProductModal from './productModal.vue'
 	import { toThousands } from '@/libs/tools'
-	import { stockByProductSn } from '@/api/stock'
 	import { salesDetailList, salesDetailDel, salesDel, salesDetailBySn, salesSubmit, salesDiscount, salesDetailUpdate,queryFlowByBizSn } from '@/api/sales'
 	export default{
-		components: { OrderInfoModal, DiscountModal, commonModal, ProductModal },
+		components: { OrderInfoModal },
 		data(){
 			return{
 				tabsList:[{
@@ -129,24 +120,16 @@
 					color:this.$config('primaryColor'),
 					borderBottom:'4rpx solid '+this.$config('primaryColor')
 				},
-				pageData: {
-					type: 'edit',
-					data: null
-				},
-				toggle: true,
 				toThousands,
-				customBtnStyle: {  //  自定义按钮样式
-					borderColor: this.$config('primaryColor'),
-					backgroundColor: this.$config('primaryColor'),
-					color: '#fff'
-				},
+				
 				listData: [],
 				pageNo: 1,
-				pageSize: 6,
+				pageSize: 10,
 				totalNum: 0,
 				status: 'loadmore',
 				noDataText: '暂无数据',
 				scrollH: 916,
+				
 				infoModal: false,
 				discountModal: false,
 				commonModal: false,
@@ -157,7 +140,7 @@
 				productInfo: null,  // 编辑产品需要的参数
 				editInfo: null,  // 添加/编辑 提交的值
 				commonType: 1,  // 公共弹框类型  1删除产品,2删除销售单,3编辑产品时库存不足
-				payRecode:null
+				payRecode:[]
 			}
 		},
 		onLoad(options) {
@@ -175,26 +158,11 @@
 				if (pageNo) {
 					this.pageNo = pageNo
 				}
-				let params = {
-					pageNo: this.pageNo,
-					pageSize: this.pageSize,
-					bizSn: this.salesBillSn
-				}
-				this.status = "loading"
-				queryFlowByBizSn(params).then(res => {
+				queryFlowByBizSn({bizSn: this.salesBillSn}).then(res => {
 					if (res.status == 200) {
-						if (this.pageNo > 1) {
-							this.payRecode = this.payRecode.concat(res.data.list || []);
-						} else {
-							this.payRecode = res.data.list || [];
-						}
-						this.totalNum = res.data.count || 0;
-					} else {
-						this.payRecode = [];
-						this.totalNum = 0;
-						this.noDataText = res.message;
+						this.payRecode =res.data
 					}
-					this.status = 'loadmore';
+			
 				})
 			},
 			changeTabs(index){
@@ -205,6 +173,17 @@
 				this.getDetail()
 				this.getRecodeData(1)
 			},
+			// 销售单详情
+			getDetail(){
+				salesDetailBySn({ salesBillSn: this.salesBillSn }).then(res => {
+					if(res.status == 200){
+						this.detailData = res.data
+					}else{
+						this.detailData = null
+					}
+					this.toggle = false
+				})
+			},
 			// 列表
 			getList(pageNo){
 				const _this = this
@@ -249,181 +228,6 @@
 					this.getList()
 					this.getRecodeData()
 				}
-			},
-			// 折扣金额
-			discountConfirm(amount){
-				let params = {
-					discountAmount: amount,
-					salesBillSn: this.detailData.salesBillSn,
-					id: this.detailData.id
-				}
-				salesDiscount(params).then(res => {
-					if(res.status == 200){
-						this.init()
-						this.discountModal = false
-					}
-				})
-			},
-			// 提交
-			handleSubmit(){
-				salesSubmit({ id: this.detailData.id }).then(res => {
-					if(res.status == 200){
-						this.toashMsg(res.message)
-						uni.$emit('refreshSalesBL')
-						uni.navigateBack()
-					}
-				})
-			},
-			// 编辑
-			handleEdit(data){
-				this.productInfo = {
-					productName: data.productName,
-					productMainImage: data.productMainImage,
-					productCode: data.productCode,
-					productOrigCode: data.productOrigCode,
-					warehouseName: data.warehouseEntity && data.warehouseEntity.name,
-					warehouseLocationName: data.warehouseLocationEntity && data.warehouseLocationEntity.name,
-					price: data.price,
-					qty: data.qty
-				}
-				this.openProductModal = true
-				this.productData = data
-			},
-			// 确认产品信息
-			productConfirm(data){
-				this.editInfo = data
-				this.validateStock()  //验证  库存是否不足
-			},
-			// 库存不足
-			validateStock(){
-				//  校验库存
-				stockByProductSn({ productSn: this.productData.productSn }).then(res => {
-					if (res.status == 200) {
-						if (res.data && (!res.data.currentStockQty || this.editInfo.qty <= res.data.currentStockQty)) {
-							this.editProduct()
-						} else {  // 库存不足
-							this.commonType = 3
-							this.modalText = '库存不足,将产生急件,确认修改吗?'
-							this.commonModal = true
-						}
-					}
-				})
-			},
-			// 编辑产品
-			editProduct(){
-				let params = {
-					id: this.productData.id,
-					qty: this.editInfo.qty,
-					price: this.editInfo.price,
-					productSn: this.productData.productSn,
-					salesBillSn: this.detailData.salesBillSn,
-				}
-				salesDetailUpdate(params).then(res => {
-					if(res.status == 200){
-						this.toashMsg(res.message)
-						this.init()
-						this.commonModal = false
-						this.openProductModal = false
-					}
-				})
-			},
-			// 删除
-			handleDel(item){
-				if(item){  // 删除产品
-					this.commonType = 1
-					this.productData = item
-					this.modalText = '确认要删除吗?'
-					this.commonModal = true
-				}else{  // 整单删除
-					this.commonType = 2
-					this.productData = null
-					this.modalText = '确认删除该销售单吗?'
-					this.commonModal = true
-				}
-			},
-			// 公共弹框  确定
-			handleCommon(){
-				if(this.commonType == 1){  // 删除产品
-					this.delFun()
-				}else if(this.commonType == 2){  // 整单删除
-					this.delFun()
-				}else if(this.commonType == 3){  // 编辑产品时库存不足
-					this.editProduct()
-				}
-			},
-			// 公共弹框  取消
-			handleCancel(){
-				this.openProductModal = false
-			},
-			// 删除
-			delFun(){
-				let url = salesDetailDel
-				let params = {}
-				console.log(this.commonType)
-				if(this.commonType == 1){  // 删除产品
-					url = salesDetailDel
-					params = { id: this.productData.id }
-				}else if(this.commonType == 2){  // 整单删除
-					console.log('整单删除', this.detailData)
-					url = salesDel
-					params = { id: this.detailData && this.detailData.id }
-				}
-				url(params).then(res => {
-					if (res.status == 200) {
-						if(this.productData){  // 删除产品
-							this.toashMsg(res.message)
-							this.init()
-						}else{  // 整单删除
-							this.toashMsg(res.message)
-							uni.$emit('refreshSalesBL')
-							uni.navigateBack()
-						}
-						this.commonModal = false
-					} else {
-						this.commonModal = false
-					}
-				})
-			},
-			// 选择产品
-			handleProduct(){
-				uni.navigateTo({ url: '/pages/sales/chooseProduct?data='+JSON.stringify(this.detailData) })
-			},
-			// 编辑
-			goPage(){
-				uni.redirectTo({ url: '/pages/sales/edit?pageType=edit&data='+JSON.stringify(this.detailData) })
-			},
-			// 销售单详情
-			getDetail(){
-				salesDetailBySn({ salesBillSn: this.salesBillSn }).then(res => {
-					if(res.status == 200){
-						this.detailData = res.data
-					}else{
-						this.detailData = null
-					}
-					this.toggle = false
-				})
-			},
-			changeScrollH(){
-				const _this = this
-				uni.getSystemInfo({
-					success: function (res) {
-						const winH = res.windowHeight * 2
-						let totalH = _this.$refs.salesTotal && _this.$refs.salesTotal.$el && _this.$refs.salesTotal.$el.offsetHeight || 0
-						if(_this.toggle){
-							_this.scrollH = winH - 656 - totalH
-						}else{
-							_this.scrollH = winH - 522 - totalH
-						}
-						// if(_this.detailData&&_this.detailData.billStatus=='FINISH'){
-							_this.scrollH = _this.scrollH + 100
-						// }
-					}
-				})
-			}
-		},
-		watch: {
-			toggle (newValue, oldValue) {
-				this.changeScrollH()
 			}
 		}
 	}

+ 1 - 0
pages/statistics/chooseShelf.vue

@@ -134,6 +134,7 @@
 				}
 			},
 			viewDetail(item){
+				console.log('111111',item)
 				uni.$emit('chooseShelfOk',item)
 				uni.navigateBack()
 			}