mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-18 07:16:46 +08:00
保存接口
This commit is contained in:
@@ -101,10 +101,13 @@ import * as lecturerApi from "@/api/Lecturer.js";
|
|||||||
expandedKeys.value = []
|
expandedKeys.value = []
|
||||||
selectedKeys.value = []
|
selectedKeys.value = []
|
||||||
checkedKeys.value = []
|
checkedKeys.value = []
|
||||||
|
}else{
|
||||||
|
console.log(props.AddContentList,'xixiixix')
|
||||||
|
treeAddData.value = props?.AddContentList
|
||||||
|
checkedKeys.value = props?.AddContentList?.map(item=>item.id)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const onCheck = (checkedKeys, {checked: bool, checkedNodes, node, event}) => {
|
const onCheck = (checkedKeys, {checked: bool, checkedNodes, node, event}) => {
|
||||||
console.log(checkedKeys.value,'选中的id值')
|
|
||||||
// "965356037047586816"
|
// "965356037047586816"
|
||||||
let length = treeAddData.value.length
|
let length = treeAddData.value.length
|
||||||
if(checkedNodes.length > length){
|
if(checkedNodes.length > length){
|
||||||
@@ -131,7 +134,7 @@ import * as lecturerApi from "@/api/Lecturer.js";
|
|||||||
clearTree()
|
clearTree()
|
||||||
};
|
};
|
||||||
const queryCreate = () => {
|
const queryCreate = () => {
|
||||||
emit("AddContentList", treeAddData.value);
|
emit("update:AddContentList", treeAddData.value);
|
||||||
closeCodeModal()
|
closeCodeModal()
|
||||||
}
|
}
|
||||||
const expandedKeys = ref([]);
|
const expandedKeys = ref([]);
|
||||||
|
|||||||
@@ -102,14 +102,14 @@
|
|||||||
</a-row>
|
</a-row>
|
||||||
<a-row :gutter="16">
|
<a-row :gutter="16">
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="是否为根节点:" name="parentId">
|
<a-form-item label="是否为根节点:" name="code">
|
||||||
<div style="display: flex;align-items: center;">
|
<div style="display: flex;align-items: center;">
|
||||||
<a-radio-group style="min-width:126px;" @change="selectRadio" v-model:value="formParam.status" name="radioGroup">
|
<a-radio-group style="min-width:126px;" @change="selectRadio" v-model:value="formParam.isParent" name="radioGroup">
|
||||||
<a-radio :value="0">否</a-radio>
|
<a-radio :value="1">否</a-radio>
|
||||||
<a-radio :value="1">是</a-radio>
|
<a-radio :value="0">是</a-radio>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
<a-select v-model:value="formParam.parentId" placeholder="请选择根节点"
|
<a-select v-model:value="formParam.code" placeholder="请选择根节点"
|
||||||
:options="formParam.status?PlaceOfPayList:PlaceOfPayListTwo" allowClear showSearch/>
|
:options="!formParam.isParent?PlaceOfPayList:PlaceOfPayListTwo" allowClear showSearch/>
|
||||||
</div>
|
</div>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
@@ -121,7 +121,7 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row :gutter="16" v-if="!formParam.status">
|
<a-row :gutter="16" v-if="formParam.isParent">
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<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="请选择一级审批人"
|
||||||
@@ -138,7 +138,7 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row :gutter="16">
|
<a-row :gutter="16">
|
||||||
<a-col :span="12" v-if="!formParam.status">
|
<a-col :span="12" v-if="formParam.isParent">
|
||||||
<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/> -->
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
<a-form-item label="">
|
<a-form-item label="">
|
||||||
<!-- <a-textarea v-model:value="formParam.remark" showCount :maxlength="200"
|
<!-- <a-textarea v-model:value="formParam.remark" showCount :maxlength="200"
|
||||||
style="width: 100%; height: 100px; border-radius: 8px" placeholder="请输入" /> -->
|
style="width: 100%; height: 100px; border-radius: 8px" placeholder="请输入" /> -->
|
||||||
<a-table :dataSource="orgList" :columns="orgColumns"/>
|
<a-table :dataSource="formParam?.affiliationOrgList" :columns="orgColumns"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@@ -193,7 +193,7 @@
|
|||||||
</a-button>
|
</a-button>
|
||||||
</div>
|
</div>
|
||||||
</a-drawer>
|
</a-drawer>
|
||||||
<AddOrgContent :Addtitle="'选择组织'" v-model:showContent="showContent" @AddContentList="AddContentList" />
|
<AddOrgContent :Addtitle="'选择组织'" v-model:showContent="showContent" v-model:AddContentList="formParam.affiliationOrgList" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -234,7 +234,7 @@ export default{
|
|||||||
formParam:{
|
formParam:{
|
||||||
trainOrgId:null,
|
trainOrgId:null,
|
||||||
trainOrgName:null,
|
trainOrgName:null,
|
||||||
status: 0,
|
isParent: 1,
|
||||||
remark:null,
|
remark:null,
|
||||||
orgName: null,
|
orgName: null,
|
||||||
orgId: null,
|
orgId: null,
|
||||||
@@ -244,31 +244,25 @@ export default{
|
|||||||
leveOneArray: [],
|
leveOneArray: [],
|
||||||
leveTwoArray: [],
|
leveTwoArray: [],
|
||||||
leveThreeArray: [],
|
leveThreeArray: [],
|
||||||
parentId: null,
|
code: null,
|
||||||
affiliationOrgList: [],
|
affiliationOrgList: [],
|
||||||
},
|
},
|
||||||
orgList: [],
|
|
||||||
})
|
})
|
||||||
const PlaceOfPayList = ref([
|
const PlaceOfPayList = ref([
|
||||||
{ value: 1, label: "一级审批人" },
|
{ value: '1', label: "一级审批人" },
|
||||||
{ value: 2, label: "二级审批人" },
|
{ value: '2', label: "二级审批人" },
|
||||||
{ value: 3, label: "三级审批人" },
|
{ value: '3', label: "三级审批人" },
|
||||||
])
|
])
|
||||||
const PlaceOfPayListTwo = ref([
|
const PlaceOfPayListTwo = ref([
|
||||||
{ value: 1, label: "一级审批人" },
|
{ value: '1', label: "一级审批人" },
|
||||||
])
|
])
|
||||||
const AddContentList = (val) => {
|
|
||||||
console.log(val,'val')
|
|
||||||
state.orgList = val
|
|
||||||
state.formParam.affiliationOrgList = val
|
|
||||||
}
|
|
||||||
const selectRadio = (val)=>{
|
const selectRadio = (val)=>{
|
||||||
if(val.target.value == 1){
|
if(val.target.value == 1){
|
||||||
state.formParam.leveOneArray = []
|
state.formParam.leveOneArray = []
|
||||||
state.formParam.leveTwoArray = []
|
state.formParam.leveTwoArray = []
|
||||||
state.formParam.leveThreeArray = []
|
state.formParam.leveThreeArray = []
|
||||||
}
|
}
|
||||||
state.formParam.parentId = null
|
state.formParam.code = null
|
||||||
}
|
}
|
||||||
const columns = ref([
|
const columns = ref([
|
||||||
{
|
{
|
||||||
@@ -343,7 +337,7 @@ const orgColumns = ref([
|
|||||||
customRender: (text) => {
|
customRender: (text) => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{isSelect == 1 ? `${text.record.isSelect} (${text.record.orgName})` : "否 (-)"}
|
{text.record.isSelect == 1 ? `${text.record.isSelect} (${text.record.orgName})` : "否 (-)"}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -451,7 +445,7 @@ const getTableDate = (obj) => {
|
|||||||
state.formParam={
|
state.formParam={
|
||||||
trainOrgId:null,
|
trainOrgId:null,
|
||||||
trainOrgName:null,
|
trainOrgName:null,
|
||||||
status: 0,
|
isParent: 0,
|
||||||
remark:null,
|
remark:null,
|
||||||
orgName: null,
|
orgName: null,
|
||||||
orgId: null,
|
orgId: null,
|
||||||
@@ -461,7 +455,7 @@ const getTableDate = (obj) => {
|
|||||||
leveOneArray: [],
|
leveOneArray: [],
|
||||||
leveTwoArray: [],
|
leveTwoArray: [],
|
||||||
leveThreeArray: [],
|
leveThreeArray: [],
|
||||||
parentId: null,
|
code: null,
|
||||||
affiliationOrgList: []
|
affiliationOrgList: []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -478,12 +472,8 @@ const getTableDate = (obj) => {
|
|||||||
}
|
}
|
||||||
//保存
|
//保存
|
||||||
const createTeacherDialog = async () => {
|
const createTeacherDialog = async () => {
|
||||||
if(state.formParam.status){
|
console.log(state.formParam,'state.formParam')
|
||||||
state.formParam.status = state.formParam.parentId
|
|
||||||
}
|
|
||||||
state.formParam.affiliationUserList = [...state.formParam?.actArray,...state.formParam?.leveOneArray,...state.formParam?.leveTwoArray,...state.formParam?.leveThreeArray]
|
state.formParam.affiliationUserList = [...state.formParam?.actArray,...state.formParam?.leveOneArray,...state.formParam?.leveTwoArray,...state.formParam?.leveThreeArray]
|
||||||
state.formParam.orgId = state.orgList?.map(item=>item.id).join(',')
|
|
||||||
state.formParam.orgName = state.orgList?.map(item=>item.name).join(',')
|
|
||||||
const formItemNames = Object.keys(rules);
|
const formItemNames = Object.keys(rules);
|
||||||
for(let i=0;i<formItemNames.length;i++){
|
for(let i=0;i<formItemNames.length;i++){
|
||||||
const result = await validateField(formItemNames[i]);
|
const result = await validateField(formItemNames[i]);
|
||||||
@@ -515,7 +505,7 @@ const getTableDate = (obj) => {
|
|||||||
const rules = {
|
const rules = {
|
||||||
trainOrgId: [{ required: true, message: '',log:'培训发生组织编号不能为空' }],
|
trainOrgId: [{ required: true, message: '',log:'培训发生组织编号不能为空' }],
|
||||||
trainOrgName: [{ required: true, message: '',log:'培训发生组织名称不能为空' }],
|
trainOrgName: [{ required: true, message: '',log:'培训发生组织名称不能为空' }],
|
||||||
parentId: [{ required: true, message: '',log:'根节点不能为空' }],
|
code: [{ required: true, message: '',log:'根节点不能为空' }],
|
||||||
actValue: [{ required: true, message: '',log:'组织担当不能为空' }],
|
actValue: [{ required: true, message: '',log:'组织担当不能为空' }],
|
||||||
leveOneValue: [{ required: true, message: '"',log:'一级审批人不能为空' }],
|
leveOneValue: [{ required: true, message: '"',log:'一级审批人不能为空' }],
|
||||||
|
|
||||||
@@ -531,7 +521,6 @@ const getTableDate = (obj) => {
|
|||||||
getTableDate,
|
getTableDate,
|
||||||
searchSubmit,
|
searchSubmit,
|
||||||
selectRadio,
|
selectRadio,
|
||||||
AddContentList,
|
|
||||||
PlaceOfPayList,
|
PlaceOfPayList,
|
||||||
PlaceOfPayListTwo,
|
PlaceOfPayListTwo,
|
||||||
searchReset,
|
searchReset,
|
||||||
|
|||||||
Reference in New Issue
Block a user