no message

cyl/job_im_cus
jscyl13849007907 6 days ago
parent 14b7d29634
commit 61adb172d7

@ -73,8 +73,8 @@
<view class="g_text_c g_bg_f_5 g_fs_17">
<view class="g_bg_f">
<view class="g_c_3">
<view class="g_p_16 g_border_e_t" @click="onOperate('editName')"></view>
<view class="g_p_16 g_border_e_t" @click="onOperate('delete')"></view>
<view class="g_p_16 g_border_e_t" @click="onOperate('editName')"></view>
<view class="g_p_16 g_border_e_t" @click="onOperate('delete')"></view>
</view>
</view>
<view class="g_p_16 g_mt_10 g_bg_f" style="padding-bottom: calc(constant(safe-area-inset-bottom) + 16px); padding-bottom: calc(env(safe-area-inset-bottom) + 16px)" @click="operateShow = false">取消</view>
@ -84,7 +84,7 @@
<u-modal v-model="editNameShow" width="90%" negativeTop="150" :showTitle="false" :showConfirmButton="false" :maskCloseAble="true">
<div class="g_fs_17 g_text_c">
<div style="padding: 32px 24px">
<div class="g_text_c g_fw_600 g_c_0 g_mb_16">修改名称</div>
<div class="g_text_c g_fw_600 g_c_0 g_mb_16">修改当前部门名称</div>
<div class="">
<u-input v-model="editNameValue"
:customStyle="{
@ -125,11 +125,41 @@
</div>
</u-modal>
<u-modal v-model="addTeamShow" width="90%" negativeTop="150" :showTitle="false" :showConfirmButton="false" :maskCloseAble="true">
<div class="g_fs_17 g_text_c">
<div style="padding: 32px 24px">
<div class="g_text_c g_fw_600 g_c_0 g_mb_16">添加子部门</div>
<div class="">
<u-input v-model="teamName"
:customStyle="{
fontSize: '17px',
borderRadius: '4px',
backgroundColor: '#fff',
}"
height="80"
border
border-color="#dddddd"
placeholder="请输入子部门名称"
placeholder-style="color:#999;font-size: 17px;"
/>
</div>
</div>
<div class="g_flex_row_center flex_center g_fw_600 g_border_e_t">
<div class="g_flex_1 g_text_c g_border_e_r" hover-class="thover" @click="addTeamShow = false" style="height: 56px;line-height: 56px;font-size: 17px;color: #333;">取消</div>
<div class="g_flex_1 g_text_c g_c_sub" hover-class="thover" @click="submitAddTeam" style="height: 56px;line-height: 56px;font-size: 17px;color: #576b95;">
<u-loading mode="circle" size="16" v-if="addTeamLoading"></u-loading>
<span v-else></span>
</div>
</div>
</div>
</u-modal>
<div style="height: 40px;"></div>
<g-panel-fixed>
<slot>
<div class="g_flex_row_between" style="padding: 0 10px;">
<div style="font-size: 17px;color: rgba(2, 122, 255, 1);" @click="addMemberShow = true">添加成员</div>
<div v-if="!hideAddTeam" style="font-size: 17px;color: rgba(2, 122, 255, 1);" @click="addTeamShow = true"></div>
<div style="font-size: 17px;color: rgba(2, 122, 255, 1);" @click="operateShow = true">操作</div>
<div style="font-size: 17px;color: rgba(2, 122, 255, 1);" @click="goPage('/root/person/info?active=1')"></div>
</div>
@ -154,6 +184,10 @@ export default {
editNameValue: "",
deleteShow: false,
deleteLoading: false,
addTeamShow: false,
addTeamLoading: false,
teamName: "",
hideAddTeam: false,
agencyInfo: uni.getStorageSync("agencyInfo"),
};
},
@ -200,6 +234,7 @@ export default {
that.G.Post('/yishoudan/agency/team/list', {}, (teamRes) => {
let currentChild = that.findChildById(teamRes.list, that.currentId);
that.teamList = currentChild ? (currentChild.childs || []) : [];
that.hideAddTeam = currentChild && currentChild.levels > 4;
that.G.Get(that.api.order_peopleList, {
pageSize: 500,
@ -274,7 +309,7 @@ export default {
submitDelete() {
if (this.deleteLoading) return;
this.deleteLoading = true;
this.G.Get(`/yishoudan/agency/team/del/${this.currentId}`, {}, (res) => {
this.G.Post(`/yishoudan/agency/team/del/${this.currentId}`, {}, (res) => {
this.deleteLoading = false;
uni.showToast({
title: "删除成功",
@ -285,6 +320,32 @@ export default {
this.deleteLoading = false;
});
},
submitAddTeam() {
if (!this.teamName || !this.teamName.trim()) {
uni.showToast({
title: "请输入子部门名称",
icon: "none",
});
return;
}
if (this.addTeamLoading) return;
this.addTeamLoading = true;
this.G.Post("/yishoudan/agency/team/add", {
teamName: this.teamName.trim(),
parentId: this.currentId,
}, (res) => {
this.addTeamLoading = false;
uni.showToast({
title: "添加成功",
icon: "success",
});
this.addTeamShow = false;
this.teamName = "";
this.getList();
}, (err) => {
this.addTeamLoading = false;
});
},
findChildById(list, id) {
for (let item of list) {
if (String(item.id) === String(id)) {

Loading…
Cancel
Save