apply.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. <template>
  2. <view class="authentication-info">
  3. <view class="company-info info-chunk">
  4. <view class="apply-input-wrap">
  5. <text>店铺名称</text>
  6. <input type="text" class="input-content" disabled="false" v-model="infoData.shop_name" />
  7. </view>
  8. <view class="apply-input-wrap">
  9. <text>开店套餐</text>
  10. <input type="text" class="input-content" disabled="false" v-model="infoData.shop_group_name" />
  11. </view>
  12. <view class="apply-input-wrap">
  13. <text>主营行业</text>
  14. <input type="text" class="input-content" disabled="false" v-model="selectCategory" />
  15. </view>
  16. <view class="apply-input-wrap more-wrap">
  17. <text>入驻时长</text>
  18. <block v-if="isRenew">
  19. <picker mode="selector" :value="selectApplyYear.key" :range="applyYearArr" @change="applyYearChange">
  20. <text class="input-content" :class="{ 'color-tip': !selectApplyYear.value }">{{ selectApplyYear.value ? selectApplyYear.value : '请选择入驻时长' }}</text>
  21. <text class="iconfont iconright"></text>
  22. </picker>
  23. </block>
  24. <block v-else><input type="text" class="input-content" disabled="false" v-model="selectApplyYear.value" /></block>
  25. </view>
  26. <view class="apply-input-wrap">
  27. <text>服务费</text>
  28. <input type="text" class="input-content" placeholder="0.00 元" disabled="false" v-model="applyMoney.paying_apply" />
  29. </view>
  30. <view class="apply-input-wrap">
  31. <text>总计</text>
  32. <input type="text" class="input-content" placeholder="0.00 元" disabled="false" v-model="applyMoney.paying_amount" />
  33. </view>
  34. </view>
  35. <view class="company-info info-chunk">
  36. <view class="apply-input-wrap">
  37. <text>付款凭证</text>
  38. <view class="input-img" @click="uplodImg()">
  39. <text class="iconfont iconadd1" v-if="!payData.paying_money_certificate"></text>
  40. <image v-else :src="$util.img(payData.paying_money_certificate)" mode="aspectFit"></image>
  41. </view>
  42. </view>
  43. <view class="apply-input-wrap">
  44. <text>付款凭证说明</text>
  45. <input type="text" class="input-content" placeholder="请输入付款凭证说明" v-model="payData.paying_money_certificate_explain" />
  46. </view>
  47. </view>
  48. <view class="company-info info-chunk">
  49. <view class="shroff-account">
  50. <text class="account-title">收款账户信息</text>
  51. <view class="account-content">
  52. <view>
  53. <text>银行开户名:</text>
  54. <text>{{ infoData.bank_account_name }}</text>
  55. </view>
  56. <view>
  57. <text>银行账户:</text>
  58. <text>{{ infoData.bank_account_no }}</text>
  59. </view>
  60. <view>
  61. <text>开户名称:</text>
  62. <text>{{ infoData.bank_name }}</text>
  63. </view>
  64. <view>
  65. <text>开户所在地:</text>
  66. <text>{{ infoData.bank_address }}</text>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <button type="primary" @click="save">提交</button>
  72. <loading-cover ref="loadingCover"></loading-cover>
  73. </view>
  74. </template>
  75. <script>
  76. import validate from '@/common/js/validate.js';
  77. export default {
  78. data() {
  79. return {
  80. categoryArr: {
  81. key: [],
  82. name: [],
  83. value: []
  84. },
  85. selectCategory: '',
  86. applyYearArr: ['1年', '2年', '3年', '4年', '5年'],
  87. selectApplyYear: {
  88. key: '',
  89. value: ''
  90. },
  91. applyMoney: {
  92. paying_apply: '',
  93. paying_amount: ''
  94. },
  95. infoData: {
  96. shop_name: '',
  97. shop_group_name: '',
  98. shop_group_id: '',
  99. apply_year: ''
  100. },
  101. payData: {
  102. paying_money_certificate: '',
  103. paying_money_certificate_explain: ''
  104. },
  105. isRenew: false, //是否是续签
  106. isEditRenew: false, //是否是编辑续签
  107. renewId: ''
  108. };
  109. },
  110. async onShow() {
  111. if (!this.$util.checkToken('/pages/renew/apply')) return;
  112. this.initData();
  113. let renewObj = uni.getStorageSync('renewObj') ? JSON.parse(uni.getStorageSync('renewObj')) : null;
  114. if (renewObj && renewObj.cert_id != 0 && renewObj.is_reopen == 1) this.isRenew = true;
  115. if (renewObj && renewObj.cert_id != 0 && renewObj.is_reopen != 1) {
  116. this.isEditRenew = true;
  117. this.getReopenDetail();
  118. }
  119. },
  120. methods: {
  121. initData() {
  122. this.$api.sendRequest({
  123. url: '/shopapi/apply/index',
  124. success: res => {
  125. let data = res.data;
  126. //收款账户信息
  127. if (res.code == 0 && data && data.receivable_config) {
  128. let receivableData = data.receivable_config.value;
  129. this.infoData.bank_account_name = receivableData.bank_account_name;
  130. this.infoData.bank_account_no = receivableData.bank_account_no;
  131. this.infoData.bank_address = receivableData.bank_address;
  132. this.infoData.bank_name = receivableData.bank_name;
  133. }
  134. //主营行业
  135. for (let key in data.shop_category) {
  136. this.categoryArr.key.push(data.shop_category[key].category_id);
  137. this.categoryArr.name.push(data.shop_category[key].category_name);
  138. let val = data.shop_category[key].category_name + '(保证金' + data.shop_category[key].baozheng_money + ')';
  139. this.categoryArr.value.push(val);
  140. }
  141. if (res.code == 0 && data.shop_apply_info) {
  142. let initData = data.shop_apply_info;
  143. this.infoData.shop_name = initData.shop_name;
  144. //开店套餐
  145. if (this.isRenew) {
  146. let groupInfo = uni.getStorageSync('shopPackage') ? JSON.parse(uni.getStorageSync('shopPackage')) : null;
  147. if (groupInfo) {
  148. this.infoData.shop_group_name = groupInfo.group_name;
  149. this.infoData.shop_group_id = groupInfo.group_id;
  150. }
  151. }
  152. //主营行业
  153. let categoryIndex = this.categoryArr.key.indexOf(initData.category_id);
  154. this.selectCategory = this.categoryArr.value[categoryIndex];
  155. }
  156. if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
  157. }
  158. });
  159. },
  160. getReopenDetail() {
  161. this.$api.sendRequest({
  162. url: '/shopapi/shopreopen/getReopenDetail',
  163. success: res => {
  164. if (res) {
  165. let data = res.data;
  166. this.renewId = data.id;
  167. this.infoData.shop_name = data.site_name;
  168. //开店套餐
  169. this.infoData.shop_group_name = data.shop_group_name;
  170. this.infoData.shop_group_id = data.shop_group_id;
  171. //入驻年限
  172. this.infoData.apply_year = data.apply_year;
  173. this.selectApplyYear.value = this.applyYearArr[data.apply_year - 1];
  174. this.selectApplyYear.key = parseInt(data.apply_year) - 1;
  175. //支付凭证
  176. this.payData.paying_money_certificate = data.paying_money_certificate;
  177. this.payData.paying_money_certificate_explain = data.paying_money_certificate_explain;
  178. //计算费用
  179. this.getApplyMoney();
  180. }
  181. }
  182. });
  183. },
  184. applyYearChange(e) {
  185. let index = parseInt(e.detail.value);
  186. this.selectApplyYear.key = index;
  187. this.selectApplyYear.value = this.applyYearArr[index];
  188. this.infoData.apply_year = index + 1;
  189. if (this.infoData.apply_year && this.infoData.shop_group_id) {
  190. this.getApplyMoney();
  191. }
  192. },
  193. getApplyMoney() {
  194. if (!this.infoData.apply_year || !this.infoData.shop_group_id) return false;
  195. this.$api.sendRequest({
  196. url: '/shopapi/shopreopen/getReopenMoney',
  197. data: {
  198. apply_year: this.infoData.apply_year,
  199. group_id: this.infoData.shop_group_id
  200. },
  201. success: res => {
  202. if (res.code == 0 && res.data) {
  203. let data = res.data;
  204. this.applyMoney = {
  205. paying_apply: '',
  206. paying_amount: ''
  207. };
  208. this.applyMoney.paying_apply = data.fee + ' 元';
  209. this.applyMoney.paying_amount = data.money + ' 元';
  210. } else {
  211. this.$util.showToast({
  212. title: res.message
  213. });
  214. }
  215. }
  216. });
  217. },
  218. uplodImg(type) {
  219. this.$util.upload(
  220. {
  221. number: 1,
  222. path: 'image'
  223. },
  224. res => {
  225. if (res) {
  226. this.$util.showToast({
  227. title: '上传成功'
  228. });
  229. this.payData.paying_money_certificate = res[0];
  230. }
  231. }
  232. );
  233. },
  234. vertify() {
  235. let rule = [];
  236. let obj = {};
  237. if(!this.isEditRenew){
  238. rule.push({ name: 'apply_year', checkType: 'required', errorMsg: '请选择入驻年长' });
  239. obj.apply_year = this.infoData.apply_year;
  240. }
  241. rule.push({ name: 'paying_money_certificate', checkType: 'required', errorMsg: '请上传支付凭证' });
  242. obj = Object.assign(obj,this.payData);
  243. let checkRes = validate.check(obj, rule);
  244. if (checkRes) {
  245. return true;
  246. } else {
  247. this.$util.showToast({ title: validate.error });
  248. return false;
  249. }
  250. },
  251. async save() {
  252. if (this.vertify()) {
  253. let url = '',
  254. data = {};
  255. if (this.isEditRenew) {
  256. url = '/shopapi/shopreopen/editReopen';
  257. data = Object.assign(data, this.payData);
  258. data.id = this.renewId;
  259. } else {
  260. url = '/shopapi/shopreopen/addReopen';
  261. data = Object.assign(data, this.payData, this.infoData);
  262. }
  263. this.$api.sendRequest({
  264. url: url,
  265. data: data,
  266. success: res => {
  267. if (res.code == 0) {
  268. if (this.isEditRenew) {
  269. uni.removeStorageSync('renewObj');
  270. }
  271. this.$util.showToast({
  272. title: '申请续签成功'
  273. });
  274. this.$util.redirectTo('/pages/property/reopen/list',{},'reLaunch');
  275. } else {
  276. this.$util.showToast({
  277. title: res.message
  278. });
  279. }
  280. }
  281. });
  282. }
  283. }
  284. }
  285. };
  286. </script>
  287. <style lang="scss">
  288. .authentication-info {
  289. overflow: hidden;
  290. }
  291. .info-chunk {
  292. padding: 0 30rpx;
  293. margin-top: 20rpx;
  294. background-color: #fff;
  295. }
  296. .company-info {
  297. .apply-input-wrap {
  298. display: flex;
  299. align-items: center;
  300. justify-content: space-between;
  301. min-height: 100rpx;
  302. border-top: 2rpx solid $color-line;
  303. &:first-of-type {
  304. border: none;
  305. }
  306. &.more-wrap {
  307. .selected {
  308. vertical-align: middle;
  309. display: inline-block;
  310. flex: 1;
  311. text-align: right;
  312. color: $color-tip;
  313. overflow: hidden;
  314. white-space: pre;
  315. text-overflow: ellipsis;
  316. &.have {
  317. color: $color-title;
  318. }
  319. }
  320. .iconfont {
  321. color: $color-tip;
  322. margin-left: 20rpx;
  323. }
  324. }
  325. .input-content {
  326. text-align: right;
  327. font-size: $font-size-base;
  328. flex: 1;
  329. margin-left: 30rpx;
  330. }
  331. .input-img {
  332. display: flex;
  333. align-items: center;
  334. justify-content: center;
  335. margin: 40rpx 0;
  336. width: 300rpx;
  337. height: 140rpx;
  338. border: 2rpx dashed $color-disabled;
  339. .iconfont {
  340. font-size: 68rpx;
  341. color: $color-disabled;
  342. }
  343. image {
  344. width: 100%;
  345. height: 100%;
  346. }
  347. }
  348. }
  349. }
  350. .shroff-account {
  351. padding-bottom: 38rpx;
  352. padding-top: 38rpx;
  353. background: #fff;
  354. border-radius: $border-radius;
  355. .account-title {
  356. display: block;
  357. padding: 20rpx 0 20rpx;
  358. font-size: $font-size-base;
  359. color: $color-title;
  360. text-align: center;
  361. border: 1px solid $color-line;
  362. border-bottom: 0;
  363. }
  364. .account-content {
  365. view {
  366. display: flex;
  367. border-top: 2rpx solid $color-line;
  368. border-right: 2rpx solid $color-line;
  369. &:last-of-type {
  370. border-bottom: 2rpx solid $color-line;
  371. }
  372. }
  373. text {
  374. padding: 20rpx;
  375. border-left: 2rpx solid $color-line;
  376. &:first-of-type {
  377. width: 180rpx;
  378. }
  379. &:last-of-type {
  380. // border-ri: 2rpx solid $color-line;
  381. }
  382. }
  383. }
  384. }
  385. button {
  386. margin-top: 40rpx;
  387. margin-bottom: 40rpx;
  388. }
  389. </style>