changeStore.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  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">
  19. {{store == ''? '请选择':store}}
  20. </view>
  21. <image src="../../static/img/rightArrow.png" mode="" style="width: 13rpx; height: 23rpx;"></image>
  22. </view>
  23. </view>
  24. <view class="content">
  25. <view class="viewBg" style="border-bottom: 1rpx solid #EEEEEE;">
  26. <image src="../../static/img/icon_xinghao.png" mode="" style="width: 14rpx; height: 14rpx;"></image>
  27. <view class="leftTitle">更换原因</view>
  28. <picker class="width70" mode="selector" :range="reasonNameArray" @change="reasonChange">
  29. <view class="blackColor" :class="{grayColor: reason==''}">
  30. {{reason == '' ? '请选择' : reason}}
  31. </view>
  32. </picker>
  33. <image src="../../static/img/rightArrow.png" mode="" style="width: 13rpx; height: 23rpx;"></image>
  34. </view>
  35. <view class="viewBg">
  36. <view class="leftTitle">补充描述</view>
  37. <textarea placeholder-style="color:#999999" placeholder="选填,请输入补充描述" v-model="exeContent"
  38. class="textareaCont" maxlength="-1" auto-height="true" @confirm="feedDone" />
  39. </view>
  40. </view>
  41. <view class="bottom">
  42. <view class="shoreDz" @click="submit">提交</view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. data() {
  49. return {
  50. sheetId: '',
  51. oldStoreName: '',
  52. oldStoreAddress: '',
  53. store: '',
  54. storeId: '',
  55. reasonArray: [],
  56. reasonNameArray: [],
  57. reasonId: '',
  58. reason: "",
  59. exeContent: '',
  60. edit: '', //修改申请
  61. editId: '',
  62. }
  63. },
  64. onLoad(opt) {
  65. this.sheetId = opt.sheetId;
  66. this.oldStoreName = opt.oldStoreName;
  67. this.oldStoreAddress = opt.oldStoreAddress;
  68. this.getChangeData();
  69. console.log(this.sheetId);
  70. //修改申请
  71. this.edit = opt.edit;
  72. this.editId = opt.editId;
  73. this.oldStoreName = opt.oldStoreName;
  74. this.oldStoreAddress = opt.oldStoreAddress;
  75. this.store = opt.store;
  76. this.storeId = opt.storeId;
  77. this.reasonId = opt.reasonId;
  78. this.reason = opt.reason;
  79. this.exeContent = opt.exeContent;
  80. if (opt.exeContent == null || opt.exeContent == 'null') {
  81. this.exeContent = ''
  82. }
  83. },
  84. onShow() {
  85. let storeMes = uni.getStorageSync('changeStore')
  86. if (storeMes) {
  87. this.storeId = storeMes.shopId
  88. this.store = storeMes.shopName
  89. }
  90. },
  91. methods: {
  92. submit() {
  93. if (this.store == '') {
  94. uni.showToast({
  95. title: '请选择更换门店',
  96. icon: 'none',
  97. duration: 2000,
  98. });
  99. return;
  100. }
  101. if (this.reasonId == '') {
  102. uni.showToast({
  103. title: '请选择更换原因',
  104. icon: 'none',
  105. duration: 2000,
  106. });
  107. return;
  108. }
  109. if (this.edit == 'true') {
  110. console.log('修改申请');
  111. this.editUrl();
  112. } else {
  113. this.addUrl();
  114. }
  115. },
  116. addUrl() {
  117. uni.showLoading({});
  118. this.$http('worldKeepCar/orderChangeShop/applyChangeShop',
  119. {
  120. sheetId: this.sheetId,
  121. applyReasonId: this.reasonId,
  122. applyReason: this.reason,
  123. reasonComment: this.exeContent,
  124. newShopId: this.storeId,
  125. newShopName: this.store,
  126. }, 'POST').then(res => {
  127. uni.hideLoading();
  128. if (res.code == 0) {
  129. uni.removeStorageSync('changeStore')
  130. uni.showModal({
  131. title: '更换门店申请成功,请等待平台处理',
  132. content: '您可以在【我的-更换门店申请记录】列表里具体查看申请的处理进度哦~',
  133. showCancel:false,
  134. confirmText:'知道了',
  135. success: function (res) {
  136. if (res.confirm) {
  137. uni.navigateBack({
  138. })
  139. }
  140. }
  141. });
  142. }
  143. })
  144. },
  145. editUrl() {
  146. uni.showLoading({});
  147. this.$http('worldKeepCar/orderChangeShop/editApply',
  148. {
  149. applyReasonId: this.reasonId,
  150. applyReason: this.reason,
  151. reasonComment: this.exeContent,
  152. newShopId: this.storeId,
  153. newShopName: this.store,
  154. id: this.editId,
  155. }, 'POST').then(res => {
  156. uni.hideLoading();
  157. if (res.code == 0) {
  158. uni.removeStorageSync('changeStore')
  159. uni.showModal({
  160. title: '更换门店申请成功,请等待平台处理',
  161. content: '您可以在【我的-更换门店申请记录】列表里具体查看申请的处理进度哦~',
  162. showCancel:false,
  163. confirmText:'知道了',
  164. success: function (res) {
  165. if (res.confirm) {
  166. uni.navigateBack({
  167. })
  168. }
  169. }
  170. });
  171. }
  172. })
  173. },
  174. getChangeData() {
  175. uni.showLoading({
  176. title: '加载中'
  177. })
  178. let url = 'worldKeepCar/orderChangeShop/refuseReasonList',
  179. params = {
  180. type: 1,
  181. }
  182. this.$http(url, params, 'GET').then(res => {
  183. uni.hideLoading();
  184. this.reasonArray = res.data
  185. this.reasonArray.forEach((item, index) => {
  186. this.reasonNameArray.push(item.contents)
  187. });
  188. console.log(this.reasonNameArray);
  189. })
  190. },
  191. feedDone(e) {
  192. this.exeContent = e.target.value
  193. },
  194. storeChange(e) {
  195. uni.navigateTo({
  196. url: '../module/orderShop?fromChangeStore=true'
  197. })
  198. },
  199. reasonChange(e) {
  200. this.reasonId = this.reasonArray[e.target.value].id
  201. this.reason = this.reasonArray[e.target.value].contents
  202. }
  203. }
  204. }
  205. </script>
  206. <style scoped>
  207. .box {
  208. min-height: 100vh;
  209. background: #F4F5F7;
  210. padding-top: 20rpx;
  211. }
  212. .content {
  213. background-color: #FFFFFF;
  214. border-radius: 10rpx;
  215. margin: 20rpx 24rpx;
  216. padding: 0 20rpx;
  217. }
  218. .shopBg {
  219. padding: 30rpx 0;
  220. }
  221. .addrressBg {
  222. padding-top: 12rpx;
  223. display: flex;
  224. align-items: center;
  225. }
  226. .viewBg {
  227. display: flex;
  228. align-items: center;
  229. padding: 30rpx 0;
  230. }
  231. .width70 {
  232. width: 70%;
  233. }
  234. .leftTitle2 {
  235. color: #333333;
  236. font-size: 28rpx;
  237. }
  238. .leftTitle {
  239. color: #333333;
  240. font-size: 28rpx;
  241. width: 130rpx;
  242. margin-right: 50rpx;
  243. }
  244. .blackColor {
  245. color: #333333;
  246. font-size: 28rpx;
  247. }
  248. .grayColor {
  249. color: #999999;
  250. font-size: 28rpx;
  251. }
  252. .textareaCont {
  253. width: 70%;
  254. font-size: 28rpx;
  255. color: #333333;
  256. }
  257. .bottom {
  258. width: 750rpx;
  259. height: 120rpx;
  260. background: #FFFFFF;
  261. box-shadow: 0px -4px 8px 0px rgba(153, 153, 153, 0.08);
  262. position: fixed;
  263. left: 0;
  264. bottom: 0;
  265. display: flex;
  266. justify-content: space-around;
  267. }
  268. .shoreDz {
  269. width: 702rpx;
  270. height: 74rpx;
  271. background: linear-gradient(135deg, #FD5300 0%, #FF270A 100%);
  272. border-radius: 37rpx;
  273. text-align: center;
  274. line-height: 74rpx;
  275. color: #FFFFFF;
  276. font-size: 30rpx;
  277. margin-top: 24rpx;
  278. }
  279. </style>