assistant.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <template>
  2. <div class="iApp">
  3. <div class="log_list" v-if="list.length">
  4. <!-- <div class="history">
  5. <div class="btn" @click="toHistory">
  6. <span>开票历史</span>
  7. </div>
  8. </div> -->
  9. <div class="list_box" v-for="(item, index) of list" :key="index">
  10. <div class="list_item flex_r flex_jb">
  11. <checkbox-group
  12. class="list_item_l flex_c flex_jc"
  13. @change="checkboxChange($event, item)"
  14. >
  15. <label class="option_box mar_t30">
  16. <checkbox
  17. :value="item.order_sn"
  18. :checked="item.isclick"
  19. color="#2DB389"
  20. style="transform: scale(0.7)"
  21. />
  22. </label>
  23. </checkbox-group>
  24. <div class="list_item_r">
  25. <div class="p1 flex_r flex_jb c05">
  26. <span>订单号:{{ item.order_sn }}</span>
  27. <span>{{ $day(item.add_time * 1000).format("YYYY-MM-DD") }}</span>
  28. </div>
  29. <div class="p2 flex_r flex_jb">
  30. <img :src="item.original_img" class="odr_img" alt />
  31. <div class="odr_info flex_c flex_jb">
  32. <div class="tit ellipsis">{{ item.goods_name }}</div>
  33. <div class="num">数量 x{{ item.goods_num }}</div>
  34. <div class="money flex_r flex_jb">
  35. <span>金额{{ item.order_amount }}</span>
  36. <!-- <span>奖励茶宝36</span> -->
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. <div class="zanwu" v-else>
  45. <img src="@/static/img/zanwu.png" alt="" class="zanwuimg">
  46. <view class="zanwutxt">暂无可开票订单</view>
  47. </div>
  48. <div class="bottom" v-if="list.length">
  49. <div class="left">
  50. <span>共</span>
  51. <span class="green">{{ trueTotal }}</span>
  52. <span>笔订单,合计</span>
  53. <span class="green">¥{{ money }}</span>
  54. <span>元</span>
  55. </div>
  56. <div class="right">
  57. <div class="button" @click="toEditinvoice">
  58. <span>下一步</span>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </template>
  64. <script>
  65. import { post } from "@/request/api.js";
  66. var app = getApp();
  67. var appEv = app.$vm.$options;
  68. export default {
  69. name: "iApp",
  70. components: {},
  71. data() {
  72. return {
  73. list: [],
  74. page: 1,
  75. rows: 10,
  76. selectedId: [],
  77. selectedLi: [],
  78. // height: undefined,
  79. trueTotal: 0,
  80. money: 0,
  81. };
  82. },
  83. onLoad(option) {
  84. let that = this;
  85. uni.getSystemInfo({
  86. success: function (res) {
  87. // that.height = res.windowHeight * 2 - 150 + "rpx";
  88. that.getList();
  89. },
  90. });
  91. },
  92. onLaunch() {},
  93. onShow() {},
  94. onHide() {},
  95. //页面上拉触底事件的处理函数
  96. onReachBottom() {
  97. if (this.page != -1) {
  98. var that = this;
  99. setTimeout(function () {
  100. that.page++;
  101. that.getList();
  102. }, 800);
  103. }
  104. },
  105. methods: {
  106. getList() {
  107. let data = {
  108. page: this.page,
  109. rows: this.rows,
  110. };
  111. post("v1/invoice/orderList", data).then((res) => {
  112. if (res.code == 0) {
  113. this.list = this.list.concat(res.data.data);
  114. this.total = res.data.total;
  115. if (Math.ceil(this.total / this.rows) <= this.page) {
  116. this.page = -1;
  117. }
  118. }
  119. });
  120. },
  121. checkboxChange(e, item) {
  122. this.trueTotal = 0;
  123. this.money = 0;
  124. if (item.isclick == true) {
  125. this.$set(item, "isclick", false);
  126. } else {
  127. this.$set(item, "isclick", true);
  128. }
  129. for (let i of this.list) {
  130. if (i.isclick) {
  131. this.trueTotal++;
  132. this.money = this.money + i.order_amount * 1;
  133. }
  134. }
  135. },
  136. toHistory() {
  137. this.goto("/pagesB/invoice/invoiceList");
  138. },
  139. toEditinvoice() {
  140. if (this.trueTotal == 0) {
  141. appEv.errTips("请先选择订单");
  142. return;
  143. }
  144. let list = [];
  145. for (let i of this.list) {
  146. if (i.isclick == true) {
  147. list.push(i.order_id);
  148. }
  149. }
  150. uni.navigateTo({
  151. url:
  152. "/pagesB/invoice/editinvoice?icheckList=" +
  153. list.toString() +
  154. "&money=" +
  155. this.money,
  156. });
  157. // this.goto("/pagesB/invoice/editinvoice",{checkList : list.toString(),money:this.money});
  158. },
  159. },
  160. computed: {},
  161. watch: {},
  162. };
  163. </script>
  164. <style scoped lang='scss'>
  165. .iApp {
  166. min-height: 100vh;
  167. background: #fff;
  168. .log_list {
  169. padding: 0rpx 32rpx 100rpx;
  170. .history {
  171. display: flex;
  172. justify-content: flex-end;
  173. // background-color: red;
  174. align-items: center;
  175. margin-right: 30rpx;
  176. margin-top: 30rox;
  177. height: 100rpx;
  178. .btn {
  179. padding: 10rpx 20rpx;
  180. background-color: #2db389;
  181. border-radius: 10rpx;
  182. span {
  183. color: #fff;
  184. }
  185. }
  186. }
  187. overflow: scroll;
  188. .log_title {
  189. line-height: 40rpx;
  190. margin-bottom: 20rpx;
  191. .tit {
  192. font-size: 36rpx;
  193. font-weight: bold;
  194. .log_num {
  195. font-size: 28rpx;
  196. margin-left: 10rpx;
  197. }
  198. .active {
  199. border-bottom: 4rpx solid #3a88ff;
  200. }
  201. }
  202. .mor {
  203. font-size: 24rpx;
  204. color: rgba($color: #000, $alpha: 0.5);
  205. .icofont {
  206. font-size: 22rpx;
  207. }
  208. }
  209. }
  210. .list_box {
  211. margin-top: 20rpx;
  212. .list_item {
  213. background: #fff;
  214. padding: 32rpx;
  215. border-radius: 16rpx;
  216. margin-bottom: 20rpx;
  217. border: 1px solid #ddd;
  218. .list_item_l {
  219. width: 68rpx;
  220. // text-align: center;
  221. .iconfont {
  222. font-size: 36rpx;
  223. }
  224. }
  225. .list_item_r {
  226. width: calc(100% - 68rpx);
  227. }
  228. &:last-child {
  229. margin-bottom: 0;
  230. }
  231. }
  232. .p1 {
  233. font-size: 25rpx;
  234. margin-bottom: 20rpx;
  235. }
  236. .p2 {
  237. .odr_img {
  238. object-fit: cover;
  239. width: 120rpx;
  240. height: 112rpx;
  241. }
  242. .odr_info {
  243. width: calc(100% - 120rpx - 20rpx);
  244. font-size: 24rpx;
  245. color: rgba($color: #000, $alpha: 0.5);
  246. .tit {
  247. color: rgba($color: #000, $alpha: 0.9);
  248. }
  249. }
  250. }
  251. }
  252. }
  253. .bottom {
  254. position: fixed;
  255. left: 0;bottom: 0;
  256. background: #fff;
  257. border-top: 1px solid #ddd;
  258. height: 100rpx;
  259. width: 100%;
  260. z-index: 999;
  261. display: flex;
  262. flex-direction: row;
  263. justify-content: space-between;
  264. align-items: center;
  265. padding: 0 32rpx;
  266. .left {
  267. display: flex;
  268. flex-direction: row;
  269. .green {
  270. color: #2db389;
  271. margin: 0 6rpx;
  272. }
  273. }
  274. .right {
  275. display: flex;
  276. justify-content: center;
  277. align-items: center;
  278. .button {
  279. padding: 10rpx 20rpx;
  280. background-color: #2db389;
  281. border-radius: 10rpx;
  282. span {
  283. color: #fff;
  284. }
  285. }
  286. }
  287. }
  288. }
  289. </style>