invoices.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. <template>
  2. <view>
  3. <view class="search-wrap">
  4. <view class="search-input-inner">
  5. <text class="search-input-icon iconfont iconsousuo" @click.stop="searchGoods()"></text>
  6. <input class="uni-input font-size-tag" maxlength="50" v-model="search_text" placeholder="请输入订单号" @confirm="searchGoods()" />
  7. </view>
  8. <picker @change="bindPickerChange" :value="indexse" :range="array">
  9. <view class="select color-tip">{{array[indexse]}}<text class="iconfont iconiconangledown" style="transform: scale(1.8);"></text></view>
  10. </picker>
  11. </view>
  12. <view class="tab-block">
  13. <view class="tab-wrap">
  14. <block v-for="(item, index) in statusList" :key="index">
  15. <view class="tab-item" @click.stop="tabChange(item.id)" :class="item.id == status ? 'active color-base-text color-base-bg-before' : ''">{{ item.name }}</view>
  16. </block>
  17. </view>
  18. </view>
  19. <mescroll-uni @getData="getList" top="200" ref="mescroll" >
  20. <block slot="list">
  21. <block v-if="dashboard_list.length > 0">
  22. <view class="goods-class" v-for="(item, index) in dashboard_list" :key="index">
  23. <view class="goods-item">
  24. <view class="goods-item-title">
  25. <view class="title-ordernum">订单编号:{{item.order_no}}</view>
  26. <view :class="item.invoice_status == 0 ? 'title-orderactive' : 'title-ordertext'">{{item.invoice_status == 0 ? '未开票' : '已开票'}}</view>
  27. </view>
  28. <view class="goods-item-content">
  29. <view class="content-left">订单总额</view>
  30. <view class="content-right">{{item.order_money}}元</view>
  31. </view>
  32. <view class="goods-item-content" style="align-items: center;">
  33. <view class="content-left">发票金额</view>
  34. <view class="content-right">{{item.invoice_money}}元</view>
  35. <view class="content-last" v-if="item.invoice_delivery_money > 0">发票邮寄费用:{{item.invoice_delivery_money}}</view>
  36. </view>
  37. <view class="goods-item-content">
  38. <view class="content-left">发票类型</view>
  39. <view class="content-right">{{item.order_type_name}}</view>
  40. </view>
  41. <view class="goods-item-content">
  42. <view class="content-left">发票抬头</view>
  43. <view class="content-right">发票抬头:{{item.invoice_title}}<br/>
  44. 抬头类型:{{item.invoice_title_type == 1 ? '个人' : '企业'}}<br/>
  45. 发票内容:{{item.invoice_content}}</view>
  46. </view>
  47. <view class="goods-item-content">
  48. <view class="content-left">发票税率(%)</view>
  49. <view class="content-right">{{item.invoice_rate}}</view>
  50. </view>
  51. <view class="goods-item-content">
  52. <view class="content-left">订单状态</view>
  53. <view class="content-right">{{item.order_status_name}}</view>
  54. </view>
  55. <view class="goods-item-content">
  56. <view class="content-left">下单时间</view>
  57. <view class="content-right">{{$util.timeStampTurnTime(item.create_time)}}</view>
  58. </view>
  59. <view class="goods-item-content" v-if="item.invoice_time">
  60. <view class="content-left">开票时间</view>
  61. <view class="content-right">{{$util.timeStampTurnTime(item.invoice_time)}}</view>
  62. </view>
  63. <view class="goods-btn">
  64. <button type="default" size="mini" class="goods-btn-search" @click="onDetail(item.order_id)">查看订单</button>
  65. <button v-if="item.invoice_status == 0" type="default" size="mini" class="goods-btn-item" @click="onEdit(item.order_id)">开票</button>
  66. </view>
  67. </view>
  68. </view>
  69. </block>
  70. <ns-empty v-if="!dashboard_list.length" text="暂无商品数据"></ns-empty>
  71. </block>
  72. </mescroll-uni>
  73. </view>
  74. </template>
  75. <script>
  76. export default {
  77. data() {
  78. return {
  79. search_text: '',
  80. array: ['全部','普通订单', '自提订单', '外卖订单', '虚拟订单'],
  81. statusList: [
  82. {
  83. id: 0,
  84. name: '全部',
  85. invoice_status: '',
  86. },
  87. {
  88. id: 1,
  89. name: '未开票',
  90. invoice_status: 0,
  91. },
  92. {
  93. id: 2,
  94. name: '已开票',
  95. invoice_status: 1,
  96. }
  97. ],
  98. status: 0,
  99. indexse: 0,
  100. orderType: '',
  101. dashboard_list: []
  102. }
  103. },
  104. onShow(){
  105. if (this.mescroll) this.$refs.mescroll.refresh();
  106. },
  107. methods: {
  108. searchGoods(){
  109. this.$refs.mescroll.refresh();
  110. },
  111. tabChange(e){
  112. this.status = e
  113. this.$refs.mescroll.refresh();
  114. },
  115. onDetail(e){
  116. this.$util.redirectTo('/pages/order/detail/basis', {order_id: e})
  117. },
  118. onEdit(e){
  119. this.$util.redirectTo('/pages/invoices/edit/edit', {order_id: e})
  120. },
  121. bindPickerChange(e){
  122. this.indexse = e.detail.value
  123. if(e.detail.value == 0){
  124. this.orderType = ''
  125. }else{
  126. this.orderType = e.detail.value
  127. }
  128. this.$refs.mescroll.refresh();
  129. },
  130. getList(mescroll) {
  131. var data = {
  132. page: mescroll.num,
  133. page_size: mescroll.size,
  134. invoice_status: this.statusList[this.status].invoice_status,
  135. search_text: this.search_text,
  136. order_type: this.orderType
  137. };
  138. this.$api.sendRequest({
  139. url: '/shopapi/order/invoicelist',
  140. data: data,
  141. success: res => {
  142. let newArr = [];
  143. let msg = res.message;
  144. if (res.code == 0 && res.data) {
  145. if (res.data.page_count == 0) {
  146. this.emptyShow = true;
  147. }
  148. newArr = res.data.list;
  149. } else {
  150. this.$util.showToast({
  151. title: msg
  152. });
  153. }
  154. mescroll.endSuccess(newArr.length);
  155. //设置列表数据
  156. if (mescroll.num == 1) this.dashboard_list = []; //如果是第一页需手动制空列表
  157. this.dashboard_list = this.dashboard_list.concat(newArr); //追加新数据
  158. if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
  159. }
  160. });
  161. }
  162. }
  163. }
  164. </script>
  165. <style lang="scss">
  166. .search-wrap {
  167. display: flex;
  168. justify-content: space-between;
  169. padding: $margin-both;
  170. background-color: #fff;
  171. .search-input-inner {
  172. display: flex;
  173. align-items: center;
  174. width: 460rpx;
  175. height: 70rpx;
  176. padding: 0 30rpx;
  177. background-color: #F8F8F8;
  178. border-radius: 100rpx;
  179. box-sizing: border-box;
  180. .search-input-icon {
  181. margin-right: 10rpx;
  182. color: $color-tip;
  183. }
  184. }
  185. .search-btn {
  186. display: flex;
  187. justify-content: center;
  188. align-items: center;
  189. width: 200rpx;
  190. height: 70rpx;
  191. color: #fff;
  192. border-radius: 100rpx;
  193. text {
  194. margin-right: 10rpx;
  195. }
  196. }
  197. }
  198. .search {
  199. display: flex;
  200. padding: 0 30rpx 30rpx;
  201. justify-content: center;
  202. text-align: center;
  203. .search_input {
  204. padding: 0 20rpx;
  205. background-color: #fff;
  206. flex: 1;
  207. height: 70rpx;
  208. line-height: 70rpx;
  209. border-radius: 70rpx;
  210. display: flex;
  211. align-items: center;
  212. input {
  213. height: 70rpx;
  214. line-height: 70rpx;
  215. border-radius: 70rpx;
  216. padding: 0 $padding;
  217. }
  218. .date {
  219. display: flex;
  220. align-items: center;
  221. flex: 1;
  222. color: $color-tip;
  223. picker {
  224. flex: 1;
  225. &.start{
  226. margin-right: 20rpx !important;
  227. }
  228. &.end{
  229. margin-left: 20rpx !important;
  230. }
  231. }
  232. .clear{
  233. min-width: 60rpx;
  234. }
  235. }
  236. .search_btn {
  237. min-width: 60rpx;
  238. }
  239. .placeholder {
  240. font-size: $font-size-base;
  241. color: $color-tip;
  242. }
  243. }
  244. .search_select {
  245. background-color: #fff;
  246. height: 70rpx;
  247. line-height: 70rpx;
  248. border-radius: 70rpx;
  249. width: 160rpx;
  250. color: $color-tip;
  251. font-size: $font-size-tag;
  252. display: flex;
  253. align-items: center;
  254. justify-content: center;
  255. > text {
  256. margin-left: 10rpx;
  257. }
  258. }
  259. }
  260. .select {
  261. height: 68rpx;
  262. line-height: 68rpx;
  263. border-radius: 35rpx;
  264. min-width: 200rpx;
  265. // max-width: 200rpx;
  266. margin-left: 30rpx;
  267. padding:0 20rpx;
  268. text-align: center;
  269. background: #fff;
  270. border: 1px solid #ccc;
  271. font-size: $font-size-tag;
  272. display: flex;
  273. justify-content: space-between;
  274. align-items: center;
  275. font-size: 28rpx;
  276. text {
  277. vertical-align: middle;
  278. font-size: 28rpx;
  279. }
  280. }
  281. .tab-block {
  282. display: flex;
  283. flex-direction: row;
  284. justify-content: space-between;
  285. background: #fff;
  286. .choose {
  287. min-width: 50px;
  288. background-color: #fff;
  289. padding: 20rpx 0rpx 0 20rpx;
  290. height: 66rpx;
  291. }
  292. .tab-wrap {
  293. width: 100%;
  294. height: 66rpx;
  295. background-color: #fff;
  296. display: flex;
  297. flex-direction: row;
  298. justify-content: space-around;
  299. }
  300. .active {
  301. position: relative;
  302. &::after {
  303. content: '';
  304. position: absolute;
  305. bottom: 0;
  306. left: 0;
  307. height: 4rpx;
  308. width: 100%;
  309. }
  310. }
  311. }
  312. .goods-class {
  313. margin:0 30rpx;
  314. }
  315. .goods-item {
  316. background: #FFFFFF;
  317. border-radius: 10rpx;
  318. margin-top: 20rpx;
  319. padding:30rpx 30rpx 40rpx;
  320. .goods-item-title {
  321. display: flex;
  322. flex-direction: row;
  323. justify-content: space-between;
  324. align-items: center;
  325. height: 70rpx;
  326. border-bottom: 1px solid #eee;
  327. .title-ordernum {
  328. font-size: 24rpx;
  329. font-family: PingFang SC;
  330. font-weight: 500;
  331. color: #909399;
  332. }
  333. .title-ordertext {
  334. font-size: 24rpx;
  335. font-family: PingFang SC;
  336. font-weight: 500;
  337. color: #4456FF;
  338. }
  339. .title-orderactive {
  340. font-size: 24rpx;
  341. font-family: PingFang SC;
  342. font-weight: 500;
  343. color: #FF4544;
  344. }
  345. }
  346. .goods-item-content {
  347. display: flex;
  348. flex-direction: row;
  349. padding-top: 10rpx;
  350. // margin-top:10rpx;
  351. .content-left {
  352. font-size: 26rpx;
  353. font-family: PingFang SC;
  354. font-weight: 500;
  355. color: #303133;
  356. min-width: 160rpx;
  357. }
  358. .content-right {
  359. font-size: 26rpx;
  360. font-family: PingFang SC;
  361. font-weight: 500;
  362. color: #303133;
  363. margin-left: 80rpx;
  364. }
  365. .content-last {
  366. font-size: 24rpx;
  367. font-family: PingFang SC;
  368. font-weight: 500;
  369. color: #FF6A00;
  370. margin-left: 30rpx;
  371. }
  372. }
  373. .goods-btn {
  374. display: flex;
  375. flex-direction: row-reverse;
  376. margin-top: 25rpx;
  377. .goods-btn-search {
  378. // padding:0 20rpx;
  379. color: #303133;
  380. border-color: #909399;
  381. margin-left: 20rpx !important;
  382. }
  383. .goods-btn-item {
  384. color: #FF6A00;
  385. border-color: #FF6A00;
  386. }
  387. }
  388. }
  389. </style>