changeStore.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <template>
  2. <view class="box">
  3. <view class="content">
  4. <view class="leftTitle2" style="padding: 24rpx 0; border-bottom: 1rpx solid #EEEEEE;">原服务门店信息</view>
  5. <view class="shopBg">
  6. <view class="leftTitle2">{{oldStoreName}}</view>
  7. <view class="addrressBg">
  8. <image src="../../static/img/icon_coordinate.png" mode="" style="width: 22rpx; height: 30rpx;">
  9. </image>
  10. <view style="color: #999999; font-size: 24rpx; margin-left: 20rpx;">{{oldStoreAddress}}</view>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="content">
  15. <view class="viewBg">
  16. <image src="../../static/img/icon_xinghao.png" mode="" style="width: 14rpx; height: 14rpx;"></image>
  17. <view class="leftTitle">更换门店</view>
  18. <view class="blackColor width70" :class="{grayColor: store==''}" @click="storeChange">{{store?store:'请选择'}}</view>
  19. <image src="../../static/img/rightArrow.png" mode="" style="width: 13rpx; height: 23rpx;"></image>
  20. </view>
  21. </view>
  22. <view class="content">
  23. <view class="viewBg" style="border-bottom: 1rpx solid #EEEEEE;">
  24. <image src="../../static/img/icon_xinghao.png" mode="" style="width: 14rpx; height: 14rpx;"></image>
  25. <view class="leftTitle">更换原因</view>
  26. <picker :value="firstIndex" class="width70" mode="selector" :range="reasonArray" range-key="contents"
  27. @change="reasonChange">
  28. <view class="blackColor" :class="{grayColor: firstIndex==null}">
  29. {{firstIndex == null ? '请选择' : reasonArray[firstIndex].contents}}
  30. </view>
  31. </picker>
  32. <image src="../../static/img/rightArrow.png" mode="" style="width: 13rpx; height: 23rpx;"></image>
  33. </view>
  34. <view class="viewBg">
  35. <view class="leftTitle">补充描述</view>
  36. <textarea placeholder-style="color:#999999" placeholder="选填,请输入补充描述" v-model="exeContent"
  37. class="textareaCont" maxlength="-1" auto-height="true" @confirm="feedDone" />
  38. </view>
  39. </view>
  40. <view class="bottom">
  41. <view class="shoreDz" @click="submit">提交</view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. data() {
  48. return {
  49. sheetId:'',
  50. oldStoreName: '',
  51. oldStoreAddress: '',
  52. store: '',
  53. storeId:'',
  54. reasonArray: [],
  55. reasonId: '',
  56. firstIndex: null,
  57. exeContent: '',
  58. }
  59. },
  60. onLoad(opt) {
  61. this.sheetId = opt.sheetId;
  62. this.oldStoreName = opt.oldStoreName;
  63. this.oldStoreAddress = opt.oldStoreAddress;
  64. this.getChangeData();
  65. console.log(this.sheetId);
  66. },
  67. onShow() {
  68. let storeMes = uni.getStorageSync('changeStore')
  69. this.storeId = storeMes.shopId
  70. this.store = storeMes.shopName
  71. },
  72. methods: {
  73. submit() {
  74. if (this.store == '') {
  75. uni.showToast({
  76. title: '请选择更换门店',
  77. icon: 'none',
  78. duration: 2000,
  79. });
  80. return;
  81. }
  82. if (this.reasonId == '') {
  83. uni.showToast({
  84. title: '请选择更换原因',
  85. icon: 'none',
  86. duration: 2000,
  87. });
  88. return;
  89. }
  90. uni.showLoading({});
  91. this.$http('worldKeepCar/orderChangeShop/applyChangeShop', {
  92. sheetId: this.sheetId,
  93. applyReasonId: this.reasonId,
  94. applyReason: this.reasonArray[this.firstIndex].contents,
  95. reasonComment: this.exeContent,
  96. newShopID: this.storeId,
  97. newShopName: this.store,
  98. }, 'POST').then(res => {
  99. uni.hideLoading();
  100. if (res.code == 0) {
  101. uni.showToast({
  102. title: '提交成功',
  103. icon: 'none',
  104. duration: 2000,
  105. });
  106. uni.removeStorageSync('changeStore')
  107. setTimeout(function() {
  108. uni.navigateBack({
  109. })
  110. }, 2000);
  111. }
  112. })
  113. },
  114. getChangeData() {
  115. uni.showLoading({
  116. title: '加载中'
  117. })
  118. let url = 'worldKeepCar/orderChangeShop/refuseReasonList',
  119. params = {
  120. type: 1,
  121. }
  122. this.$http(url, params, 'GET').then(res => {
  123. uni.hideLoading();
  124. this.reasonArray = res.data
  125. })
  126. },
  127. feedDone(e) {
  128. this.exeContent = e.target.value
  129. },
  130. storeChange(e) {
  131. uni.navigateTo({
  132. url:'../module/orderShop?fromChangeStore=true'
  133. })
  134. },
  135. reasonChange(e) {
  136. this.firstIndex = e.target.value
  137. this.reasonId = this.reasonArray[this.firstIndex].id
  138. }
  139. }
  140. }
  141. </script>
  142. <style scoped>
  143. .box {
  144. min-height: 100vh;
  145. background: #F4F5F7;
  146. padding-top: 20rpx;
  147. }
  148. .content {
  149. background-color: #FFFFFF;
  150. border-radius: 10rpx;
  151. margin: 20rpx 24rpx;
  152. padding: 0 20rpx;
  153. }
  154. .shopBg {
  155. padding: 30rpx 0;
  156. }
  157. .addrressBg {
  158. padding-top: 12rpx;
  159. display: flex;
  160. align-items: center;
  161. }
  162. .viewBg {
  163. display: flex;
  164. align-items: center;
  165. padding: 30rpx 0;
  166. }
  167. .width70 {
  168. width: 70%;
  169. }
  170. .leftTitle2 {
  171. color: #333333;
  172. font-size: 28rpx;
  173. }
  174. .leftTitle {
  175. color: #333333;
  176. font-size: 28rpx;
  177. width: 130rpx;
  178. margin-right: 50rpx;
  179. }
  180. .blackColor {
  181. color: #333333;
  182. font-size: 28rpx;
  183. }
  184. .grayColor {
  185. color: #999999;
  186. font-size: 28rpx;
  187. }
  188. .textareaCont {
  189. width: 70%;
  190. font-size: 28rpx;
  191. color: #333333;
  192. }
  193. .bottom {
  194. width: 750rpx;
  195. height: 120rpx;
  196. background: #FFFFFF;
  197. box-shadow: 0px -4px 8px 0px rgba(153, 153, 153, 0.08);
  198. position: fixed;
  199. left: 0;
  200. bottom: 0;
  201. display: flex;
  202. justify-content: space-around;
  203. }
  204. .shoreDz {
  205. width: 702rpx;
  206. height: 74rpx;
  207. background: linear-gradient(135deg, #FD5300 0%, #FF270A 100%);
  208. border-radius: 37rpx;
  209. text-align: center;
  210. line-height: 74rpx;
  211. color: #FFFFFF;
  212. font-size: 30rpx;
  213. margin-top: 24rpx;
  214. }
  215. </style>