changeStore.vue 7.8 KB

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