index.php 66 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-rich-text');
  4. ComponentHelper::loadComponentView('com-dialog-select');
  5. ComponentHelper::loadComponentView('com-image');
  6. ComponentHelper::loadComponentView('store-list-view', __DIR__ . '/../compoents/store');
  7. ComponentHelper::loadComponentView('store-score-apply', __DIR__ . '/../compoents/store');
  8. ComponentHelper::loadComponentView('store-score-protocol', __DIR__ . '/../compoents/store');
  9. ComponentHelper::loadComponentView('com-store-list', __DIR__ . '/../compoents/store');
  10. use common\helpers\AddonHelper;
  11. ComponentHelper::loadComponentView('coupon-select', AddonHelper::getAddonRootPath('Coupon') . 'backend/views/components');
  12. ComponentHelper::loadComponentView('pattern-rebate', __DIR__ . '/');
  13. ComponentHelper::loadComponentView('com-dialog-store');
  14. ?>
  15. <div id="app" v-cloak>
  16. <el-card v-loading="loading" style="border:0" shadow="never" body-style="padding: 0 0;">
  17. <el-tabs v-model="activeName" @tab-click="handleClick">
  18. <el-tab-pane label="基本设置" name="basic">
  19. <?php ComponentHelper::loadComponentView('basic', __DIR__ . '/'); ?>
  20. </el-tab-pane>
  21. <el-tab-pane label="收银设置" name="cashier" class="cashier-tabs">
  22. <?php ComponentHelper::loadComponentView('cashier', __DIR__ . '/'); ?>
  23. </el-tab-pane>
  24. <el-tab-pane label="模式设置" name="mode" class="cashier-tabs">
  25. <?php ComponentHelper::loadComponentView('pattern', __DIR__ . '/'); ?>
  26. </el-tab-pane>
  27. <el-tab-pane label="入驻设置" name="enter">
  28. <?php ComponentHelper::loadComponentView('enter', __DIR__ . '/'); ?>
  29. </el-tab-pane>
  30. <el-tab-pane label="装修风格" name="decoration">
  31. <?php ComponentHelper::loadComponentView('decoration', __DIR__ . '/'); ?>
  32. </el-tab-pane>
  33. <el-tab-pane label="商品设置" name="goodsStore">
  34. <?php ComponentHelper::loadComponentView('goods_store', __DIR__ . '/'); ?>
  35. </el-tab-pane>
  36. <el-tab-pane label="门店设置" name="store">
  37. <?php ComponentHelper::loadComponentView('store', __DIR__ . '/'); ?>
  38. </el-tab-pane>
  39. <el-tab-pane label="资产设置" name="finance">
  40. <?php ComponentHelper::loadComponentView('finance', __DIR__ . '/'); ?>
  41. </el-tab-pane>
  42. <el-tab-pane label="支付方式设置" name="payment">
  43. <?php ComponentHelper::loadComponentView('payment', __DIR__ . '/'); ?>
  44. </el-tab-pane>
  45. <el-tab-pane label="提示语设置" name="tips">
  46. <?php ComponentHelper::loadComponentView('tips', __DIR__ . '/'); ?>
  47. </el-tab-pane>
  48. <el-tab-pane label="广告设置" name="advertising">
  49. <?php ComponentHelper::loadComponentView('advertising', __DIR__ . '/'); ?>
  50. </el-tab-pane>
  51. <el-tab-pane label="积分赠送设置" name="scoreGive">
  52. <?php ComponentHelper::loadComponentView('score_give', __DIR__ . '/'); ?>
  53. </el-tab-pane>
  54. <el-tab-pane label="评分设置" name="rating_setting">
  55. <?php ComponentHelper::loadComponentView('rating_setting', __DIR__ . '/'); ?>
  56. </el-tab-pane>
  57. <el-tab-pane label="短信提醒" name="sms_setting">
  58. <?php ComponentHelper::loadComponentView('sms_setting', __DIR__ . '/'); ?>
  59. </el-tab-pane>
  60. <el-tab-pane label="消息提醒" name="notice">
  61. <?php ComponentHelper::loadComponentView('notice', __DIR__ . '/'); ?>
  62. </el-tab-pane>
  63. </el-tabs>
  64. </el-card>
  65. </div>
  66. <script>
  67. const app = new Vue({
  68. el: '#app',
  69. data() {
  70. // 自定义校验规则 (积分抵扣校验)
  71. let checkDeductionMin = (rule, value, callback) => {
  72. let fieldArr = rule.field.split('.')
  73. if(value < 0){
  74. callback(new Error('不能小于0'));
  75. return
  76. } else if(fieldArr.length == 4 && fieldArr[2]*1){
  77. let index = fieldArr[2]
  78. let item = this.paymentForm.score_deduction.deduction_proportion[index-1]
  79. if (parseFloat(value) <= parseFloat(item.max)) {
  80. callback(new Error('不能小于上个区间的结束值'));
  81. return
  82. }
  83. }
  84. callback();
  85. };
  86. let checkDeductionMax = (rule, value, callback) => {
  87. let fieldArr = rule.field.split('.')
  88. if(value < 0){
  89. value = 0
  90. callback(new Error('不能小于0'));
  91. return
  92. } else if(fieldArr.length == 4){
  93. let index = fieldArr[2]
  94. let item = this.paymentForm.score_deduction.deduction_proportion[index]
  95. if (parseFloat(value) <= parseFloat(item.min)) {
  96. callback(new Error('不能小于起始值'));
  97. return
  98. }
  99. }
  100. callback();
  101. };
  102. let checkDeductionRatio = (rule, value, callback) => {
  103. if(value < 0 || value > 100) {
  104. callback(new Error('抵扣比例取值在 0~100 之间'));
  105. } else {
  106. callback();
  107. }
  108. };
  109. return {
  110. loading: false,
  111. submitLoading: false,
  112. activeName: 'basic',
  113. default_goods_style1: "/resources/addons/store/img/default_goods_style1.png",
  114. default_goods_style2: "/resources/addons/store/img/default_goods_style2.png",
  115. default_store_style1: "/resources/addons/store/img/new_default_store_style1.png",
  116. default_store_style2: "/resources/addons/store/img/new_default_store_style2.png",
  117. default_store_style3: "/resources/addons/store/img/new_default_store_style3.png",
  118. default_store_cate_style1: "/resources/addons/store/img/default_store_cate_style1.png",
  119. default_store_cate_style2: "/resources/addons/store/img/default_store_cate_style2.png",
  120. pay_after_link_show: '订单详情',
  121. defaultTabs: [
  122. {"name":"mall"}
  123. ],
  124. basicForm: {
  125. o2o_url: 'plugins2/Store/store/storeindex',
  126. goods_auth: 0,
  127. service_fee: 0,
  128. settle_type: 1,
  129. service_fee_settle_type: 1,
  130. platform_ratio: 0,
  131. risk_management: 0,
  132. risk_management_ratio: 0,
  133. settle_scene: 2,
  134. store_distribution_status: 0,
  135. store_agent_status: 0,
  136. store_area_status: 0,
  137. store_boss_status: 0,
  138. is_distribution_enable: 0,
  139. is_agent_enable: 0,
  140. is_area_enable: 0,
  141. is_boss_enable: 0,
  142. watch_times: 0,
  143. recommend_nums: 0,
  144. payment_settle_info: [],
  145. payment_settle: [],
  146. is_show_location_store: 0,
  147. is_location_limit: 0,
  148. localtion_limit: 10,
  149. is_double_copy_enable: 0,
  150. double_copy_status: 0,
  151. is_rebate_enable: 0,
  152. store_rebate_status: 0,
  153. is_enable_dollars_symbol: 0,
  154. dollars_symbol: '',
  155. score_give_setting: {
  156. is_open:0,
  157. bear:0,
  158. condition:1,
  159. give_type:1,
  160. give_num:0,
  161. settlement:0,
  162. },
  163. total_score:0,
  164. speciality:0,
  165. service_attitude:0,
  166. timeliness:0,
  167. service_fee_type: 0,
  168. store_distribution_fee_type:1,
  169. store_area_fee_type:1,
  170. },
  171. migrationStore: [],
  172. enterForm: {
  173. is_template: 0,
  174. is_front_template: 1,
  175. template_store_id: null,
  176. template_store: [],
  177. is_enable: 0,
  178. time_status: 0,
  179. expired_days: 0,
  180. store_audit: 0,
  181. upload_license_image: 0,
  182. mode: 1,
  183. goods_ids: [],
  184. goods_list: [],
  185. recruit_title: '商家入驻',
  186. recruit_content: '',
  187. recruit_btn_text: '申请入驻',
  188. dow_center_agreement: '',
  189. store_auth: 0,
  190. buy_store_num: 0, // 入驻条件:购买商品的门店数
  191. finish_order_num: 0, // 入驻条件:完成订单数
  192. },
  193. cashierForm: {
  194. preferential_undertaking: '1', //优惠谁承担
  195. is_distribution_enable: 1,
  196. is_agent_enable: 1,
  197. service_fee_ratio: 0,
  198. member_status: 0,
  199. members: [
  200. // {
  201. // level: 0,
  202. // level_name: '默认等级',
  203. // discount: 0
  204. // }
  205. ],
  206. is_distribution: 0,
  207. deepNames: ['一级分销', '二级分销'],
  208. distribution_settings: [
  209. // {
  210. // level: 0,
  211. // level_name: '默认等级',
  212. // name: '佣金',
  213. // commission_rate: [0, 0]
  214. // },
  215. ],
  216. distribution_settings_score: [{
  217. level: 0,
  218. level_name: '默认等级',
  219. name: '佣金',
  220. commission_rate: [0, 0]
  221. }, ],
  222. is_agent: 0,
  223. agent_settings: {
  224. team_rewards: [
  225. // {
  226. // level: 0,
  227. // level_name: '默认等级',
  228. // commission_rate: 0
  229. // },
  230. ],
  231. equal_rewards: [
  232. // {
  233. // level: 0,
  234. // level_name: '默认等级',
  235. // commission_rate: 0
  236. // },
  237. ],
  238. over_rewards: [
  239. // {
  240. // level: 0,
  241. // level_name: '默认等级',
  242. // commission_rate: 0
  243. // },
  244. ],
  245. },
  246. area_currency: [],
  247. cashier_distribution_currencys: {},
  248. collect_reward: [],
  249. payment_reward: [],
  250. collect_reward_info: [],
  251. payment_reward_info: [],
  252. cashier_bg_img: '',
  253. cashier_amount: [],
  254. cashier_amount_info: [],
  255. cashier_settle_type: 1,
  256. is_double_copy_enable_cashier:1,
  257. DoubleCopy_Cashier: {
  258. commission: {
  259. is_enable: 0,
  260. is_percent: 0,
  261. detail: [],
  262. },
  263. },
  264. is_area_enable_cashier: 1, // 区域管理是否安装
  265. AreaCashier: { // 区域管理配置
  266. is_enable: 1, // 是否开启区域管理
  267. }
  268. },
  269. decorationForm: {
  270. custom_goods_style: 0,
  271. default_goods_style: 1,
  272. custom_store_style: 0,
  273. default_store_style: 1,
  274. default_store_cate_style: 1,
  275. near_shop_title: '',
  276. store_category_switch: 0,
  277. },
  278. storeGoodsForm: {
  279. min_price: 0,
  280. max_price: 0,
  281. is_limit_max_price: false,
  282. express_title_arr: [],
  283. is_hidden_goods_store: 0,
  284. },
  285. storeForm: {
  286. store_h5_login_url: '',
  287. },
  288. financeForm: {
  289. freeze_is_enable: 0,
  290. finance_name: '',
  291. balance_cash_service_fee: 0,
  292. balance_cash_type: [],
  293. balance_withdraw_way: [],
  294. balance_cash_service_fee_limit: 0,
  295. balance_cash_service_fee_month: 0,
  296. balance_cash_service_fee_diff: 0,
  297. },
  298. paymentForm: {
  299. payment_is_enable: 0,
  300. payment_type: [],
  301. payment_way: [],
  302. score_pay_setting: 0,
  303. score_pay: 0,
  304. score_pay_password_status: 0,
  305. pay_after_link:'',
  306. score_open_type:1,
  307. score_deduction:{
  308. deduction_type: 0,
  309. is_score_deduction: 0,//
  310. effective: '',//
  311. score_balance_ratio: '',//
  312. deduction_proportion: [
  313. {
  314. min: '',
  315. max: '',
  316. deduction_ratio: ''
  317. },
  318. ],
  319. max_deduction_percent: 0,
  320. store_limit_type: 0,
  321. store_limit_stores: [],
  322. store_limit_stores_deduction: {}
  323. },
  324. store_limit_protocol: ''
  325. },
  326. tipsForm: {
  327. link_tips: '',
  328. bank_account_tips: '',
  329. },
  330. advertisingForm: {
  331. type: 1,
  332. is_open: 0,
  333. pic: '',
  334. url: '',
  335. },
  336. ratingSettingForm:{
  337. total_score:1,
  338. environment_score:1,
  339. service_score:1,
  340. staff_score:1,
  341. },
  342. scoreGiveForm: {
  343. score_give_setting: {
  344. is_open:0,
  345. bear:0,
  346. condition:1,
  347. give_type:1,
  348. give_num:0,
  349. settlement:0,
  350. },
  351. score_give_is_store_alone: 0,
  352. store_limit_type: 0,
  353. store_limit_stores: [],
  354. store_limit_protocol: '',
  355. },
  356. basicFormRules: {
  357. settle_type: [
  358. // {
  359. // required: true,
  360. // message: '请选择计算方式',
  361. // trigger: 'blur'
  362. // }
  363. ],
  364. settle_scene: [
  365. // {
  366. // required: true,
  367. // message: '请选择结算方式',
  368. // trigger: 'blur'
  369. // }
  370. ],
  371. },
  372. decorationFormRules: {},
  373. storeGoodsFormRules: {},
  374. storeFormRules: {},
  375. enterRules: {},
  376. cashierFormRules: {},
  377. modeForm: {
  378. is_enable_mode: 0,
  379. is_distribution_enable: 1,
  380. is_agent_enable: 1,
  381. is_boss_enable: 1,
  382. is_area_enable: 1,
  383. is_double_copy_enable: 1,
  384. is_rebate_enable: 1,
  385. is_double_copy_enable_cashier: 1,
  386. Distribution: {
  387. commission: {
  388. is_enable: 0,
  389. is_percent: 0,
  390. detail: [
  391. // {
  392. // level: 0,
  393. // level_name: '默认等级',
  394. // first_prize: 0,
  395. // second_prize: 0,
  396. // third_prize: 0
  397. // }
  398. ],
  399. },
  400. score: {
  401. is_enable: 0,
  402. is_percent: 0,
  403. detail: [
  404. // {
  405. // level: 0,
  406. // level_name: '默认等级',
  407. // first_prize: 0,
  408. // second_prize: 0,
  409. // third_prize: 0
  410. // }
  411. ],
  412. }
  413. },
  414. Agent: {
  415. commission: {
  416. is_enable: 0,
  417. is_percent_team: 0,
  418. is_percent_equal: 0,
  419. is_percent_over: 0,
  420. is_percent_extra: 0,
  421. detail: [
  422. // {
  423. // level: 0,
  424. // level_name: '默认等级',
  425. // agent_team_prize: 0,
  426. // agent_equal_prize: 0,
  427. // agent_over_prize: 0,
  428. // agent_extra_prize: 0
  429. // }
  430. ],
  431. },
  432. score: {
  433. is_enable: 0,
  434. is_percent_team: 0,
  435. is_percent_equal: 0,
  436. is_percent_over: 0,
  437. is_percent_extra: 0,
  438. detail: [
  439. // {
  440. // level: 0,
  441. // level_name: '默认等级',
  442. // agent_team_prize: 0,
  443. // agent_equal_prize: 0,
  444. // agent_over_prize: 0,
  445. // agent_extra_prize: 0
  446. // }
  447. ],
  448. }
  449. },
  450. Boss: {
  451. is_enable: 0,
  452. is_extra: 0,
  453. detail: [
  454. // {
  455. // level: 0,
  456. // level_name: '默认等级',
  457. // prize: 0,
  458. // extra_prize: 0
  459. // }
  460. ]
  461. },
  462. Area: {
  463. is_enable: 0,
  464. detail: [
  465. // {
  466. // level: 0,
  467. // level_name: '默认等级',
  468. // prize: 0,
  469. // equal_prize: 0
  470. // }
  471. ],
  472. detail_score: [],
  473. },
  474. distribution_currency: [],
  475. agent_currency: [],
  476. area_currency: [],
  477. boss_settings: [],
  478. DoubleCopy: {
  479. commission: {
  480. is_enable: 0,
  481. is_percent: 0,
  482. detail: [],
  483. },
  484. },
  485. DoubleCopy_Cashier: {
  486. commission: {
  487. is_enable: 0,
  488. is_percent: 0,
  489. detail: [],
  490. },
  491. },
  492. Rebate: {
  493. is_enable: 0,
  494. detail: [
  495. // initiate_type: 0,
  496. // initiate_level: [],
  497. // consume_type: 0,
  498. // consume_level: [],
  499. // reward_type: 1,
  500. // reward_info: [],
  501. // is_repeat: 0,
  502. // join_type: 0,
  503. // repeat_setting: 0,
  504. // agent_limit_num: 0,
  505. ]
  506. },
  507. },
  508. distributionName: 'distribution-commission',
  509. cashierDistributionName: 'cashier-distribution-settings',
  510. cashierAgentName: 'cashier-agent-settings',
  511. agentName: 'agent-commission',
  512. areaName: 'area-detail',
  513. bossName: 'commission',
  514. cashierTab: 'distribution-cashier',
  515. level: 0,
  516. stretch: true,
  517. paymentRules:{
  518. deduction_min:[
  519. { required: true, message: '请填写消费区间', trigger: 'blur' },
  520. { validator: checkDeductionMin, trigger: 'blur' }
  521. ],
  522. deduction_max:[
  523. { required: true, message: '请填写消费区间', trigger: 'blur' },
  524. { validator: checkDeductionMax, trigger: 'blur' }
  525. ],
  526. deduction_ratio:[
  527. { required: true, message: '请输入抵扣比例', trigger: 'blur' },
  528. { validator: checkDeductionRatio, trigger: 'blur' }
  529. ],
  530. 'score_deduction.score_balance_ratio': { required: true, message: '请输入积分转换比例', trigger: 'blur' }
  531. },
  532. batch_deduction: 0,
  533. btnLoading: false,
  534. smsSettingForm:{
  535. is_pay_remind: 0,
  536. pay_template_id:'',
  537. pay_template_variable:'',
  538. //门店到期短信提醒
  539. is_alert_expire: 0,
  540. expire_day: '',
  541. expire_template_id: '',
  542. expire_template_variable: '',
  543. },
  544. noticeForm: {
  545. notice_wechat: {
  546. is_logging: 0,
  547. template_message: {},
  548. }
  549. },
  550. noticeFormRules: {},
  551. notice_loading: false,
  552. updateBtnLoading: false,
  553. };
  554. },
  555. computed: {
  556. isAddDeduction() {
  557. let result = false
  558. this.paymentForm.score_deduction.deduction_proportion.forEach(item=>{
  559. if(item.min === '' || item.max === '' || item.deduction_ratio === ''){
  560. result = true
  561. }
  562. })
  563. return result
  564. }
  565. },
  566. mounted: function() {
  567. this.loadData();
  568. },
  569. methods: {
  570. tabClickHandle(tab, key) {
  571. this[key] = tab.name
  572. },
  573. tabClickHandles(tab, key) {
  574. this[key] = tab.name
  575. },
  576. onSubmit() {
  577. console.log('submit!');
  578. },
  579. /* test(event, ...vv) {
  580. console.info(event, vv);
  581. let data = this[vv[0]];
  582. console.log(data);
  583. event = 0;
  584. if (vv.length == 1) {
  585. data = event
  586. } else if (vv.length - 1 == 1) {
  587. data[vv[1]] = event
  588. } else {
  589. // debugger
  590. let newVV = [...vv];
  591. newVV.shift();
  592. for (let index = 1; index < vv.length; index++) {
  593. data = data[vv[index]];
  594. if ((vv.length - newVV.length) == vv.length - 2) {
  595. data[vv[vv.length - 1]] = event
  596. }
  597. newVV.shift();
  598. }
  599. }
  600. console.info(data);
  601. console.info(this.cashierForm);
  602. }, */
  603. // 复制首页链接
  604. copyLink(link) {
  605. link = localStorage.getItem('h5_domain') + '/#/' + link + '?sign=' + localStorage.getItem('mall_sign');
  606. // console.log('link: ', link);
  607. var input = document.getElementById("copy-container");
  608. input.value = link; // 修改文本框的内容
  609. input.select(); // 选中文本
  610. document.execCommand("copy"); // 执行浏览器复制命令
  611. this.$message.success('复制成功');
  612. },
  613. copyStoreLink(link) {
  614. // link = localStorage.getItem('h5_domain') + link + '?sign=' + localStorage.getItem('mall_sign');
  615. // console.log('link: ', link);
  616. var input = document.getElementById("copy-container-store");
  617. input.value = link; // 修改文本框的内容
  618. input.select(); // 选中文本
  619. document.execCommand("copy"); // 执行浏览器复制命令
  620. this.$message.success('复制成功');
  621. },
  622. // 输入值过滤处理
  623. changeHandle(key) {
  624. try {
  625. this.flierValue(this.activeName, key);
  626. } catch (err) {
  627. this.$message.error(err);
  628. let formName = this.activeName + 'Form';
  629. if (this[formName][key] < 0) {
  630. this[formName][key] = Math.abs(this[formName][key]);
  631. } else if (this[formName][key] > 100) {
  632. this[formName][key] = 0;
  633. }
  634. return false;
  635. }
  636. },
  637. // 过滤和处理值
  638. flierValue(group, key) {
  639. // console.log(group, key);
  640. let configs = {
  641. platform_ratio: {
  642. text: `服务费比例取值在 0~100 之间`,
  643. max: '100',
  644. min: '0',
  645. },
  646. risk_management_ratio: {
  647. text: '售价比例取值在 0~100 之间',
  648. max: '100',
  649. min: '0',
  650. },
  651. expired_days: {
  652. text: '请填写门店有效天数',
  653. min: '0',
  654. },
  655. service_fee_ratio: {
  656. text: `服务费比例取值在 0~100 之间`,
  657. max: '100',
  658. min: '0',
  659. },
  660. balance_cash_service_fee_diff: {
  661. text: `服务费比例取值在 0~100 之间`,
  662. max: '100',
  663. min: '0',
  664. },
  665. };
  666. let datas = {
  667. basic: this.basicForm,
  668. cashier: this.cashierForm,
  669. enter: this.enterForm,
  670. finance: this.financeForm,
  671. payment: this.paymentForm,
  672. };
  673. let val = datas[group][key];
  674. if (configs[key]) {
  675. if (configs[key].max && val > parseInt(configs[key].max)) {
  676. throw new Error(configs[key].text);
  677. }
  678. if (configs[key].min && val < parseInt(configs[key].min)) {
  679. throw new Error(configs[key].text);
  680. }
  681. }
  682. },
  683. loadData() {
  684. let self = this;
  685. this.loading = true;
  686. request({
  687. params: {
  688. r: 'store/store-setting/index',
  689. },
  690. }).then(e => {
  691. // console.log('LLLLLLL: ', e);
  692. self.loading = false;
  693. if (e.data.code === 0) {
  694. self.level = e.data.data.level;
  695. if (e.data.data.basic) {
  696. if (e.data.data.basic.is_basic_null) {
  697. self.basicForm.is_boss_enable = e.data.data.basic.is_boss_enable;
  698. self.basicForm.is_area_enable = e.data.data.basic.is_area_enable;
  699. self.basicForm.is_agent_enable = e.data.data.basic.is_agent_enable;
  700. self.basicForm.is_distribution_enable = e.data.data.basic.is_distribution_enable;
  701. self.basicForm.is_double_copy_enable = e.data.data.basic.is_double_copy_enable;
  702. self.basicForm.is_rebate_enable = e.data.data.basic.is_rebate_enable;
  703. self.basicForm.payment_settle = e.data.data.basic.payment_settle;
  704. self.basicForm.payment_settle_info = e.data.data.basic.payment_settle_info;
  705. self.basicForm.min_platform_ratio = e.data.data.basic.min_platform_ratio;
  706. self.basicForm.max_platform_ratio = e.data.data.basic.max_platform_ratio;
  707. } else {
  708. self.basicForm = e.data.data.basic;
  709. }
  710. }
  711. if (e.data.data.cashier) {
  712. self.cashierForm = e.data.data.cashier;
  713. self.cashierForm.preferential_undertaking = self.cashierForm.preferential_undertaking.toString();
  714. }
  715. if (e.data.data.enter) {
  716. self.enterForm = Object.assign(this.enterForm, e.data.data.enter);
  717. self.migrationStore = e.data.data.enter.template_store;
  718. if (Array.isArray(self.migrationStore) && self.migrationStore.length > 0) {
  719. self.enterForm.template_store_id = self.migrationStore[0].id;
  720. }
  721. }
  722. if (e.data.data.decoration) {
  723. self.decorationForm = e.data.data.decoration;
  724. }
  725. if (e.data.data.goodsStore) {
  726. self.storeGoodsForm = e.data.data.goodsStore;
  727. }
  728. if (e.data.data.store_setting) {
  729. self.storeForm = e.data.data.store_setting;
  730. }
  731. if (e.data.data.mode) {
  732. let modeData = e.data.data.mode;
  733. for (key in modeData) {
  734. if (modeData[key] != null) {
  735. self.modeForm[key] = modeData[key];
  736. }
  737. }
  738. // console.log(self.modeForm, '========== kkkkkkk ============');
  739. }
  740. if (e.data.data.finance) {
  741. self.financeForm = e.data.data.finance;
  742. }
  743. if (e.data.data.payment) {
  744. self.paymentForm = e.data.data.payment;
  745. if (self.paymentForm.pay_after_link !== '') {
  746. this.pay_after_link_show = self.paymentForm.pay_after_link.params.title;
  747. }
  748. }
  749. if(e.data.data.tips){
  750. self.tipsForm = e.data.data.tips;
  751. }
  752. self.advertisingForm = e.data.data.advertising;
  753. self.ratingSettingForm = e.data.data.rating_setting;
  754. if(e.data.data.advertising){
  755. self.advertisingForm = e.data.data.advertising;
  756. }
  757. if(e.data.data.scoreGive){
  758. self.scoreGiveForm = e.data.data.scoreGive;
  759. }
  760. if(e.data.data.sms_setting){
  761. self.smsSettingForm = e.data.data.sms_setting;
  762. }
  763. if(e.data.data.notice_wechat){
  764. self.noticeForm.notice_wechat = e.data.data.notice_wechat;
  765. }
  766. localStorage.setItem('h5_domain', e.data.data.h5_domain);
  767. localStorage.setItem('mall_sign', e.data.data.mall_sign);
  768. } else {
  769. self.$message.error(e.data.msg);
  770. }
  771. }).catch(e => {
  772. console.log(e);
  773. self.$message.error('网络错误');
  774. });
  775. },
  776. // 配置提交
  777. submit(formName) {
  778. // console.log('5555555555: ', formName, this.activeName);return null;
  779. let self = this;
  780. let keys = [];
  781. if ('basic' == self.activeName) {
  782. if (self.basicForm.service_fee == 1) {
  783. keys.push('platform_ratio');
  784. }
  785. if (self.basicForm.risk_management == 1) {
  786. keys.push('risk_management_ratio');
  787. }
  788. } else if ('cashier' == self.activeName) {
  789. keys = ['service_fee_ratio'];
  790. // 会员等级折扣验证
  791. if (1 == self.cashierForm.member_status) {
  792. let memberForNum = self.cashierForm.members.length;
  793. for (let i = 0; i < memberForNum; i++) {
  794. let discount_val = self.cashierForm.members[i].discount;
  795. if (discount_val < 0 || discount_val > 100) {
  796. self.$message.error('会员折扣比例取值在 0~100 之间');
  797. return false;
  798. }
  799. }
  800. }
  801. // 分销佣金比例验证
  802. if (1 == self.cashierForm.is_distribution && 1 == self.cashierForm.is_distribution_enable) {
  803. let forNum = self.cashierForm.distribution_settings.length;
  804. for (let i = 0; i < forNum; i++) {
  805. let val = self.cashierForm.distribution_settings[i].commission_rate;
  806. let valForNum = val.length;
  807. for (let i = 0; i < valForNum; i++) {
  808. if (val[i] < 0 || val[i] > 100) {
  809. self.$message.error('分销佣金比例取值在 0~100 之间');
  810. return false;
  811. }
  812. }
  813. }
  814. }
  815. // 经销佣金比例验证
  816. if (1 == self.cashierForm.is_agent && 1 == self.cashierForm.is_agent_enable) {
  817. for (key in self.cashierForm.agent_settings) {
  818. let settings = self.cashierForm.agent_settings[key];
  819. let forNum = settings.length;
  820. for (let i = 0; i < forNum; i++) {
  821. let val = settings[i].commission_rate;
  822. if (val < 0 || val > 100) {
  823. self.$message.error('经销佣金比例取值在 0~100 之间');
  824. return false;
  825. }
  826. }
  827. }
  828. }
  829. } else if ('enter' == self.activeName) {
  830. keys = ['expired_days'];
  831. if (1 == self.enterForm.time_status && !self.enterForm.expired_days) {
  832. self.$message.error('请填写门店有效天数');
  833. return false;
  834. }
  835. if (2 == self.enterForm.mode && !self.enterForm.goods_ids.length) {
  836. self.$message.error('请选择入驻必须消费的商品');
  837. return false;
  838. }
  839. if (1 == self.enterForm.is_template && !self.enterForm.template_store_id ) {
  840. self.$message.error('请选择模板门店');
  841. return false;
  842. }
  843. } else if ('mode' == self.activeName) {
  844. keys = [];
  845. // console.log(self.modeForm, 'pppppppppp==========');return null;
  846. if (self.modeForm.is_enable_mode == 1) {
  847. // 分销佣金比例验证.
  848. let dstInfo = self.modeForm.Distribution;
  849. let dstPrizeMap = ['first_prize', 'second_prize', 'third_prize'];
  850. for (let dk in self.modeForm.Distribution) {
  851. if (dstInfo[dk].is_enable == 1) {
  852. let forNum = dstInfo[dk].detail.length;
  853. for (let i = 0; i < forNum; i++) {
  854. let detail = dstInfo[dk].detail[i];
  855. for (dik in detail) {
  856. if (dstPrizeMap.indexOf(dik) > -1) {
  857. if (detail[dik] < 0) {
  858. self.$message.error('分销等级 [' + detail.level_name + '] 比例不能小于 0');
  859. return false;
  860. }
  861. }
  862. if (dstInfo[dk].is_percent == 1 && detail[dik] > 100) {
  863. self.$message.error('分销等级 [' + detail.level_name + '] 比例不能大于 100');
  864. return false;
  865. }
  866. }
  867. }
  868. }
  869. }
  870. // 经销佣金比例验证
  871. let agentInfo = self.modeForm.Agent;
  872. let agentPrizeMap = ['agent_team_prize', 'agent_equal_prize', 'agent_over_prize', 'agent_extra_prize'];
  873. let agentPrizePercentMap = {
  874. agent_team_prize: 'is_percent_team',
  875. agent_equal_prize: 'is_percent_equal',
  876. agent_over_prize: 'is_percent_over',
  877. agent_extra_prize: 'is_percent_extra'
  878. };
  879. for (let ak in agentInfo) {
  880. if (agentInfo[ak].is_enable == 1) {
  881. if (agentInfo[ak].detail && agentInfo[ak].detail.length) {
  882. let forNum = agentInfo[ak].detail.length;
  883. for (let i = 0; i < forNum; i++) {
  884. let detail = agentInfo[ak].detail[i];
  885. for (dik in detail) {
  886. if (agentPrizeMap.indexOf(dik) > -1) {
  887. if (agentInfo[ak].is_percent_team == 0) {
  888. if (detail[dik] < 0) {
  889. self.$message.error('经销等级 [' + detail.level_name + '] 比例不能小于 0');
  890. return false;
  891. }
  892. if (agentInfo[ak][agentPrizePercentMap[dik]] == 1 && detail[dik] > 100) {
  893. self.$message.error('经销等级 [' + detail.level_name + '] 比例不能大于 100');
  894. return false;
  895. }
  896. }
  897. }
  898. }
  899. }
  900. }
  901. }
  902. }
  903. // 股东分红等级比例验证
  904. /* let bossInfo = self.modeForm.Boss;
  905. if (bossInfo.is_enable == 1) {
  906. let forNum = bossInfo.detail.length;
  907. for (let i = 0; i < forNum; i++) {
  908. let detail = bossInfo.detail[i];
  909. if (detail.prize < 0 || detail.prize > 100) {
  910. self.$message.error('股东分红等级 ['+ detail.level_name+ '] 比例在 0 ~ 100 之间');
  911. return false;
  912. }
  913. if (bossInfo.is_extra == 1) {
  914. if (detail.extra_prize < 0 || detail.extra_prize > 100) {
  915. self.$message.error('股东 ['+ detail.level_name+ '] 额外分红比例在 0 ~ 100 之间');
  916. return false;
  917. }
  918. }
  919. }
  920. } */
  921. // 区域分红等级比例验证
  922. let areaInfo = self.modeForm.Area;
  923. if (areaInfo.is_enable == 1) {
  924. let forNum = areaInfo.detail.length;
  925. for (let i = 0; i < forNum; i++) {
  926. let detail = areaInfo.detail[i];
  927. if (detail.prize < 0 || detail.prize > 100) {
  928. self.$message.error('区域等级 [' + detail.level_name + '] 默认分红比例在 0 ~ 100 之间');
  929. return false;
  930. }
  931. if (detail.equal_prize < 0 || detail.equal_prize > 100) {
  932. self.$message.error('区域等级 [' + detail.level_name + '] 平级奖比例在 0 ~ 100 之间');
  933. return false;
  934. }
  935. }
  936. }
  937. }
  938. } else if ('decoration' == self.activeName) {
  939. } else if ('goodsStore' == self.activeName) {
  940. } else if ('noticeForm' == self.activeName) {
  941. }
  942. let forNum = keys.length;
  943. for (let i = 0; i < forNum; i++) {
  944. try {
  945. self.flierValue(self.activeName, keys[i]);
  946. } catch (err) {
  947. self.$message.error(err);
  948. return false;
  949. }
  950. }
  951. self.$refs[formName].validate(valid => {
  952. if (valid) {
  953. self.submitLoading = true;
  954. let activeName = self.activeName;
  955. let formData = {};
  956. formData[activeName] = self[formName];
  957. formData.group = activeName;
  958. // console.log(formData);return null;
  959. request({
  960. params: {
  961. r: 'store/store-setting/index',
  962. },
  963. method: 'post',
  964. data: formData,
  965. }).then(e => {
  966. self.submitLoading = false;
  967. if (e.data.code === 0) {
  968. self.$message.success(e.data.msg);
  969. } else {
  970. self.$message.error(e.data.msg);
  971. }
  972. }).catch(e => {
  973. console.log('打印1',e)
  974. console.log(e);
  975. self.$message.error('网络错误');
  976. });
  977. } else {
  978. self.$message.error('参数验证未通过');
  979. }
  980. });
  981. },
  982. handleClick(tab, event) {
  983. this.activeName = tab.name;
  984. },
  985. updateData(val)
  986. {
  987. this.modeForm.Rebate=val;
  988. },
  989. // 选中商品回调
  990. goodsSelect(list) {
  991. for (let j in list) {
  992. let item = list[j];
  993. if (this.enterForm.goods_ids.length >= 20) {
  994. this.$message.error('指定商品不能大于20个');
  995. return;
  996. }
  997. let flag = true;
  998. for (let i in this.enterForm.goods_ids) {
  999. if (this.enterForm.goods_ids[i] == item.id) {
  1000. flag = false;
  1001. break;
  1002. }
  1003. }
  1004. if (flag) {
  1005. this.enterForm.goods_ids.push(item.id);
  1006. this.enterForm.goods_list.push({
  1007. id: item.id,
  1008. goods_name: item.goods_name,
  1009. cover_pic: item.cover_pic,
  1010. });
  1011. }
  1012. }
  1013. },
  1014. // 删除已选择商品
  1015. deleteGoods(index) {
  1016. this.enterForm.goods_ids.splice(index, 1);
  1017. this.enterForm.goods_list.splice(index, 1);
  1018. },
  1019. delPic(key) {
  1020. this.cashierForm.cashier_bg_img = '';
  1021. this.$forceUpdate();
  1022. },
  1023. selectedImg(e) {
  1024. this.cashierForm.cashier_bg_img = e[0].url;
  1025. this.$forceUpdate();
  1026. },
  1027. selectUrl(e) {
  1028. let self = this;
  1029. let link_data = {};
  1030. console.log(e);
  1031. e.forEach(function (item) {
  1032. self.pay_after_link_show = item.title;
  1033. link_data = {
  1034. route: item.route,
  1035. open_type: item.open_type,
  1036. params: item.params,
  1037. }
  1038. });
  1039. console.log('111',link_data)
  1040. self.paymentForm.pay_after_link = link_data;
  1041. },
  1042. handleGiveTypeChange() {
  1043. if (this.scoreGiveForm.score_give_setting.give_type == 2) {
  1044. let giveNum = this.scoreGiveForm.score_give_setting.give_num
  1045. giveNum = giveNum ? giveNum : 0
  1046. this.scoreGiveForm.score_give_setting.give_num = parseInt(giveNum)
  1047. }
  1048. },
  1049. formatGiveNumber(value) {
  1050. if (this.scoreGiveForm.score_give_setting.give_type == 2) {
  1051. this.scoreGiveForm.score_give_setting.give_num = value.replace(/[^\d]/g, "")
  1052. } else {
  1053. let temp = value.toString();
  1054. temp = temp.replace(/。/g, ".");
  1055. temp = temp.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
  1056. temp = temp.replace(/^\./g, ""); //验证第一个字符是数字
  1057. temp = temp.replace(/\.{2,}/g, ""); //只保留第一个, 清除多余的
  1058. temp = temp.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
  1059. temp = temp.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3");
  1060. this.scoreGiveForm.score_give_setting.give_num = temp
  1061. }
  1062. },
  1063. formatLocaltion(value) {
  1064. let temp = this.formatNumber(value);
  1065. this.basicForm.localtion_limit = temp;
  1066. },
  1067. formatNumber(value) {
  1068. let temp = value.toString();
  1069. temp = temp.replace(/。/g, ".");
  1070. temp = temp.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
  1071. temp = temp.replace(/^\./g, ""); //验证第一个字符是数字
  1072. temp = temp.replace(/\.{2,}/g, ""); //只保留第一个, 清除多余的
  1073. temp = temp.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
  1074. temp = temp.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3");
  1075. return temp;
  1076. },
  1077. selectedImgAdvertising(e, key) {
  1078. this.advertisingForm[key] = e[0].url;
  1079. this.$forceUpdate();
  1080. },
  1081. delPicAdvertising(key) {
  1082. this.advertisingForm[key] = '';
  1083. this.$forceUpdate();
  1084. },
  1085. addItem() {
  1086. let deduction_proportion = JSON.parse(JSON.stringify(this.paymentForm.score_deduction.deduction_proportion));
  1087. let leng = deduction_proportion.length
  1088. let item = {min: '', max: '', deduction_ratio: ''};
  1089. if(leng){
  1090. let preItem = deduction_proportion[leng-1]
  1091. item.min = (preItem.max*1)+1
  1092. }
  1093. deduction_proportion.push(item);
  1094. this.paymentForm.score_deduction.deduction_proportion = deduction_proportion;
  1095. },
  1096. deleteItem() {
  1097. this.paymentForm.score_deduction.deduction_proportion.pop()
  1098. },
  1099. changeScoreOpenType(value){
  1100. switch (value){
  1101. case 1:
  1102. this.paymentForm.score_deduction.is_score_deduction = 0;
  1103. break;
  1104. case 2:
  1105. this.paymentForm.score_pay_setting =0;
  1106. this.paymentForm.score_pay =0;
  1107. for (let index in this.paymentForm.payment_type) {
  1108. // 遍历数组,对每个元素进行操作
  1109. if(this.paymentForm.payment_type[index]==12){
  1110. this.paymentForm.payment_type.splice(index, 1);
  1111. break;
  1112. }
  1113. }
  1114. break;
  1115. }
  1116. },
  1117. changeScoreDeductionStatus(value){
  1118. if(value==1 && this.paymentForm.score_open_type==1){
  1119. console.log('======',value)
  1120. this.paymentForm.score_deduction.is_score_deduction = 0;
  1121. }
  1122. //开启积分抵扣,则不能使用积分支付
  1123. if(this.paymentForm.score_deduction.is_score_deduction){
  1124. this.paymentForm.payment_type = this.paymentForm.payment_type.filter(item => item !== 12);
  1125. }
  1126. },
  1127. changeScorePaySetting(value){
  1128. if(value==1 && this.paymentForm.score_open_type==2){
  1129. console.log('======',value)
  1130. this.paymentForm.score_pay_setting = 0;
  1131. }
  1132. },
  1133. changeScorePay(value){
  1134. if(value==1 && this.paymentForm.score_open_type==2){
  1135. console.log('======',value)
  1136. this.paymentForm.score_pay = 0;
  1137. }
  1138. },
  1139. handleApplyClose(value) {
  1140. if(value.length <= 0) return;
  1141. value.forEach(store_id => {
  1142. if(this.scoreGiveForm.store_limit_stores.indexOf(store_id) == -1) {
  1143. this.scoreGiveForm.store_limit_stores.push(store_id);
  1144. }
  1145. });
  1146. },
  1147. handleScoreDeductionApplyClose(value) {
  1148. console.log(value);
  1149. if(value.length <= 0) return;
  1150. value.forEach(store_id => {
  1151. if(this.paymentForm.score_deduction.store_limit_stores_deduction[store_id] == undefined) {
  1152. this.$set(this.paymentForm.score_deduction.store_limit_stores_deduction, store_id, "");
  1153. }
  1154. if(this.paymentForm.score_deduction.store_limit_stores.indexOf(store_id) == -1) {
  1155. this.paymentForm.score_deduction.store_limit_stores.push(store_id);
  1156. }
  1157. });
  1158. },
  1159. handleStoreLimitChange(value) {
  1160. let _temp_deduction = {};
  1161. value.forEach(store_id => {
  1162. _temp_deduction[store_id] = this.paymentForm.score_deduction.store_limit_stores_deduction[store_id] ?? "";
  1163. });
  1164. this.paymentForm.score_deduction.store_limit_stores_deduction = _temp_deduction;
  1165. },
  1166. batchSetMaxDeduction() {
  1167. if(this.batch_deduction == '' || this.batch_deduction == null) {
  1168. this.$message.error('请输入批量设置的最高抵扣比例');
  1169. return;
  1170. }
  1171. let _selectStore = this.$refs.storeListRef.getSelectedRows();
  1172. if(_selectStore.length <= 0) {
  1173. this.$message.error('请选勾选需要批量设置的门店');
  1174. return;
  1175. }
  1176. _selectStore.forEach(item => {
  1177. let _store_id = item.id;
  1178. if(this.paymentForm.score_deduction.store_limit_stores_deduction[_store_id] != undefined){
  1179. this.$set(this.paymentForm.score_deduction.store_limit_stores_deduction, _store_id, this.batch_deduction);
  1180. }
  1181. });
  1182. },
  1183. storeSelect(param) {
  1184. this.migrationStore = [];
  1185. this.migrationStore.push(param);
  1186. this.enterForm.template_store_id = param.id;
  1187. this.enterForm.template_store = this.migrationStore;
  1188. },
  1189. testSend(type) {
  1190. this.btnLoading = true;
  1191. this.$request({
  1192. params: {
  1193. r: 'store/store-setting/send-sms',
  1194. },
  1195. method: 'post',
  1196. data: {
  1197. type: type,
  1198. },
  1199. }).then(e => {
  1200. this.btnLoading = false;
  1201. if (e.data.code === 0) {
  1202. this.$message.success(e.data.msg);
  1203. } else {
  1204. this.$message.error(e.data.msg);
  1205. }
  1206. }).catch(e => {
  1207. this.btnLoading = false;
  1208. });
  1209. },
  1210. handleChange(val) {
  1211. if(val === 1) {
  1212. this.open();
  1213. }
  1214. },
  1215. open() {
  1216. this.$alert('注意:若修改的区间比例不在入住的门店设置的比例范围内,将自动把门店的比例调整成区间比例的最大值', '提示', {
  1217. dangerouslyUseHTMLString: true,
  1218. // showCancelButton: true,
  1219. type: 'warning',
  1220. customClass: 'alertMessage'
  1221. }).then(() => {
  1222. }).catch(() => {
  1223. });
  1224. },
  1225. onInput(){
  1226. this.$forceUpdate();
  1227. },
  1228. getWechatNoticeId(index){
  1229. this.notice_loading = true;
  1230. this.$request({
  1231. params: {
  1232. r: 'store/store-setting/get-wechat-notice',
  1233. },
  1234. method: 'post',
  1235. data: {
  1236. key: index,
  1237. },
  1238. }).then(e => {
  1239. this.notice_loading = false;
  1240. if (e.data.code === 0) {
  1241. this.ruleForm.notice_wechat.template_message.value[index].tempid = e.data.data
  1242. this.$message.success(e.data.msg);
  1243. } else {
  1244. this.$message.error(e.data.msg);
  1245. }
  1246. }).catch(e => {
  1247. this.notice_loading = false;
  1248. });
  1249. },
  1250. },
  1251. });
  1252. </script>
  1253. <style>
  1254. .table-head {
  1255. font-weight: 500;
  1256. }
  1257. .el-tabs__header {
  1258. padding: 0 20px;
  1259. height: 56px;
  1260. line-height: 56px;
  1261. background-color: #fff;
  1262. margin-bottom: 0;
  1263. }
  1264. .title {
  1265. padding: 0px 8px;
  1266. border-left: 5px solid #1479F0;
  1267. background-color: #fff;
  1268. font-size: 18px;
  1269. position: relative;
  1270. left: 32px;
  1271. margin: 20px 0;
  1272. }
  1273. .form-body {
  1274. background-color: #fff;
  1275. /* padding: 20px 50% 20px 0; */
  1276. padding: 20px 20px 20px 0;
  1277. }
  1278. .cashier .form-body {
  1279. padding: 20px 20px 0 0;
  1280. }
  1281. .cashier .el-form-item--small.el-form-item {
  1282. margin-bottom: 0px;
  1283. }
  1284. .form-body .item {
  1285. width: 300px;
  1286. margin-bottom: 50px;
  1287. margin-right: 25px;
  1288. }
  1289. .item-img {
  1290. height: 550px;
  1291. padding: 25px 10px;
  1292. border-radius: 30px;
  1293. border: 1px solid #CCCCCC;
  1294. background-color: #fff;
  1295. }
  1296. .item .el-form-item {
  1297. width: 300px;
  1298. margin: 20px auto;
  1299. }
  1300. .left-setting-menu {
  1301. width: 260px;
  1302. }
  1303. .left-setting-menu .el-form-item {
  1304. height: 60px;
  1305. padding-left: 20px;
  1306. display: flex;
  1307. align-items: center;
  1308. margin-bottom: 0;
  1309. cursor: pointer;
  1310. }
  1311. .left-setting-menu .el-form-item .el-form-item__label {
  1312. cursor: pointer;
  1313. }
  1314. .left-setting-menu .el-form-item.active {
  1315. background-color: #F3F5F6;
  1316. border-top-left-radius: 10px;
  1317. width: 105%;
  1318. border-bottom-left-radius: 10px;
  1319. }
  1320. .left-setting-menu .el-form-item .el-form-item__content {
  1321. margin-left: 0 !important
  1322. }
  1323. .no-radius {
  1324. border-top-left-radius: 0 !important;
  1325. }
  1326. .del-btn {
  1327. position: absolute;
  1328. right: -8px;
  1329. top: -8px;
  1330. padding: 4px 4px;
  1331. }
  1332. .reset {
  1333. position: absolute;
  1334. top: 3px;
  1335. left: 90px;
  1336. }
  1337. .app-tip {
  1338. position: absolute;
  1339. right: 24px;
  1340. top: 16px;
  1341. height: 72px;
  1342. line-height: 72px;
  1343. max-width: calc(100% - 78px);
  1344. }
  1345. .app-tip:before {
  1346. content: ' ';
  1347. width: 0;
  1348. height: 0;
  1349. border-color: inherit;
  1350. position: absolute;
  1351. top: -32px;
  1352. right: 100px;
  1353. border-width: 16px;
  1354. border-style: solid;
  1355. }
  1356. .tip-content {
  1357. display: block;
  1358. white-space: nowrap;
  1359. width: 100%;
  1360. overflow: hidden;
  1361. text-overflow: ellipsis;
  1362. margin: 0 28px;
  1363. font-size: 28px;
  1364. }
  1365. .btn-abs {
  1366. position: absolute;
  1367. top: 12px;
  1368. right: 18px;
  1369. }
  1370. .form-body .app-share {
  1371. padding-top: 12px;
  1372. border-top: 1px solid #e2e2e2;
  1373. margin-top: -20px;
  1374. }
  1375. .form-body .app-share .app-share-bg {
  1376. position: relative;
  1377. width: 310px;
  1378. height: 360px;
  1379. background-repeat: no-repeat;
  1380. background-size: contain;
  1381. background-position: center
  1382. }
  1383. .form-body .app-share .app-share-bg .title {
  1384. width: 160px;
  1385. height: 29px;
  1386. line-height: 1;
  1387. word-break: break-all;
  1388. text-overflow: ellipsis;
  1389. display: -webkit-box;
  1390. -webkit-box-orient: vertical;
  1391. -webkit-line-clamp: 2;
  1392. overflow: hidden;
  1393. }
  1394. .form-body .app-share .app-share-bg .pic-image {
  1395. background-repeat: no-repeat;
  1396. background-position: 0 0;
  1397. background-size: cover;
  1398. width: 160px;
  1399. height: 130px;
  1400. }
  1401. .cashier-tabs .el-tabs__header {
  1402. padding: 0;
  1403. height: 45px;
  1404. line-height: 45px;
  1405. /* background-color: #F5F7FA; */
  1406. margin-bottom: 0;
  1407. }
  1408. .cashier-tabs .el-tabs__item {
  1409. height: 43px;
  1410. line-height: 43px;
  1411. }
  1412. .cashier-tabs .el-tabs__content {
  1413. margin-top: 20px;
  1414. }
  1415. .form-body {
  1416. background-color: #fff;
  1417. padding: 20px 30% 20px 0;
  1418. }
  1419. .button-item {
  1420. margin-bottom: 18px;
  1421. padding: 9px 25px;
  1422. margin-left: 10%;
  1423. }
  1424. .form-body .item {
  1425. width: 300px;
  1426. margin-bottom: 50px;
  1427. margin-right: 25px;
  1428. }
  1429. .item-img {
  1430. height: 550px;
  1431. padding: 25px 10px;
  1432. border-radius: 30px;
  1433. border: 1px solid #CCCCCC;
  1434. background-color: #fff;
  1435. }
  1436. .item .el-form-item {
  1437. width: 500px;
  1438. margin: 20px auto;
  1439. }
  1440. .left-setting-menu {
  1441. width: 260px;
  1442. }
  1443. .left-setting-menu .el-form-item {
  1444. height: 60px;
  1445. padding-left: 20px;
  1446. display: flex;
  1447. align-items: center;
  1448. margin-bottom: 0;
  1449. cursor: pointer;
  1450. }
  1451. .left-setting-menu .el-form-item .el-form-item__label {
  1452. cursor: pointer;
  1453. }
  1454. .left-setting-menu .el-form-item.active {
  1455. background-color: #F3F5F6;
  1456. border-top-left-radius: 10px;
  1457. width: 105%;
  1458. border-bottom-left-radius: 10px;
  1459. }
  1460. .left-setting-menu .el-form-item .el-form-item__content {
  1461. margin-left: 0 !important
  1462. }
  1463. .no-radius {
  1464. border-top-left-radius: 0 !important;
  1465. }
  1466. .del-btn {
  1467. position: absolute;
  1468. right: -8px;
  1469. top: -8px;
  1470. padding: 4px 4px;
  1471. }
  1472. .reset {
  1473. position: absolute;
  1474. top: 3px;
  1475. left: 90px;
  1476. }
  1477. .app-tip {
  1478. position: absolute;
  1479. right: 24px;
  1480. top: 16px;
  1481. height: 72px;
  1482. line-height: 72px;
  1483. max-width: calc(100% - 78px);
  1484. }
  1485. .app-tip:before {
  1486. content: ' ';
  1487. width: 0;
  1488. height: 0;
  1489. border-color: inherit;
  1490. position: absolute;
  1491. top: -32px;
  1492. right: 100px;
  1493. border-width: 16px;
  1494. border-style: solid;
  1495. }
  1496. .tip-content {
  1497. display: block;
  1498. white-space: nowrap;
  1499. width: 100%;
  1500. overflow: hidden;
  1501. text-overflow: ellipsis;
  1502. margin: 0 28px;
  1503. font-size: 28px;
  1504. }
  1505. /* .el-tabs--card>.el-tabs__header .el-tabs__item {
  1506. border:1px solid #0055ff;
  1507. }
  1508. .el-tabs--card>.el-tabs__header .el-tabs__item.is-active {
  1509. background: #0055ff;
  1510. color:white;
  1511. }
  1512. .el-tabs--card>.el-tabs__header .el-tabs__item:first-child{
  1513. border-top-left-radius:26px;
  1514. border-bottom-left-radius:26px;
  1515. }
  1516. .el-tabs--card>.el-tabs__header .el-tabs__item:last-child {
  1517. border-top-right-radius:26px;
  1518. border-bottom-right-radius:26px;
  1519. }
  1520. .el-tabs--card>.el-tabs__header .el-tabs__nav{
  1521. border:none;
  1522. } */
  1523. .zhangsan .el-tabs__nav .el-tabs__item {
  1524. font-size: 16px;
  1525. font-weight: 700;
  1526. padding: 0px;
  1527. }
  1528. .zhangsan .el-tabs__active-bar {
  1529. height: 3px;
  1530. }
  1531. .zhangsan .el-tabs__nav.is-stretch {
  1532. min-width: 15%;
  1533. }
  1534. .zhangsan-1 .el-tabs__nav.is-stretch {
  1535. min-width: 25%;
  1536. }
  1537. .zhangsan-1 .nomb .el-form-item--small.el-form-item {
  1538. margin-bottom: 0px;
  1539. }
  1540. .lisi .el-tabs__nav .el-tabs__item {
  1541. font-size: 14px;
  1542. font-weight: normal;
  1543. padding: 0 20px;
  1544. }
  1545. .lisi .el-tabs__active-bar {
  1546. height: 2px;
  1547. }
  1548. .pic-url-remark {
  1549. font-size: 13px;
  1550. color: #c9c9c9;
  1551. margin-bottom: 12px;
  1552. }
  1553. .add-image-btn {
  1554. width: 100px;
  1555. height: 100px;
  1556. color: #419EFB;
  1557. border: 1px solid #e2e2e2;
  1558. cursor: pointer;
  1559. }
  1560. .deduction-list {
  1561. display: flex;
  1562. align-items: flex-start;
  1563. white-space: nowrap;
  1564. }
  1565. .deduction-list+.deduction-list{
  1566. margin-top: 10px;
  1567. }
  1568. .form-bottom {
  1569. margin-bottom: 18px;
  1570. }
  1571. .batch-deduction {
  1572. max-width: 200px;
  1573. margin-right: 8px;
  1574. }
  1575. .el-input {
  1576. max-width: 450px;
  1577. }
  1578. .show-type-radio-group{
  1579. display: flex;
  1580. }
  1581. .show-type-radio {
  1582. display: flex !important;
  1583. flex-direction: column !important;
  1584. align-items: center !important;
  1585. }
  1586. .show-type-radio + .show-type-radio {
  1587. margin-left: 30px;
  1588. }
  1589. .radio-group-img {
  1590. margin-top: 10px;
  1591. width: 150px;
  1592. }
  1593. .el-radio-group {
  1594. display: flex;
  1595. flex-direction: row;
  1596. /*gap: 5px;*/
  1597. margin-left: 10px;
  1598. }
  1599. .form-body .item {
  1600. width: 20px;
  1601. margin-bottom: 0;
  1602. margin-right: 0;
  1603. }
  1604. </style>