合并分支

master
lemon橪 2021-08-16 11:32:15 +08:00
commit f33efac045
6 changed files with 226 additions and 143 deletions

View File

@ -138,7 +138,7 @@
<script>
import Promotion from './Promotion.vue';
import PicZoom from 'vue-piczoom'; // https://github.com/826327700/vue-piczoom
import PicZoom from 'vue-piczoom'; //
import { collectGoods, isCollection, receiveCoupon, cancelCollect } from '@/api/member.js';
import { addCartGoods } from '@/api/cart.js';
export default {
@ -173,7 +173,6 @@ export default {
methods: {
select (index, value) { //
this.$set(this.currentSelceted, index, value);
let selectedSkuId = this.goodsSpecList.find((i) => {
let matched = true;
let specValues = i.specValues.filter((j) => j.specName !== 'images');
@ -200,7 +199,6 @@ export default {
};
this.loading = true;
addCartGoods(params).then(res => {
debugger;
this.loading = false;
if (res.success) {
this.$router.push({path: '/shoppingCart', query: {detail: this.skuDetail, count: this.count}});
@ -208,7 +206,6 @@ export default {
this.$Message.warning(res.message);
}
}).catch(() => {
console.log('catch');
this.loading = false;
});
},

View File

@ -158,7 +158,7 @@
<Button type="info" :loading="uploadLoading1">证照上传</Button>
</Upload>
<div class="describe">
请压缩图片在2M以内格式为gifjpgpng并确保文字清晰以免上传或审核失败
请压缩图片在2M以内身份证正反面两张照片确保图片清晰无缺角
</div>
<div
class="img-list"
@ -299,8 +299,8 @@ export default {
//
beforeUpload1 () {
this.uploadLoading1 = true;
if (this.form.legalPhoto.length >= 3) {
this.$Message.warning('最多上传张图片')
if (this.form.legalPhoto.length >= 2) {
this.$Message.warning('最多上传张图片')
return false;
}
},
@ -313,8 +313,6 @@ export default {
handleSuccess1 (res, file) {
this.uploadLoading1 = false;
this.form.legalPhoto.push(res.result);
console.log(res);
console.log(file);
},
//
uploadErr () {

View File

@ -3,59 +3,39 @@
<Cascader
:data="data"
:load-data="loadData"
change-on-select
@on-visible-change="handleChangeOnSelect"
v-model="addr"
placeholder="请选择地址"
@on-change="change"
style="width: 350px"
></Cascader>
</div>
</template>
<script>
import * as API_Setup from "@/api/common.js";
import {getChildRegion} from '@/api/common.js';
export default {
data() {
data () {
return {
data: [], //
selected: [], //
id: 0, // id
changeOnSelect: false, //
addr: [] //
};
},
mounted() {
this.init();
},
props: ['addressId'],
mounted () {},
methods: {
//
change(val, selectedData) {
change (val, selectedData) { //
/**
* @returns [regionId,region]
*/
this.$emit("selected", [
this.$emit('selected', [
val,
selectedData[selectedData.length - 1].__label.split("/"),
selectedData[selectedData.length - 1].__label.split('/')
]);
},
/**
* 动态设置change-on-select的值
* 当级联选择器弹窗展开时设置change-on-select为true即可以点选菜单选项值发生变化
* 当级联选择器弹窗关闭时设置change-on-select为false即能够设置初始值
*/
handleChangeOnSelect(value) {
this.changeOnSelect = value;
},
//
loadData(item, callback) {
loadData (item, callback) { //
item.loading = true;
API_Setup.getChildRegion(item.value).then((res) => {
getChildRegion(item.value).then((res) => {
if (res.result.length <= 0) {
item.loading = false;
this.selected = item;
/**
* 处理数据并返回
*/
} else {
res.result.forEach((child) => {
item.loading = false;
@ -64,54 +44,138 @@ export default {
value: child.id,
label: child.name,
loading: false,
children: [],
children: []
};
if (
child.level == "street" ||
item.label == "香港特别行政区" ||
item.label == "澳门特别行政区"
) {
if (child.level === 'street' || item.label === '香港特别行政区') {
item.children.push({
value: child.id,
label: child.name,
label: child.name
});
} else {
item.children.push(data);
}
});
this.selected = item;
callback();
}
});
},
//
init() {
API_Setup.getChildRegion(this.id).then((res) => {
let way = [];
res.result.forEach((item) => {
let data;
//
if (item.name == "台湾省") {
data = {
value: item.id,
label: item.name,
};
} else {
data = {
value: item.id,
label: item.name,
loading: false,
children: [],
};
}
way.push(data);
});
this.data = way;
async init () { //
let data = await getChildRegion(0);
let arr = [];
data.result.forEach((item) => {
let obj;
//
if (item.name === '台湾省') {
obj = {
value: item.id,
label: item.name
};
} else {
obj = {
value: item.id,
label: item.name,
loading: false,
children: []
};
}
arr.push(obj);
});
this.data = arr;
},
async reviewData () {
//
let addr = JSON.parse(JSON.stringify(this.addressId.split(',')));
let length = addr.length;
let data = await getChildRegion(0);
let arr0 = [];
let arr1 = [];
let arr2 = [];
//
data.result.forEach((item) => {
let obj;
//
if (item.name === '台湾省') {
obj = {
value: item.id,
label: item.name
};
} else {
obj = {
value: item.id,
label: item.name,
loading: false,
children: []
};
}
arr0.push(obj);
});
//
if (length > 0) {
let children = await getChildRegion(addr[0]);
children = this.handleData(children.result);
arr0.forEach((e) => {
if (e.value === addr[0]) {
e.children = arr1 = children;
}
});
}
if (length > 1) {
let children = await getChildRegion(addr[1]);
children = this.handleData(children.result);
arr1.forEach((e) => {
if (e.value === addr[1]) {
e.children = arr2 = children;
}
});
}
if (length > 2) {
let children = await getChildRegion(addr[2]);
children = this.handleData(children.result);
arr2.forEach((e) => {
if (e.value === addr[2]) {
e.children = children;
}
});
}
this.data = arr0;
this.addr = addr;
},
handleData (data) {
//
let item = [];
data.forEach((child) => {
let obj = {
value: child.id,
label: child.name,
loading: false,
children: []
};
if (child.level === 'street' || item.label === '香港特别行政区') {
item.push({
value: child.id,
label: child.name
});
} else {
item.push(obj);
}
});
return item;
}
},
watch: {
addressId: {
handler: function (v) {
if (v) {
this.reviewData();
} else {
this.init();
}
},
immediate: true
}
}
};
</script>
<style scoped lang="scss">

View File

@ -129,7 +129,7 @@
<p class="item">
<span class="label">身份证照片</span>
<span class="info">
<img style="height: 100px;width: 90px" :src="storeInfo.legalPhoto">
<img style="height: 100px;width: 100px" class="mr_10" v-for="item in storeInfo.legalPhoto" :src="item" :key="item">
</span>
</p>
<p class="item">
@ -144,7 +144,7 @@
<p class="item">
<span class="label">营业执照电子版</span>
<span class="info">
<img style="height: 100px;width: 90px" :src="storeInfo.licencePhoto">
<img style="height: 100px;width: 100px" :src="storeInfo.licencePhoto">
</span>
</p>
@ -846,6 +846,7 @@
//switchtruefalse
this.storeInfo.storeDisable = this.storeInfo.storeDisable === "OPEN" ? true : false
this.checkAllGroup = this.storeInfo.goodsManagementCategory.split(",");
this.storeInfo.legalPhoto = this.storeInfo.legalPhoto.split(",");
});
},
//

View File

@ -3,7 +3,8 @@
<Card>
<Button class="mb_10" v-if="shopForm.storeDisable === 'APPLYING'" type="primary" @click="audit"></Button>
<Tabs v-model="tabName" :animated="false" style="overflow: visible">
<Form ref="shopForm" :model="shopForm" :label-width="130" label-position="right" :rules="shopValidate">
<Form ref="shopForm" :model="shopForm" :label-width="130" label-position="right" :rules="shopValidate" @on-validate="formValidate">
<TabPane label="基本信息" class="tab" name="base">
<Divider orientation="left">基本信息</Divider>
<!-- 遮罩层 -->
@ -13,7 +14,6 @@
<div class="item">
<Input disabled v-model="shopForm.memberName" />
<Button @click="selectMember()" v-if="!$route.query.shopId"></Button>
</div>
</FormItem>
<FormItem label="店铺名称" prop="storeName">
@ -57,35 +57,34 @@
</FormItem>
<FormItem label="店铺简介" prop="storeDesc" style="width: 350px">
<Input v-model="shopForm.storeDesc" type="textarea" :rows="4" clearable style="width: 400px" />
<Input v-model="shopForm.storeDesc" type="textarea" :rows="4" maxlength="200"
show-word-limit clearable style="width: 400px" />
</FormItem>
<br>
<Divider orientation="left">退货收件地址</Divider>
<FormItem label="收件人姓名" prop="salesConsigneeName">
<FormItem label="收件人姓名">
<Input v-model="shopForm.salesConsigneeName" clearable style="width: 350px" />
</FormItem>
<FormItem label="收件人手机" prop="salesConsigneeMobile">
<FormItem label="收件人手机">
<Input v-model="shopForm.salesConsigneeMobile" clearable maxlength="11" style="width: 350px" />
</FormItem>
<FormItem label="地址信息" prop="salesConsigneeAddressPath">
<Input v-model="shopForm.salesConsigneeAddressPath" disabled style="width: 305px" v-if="showRegion == false" />
<Button v-if="showRegion == false" @click="regionClick" :loading="submitLoading" type="primary" icon="ios-create-outline" style="margin-left: 8px">
</Button>
<region style="width: 350px" @selected="selectedConsigneeRegion" v-if="showRegion == true" />
<FormItem label="地址信息">
<region style="width: 350px" @selected="selectedConsigneeRegion" :addressId="returnAddress" />
</FormItem>
<FormItem label="详细地址" prop="salesConsigneeDetail">
<FormItem label="详细地址">
<Input v-model="shopForm.salesConsigneeDetail" clearable style="width: 350px" />
</FormItem>
<Divider orientation="left">腾讯云智服</Divider>
<FormItem label="唯一标识" prop="salesConsigneeDetail">
<FormItem label="唯一标识">
<Input v-model="shopForm.yzfSign" clearable style="width: 350px" />
</FormItem>
<FormItem label="小程序唯一标识" prop="salesConsigneeDetail">
<FormItem label="小程序唯一标识">
<Input v-model="shopForm.yzfMpSign" clearable style="width: 350px" />
</FormItem>
<Spin fix v-if="loading"></Spin>
</div>
</TabPane>
<!-- 入驻信息 -->
<TabPane label="入驻信息" class="tab" name="entry">
<!-- 遮罩层 -->
@ -99,11 +98,8 @@
<FormItem label="公司电话" prop="companyPhone">
<Input v-model="shopForm.companyPhone" clearable style="width: 350px" />
</FormItem>
<FormItem label="公司所在地" >
<Input v-model="shopForm.companyAddressPath" disabled style="width: 260px" v-if="showRegion == false" />
<Button v-if="showRegion == false" @click="regionClick" :loading="submitLoading" type="primary" icon="ios-create-outline" style="margin-left: 8px">
</Button>
<region style="width: 350px" @selected="selectedRegion" v-if="showRegion == true" />
<FormItem label="公司所在地" prop="companyAddressIdPath">
<region style="width: 350px" @selected="selectedRegion" :addressId="address" />
</FormItem>
<FormItem label="公司详细地址" prop="companyAddress">
<Input v-model="shopForm.companyAddress" clearable style="width: 350px" />
@ -139,34 +135,33 @@
<Divider orientation="left">法人信息</Divider>
<FormItem label="法人姓名" prop="legalName">
<FormItem label="法人姓名" prop="legalName">
<Input v-model="shopForm.legalName" clearable style="width: 200px" />
</FormItem>
<FormItem label="法人证件号" prop="legalId">
<Input v-model="shopForm.legalId" clearable style="width: 200px" />
</FormItem>
<FormItem label="法人身份证照片" ref="legalPhoto">
<Avatar style="height: 100px;width: 100px" v-if="shopForm.legalPhoto" shape="square" icon="ios-person" size="default" :src="shopForm.legalPhoto" />
<div>
<Button @click="handleCLickImg('legalPhoto')" type="primary">选择图片</Button>
</div>
<FormItem label="法人身份证照片" prop="legalPhoto">
<Avatar class="legal-photo" shape="square" size="100" icon="md-add" @click.native="handleCLickImg('legalPhoto', 0)" :src="shopForm.legalPhoto[0]" />
<Avatar class="ml_10 legal-photo" shape="square" size="100" icon="md-add" @click.native="handleCLickImg('legalPhoto', 1)" :src="shopForm.legalPhoto[1]" />
<span>点击图片上传身份证正反面要求身份证清晰四角无缺漏</span>
</FormItem>
<Divider orientation="left">结算银行信息</Divider>
<FormItem label="银行开户名" prop="settlementBankAccountName">
<FormItem label="银行开户名" prop="settlementBankAccountName">
<Input v-model="shopForm.settlementBankAccountName" clearable style="width: 200px" />
</FormItem>
<FormItem label="银行账号" prop="settlementBankAccountNum">
<FormItem label="银行账号" prop="settlementBankAccountNum">
<Input v-model="shopForm.settlementBankAccountNum" clearable style="width: 200px" />
</FormItem>
<FormItem label="银行支行名称" prop="settlementBankBranchName">
<FormItem label="银行支行名称" prop="settlementBankBranchName">
<Input v-model="shopForm.settlementBankBranchName" clearable style="width: 200px" />
</FormItem>
<FormItem label="支行联行号" prop="settlementBankJointName">
<FormItem label="支行联行号" prop="settlementBankJointName">
<Input v-model="shopForm.settlementBankJointName" clearable style="width: 200px" />
</FormItem>
<FormItem label="许可证电子版" >
<FormItem label="许可证电子版">
<Avatar style="height: 100px;width: 100px" v-if="shopForm.licencePhoto" shape="square" icon="ios-person" size="default" :src="shopForm.licencePhoto" />
<div>
<Button @click="handleCLickImg('licencePhoto')" type="primary">选择图片</Button>
@ -259,6 +254,8 @@ export default {
isRead: false, //
selectedFormBtnName: "", // form
picModalFlag: false, //
address: '', //
returnAddress: '', // 退
memberModalFlag: false, //
settlementShow: false, //
addSettlementConfirmBtn: false, //
@ -299,6 +296,9 @@ export default {
message: "员工总数不能为空",
trigger: "blur",
},
],
companyAddressIdPath: [
{ required: true, message: "请选择公司地址", },
],
registeredCapital: [
{
@ -348,6 +348,7 @@ export default {
settlementBankJointName: [
{ required: true, message: "支行联行号不能为空", },
],
salesConsigneeMobile: [
{
type: "string",
@ -360,16 +361,17 @@ export default {
indeterminate: true, //
checkAll: false, //
checkAllGroup: [], //
showRegion: false, //
submitLoading: false, //
settlementCycle: [], //
shopForm: { //
settlementCycle: "",
selfOperated: "",
selfOperated: false,
memberName: "",
companyName: "",
addressPath: "",
addressIdPath: "",
companyAddressPath: "",
companyAddressIdPath: "",
companyAddress: "",
companyEmail: "",
employeeNum: 1,
@ -381,7 +383,7 @@ export default {
licencePhoto: "",
legalName: "",
legalId: "",
legalPhoto: "",
legalPhoto: ['', ''],
companyPhone: "",
settlementBankAccountName: "",
settlementBankAccountNum: "",
@ -396,6 +398,7 @@ export default {
categories: [], //
infoResult: {}, //
picIndex: '', // 便
};
},
methods: {
@ -455,26 +458,40 @@ export default {
this.day = 1;
},
//
//
selectedRegion(val) {
this.$set(this.shopForm, "companyAddressIdPath", val[0]);
this.$set(this.shopForm, "companyAddressPath", val[1]);
this.$set(this.shopForm, 'companyAddressIdPath', val[0].toString());
this.$set(
this.shopForm,
'companyAddressPath',
val[1].toString().replace(/\s/g, '')
);
},
//
// 退
selectedConsigneeRegion(val) {
this.shopForm.salesConsigneeAddressPath = val[1];
this.shopForm.salesConsigneeAddressId = val[0];
this.$set(this.shopForm, 'salesConsigneeAddressId', val[0].toString());
this.$set(
this.shopForm,
'salesConsigneeAddressPath',
val[1].toString().replace(/\s/g, '')
);
},
// modal
handleCLickImg(val) {
handleCLickImg(val, index) {
this.$refs.ossManage.selectImage = true;
this.picModalFlag = true;
this.selectedFormBtnName = val;
this.picIndex = index
},
//
callbackSelected(val) {
this.picModalFlag = false;
this.shopForm[this.selectedFormBtnName] = val.url;
if (this.picIndex===0 || this.picIndex === 1) {
this.shopForm[this.selectedFormBtnName][this.picIndex] = val.url;
} else {
this.shopForm[this.selectedFormBtnName] = val.url;
}
this.picIndex = ''
},
//
init() {
@ -491,18 +508,23 @@ export default {
let index = this.tabNameList.indexOf(this.tabName) - 1
this.tabName = this.tabNameList[index]
},
formValidate (prop, status, error) { //
console.log(prop, status, error);
},
//
getShopDetail() {
shopDetail(this.shopId).then((res) => {
if (res.result) {
if (res.success) {
this.infoResult = res.result;
this.shopForm = res.result;
console.warn(this.shopForm);
this.checkAllGroup = this.shopForm.goodsManagementCategory.split(",");
if (this.shopForm.settlementCycle != "")
this.shopForm.settlementCycle.split(",").forEach((e) => {
this.settlementCycle.push(e);
});
if (this.shopForm.settlementCycle) {
this.settlementCycle = this.shopForm.settlementCycle.split(',')
}
this.shopForm.legalPhoto = this.shopForm.legalPhoto.split(',')
this.address = this.shopForm.companyAddressIdPath;
this.returnAddress = this.shopForm.salesConsigneeAddressId;
}
});
},
@ -514,23 +536,20 @@ export default {
this.$Message.error("请确认当前所填结算日信息");
return;
}
//
if (this.checkAllGroup == "") {
this.$Message.error("请选择店铺经营类目");
this.tabName = 'cagetory'
return;
}
if (valid) {
//
if (this.checkAllGroup == "") {
this.$Message.error("请选择店铺经营类目");
return;
}
//
if (this.shopForm.companyAddressPath == "") {
this.$Message.error("请选择公司所在地");
return;
}
//
this.shopForm.goodsManagementCategory = this.checkAllGroup;
this.shopForm.settlementCycle = this.settlementCycle;
const params = JSON.parse(JSON.stringify(this.shopForm))
//
params.goodsManagementCategory = this.checkAllGroup;
params.settlementCycle = this.settlementCycle;
if (this.shopId) {
delete this.shopForm.memberId;
shopEdit(this.shopId, this.shopForm).then((res) => {
delete params.memberId;
shopEdit(this.shopId, params).then((res) => {
if (res.success) {
this.$Message.success("编辑成功");
this.$router.push({ name: "shopList" });
@ -538,11 +557,11 @@ export default {
});
} else {
//
if (this.shopForm.memberName == "") {
if (params.memberName == "") {
this.$Message.error("请选择开店的会员");
return;
}
shopAdd(this.shopForm).then((resp) => {
shopAdd(params).then((resp) => {
if (resp.success) {
this.$Message.success("添加成功");
this.shopForm = {};
@ -553,7 +572,7 @@ export default {
}
});
},
//
//
getAddress(item) {
this.shopForm.storeCenter = item.position.lat + "," + item.position.lng;
this.$set(this.shopForm, "storeAddressPath", item.addr);
@ -678,4 +697,9 @@ export default {
margin: 0 4px;
}
}
.legal-photo{
width: 100px;
height: 100px;
cursor: pointer;
}
</style>

View File

@ -505,12 +505,11 @@ export default {
* @value 参数选项值
*/
selectParams(paramsGroup, groupIndex, params, paramsIndex, value) {
debugger
if (!this.baseInfoForm.goodsParamsDTOList[groupIndex]) {
this.baseInfoForm.goodsParamsDTOList[groupIndex] = {
groupId:'',
groupName:'',
goodsParamsItemDTOList:[]
groupId: '',
groupName: '',
goodsParamsItemDTOList: []
}
}
//id