search.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <template>
  2. <view>
  3. <view class="search-box">
  4. <view class="ssbot dflex">
  5. <view class="searchbot dflex">
  6. <image src="../merchant/static/images/ssico.png"></image>
  7. <input placeholder="请输入订单号、客户手机号后4位" class="flex" :value="searchTitle" @input="onSearch" @confirm="confirm" confirm-type="search" />
  8. <!-- <image src="/static/images/clear.png" @tap="clearInput" v-if="searchTitle != ''"></image> -->
  9. <view class="sousuo" @click="searchClick()">搜索</view>
  10. </view>
  11. </view>
  12. <!-- <span>搜索</span> -->
  13. </view>
  14. <!-- <view class="nodata" v-if="ishow">
  15. <image src="/static/images/empty_dd.png" />
  16. <view>还没有订单哦</view>
  17. </view> -->
  18. <ul class="list" v-if="pageList && pageList.length > 0">
  19. <li v-for="(item, index) in pageList" :key="index">
  20. <view class="ddbh dflex" @click="toOrederDel(item.id)">
  21. <view class="ordid">
  22. <image src="../merchant/static/images/ziti.png" class="ziti" v-if="item.mode == 1" />
  23. <image src="../merchant/static/images/youji.png" class="youji" v-if="item.mode == 2" />
  24. <image src="../merchant/static/images/jishida.png" class="jsd" v-if="item.mode == 3" />
  25. {{ item.id }}
  26. </view>
  27. <view class="flex dflex right ddddd">
  28. <!-- <block v-if="item.state == 4 && (item.orderType == 17 || item.orderType == 18)"></block>
  29. <block v-else>
  30. <view class="th-code red" v-if="item.mode === 1">
  31. 提货码:
  32. <text>{{ item.code }}</text>
  33. </view>
  34. </block> -->
  35. <image src="../merchant/static/images/jishidaioc.png" class="type" v-if="item.orderType === 5" />
  36. <image src="../merchant/static/images/tuangou.png" class="type" v-if="item.orderType === 2" />
  37. <image src="../merchant/static/images/pingtuan.png" class="type" v-if="item.orderType == 4" />
  38. <image src="../merchant/static/images/seckill.png" class="type" v-if="item.orderType == 3" />
  39. <image src="../merchant/static/images/newbornZone.png" class="type" v-if="item.orderType == 6" />
  40. <image src="../merchant/static/images/kanjia.png" class="type" v-if="item.orderType == 7" />
  41. </view>
  42. </view>
  43. <view class="lis" v-for="(pro, ind) in item.products" :key="ind" @click="toOrederDel(item.id)">
  44. <image :src="pro.pic" class="cimage" />
  45. <view class="zhinfo">
  46. <view class="zhtit" v-text="pro.title"></view>
  47. <view class="jiage">
  48. <view class="price">
  49. <span>¥</span>
  50. {{ pro.salePrice }}
  51. </view>
  52. <view class="num">×{{ pro.quantity }}</view>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="total" @click="toOrederDel(item.id)">
  57. <view>共{{ item.count }}件</view>
  58. <view>
  59. 总计:
  60. <span>¥{{ item.money }}</span>
  61. </view>
  62. </view>
  63. <view class="status">
  64. <block v-if="item.state == 4 && (item.orderType == 17 || item.orderType == 18)"><view class="flex">待核销</view></block>
  65. <span v-else class="ordidss flex">{{ item.stateName }}</span>
  66. <view class="sta-btn" v-if="merchant.printer != 0 && (item.state == 3 || item.state == 4)" @click="orderPrinting(item.id, index)">打印小票</view>
  67. <view class="sta-btn" v-if="item.state > 29 && item.state < 41 && item.state != 32" @click="jumpUrl('refund?id=' + item.id)">审核</view>
  68. <view class="sta-btn" v-if="item.state == 3" @click="deliverGoods(item.id, merchantId, item.orderType)">确认发货</view>
  69. <block v-if="item.orderType != 17 && item.orderType != 18">
  70. <view class="sta-btn" v-if="item.state === 4" @click="send(item.id)">通知取件</view>
  71. <view class="sta-btn" v-if="item.state === 4" @click="deliver(item.id, index)">提货</view>
  72. </block>
  73. <block v-else><view class="sta-btn" v-if="item.state === 4" @click="deliver(item.id, index)">核销</view></block>
  74. </view>
  75. </li>
  76. </ul>
  77. <view v-else class="nodata">
  78. <image src="../merchant/static/images/empty.png"></image>
  79. <view>暂无数据</view>
  80. </view>
  81. </view>
  82. </template>
  83. <script>
  84. // import cache from '../datas/cache'
  85. const req = require('../utils/request');
  86. export default {
  87. data: () => ({
  88. pageList: [],
  89. searchTitle: '',
  90. ishow: false,
  91. params: {
  92. page: 0,
  93. limit: 10
  94. },
  95. merchant: {},
  96. userInfo: {},
  97. isLoad: true,
  98. merchantId: ''
  99. }),
  100. onLoad(opt) {
  101. this.userInfo = req.getStorage('userInfo');
  102. this.searchTitle = opt.searchValue;
  103. this.merchantId = opt.merchantId;
  104. this.isPrinting();
  105. this.confirm(true);
  106. },
  107. onShow() {},
  108. onReachBottom() {
  109. this.params.page++;
  110. this.confirm(false);
  111. },
  112. methods: {
  113. jumpUrl(url) {
  114. uni.navigateTo({
  115. url: url
  116. });
  117. },
  118. // s是否开启云打印
  119. isPrinting() {
  120. let fromP = {};
  121. fromP.id = this.merchantId;
  122. req.getRequest('/api/merchant/detail', fromP, data => {
  123. this.merchant = data;
  124. });
  125. },
  126. //是否为自己发货
  127. isMyDeliver(item) {
  128. return item.supplierId == this.userInfo.supplierId;
  129. },
  130. // 搜索订单 获取用户输入的内容
  131. onSearch(e) {
  132. this.searchTitle = e.detail.value;
  133. this.isLoad = true;
  134. console.log(this.searchTitle);
  135. },
  136. // 查看订单详情
  137. toOrederDel(id) {
  138. this.jumpUrl('show?id=' + id + '&merchantId=' + this.merchant.id);
  139. },
  140. searchClick() {
  141. this.isLoad = true;
  142. this.params.page = 0;
  143. this.confirm(true);
  144. },
  145. // 搜索订单
  146. confirm(isShowLoad) {
  147. let that = this;
  148. let value = this.searchTitle;
  149. let form = this.params;
  150. form.search = value;
  151. form.merchantId = this.merchantId;
  152. if (!this.isLoad) return false;
  153. this.isLoad = false;
  154. req.getRequest(
  155. '/api/order/merchant/list',
  156. form,
  157. data => {
  158. if (data && data.length == 10) {
  159. this.isLoad = true;
  160. }
  161. if (that.params.page > 0) {
  162. data = that.pageList.concat(data);
  163. }
  164. this.pageList = data;
  165. },
  166. isShowLoad
  167. );
  168. },
  169. //清除输入框
  170. clearInput() {
  171. this.searchTitle = '';
  172. },
  173. // 查看订单详情
  174. toOrederDel(id) {
  175. this.jumpUrl('show?id=' + id + '&merchantId=' + this.merchant.id);
  176. },
  177. // 打印
  178. orderPrinting(id, index) {
  179. req.getRequest(
  180. '/api/merchant/printOrderInfo',
  181. id,
  182. data => {
  183. req.msg(data.msg);
  184. },
  185. true
  186. );
  187. },
  188. // 确认发货
  189. deliverGoods(id, merchantId, orderType) {
  190. req.postRequest(
  191. '/api/order/deliverExtend',
  192. {
  193. id: id
  194. },
  195. res => {
  196. if (res && res.length > 1) {
  197. this.jumpUrl('deliverExtend?id=' + id + '&merchantId=' + merchantId + '&orderType=' + orderType);
  198. }
  199. if (res && res.length <= 1) {
  200. this.jumpUrl('express?id=' + id + '&merchantId=' + merchantId + '&orderType=' + orderType);
  201. }
  202. },
  203. true
  204. );
  205. },
  206. // 通知取件
  207. send(id) {
  208. req.getRequest(
  209. '/api/wxmes/send',
  210. {
  211. orderId: id,
  212. bsusinessType: 11
  213. },
  214. data => {
  215. req.msg('通知成功');
  216. },
  217. true
  218. );
  219. },
  220. // 已提货
  221. deliver(id, index) {
  222. req.postRequest(
  223. '/api/order/confirm',
  224. {
  225. id: id,
  226. mode: '1'
  227. },
  228. data => {
  229. this.pageList[index].state = 6;
  230. this.pageList[index].stateName = '已签收';
  231. },
  232. true
  233. );
  234. }
  235. }
  236. };
  237. </script>
  238. <style scoped>
  239. @import './static/css/main.css';
  240. .ssbot {
  241. padding: 5px 10px 7px;
  242. -webkit-box-pack: center;
  243. -webkit-justify-content: center;
  244. justify-content: center;
  245. -webkit-box-align: center;
  246. -webkit-align-items: center;
  247. align-items: center;
  248. }
  249. .ssbot .searchbot {
  250. background: #fff;
  251. height: 33px;
  252. border-radius: 15px;
  253. padding: 0 0 0 10px;
  254. font-size: 13px;
  255. color: #666;
  256. width: 100%;
  257. box-sizing: border-box;
  258. align-items: center;
  259. }
  260. .searchbot input {
  261. font-size: 28rpx !important;
  262. color: #333;
  263. }
  264. .searchbot image {
  265. width: 15px;
  266. height: 15px;
  267. margin-right: 6px;
  268. }
  269. .van-button:not(:last-child) {
  270. margin-right: 5px;
  271. }
  272. .list {
  273. padding: 0.2rem 0.2rem 0;
  274. }
  275. </style>