recordOrder.vue 5.6 KB

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