Commit 1f4de27d by 无尘

add: 更新区域选择插件

parent 5c7c8584
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
</div> </div>
<ul class="particular-list"> <ul class="particular-list">
<template v-for="(li, index) in defaultSelection"> <template v-for="(li, index) in defaultSelection">
<li class="item person-item" v-if="li.employeeClerkId" :key="index+'_'+li.employeeClerkId"> <li class="item person-item" v-if="li.type == 1" :key="index+'_'+li.employeeClerkId">
<img :src="li.headPic"> <img :src="li.headPic">
<p class="name">{{li.label}}</p> <p class="name">{{li.name}}</p>
<i class="el-icon-circle-close" @click="delCurrent(index, defaultSelection)"></i> <i class="el-icon-circle-close" @click="delCurrent(index, defaultSelection)"></i>
</li> </li>
<li class="item group-item" v-else :key="index+'_'+li.groupId"> <li class="item group-item" v-else :key="index+'_'+li.groupId">
{{li.label}} {{li.name}}
<i class="el-icon-circle-close" @click="delCurrent(index, defaultSelection)"></i> <i class="el-icon-circle-close" @click="delCurrent(index, defaultSelection)"></i>
</li> </li>
</template> </template>
...@@ -55,7 +55,7 @@ export default { ...@@ -55,7 +55,7 @@ export default {
isSingle: false // 是否单选 isSingle: false // 是否单选
}, },
treeData: {}, treeData: {},
defaultSelection: [], // 已选数据 defaultSelection: this.value || [], // 已选数据
onlyPerson: false, // 控制只能选人(true) onlyPerson: false, // 控制只能选人(true)
}; };
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
updateList(data) { updateList(data) {
const that = this; const that = this;
that.$emit('input',data) that.$emit('input',data)
console.log(data) // console.log(data)
}, },
/** /**
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
*/ */
handleSelectedList(list) { handleSelectedList(list) {
const that = this; const that = this;
console.log(list); // console.log(list);
// that.defaultSelection = list // that.defaultSelection = list
// that.$emit('input',list) // that.$emit('input',list)
that.updateList(list) that.updateList(list)
...@@ -97,6 +97,8 @@ export default { ...@@ -97,6 +97,8 @@ export default {
isSingle: false, isSingle: false,
isSelectPerson: true isSelectPerson: true
}; };
console.log("参数:",that.value,that.defaultSelection,that.treeData)
that.defaultSelection = that.value
if (!!that.treeData.hasOwnProperty('treeData')) { if (!!that.treeData.hasOwnProperty('treeData')) {
return; return;
} }
...@@ -153,10 +155,15 @@ export default { ...@@ -153,10 +155,15 @@ export default {
watch: { watch: {
value: function(newData,oldData) { value: function(newData,oldData) {
const that = this const that = this
// console.log(oldData,newData) // console.log("value:",oldData,newData)
that.defaultSelection = newData that.defaultSelection = newData;
} }
} },
mounted() {
const that = this;
console.log(that.value)
// that.getDepartData(that.value)
},
}; };
</script> </script>
......
...@@ -60,7 +60,10 @@ export default { ...@@ -60,7 +60,10 @@ export default {
name: "", name: "",
props: { props: {
authData: { authData: {
type: [Object,Array] type: [Object,Array],
default() {
return {}
}
}, },
permType: { permType: {
...@@ -77,13 +80,13 @@ export default { ...@@ -77,13 +80,13 @@ export default {
visibleAll: [ visibleAll: [
// { // {
// id: '1', // id: '1',
// type: 'people', // type: '1',
// name: '张三', // name: '张三',
// img: 'http://thirdwx.qlogo.cn/mmopen/j7nX4OeBsXRNyvh6micCywssVEYCaWiaicUZq5Vn2zWktWLAyRvEAH7icQmUhLze8rrQYpM5ptwZ2RL7cX0icyBbiavhYFNTIZhibKu/0' // headPic: 'http://thirdwx.qlogo.cn/mmopen/j7nX4OeBsXRNyvh6micCywssVEYCaWiaicUZq5Vn2zWktWLAyRvEAH7icQmUhLze8rrQYpM5ptwZ2RL7cX0icyBbiavhYFNTIZhibKu/0'
// }, // },
// { // {
// id: '1', // id: '2',
// type: 'store', // type: '2',
// name: '张三', // name: '张三',
// } // }
] ]
...@@ -121,6 +124,21 @@ export default { ...@@ -121,6 +124,21 @@ export default {
console.log(valid) console.log(valid)
if (valid) { if (valid) {
console.log(that.ruleForm) console.log(that.ruleForm)
let data = {
allowCherkIds: [],
allowDepartIds: [],
brandId: that.ruleForm.brandId,
groupId: that.ruleForm.groupId,
radio: that.ruleForm.radio
};
that.ruleForm.visibleAll.forEach(function(ele,index){
if (ele.hasOwnProperty('employeeClerkId')) {
data.allowCherkIds.push(ele.employeeClerkId)
}else {
data.allowDepartIds.push(ele.groupId)
}
})
that.setStoreAuth(data,that.permType)
} else { } else {
return false; return false;
} }
...@@ -139,8 +157,8 @@ export default { ...@@ -139,8 +157,8 @@ export default {
groupId: data.groupId, groupId: data.groupId,
storeEmployeeAuth: data.radio, storeEmployeeAuth: data.radio,
storeManagerAuth: data.radio, storeManagerAuth: data.radio,
allowCherkIds: data.allowCherkIds, allowCherkIds: data.allowCherkIds.join(','),
allowDepartIds: data.allowDepartIds allowDepartIds: data.allowDepartIds.join(',')
} }
postRequest('/haoban-manage-web/brand/saveStoreAuth',para) postRequest('/haoban-manage-web/brand/saveStoreAuth',para)
.then((res) => { .then((res) => {
...@@ -165,9 +183,36 @@ export default { ...@@ -165,9 +183,36 @@ export default {
}); });
}, },
/**
* 处理传递数据
*/
handleAuthData(data) {
const that = this;
// console.log("处理传递数据:",data)
if (!Object.keys(data).length) {return;}
that.ruleForm.brandId = data.brandId;
that.ruleForm.groupId = data.groupId;
if (Number.parseInt(that.permType) === 1 ) {// && !!data.employeeAuthList.length
that.ruleForm.visibleAll = data.employeeAuthList
}
if (Number.parseInt(that.permType) === 2 ) { // && !!data.managerAuthList.length
that.ruleForm.visibleAll = data.managerAuthList
}
}
},
watch: {
authData: function(newData,oldData) {
const that = this
console.log("authData:",oldData,newData)
that.handleAuthData(newData)
}
}, },
mounted() { mounted() {
const that = this; const that = this;
console.log(that.authData)
that.handleAuthData(that.authData)
}, },
components: { components: {
setPermissData setPermissData
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
<i v-else class="el-icon-plus avatar-uploader-icon"></i> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload> </el-upload>
<p class="upload-tip w-500" v-if="field=='businessCard'">上传营业执照复印件加盖公章,手写“仅用于好办认证”字样;照片搜索信息要求清晰可见,内容真实有效,不得做任何修改;支持jpp、jpeg、bmg、gif、png格式,大小不超过8M。</p> <p class="upload-tip w-500" v-if="field=='businessCard'">上传营业执照复印件加盖公章,手写“仅用于好办认证”字样;照片搜索信息要求清晰可见,内容真实有效,不得做任何修改;支持jpp、jpeg、bmg、gif、png格式,大小不超过8M。</p>
<p class="upload-tip w-500" v-if="field=='idPhoto'">支持jpg、jpeg、pdf、bmg、gif格式照片,大小不超过2M,只能上传一张,再次上传覆盖前一张</p> <p class="upload-tip w-500" v-if="field=='cardUrl'">支持jpg、jpeg、pdf、bmg、gif格式照片,大小不超过2M,只能上传一张,再次上传覆盖前一张</p>
<p class="upload-tip w-500" v-if="field=='authPhoto'">点击可以<a href="#/" class="color-1890ff">下载授权书</a>模板,支持jpg、jpeg、pdf、bmg、gif格式照片,大小不超过2M,只能上传一张,再次上传覆盖前一张</p> <p class="upload-tip w-500" v-if="field=='authUrl'">点击可以<a href="#/" class="color-1890ff">下载授权书</a>模板,支持jpg、jpeg、pdf、bmg、gif格式照片,大小不超过2M,只能上传一张,再次上传覆盖前一张</p>
<!-- 图片预览 --> <!-- 图片预览 -->
<vue-gic-img-preview :imgUrl="imgUrl" :imgShowFlag="imgShowFlag" @hideImage="hideImage"></vue-gic-img-preview> <vue-gic-img-preview :imgUrl="imgUrl" :imgShowFlag="imgShowFlag" @hideImage="hideImage"></vue-gic-img-preview>
......
...@@ -284,6 +284,10 @@ export default { ...@@ -284,6 +284,10 @@ export default {
isSingle: false, isSingle: false,
isSelectPerson: true isSelectPerson: true
}; };
that.defaultSelection = selData;
if (!!that.treeData.hasOwnProperty('treeData')) {
return;
}
that.getDepartData(selData); that.getDepartData(selData);
}, },
...@@ -295,9 +299,9 @@ export default { ...@@ -295,9 +299,9 @@ export default {
const that = this; const that = this;
if (that.selectType === 'people') { if (that.selectType === 'people') {
that.ruleForm.peopleList = group that.ruleForm.peopleList = group;
}else { }else {
that.ruleForm.departList = group that.ruleForm.departList = group;
} }
}, },
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
<div class="right-content"> <div class="right-content">
<div class="right-box"> <div class="right-box">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm"> <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
<el-form-item label="企业名称" prop="name" class=""> <el-form-item label="企业名称" prop="enterpriseName" class="">
<!-- <el-input v-model="ruleForm.name" placeholder="请输入地址" class="w-500"></el-input> --> <!-- <el-input v-model="ruleForm.name" placeholder="请输入地址" class="w-500"></el-input> -->
<limitInput <limitInput
:inputWidth="500" :inputWidth="500"
:inputValue.sync="ruleForm.name" :inputValue.sync="ruleForm.enterpriseName"
:holder="'请输入企业名称'" :holder="'请输入企业名称'"
:maxLength="20"> :maxLength="20">
</limitInput> </limitInput>
...@@ -16,18 +16,18 @@ ...@@ -16,18 +16,18 @@
<el-form-item label="所在地区" prop="region" class="city-area"> <el-form-item label="所在地区" prop="region" class="city-area">
<vue-office-area :projectName="projectName" :postUrl="postUrl" :areaOptions="areaOptions" @selected="selected"></vue-office-area> <vue-office-area :projectName="projectName" :postUrl="postUrl" :areaOptions="areaOptions" @selected="selected"></vue-office-area>
</el-form-item> </el-form-item>
<el-form-item label="详细地址" prop="addressDetail" class=""> <el-form-item label="详细地址" prop="detailAddress" class="">
<limitInput <limitInput
:inputWidth="500" :inputWidth="500"
:inputValue.sync="ruleForm.addressDetail" :inputValue.sync="ruleForm.detailAddress"
:holder="'请输入详细地址'" :holder="'请输入详细地址'"
:maxLength="40"> :maxLength="40">
</limitInput> </limitInput>
</el-form-item> </el-form-item>
<el-form-item label="营业执照注册号" prop="registNum" class=""> <el-form-item label="营业执照注册号" prop="businessLicenseNum" class="">
<limitInput <limitInput
:inputWidth="500" :inputWidth="500"
:inputValue.sync="ruleForm.registNum" :inputValue.sync="ruleForm.businessLicenseNum"
:holder="'请输入营业执照注册号'" :holder="'请输入营业执照注册号'"
:maxLength="20"> :maxLength="20">
</limitInput> </limitInput>
...@@ -40,23 +40,23 @@ ...@@ -40,23 +40,23 @@
<el-radio v-model="ruleForm.cardType" label="1">普通营业执照(仍然标识为15位的“注册号”)</el-radio> <el-radio v-model="ruleForm.cardType" label="1">普通营业执照(仍然标识为15位的“注册号”)</el-radio>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="营业执照" prop="qcloudImageUrl" class=""> <el-form-item label="营业执照" prop="businessLicenseUrl" class="">
<single-upload <single-upload
:imgSrc.sync="ruleForm.qcloudImageUrl" :imgSrc.sync="ruleForm.businessLicenseUrl"
:uploadLimit="8" :uploadLimit="8"
:field="'businessCard'"> :field="'businessCard'">
</single-upload> </single-upload>
</el-form-item> </el-form-item>
<el-form-item label="手持证件照片" prop="idPhoto" class=""> <el-form-item label="手持证件照片" prop="cardUrl" class="">
<single-upload <single-upload
:imgSrc.sync="ruleForm.idPhoto" :imgSrc.sync="ruleForm.cardUrl"
:field="'idPhoto'"> :field="'cardUrl'">
</single-upload> </single-upload>
</el-form-item> </el-form-item>
<el-form-item label="授权书" prop="authPhoto" class=""> <el-form-item label="授权书" prop="authUrl" class="">
<single-upload <single-upload
:imgSrc.sync="ruleForm.authPhoto" :imgSrc.sync="ruleForm.authUrl"
:field="'authPhoto'"> :field="'authUrl'">
</single-upload> </single-upload>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status" class="status-item"> <el-form-item label="状态" prop="status" class="status-item">
...@@ -88,7 +88,7 @@ export default { ...@@ -88,7 +88,7 @@ export default {
data() { data() {
return { return {
projectName: '', // 当前项目名 projectName: '', // 当前项目名
postUrl: '/api-admin/dict-district-list',// 地区选择请求 url 参数 postUrl: '/haoban-manage-web/dict-district-list',// 地区选择请求 url 参数
// 面包屑参数 // 面包屑参数
navpath: [ navpath: [
{ {
...@@ -111,24 +111,24 @@ export default { ...@@ -111,24 +111,24 @@ export default {
], ],
ruleForm: { ruleForm: {
name: '', enterpriseName: '',
region: '', region: '',
addressDetail: '', detailAddress: '',
registNum: '', businessLicenseNum: '',
cardType: '0',// cardType: '0',// 证件类型(0:多证合一营业执照,1:普通营业执照)
qcloudImageUrl: '', businessLicenseUrl: '',
idPhoto: '', cardUrl: '',
authPhoto: '', authUrl: '',
status: 0 status: 0
}, },
rules: { rules: {
name: [ enterpriseName: [
{required: true,message: '请输入企业名称', trigger: 'blur' } {required: true,message: '请输入企业名称', trigger: 'blur' }
], ],
addressDetail: [ detailAddress: [
{ required: true, message: '请输入详细地址', trigger: 'blur' } { required: true, message: '请输入详细地址', trigger: 'blur' }
], ],
registNum: [ businessLicenseNum: [
{ required: true, message: '请输入营业执照注册号', trigger: 'blur' } { required: true, message: '请输入营业执照注册号', trigger: 'blur' }
], ],
region: [ region: [
...@@ -137,13 +137,13 @@ export default { ...@@ -137,13 +137,13 @@ export default {
cardType: [ cardType: [
{ required: true, message: '请选择证件类型', trigger: 'blur' } { required: true, message: '请选择证件类型', trigger: 'blur' }
], ],
qcloudImageUrl: [ businessLicenseUrl: [
{ required: true, message: '请上传营业执照', trigger: 'blur' } { required: true, message: '请上传营业执照', trigger: 'blur' }
], ],
idPhoto: [ cardUrl: [
{ required: true, message: '请上传照片', trigger: 'blur' } { required: true, message: '请上传照片', trigger: 'blur' }
], ],
authPhoto: [ authUrl: [
{ required: true, message: '请上传授权书', trigger: 'blur' } { required: true, message: '请上传授权书', trigger: 'blur' }
], ],
...@@ -213,9 +213,48 @@ export default { ...@@ -213,9 +213,48 @@ export default {
/** /**
* 保存---api * 保存---api
*/ */
postSave() { postSave(data) {
const that = this; const that = this;
let para = {
enterpriseName: data.enterpriseName,
enterpriseCode: data.enterpriseCode,
provinceId: data.region.provinceId,
cityId: data.region.cityId,
areaId: data.region.areaId,
detailAddress: data.region.detailAddress,
cardType: data.region.cardType,
cardUrl: data.region.cardUrl,
businessLicenseUrl: data.region.businessLicenseUrl,
businessLicenseNum: data.region.businessLicenseNum,
authUrl: data.region.authUrl,
saveOnly: '',
}
postRequest('/haoban-manage-web/enterprise-authentication/update-authentication',para)
.then((res) => {
// console.log(res,res.data,res.data.errorCode)
let resData = res.data;
if (resData.errorCode == 1) {
// showMsg.showmsg('保存成功','success')
for(let k in Object.values(resData.result)) {
if (k == null) {
resData.result[k] = ''
}
}
that.ruleForm = Object.assign(that.ruleForm,resData.result)
return;
}
errMsg.errorMsg(resData)
})
.catch(function (error) {
console.log(error);
that.$message.error({
duration: 1000,
message: error.message
})
});
}, },
/** /**
...@@ -238,10 +277,49 @@ export default { ...@@ -238,10 +277,49 @@ export default {
*/ */
postReview() { postReview() {
const that = this; const that = this;
},
/**
* 查询企业认证信息
*/
getCompanyInfo() {
const that = this;
let para = {
}
postRequest('/haoban-manage-web/enterprise-authentication/find-detail',para)
.then((res) => {
// console.log(res,res.data,res.data.errorCode)
let resData = res.data;
if (resData.errorCode == 1) {
// showMsg.showmsg('保存成功','success')
for(let k of Object.keys(resData.result)) {
console.log(k)
if (k == null) {
resData.result[k] = ''
}
}
that.ruleForm = Object.assign(that.ruleForm,resData.result)
return;
}
errMsg.errorMsg(resData)
})
.catch(function (error) {
console.log(error);
that.$message.error({
duration: 1000,
message: error.message
})
});
} }
}, },
mounted() { mounted() {
const that = this;
that.getCompanyInfo()
}, },
components: { components: {
navCrumb, navCrumb,
......
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
<!-- {{item.name}} --> <!-- {{item.name}} -->
<set-permiss <set-permiss
:permType="1" :permType="1"
:authData="brandList.clerkData"> :authData="item.clerkData">
</set-permiss> </set-permiss>
<set-permiss <set-permiss
:permType="2" :permType="2"
:authData="brandList.managerData"> :authData="item.managerData">
</set-permiss> </set-permiss>
</el-tab-pane> </el-tab-pane>
...@@ -135,8 +135,9 @@ export default { ...@@ -135,8 +135,9 @@ export default {
*/ */
handleClick(tab, event) { handleClick(tab, event) {
const that = this const that = this
console.log(tab, event); console.log(tab, event,tab.name,Number.parseInt(tab.index));
that.getStoreAuth(tab.name) that.getStoreAuth(tab.name,Number.parseInt(tab.index))
that.activeName = tab.name;
}, },
/** /**
...@@ -159,7 +160,7 @@ export default { ...@@ -159,7 +160,7 @@ export default {
const that = this; const that = this;
let para = { let para = {
brandId: data.brandId, brandId: data.brandId,
groupId: data.groupId, groupId: that.activeName,
addStoreClerkCheck: data.addStoreClerkCheck, addStoreClerkCheck: data.addStoreClerkCheck,
deleteStoreClerkCheck: data.deleteStoreClerkCheck, deleteStoreClerkCheck: data.deleteStoreClerkCheck,
storeInformationChangeCheck: data.storeInformationChangeCheck, storeInformationChangeCheck: data.storeInformationChangeCheck,
...@@ -191,7 +192,7 @@ export default { ...@@ -191,7 +192,7 @@ export default {
/** /**
* 获取门店权限设置 * 获取门店权限设置
*/ */
getStoreAuth(groupId) { getStoreAuth(groupId,index) {
const that = this; const that = this;
let para = { let para = {
groupId: groupId groupId: groupId
...@@ -204,14 +205,15 @@ export default { ...@@ -204,14 +205,15 @@ export default {
// showMsg.showmsg('操作成功','success') // showMsg.showmsg('操作成功','success')
if (!!resData.result) { if (!!resData.result) {
that.brandList.clerkData = resData.result; that.brandList[index].clerkData = resData.result;
that.brandList.managerData = resData.result; that.brandList[index].managerData = resData.result;
// 设置开关 // 设置开关
let brandDTO = resData.result.brandDTO; let brandDTO = resData.result.brandDTO;
brandDTO.addStoreClerkCheck = brandDTO.addStoreClerkCheck == 1? true: false; brandDTO.addStoreClerkCheck = brandDTO.addStoreClerkCheck == 1? true: false;
brandDTO.deleteStoreClerkCheck = brandDTO.deleteStoreClerkCheck == 1? true: false; brandDTO.deleteStoreClerkCheck = brandDTO.deleteStoreClerkCheck == 1? true: false;
brandDTO.storeInformationChangeCheck = brandDTO.storeInformationChangeCheck == 1? true: false; brandDTO.storeInformationChangeCheck = brandDTO.storeInformationChangeCheck == 1? true: false;
that.switchList = Object.assign(that.switchList,brandDTO); that.switchList = Object.assign(that.switchList,brandDTO);
that.$forceUpdate()
}else { }else {
that.$message.error({ that.$message.error({
duration: 1000, duration: 1000,
...@@ -248,7 +250,7 @@ export default { ...@@ -248,7 +250,7 @@ export default {
if (!!resData.result && !!resData.result.length ) { if (!!resData.result && !!resData.result.length ) {
that.brandList = resData.result that.brandList = resData.result
that.activeName = resData.result[0].groupId; that.activeName = resData.result[0].groupId;
that.getStoreAuth(resData.result[0].groupId) that.getStoreAuth(resData.result[0].groupId,0)
}else { }else {
that.$message.error({ that.$message.error({
duration: 1000, duration: 1000,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment