no message

cyl/job_im_cus
jscyl13849007907 6 days ago
parent cb6efd9c6e
commit 9a202bd6f0

@ -93,7 +93,7 @@
<u-input type="password" :custom-style="{ fontSize: item.fontSize || ' 16px' }" :clearable="false" :password-icon="false" :placeholder="item.placeholder" input-align="right" class="g_text_r g_w_all" placeholder-style="color:#999;font-size:16px;line-height:1" v-model="item.value" @input="(e) => handleConfirmPwd(e, item, index)" />
</div>
<!-- 姓名输入框 -->
<div class="form-new-name g_flex_rowRight_columnCenter g_w_all" v-if="item.tip == 'slot-name' || item.tip == 'slot-upID' || item.tip == 'slot-weChat'">
<div class="form-new-name g_flex_rowRight_columnCenter g_w_all" v-if="item.tip == 'slot-name' || item.tip == 'slot-upID' || item.tip == 'slot-weChat' || item.tip == 'slot-title'">
<u-input type="text" :hover-stop-propagation="true" :maxlength="30" :custom-style="{ fontSize: item.fontSize || ' 16px' }" :clearable="false" :password-icon="false" :placeholder="item.placeholder" input-align="right" class="g_text_r g_w_all" placeholder-style="color:#999;font-size:16px;line-height:1" v-model="item.value" @input="(e) => handleName(e, item, index)" @blur="(e) => handleName(e, item, index)" />
<div class="form-new-why g_flex_column_center" style="" @click="chooseImgType('IDCard')" v-if="item.tip == 'slot-upID'">
<image class="g_ml_4 g_w_24 g_h_22" :src="item.img || cdnBaseImg + 'mock_photo1.svg'"></image>
@ -169,10 +169,20 @@
<div class="g_flex_1 g_c_3 g_text_l g_fs_16 g_pl_6" :class="[caiwuToggle ? '' : '', item.value.length > 1 ? 'g_text_l' : 'g_text_r']" style="white-space: pre-line">{{ item.value || "-" }}</div>
</div>
<!-- 选择政策 -->
<div class="g_flex_rowRight_columnCenter g_w_all" @click="uploadZhengce" v-if="item.tip == 'slot-zhengce'">
<div class="g_flex_1 g_c_3 g_text_r g_fs_16">{{ item.value }}</div>
</div>
<div class="g_flex_rowRight_columnCenter g_w_all" @click="uploadZhengce" v-if="item.tip == 'slot-zhengce'">
<div class="g_flex_1 g_c_3 g_text_r g_fs_16">{{ item.value }}</div>
</div>
<!-- 部门选择框 -->
<div class="form-new-choose g_flex_rowRight_columnCenter g_w_all" v-if="item.tip == 'slot-agencyTeam'">
<div class="g_flex_1 g_ell_1 g_text_r g_fs_16" :class="item.value ? 'g_c_3' : 'g_c_9'" @click="openDeptPicker(item)">{{ item.value || item.placeholder }}</div>
<i class="iconfont icon-gengduo11 g_c_c g_ml_4" @click="openDeptPicker(item)"></i>
</div>
<!-- 角色选择框 -->
<div class="form-new-choose g_flex_rowRight_columnCenter g_w_all" v-if="item.tip == 'slot-agencyRole'">
<div class="g_flex_1 g_ell_1 g_text_r g_fs_16" :class="item.value ? 'g_c_3' : 'g_c_9'" @click="openRolePicker(item)">{{ item.value || item.placeholder }}</div>
<i class="iconfont icon-gengduo11 g_c_c g_ml_4" @click="openRolePicker(item)"></i>
</div>
</div>
<!-- 右箭头 -->
<div class="form-new-right g_flex_column_center" v-if="item.type != 'slot'" @click.capture="item.path ? handleResult(item) : ''">
<i class="iconfont icon-gengduo11 g_c_c" style="margin-right: -4px"></i>
@ -245,6 +255,75 @@
</slot>
</g-panel-fixed>
</u-popup>
<u-popup v-model="deptModal.isShow" mode="bottom" border-radius="16" height="980" :mask-close-able="true" @close="deptModal.isShow = false">
<div class="dept-picker-wrap">
<div class="g_fs_18 g_c_3 g_flex_row_center g_pt_16 g_pb_16">选择部门</div>
<div class="dept-columns-scroll">
<div class="dept-columns g_flex_row_start">
<div class="dept-column" v-for="(column, colIndex) in deptColumns" :key="colIndex">
<div class="">
<div class="g_flex_row_between g_pt_16 g_pb_16" style="border-bottom: 1px solid #ddd;" v-for="(dept, deptIndex) in column" :key="dept.id" @click="handleDeptClick(dept, colIndex)">
<div class="g_ell_1 g_flex_1" :style="{ color: '#333', fontSize: '14px', flex: 1, marginRight: '8px',padding:'0 4px' }">
{{ dept.teamName }}
</div>
<div class="g_flex_column_center g_flex_none">
<i
class="iconfont icon-a-duigoubeifen2"
style="font-size: 24px"
:style="{
color: isDeptSelected(dept.id) ? '#6A81FF' : '#fff',
}"
></i>
</div>
</div>
</div>
</div>
</div>
</div>
<g-panel-fixed>
<slot>
<div class="g_flex_row_center">
<rh-button btnText="确定" type="primary" @clickBtn="submitDept" />
</div>
</slot>
</g-panel-fixed>
</div>
</u-popup>
<!-- 角色选择弹窗 -->
<u-popup v-model="roleModal.isShow" mode="bottom" border-radius="16" height="980" :mask-close-able="true" @close="roleModal.isShow = false">
<div class="dept-picker-wrap">
<div class="g_fs_18 g_c_3 g_flex_row_center g_pt_16 g_pb_16">选择角色</div>
<div class="dept-columns-scroll">
<div class="dept-columns g_flex_row_start">
<div class="dept-column" style="width: 100%; min-width: 100%; max-width: 100%; border-right: none;">
<div class="">
<div class="g_flex_row_between g_pt_16 g_pb_16" style="border-bottom: 1px solid #ddd;" v-for="(role, roleIndex) in roleList" :key="role.id" @click="handleRoleClick(role)">
<div class="g_ell_1 g_flex_1" :style="{ color: '#333', fontSize: '17px', flex: 1, marginRight: '8px', padding: '0 0 0 10px' }">
{{ role.roleName }}
</div>
<div class="g_flex_column_center g_flex_none" style="margin-right: 10px;">
<i
class="iconfont icon-a-duigoubeifen2"
style="font-size: 24px"
:style="{
color: isRoleSelected(role.id) ? '#6A81FF' : '#fff',
}"
></i>
</div>
</div>
</div>
</div>
</div>
</div>
<g-panel-fixed>
<slot>
<div class="g_flex_row_center">
<rh-button btnText="确定" type="primary" @clickBtn="submitRole" />
</div>
</slot>
</g-panel-fixed>
</div>
</u-popup>
</div>
</template>
@ -288,6 +367,20 @@ export default {
},
zhengceList: [],
chooseImg: { chooseImgShow: false, type: "" }, //
deptModal: {
isShow: false,
},
deptColumns: [], // [[{id,teamName,childs}], [...]]
selectedDeptIds: [], // id
selectedDeptNames: [], //
currentDeptItem: null, //
roleModal: {
isShow: false,
},
roleList: [], //
selectedRoleIds: [], // id
selectedRoleNames: [], //
currentRoleItem: null, //
};
},
props: {
@ -307,6 +400,18 @@ export default {
type: Number,
default: 0,
},
deptList: {
type: Array,
default: () => {
return [];
},
},
roleList: {
type: Array,
default: () => {
return [];
},
},
},
created() {
this.localBaseImg = this.G.store().localBaseImg;
@ -353,6 +458,8 @@ export default {
}
if ($item.tip == "slot-weChat") {
this.$emit("changeWeChat", e, $item);
} else if ($item.tip == "slot-title") {
this.$emit("changeTitle", e, $item);
} else {
this.$emit("changeName", e, $item);
}
@ -697,12 +804,108 @@ export default {
handleResult(e) {
this.$emit("clickResult", e);
},
//
isDeptSelected(id) {
return this.selectedDeptIds.indexOf(id) > -1;
},
//
openDeptPicker(item) {
this.currentDeptItem = item;
//
this.deptColumns = this.buildAllDeptColumns(this.deptList || []);
if (item.deptIds && item.deptIds.length) {
this.selectedDeptIds = [].concat(item.deptIds);
this.selectedDeptNames = [].concat(item.deptNames || []);
} else {
this.selectedDeptIds = [];
this.selectedDeptNames = [];
}
this.deptModal.isShow = true;
},
//
buildAllDeptColumns(list) {
if (!list || list.length === 0) return [];
let columns = [list];
//
let nextColumn = [];
list.forEach(item => {
if (item.childs && item.childs.length > 0) {
nextColumn = nextColumn.concat(item.childs);
}
});
if (nextColumn.length > 0) {
columns = columns.concat(this.buildAllDeptColumns(nextColumn));
}
return columns;
},
// +
handleDeptClick(dept, colIndex) {
let idx = this.selectedDeptIds.indexOf(dept.id);
if (idx > -1) {
this.selectedDeptIds.splice(idx, 1);
this.selectedDeptNames.splice(idx, 1);
} else {
this.selectedDeptIds.push(dept.id);
this.selectedDeptNames.push(dept.teamName);
}
},
//
submitDept() {
let ids = this.selectedDeptIds.join(",");
let names = this.selectedDeptNames.join("");
this.deptModal.isShow = false;
this.$emit("changeAgencyTeam", {
ids: ids,
names: names,
idList: [].concat(this.selectedDeptIds),
nameList: [].concat(this.selectedDeptNames),
});
},
handleMobile(e, $item, $index) {
this.$emit("changeMobile", e, $item);
},
handleMianshi(e, $item, $index) {
this.$emit("changeTime", e);
},
//
isRoleSelected(id) {
return this.selectedRoleIds.indexOf(id) > -1;
},
//
openRolePicker(item) {
this.currentRoleItem = item;
if (item.roleIds && item.roleIds.length) {
this.selectedRoleIds = [].concat(item.roleIds);
this.selectedRoleNames = [].concat(item.roleNames || []);
} else {
this.selectedRoleIds = [];
this.selectedRoleNames = [];
}
this.roleModal.isShow = true;
},
//
handleRoleClick(role) {
let idx = this.selectedRoleIds.indexOf(role.id);
if (idx > -1) {
this.selectedRoleIds.splice(idx, 1);
this.selectedRoleNames.splice(idx, 1);
} else {
this.selectedRoleIds.push(role.id);
this.selectedRoleNames.push(role.roleName);
}
},
//
submitRole() {
let ids = this.selectedRoleIds.join(",");
let names = this.selectedRoleNames.join("");
this.roleModal.isShow = false;
this.$emit("changeAgencyRole", {
ids: ids,
names: names,
idList: [].concat(this.selectedRoleIds),
nameList: [].concat(this.selectedRoleNames),
});
},
},
};
</script>
@ -778,4 +981,39 @@ export default {
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
.dept-picker-wrap {
background-color: #fff;
height: 980rpx;
display: flex;
flex-direction: column;
}
.dept-columns-scroll {
white-space: nowrap;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
flex: 1;
width: 100%;
padding-bottom: calc(constant(safe-area-inset-bottom) + 80rpx);
padding-bottom: calc(env(safe-area-inset-bottom) + 80rpx);
}
.dept-columns {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
height: 100%;
width: max-content;
min-width: 100%;
}
.dept-column {
width: 30vw;
min-width: 30vw;
max-width: 30vw;
height: 100%;
border-right: 1px solid #ddd;
box-sizing: border-box;
flex-shrink: 0;
flex-grow: 0;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
</style>

@ -2,6 +2,7 @@
<div class="team-manage-container g_bg_page">
<div class="g_h_10"></div>
<g-panel-form-slot
:deptList="deptList"
:list="[
{
icon: '',
@ -28,9 +29,53 @@
require: true,
disabled: memberInfo.agencyRoleName && memberInfo.agencyRoleName.indexOf('创建人') > -1,
},
{
icon: '',
label: '角色',
result: '',
value: memberInfo.agencyRoleName,
roleIds: memberInfo.agencyRoleIdList,
roleNames: memberInfo.agencyRoleNameList,
path: '',
placeholder: '请选择角色',
tip: 'slot-agencyRole',
type: 'slot',
pColumn: 15,
require: true,
},
{
icon: '',
label: '部门',
result: '',
value: memberInfo.agencyTeamName,
deptIds: memberInfo.agencyTeamIdList,
deptNames: memberInfo.agencyTeamNameList,
path: '',
placeholder: '请选择部门',
tip: 'slot-agencyTeam',
type: 'slot',
pColumn: 15,
require: false,
},
{
icon: '',
label: '职位',
result: '',
value: memberInfo.title,
path: '',
placeholder: '请输入职位',
tip: 'slot-title',
type: 'slot',
pColumn: 8,
require: false,
},
]"
:roleList="roleList"
@changeName="changeName"
@changeMobile="changeMobile"
@changeTitle="changeTitle"
@changeAgencyTeam="changeAgencyTeam"
@changeAgencyRole="changeAgencyRole"
></g-panel-form-slot>
<div class="g_text_c g_mt_90">
<rh-button btnText="确定" type="primary" class="" @clickBtn="subMemberInfo"></rh-button>
@ -44,6 +89,8 @@ export default {
data() {
return {
memberInfo: {},
deptList: [],
roleList: [],
};
},
onShow() {},
@ -53,6 +100,7 @@ export default {
if (options.info) {
console.log("options.info", options.info);
this.memberInfo = JSON.parse(options.info);
this.initMemberDept();
uni.setNavigationBarTitle({
title: "修改成员信息",
});
@ -61,12 +109,49 @@ export default {
title: "添加成员",
});
}
this.getDeptList();
this.getRoleList();
},
created() {
console.log(123123);
},
methods: {
getDeptList() {
let that = this;
this.G.Post('/yishoudan/agency/team/list', {}, (res) => {
that.deptList = res.list || [];
});
},
initMemberDept() {
let info = this.memberInfo;
if (info.agencyTeamIds) {
info.agencyTeamIdList = info.agencyTeamIds.split(",").map((id) => Number(id));
} else {
info.agencyTeamIdList = [];
}
if (info.agencyTeamName) {
info.agencyTeamNameList = info.agencyTeamName.split("");
} else {
info.agencyTeamNameList = [];
}
if (info.agencyRoleIds) {
info.agencyRoleIdList = info.agencyRoleIds.split(",").map((id) => Number(id));
} else {
info.agencyRoleIdList = [];
}
if (info.agencyRoleName) {
info.agencyRoleNameList = info.agencyRoleName.split("");
} else {
info.agencyRoleNameList = [];
}
},
getRoleList() {
let that = this;
this.G.Get('/yishoudan/agency/role/list', {}, (res) => {
that.roleList = res.list || [];
});
},
getMemberList() {
let that = this;
this.G.Get(this.api.order_peopleList, {}, (res) => {
@ -103,6 +188,13 @@ export default {
});
return false;
}
if (!this.memberInfo.agencyRoleIds) {
uni.showToast({
title: "请选择角色",
icon: "none",
});
return false;
}
let url = "order_addMember";
if (this.memberInfo.id) {
//
@ -175,6 +267,24 @@ export default {
console.log("e", e);
this.memberInfo.tel = e;
},
changeTitle(e) {
console.log("e", e);
this.memberInfo.title = e;
},
changeAgencyTeam(res) {
console.log("res", res);
this.memberInfo.agencyTeamIds = res.ids;
this.memberInfo.agencyTeamName = res.names;
this.memberInfo.agencyTeamIdList = res.idList;
this.memberInfo.agencyTeamNameList = res.nameList;
},
changeAgencyRole(res) {
console.log("roleRes", res);
this.memberInfo.agencyRoleIds = res.ids;
this.memberInfo.agencyRoleName = res.names;
this.memberInfo.agencyRoleIdList = res.idList;
this.memberInfo.agencyRoleNameList = res.nameList;
},
},
};
</script>

Loading…
Cancel
Save