|
|
export default {
|
|
|
name: 'resourceTypePer',
|
|
|
name: 'bizLeader',
|
|
|
template: '',
|
|
|
components: {
|
|
|
|
|
|
'ChangeUsersList': Vue.defineAsyncComponent(
|
|
|
() => myImport('views/batchChangeLeaders/changeUsersList/index')
|
|
|
),
|
|
|
},
|
|
|
data() {
|
|
|
},
|
...
|
...
|
@@ -10,12 +12,268 @@ export default { |
|
|
},
|
|
|
setup: function (props, {attrs, slots, emit}) {
|
|
|
const {proxy} = Vue.getCurrentInstance();
|
|
|
//接收从用户列表中选中的用户
|
|
|
let userName=Vue.ref(proxy.$route.query.username);
|
|
|
//变更人员弹框
|
|
|
let show=Vue.ref(false);
|
|
|
//变更人员列表是否多选
|
|
|
let isMulti=Vue.ref(false);
|
|
|
//变更人员列表是否是两组
|
|
|
let isTwoGroup=Vue.ref(false);
|
|
|
//配置列表总数
|
|
|
let count = Vue.ref(0);
|
|
|
//列表高度
|
|
|
let height = Vue.ref(window.innerHeight);
|
|
|
//列表分页
|
|
|
let limit = Vue.ref(400);
|
|
|
//加载
|
|
|
let loading = Vue.ref(true);
|
|
|
//选中数据
|
|
|
let pitch = Vue.ref([]);
|
|
|
let showTypeList=Vue.ref([]);
|
|
|
let search = Vue.ref({
|
|
|
resType: '',
|
|
|
keyword: '',
|
|
|
page: 1,
|
|
|
limit: 20,
|
|
|
});
|
|
|
let resTypeOptions=Vue.ref([])
|
|
|
const columns = [
|
|
|
{
|
|
|
prop: 'busTypeName',
|
|
|
label: '业务类型名称',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
prop: 'admin',
|
|
|
label: '负责人',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
prop: 'busTypeDesc',
|
|
|
label: '业务类型描述',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
prop: 'isUse',
|
|
|
label: '是否使用',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
render: function (row) {
|
|
|
switch (row.isUse) {
|
|
|
case 0:
|
|
|
return '否';
|
|
|
case 1:
|
|
|
return '是';
|
|
|
default:
|
|
|
return '';
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
prop: 'important',
|
|
|
label: '重要程度',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
render: function (row) {
|
|
|
switch (row.important) {
|
|
|
case 1:
|
|
|
return '核心';
|
|
|
case 2:
|
|
|
return '重要';
|
|
|
case 3:
|
|
|
return '一般';
|
|
|
case 9:
|
|
|
return '虚拟业务';
|
|
|
default:
|
|
|
return '';
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
prop: 'sort',
|
|
|
label: '排序',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
prop: 'showType',
|
|
|
label: '展示类型',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
/* render: function (row) {
|
|
|
|
|
|
}*/
|
|
|
}
|
|
|
];
|
|
|
|
|
|
//列表数据
|
|
|
let resourceData = Vue.ref([]);
|
|
|
//获取列表数据
|
|
|
const getListData = () => {
|
|
|
resourceData.value=[];
|
|
|
loading.value = true;
|
|
|
//定义列表参数
|
|
|
let getParams = {
|
|
|
resType:search.value.resType,
|
|
|
keywords:search.value.keyword,
|
|
|
userName:userName.value,
|
|
|
page: search.value.page,
|
|
|
limit: search.value.limit
|
|
|
};
|
|
|
proxy.$http.post("/api-web/personnelChange/getList/bizLeader", getParams, function (res) {
|
|
|
if (res && res.data) {
|
|
|
resourceData.value = res.data ? res.data : [];
|
|
|
count.value = res.count;
|
|
|
loading.value = false;
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
//重新加载表格数据
|
|
|
let loadTableDataList = ({page, limit}) => {
|
|
|
search.value.page=page;
|
|
|
search.value.limit=limit;
|
|
|
getListData();
|
|
|
}
|
|
|
let busIds=Vue.ref('');//选中的ids
|
|
|
//表格全选事件
|
|
|
let selectionChange = (val) => {
|
|
|
pitch.value = val;
|
|
|
let arr=[];
|
|
|
pitch.value.map(item=>{
|
|
|
arr.push(item.busId)
|
|
|
})
|
|
|
busIds.value=arr.join(",");//选中的值
|
|
|
/*proxy.resourceData.map((v, i) => {
|
|
|
v.checked = false;
|
|
|
});
|
|
|
let selectData = val;
|
|
|
if (selectData.length > 0) {
|
|
|
selectData.map((item, index) => {
|
|
|
proxy.resourceData.map((v, i) => {
|
|
|
if (item.id == v.id) {
|
|
|
v.checked = true;
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
} else {
|
|
|
proxy.resourceData.map((v, i) => {
|
|
|
v.checked = false;
|
|
|
})
|
|
|
}*/
|
|
|
}
|
|
|
//获取资源类型数据
|
|
|
let getResourceTypoe=()=>{
|
|
|
proxy.$http.get(`/api-web/manage/restype/list`, {}, function (res) {
|
|
|
if (res && res.data) {
|
|
|
resTypeOptions.value=res.data
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
//获取展示类型的字典数据
|
|
|
let initShowType=()=>{
|
|
|
proxy.$http.post("/api-web/manage/ddic/findSucDdics/DETAILS_POWER", {}, function (res) {
|
|
|
if (res && res.data) {
|
|
|
let arr=res.data;
|
|
|
if(arr && arr.length>0){
|
|
|
arr.map(v=>{
|
|
|
showTypeList.value.push({
|
|
|
name: v.ddicName
|
|
|
,value: v.ddicCode.substring(v.ddicCode.lastIndexOf("_")+1,v.ddicCode.length)
|
|
|
});
|
|
|
})
|
|
|
}
|
|
|
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
//批量取消相关资源
|
|
|
let changeCancel = () => {
|
|
|
if(pitch.value.length<1){
|
|
|
proxy.$global.showMsg('请至少选择一项','warning');
|
|
|
}else{
|
|
|
proxy.$global.confirm("确定取消相关资源?", function () {
|
|
|
let parmas={
|
|
|
userName:userName.value,
|
|
|
busId:busIds.value
|
|
|
}
|
|
|
proxy.$http.post(`/api-web/personnelChange/remove/bizLeader`, parmas, function (res) {
|
|
|
if (res && res.success) {
|
|
|
proxy.$global.showMsg('取消成功!');
|
|
|
getListData()
|
|
|
}
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
//变更负责人
|
|
|
let changeAdmin = () => {
|
|
|
if(pitch.value.length<1){
|
|
|
proxy.$global.showMsg('请至少选择一项','warning');
|
|
|
|
|
|
}else{
|
|
|
show.value=true;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
//变更人员的弹框关闭后
|
|
|
let hideDialog =(flag)=>{
|
|
|
show.value=flag;
|
|
|
}
|
|
|
//变更人员的弹框保存后
|
|
|
let savebtn =(obj)=>{
|
|
|
show.value=false;
|
|
|
//obj.selectModel 选中的用户组(一个/主负责人) obj.selectModelSecond 辅负责人,都是数组
|
|
|
let targetUserName='';
|
|
|
if(obj.selectModel){
|
|
|
targetUserName=obj.selectModel.join(',')
|
|
|
}
|
|
|
let params={
|
|
|
busId:busIds.value,
|
|
|
targetUserName:targetUserName,
|
|
|
userName:userName.value,
|
|
|
}
|
|
|
proxy.$http.post(`/api-web/personnelChange/update/bizLeader`, params, function (res) {
|
|
|
if (res && res.success) {
|
|
|
proxy.$global.showMsg('变更成功!');
|
|
|
getListData()
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
// 挂载完
|
|
|
Vue.onMounted(() => {
|
|
|
initShowType();
|
|
|
getResourceTypoe();
|
|
|
getListData();
|
|
|
})
|
|
|
return {
|
|
|
isMulti,
|
|
|
isTwoGroup,
|
|
|
show,
|
|
|
initShowType,
|
|
|
showTypeList,
|
|
|
search,
|
|
|
resTypeOptions,
|
|
|
changeCancel,
|
|
|
count,
|
|
|
hideDialog,
|
|
|
savebtn,
|
|
|
changeAdmin,
|
|
|
getResourceTypoe,
|
|
|
|
|
|
resourceData,
|
|
|
columns,
|
|
|
height,
|
|
|
loading,
|
|
|
|
|
|
selectionChange,
|
|
|
|
|
|
getListData,
|
|
|
loadTableDataList,
|
|
|
userName
|
|
|
}
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|