Commit 1f4de27d by 无尘

add: 更新区域选择插件

parent 5c7c8584
......@@ -5,13 +5,13 @@
</div>
<ul class="particular-list">
<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">
<p class="name">{{li.label}}</p>
<p class="name">{{li.name}}</p>
<i class="el-icon-circle-close" @click="delCurrent(index, defaultSelection)"></i>
</li>
<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>
</li>
</template>
......@@ -55,7 +55,7 @@ export default {
isSingle: false // 是否单选
},
treeData: {},
defaultSelection: [], // 已选数据
defaultSelection: this.value || [], // 已选数据
onlyPerson: false, // 控制只能选人(true)
};
......@@ -73,7 +73,7 @@ export default {
updateList(data) {
const that = this;
that.$emit('input',data)
console.log(data)
// console.log(data)
},
/**
......@@ -81,7 +81,7 @@ export default {
*/
handleSelectedList(list) {
const that = this;
console.log(list);
// console.log(list);
// that.defaultSelection = list
// that.$emit('input',list)
that.updateList(list)
......@@ -97,6 +97,8 @@ export default {
isSingle: false,
isSelectPerson: true
};
console.log("参数:",that.value,that.defaultSelection,that.treeData)
that.defaultSelection = that.value
if (!!that.treeData.hasOwnProperty('treeData')) {
return;
}
......@@ -153,10 +155,15 @@ export default {
watch: {
value: function(newData,oldData) {
const that = this
// console.log(oldData,newData)
that.defaultSelection = newData
// console.log("value:",oldData,newData)
that.defaultSelection = newData;
}
}
},
mounted() {
const that = this;
console.log(that.value)
// that.getDepartData(that.value)
},
};
</script>
......
......@@ -60,7 +60,10 @@ export default {
name: "",
props: {
authData: {
type: [Object,Array]
type: [Object,Array],
default() {
return {}
}
},
permType: {
......@@ -77,13 +80,13 @@ export default {
visibleAll: [
// {
// id: '1',
// type: 'people',
// type: '1',
// name: '张三',
// img: 'http://thirdwx.qlogo.cn/mmopen/j7nX4OeBsXRNyvh6micCywssVEYCaWiaicUZq5Vn2zWktWLAyRvEAH7icQmUhLze8rrQYpM5ptwZ2RL7cX0icyBbiavhYFNTIZhibKu/0'
// headPic: 'http://thirdwx.qlogo.cn/mmopen/j7nX4OeBsXRNyvh6micCywssVEYCaWiaicUZq5Vn2zWktWLAyRvEAH7icQmUhLze8rrQYpM5ptwZ2RL7cX0icyBbiavhYFNTIZhibKu/0'
// },
// {
// id: '1',
// type: 'store',
// id: '2',
// type: '2',
// name: '张三',
// }
]
......@@ -121,6 +124,21 @@ export default {
console.log(valid)
if (valid) {
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 {
return false;
}
......@@ -139,8 +157,8 @@ export default {
groupId: data.groupId,
storeEmployeeAuth: data.radio,
storeManagerAuth: data.radio,
allowCherkIds: data.allowCherkIds,
allowDepartIds: data.allowDepartIds
allowCherkIds: data.allowCherkIds.join(','),
allowDepartIds: data.allowDepartIds.join(',')
}
postRequest('/haoban-manage-web/brand/saveStoreAuth',para)
.then((res) => {
......@@ -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() {
const that = this;
console.log(that.authData)
that.handleAuthData(that.authData)
},
components: {
setPermissData
......
......@@ -17,8 +17,8 @@
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</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=='idPhoto'">支持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=='cardUrl'">支持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>
......
......@@ -284,6 +284,10 @@ export default {
isSingle: false,
isSelectPerson: true
};
that.defaultSelection = selData;
if (!!that.treeData.hasOwnProperty('treeData')) {
return;
}
that.getDepartData(selData);
},
......@@ -295,9 +299,9 @@ export default {
const that = this;
if (that.selectType === 'people') {
that.ruleForm.peopleList = group
that.ruleForm.peopleList = group;
}else {
that.ruleForm.departList = group
that.ruleForm.departList = group;
}
},
......
......@@ -4,11 +4,11 @@
<div class="right-content">
<div class="right-box">
<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> -->
<limitInput
:inputWidth="500"
:inputValue.sync="ruleForm.name"
:inputValue.sync="ruleForm.enterpriseName"
:holder="'请输入企业名称'"
:maxLength="20">
</limitInput>
......@@ -16,18 +16,18 @@
<el-form-item label="所在地区" prop="region" class="city-area">
<vue-office-area :projectName="projectName" :postUrl="postUrl" :areaOptions="areaOptions" @selected="selected"></vue-office-area>
</el-form-item>
<el-form-item label="详细地址" prop="addressDetail" class="">
<el-form-item label="详细地址" prop="detailAddress" class="">
<limitInput
:inputWidth="500"
:inputValue.sync="ruleForm.addressDetail"
:inputValue.sync="ruleForm.detailAddress"
:holder="'请输入详细地址'"
:maxLength="40">
</limitInput>
</el-form-item>
<el-form-item label="营业执照注册号" prop="registNum" class="">
<el-form-item label="营业执照注册号" prop="businessLicenseNum" class="">
<limitInput
:inputWidth="500"
:inputValue.sync="ruleForm.registNum"
:inputValue.sync="ruleForm.businessLicenseNum"
:holder="'请输入营业执照注册号'"
:maxLength="20">
</limitInput>
......@@ -40,23 +40,23 @@
<el-radio v-model="ruleForm.cardType" label="1">普通营业执照(仍然标识为15位的“注册号”)</el-radio>
</div>
</el-form-item>
<el-form-item label="营业执照" prop="qcloudImageUrl" class="">
<el-form-item label="营业执照" prop="businessLicenseUrl" class="">
<single-upload
:imgSrc.sync="ruleForm.qcloudImageUrl"
:imgSrc.sync="ruleForm.businessLicenseUrl"
:uploadLimit="8"
:field="'businessCard'">
</single-upload>
</el-form-item>
<el-form-item label="手持证件照片" prop="idPhoto" class="">
<el-form-item label="手持证件照片" prop="cardUrl" class="">
<single-upload
:imgSrc.sync="ruleForm.idPhoto"
:field="'idPhoto'">
:imgSrc.sync="ruleForm.cardUrl"
:field="'cardUrl'">
</single-upload>
</el-form-item>
<el-form-item label="授权书" prop="authPhoto" class="">
<el-form-item label="授权书" prop="authUrl" class="">
<single-upload
:imgSrc.sync="ruleForm.authPhoto"
:field="'authPhoto'">
:imgSrc.sync="ruleForm.authUrl"
:field="'authUrl'">
</single-upload>
</el-form-item>
<el-form-item label="状态" prop="status" class="status-item">
......@@ -88,7 +88,7 @@ export default {
data() {
return {
projectName: '', // 当前项目名
postUrl: '/api-admin/dict-district-list',// 地区选择请求 url 参数
postUrl: '/haoban-manage-web/dict-district-list',// 地区选择请求 url 参数
// 面包屑参数
navpath: [
{
......@@ -111,24 +111,24 @@ export default {
],
ruleForm: {
name: '',
enterpriseName: '',
region: '',
addressDetail: '',
registNum: '',
cardType: '0',//
qcloudImageUrl: '',
idPhoto: '',
authPhoto: '',
detailAddress: '',
businessLicenseNum: '',
cardType: '0',// 证件类型(0:多证合一营业执照,1:普通营业执照)
businessLicenseUrl: '',
cardUrl: '',
authUrl: '',
status: 0
},
rules: {
name: [
enterpriseName: [
{required: true,message: '请输入企业名称', trigger: 'blur' }
],
addressDetail: [
detailAddress: [
{ required: true, message: '请输入详细地址', trigger: 'blur' }
],
registNum: [
businessLicenseNum: [
{ required: true, message: '请输入营业执照注册号', trigger: 'blur' }
],
region: [
......@@ -137,13 +137,13 @@ export default {
cardType: [
{ required: true, message: '请选择证件类型', trigger: 'blur' }
],
qcloudImageUrl: [
businessLicenseUrl: [
{ required: true, message: '请上传营业执照', trigger: 'blur' }
],
idPhoto: [
cardUrl: [
{ required: true, message: '请上传照片', trigger: 'blur' }
],
authPhoto: [
authUrl: [
{ required: true, message: '请上传授权书', trigger: 'blur' }
],
......@@ -213,9 +213,48 @@ export default {
/**
* 保存---api
*/
postSave() {
postSave(data) {
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 {
*/
postReview() {
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() {
const that = this;
that.getCompanyInfo()
},
components: {
navCrumb,
......
......@@ -9,12 +9,12 @@
<!-- {{item.name}} -->
<set-permiss
:permType="1"
:authData="brandList.clerkData">
:authData="item.clerkData">
</set-permiss>
<set-permiss
:permType="2"
:authData="brandList.managerData">
:authData="item.managerData">
</set-permiss>
</el-tab-pane>
......@@ -135,8 +135,9 @@ export default {
*/
handleClick(tab, event) {
const that = this
console.log(tab, event);
that.getStoreAuth(tab.name)
console.log(tab, event,tab.name,Number.parseInt(tab.index));
that.getStoreAuth(tab.name,Number.parseInt(tab.index))
that.activeName = tab.name;
},
/**
......@@ -159,7 +160,7 @@ export default {
const that = this;
let para = {
brandId: data.brandId,
groupId: data.groupId,
groupId: that.activeName,
addStoreClerkCheck: data.addStoreClerkCheck,
deleteStoreClerkCheck: data.deleteStoreClerkCheck,
storeInformationChangeCheck: data.storeInformationChangeCheck,
......@@ -191,7 +192,7 @@ export default {
/**
* 获取门店权限设置
*/
getStoreAuth(groupId) {
getStoreAuth(groupId,index) {
const that = this;
let para = {
groupId: groupId
......@@ -204,14 +205,15 @@ export default {
// showMsg.showmsg('操作成功','success')
if (!!resData.result) {
that.brandList.clerkData = resData.result;
that.brandList.managerData = resData.result;
that.brandList[index].clerkData = resData.result;
that.brandList[index].managerData = resData.result;
// 设置开关
let brandDTO = resData.result.brandDTO;
brandDTO.addStoreClerkCheck = brandDTO.addStoreClerkCheck == 1? true: false;
brandDTO.deleteStoreClerkCheck = brandDTO.deleteStoreClerkCheck == 1? true: false;
brandDTO.storeInformationChangeCheck = brandDTO.storeInformationChangeCheck == 1? true: false;
that.switchList = Object.assign(that.switchList,brandDTO);
that.$forceUpdate()
}else {
that.$message.error({
duration: 1000,
......@@ -248,7 +250,7 @@ export default {
if (!!resData.result && !!resData.result.length ) {
that.brandList = resData.result
that.activeName = resData.result[0].groupId;
that.getStoreAuth(resData.result[0].groupId)
that.getStoreAuth(resData.result[0].groupId,0)
}else {
that.$message.error({
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