recordOrder.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <view class="">
  3. <u-sticky v-if="!signVisible" style="background-color: white;padding: 0;">
  4. <uni-search-bar @confirm="searchBill" placeholder="请输入搜索内容"></uni-search-bar>
  5. </u-sticky>
  6. <uni-list style="margin-top: -20rpx">
  7. <uni-list-item style="margin-top: 0;padding-top: 0" v-for="(item,index) in billList" :key="item.id" :index="index" :threshold="0">
  8. <template slot="body">
  9. <uni-card>
  10. <view class="demo-layout">
  11. <view>
  12. <text class="tag-con">支付状态</text>
  13. <span>{{ item.shipmentPackageCount }}</span>{{ item.shipmentUnit }}&nbsp;&nbsp;&nbsp;&nbsp;代收金额:<span>{{ item.shipmentMoney }}</span>&nbsp;&nbsp;&nbsp;&nbsp;
  14. </view>
  15. <view>{{ item.erpOrderCode }}</view>
  16. <view>{{ item.clientName }}</view>
  17. <view>{{ item.shipmentName }}&{{item.productName}}</view>
  18. <view style="font-size: 28rpx">{{ item.receiveAddress }}</view>
  19. </view>
  20. </uni-card>
  21. </template>
  22. </uni-list-item>
  23. </uni-list>
  24. <view v-show="isLoadMore && !signVisible">
  25. <uni-load-more :status="loadStatus" showIcon @clickLoadMore="loadMoreBill()"></uni-load-more>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import request from '@/common/libs/request.js';
  31. export default {
  32. data() {
  33. return {
  34. signVisible:false,
  35. fabPattern: {
  36. color: '#7A7E83',
  37. backgroundColor: '#fff',
  38. selectedColor: '#007AFF',
  39. buttonColor: '#007AFF',
  40. iconColor: '#fff'
  41. },
  42. billList: [],
  43. page: {
  44. pageIndex: 1,
  45. pageSize: 20
  46. },
  47. isLoadMore: true,
  48. loadStatus: 'noMore',
  49. }
  50. },
  51. onLoad() {
  52. this.getSignBillList();
  53. },
  54. created(){
  55. uni.$on('eventName',this.handelEvent)
  56. },
  57. onPullDownRefresh() {
  58. this.billList = [];
  59. this.getSignBillList();
  60. },
  61. methods: {
  62. handelEvent(data){
  63. this.billList.splice(data, 1)
  64. },
  65. scanFabClick() {
  66. //扫码
  67. let _that = this;
  68. uni.scanCode({
  69. onlyFromCamera: true,
  70. scanType: ['barCode', 'qrCode'],
  71. success: function (res) {
  72. console.log("res1212",res);
  73. if (res.result.indexOf('sendOrder') != -1) {
  74. let idOrder = res.result.split("-")[2];
  75. _that.truckUpOrder(idOrder)
  76. }else if(res.result.indexOf('orderLabel') != -1){
  77. let orderCode = res.result.split("-")[1];
  78. _that.getShipDetails(orderCode)
  79. }else {
  80. uni.showToast({
  81. title: "请扫正确的二维码",
  82. icon: 'none'
  83. })
  84. }
  85. }
  86. })
  87. },
  88. truckUpOrder(idOrder){
  89. let _that = this;
  90. let parms = {
  91. idOrder: idOrder
  92. }
  93. request.httpPost("/dnyDriver/signInScanSendOrder", parms, true).then(res => {
  94. console.log('res444',res);
  95. })
  96. },
  97. getShipDetails(orderCode){
  98. let _that = this;
  99. let parms = {
  100. orderCode: orderCode
  101. }
  102. request.httpPost("/dnyDriver/signInScanERPOrder", parms, true).then(res => {
  103. _that.signVisible = true;
  104. })
  105. },
  106. getSignBillList: function () {
  107. let _that = this;
  108. var info = {
  109. }
  110. let listData = {
  111. params: JSON.stringify(info),
  112. page: JSON.stringify(_that.page)
  113. }
  114. request.httpPost("/dnyDriver/driverQuerySignInItem", listData, true).then(res => {
  115. // console.log("res1111", res);
  116. uni.stopPullDownRefresh();
  117. if (!res.data || res.data.length == 0) {
  118. this.loadStatus = "noMore";
  119. return;
  120. }
  121. this.billList = this.billList.concat(res.data);
  122. this.loadStatus = "more";
  123. // supplierIndex = 0;
  124. });
  125. },
  126. searchBill(res) {
  127. },
  128. loadMoreBill: function () {
  129. this.loadStatus = "loading";
  130. setTimeout(() => {
  131. this.page.pageIndex += 1;
  132. this.getSignBillList();
  133. }, 100);
  134. },
  135. viewDetail: function (item) {
  136. // console.log(item.id);
  137. uni.navigateTo({
  138. url: "./detail?id=" + item.id + "&billCode=" + item.billCode,
  139. animationType: 'pop-in'
  140. })
  141. },
  142. parseBillState: function (item) {
  143. if (item.voidFlag == 1) {
  144. return "已作废";
  145. } else if (item.billState == 1) {
  146. return "已下达";
  147. } else {
  148. return "";
  149. }
  150. },
  151. viewOrderTrace: function (item,index) {
  152. // console.log(item.id);
  153. uni.navigateTo({
  154. url: "../feedback/traceCamera?idOrder=" + item.id + "&orderCode=" + item.erpOrderCode + "&shipmentName=" + item.shipmentName+ "&index=" + index
  155. });
  156. }
  157. }
  158. }
  159. </script>
  160. <style lang="scss" scoped>
  161. .tag-con {
  162. color: #e4493c;
  163. margin-right: 20rpx;
  164. }
  165. /deep/ .uni-list-item__container {
  166. padding: 0rpx;
  167. }
  168. .demo-layout span {
  169. font-weight: bold;
  170. color: #e4493c;
  171. padding: 0 5rpx;
  172. }
  173. /deep/ .uni-list-item__container {
  174. padding: 0 rpx;
  175. }
  176. /deep/ .uni-card uni-card--border{
  177. padding: 0 rpx;
  178. }
  179. .card-actions {
  180. display: flex;
  181. flex-direction: row;
  182. justify-content: space-around;
  183. align-items: center;
  184. height: 45px;
  185. border-top: 1px #eee solid;
  186. }
  187. .card-actions-item {
  188. display: flex;
  189. flex-direction: row;
  190. align-items: center;
  191. }
  192. .card-actions-item-text {
  193. font-size: 12px;
  194. color: #666;
  195. margin-left: 5px;
  196. }
  197. .textTitle {
  198. border-left: 0px solid #007AFF;
  199. display: inline-block;
  200. width: 180 rpx;
  201. text-align: left;
  202. margin-bottom: 5px;
  203. color: #8799a3;
  204. }
  205. </style>