index.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-image');
  4. ComponentHelper::loadComponentView('component/com-attachment', dirname(__DIR__));
  5. ComponentHelper::loadComponentView('component/com-attachment-edit', dirname(__DIR__));
  6. ComponentHelper::loadComponentView('component/com-upload', dirname(__DIR__));
  7. ?>
  8. <div id="app" v-cloak>
  9. <el-card shadow="never" style="border:0" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  10. <div slot="header">
  11. <div class="flex flex-x-between flex-y-center">
  12. <span>编辑多商户</span>
  13. <div class='head-btns'>
  14. <el-button type="primary" @click='save'>保存</el-button>
  15. <el-button type="info" @click='back'>返回</el-button>
  16. </div>
  17. </div>
  18. </div>
  19. <div class="table-body">
  20. <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="110px" size="medium"
  21. label-position='left' class="demo-dynamic">
  22. <div class="basic_set">
  23. <div class="common_head flex flex-y-center">
  24. <div class='line'></div>
  25. <div>基本信息</div>
  26. </div>
  27. <div class='basic_body'>
  28. <el-form-item label="多商户名称:" prop="store_name">
  29. <div class="flex flex-y-center">
  30. <el-input v-model="ruleForm.store_name" placeholder="请输入多商户名称"></el-input>
  31. </div>
  32. </el-form-item>
  33. <el-form-item label="多商户介绍:" prop="store_desc">
  34. <div class="flex flex-y-center">
  35. <el-input
  36. type="textarea"
  37. :autosize="{ minRows: 2, maxRows: 4}"
  38. placeholder="多商户介绍"
  39. v-model="ruleForm.store_desc">
  40. </el-input>
  41. </div>
  42. </el-form-item>
  43. <el-form-item prop="business_license">
  44. <label slot="label">
  45. <span>营业执照:</span>
  46. </label>
  47. <com-attachment v-model="ruleForm.license_img" :multiple="false" :max="1">
  48. <el-tooltip class="item" effect="dark" content="建议尺寸:420 * 336" placement="top">
  49. <el-button size="mini">选择图片</el-button>
  50. </el-tooltip>
  51. </com-attachment>
  52. <div class="customize-share-title">
  53. <com-image mode="aspectFill" width='100px' height='100px'
  54. :src="ruleForm.license_img ? ruleForm.license_img : ''"></com-image>
  55. <el-button v-if="ruleForm.license_img" class="del-btn" size="mini"
  56. type="danger" icon="el-icon-close" circle
  57. @click="ruleForm.license_img = ''"></el-button>
  58. </div>
  59. </el-form-item>
  60. <el-form-item prop="store_background">
  61. <label slot="label">
  62. <span>多商户背景:</span>
  63. </label>
  64. <com-attachment v-model="ruleForm.store_background" :multiple="false" :max="1">
  65. <el-tooltip class="item" effect="dark" content="建议尺寸:420 * 336" placement="top">
  66. <el-button size="mini">选择图片</el-button>
  67. </el-tooltip>
  68. </com-attachment>
  69. <div class="customize-share-title">
  70. <com-image mode="aspectFill" width='100px' height='100px'
  71. :src="ruleForm.store_background ? ruleForm.store_background : ''"></com-image>
  72. <el-button v-if="ruleForm.store_background" class="del-btn" size="mini"
  73. type="danger" icon="el-icon-close" circle
  74. @click="ruleForm.store_background = ''"></el-button>
  75. </div>
  76. </el-form-item>
  77. <el-form-item prop="logo_img">
  78. <label slot="label">
  79. <span>多商户logo:</span>
  80. </label>
  81. <com-attachment v-model="ruleForm.logo_img" :multiple="false" :max="1">
  82. <el-tooltip class="item" effect="dark" content="建议尺寸:420 * 336" placement="top">
  83. <el-button size="mini">选择图片</el-button>
  84. </el-tooltip>
  85. </com-attachment>
  86. <div class="customize-share-title">
  87. <com-image mode="aspectFill" width='100px' height='100px'
  88. :src="ruleForm.logo_img ? ruleForm.logo_img : ''"></com-image>
  89. <el-button v-if="ruleForm.logo_img" class="del-btn" size="mini"
  90. type="danger" icon="el-icon-close" circle
  91. @click="ruleForm.logo_img = ''"></el-button>
  92. </div>
  93. </el-form-item>
  94. <el-form-item label="创建时间:" prop="created_at">
  95. <div class="flex flex-y-center">
  96. {{ruleForm.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  97. </div>
  98. </el-form-item>
  99. <el-form-item label="到期时间:" prop="expire_time">
  100. <div class="flex flex-y-center">
  101. {{ruleForm.expire_time|dateTimeFormat('Y-m-d H:i:s')}}
  102. </div>
  103. </el-form-item>
  104. </div>
  105. <div class="common_head flex flex-y-center">
  106. <div class='line'></div>
  107. <div>多商户信息</div>
  108. </div>
  109. <div class='basic_body'>
  110. <el-form-item label="姓名:" prop="shop_owner">
  111. <div class="flex flex-y-center">
  112. <el-input v-model="ruleForm.shop_owner" placeholder="请输入店长姓名"></el-input>
  113. </div>
  114. </el-form-item>
  115. <el-form-item label="手机号:" prop="shop_mobile">
  116. <div class="flex flex-y-center">
  117. <el-input v-model="ruleForm.shop_mobile" placeholder="请输入联系电话"></el-input>
  118. </div>
  119. </el-form-item>
  120. </div>
  121. <div class="common_head flex flex-y-center" style="margin-top: 30px">
  122. <div class='line'></div>
  123. <div>分享</div>
  124. </div>
  125. <div class='basic_body'>
  126. <el-form-item label="分享标题:" prop="manage">
  127. <div class="flex flex-y-center">
  128. <el-input v-model="ruleForm.share_title" placeholder="请输分享标题"></el-input>
  129. </div>
  130. </el-form-item>
  131. <el-form-item label="分享描述:" prop="manage">
  132. <div class="flex flex-y-center">
  133. <el-input v-model="ruleForm.share_desc" placeholder="请输入分享描述"></el-input>
  134. </div>
  135. </el-form-item>
  136. <el-form-item prop="business_license">
  137. <label slot="label">
  138. <span>分享图片:</span>
  139. </label>
  140. <com-attachment v-model="ruleForm.share_pic" :multiple="false" :max="1">
  141. <el-tooltip class="item" effect="dark" content="建议尺寸:420 * 336" placement="top">
  142. <el-button size="mini">选择图片</el-button>
  143. </el-tooltip>
  144. </com-attachment>
  145. <div class="customize-share-title">
  146. <com-image mode="aspectFill" width='100px' height='100px'
  147. :src="ruleForm.share_pic ? ruleForm.share_pic : ''"></com-image>
  148. <el-button v-if="ruleForm.share_pic" class="del-btn" size="mini" type="danger" icon="el-icon-close" circle @click="ruleForm.share_pic = ''"></el-button>
  149. </div>
  150. </el-form-item>
  151. </div>
  152. <div class="common_head flex flex-y-center" style="margin-top: 30px">
  153. <div class='line'></div>
  154. <div>运营</div>
  155. </div>
  156. <div class='basic_body'>
  157. <el-form-item label="营业状态:" prop="status">
  158. <div class="flex flex-y-center">
  159. <template>
  160. <el-radio v-model="ruleForm.shop_status" label="1">营业</el-radio>
  161. <el-radio v-model="ruleForm.shop_status" label="0">休息</el-radio>
  162. </template>
  163. </div>
  164. </el-form-item>
  165. </div>
  166. <div class="common_head flex flex-y-center" style="margin-top: 30px">
  167. <div class='line'></div>
  168. <div>配送</div>
  169. </div>
  170. <div class='basic_body'>
  171. <el-form-item label="快递发货:" prop="express_delivery">
  172. <div class="flex flex-y-center">
  173. <template>
  174. <el-switch
  175. :active-value="1"
  176. :inactive-value="0"
  177. v-model="ruleForm.freight_type.express_delivery">
  178. </el-switch>
  179. </template>
  180. </div>
  181. 启用快递发货后,买家下单可以选择快递发货,由你安排快递送货上门。
  182. <el-button type="primary" size="small" v-if="ruleForm.freight_type.express_delivery==1" @click="jump_to_freight_rules()">编辑运费模板</el-button>
  183. </el-form-item>
  184. </div>
  185. <div class="common_head flex flex-y-center" style="margin-top: 30px">
  186. <div class='line'></div>
  187. <div>客服设置</div>
  188. </div>
  189. <div class='basic_body'>
  190. <el-form-item label="快递发货:" prop="express_delivery">
  191. <div class="flex flex-y-center">
  192. <template>
  193. <el-input v-model="ruleForm.customer_service.web_service_url" placeholder="请输入分享描述"></el-input>
  194. </template>
  195. </div>
  196. </el-form-item>
  197. </div>
  198. </div>
  199. </el-form>
  200. </div>
  201. </el-card>
  202. </div>
  203. <script>
  204. const app = new Vue({
  205. el: '#app',
  206. data() {
  207. return {
  208. keyword: '',
  209. category: [],
  210. activeName: '1',
  211. imagesCount: 1,
  212. value1:"",
  213. value2:"",
  214. ruleForm: {
  215. user_id: '',
  216. name: '',
  217. c_id: '',
  218. cIds: [],
  219. province_id: '',
  220. province: '',
  221. city_id: '',
  222. city: '',
  223. district_id: '',
  224. district: '',
  225. address: '',
  226. longitude: '',
  227. latitude: '',
  228. ll: '',
  229. license_img: '',
  230. id_card_front_img: '',
  231. id_card_back_img: '',
  232. shop_owner: '',
  233. shop_mobile: '',
  234. operate_scope: '',
  235. operate_time: '',
  236. operate_status: '',
  237. send_type: [],
  238. offline: 3,
  239. offline_address: '',
  240. cost_ratio: '',
  241. cost_cycle: '',
  242. cost_days: '',
  243. validity_type: 1,
  244. validity_days: '',
  245. validity_time: '',
  246. share_title: '',
  247. share_desc: '',
  248. share_pic: '',
  249. store_desc: '',
  250. store_name: '',
  251. status:1,
  252. store_style:1,
  253. freight_type:{
  254. express_delivery:1,
  255. merchant_distribution:1,
  256. self_mention:1,
  257. },
  258. intra_city_distribution:{
  259. distribution_scope:0,
  260. initial_delivery_amount:0,
  261. distribution_fee:0,
  262. full_money:0,
  263. reduce_money:0,
  264. },
  265. business_time_start:'00:00',
  266. business_time_end:"23:59",
  267. content: '',
  268. customer_service: {
  269. web_service_url: ''
  270. },
  271. },
  272. store_images: [],
  273. user_nickname: '',
  274. user_mobile: '',
  275. send_type_show: false,
  276. submitLoading: true,
  277. dialogVisible: false,
  278. province_arr: [],
  279. city_arr: [],
  280. district_arr: [],
  281. rules: {
  282. name: [{
  283. required: true,
  284. message: '请输入多商户名称',
  285. trigger: 'blur'
  286. }]
  287. }
  288. };
  289. },
  290. methods: {
  291. //地图确定事件
  292. mapEvent(e) {
  293. this.ruleForm.longitude = e.long;
  294. this.ruleForm.latitude = e.lat;
  295. this.ruleForm.ll = e.lat + ',' + e.long;
  296. },
  297. changeSendType() {
  298. this.send_type_show = this.ruleForm.send_type.indexOf(1) != -1;
  299. },
  300. getTime(e) {
  301. console.log(e, 'eeee');
  302. },
  303. back() {
  304. window.history.back();
  305. },
  306. save() {
  307. this.ruleForm.store_images = this.store_images
  308. this.$refs['ruleForm'].validate((valid) => {
  309. if (valid) {
  310. request({
  311. params: {
  312. r: 'mch/client/setting/index',
  313. },
  314. method: 'post',
  315. data: {
  316. form: this.ruleForm
  317. }
  318. }).then(e => {
  319. this.submitLoading = false;
  320. if (e.data.code === 0) {
  321. this.$message.success(e.data.msg);
  322. } else {
  323. this.$message.error(e.data.msg);
  324. }
  325. }).catch(e => {
  326. this.submitLoading = false;
  327. this.$message.error(e.data.msg);
  328. });
  329. } else {
  330. console.log('error submit!!');
  331. this.submitLoading = false;
  332. return false;
  333. }
  334. });
  335. },
  336. getCity(level, id = '') {
  337. this.loading = true;
  338. request({
  339. params: {
  340. r: 'mch/client/setting/get-address-list',
  341. level,
  342. id
  343. },
  344. method: 'get',
  345. }).then(e => {
  346. this.loading = false;
  347. if (e.data.code == 0) {
  348. if (level == '1') {
  349. this.province_arr = e.data.data;
  350. } else if (level == '2') {
  351. this.city_arr = e.data.data;
  352. } else {
  353. this.district_arr = e.data.data;
  354. }
  355. } else {
  356. this.$message.error(e.data.msg);
  357. }
  358. })
  359. },
  360. provinceChange(val) {
  361. this.ruleForm.province_id = val.id;
  362. this.ruleForm.province = val.name;
  363. this.getCity('2', val.id);
  364. },
  365. cityChange(val) {
  366. this.ruleForm.city_id = val.id;
  367. this.ruleForm.city = val.name;
  368. this.getCity('3', val.id);
  369. },
  370. districtChange(val) {
  371. this.ruleForm.district_id = val.id;
  372. this.ruleForm.district = val.name;
  373. },
  374. load() {
  375. request({
  376. params: {
  377. r: 'mch/client/setting/index',
  378. },
  379. method: 'get',
  380. }).then(e => {
  381. this.submitLoading = false;
  382. if (e.data.code === 0) {
  383. var intra_city_distribution = this.ruleForm.intra_city_distribution;
  384. this.ruleForm = e.data.data.detail
  385. if(e.data.data.detail.intra_city_distribution==''){
  386. this.ruleForm.intra_city_distribution = intra_city_distribution;
  387. }
  388. this.ruleForm.status = this.ruleForm.status.toString();
  389. this.ruleForm.shop_status = this.ruleForm.shop_status.toString();
  390. this.ruleForm.store_style = this.ruleForm.store_style.toString();
  391. this.store_images = e.data.data.detail.store_images
  392. } else {
  393. this.$message.error(e.data.msg);
  394. }
  395. }).catch(e => {
  396. this.submitLoading = false;
  397. this.$message.error(e.data.msg);
  398. });
  399. },
  400. jump_to_freight_rules(){
  401. param = {
  402. r: 'mch/client/setting/freight-rules'
  403. };
  404. navigateTo(param);
  405. },
  406. querySearchAsync(queryString, cb) {
  407. this.keyword = queryString;
  408. this.getUser(cb);
  409. },
  410. getCategory() {
  411. request({
  412. params: {
  413. r: 'mch/client/setting/store-cate-tree',
  414. }
  415. }).then(res => {
  416. if (res.data.code == 0) {
  417. this.category = res.data.data.list
  418. } else {
  419. this.$message.error(res.data.msg);
  420. }
  421. });
  422. },
  423. createStateFilter(queryString) {
  424. return (state) => {
  425. return (state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
  426. };
  427. },
  428. handleSelect(item) {
  429. this.ruleForm.user_id = item.id;
  430. this.user_nickname = item.nickname;
  431. this.user_mobile = item.mobile;
  432. this.dialogVisible = false;
  433. },
  434. addImage(){
  435. this.store_images.push({
  436. src: '',
  437. })
  438. }
  439. },
  440. mounted() {
  441. this.load();
  442. this.getCity('1')
  443. this.getCategory()
  444. }
  445. });
  446. </script>
  447. <style>
  448. .table-body {
  449. padding: 20px;
  450. background-color: #fff;
  451. }
  452. .head-btns .el-button {
  453. padding: 10px 35px;
  454. }
  455. .form-body {
  456. padding: 10px 20px 20px;
  457. background-color: #fff;
  458. margin-bottom: 30px;
  459. }
  460. /* 基础设置 */
  461. .basic_set {
  462. /* border: 1px solid #CCCCCC; */
  463. padding: 20px;
  464. border-radius: 10px;
  465. overflow-y: auto;
  466. }
  467. .common_head {
  468. border-bottom: 1px solid #CCCCCC;
  469. padding-bottom: 10px;
  470. font-size: 15px;
  471. margin-bottom: 30px;
  472. }
  473. .common_head2 {
  474. padding-bottom: 10px;
  475. font-size: 15px;
  476. margin-bottom: 20px;
  477. }
  478. .basic_body {
  479. padding-left: 25px;
  480. width: 50%;
  481. }
  482. .add_user {
  483. width: 350px;
  484. padding-left: 70px;
  485. }
  486. .line {
  487. margin-right: 10px;
  488. width: 5px;
  489. height: 23px;
  490. background: #03C5FF;
  491. }
  492. .stores {
  493. margin-bottom: 20px;
  494. }
  495. .customize-share-title {
  496. /* margin-top: 10px; */
  497. width: 100px;
  498. height: 100px;
  499. position: relative;
  500. cursor: move;
  501. }
  502. .del-btn {
  503. position: absolute;
  504. right: -8px;
  505. top: -8px;
  506. padding: 4px 4px;
  507. transform: scale(0.8);
  508. }
  509. .add-image-btn {
  510. width: 100px;
  511. height: 100px;
  512. color: #419EFB;
  513. border: 1px solid #e2e2e2;
  514. cursor: pointer;
  515. text-align: center;
  516. }
  517. .el-date-editor .el-range-separator {
  518. padding: 0;
  519. }
  520. .operate_state {
  521. padding-left: 15px;
  522. font-size: 15px;
  523. }
  524. .day_num {
  525. }
  526. .switchStyle {
  527. transform: scale(1.2);
  528. margin-left: 10px;
  529. }
  530. .switchStyle .el-switch__label {
  531. position: absolute;
  532. display: none;
  533. color: #fff;
  534. }
  535. .switchStyle .el-switch__label--left {
  536. z-index: 9;
  537. left: 20px;
  538. }
  539. .switchStyle .el-switch__label * {
  540. font-size: 12px !important;
  541. }
  542. .switchStyle .el-switch__label--right {
  543. z-index: 9;
  544. left: 0px;
  545. }
  546. .switchStyle .el-switch__label * {
  547. font-size: 12px !important;
  548. }
  549. .switchStyle .el-switch__label.is-active {
  550. display: block;
  551. }
  552. .switchStyle.el-switch .el-switch__core,
  553. .el-switch .el-switch__label {
  554. width: 70px !important;
  555. }
  556. .clear_style.el-form-item {
  557. margin-bottom: 0px;
  558. }
  559. .clear_style .el-input--medium .el-input__inner {
  560. width: 45%;
  561. }
  562. .add_radio .el-form-item__content {
  563. margin-top: 10px;
  564. }
  565. @media screen and (max-width: 1400px) {
  566. .basic_body {
  567. width: 70%;
  568. }
  569. .clear_style .el-input--medium .el-input__inner {
  570. width: 70%;
  571. }
  572. }
  573. /* 公共样式 */
  574. .flex {
  575. display: -webkit-box;
  576. display: -webkit-flex;
  577. /* #ifndef APP-NVUE */
  578. display: flex;
  579. /* #endif */
  580. }
  581. .flex-x-center {
  582. display: -webkit-box;
  583. display: -webkit-flex;
  584. /* #ifndef APP-NVUE */
  585. display: flex;
  586. /* #endif */
  587. -webkit-box-pack: center;
  588. -webkit-justify-content: center;
  589. -ms-flex-pack: center;
  590. justify-content: center;
  591. }
  592. .flex-x-between {
  593. display: -webkit-box;
  594. display: -webkit-flex;
  595. /* #ifndef APP-NVUE */
  596. display: flex;
  597. /* #endif */
  598. -webkit-box-pack: space-between;
  599. -webkit-justify-content: space-between;
  600. -ms-flex-pack: space-between;
  601. justify-content: space-between;
  602. }
  603. .flex-y-center {
  604. display: -webkit-box;
  605. display: -webkit-flex;
  606. /* #ifndef APP-NVUE */
  607. display: flex;
  608. /* #endif */
  609. -webkit-box-align: center;
  610. -webkit-align-items: center;
  611. -ms-flex-align: center;
  612. -ms-grid-row-align: center;
  613. align-items: center;
  614. }
  615. /* 溢出隐藏 */
  616. .over1 {
  617. text-overflow: -o-ellipsis-lastline;
  618. overflow: hidden;
  619. text-overflow: ellipsis;
  620. display: -webkit-box;
  621. -webkit-line-clamp: 1;
  622. -webkit-box-orient: vertical;
  623. }
  624. .over2 {
  625. text-overflow: -o-ellipsis-lastline;
  626. overflow: hidden;
  627. text-overflow: ellipsis;
  628. display: -webkit-box;
  629. -webkit-line-clamp: 2;
  630. -webkit-box-orient: vertical;
  631. }
  632. </style>