billHistoryDetail.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <view class="content flex flex_column" v-if="billInfo">
  3. <view class="b_head">
  4. <view class="head_list">
  5. <text>分享时间</text>
  6. <text>{{ billInfo.createDate }}</text>
  7. </view>
  8. <view class="head_list" v-if="billInfo.customer">
  9. <text>客户名称</text>
  10. <text>{{ billInfo.customer.customerName }}</text>
  11. </view>
  12. <!-- <view class="head_list">
  13. <text>对账周期</text>
  14. <text>{{ timeInfo || '--' }}</text>
  15. </view> -->
  16. <view class="head_list">
  17. <text>付款状态</text>
  18. <text>{{ billInfo.billStatus == 'UNSETTLE' ? '未付款' : billInfo.settleStyleSnDictValue ? '已付款(' + billInfo.settleStyleSnDictValue + ')' : '已付款' }}</text>
  19. </view>
  20. </view>
  21. <view class="b_detail">
  22. <view class="detail_list u-flex">
  23. <view class="detail_box">
  24. <text>总单数:</text>
  25. <text>{{ billInfo.detailNum }}</text>
  26. </view>
  27. <view class="detail_box">
  28. <text>待收金额合计:</text>
  29. <text>¥{{ billInfo.totalAmount ||billInfo.totalAmount == 0 ? toThousands(billInfo.totalAmount,2):'--' }}</text>
  30. </view>
  31. </view>
  32. <view class="detail_list u-flex">
  33. <view class="detail_box">
  34. <text>折让金额:</text>
  35. <text>¥{{ billInfo.discountAmount||billInfo.discountAmount==0? toThousands(billInfo.discountAmount,2):'--'}}</text>
  36. </view>
  37. <view class="detail_box">
  38. <text>折让后待收金额:</text>
  39. <text>¥{{ billInfo.settleAmount||billInfo.settleAmount ==0? toThousands(billInfo.settleAmount,2):'--' }}</text>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="detail_con"><billList ref="billBox" :list="billArr"></billList></view>
  44. <view class="footer" v-if="billInfo.billStatus == 'UNSETTLE'">
  45. <u-button type="primary" :loading="btnLoading" @click="submitOrder" :custom-style="customStyle" shape="circle">再次发送对账单</u-button>
  46. </view>
  47. <!-- 分享询问弹窗 -->
  48. <u-modal v-model="shareShow" :show-cancel-button="true" :content="shareContent" @confirm="handleShare" @cancel="shareShow = false;btnLoading = false;"></u-modal>
  49. </view>
  50. </template>
  51. <script>
  52. import billList from './billListComponent.vue';
  53. import { findBySn, insert } from '@/api/verify.js';
  54. import getDate from '@/libs/getDate.js';
  55. import { toThousands } from '@/libs/tools.js'
  56. export default {
  57. components: { billList },
  58. data() {
  59. return {
  60. customStyle: {
  61. backgroundColor: this.$config('primaryColor'),
  62. color: '#fff',
  63. verifySn: ''
  64. },
  65. billInfo: null,
  66. billArr: [],
  67. timeInfo: '',
  68. btnLoading: false,
  69. shareShow: false,
  70. shareContent: `是否同意发送对账单给微信好友?`,
  71. toThousands
  72. };
  73. },
  74. onReady() {
  75. uni.setNavigationBarColor({
  76. frontColor: '#ffffff',
  77. backgroundColor: this.$config('primaryColor')
  78. });
  79. },
  80. onLoad(options) {
  81. if (options && options.billId) {
  82. this.verifySn = options.billId;
  83. this.loadData({ verifySn: options.billId });
  84. }
  85. },
  86. computed: {
  87. //经销商信息
  88. userData() {
  89. return this.$store.state.vuex_userData;
  90. }
  91. },
  92. methods: {
  93. loadData(ajaxData) {
  94. let that = this;
  95. findBySn(ajaxData).then(res => {
  96. if (res.status == 200) {
  97. that.billInfo = res.data;
  98. that.billArr = res.data.detailList;
  99. let timeobj = getDate.editDay(res.data.bizBeginDate, res.data.bizEndDate);
  100. that.timeInfo = timeobj.starttime + '~' + timeobj.endtime;
  101. that.$nextTick(() => {
  102. that.$refs.billBox.setData(res.data.detailList);
  103. });
  104. }
  105. });
  106. },
  107. submitOrder() {
  108. //发送对账单
  109. this.shareShow = true;
  110. },
  111. // 分享图文
  112. handleShare() {
  113. let jumpUrl = getApp().globalData.baseUrl.replace('qpls-md/','')
  114. let url = jumpUrl+'dzd/index.html?' + this.userData.orgSn + '&' + this.verifySn;
  115. if (uni.getSystemInfoSync().platform == 'ios') {
  116. uni.share({
  117. provider: 'weixin',
  118. scene: 'WXSceneSession',
  119. type: 0,
  120. href: url,
  121. title: this.billInfo.customer.customerName + '的对账单',
  122. summary: '共' + this.billInfo.settleAmount + '元,请您查阅',
  123. imageUrl: '../../static/logo.png',
  124. success: function(res) {
  125. console.log('success:' + JSON.stringify(res));
  126. },
  127. fail: function(err) {
  128. console.log('fail:' + JSON.stringify(err));
  129. }
  130. });
  131. } else {
  132. uni.shareWithSystem({
  133. summary: this.billInfo.customer.customerName + '您好,您有一个对账单共' + this.billInfo.settleAmount + '元,请您查阅',
  134. href: url,
  135. success() {
  136. console.log('调取微信列表成功,分享不一定成功');
  137. },
  138. fail() {
  139. console.log('分享失败');
  140. }
  141. });
  142. }
  143. }
  144. }
  145. };
  146. </script>
  147. <style lang="scss" scoped>
  148. .content {
  149. height: 100vh;
  150. width: 100%;
  151. .b_head {
  152. background-color: #fff;
  153. .head_list {
  154. padding: 14rpx 20rpx;
  155. border-bottom: 1rpx solid #f8f8f8;
  156. text {
  157. &:first-child {
  158. color: $uni-text-color-grey;
  159. display: inline-block;
  160. width: 160rpx;
  161. }
  162. }
  163. }
  164. }
  165. .b_detail {
  166. margin: 6rpx 0;
  167. background-color: #fff;
  168. padding: 20rpx;
  169. box-sizing: border-box;
  170. .detail_list {
  171. margin-bottom: 10rpx;
  172. &:last-child {
  173. margin-bottom: 0rpx;
  174. }
  175. .detail_box::after {
  176. content: ';';
  177. color: $uni-text-color-grey;
  178. }
  179. .detail_box {
  180. text {
  181. &:first-child {
  182. color: $uni-text-color-grey;
  183. }
  184. &:last-child {
  185. color: $uni-color-warning;
  186. font-weight: 600;
  187. }
  188. }
  189. }
  190. }
  191. }
  192. .detail_con {
  193. flex-grow: 1;
  194. overflow: auto;
  195. background-color: #fff;
  196. }
  197. .footer {
  198. padding: 10rpx 20rpx;
  199. background: #fff;
  200. margin-top: 20rpx;
  201. }
  202. }
  203. </style>