| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696 |
- <?php
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('com-image');
- ComponentHelper::loadComponentView('component/com-attachment', dirname(__DIR__));
- ComponentHelper::loadComponentView('component/com-attachment-edit', dirname(__DIR__));
- ComponentHelper::loadComponentView('component/com-upload', dirname(__DIR__));
- ?>
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <div class="flex flex-x-between flex-y-center">
- <span>编辑多商户</span>
- <div class='head-btns'>
- <el-button type="primary" @click='save'>保存</el-button>
- <el-button type="info" @click='back'>返回</el-button>
- </div>
- </div>
- </div>
- <div class="table-body">
- <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="110px" size="medium"
- label-position='left' class="demo-dynamic">
- <div class="basic_set">
- <div class="common_head flex flex-y-center">
- <div class='line'></div>
- <div>基本信息</div>
- </div>
- <div class='basic_body'>
- <el-form-item label="多商户名称:" prop="store_name">
- <div class="flex flex-y-center">
- <el-input v-model="ruleForm.store_name" placeholder="请输入多商户名称"></el-input>
- </div>
- </el-form-item>
- <el-form-item label="多商户介绍:" prop="store_desc">
- <div class="flex flex-y-center">
- <el-input
- type="textarea"
- :autosize="{ minRows: 2, maxRows: 4}"
- placeholder="多商户介绍"
- v-model="ruleForm.store_desc">
- </el-input>
- </div>
- </el-form-item>
- <el-form-item prop="business_license">
- <label slot="label">
- <span>营业执照:</span>
- </label>
- <com-attachment v-model="ruleForm.license_img" :multiple="false" :max="1">
- <el-tooltip class="item" effect="dark" content="建议尺寸:420 * 336" placement="top">
- <el-button size="mini">选择图片</el-button>
- </el-tooltip>
- </com-attachment>
- <div class="customize-share-title">
- <com-image mode="aspectFill" width='100px' height='100px'
- :src="ruleForm.license_img ? ruleForm.license_img : ''"></com-image>
- <el-button v-if="ruleForm.license_img" class="del-btn" size="mini"
- type="danger" icon="el-icon-close" circle
- @click="ruleForm.license_img = ''"></el-button>
- </div>
- </el-form-item>
- <el-form-item prop="store_background">
- <label slot="label">
- <span>多商户背景:</span>
- </label>
- <com-attachment v-model="ruleForm.store_background" :multiple="false" :max="1">
- <el-tooltip class="item" effect="dark" content="建议尺寸:420 * 336" placement="top">
- <el-button size="mini">选择图片</el-button>
- </el-tooltip>
- </com-attachment>
- <div class="customize-share-title">
- <com-image mode="aspectFill" width='100px' height='100px'
- :src="ruleForm.store_background ? ruleForm.store_background : ''"></com-image>
- <el-button v-if="ruleForm.store_background" class="del-btn" size="mini"
- type="danger" icon="el-icon-close" circle
- @click="ruleForm.store_background = ''"></el-button>
- </div>
- </el-form-item>
- <el-form-item prop="logo_img">
- <label slot="label">
- <span>多商户logo:</span>
- </label>
- <com-attachment v-model="ruleForm.logo_img" :multiple="false" :max="1">
- <el-tooltip class="item" effect="dark" content="建议尺寸:420 * 336" placement="top">
- <el-button size="mini">选择图片</el-button>
- </el-tooltip>
- </com-attachment>
- <div class="customize-share-title">
- <com-image mode="aspectFill" width='100px' height='100px'
- :src="ruleForm.logo_img ? ruleForm.logo_img : ''"></com-image>
- <el-button v-if="ruleForm.logo_img" class="del-btn" size="mini"
- type="danger" icon="el-icon-close" circle
- @click="ruleForm.logo_img = ''"></el-button>
- </div>
- </el-form-item>
- <el-form-item label="创建时间:" prop="created_at">
- <div class="flex flex-y-center">
- {{ruleForm.created_at|dateTimeFormat('Y-m-d H:i:s')}}
- </div>
- </el-form-item>
- <el-form-item label="到期时间:" prop="expire_time">
- <div class="flex flex-y-center">
- {{ruleForm.expire_time|dateTimeFormat('Y-m-d H:i:s')}}
- </div>
- </el-form-item>
- </div>
- <div class="common_head flex flex-y-center">
- <div class='line'></div>
- <div>多商户信息</div>
- </div>
- <div class='basic_body'>
- <el-form-item label="姓名:" prop="shop_owner">
- <div class="flex flex-y-center">
- <el-input v-model="ruleForm.shop_owner" placeholder="请输入店长姓名"></el-input>
- </div>
- </el-form-item>
- <el-form-item label="手机号:" prop="shop_mobile">
- <div class="flex flex-y-center">
- <el-input v-model="ruleForm.shop_mobile" placeholder="请输入联系电话"></el-input>
- </div>
- </el-form-item>
- </div>
- <div class="common_head flex flex-y-center" style="margin-top: 30px">
- <div class='line'></div>
- <div>分享</div>
- </div>
- <div class='basic_body'>
- <el-form-item label="分享标题:" prop="manage">
- <div class="flex flex-y-center">
- <el-input v-model="ruleForm.share_title" placeholder="请输分享标题"></el-input>
- </div>
- </el-form-item>
- <el-form-item label="分享描述:" prop="manage">
- <div class="flex flex-y-center">
- <el-input v-model="ruleForm.share_desc" placeholder="请输入分享描述"></el-input>
- </div>
- </el-form-item>
- <el-form-item prop="business_license">
- <label slot="label">
- <span>分享图片:</span>
- </label>
- <com-attachment v-model="ruleForm.share_pic" :multiple="false" :max="1">
- <el-tooltip class="item" effect="dark" content="建议尺寸:420 * 336" placement="top">
- <el-button size="mini">选择图片</el-button>
- </el-tooltip>
- </com-attachment>
- <div class="customize-share-title">
- <com-image mode="aspectFill" width='100px' height='100px'
- :src="ruleForm.share_pic ? ruleForm.share_pic : ''"></com-image>
- <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>
- </div>
- </el-form-item>
- </div>
- <div class="common_head flex flex-y-center" style="margin-top: 30px">
- <div class='line'></div>
- <div>运营</div>
- </div>
- <div class='basic_body'>
- <el-form-item label="营业状态:" prop="status">
- <div class="flex flex-y-center">
- <template>
- <el-radio v-model="ruleForm.shop_status" label="1">营业</el-radio>
- <el-radio v-model="ruleForm.shop_status" label="0">休息</el-radio>
- </template>
- </div>
- </el-form-item>
- </div>
- <div class="common_head flex flex-y-center" style="margin-top: 30px">
- <div class='line'></div>
- <div>配送</div>
- </div>
- <div class='basic_body'>
- <el-form-item label="快递发货:" prop="express_delivery">
- <div class="flex flex-y-center">
- <template>
- <el-switch
- :active-value="1"
- :inactive-value="0"
- v-model="ruleForm.freight_type.express_delivery">
- </el-switch>
- </template>
- </div>
- 启用快递发货后,买家下单可以选择快递发货,由你安排快递送货上门。
- <el-button type="primary" size="small" v-if="ruleForm.freight_type.express_delivery==1" @click="jump_to_freight_rules()">编辑运费模板</el-button>
- </el-form-item>
- </div>
- <div class="common_head flex flex-y-center" style="margin-top: 30px">
- <div class='line'></div>
- <div>客服设置</div>
- </div>
- <div class='basic_body'>
- <el-form-item label="快递发货:" prop="express_delivery">
- <div class="flex flex-y-center">
- <template>
- <el-input v-model="ruleForm.customer_service.web_service_url" placeholder="请输入分享描述"></el-input>
- </template>
- </div>
- </el-form-item>
- </div>
- </div>
- </el-form>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- keyword: '',
- category: [],
- activeName: '1',
- imagesCount: 1,
- value1:"",
- value2:"",
- ruleForm: {
- user_id: '',
- name: '',
- c_id: '',
- cIds: [],
- province_id: '',
- province: '',
- city_id: '',
- city: '',
- district_id: '',
- district: '',
- address: '',
- longitude: '',
- latitude: '',
- ll: '',
- license_img: '',
- id_card_front_img: '',
- id_card_back_img: '',
- shop_owner: '',
- shop_mobile: '',
- operate_scope: '',
- operate_time: '',
- operate_status: '',
- send_type: [],
- offline: 3,
- offline_address: '',
- cost_ratio: '',
- cost_cycle: '',
- cost_days: '',
- validity_type: 1,
- validity_days: '',
- validity_time: '',
- share_title: '',
- share_desc: '',
- share_pic: '',
- store_desc: '',
- store_name: '',
- status:1,
- store_style:1,
- freight_type:{
- express_delivery:1,
- merchant_distribution:1,
- self_mention:1,
- },
- intra_city_distribution:{
- distribution_scope:0,
- initial_delivery_amount:0,
- distribution_fee:0,
- full_money:0,
- reduce_money:0,
- },
- business_time_start:'00:00',
- business_time_end:"23:59",
- content: '',
- customer_service: {
- web_service_url: ''
- },
- },
- store_images: [],
- user_nickname: '',
- user_mobile: '',
- send_type_show: false,
- submitLoading: true,
- dialogVisible: false,
- province_arr: [],
- city_arr: [],
- district_arr: [],
- rules: {
- name: [{
- required: true,
- message: '请输入多商户名称',
- trigger: 'blur'
- }]
- }
- };
- },
- methods: {
- //地图确定事件
- mapEvent(e) {
- this.ruleForm.longitude = e.long;
- this.ruleForm.latitude = e.lat;
- this.ruleForm.ll = e.lat + ',' + e.long;
- },
- changeSendType() {
- this.send_type_show = this.ruleForm.send_type.indexOf(1) != -1;
- },
- getTime(e) {
- console.log(e, 'eeee');
- },
- back() {
- window.history.back();
- },
- save() {
- this.ruleForm.store_images = this.store_images
- this.$refs['ruleForm'].validate((valid) => {
- if (valid) {
- request({
- params: {
- r: 'mch/client/setting/index',
- },
- method: 'post',
- data: {
- form: this.ruleForm
- }
- }).then(e => {
- this.submitLoading = false;
- if (e.data.code === 0) {
- this.$message.success(e.data.msg);
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.submitLoading = false;
- this.$message.error(e.data.msg);
- });
- } else {
- console.log('error submit!!');
- this.submitLoading = false;
- return false;
- }
- });
- },
- getCity(level, id = '') {
- this.loading = true;
- request({
- params: {
- r: 'mch/client/setting/get-address-list',
- level,
- id
- },
- method: 'get',
- }).then(e => {
- this.loading = false;
- if (e.data.code == 0) {
- if (level == '1') {
- this.province_arr = e.data.data;
- } else if (level == '2') {
- this.city_arr = e.data.data;
- } else {
- this.district_arr = e.data.data;
- }
- } else {
- this.$message.error(e.data.msg);
- }
- })
- },
- provinceChange(val) {
- this.ruleForm.province_id = val.id;
- this.ruleForm.province = val.name;
- this.getCity('2', val.id);
- },
- cityChange(val) {
- this.ruleForm.city_id = val.id;
- this.ruleForm.city = val.name;
- this.getCity('3', val.id);
- },
- districtChange(val) {
- this.ruleForm.district_id = val.id;
- this.ruleForm.district = val.name;
- },
- load() {
- request({
- params: {
- r: 'mch/client/setting/index',
- },
- method: 'get',
- }).then(e => {
- this.submitLoading = false;
- if (e.data.code === 0) {
- var intra_city_distribution = this.ruleForm.intra_city_distribution;
- this.ruleForm = e.data.data.detail
- if(e.data.data.detail.intra_city_distribution==''){
- this.ruleForm.intra_city_distribution = intra_city_distribution;
- }
- this.ruleForm.status = this.ruleForm.status.toString();
- this.ruleForm.shop_status = this.ruleForm.shop_status.toString();
- this.ruleForm.store_style = this.ruleForm.store_style.toString();
- this.store_images = e.data.data.detail.store_images
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.submitLoading = false;
- this.$message.error(e.data.msg);
- });
- },
- jump_to_freight_rules(){
- param = {
- r: 'mch/client/setting/freight-rules'
- };
- navigateTo(param);
- },
- querySearchAsync(queryString, cb) {
- this.keyword = queryString;
- this.getUser(cb);
- },
- getCategory() {
- request({
- params: {
- r: 'mch/client/setting/store-cate-tree',
- }
- }).then(res => {
- if (res.data.code == 0) {
- this.category = res.data.data.list
- } else {
- this.$message.error(res.data.msg);
- }
- });
- },
- createStateFilter(queryString) {
- return (state) => {
- return (state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
- };
- },
- handleSelect(item) {
- this.ruleForm.user_id = item.id;
- this.user_nickname = item.nickname;
- this.user_mobile = item.mobile;
- this.dialogVisible = false;
- },
- addImage(){
- this.store_images.push({
- src: '',
- })
- }
- },
- mounted() {
- this.load();
- this.getCity('1')
- this.getCategory()
- }
- });
- </script>
- <style>
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .head-btns .el-button {
- padding: 10px 35px;
- }
- .form-body {
- padding: 10px 20px 20px;
- background-color: #fff;
- margin-bottom: 30px;
- }
- /* 基础设置 */
- .basic_set {
- /* border: 1px solid #CCCCCC; */
- padding: 20px;
- border-radius: 10px;
- overflow-y: auto;
- }
- .common_head {
- border-bottom: 1px solid #CCCCCC;
- padding-bottom: 10px;
- font-size: 15px;
- margin-bottom: 30px;
- }
- .common_head2 {
- padding-bottom: 10px;
- font-size: 15px;
- margin-bottom: 20px;
- }
- .basic_body {
- padding-left: 25px;
- width: 50%;
- }
- .add_user {
- width: 350px;
- padding-left: 70px;
- }
- .line {
- margin-right: 10px;
- width: 5px;
- height: 23px;
- background: #03C5FF;
- }
- .stores {
- margin-bottom: 20px;
- }
- .customize-share-title {
- /* margin-top: 10px; */
- width: 100px;
- height: 100px;
- position: relative;
- cursor: move;
- }
- .del-btn {
- position: absolute;
- right: -8px;
- top: -8px;
- padding: 4px 4px;
- transform: scale(0.8);
- }
- .add-image-btn {
- width: 100px;
- height: 100px;
- color: #419EFB;
- border: 1px solid #e2e2e2;
- cursor: pointer;
- text-align: center;
- }
- .el-date-editor .el-range-separator {
- padding: 0;
- }
- .operate_state {
- padding-left: 15px;
- font-size: 15px;
- }
- .day_num {
- }
- .switchStyle {
- transform: scale(1.2);
- margin-left: 10px;
- }
- .switchStyle .el-switch__label {
- position: absolute;
- display: none;
- color: #fff;
- }
- .switchStyle .el-switch__label--left {
- z-index: 9;
- left: 20px;
- }
- .switchStyle .el-switch__label * {
- font-size: 12px !important;
- }
- .switchStyle .el-switch__label--right {
- z-index: 9;
- left: 0px;
- }
- .switchStyle .el-switch__label * {
- font-size: 12px !important;
- }
- .switchStyle .el-switch__label.is-active {
- display: block;
- }
- .switchStyle.el-switch .el-switch__core,
- .el-switch .el-switch__label {
- width: 70px !important;
- }
- .clear_style.el-form-item {
- margin-bottom: 0px;
- }
- .clear_style .el-input--medium .el-input__inner {
- width: 45%;
- }
- .add_radio .el-form-item__content {
- margin-top: 10px;
- }
- @media screen and (max-width: 1400px) {
- .basic_body {
- width: 70%;
- }
- .clear_style .el-input--medium .el-input__inner {
- width: 70%;
- }
- }
- /* 公共样式 */
- .flex {
- display: -webkit-box;
- display: -webkit-flex;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- }
- .flex-x-center {
- display: -webkit-box;
- display: -webkit-flex;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- -webkit-box-pack: center;
- -webkit-justify-content: center;
- -ms-flex-pack: center;
- justify-content: center;
- }
- .flex-x-between {
- display: -webkit-box;
- display: -webkit-flex;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- -webkit-box-pack: space-between;
- -webkit-justify-content: space-between;
- -ms-flex-pack: space-between;
- justify-content: space-between;
- }
- .flex-y-center {
- display: -webkit-box;
- display: -webkit-flex;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- -webkit-box-align: center;
- -webkit-align-items: center;
- -ms-flex-align: center;
- -ms-grid-row-align: center;
- align-items: center;
- }
- /* 溢出隐藏 */
- .over1 {
- text-overflow: -o-ellipsis-lastline;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 1;
- -webkit-box-orient: vertical;
- }
- .over2 {
- text-overflow: -o-ellipsis-lastline;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- </style>
|