mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-19 07:46:46 +08:00
讲师管理
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {defineProps, defineExpose, ref, computed, onMounted, defineEmits, nextTick} from "vue";
|
import {defineProps, defineExpose, ref, computed, onMounted, defineEmits, nextTick,watch} from "vue";
|
||||||
import {usePage, useRequest, useRowsPageNoInit} from "@/api/request";
|
import {usePage, useRequest, useRowsPageNoInit} from "@/api/request";
|
||||||
import {useResetRef} from "@/utils/useCommon";
|
import {useResetRef} from "@/utils/useCommon";
|
||||||
|
|
||||||
@@ -65,7 +65,11 @@
|
|||||||
showSizeChanger:{
|
showSizeChanger:{
|
||||||
type:Boolean,
|
type:Boolean,
|
||||||
default:false
|
default:false
|
||||||
}
|
},
|
||||||
|
selectedRowKeys:{
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const emit = defineEmits(["update:params", "update:selectedRowKeys", "update:selectedRows"]);
|
const emit = defineEmits(["update:params", "update:selectedRowKeys", "update:selectedRows"]);
|
||||||
const rowSelectKeys = ref([]);
|
const rowSelectKeys = ref([]);
|
||||||
@@ -74,7 +78,11 @@
|
|||||||
const postParam = computed(() => ({ ...params.value, ...props.params }));
|
const postParam = computed(() => ({ ...params.value, ...props.params }));
|
||||||
|
|
||||||
const { data, loading, total, fetch: onFetch } = props.request(props.url, postParam);
|
const { data, loading, total, fetch: onFetch } = props.request(props.url, postParam);
|
||||||
|
watch(()=>data.value,(val)=>{
|
||||||
|
if(val&&props.selectedRowKeys){
|
||||||
|
rowSelectKeys.value = props.selectedRowKeys
|
||||||
|
}
|
||||||
|
})
|
||||||
const rowSelection = computed(() => (props.type ? {
|
const rowSelection = computed(() => (props.type ? {
|
||||||
type: props.type,
|
type: props.type,
|
||||||
columnWidth: 20,
|
columnWidth: 20,
|
||||||
@@ -160,6 +168,7 @@
|
|||||||
|
|
||||||
const fetch = () => nextTick(onFetch);
|
const fetch = () => nextTick(onFetch);
|
||||||
|
|
||||||
|
|
||||||
defineExpose({ fetch, reset, resetSelected, clear, toLoading, remove , params });
|
defineExpose({ fetch, reset, resetSelected, clear, toLoading, remove , params });
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -101,7 +101,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a-drawer>
|
</a-drawer>
|
||||||
<a-button @click="openDrawer" type="link">
|
<a-button @click="openDrawer" type="link" style="width:100%">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</a-button>
|
</a-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -149,16 +149,16 @@ watch(stuSelectRows,(val)=>{
|
|||||||
teaunm.value = []
|
teaunm.value = []
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log(stuSelectRowKeys.value,'xixixixi')
|
|
||||||
teaunm.value = val.map((res,index)=>{
|
teaunm.value = val.map((res,index)=>{
|
||||||
return {
|
return {
|
||||||
userName:res.realName,
|
userName:res.realName,
|
||||||
userNo:res.userNo,
|
userNo:res.userNo,
|
||||||
type: props.type,
|
type: props.type,
|
||||||
userId: res.id,
|
userId: res.id,
|
||||||
|
label: res.realName + res.userNo,
|
||||||
|
...res
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(teaunm.value);
|
|
||||||
},{deep:true})
|
},{deep:true})
|
||||||
const person = ref(false);
|
const person = ref(false);
|
||||||
const visiable = ref(false);
|
const visiable = ref(false);
|
||||||
@@ -238,6 +238,8 @@ function onLoadData(treeNode) {
|
|||||||
|
|
||||||
const openDrawer = () => {
|
const openDrawer = () => {
|
||||||
visiable.value = true;
|
visiable.value = true;
|
||||||
|
stuSelectRows.value = props.arrayList
|
||||||
|
stuSelectRowKeys.value = props.arrayList.map(item=>item.userId)
|
||||||
};
|
};
|
||||||
|
|
||||||
function onSearchStu() {
|
function onSearchStu() {
|
||||||
|
|||||||
@@ -37,11 +37,11 @@
|
|||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
<div class="tableBox ">
|
<div class="tableBox ">
|
||||||
<div style="float: right;">
|
<div class="pa">
|
||||||
|
|
||||||
<a-pagination
|
<a-pagination
|
||||||
v-if="tableDataTotal > 10"
|
v-if="tableDataTotal > 10"
|
||||||
:showSizeChanger="false"
|
:showSizeChanger="true"
|
||||||
:showQuickJumper="true"
|
:showQuickJumper="true"
|
||||||
:hideOnSinglePage="true"
|
:hideOnSinglePage="true"
|
||||||
:pageSize="searchParam.pageSize"
|
:pageSize="searchParam.pageSize"
|
||||||
@@ -122,7 +122,7 @@
|
|||||||
:options="PlaceOfPayList" allowClear showSearch/> -->
|
:options="PlaceOfPayList" allowClear showSearch/> -->
|
||||||
<!-- <ProjectManager :type="0" v-model:value="formParam.actValue" :placeholder="'请选择担当'" v-model:arrayList="formParam.actArray" ></ProjectManager> -->
|
<!-- <ProjectManager :type="0" v-model:value="formParam.actValue" :placeholder="'请选择担当'" v-model:arrayList="formParam.actArray" ></ProjectManager> -->
|
||||||
<AddApprover v-model:arrayList="formParam.actArray" @valueChange="valueChange" :type="0">
|
<AddApprover v-model:arrayList="formParam.actArray" @valueChange="valueChange" :type="0">
|
||||||
<a-select v-model:value="formParam.actValue" :open="false" :placeholder="'请选择担当'"></a-select>
|
<a-select style="width:100%" v-model:value="formParam.actValue" :open="false" :placeholder="'请选择担当'"></a-select>
|
||||||
</AddApprover>
|
</AddApprover>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
@@ -132,14 +132,20 @@
|
|||||||
<a-form-item label="一级审批人" name="leveOneValue">
|
<a-form-item label="一级审批人" name="leveOneValue">
|
||||||
<!-- <a-select v-model:value="formParam.yjspr" placeholder="请选择一级审批人"
|
<!-- <a-select v-model:value="formParam.yjspr" placeholder="请选择一级审批人"
|
||||||
:options="PlaceOfPayList" allowClear showSearch/> -->
|
:options="PlaceOfPayList" allowClear showSearch/> -->
|
||||||
<ProjectManager :type="1" v-model:value="formParam.leveOneValue" :placeholder="'请选择一级审批人'" v-model:arrayList="formParam.leveOneArray" ></ProjectManager>
|
<!-- <ProjectManager :type="1" v-model:value="formParam.leveOneValue" :placeholder="'请选择一级审批人'" v-model:arrayList="formParam.leveOneArray" ></ProjectManager> -->
|
||||||
|
<AddApprover v-model:arrayList="formParam.leveOneArray" @valueChange="valueChange" :type="1">
|
||||||
|
<a-select style="width:100%" v-model:value="formParam.leveOneValue" :open="false" :placeholder="'请选择一级审批人'"></a-select>
|
||||||
|
</AddApprover>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="二级审批人">
|
<a-form-item label="二级审批人">
|
||||||
<!-- <a-select v-model:value="formParam.zzfzr" placeholder="请选择二级审批人"
|
<!-- <a-select v-model:value="formParam.zzfzr" placeholder="请选择二级审批人"
|
||||||
:options="PlaceOfPayList" allowClear showSearch/> -->
|
:options="PlaceOfPayList" allowClear showSearch/> -->
|
||||||
<ProjectManager :type="1" :placeholder="'请选择二级审批人'" v-model:arrayList="formParam.leveTwoArray" ></ProjectManager>
|
<!-- <ProjectManager :type="1" :placeholder="'请选择二级审批人'" v-model:arrayList="formParam.leveTwoArray" ></ProjectManager> -->
|
||||||
|
<AddApprover v-model:arrayList="formParam.leveTwoArray" @valueChange="valueChange" :type="2">
|
||||||
|
<a-select style="width:100%" v-model:value="formParam.leveTwoValue" :open="false" :placeholder="'请选择二级审批人'"></a-select>
|
||||||
|
</AddApprover>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@@ -148,7 +154,10 @@
|
|||||||
<a-form-item label="三级审批人" >
|
<a-form-item label="三级审批人" >
|
||||||
<!-- <a-select v-model:value="formParam.sjspr" placeholder="请选择三级审批人"
|
<!-- <a-select v-model:value="formParam.sjspr" placeholder="请选择三级审批人"
|
||||||
:options="PlaceOfPayList" allowClear showSearch/> -->
|
:options="PlaceOfPayList" allowClear showSearch/> -->
|
||||||
<ProjectManager :type="1" :placeholder="'请选择三级审批人'" v-model:arrayList="formParam.leveThreeArray" ></ProjectManager>
|
<!-- <ProjectManager :type="1" :placeholder="'请选择三级审批人'" v-model:arrayList="formParam.leveThreeArray" ></ProjectManager> -->
|
||||||
|
<AddApprover v-model:arrayList="formParam.leveThreeArray" @valueChange="valueChange" :type="3">
|
||||||
|
<a-select style="width:100%" v-model:value="formParam.leveThreeValue" :open="false" :placeholder="'请选择三级审批人'"></a-select>
|
||||||
|
</AddApprover>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
@@ -227,6 +236,7 @@ export default{
|
|||||||
setup() {
|
setup() {
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
tableDataTotal: 0,
|
||||||
vf:true,
|
vf:true,
|
||||||
showContent: false,
|
showContent: false,
|
||||||
tableLoading:false,
|
tableLoading:false,
|
||||||
@@ -247,6 +257,8 @@ export default{
|
|||||||
actValue: null,
|
actValue: null,
|
||||||
actArray: [],
|
actArray: [],
|
||||||
leveOneValue: null,
|
leveOneValue: null,
|
||||||
|
leveTwoValue: null,
|
||||||
|
leveThreeValue: null,
|
||||||
leveOneArray: [],
|
leveOneArray: [],
|
||||||
leveTwoArray: [],
|
leveTwoArray: [],
|
||||||
leveThreeArray: [],
|
leveThreeArray: [],
|
||||||
@@ -397,6 +409,7 @@ const getTableDate = (obj) => {
|
|||||||
let objA = { ...state.searchParam };
|
let objA = { ...state.searchParam };
|
||||||
queryTrainOrg(objA)
|
queryTrainOrg(objA)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
console.log(res,'res')
|
||||||
tableData.value = res.data.data.records
|
tableData.value = res.data.data.records
|
||||||
state.tableDataTotal = Number(res.data.data.total);
|
state.tableDataTotal = Number(res.data.data.total);
|
||||||
state.tableLoading = false
|
state.tableLoading = false
|
||||||
@@ -487,6 +500,7 @@ const getTableDate = (obj) => {
|
|||||||
return {
|
return {
|
||||||
label: item.userName + item.userNo,
|
label: item.userName + item.userNo,
|
||||||
value: item.userId,
|
value: item.userId,
|
||||||
|
realName: item.userName,
|
||||||
...item
|
...item
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -495,6 +509,7 @@ const getTableDate = (obj) => {
|
|||||||
return {
|
return {
|
||||||
label: item.userName + item.userNo,
|
label: item.userName + item.userNo,
|
||||||
value: item.userId,
|
value: item.userId,
|
||||||
|
realName: item.userName,
|
||||||
...item
|
...item
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -503,16 +518,20 @@ const getTableDate = (obj) => {
|
|||||||
return {
|
return {
|
||||||
label: item.userName + item.userNo,
|
label: item.userName + item.userNo,
|
||||||
value: item.userId,
|
value: item.userId,
|
||||||
|
realName: item.userName,
|
||||||
...item
|
...item
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
state.formParam.leveTwoValue = state.formParam.leveTwoArray.map(item => item.label).join(',');
|
||||||
state.formParam.leveThreeArray = leveThreeArray.map(item => {
|
state.formParam.leveThreeArray = leveThreeArray.map(item => {
|
||||||
return {
|
return {
|
||||||
label: item.userName + item.userNo,
|
label: item.userName + item.userNo,
|
||||||
value: item.userId,
|
value: item.userId,
|
||||||
|
realName: item.userName,
|
||||||
...item
|
...item
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
state.formParam.leveThreeValue = state.formParam.leveThreeArray.map(item => item.label).join(',');
|
||||||
state.teacherdialog = true;
|
state.teacherdialog = true;
|
||||||
state.teacherdialogtitle = '修改归属组织'
|
state.teacherdialogtitle = '修改归属组织'
|
||||||
state.vf = false
|
state.vf = false
|
||||||
@@ -533,6 +552,8 @@ const getTableDate = (obj) => {
|
|||||||
actValue: null,
|
actValue: null,
|
||||||
actArray: [],
|
actArray: [],
|
||||||
leveOneValue: null,
|
leveOneValue: null,
|
||||||
|
leveTwoValue:null,
|
||||||
|
leveThreeValue:null,
|
||||||
leveOneArray: [],
|
leveOneArray: [],
|
||||||
leveTwoArray: [],
|
leveTwoArray: [],
|
||||||
leveThreeArray: [],
|
leveThreeArray: [],
|
||||||
@@ -553,6 +574,17 @@ const getTableDate = (obj) => {
|
|||||||
}
|
}
|
||||||
const valueChange = (val) => {
|
const valueChange = (val) => {
|
||||||
console.log(val,'vallll')
|
console.log(val,'vallll')
|
||||||
|
if(val.length>0){
|
||||||
|
if(val[0].type==0){
|
||||||
|
state.formParam.actValue = val.map(item=>item.label).join(',') || null
|
||||||
|
}else if(val[0].type==1){
|
||||||
|
state.formParam.leveOneValue = val.map(item=>item.label).join(',') || null
|
||||||
|
}else if(val[0].type==2){
|
||||||
|
state.formParam.leveTwoValue = val.map(item=>item.label).join(',') || null
|
||||||
|
}else if(val[0].type==3){
|
||||||
|
state.formParam.leveThreeValue = val.map(item=>item.label).join(',') || null
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//保存
|
//保存
|
||||||
const createTeacherDialog = async () => {
|
const createTeacherDialog = async () => {
|
||||||
@@ -635,7 +667,24 @@ const getTableDate = (obj) => {
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.tableBox {
|
||||||
|
padding-bottom: 20px;
|
||||||
|
margin: 20px 38px 30px;
|
||||||
|
::v-deep .ant-select-dropdown{
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
::v-deep .ant-select-selection-item{
|
||||||
|
margin-left: 3px;
|
||||||
|
}
|
||||||
|
::v-deep .ant-pagination-options-size-changer.ant-select{
|
||||||
|
width: 84px;
|
||||||
|
}
|
||||||
|
.pa {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
.add_content{
|
.add_content{
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
@@ -932,6 +981,7 @@ position: relative;
|
|||||||
border-radius:8px;
|
border-radius:8px;
|
||||||
height:40px;
|
height:40px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
|
text-align: left;
|
||||||
}
|
}
|
||||||
.ant-col-12{
|
.ant-col-12{
|
||||||
height:90px;
|
height:90px;
|
||||||
|
|||||||
Reference in New Issue
Block a user