signOrderCode.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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.shipmentName }}&{{item.productName}}</view>
  18. <view style="font-size: 28rpx">{{ item.receiveAddress }}</view>
  19. </view>
  20. <view slot="actions" class="card-actions">
  21. <view class="card-actions-item" @click="updateBillBtn(item)">
  22. <uni-icons type="info-filled" size="18" color="#999"></uni-icons>
  23. <text class="card-actions-item-text">货款代收</text>
  24. </view>
  25. <view class="card-actions-item" @click="viewOrderTrace(item,index)">
  26. <uni-icons type="camera-filled" size="18" color="#999"></uni-icons>
  27. <text class="card-actions-item-text">拍照签收</text>
  28. </view>
  29. </view>
  30. </uni-card>
  31. </template>
  32. </uni-list-item>
  33. </uni-list>
  34. <view v-show="isLoadMore && !signVisible">
  35. <uni-load-more :status="loadStatus" showIcon @clickLoadMore="loadMoreBill()"></uni-load-more>
  36. </view>
  37. <uni-fab style="bottom: 100rpx;" ref="fab" :pattern="fabPattern" icon="color" :popMenu="false" horizontal="right"
  38. vertical="bottom"
  39. @fabClick="scanFabClick"/>
  40. <u-loading-page :loading="loading"></u-loading-page>
  41. <view>
  42. <u-popup :show="show" @close="close" :closeable="true" mode="center" @open="open">
  43. <view class="popup-con">
  44. <div v-if="qrCodeInfo" class="qrCodeInfo">
  45. {{erpOrderCode}} &nbsp;&nbsp;代收金额:<span>{{qrCodeInfo}}</span>
  46. </div>
  47. <div style="margin: auto;width: 600rpx">
  48. <u--image :showLoading="true" :src="src" width="600rpx" height="600rpx"></u--image>
  49. </div>
  50. <div style="text-align: center;line-height: 60rpx;margin-left: 180rpx;padding-top: 10px">
  51. <span style="float: left">请使用</span>
  52. <u-icon style="float: left" name="zhifubao-circle-fill" color="#2979ff" size="28"></u-icon>
  53. &nbsp;&nbsp;&nbsp;&nbsp;
  54. <u-icon style="float: left" name="weixin-circle-fill" color="#53c21d" size="28"></u-icon>
  55. <span style="float: left">支付</span>
  56. </div>
  57. </view>
  58. </u-popup>
  59. <u-button @click="show = true">打开</u-button>
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. import request from '@/common/libs/request.js';
  65. export default {
  66. data() {
  67. return {
  68. src:"",
  69. qrCodeInfo:"",
  70. erpOrderCode:"",
  71. show:false,
  72. loading:false,
  73. signVisible:false,
  74. fabPattern: {
  75. color: '#7A7E83',
  76. backgroundColor: '#fff',
  77. selectedColor: '#007AFF',
  78. buttonColor: '#007AFF',
  79. iconColor: '#fff'
  80. },
  81. billList: [],
  82. page: {
  83. pageIndex: 1,
  84. pageSize: 20
  85. },
  86. isLoadMore: true,
  87. loadStatus: 'noMore',
  88. }
  89. },
  90. onLoad() {
  91. this.getSignBillList();
  92. },
  93. created(){
  94. uni.$on('eventName',this.handelEvent)
  95. },
  96. onPullDownRefresh() {
  97. this.billList = [];
  98. this.getSignBillList();
  99. },
  100. methods: {
  101. close(){
  102. this.show=false;
  103. },
  104. open(){},
  105. handelEvent(data){
  106. this.billList.splice(data, 1)
  107. },
  108. scanFabClick() {
  109. //扫码
  110. let _that = this;
  111. uni.scanCode({
  112. onlyFromCamera: true,
  113. scanType: ['barCode', 'qrCode'],
  114. success: function (res) {
  115. // console.log("res1212",res);
  116. if (res.result.indexOf('sendOrder') != -1) {
  117. let idOrder = res.result.split("-")[2];
  118. _that.truckUpOrder(idOrder)
  119. }else if(res.result.indexOf('orderLabel') != -1){
  120. let orderCode = res.result.split("-")[1];
  121. _that.getShipDetails(orderCode)
  122. }else {
  123. uni.showToast({
  124. title: "请扫正确的二维码",
  125. icon: 'none'
  126. })
  127. }
  128. }
  129. })
  130. },
  131. truckUpOrder(idOrder){
  132. let _that = this;
  133. _that.billList = [];
  134. let parms = {
  135. idOrder: idOrder
  136. }
  137. request.httpPost("/dnyDriver/signInScanSendOrder", parms, true).then(res => {
  138. _that.signVisible = true;
  139. _that.billList = res.data
  140. })
  141. },
  142. getShipDetails(orderCode){
  143. let _that = this;
  144. _that.billList = [];
  145. let parms = {
  146. orderCode: orderCode
  147. }
  148. request.httpPost("/dnyDriver/signInScanERPOrder", parms, true).then(res => {
  149. _that.signVisible = true;
  150. _that.billList = res.data
  151. })
  152. },
  153. getSignBillList: function () {
  154. let _that = this;
  155. _that.loading = true;
  156. _that.signVisible = false;
  157. var info = {
  158. ltItemState: 5
  159. }
  160. let listData = {
  161. params: JSON.stringify(info),
  162. page: JSON.stringify(_that.page)
  163. }
  164. request.httpPost("/dnyDriver/driverQuerySignInItem", listData, true).then(res => {
  165. _that.loading = false;
  166. // console.log("res1111", res);
  167. uni.stopPullDownRefresh();
  168. if (!res.data || res.data.length == 0) {
  169. this.loadStatus = "noMore";
  170. return;
  171. }
  172. this.billList = this.billList.concat(res.data);
  173. this.loadStatus = "more";
  174. // supplierIndex = 0;
  175. });
  176. },
  177. searchBill(res) {
  178. },
  179. loadMoreBill: function () {
  180. this.loadStatus = "loading";
  181. setTimeout(() => {
  182. this.page.pageIndex += 1;
  183. this.getSignBillList();
  184. }, 100);
  185. },
  186. updateBillBtn: function (item) {
  187. let _that = this;
  188. _that.loading = true;
  189. let parms = {
  190. idOrder: item.idOrder
  191. }
  192. request.httpPost("/dnyDriver/orderPayRequest3", parms, true).then(res => {
  193. // console.log("res333",res);
  194. _that.loading = false;
  195. if (res.httpCode == 200) {
  196. _that.show = true;
  197. _that.erpOrderCode = item.erpOrderCode
  198. _that.qrCodeInfo = res.data.qrCodeInfo
  199. _that.src = res.data.qrCodeImageUrl.substring(1).replace('apis', 'http://192.168.1.24:51106');
  200. console.log(_that.src);
  201. // _that.src = res.data.qrCodeImageUrl
  202. }else {
  203. uni.showToast({
  204. title: res.msg,
  205. icon: 'none',
  206. mask: true,
  207. duration: 1000,
  208. })
  209. }
  210. })
  211. },
  212. parseBillState: function (item) {
  213. if (item.voidFlag == 1) {
  214. return "已作废";
  215. } else if (item.billState == 1) {
  216. return "已下达";
  217. } else {
  218. return "";
  219. }
  220. },
  221. viewOrderTrace: function (item,index) {
  222. // console.log(item.id);
  223. uni.navigateTo({
  224. url: "../feedback/traceCamera?idOrder=" + item.id + "&orderCode=" + item.erpOrderCode + "&shipmentName=" + item.shipmentName+ "&index=" + index
  225. });
  226. }
  227. }
  228. }
  229. </script>
  230. <style lang="scss" scoped>
  231. .qrCodeInfo{
  232. font-size: 30rpx;
  233. }
  234. .qrCodeInfo span{
  235. color: #e4493c !important;
  236. font-size: 30rpx;
  237. font-weight: bold;
  238. }
  239. .popup-con{
  240. min-height: 800rpx;
  241. padding: 40rpx;
  242. width: 700rpx;
  243. margin: auto;
  244. box-sizing: border-box;
  245. }
  246. .tag-con {
  247. color: #e4493c;
  248. margin-right: 20rpx;
  249. }
  250. /deep/ .uni-list-item__container {
  251. padding: 0rpx;
  252. }
  253. .demo-layout span {
  254. font-weight: bold;
  255. color: #e4493c;
  256. padding: 0 5rpx;
  257. }
  258. /deep/ .uni-list-item__container {
  259. padding: 0 rpx;
  260. }
  261. /deep/ .uni-card uni-card--border{
  262. padding: 0 rpx;
  263. }
  264. .card-actions {
  265. display: flex;
  266. flex-direction: row;
  267. justify-content: space-around;
  268. align-items: center;
  269. height: 45px;
  270. border-top: 1px #eee solid;
  271. }
  272. .card-actions-item {
  273. display: flex;
  274. flex-direction: row;
  275. align-items: center;
  276. }
  277. .card-actions-item-text {
  278. font-size: 12px;
  279. color: #666;
  280. margin-left: 5px;
  281. }
  282. .textTitle {
  283. border-left: 0px solid #007AFF;
  284. display: inline-block;
  285. width: 180 rpx;
  286. text-align: left;
  287. margin-bottom: 5px;
  288. color: #8799a3;
  289. }
  290. </style>