changeStore.vue 7.0 KB

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