changeStore.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  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. title: '保存中'
  125. })
  126. this.$http('worldKeepCar/orderChangeShop/applyChangeShop',
  127. {
  128. sheetId: this.sheetId,
  129. applyReasonId: this.reasonId,
  130. applyReason: this.reason,
  131. reasonComment: this.exeContent,
  132. newShopId: this.storeId,
  133. newShopName: this.store,
  134. }, 'POST').then(res => {
  135. uni.hideLoading();
  136. if (res.code == 0) {
  137. uni.removeStorageSync('changeStore')
  138. uni.showModal({
  139. title: '更换门店申请成功,请等待平台处理',
  140. content: '您可以在【我的-更换门店申请记录】里查看申请的处理进度哦',
  141. showCancel:false,
  142. confirmText:'知道了',
  143. success: function (res) {
  144. if (res.confirm) {
  145. uni.navigateBack({
  146. })
  147. }
  148. }
  149. });
  150. }
  151. })
  152. },
  153. editUrl() {
  154. uni.showLoading({
  155. title: '保存中'
  156. })
  157. this.$http('worldKeepCar/orderChangeShop/editApply',
  158. {
  159. applyReasonId: this.reasonId,
  160. applyReason: this.reason,
  161. reasonComment: this.exeContent,
  162. newShopId: this.storeId,
  163. newShopName: this.store,
  164. id: this.editId,
  165. }, 'POST').then(res => {
  166. uni.hideLoading();
  167. if (res.code == 0) {
  168. uni.removeStorageSync('changeStore')
  169. uni.showModal({
  170. title: '更换门店申请成功,请等待平台处理',
  171. content: '您可以在【我的-更换门店申请记录】里查看申请的处理进度哦',
  172. showCancel:false,
  173. confirmText:'知道了',
  174. success: function (res) {
  175. if (res.confirm) {
  176. uni.navigateBack({
  177. })
  178. }
  179. }
  180. });
  181. }
  182. })
  183. },
  184. getChangeData() {
  185. uni.showLoading({
  186. title: '加载中'
  187. })
  188. let url = 'worldKeepCar/orderChangeShop/refuseReasonList',
  189. params = {
  190. type: 1,
  191. }
  192. this.$http(url, params, 'GET').then(res => {
  193. uni.hideLoading();
  194. this.reasonArray = res.data
  195. this.reasonArray.forEach((item, index) => {
  196. this.reasonNameArray.push(item.contents)
  197. });
  198. console.log(this.reasonNameArray);
  199. })
  200. },
  201. feedDone(e) {
  202. this.exeContent = e.target.value
  203. },
  204. storeChange(e) {
  205. uni.navigateTo({
  206. url: '../module/orderShop?fromChangeStore=true'+'&oldShopID='+this.oldShopID+'&brand='+this.brand
  207. })
  208. },
  209. reasonChange(e) {
  210. this.reasonId = this.reasonArray[e.target.value].id
  211. this.reason = this.reasonArray[e.target.value].contents
  212. }
  213. }
  214. }
  215. </script>
  216. <style scoped>
  217. .box {
  218. min-height: 100vh;
  219. background: #F4F5F7;
  220. padding-top: 20rpx;
  221. }
  222. .content {
  223. background-color: #FFFFFF;
  224. border-radius: 10rpx;
  225. margin: 20rpx 24rpx;
  226. padding: 0 20rpx;
  227. }
  228. .shopBg {
  229. padding: 30rpx 0;
  230. }
  231. .addrressBg {
  232. padding-top: 12rpx;
  233. display: flex;
  234. align-items: center;
  235. }
  236. .viewBg {
  237. display: flex;
  238. align-items: center;
  239. padding: 30rpx 0;
  240. }
  241. .width70 {
  242. width: 70%;
  243. }
  244. .leftTitle2 {
  245. color: #333333;
  246. font-size: 28rpx;
  247. }
  248. .leftTitle {
  249. color: #333333;
  250. font-size: 28rpx;
  251. width: 130rpx;
  252. margin-right: 50rpx;
  253. }
  254. .blackColor {
  255. color: #333333;
  256. font-size: 28rpx;
  257. }
  258. .grayColor {
  259. color: #999999;
  260. font-size: 28rpx;
  261. }
  262. .textareaCont {
  263. width: 70%;
  264. font-size: 28rpx;
  265. color: #333333;
  266. }
  267. .bottom {
  268. width: 750rpx;
  269. height: 120rpx;
  270. background: #FFFFFF;
  271. box-shadow: 0px -4px 8px 0px rgba(153, 153, 153, 0.08);
  272. position: fixed;
  273. left: 0;
  274. bottom: 0;
  275. display: flex;
  276. justify-content: space-around;
  277. }
  278. .shoreDz {
  279. width: 702rpx;
  280. height: 74rpx;
  281. background: linear-gradient(135deg, #FD5300 0%, #FF270A 100%);
  282. border-radius: 37rpx;
  283. text-align: center;
  284. line-height: 74rpx;
  285. color: #FFFFFF;
  286. font-size: 30rpx;
  287. margin-top: 24rpx;
  288. }
  289. </style>