extraction.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <view>
  3. <view v-if="data_base != null">
  4. <view class="padding-main">
  5. <!-- 未申请 -->
  6. <view v-if="extraction == null">
  7. <view v-if="(data_base.self_extraction_apply_desc || null) != null && data_base.self_extraction_apply_desc.length > 0" class="notice-content-blue spacing-mb">
  8. <view v-for="(item, index) in data_base.self_extraction_apply_desc" :key="index" class="item">
  9. {{item}}
  10. </view>
  11. </view>
  12. <view class="margin-top-xxxl">
  13. <navigator url="/pages/plugins/distribution/extraction-apply/extraction-apply" hover-class="none">
  14. <button class="bg-main br-main cr-white round wh-auto" type="default" size="mini" hover-class="none">立即申请</button>
  15. </navigator>
  16. </view>
  17. </view>
  18. <!-- 已存在申请信息 -->
  19. <view v-else class="apply-already">
  20. <!-- status 状态(0待审核, 1已通过, 2已拒绝 -->
  21. <!-- 审核中 -->
  22. <view v-if="extraction.status == 0">
  23. <view class="padding-main border-radius-main bg-white">
  24. <view class="cr-red tc text-size-lg">申请信息正在审核中...</view>
  25. </view>
  26. <view class="margin-top-xxxl">
  27. <navigator url="/pages/plugins/distribution/extraction-apply/extraction-apply" hover-class="none">
  28. <button class="bg-green br-green cr-white round wh-auto" type="default" size="mini" hover-class="none">编辑</button>
  29. </navigator>
  30. </view>
  31. </view>
  32. <!-- 审核通过 -->
  33. <view v-else-if="extraction.status == 1 || extraction.status == 3" class="valid">
  34. <view class="padding-main border-radius-main bg-white">
  35. <!-- 导航 -->
  36. <view class="padding-bottom-main br-b">
  37. <text class="fw-b">取货点信息</text>
  38. <view class="fr cr-blue">
  39. <navigator url="/pages/plugins/distribution/extraction-apply/extraction-apply" hover-class="none">编辑信息</navigator>
  40. </view>
  41. </view>
  42. <!-- 地址信息 -->
  43. <view class="margin-top-lg" @tap="address_map_event">
  44. <text v-if="(extraction.alias || null) != null" class="alias br-main cr-main bg-white round margin-right-sm">{{extraction.alias}}</text>
  45. <text class="cr-base">{{extraction.province_name}}{{extraction.city_name}}{{extraction.county_name}}{{extraction.address}}</text>
  46. </view>
  47. </view>
  48. <view v-if="extraction.status == 1" class="spacing-mt">
  49. <view class="padding-main border-radius-main bg-white">
  50. <!-- 导航 -->
  51. <view class="padding-bottom-main br-b">
  52. <text class="fw-b">取货订单统计</text>
  53. <view class="fr cr-blue">
  54. <navigator url="/pages/plugins/distribution/extraction-order/extraction-order" hover-class="none">查看取货订单</navigator>
  55. </view>
  56. </view>
  57. <!-- 自提地点统计 -->
  58. <view class="statistics oh padding-top-main">
  59. <view class="item fl tc padding-main" data-value="0" @tap="order_event">
  60. <view class="title cr-base">待处理</view>
  61. <view class="single-text cr-red fw-b margin-top-sm">{{statistical.order_wait || 0}}</view>
  62. </view>
  63. <view class="item fl tc padding-main" data-value="1" @tap="order_event">
  64. <view class="title cr-base">已处理</view>
  65. <view class="single-text cr-green fw-b margin-top-sm">{{statistical.order_already || 0}}</view>
  66. </view>
  67. </view>
  68. </view>
  69. <!-- 通知 -->
  70. <view v-if="(data_base || null) != null && (data_base.self_extraction_common_notice || null) != null && data_base.self_extraction_common_notice.length > 0" class="spacing-mt">
  71. <view class="notice-content">
  72. <view v-for="(item, index) in data_base.self_extraction_common_notice" :key="index" class="item">
  73. {{item}}
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. <!-- 已解约 -->
  79. <view v-else class="spacing-mt">
  80. <view class="notice-content-blue">当前状态也解约,可重新编辑数据提交审核。</view>
  81. </view>
  82. </view>
  83. <!-- 审核失败 -->
  84. <view v-else="extraction.status == 2">
  85. <view class="padding-main border-radius-main bg-white spacing-mb">
  86. <view class="cr-red tc text-size-lg">申请信息审核失败</view>
  87. <view v-if="(extraction.fail_reason || null) != null" class="margin-top-lg">
  88. <text class="fw-b">原因:</text>
  89. <text class="cr-gray">{{extraction.fail_reason}}</text>
  90. </view>
  91. </view>
  92. <view class="margin-top-xxxl">
  93. <navigator url="/pages/plugins/distribution/extraction-apply/extraction-apply" hover-class="none">
  94. <button class="bg-green br-green cr-white round wh-auto" type="default" size="mini" hover-class="none">编辑</button>
  95. </navigator>
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. <!-- 结尾 -->
  101. <component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
  102. </view>
  103. <view v-else>
  104. <!-- 提示信息 -->
  105. <component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
  106. </view>
  107. </view>
  108. </template>
  109. <script>
  110. const app = getApp();
  111. import componentNoData from "../../../../components/no-data/no-data";
  112. import componentBottomLine from "../../../../components/bottom-line/bottom-line";
  113. export default {
  114. data() {
  115. return {
  116. data_bottom_line_status: false,
  117. data_list_loding_status: 1,
  118. data_list_loding_msg: '',
  119. data_base: null,
  120. extraction: null,
  121. statistical: null
  122. };
  123. },
  124. components: {
  125. componentNoData,
  126. componentBottomLine
  127. },
  128. props: {},
  129. onLoad(params) {},
  130. onShow() {
  131. this.init();
  132. // 分享菜单处理
  133. app.globalData.page_share_handle();
  134. },
  135. // 下拉刷新
  136. onPullDownRefresh() {
  137. this.get_data();
  138. },
  139. methods: {
  140. init() {
  141. var user = app.globalData.get_user_info(this, 'init');
  142. if (user != false) {
  143. // 用户未绑定用户则转到登录页面
  144. if (app.globalData.user_is_need_login(user)) {
  145. uni.redirectTo({
  146. url: "/pages/login/login?event_callback=init"
  147. });
  148. return false;
  149. } else {
  150. // 获取数据
  151. this.get_data();
  152. }
  153. } else {
  154. this.setData({
  155. data_list_loding_status: 0,
  156. data_bottom_line_status: false
  157. });
  158. }
  159. },
  160. // 获取数据
  161. get_data() {
  162. uni.request({
  163. url: app.globalData.get_request_url("index", "extraction", "distribution"),
  164. method: 'POST',
  165. data: {},
  166. dataType: 'json',
  167. success: res => {
  168. uni.hideLoading();
  169. uni.stopPullDownRefresh();
  170. if (res.data.code == 0) {
  171. var data = res.data.data;
  172. this.setData({
  173. data_base: data.base || null,
  174. extraction: data.extraction || null,
  175. statistical: data.statistical || null,
  176. data_list_loding_msg: '',
  177. data_list_loding_status: 0,
  178. data_bottom_line_status: true
  179. });
  180. } else {
  181. this.setData({
  182. data_bottom_line_status: false,
  183. data_list_loding_status: 2,
  184. data_list_loding_msg: res.data.msg
  185. });
  186. if (app.globalData.is_login_check(res.data, this, 'get_data')) {
  187. app.globalData.showToast(res.data.msg);
  188. }
  189. }
  190. },
  191. fail: () => {
  192. uni.hideLoading();
  193. uni.stopPullDownRefresh();
  194. this.setData({
  195. data_bottom_line_status: false,
  196. data_list_loding_status: 2,
  197. data_list_loding_msg: '服务器请求出错'
  198. });
  199. app.globalData.showToast('服务器请求出错');
  200. }
  201. });
  202. },
  203. // 地图查看
  204. address_map_event(e) {
  205. if ((this.extraction || null) == null) {
  206. return false;
  207. }
  208. var data = this.extraction;
  209. // 打开地图
  210. var name = data.alias || data.name || '';
  211. var address = (data.province_name || '') + (data.city_name || '') + (data.county_name || '') + (data.address || '');
  212. app.globalData.open_location(data.lng, data.lat, name, address);
  213. },
  214. // 进入取货订单管理
  215. order_event(e) {
  216. var value = e.currentTarget.dataset.value || 0;
  217. uni.navigateTo({
  218. url: '/pages/plugins/distribution/extraction-order/extraction-order?status=' + value
  219. });
  220. }
  221. }
  222. };
  223. </script>
  224. <style>
  225. @import './extraction.css';
  226. </style>