...
|
...
|
@@ -12,6 +12,8 @@ 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);
|
|
|
//变更人员列表是否多选
|
...
|
...
|
@@ -110,22 +112,17 @@ export default { |
|
|
let resourceData = Vue.ref([]);
|
|
|
//获取列表数据
|
|
|
const getListData = () => {
|
|
|
let username=proxy.$route.query.username;
|
|
|
let resTypeName=proxy.$route.query.resTypeName;
|
|
|
//定义列表参数
|
|
|
let getParams = {
|
|
|
resType:search.value.resType,
|
|
|
keyword:search.value.keyword,
|
|
|
resTypeName: resTypeName,
|
|
|
userAccount: username,
|
|
|
// page: search.value.page,
|
|
|
// limit: search.value.limit
|
|
|
keywords:search.value.keyword,
|
|
|
userName: userName.value,
|
|
|
page: search.value.page,
|
|
|
limit: search.value.limit
|
|
|
};
|
|
|
proxy.$http.get("/api-web/manage/restype/listAll", getParams, function (res) {
|
|
|
proxy.$http.post("/api-web/personnelChange/getList/resourceTypePer", getParams, function (res) {
|
|
|
if (res && res.data) {
|
|
|
resourceData.value = handleTree(res.data, 'resTypeCode', 'parentId')
|
|
|
|
|
|
console.log("(()",resourceData.value)
|
|
|
count.value = res.count;
|
|
|
loading.value = false;
|
|
|
}else{
|
...
|
...
|
@@ -183,16 +180,16 @@ export default { |
|
|
search.value.limit=limit;
|
|
|
getListData();
|
|
|
}
|
|
|
let resIds=Vue.ref('');//选中的ids
|
|
|
let resType=Vue.ref('');//选中的ids
|
|
|
//表格全选事件
|
|
|
let selectionChange = (val) => {
|
|
|
pitch.value = val;
|
|
|
let arr=[];
|
|
|
pitch.value.map(item=>{
|
|
|
arr.push(item.resId)
|
|
|
arr.push(item.resType)
|
|
|
})
|
|
|
resIds.value=arr.join(",");//选中的值
|
|
|
proxy.resourceData.map((v, i) => {
|
|
|
resType.value=arr.join(",");//选中的值
|
|
|
/*proxy.resourceData.map((v, i) => {
|
|
|
v.checked = false;
|
|
|
});
|
|
|
let selectData = val;
|
...
|
...
|
@@ -208,7 +205,11 @@ export default { |
|
|
proxy.resourceData.map((v, i) => {
|
|
|
v.checked = false;
|
|
|
})
|
|
|
}
|
|
|
}*/
|
|
|
}
|
|
|
//勾选数据行的checked
|
|
|
let handleSelect=(selection)=>{
|
|
|
console.log("selection",selection)
|
|
|
}
|
|
|
//获取资源类型数据
|
|
|
let getResourceTypoe=()=>{
|
...
|
...
|
@@ -258,13 +259,16 @@ export default { |
|
|
proxy.$global.showMsg('请至少选择一项','warning');
|
|
|
}else{
|
|
|
proxy.$global.confirm("确定取消负责的相关资源?", function () {
|
|
|
proxy.$global.showMsg('取消成功!');
|
|
|
// proxy.$http.get(`/api-web/`, {resIds:resIds.value}, function (res) {
|
|
|
// if (res && res.data) {
|
|
|
// proxy.$global.showMsg('取消成功!');
|
|
|
// getListData()
|
|
|
// }
|
|
|
// })
|
|
|
let parmas={
|
|
|
userName:userName.value,
|
|
|
resType:resType.value
|
|
|
}
|
|
|
proxy.$http.post(`/api-web/personnelChange/remove/resourceTypePer`, parmas, function (res) {
|
|
|
if (res && res.success) {
|
|
|
proxy.$global.showMsg('取消成功!');
|
|
|
getListData()
|
|
|
}
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -281,22 +285,26 @@ export default { |
|
|
//变更人员的弹框关闭后
|
|
|
let hideDialog =(flag)=>{
|
|
|
show.value=flag;
|
|
|
// getListData();
|
|
|
}
|
|
|
//变更人员的弹框保存后
|
|
|
let savebtn =(obj)=>{
|
|
|
show.value=false;
|
|
|
//obj.selectModel 选中的用户组(一个/主负责人) obj.selectModelSecond 辅负责人,都是数组
|
|
|
let targetUserName='';
|
|
|
if(obj.selectModel){
|
|
|
targetUserName=obj.selectModel.join(',')
|
|
|
}
|
|
|
let params={
|
|
|
resIds:resIds.value,
|
|
|
selectModel:obj.selectModel,
|
|
|
resType:resType.value,
|
|
|
targetUserName:targetUserName,
|
|
|
userName:userName.value,
|
|
|
}
|
|
|
// proxy.$http.get(`/api-web/`, {}, function (res) {
|
|
|
// if (res && res.data) {
|
|
|
// proxy.$global.showMsg('变更成功!');
|
|
|
// getListData()
|
|
|
// }
|
|
|
// })
|
|
|
proxy.$http.post(`/api-web/personnelChange/update/resourceTypePer`, params, function (res) {
|
|
|
if (res && res.success) {
|
|
|
proxy.$global.showMsg('变更成功!');
|
|
|
getListData()
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
// 挂载完
|
|
|
Vue.onMounted(() => {
|
...
|
...
|
@@ -331,7 +339,7 @@ export default { |
|
|
|
|
|
getListData,
|
|
|
loadTableDataList,
|
|
|
|
|
|
handleSelect
|
|
|
}
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|