Browse Source

编辑店铺

master
tianyi 3 months ago
parent
commit
1f6296c66f
  1. 148
      src/views/app/shop/addEdit.vue
  2. 9
      src/views/app/shop/dictManage.vue
  3. 63
      src/views/my-components/hiver/shopArea-tree-choose.vue

148
src/views/app/shop/addEdit.vue

@ -1,30 +1,15 @@
<template>
<div class="user-edit">
<!-- Drawer抽屉 -->
<Drawer
:title="title"
v-model="visible"
width="720"
draggable
:mask-closable="type == '0'"
>
<Drawer :title="title" v-model="visible" width="720" draggable :mask-closable="type == '0'">
<div :style="{ maxHeight: maxHeight }" class="drawer-content">
<Form
ref="form"
:model="form"
:rules="formValidate"
label-position="top"
>
<Form ref="form" :model="form" :rules="formValidate" label-position="top">
<Row :gutter="32">
<Col span="12">
<FormItem label="店铺名称" prop="shopName">
<Input
v-model="form.shopName"
autocomplete="off"
:maxlength="16"
/>
<Input v-model="form.shopName" autocomplete="off" :maxlength="16" />
</FormItem>
</Col>
<Col span="12">
@ -36,10 +21,8 @@
<Row :gutter="32">
<Col span="12">
<FormItem label="所属区域" class="form-noheight">
<shopArea-tree-choose
@on-change="handleSelectShopAreaTree"
ref="shopAreaTree"
></shopArea-tree-choose>
<shopArea-tree-choose @on-change="handleSelectShopAreaTree"
ref="shopAreaTree"></shopArea-tree-choose>
</FormItem>
</Col>
<Col span="12">
@ -58,51 +41,31 @@
<Row :gutter="32">
<Col span="12">
<FormItem label="联系方式" prop="contactPhone">
<Input
v-model="form.contactPhone"
autocomplete="off"
:maxlength="16"
/>
<Input v-model="form.contactPhone" autocomplete="off" :maxlength="16" />
</FormItem>
</Col>
<Col span="12">
<FormItem label="副标题" prop="contactPhone">
<Input
v-model="form.subtitle"
autocomplete="off"
:maxlength="16"
/>
<Input v-model="form.subtitle" autocomplete="off" :maxlength="16" />
</FormItem>
</Col>
</Row>
<Row :gutter="32">
<Col span="12">
<FormItem label="支付宝账号" prop="contactPhone">
<Input
v-model="form.aliAccount"
autocomplete="off"
:maxlength="16"
/>
<Input v-model="form.aliAccount" autocomplete="off" :maxlength="16" />
</FormItem>
</Col>
<Col span="12">
<FormItem label="支付宝户名" prop="contactPhone">
<Input
v-model="form.aliName"
autocomplete="off"
:maxlength="16"
/>
<Input v-model="form.aliName" autocomplete="off" :maxlength="16" />
</FormItem>
</Col>
</Row>
<Row :gutter="32">
<Col span="12">
<FormItem label="排名" prop="shoprank">
<Input
v-model="form.shoprank"
autocomplete="off"
:maxlength="16"
/>
<Input v-model="form.shoprank" autocomplete="off" :maxlength="16" />
</FormItem>
</Col>
</Row>
@ -121,9 +84,7 @@
</Form>
</div>
<div class="drawer-footer br" v-show="type != '0'">
<Button type="primary" :loading="submitLoading" @click="submit"
>提交</Button
>
<Button type="primary" :loading="submitLoading" @click="submit">提交</Button>
<Button @click="visible = false">取消</Button>
</div>
</Drawer>
@ -131,7 +92,10 @@
</template>
<script>
import {getUsersByRoleName,getDictDataByType} from "@/api/index";
import {
getUsersByRoleName,
getDictDataByType
} from "@/api/index";
import {
validateUsername,
validateMobile,
@ -141,7 +105,12 @@ import shopAreaTreeChoose from "@/views/my-components/hiver/shopArea-tree-choose
import uploadPicInput from "@/views/my-components/hiver/upload-pic-input";
import SetPassword from "@/views/my-components/hiver/set-password";
import dict from "@/views/my-components/hiver/dict";
import {addShop, editShop} from "@/api/app";
import {
addShop,
editShop,
initShopArea,
loadShopArea,
} from "@/api/app";
export default {
name: "addEdit",
components: {
@ -179,33 +148,59 @@ export default {
},
formValidate: {
//
username: [
{ required: true, message: "请输入登录账号", trigger: "blur" },
{ validator: validateUsername, trigger: "blur" },
],
nickname: [
{ required: true, message: "请输入用户名", trigger: "blur" },
username: [{
required: true,
message: "请输入登录账号",
trigger: "blur"
},
{
validator: validateUsername,
trigger: "blur"
},
],
mobile: [
{ required: true, message: "请输入手机号", trigger: "blur" },
{ validator: validateMobile, trigger: "blur" },
nickname: [{
required: true,
message: "请输入用户名",
trigger: "blur"
}, ],
mobile: [{
required: true,
message: "请输入手机号",
trigger: "blur"
},
{
validator: validateMobile,
trigger: "blur"
},
],
password: [
{ required: true, message: "请输入密码", trigger: "blur" },
{ validator: validatePassword, trigger: "blur" },
password: [{
required: true,
message: "请输入密码",
trigger: "blur"
},
{
validator: validatePassword,
trigger: "blur"
},
],
email: [
{ required: true, message: "请输入邮箱地址" },
{ type: "email", message: "邮箱格式不正确" },
email: [{
required: true,
message: "请输入邮箱地址"
},
{
type: "email",
message: "邮箱格式不正确"
},
],
},
};
},
methods: {
init() {
this.getRoleList();
init(v) {
console.log("111")
this.getRoleList(v);
},
getRoleList() {
getRoleList(v) {
getUsersByRoleName("ROLE_OWNER").then((res) => {
if (res.success) {
this.roleList = res.result;
@ -221,9 +216,17 @@ export default {
this.businessDistrictLevelList = res.result;
}
});
getDictDataByType("mallRegion").then((res) => {
initShopArea().then((res) => {
if (res.success) {
this.shopAreaList = res.result;
res.result.forEach(function(e) {
if (e.isParent) {
e.loading = false;
e.children = [];
e._loading = false;
}
});
this.data = res.result;
}
});
getDictDataByType("shopType").then((res) => {
@ -354,4 +357,3 @@ export default {
<style lang="less">
@import "@/styles/drawer-common.less";
</style>

9
src/views/app/shop/dictManage.vue

@ -392,7 +392,7 @@
specNum:9999
}],
sellTime:0, //
isMoreBuy:0,
isMoreBuy:0, //
sellBeginTime:'', //---
sellEndTime:'', //---
attributeList:'',
@ -775,8 +775,6 @@
}).then((res) => {
if(res.code == 200){
this.categorySonData = res.result.content
console.log("this.modalclassType",this.modalclassType)
console.log("this.categorySonData",this.categorySonData)
if(this.modalclassType == 'shuxing'){
for (var i = 0; i < this.categorySonData.length; i++) {
if(this.attrValueArr.length>0){
@ -834,9 +832,6 @@
this.addGoodsForm.isMoreBuy = type;
},
checkSpecValue(index){
//this.typeToAttrName = res.result.content[this.categoryIndex].title
console.log("this.categorySonData[index]",this.categorySonData[index])
console.log("this.modalclassType",this.modalclassType)
this.categorySonData[index].checked = !this.categorySonData[index].checked
if(this.modalclassType == 'shuxing'){
if(this.categorySonData[index].checked == true){
@ -865,8 +860,6 @@
},
guigeSubmit(){
if(this.modalclassType == 'shuxing'){
console.log("this.addGoodsForm.attributeList1",this.addGoodsForm.attributeList1)
console.log("this.attrValueArr",this.attrValueArr)
for(let i=0;i<this.attrValueArr.length;i++){
if(this.addGoodsForm.attributeList1.size == 0){
//set has get

63
src/views/my-components/hiver/shopArea-tree-choose.vue

@ -1,49 +1,17 @@
<template>
<div>
<div style="display: flex;">
<Input
v-model="shopAreaTitle"
readonly
:size="size"
:disabled="disabled"
:prefix="prefix"
:suffix="suffix"
style="margin-right: 10px"
:placeholder="placeholder"
:clearable="clearable"
@on-clear="clearSelect"
/>
<Poptip
transfer
trigger="click"
placement="right"
title="选择区域"
width="250"
>
<Button
:size="size"
:disabled="disabled"
:icon="icon"
:type="type"
:shape="shape"
:ghost="ghost"
>{{ text }}</Button
>
<Input v-model="shopAreaTitle" readonly :size="size" :disabled="disabled" :prefix="prefix" :suffix="suffix"
style="margin-right: 10px" :placeholder="placeholder" :clearable="clearable" @on-clear="clearSelect" />
<Poptip transfer trigger="click" placement="right" title="选择区域" width="250">
<Button :size="size" :disabled="disabled" :icon="icon" :type="type" :shape="shape"
:ghost="ghost">{{ text }}</Button>
<div slot="content">
<Input
v-model="searchKey"
suffix="ios-search"
@on-change="searchDep"
placeholder="输入区域名搜索"
clearable
/>
<Input v-model="searchKey" suffix="ios-search" @on-change="searchDep" placeholder="输入区域名搜索"
clearable />
<div class="dep-tree-bar">
<Tree
:data="dataDep"
:load-data="loadData"
@on-select-change="selectTree"
:multiple="multiple"
></Tree>
<Tree :data="dataDep" :load-data="loadData" @on-select-change="selectTree" :multiple="multiple">
</Tree>
<Spin size="large" fix v-if="depLoading"></Spin>
</div>
</div>
@ -53,7 +21,11 @@
</template>
<script>
import { initShopArea, loadShopArea, searchShopArea } from "@/api/app";
import {
initShopArea,
loadShopArea,
searchShopArea
} from "@/api/app";
export default {
name: "shopAreaTreeChoose",
props: {
@ -103,7 +75,7 @@ export default {
},
methods: {
initShopAreaData() {
loadShopArea(JSON.parse(this.getStore("userInfo")).departmentId).then((res) => {
initShopArea().then((res) => {
if (res.success) {
res.result.forEach(function(e) {
if (e.isParent) {
@ -140,7 +112,9 @@ export default {
//
if (this.searchKey) {
this.depLoading = true;
searchShopArea({ title: this.searchKey }).then((res) => {
searchShopArea({
title: this.searchKey
}).then((res) => {
this.depLoading = false;
if (res.success) {
res.result.forEach(function(e) {
@ -223,4 +197,3 @@ export default {
background: #e4e4e4;
}
</style>

Loading…
Cancel
Save