order.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  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" @tap="confirm">搜索</view>
  10. </view>
  11. </view>
  12. <!-- <span>搜索</span> -->
  13. </view>
  14. <view class="tab">
  15. <view v-for="(item, index) in TabList" :key="index" :class="'li ' + (item.active ? 'active' : '')" @click="switchTab(index)">{{ item.label }}</view>
  16. </view>
  17. <view class="tabcon">
  18. <block v-if="pageList && pageList.length > 0">
  19. <ul class="list" v-if="tabIndex == 3">
  20. <li v-for="(item, index) in pageList" :key="index" @click="jumpUrl('refundDetail?id=' + item.id)">
  21. <view class="ddbh dflex" @click="toOrederDel(item.id)">
  22. <view class="ordid">{{ item.orderId }}</view>
  23. </view>
  24. <view class="lis" v-for="(pro, ind) in item.productList" :key="ind">
  25. <image :src="pro.image" class="cimage" />
  26. <view class="zhinfo">
  27. <view class="zhtit" v-text="pro.title"></view>
  28. <view v-if="pro.specsList && pro.specsList.length > 0" class="guige">
  29. 规格:
  30. <text v-for="(itemGuige, index) in pro.specsList" :key="index" class="guige" decode="true">{{ itemGuige.value }}&nbsp;</text>
  31. </view>
  32. <view class="jiage">
  33. <view class="price">
  34. <span>¥</span>
  35. {{ pro.money }}
  36. </view>
  37. <view class="num">×{{ pro.quantity }}</view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="total">
  42. <view>共{{ item.quantity }}件</view>
  43. <view>
  44. 总计:
  45. <span>¥{{ item.refundMoney }}</span>
  46. </view>
  47. </view>
  48. <view class="status">
  49. <span class="ordidss flex">{{ item.refundStateName }}</span>
  50. <!-- <view class="sta-btn" v-if="item.refundState > 29 && item.refundState < 41 && item.refundState != 32">审核</view> -->
  51. </view>
  52. </li>
  53. </ul>
  54. <ul class="list" v-else>
  55. <li v-for="(item, index) in pageList" :key="index">
  56. <view class="ddbh dflex" @click="toOrederDel(item.id)">
  57. <view class="ordid">
  58. <image src="../merchant/static/images/ziti.png" class="ziti" v-if="item.mode == 1" />
  59. <image src="../merchant/static/images/youji.png" class="youji" v-if="item.mode == 2" />
  60. <image src="../merchant/static/images/jishida.png" class="jsd" v-if="item.mode == 3" />
  61. {{ item.id }}
  62. </view>
  63. <view class="flex dflex right ddddd">
  64. <!-- <block v-if="item.state == 4 && (item.orderType == 17 || item.orderType == 18)"></block>
  65. <block v-else>
  66. <view class="th-code red" v-if="item.mode === 1">
  67. 提货码:
  68. <text>{{ item.code }}</text>
  69. </view>
  70. </block> -->
  71. <image src="../merchant/static/images/jishidaioc.png" class="type" v-if="item.orderType === 5" />
  72. <image src="../merchant/static/images/tuangou.png" class="type" v-if="item.orderType === 2" />
  73. <image src="../merchant/static/images/pingtuan.png" class="type" v-if="item.orderType == 4" />
  74. <image src="../merchant/static/images/seckill.png" class="type" v-if="item.orderType == 3" />
  75. <image src="../merchant/static/images/newbornZone.png" class="type" v-if="item.orderType == 6" />
  76. <image src="../merchant/static/images/kanjia.png" class="type" v-if="item.orderType == 7" />
  77. </view>
  78. </view>
  79. <view class="lis" v-for="(pro, ind) in item.products" :key="ind" @click="toOrederDel(item.id)">
  80. <image :src="pro.pic" class="cimage" />
  81. <view class="zhinfo">
  82. <view class="zhtit" v-text="pro.title"></view>
  83. <view v-if="pro.propertiesList && pro.propertiesList.length > 0" class="guige">
  84. 规格:
  85. <text v-for="(itemGuige, index) in pro.propertiesList" :key="index" class="guige" decode="true">{{ itemGuige.value }}&nbsp;</text>
  86. </view>
  87. <view class="jiage">
  88. <view class="price">
  89. <span>¥</span>
  90. {{ pro.salePrice }}
  91. </view>
  92. <view class="num">×{{ pro.quantity }}</view>
  93. </view>
  94. </view>
  95. </view>
  96. <view class="total" @click="toOrederDel(item.id)">
  97. <view>共{{ item.count }}件</view>
  98. <view>
  99. 总计:
  100. <span>¥{{ item.money }}</span>
  101. </view>
  102. </view>
  103. <view class="status">
  104. <block v-if="item.state == 4 && (item.orderType == 17 || item.orderType == 18)"><view class="flex">待核销</view></block>
  105. <span v-else class="ordidss flex">{{ item.stateName }}</span>
  106. <view class="sta-btn" v-if="merchant.printer != 0 && (item.state == 3 || item.state == 4)" @click="orderPrinting(item.id, index)">打印小票</view>
  107. <!-- <view class="sta-btn" v-if="item.state > 29 && item.state < 41 && item.state != 32" @click="jumpUrl('refund?id=' + item.id)">审核</view> -->
  108. <view class="sta-btn" v-if="item.state == 3" @click="deliverGoods(item.id, merchantId, item.orderType)">确认发货</view>
  109. <block v-if="item.orderType != 17 && item.orderType != 18">
  110. <view class="sta-btn" v-if="item.state === 4" @click="send(item.id)">通知取件</view>
  111. <view class="sta-btn" v-if="item.state === 4" @click="deliver(item.id, index)">提货</view>
  112. </block>
  113. <block v-else>
  114. <view class="sta-btn" v-if="item.state === 4" @click="deliver(item.id, index)">核销</view>
  115. </block>
  116. </view>
  117. </li>
  118. </ul>
  119. </block>
  120. <view v-else class="nodata">
  121. <image src="../merchant/static/images/empty.png"></image>
  122. <view>暂无数据</view>
  123. </view>
  124. </view>
  125. </view>
  126. </template>
  127. <script>
  128. const req = require('../utils/request');
  129. export default {
  130. data() {
  131. return {
  132. TabList: [
  133. {
  134. label: '待发货',
  135. state: 2,
  136. active: false
  137. },
  138. {
  139. label: '待核销',
  140. state: 4,
  141. active: false
  142. },
  143. {
  144. label: '待提货',
  145. state: 3,
  146. active: false
  147. },
  148. {
  149. label: '售后',
  150. state: 7,
  151. active: false
  152. },
  153. {
  154. label: '全部',
  155. active: true
  156. }
  157. ],
  158. merchant: {},
  159. tabIndex: '',
  160. active: 3,
  161. pageList: [],
  162. ishow: false,
  163. id: '',
  164. index: 0,
  165. searchTitle: '',
  166. form: {
  167. page: 0,
  168. limit: 10
  169. },
  170. isLoad: true,
  171. userInfo: {},
  172. type: 1,
  173. merchantId: ''
  174. };
  175. },
  176. onLoad(opt) {
  177. this.active = opt.tabIndex;
  178. this.merchantId = opt.merchantId;
  179. this.isPrinting();
  180. this.switchTab(this.active);
  181. },
  182. onReachBottom() {
  183. this.form.page++;
  184. this.getOrderlist();
  185. },
  186. methods: {
  187. jumpUrl(url) {
  188. uni.navigateTo({
  189. url: url
  190. });
  191. },
  192. // s是否开启云打印
  193. isPrinting() {
  194. let fromP = {};
  195. fromP.id = this.merchantId;
  196. req.getRequest('/api/merchant/detail', fromP, data => {
  197. this.merchant = data;
  198. });
  199. },
  200. // 查看订单详情
  201. toOrederDel(id) {
  202. this.jumpUrl('show?id=' + id + '&merchantId=' + this.merchant.id);
  203. },
  204. // 确认发货
  205. deliverGoods(id, merchantId, orderType) {
  206. this.jumpUrl('expressList/index?id=' + id + '&merchantId=' + merchantId + '&orderType=' + orderType);
  207. },
  208. // 打印
  209. orderPrinting(id, index) {
  210. req.getRequest(
  211. '/api/merchant/printOrderInfo',
  212. id,
  213. data => {
  214. req.msg(data.msg);
  215. },
  216. true
  217. );
  218. },
  219. // 通知取件
  220. send(id) {
  221. req.getRequest(
  222. '/api/wxmes/send',
  223. {
  224. orderId: id,
  225. bsusinessType: 11
  226. },
  227. data => {
  228. req.msg('通知成功');
  229. },
  230. true
  231. );
  232. },
  233. // 已提货
  234. deliver(id, index) {
  235. req.postRequest(
  236. '/api/order/confirm',
  237. {
  238. id: id,
  239. mode: '1'
  240. },
  241. data => {
  242. this.pageList[index].state = 7;
  243. this.pageList[index].stateName = '已核销';
  244. },
  245. true
  246. );
  247. },
  248. // 获取订单列表
  249. getOrderlist() {
  250. if (!this.isLoad) return false;
  251. this.isLoad = false;
  252. let fromP = {
  253. merchantId: this.merchantId,
  254. page: this.form.page,
  255. limit: this.form.limit
  256. };
  257. let that = this;
  258. if (this.tabIndex == 3) {
  259. //售后
  260. this.getRefundList(fromP);
  261. } else {
  262. fromP.typeState = this.TabList[this.tabIndex].state;
  263. //正常其它订单
  264. this.getOrderlists(fromP);
  265. }
  266. },
  267. getRefundList(fromP) {
  268. req.getRequest('/api/v3/store/refund/page', fromP, data => {
  269. if (data.list && data.list.length == 10) {
  270. this.isLoad = true;
  271. }
  272. if (this.form.page > 0) {
  273. data.list = this.pageList.concat(data.list);
  274. }
  275. this.pageList = data.list;
  276. });
  277. },
  278. getOrderlists(fromP) {
  279. req.getRequest('/api/order/merchant/list', fromP, data => {
  280. if (data && data.length == 10) {
  281. this.isLoad = true;
  282. }
  283. if (this.form.page > 0) {
  284. data = this.pageList.concat(data);
  285. }
  286. this.pageList = data;
  287. });
  288. },
  289. // tab栏切换
  290. switchTab(tabIndex) {
  291. this.tabIndex = tabIndex;
  292. let def = this.TabList.findIndex(it => it.active);
  293. this.TabList[def].active = false;
  294. this.TabList[this.tabIndex].active = true;
  295. this.isLoad = true;
  296. this.form.page = 1;
  297. this.pageList = [];
  298. this.form.state = this.TabList[this.tabIndex].state;
  299. this.getOrderlist();
  300. },
  301. // 搜索订单 获取用户输入的内容
  302. onSearch(e) {
  303. console.log(e.detail.value);
  304. this.searchTitle = e.detail.value;
  305. },
  306. //清除输入框
  307. clearInput() {
  308. this.searchTitle = '';
  309. },
  310. // 搜索订单
  311. confirm() {
  312. let value = this.searchTitle;
  313. uni.navigateTo({
  314. url: 'search?searchValue=' + value + '&merchantId=' + this.merchant.id
  315. });
  316. }
  317. }
  318. };
  319. </script>
  320. <style scoped>
  321. @import './static/css/main.css';
  322. .noguige {
  323. height: 15px;
  324. }
  325. .ssbot {
  326. padding: 5px 10px 7px;
  327. -webkit-box-pack: center;
  328. -webkit-justify-content: center;
  329. justify-content: center;
  330. -webkit-box-align: center;
  331. -webkit-align-items: center;
  332. align-items: center;
  333. }
  334. .ssbot .searchbot {
  335. background: #fff;
  336. height: 33px;
  337. border-radius: 15px;
  338. padding: 0 0 0 10px;
  339. font-size: 13px;
  340. color: #666;
  341. width: 100%;
  342. box-sizing: border-box;
  343. align-items: center;
  344. }
  345. .searchbot input {
  346. font-size: 28rpx !important;
  347. color: #333;
  348. }
  349. .searchbot image {
  350. width: 15px;
  351. height: 15px;
  352. margin-right: 6px;
  353. }
  354. .expressinfo {
  355. display: flex;
  356. justify-content: space-between;
  357. margin-bottom: 10px;
  358. }
  359. .pad20 {
  360. padding: 20px;
  361. }
  362. .refundFalseRes {
  363. text-align: right;
  364. }
  365. .van-button:not(:last-child) {
  366. margin-right: 5px;
  367. }
  368. .tab {
  369. padding: 0 17px;
  370. display: flex;
  371. display: -webkit-flex;
  372. height: 50px;
  373. background: #fff;
  374. line-height: 50px;
  375. }
  376. .tab .li {
  377. font-size: 14px;
  378. color: #999;
  379. width: 25%;
  380. text-align: center;
  381. position: relative;
  382. }
  383. .tab .li.active {
  384. color: #333;
  385. }
  386. .tab .li.active::after {
  387. content: '';
  388. display: block;
  389. width: 49rpx;
  390. height: 6rpx;
  391. background: #0065ac !important;
  392. position: absolute;
  393. left: 50%;
  394. transform: translateX(-50%);
  395. bottom: 0;
  396. }
  397. </style>