|
@@ -18,23 +18,23 @@
|
|
|
<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="cycleName" @click="showSearch = true" disabled placeholder="请选择对账日期" />
|
|
|
+ <u-input v-model="cycleName" @click="chooseCycleData" disabled placeholder="请选择对账日期" />
|
|
|
<u-icon name="arrow-right" color="#999" size="30"></u-icon>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <view class="statistical u-flex">
|
|
|
- <view class="statisticalList">
|
|
|
- <text>总单数:</text>
|
|
|
- <text>{{ bill.length }}</text>
|
|
|
- </view>
|
|
|
- <view class="statisticalList">
|
|
|
- <text>待收金额合计:</text>
|
|
|
- <text>¥{{ totalPayPrice }}</text>
|
|
|
+ <view class="statistical u-flex">
|
|
|
+ <view class="statisticalList">
|
|
|
+ <text>总单数:</text>
|
|
|
+ <text>{{ bill.length }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="statisticalList">
|
|
|
+ <text>待收金额合计:</text>
|
|
|
+ <text>¥{{ totalPayPrice }}</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="chooseCon"><billList ref="bill" :showCheck="true" :list="bill" @allChecked="allCheckedCallback"></billList></view>
|
|
|
- <view class="footer u-flex">
|
|
|
+ <view class="footerCon u-flex">
|
|
|
<view class="f-left">
|
|
|
<u-checkbox @change="allCheckeChange" v-model="allChecked" shape="circle">{{ allChecked ? '取消全选' : '全选' }}</u-checkbox>
|
|
|
</view>
|
|
@@ -56,7 +56,9 @@
|
|
|
</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" :loading="submitLoading" shape="circle" type="primary" hover-class="none">
|
|
|
+ 发送对账单
|
|
|
+ </u-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 对账周期弹窗 -->
|
|
@@ -99,7 +101,11 @@
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
<!-- 对账周期弹窗 -->
|
|
|
- <u-modal v-model="tipShow" :show-title="false" :content="tipContent" confirm-text="知道了"></u-modal>
|
|
|
+ <u-modal v-model="tipShow" :show-title="false" confirm-text="知道了">
|
|
|
+ <view class="slot-content"><rich-text :nodes="tipContent"></rich-text></view>
|
|
|
+ </u-modal>
|
|
|
+ <!-- 分享询问弹窗 -->
|
|
|
+ <u-modal v-model="shareShow" :content="shareContent" @confirm="handleShare" @cancel="shareShow = false"></u-modal>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -127,7 +133,8 @@ export default {
|
|
|
allChecked: false,
|
|
|
tipShow: false,
|
|
|
discountVal: null, //折让金额
|
|
|
- tipContent: `账单周期指销售单的创建时间`,
|
|
|
+ tipContent: `账单周期指<br>销售单的创建时间`,
|
|
|
+ shareContent:`是否同意发送对账单给微信好友?`,
|
|
|
placeTab: [
|
|
|
{
|
|
|
name: '今日',
|
|
@@ -182,7 +189,9 @@ export default {
|
|
|
bill: [],
|
|
|
dateArray: '',
|
|
|
chooseList: [],
|
|
|
- isDetailShow:false
|
|
|
+ isDetailShow: false,
|
|
|
+ submitLoading: false,
|
|
|
+ shareShow: false
|
|
|
};
|
|
|
},
|
|
|
onReady() {
|
|
@@ -224,12 +233,18 @@ export default {
|
|
|
this.showSearch = false;
|
|
|
} else {
|
|
|
uni.removeStorageSync('curTab');
|
|
|
+ uni.removeStorageSync('chooseList');
|
|
|
}
|
|
|
},
|
|
|
onUnload() {
|
|
|
uni.removeStorageSync('curTab');
|
|
|
+ uni.removeStorageSync('chooseList');
|
|
|
},
|
|
|
computed: {
|
|
|
+ //经销商信息
|
|
|
+ userData(){
|
|
|
+ return this.$store.state.vuex_userData;
|
|
|
+ },
|
|
|
totalPayPrice() {
|
|
|
let totalPrice = 0;
|
|
|
for (let i = 0; i < this.bill.length; i++) {
|
|
@@ -251,7 +266,11 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- handleClean(){
|
|
|
+ chooseCycleData() {
|
|
|
+ uni.setStorageSync('chooseList', this.chooseList);
|
|
|
+ this.showSearch = true;
|
|
|
+ },
|
|
|
+ handleClean() {
|
|
|
this.showSearch = false;
|
|
|
let systemList = this.$store.state.vuex_systemSetList;
|
|
|
let cycleObj = systemList.find(item => {
|
|
@@ -285,6 +304,13 @@ export default {
|
|
|
queryUnsettleSaleList(this.params).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.bill = res.data;
|
|
|
+ let chooseArr = uni.getStorageSync('chooseList');
|
|
|
+ if (chooseArr && chooseArr.length > 0) {
|
|
|
+ res.data.map(item => {
|
|
|
+ const row = chooseArr.find(k => k.bizSn == item.bizSn);
|
|
|
+ item.checked = !!row;
|
|
|
+ });
|
|
|
+ }
|
|
|
this.$refs.bill.setData(res.data);
|
|
|
}
|
|
|
});
|
|
@@ -328,20 +354,20 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
handleDisCount() {
|
|
|
- if(this.discountVal > this.chooseTotalPayPrice){
|
|
|
+ if (this.discountVal > this.chooseTotalPayPrice) {
|
|
|
uni.showToast({
|
|
|
title: '折让金额不能大于待收金额,请重新输入',
|
|
|
icon: 'none'
|
|
|
});
|
|
|
- return
|
|
|
+ return;
|
|
|
}
|
|
|
- let reg=/^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/;
|
|
|
- if(!reg.test(this.discountVal)){
|
|
|
+ let reg = /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/;
|
|
|
+ if (!reg.test(this.discountVal)) {
|
|
|
uni.showToast({
|
|
|
title: '折让金额格式不正确,请重新输入',
|
|
|
icon: 'none'
|
|
|
});
|
|
|
- return
|
|
|
+ return;
|
|
|
}
|
|
|
this.costShow = false;
|
|
|
},
|
|
@@ -362,9 +388,16 @@ export default {
|
|
|
detailList: this.chooseList
|
|
|
};
|
|
|
let ajaxData = Object.assign(this.params, obj);
|
|
|
+ this.submitLoading = true;
|
|
|
insert(ajaxData).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- this.goShare();
|
|
|
+ this.submitLoading = true;
|
|
|
+ this.shareShow = true;
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.message,
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -390,15 +423,29 @@ export default {
|
|
|
this.allChecked = isAllChecked;
|
|
|
},
|
|
|
// 分享图文
|
|
|
- goShare() {
|
|
|
- uni.shareWithSystem({
|
|
|
- summary: '',
|
|
|
- href: '',
|
|
|
- success() {
|
|
|
- // 分享完成,请注意此时不一定是成功分享
|
|
|
+ handleShare(){
|
|
|
+ let obj = {
|
|
|
+ endTime: this.params.bizEndDate,
|
|
|
+ startTime: this.params.bizBeginDate,
|
|
|
+ customerSn: this.customerObj.customerSn,
|
|
|
+ customerName: this.customerObj.customerName,
|
|
|
+ userName:this.userData.orgName,
|
|
|
+ userSn:this.userData.orgSn
|
|
|
+ };
|
|
|
+ let url = '/hybrid/html/index.html?data=' + JSON.stringify(obj);
|
|
|
+ uni.share({
|
|
|
+ provider: 'weixin',
|
|
|
+ scene: 'WXSceneSession',
|
|
|
+ type: 0,
|
|
|
+ href: url,
|
|
|
+ title: this.customerObj.customerName,
|
|
|
+ summary: '共' + this.settlement + '元,请您查阅',
|
|
|
+ imageUrl: '../../static/logo.png',
|
|
|
+ success: function(res) {
|
|
|
+ console.log('success:' + JSON.stringify(res));
|
|
|
},
|
|
|
- fail() {
|
|
|
- // 分享失败
|
|
|
+ fail: function(err) {
|
|
|
+ console.log('fail:' + JSON.stringify(err));
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -417,7 +464,7 @@ export default {
|
|
|
box-sizing: border-box;
|
|
|
padding: 16rpx 20rpx;
|
|
|
background: #fff;
|
|
|
- &:last-child {
|
|
|
+ &:nth-child(2) {
|
|
|
border-top: 1rpx solid #e4e7ed;
|
|
|
}
|
|
|
.list_l {
|
|
@@ -433,33 +480,37 @@ export default {
|
|
|
width: calc(100% - 208rpx);
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- .statistical {
|
|
|
- padding: 20rpx;
|
|
|
- background: #fff;
|
|
|
- margin: 10rpx 0;
|
|
|
- .statisticalList {
|
|
|
- &:first-child {
|
|
|
- width: 210rpx;
|
|
|
+
|
|
|
+ .statistical {
|
|
|
+ padding: 20rpx;
|
|
|
+ background: #fff;
|
|
|
+ margin: 10rpx 0;
|
|
|
+ .statisticalList {
|
|
|
+ &:first-child {
|
|
|
+ width: 210rpx;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- text {
|
|
|
- &:last-child {
|
|
|
- color: $uni-color-warning;
|
|
|
- font-weight: 600;
|
|
|
+ text {
|
|
|
+ &:last-child {
|
|
|
+ color: $uni-color-warning;
|
|
|
+ font-weight: 600;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.chooseCon {
|
|
|
flex-grow: 1;
|
|
|
+ flex-basis:0;
|
|
|
overflow: auto;
|
|
|
background-color: #fff;
|
|
|
}
|
|
|
- .footer {
|
|
|
+ .footerCon {
|
|
|
background-color: #f8f8f8;
|
|
|
- padding: 10rpx 20rpx;
|
|
|
+ padding:10rpx 20rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
.f-mid {
|
|
|
- flex-grow: 1;
|
|
|
+ flex:1;
|
|
|
color: #666;
|
|
|
font-size: 0.8rem;
|
|
|
> view {
|
|
@@ -568,5 +619,11 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .slot-content {
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: $u-content-color;
|
|
|
+ padding:60rpx 30rpx;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|