Browse Source

解决冲突

liujun 2 years ago
parent
commit
0baf38c70d
4 changed files with 30 additions and 14 deletions
  1. 19 11
      pages/sales/bill.vue
  2. 1 2
      pages/sales/index.vue
  3. 9 0
      pages/sales/salesSearch.vue
  4. 1 1
      pages/userCenter/index.vue

+ 19 - 11
pages/sales/bill.vue

@@ -43,16 +43,16 @@
 					待收:
 					<text class="fontColor">¥{{ chooseTotalPayPrice }}</text>
 				</view>
-				<view v-if="chooseList.length > 0 && backDiscountVal&&backDiscountVal!=0">
+				<view v-if="chooseList.length > 0 && backDiscountVal">
 					折后:
 					<text class="fontColor">¥{{ backDiscountPrice }}</text>
 				</view>
 				<view class="u-flex" v-if="chooseList.length > 0">
 					<view>
 						折让:
-						<text>¥{{ backDiscountVal }}</text>
+						<text>¥{{ Number(backDiscountVal) ? Number(backDiscountVal).toFixed(2) : 0 }}</text>
 					</view>
-					<view class="costBtn" @click="costShow = true">打折</view>
+					<view class="costBtn" @click="openCostShow">打折</view>
 				</view>
 			</view>
 			<view class="f-btns">
@@ -95,7 +95,7 @@
 					</view>
 					<view class="tip" v-if="discountVal*1 > chooseTotalPayPrice*1">折让金额不能大于待收金额,请重新输入</view>
 					<view class="costText">折让后金额</view>
-					<view class="costText">¥{{ settlement }}</view>
+					<view class="costText">¥{{ settlement<0?0:settlement }}</view>
 				</view>
 				<u-button type="primary" :custom-style="customStyle"  shape="circle" @click="handleDisCount">确定</u-button>
 			</view>
@@ -113,7 +113,6 @@
 import billList from './billListComponent.vue';
 import { queryUnsettleSaleList, insert } from '@/api/verify.js';
 import getDate from '@/libs/getDate.js';
-import {formatDecimal} from '@/libs/tools.js'
 export default {
 	components: { billList },
 	data() {
@@ -195,7 +194,7 @@ export default {
 			shareShow: false,
 			verifySn:'',
 			backDiscountPrice:null,
-			backDiscountVal:'0.00',
+			backDiscountVal: 0,
 			cycleNameShow:''
 		};
 	},
@@ -272,8 +271,9 @@ export default {
 		settlement() {
 			let totalPrice=this.chooseTotalPayPrice?this.chooseTotalPayPrice:0;
 			let discountPrice=this.discountVal?this.discountVal:0
-			let priceNum=(totalPrice - discountPrice)>0?(totalPrice - discountPrice) :0;
-			return priceNum.toFixed(2)
+			let priceNum=totalPrice - discountPrice;
+			const ret = priceNum.toFixed(2)
+			return Number(this.chooseTotalPayPrice)>=Number(this.backDiscountVal) ? ret : 0
 		}
 	},
 	methods: {
@@ -378,6 +378,10 @@ export default {
 				url
 			});
 		},
+		openCostShow(){
+			this.costShow = true
+			this.discountVal = this.backDiscountVal||''
+		},
 		handleDisCount() {
 			if (this.discountVal*1 > this.chooseTotalPayPrice*1) {
 				uni.showToast({
@@ -433,12 +437,16 @@ export default {
 				}
 			}
 			if(this.settlement *1 <0){
-				this.backDiscountVal = '0.00'
-				this.discountVal = ''
+				this.backDiscountVal = 0
 			}else{
-				this.backDiscountVal = this.discountVal?(this.discountVal).toFixed(2):'0.00'
+				this.backDiscountVal = this.discountVal
 			}
 			 this.backDiscountPrice = this.settlement
+			 
+			if(Number(this.chooseTotalPayPrice)<Number(this.backDiscountVal)){
+				this.backDiscountVal = 0
+				this.discountVal = 0
+			}
 			// 是否全选
 			this.allChecked = isAllChecked;
 		},

+ 1 - 2
pages/sales/index.vue

@@ -35,7 +35,6 @@
 					<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_ARStatement_mobile')">
 					<u-image class="nav-pic" :src="`../../static/${theme}/navIcon/billImg.png`" width="64" height="64"></u-image>
 					<text class="nav-txt">应收对账单</text>
@@ -264,7 +263,7 @@
 		}
 		.nav-cont{
 			.nav-item{
-				width: 32%;
+				flex:1;
 				margin-right: 2%;
 				border-radius: 25upx;
 				background-color: #ffffff;

+ 9 - 0
pages/sales/salesSearch.vue

@@ -109,6 +109,13 @@
 			// 查询
 			handleSearch() {
 				let params = JSON.parse(JSON.stringify(this.form))
+				console.log(params)
+				if(!params.settleStyleSn){
+					params.settleStyleSn = ''
+				}
+				if(!params.sourceType){
+					params.sourceType = ''
+				}
 				delete params.date
 				this.$emit('refresh', params)
 				this.isShow = false
@@ -120,6 +127,8 @@
 				this.form.beginDate = ''
 				this.form.endDate = ''
 				this.$refs.uForm.resetFields()
+				this.clearSettleStyle()
+				this.clearSourceType()
 				this.$emit('refresh', null)
 				this.isShow = false
 				this.clearTime()

+ 1 - 1
pages/userCenter/index.vue

@@ -23,7 +23,7 @@
 					<u-badge :count="noReadNums" :absolute="false" slot="right-icon"></u-badge>
 				</u-cell-item>
 				<u-cell-item icon="edit-pen" icon-size="38" :icon-style="{color:'#00aaff'}" index="1" @click="toPage(1)" title="修改密码"></u-cell-item>
-				<u-cell-item  index="1" @click="toPage(4)" title="系统参数">
+				<u-cell-item  index="1" @click="toPage(4)" title="系统参数" v-if="$hasPermissions('M_ARStatement_mobile')">
 					<u-icon slot="icon" name="xitongcanshu-05" custom-prefix="iscm-icon" size="42" color="#00aaff"></u-icon>
 				</u-cell-item>
 				<u-cell-item icon="man-delete" icon-size="38" :icon-style="{color:'#00aaff'}" index="1" @click="closeAccount" title="注销账户"></u-cell-item>