培训通知 培训记录 字段修改
This commit is contained in:
parent
13cfbde0c6
commit
a90a8ab907
@ -3,71 +3,51 @@
|
|||||||
<view class="card">
|
<view class="card">
|
||||||
<view class="background"></view>
|
<view class="background"></view>
|
||||||
<view>
|
<view>
|
||||||
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="model" :rules="rules"
|
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="model" :rules="rules" ref="wForm" errorType="border-bottom" class="demo-ruleForm">
|
||||||
ref="wForm" errorType="border-bottom" class="demo-ruleForm">
|
|
||||||
<u-form-item required label="培训名称" prop="NAME" borderBottom>
|
<u-form-item required label="培训名称" prop="NAME" borderBottom>
|
||||||
<u--input v-model="model.NAME" border="none" slot="right" inputAlign="right" fontSize="14px"
|
<u--input v-model="model.NAME" border="none" slot="right" inputAlign="right" fontSize="14px" placeholder="请输入培训名称"></u--input>
|
||||||
placeholder="请输入培训名称"></u--input>
|
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item required label="培训类型" prop="Nav_TrainType.NAME" borderBottom
|
<u-form-item required label="培训类型" prop="Nav_TrainType.NAME" borderBottom @click="handleChange('Nav_TrainType','')">
|
||||||
@click="handleChange('Nav_TrainType','')">
|
<u--input v-if="model.Nav_TrainType" v-model="model.Nav_TrainType.NAME" placeholder="请选择培训类型" border="none" inputAlign="right" disabled disabledColor="#fff" fontSize="14px"></u--input>
|
||||||
<u--input v-if="model.Nav_TrainType" v-model="model.Nav_TrainType.NAME" placeholder="请选择培训类型"
|
|
||||||
border="none" inputAlign="right" disabled disabledColor="#fff" fontSize="14px"></u--input>
|
|
||||||
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
|
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
|
||||||
</u-icon>
|
</u-icon>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item required label="培训级别" prop="LEVEL" borderBottom
|
<u-form-item required label="培训级别" prop="LEVEL" borderBottom @click="handleShowSheet({title: '层级', name: 'LEVEL'})">
|
||||||
@click="handleShowSheet({title: '层级', name: 'LEVEL'})">
|
<u--input :value="model.LEVEL_SHOW" placeholder="请选择层级" border="none" inputAlign="right" disabled disabledColor="#fff" fontSize="14px"></u--input>
|
||||||
<u--input :value="model.LEVEL_SHOW" placeholder="请选择层级" border="none" inputAlign="right"
|
|
||||||
disabled disabledColor="#fff" fontSize="14px"></u--input>
|
|
||||||
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12"></u-icon>
|
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12"></u-icon>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="开始时间" required prop="TRAIN_START_TIME" borderBottom
|
<u-form-item label="开始时间" required prop="TRAIN_START_TIME" borderBottom @click="showCheckDate({ name: 'TRAIN_START_TIME'})">
|
||||||
@click="showCheckDate({ name: 'TRAIN_START_TIME'})">
|
<u--input disabledColor="#fff" v-model="model.TRAIN_START_TIME" disabled placeholder="请选择开始时间" suffixIcon="arrow-down" suffixIconStyle="font-size:12px" fontSize="14px" border="none"
|
||||||
<u--input disabledColor="#fff" v-model="model.TRAIN_START_TIME" disabled placeholder="请选择开始时间"
|
|
||||||
suffixIcon="arrow-down" suffixIconStyle="font-size:12px" fontSize="14px" border="none"
|
|
||||||
customStyle="margin:0px;display:flex;padding:3px 0px" inputAlign="right">
|
customStyle="margin:0px;display:flex;padding:3px 0px" inputAlign="right">
|
||||||
</u--input>
|
</u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="结束时间" required prop="TRAIN_END_TIME" borderBottom
|
<u-form-item label="结束时间" required prop="TRAIN_END_TIME" borderBottom @click="showCheckDate({name: 'TRAIN_END_TIME'})">
|
||||||
@click="showCheckDate({name: 'TRAIN_END_TIME'})">
|
<u--input disabledColor="#fff" v-model="model.TRAIN_END_TIME" disabled placeholder="请选择结束时间" suffixIcon="arrow-down" suffixIconStyle="font-size:12px" fontSize="14px" border="none"
|
||||||
<u--input disabledColor="#fff" v-model="model.TRAIN_END_TIME" disabled placeholder="请选择结束时间"
|
|
||||||
suffixIcon="arrow-down" suffixIconStyle="font-size:12px" fontSize="14px" border="none"
|
|
||||||
inputAlign="right" customStyle="margin:0px;display:flex;padding:3px 0px">
|
inputAlign="right" customStyle="margin:0px;display:flex;padding:3px 0px">
|
||||||
</u--input>
|
</u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item required label="培训地点" prop="TRAIN_ADDR" borderBottom>
|
<u-form-item required label="培训地点" prop="TRAIN_ADDR" borderBottom>
|
||||||
<u--input v-model="model.TRAIN_ADDR" border="none" slot="right" inputAlign="right"
|
<u--input v-model="model.TRAIN_ADDR" border="none" slot="right" inputAlign="right" fontSize="14px" placeholder="请填写培训地点"></u--input>
|
||||||
fontSize="14px" placeholder="请填写培训地点"></u--input>
|
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item required label="培训学时" prop="HOURS" borderBottom>
|
<u-form-item required label="培训学时" prop="HOURS" borderBottom>
|
||||||
<u--input v-model="model.HOURS" type="number" border="none" slot="right" placeholder="请填写培训学时"
|
<u--input v-model="model.HOURS" type="number" border="none" slot="right" placeholder="请填写培训学时" inputAlign="right" fontSize="14px"></u--input>
|
||||||
inputAlign="right" fontSize="14px"></u--input>
|
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item required label="培训老师" prop="TRAIN_TEACHER" borderBottom>
|
<u-form-item required label="培训老师" prop="TRAIN_TEACHER" borderBottom>
|
||||||
<u--input v-model="model.TRAIN_TEACHER" border="none" slot="right" placeholder="请填写培训老师"
|
<u--input v-model="model.TRAIN_TEACHER" border="none" slot="right" placeholder="请填写培训老师" inputAlign="right" fontSize="14px"></u--input>
|
||||||
inputAlign="right" fontSize="14px"></u--input>
|
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item required label="培训形式" prop="TRAIN_MODEL" borderBottom
|
<u-form-item required label="培训形式" prop="TRAIN_MODEL" borderBottom @click="handleShowSheet({title: '培训形式', name: 'TrainType'})">
|
||||||
@click="handleShowSheet({title: '培训形式', name: 'TRAIN_MODEL'})">
|
<u--input v-model="model.TRAINTYPE_SHOW" placeholder="请选择培训形式" border="none" inputAlign="right" disabled disabledColor="#fff" fontSize="14px"></u--input>
|
||||||
<u--input :value="model.TRAIN_MODEL_SHOW" placeholder="请选择培训形式" border="none" inputAlign="right"
|
|
||||||
disabled disabledColor="#fff" fontSize="14px"></u--input>
|
|
||||||
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12"></u-icon>
|
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12"></u-icon>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item required label="考核方式" prop="Nav_TrainCheckType.NAME" borderBottom
|
<u-form-item required label="考核方式" prop="Nav_TrainCheckType.NAME" borderBottom @click="handleShowSheet({title: '培训形式', name: 'PlanCheckType'})">
|
||||||
@click="handleChange('Nav_TrainCheckType','')">
|
<u--input v-model="model.CHECKTYPE_SHOW" placeholder="请选择考核方式" border="none" inputAlign="right" disabled disabledColor="#fff" fontSize="14px"></u--input>
|
||||||
<u--input v-if="model.Nav_TrainCheckType" v-model="model.Nav_TrainCheckType.NAME"
|
|
||||||
placeholder="请选择考核方式" border="none" inputAlign="right" disabled disabledColor="#fff"
|
|
||||||
fontSize="14px"></u--input>
|
|
||||||
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
|
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
|
||||||
</u-icon>
|
</u-icon>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item required class="custom-form-item" label="培训内容" prop="DetailPost" borderBottom
|
<u-form-item required class="custom-form-item" label="培训内容" prop="DetailPost" borderBottom @click="handleQuerySelect({ formIndex: 'Nav_TrainContentList', isMultiple: true})">
|
||||||
@click="handleQuerySelect({ formIndex: 'Nav_TrainContentList', isMultiple: true})">
|
|
||||||
<view slot="right" class="custom-form-item-right">
|
<view slot="right" class="custom-form-item-right">
|
||||||
<view class="multi">
|
<view class="multi">
|
||||||
<u--text v-for="(i, k) in model.Nav_TrainContentList" :key="k" class="item"
|
<u--text v-for="(i, k) in model.Nav_TrainContentList" :key="k" class="item" :text="k + 1 + '. ' + i.Nav_Point.NAME" :size="14"></u--text>
|
||||||
:text="k + 1 + '. ' + i.Nav_Point.NAME" :size="14"></u--text>
|
|
||||||
</view>
|
</view>
|
||||||
<u-icon class="icon" name="arrow-down" size="12">
|
<u-icon class="icon" name="arrow-down" size="12">
|
||||||
</u-icon>
|
</u-icon>
|
||||||
@ -76,52 +56,37 @@
|
|||||||
<u-form-item label="培训安排及要求" prop="TRAIN_PLAN" borderBottom>
|
<u-form-item label="培训安排及要求" prop="TRAIN_PLAN" borderBottom>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u--textarea required v-model="model.TRAIN_PLAN" border="surround"></u--textarea>
|
<u--textarea required v-model="model.TRAIN_PLAN" border="surround"></u--textarea>
|
||||||
<u-form-item label="是否需要培训效果评估" prop="NEED_EVALUATION" borderBottom
|
<u-form-item label="是否需要培训效果评估" prop="NEED_EVALUATION" borderBottom @click="handleShowSheet({title: '是否需要培训效果评估', name: 'NEED_EVALUATION'})">
|
||||||
@click="handleShowSheet({title: '是否需要培训效果评估', name: 'NEED_EVALUATION'})">
|
<u--input :value="model.NEED_EVALUATION_SHOW" placeholder="请选择" border="none" inputAlign="right" disabled disabledColor="#fff"></u--input>
|
||||||
<u--input :value="model.NEED_EVALUATION_SHOW" placeholder="请选择" border="none" inputAlign="right"
|
|
||||||
disabled disabledColor="#fff"></u--input>
|
|
||||||
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12"></u-icon>
|
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12"></u-icon>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="是否触发培训记录" prop="CREATE_NOTIFY_RECORD" borderBottom>
|
<u-form-item label="是否触发培训记录" prop="CREATE_NOTIFY_RECORD" borderBottom>
|
||||||
<u-switch inactiveColor="rgb(230, 230, 230)" size="24" space="4"
|
<u-switch inactiveColor="rgb(230, 230, 230)" size="24" space="4" v-model="model.CREATE_NOTIFY_RECORD" @change="changeSwitch" border="none" slot="right" inputAlign="right"></u-switch>
|
||||||
v-model="model.CREATE_NOTIFY_RECORD" @change="changeSwitch" border="none" slot="right"
|
|
||||||
inputAlign="right"></u-switch>
|
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item required label="记录人员" prop="Nav_RecordUser.NAME" borderBottom
|
<u-form-item required label="记录人员" prop="Nav_RecordUser.NAME" borderBottom @click="handleChange('Nav_RecordUser','')">
|
||||||
@click="handleChange('Nav_RecordUser','')">
|
<u--input v-if="model.Nav_RecordUser" v-model="model.Nav_RecordUser.NAME" placeholder="记录人员" border="none" inputAlign="right" disabled disabledColor="#fff"></u--input>
|
||||||
<u--input v-if="model.Nav_RecordUser" v-model="model.Nav_RecordUser.NAME" placeholder="记录人员"
|
|
||||||
border="none" inputAlign="right" disabled disabledColor="#fff"></u--input>
|
|
||||||
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
|
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
|
||||||
</u-icon>
|
</u-icon>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<view class="upload-title">附件</view>
|
<view class="upload-title">附件</view>
|
||||||
<full-upload v-model="model.Nav_Files" :isShowBtn='true' :listProp='listPropUpload'
|
<full-upload v-model="model.Nav_Files" :isShowBtn='true' :listProp='listPropUpload' :listPropVal='listPropValUpload'></full-upload>
|
||||||
:listPropVal='listPropValUpload'></full-upload>
|
|
||||||
<u-form-item required label="培训人员">
|
<u-form-item required label="培训人员">
|
||||||
<u-icon name="man-add" @click="handleShowUserSelector()" size="24" color="#3d9cff"
|
<u-icon name="man-add" @click="handleShowUserSelector()" size="24" color="#3d9cff" slot="right"></u-icon>
|
||||||
slot="right"></u-icon>
|
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<view v-show="!!model.Nav_TrainUserList.length" class="tag-view">
|
<view v-show="!!model.Nav_TrainUserList.length" class="tag-view">
|
||||||
<uni-tag class="tag" v-for="(i, k) in model.Nav_TrainUserList.filter(i => !i.IS_DELETED)"
|
<uni-tag class="tag" v-for="(i, k) in model.Nav_TrainUserList.filter(i => !i.IS_DELETED)" :key="k" :inverted="true" :text="i.NAME" type="primary" />
|
||||||
:key="k" :inverted="true" :text="i.NAME" type="primary" />
|
|
||||||
</view>
|
</view>
|
||||||
</u--form>
|
</u--form>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<query-selector :show="showPopup" :lists="Lists" @close="handleClosePopup" @search="handleSearch"
|
<query-selector :show="showPopup" :lists="Lists" @close="handleClosePopup" @search="handleSearch" @select="handleSelected" />
|
||||||
@select="handleSelected" />
|
<u-picker :show="comPickerInfo.showSheet" :columns="comPickerInfo.columns" @confirm="onConfirmPicker" :defaultIndex="[0]" @close="closePicker" @cancel="closePicker" keyName="NAME"></u-picker>
|
||||||
<u-picker :show="comPickerInfo.showSheet" :columns="comPickerInfo.columns" @confirm="onConfirmPicker"
|
|
||||||
:defaultIndex="[0]" @close="closePicker" @cancel="closePicker" keyName="NAME"></u-picker>
|
|
||||||
<view class="bottom-button">
|
<view class="bottom-button">
|
||||||
</view>
|
</view>
|
||||||
<u-datetime-picker :show="dateTimePickerInfo.showCheckDate" mode="datetime"
|
<u-datetime-picker :show="dateTimePickerInfo.showCheckDate" mode="datetime" v-model='dateTimePickerInfo.defaultDateTime' :formatter="formatter" @confirm="handleCheckDate"
|
||||||
v-model='dateTimePickerInfo.defaultDateTime' :formatter="formatter" @confirm="handleCheckDate"
|
@close="dateTimePickerInfo.showCheckDate = false;" @cancel="dateTimePickerInfo.showCheckDate = false;"></u-datetime-picker>
|
||||||
@close="dateTimePickerInfo.showCheckDate = false;"
|
<query-selector :multiple="qsCom.isMultiple" :total="curTotal" :show="qsCom.show" :lists="qsCom.lists" @close="onCloseQS" @search="onSearchQS" @select="onSelectedQS" />
|
||||||
@cancel="dateTimePickerInfo.showCheckDate = false;"></u-datetime-picker>
|
<people-selector :defaultChecked="peopleSelectOption.defaultChecked" :show="peopleSelectOption.showSelector" @select="handleSelectorPeople" @close="peopleSelectOption.showSelector = false">
|
||||||
<query-selector :multiple="qsCom.isMultiple" :total="curTotal" :show="qsCom.show" :lists="qsCom.lists"
|
|
||||||
@close="onCloseQS" @search="onSearchQS" @select="onSelectedQS" />
|
|
||||||
<people-selector :defaultChecked="peopleSelectOption.defaultChecked" :show="peopleSelectOption.showSelector"
|
|
||||||
@select="handleSelectorPeople" @close="peopleSelectOption.showSelector = false">
|
|
||||||
</people-selector>
|
</people-selector>
|
||||||
<view class="bottom-button">
|
<view class="bottom-button">
|
||||||
<u-button type="primary" @click="submit" color="#3d4b70">提交</u-button>
|
<u-button type="primary" @click="submit" color="#3d4b70">提交</u-button>
|
||||||
@ -145,7 +110,7 @@
|
|||||||
} from '../../../../services/apply/FOServices/FOServices';
|
} from '../../../../services/apply/FOServices/FOServices';
|
||||||
import {
|
import {
|
||||||
getEnum
|
getEnum
|
||||||
} from '../../../../services/common'
|
} from '../../../../services/common';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -266,21 +231,65 @@
|
|||||||
name: ''
|
name: ''
|
||||||
},
|
},
|
||||||
formatter: null,
|
formatter: null,
|
||||||
|
enumsData: {}, // 存储所有枚举数据(键:枚举名称,值:处理后的枚举列表)
|
||||||
|
enumsText: {}, // 存储枚举文本列表(用于下拉选择等场景)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.TaskID = option.taskID ? option.taskID : '';
|
this.TaskID = option.taskID ? option.taskID : '';
|
||||||
this.model.ID = option.ID ? option.ID : '';
|
this.model.ID = option.ID ? option.ID : '';
|
||||||
this.tableKey = option.tableKey ? option.tableKey : '0';
|
this.tableKey = option.tableKey ? option.tableKey : '0';
|
||||||
if (option.isAdd != 1) {
|
this.fetchEnums(['TrainType', 'PlanCheckType']);
|
||||||
|
this.isAdd = option.isAdd
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async fetchEnums(enumNames) {
|
||||||
|
try {
|
||||||
|
// 存储所有枚举请求的Promise
|
||||||
|
const enumPromises = enumNames.map(name => {
|
||||||
|
return getEnum({
|
||||||
|
name
|
||||||
|
}).then(res => {
|
||||||
|
// 统一处理枚举格式:添加name/code字段,便于后续映射
|
||||||
|
return {
|
||||||
|
enumName: name,
|
||||||
|
data: res.map(item => ({
|
||||||
|
...item,
|
||||||
|
name: item.NAME, // 统一显示名称字段
|
||||||
|
code: item.ID // 统一值字段
|
||||||
|
}))
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 等待所有枚举请求完成
|
||||||
|
const results = await Promise.all(enumPromises);
|
||||||
|
// 存储枚举结果到data中(键为枚举名称,值为处理后的数据)
|
||||||
|
results.forEach(({
|
||||||
|
enumName,
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
|
this.enumsData[enumName] = data;
|
||||||
|
// 生成文本列表(如需要)
|
||||||
|
this.enumsText[enumName] = data.map(item => item.name);
|
||||||
|
});
|
||||||
|
// 所有枚举获取完成后,执行loadData
|
||||||
|
if (this.isAdd != 1) {
|
||||||
this.loadData();
|
this.loadData();
|
||||||
} else {
|
} else {
|
||||||
this.isAdd = 1;
|
this.isAdd = 1;
|
||||||
this.model.ID = guid();
|
this.model.ID = guid();
|
||||||
this.model.CREATE_NOTIFY_RECORD = true;
|
this.model.CREATE_NOTIFY_RECORD = true;
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('枚举请求失败:', error);
|
||||||
|
uni.showToast({
|
||||||
|
title: '枚举数据加载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
changeSwitch(e) {
|
changeSwitch(e) {
|
||||||
this.model.CREATE_NOTIFY_RECORD = e;
|
this.model.CREATE_NOTIFY_RECORD = e;
|
||||||
},
|
},
|
||||||
@ -352,10 +361,7 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else if (this.currSearchType == "Nav_TrainCheckType") {
|
} else if (this.currSearchType == "Nav_TrainCheckType") {
|
||||||
var dataParm = {
|
getRequest(json, "/SE/TrainCheckTypeEnum/OrderPaged").then(res => {
|
||||||
'name': "PlanCheckType"
|
|
||||||
}
|
|
||||||
getEnum(dataParm).then(res => {
|
|
||||||
this.Lists = res.map(i => {
|
this.Lists = res.map(i => {
|
||||||
return {
|
return {
|
||||||
...i,
|
...i,
|
||||||
@ -363,14 +369,6 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
// getRequest(json, "/SE/TrainCheckTypeEnum/OrderPaged").then(res => {
|
|
||||||
// this.Lists = res.map(i => {
|
|
||||||
// return {
|
|
||||||
// ...i,
|
|
||||||
// name: i.NAME,
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
} else if (this.currSearchType == "Nav_RecordUser") {
|
} else if (this.currSearchType == "Nav_RecordUser") {
|
||||||
getRequest(json, "/FM/FMUser/OrderPagedUseful").then(res => {
|
getRequest(json, "/FM/FMUser/OrderPagedUseful").then(res => {
|
||||||
this.Lists = res.map(i => {
|
this.Lists = res.map(i => {
|
||||||
@ -390,7 +388,7 @@
|
|||||||
this.model.TRAIN_TYPE = val.ID;
|
this.model.TRAIN_TYPE = val.ID;
|
||||||
} else if (this.currSearchType == 'Nav_TrainCheckType') {
|
} else if (this.currSearchType == 'Nav_TrainCheckType') {
|
||||||
this.model.Nav_TrainCheckType = val;
|
this.model.Nav_TrainCheckType = val;
|
||||||
this.model.CHECKTYPE = val.ID;
|
this.model.CHECK_TYPE_ID = val.ID;
|
||||||
} else if (this.currSearchType == 'Nav_RecordUser') {
|
} else if (this.currSearchType == 'Nav_RecordUser') {
|
||||||
this.model.Nav_RecordUser = val;
|
this.model.Nav_RecordUser = val;
|
||||||
this.model.RECORD_USER_ID = val.ID;
|
this.model.RECORD_USER_ID = val.ID;
|
||||||
@ -517,7 +515,7 @@
|
|||||||
extendInclude(json, "Nav_TrainContentList.Nav_Point")
|
extendInclude(json, "Nav_TrainContentList.Nav_Point")
|
||||||
extendInclude(json, "Nav_LaunchDepartment")
|
extendInclude(json, "Nav_LaunchDepartment")
|
||||||
extendInclude(json, "Nav_TrainType")
|
extendInclude(json, "Nav_TrainType")
|
||||||
// extendInclude(json, "Nav_TrainCheckType")
|
extendInclude(json, "Nav_TrainCheckType")
|
||||||
extendInclude(json, "Nav_RecordUser")
|
extendInclude(json, "Nav_RecordUser")
|
||||||
extendInclude(json, "Nav_TrainContentList")
|
extendInclude(json, "Nav_TrainContentList")
|
||||||
extendInclude(json, "Nav_TrainUserList.Nav_User.Nav_Person")
|
extendInclude(json, "Nav_TrainUserList.Nav_User.Nav_Person")
|
||||||
@ -527,6 +525,8 @@
|
|||||||
getRequest(json, "/SE/TrainNotify/Get").then(res => {
|
getRequest(json, "/SE/TrainNotify/Get").then(res => {
|
||||||
this.model = res
|
this.model = res
|
||||||
this.model.LEVEL_SHOW = this.transLevel(this.model.LEVEL)
|
this.model.LEVEL_SHOW = this.transLevel(this.model.LEVEL)
|
||||||
|
this.model.TRAINTYPE_SHOW = res.TRAINTYPE !== undefined ? this.enumsData['TrainType'].find(item => item.code === res.TRAINTYPE).name : '';
|
||||||
|
this.model.CHECKTYPE_SHOW = res.CHECKTYPE !== undefined ? this.enumsData['PlanCheckType'].find(item => item.code === res.CHECKTYPE).name : '';
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
closePicker() {
|
closePicker() {
|
||||||
@ -588,6 +588,8 @@
|
|||||||
ID: 1
|
ID: 1
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
} else if (p.name == 'TrainType' || p.name == 'PlanCheckType') {
|
||||||
|
column = this.enumsData[p.name]
|
||||||
}
|
}
|
||||||
if (column.length) {
|
if (column.length) {
|
||||||
this.comPickerInfo = {
|
this.comPickerInfo = {
|
||||||
@ -606,8 +608,19 @@
|
|||||||
name,
|
name,
|
||||||
formIndex
|
formIndex
|
||||||
} = this.comPickerInfo
|
} = this.comPickerInfo
|
||||||
|
if(name == 'TrainType'){
|
||||||
|
this.model.TRAINTYPE_SHOW = e.value[0].name
|
||||||
|
this.model.TRAINTYPE = this.enumsData['TrainType'][e.indexs[0]].code
|
||||||
|
}else if(name == 'PlanCheckType'){
|
||||||
|
this.model.CHECKTYPE_SHOW = e.value[0].name
|
||||||
|
this.model.CHECKTYPE = this.enumsData['PlanCheckType'][e.indexs[0]].code
|
||||||
|
}else{
|
||||||
this.model[name] = e.value[0].ID
|
this.model[name] = e.value[0].ID
|
||||||
this.model[name + '_SHOW'] = e.value[0].NAME
|
this.model[name + '_SHOW'] = e.value[0].NAME
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.comPickerInfo.showSheet = false
|
this.comPickerInfo.showSheet = false
|
||||||
},
|
},
|
||||||
transLevel(level) {
|
transLevel(level) {
|
||||||
|
|||||||
@ -49,11 +49,11 @@
|
|||||||
disabledColor="#ffffff" fontSize="14px"></u--input>
|
disabledColor="#ffffff" fontSize="14px"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="培训形式:" prop="" borderBottom>
|
<u-form-item label="培训形式:" prop="" borderBottom>
|
||||||
<u--input v-model="model.TRAIN_MODEL" border="none" inputAlign="right" disabled
|
<u--input v-model="model.TRAINTYPE_SHOW" border="none" inputAlign="right" disabled
|
||||||
disabledColor="#ffffff" fontSize="14px"></u--input>
|
disabledColor="#ffffff" fontSize="14px"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="考核方式:" prop="Nav_TrainCheckType.NAME" borderBottom>
|
<u-form-item label="考核方式:" prop="Nav_TrainCheckType.NAME" borderBottom>
|
||||||
<u--input v-model="model.CHECKTYPE_NAME" border="none"
|
<u--input v-model="model.CHECKTYPE_SHOW" border="none"
|
||||||
slot="right" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
|
slot="right" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="培训内容:" prop="TRAINCONTENT" borderBottom>
|
<u-form-item label="培训内容:" prop="TRAINCONTENT" borderBottom>
|
||||||
@ -117,30 +117,56 @@
|
|||||||
orgId: uni.getStorageSync('orgId'),
|
orgId: uni.getStorageSync('orgId'),
|
||||||
listPropUpload: ['NOTIFY_ID'],
|
listPropUpload: ['NOTIFY_ID'],
|
||||||
listPropValUpload: [],
|
listPropValUpload: [],
|
||||||
Lists: [],
|
enumsData: {}, // 存储所有枚举数据(键:枚举名称,值:处理后的枚举列表)
|
||||||
|
enumsText: {}, // 存储枚举文本列表(用于下拉选择等场景)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.model.ID = option.ID;
|
this.model.ID = option.ID;
|
||||||
this.TaskID = option.taskID;
|
this.TaskID = option.taskID;
|
||||||
this.tableKey = option.tableKey ? option.tableKey : '0'
|
this.tableKey = option.tableKey ? option.tableKey : '0'
|
||||||
|
this.fetchEnums(['TrainType', 'PlanCheckType']);
|
||||||
this.getEnums()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getEnums(){
|
async fetchEnums(enumNames) {
|
||||||
var dataParm = {
|
try {
|
||||||
'name': "PlanCheckType"
|
// 存储所有枚举请求的Promise
|
||||||
}
|
const enumPromises = enumNames.map(name => {
|
||||||
getEnum(dataParm).then(res => {
|
return getEnum({
|
||||||
this.Lists = res.map(i => {
|
name
|
||||||
|
}).then(res => {
|
||||||
|
// 统一处理枚举格式:添加name/code字段,便于后续映射
|
||||||
return {
|
return {
|
||||||
...i,
|
enumName: name,
|
||||||
name: i.NAME,
|
data: res.map(item => ({
|
||||||
|
...item,
|
||||||
|
name: item.NAME, // 统一显示名称字段
|
||||||
|
code: item.ID // 统一值字段
|
||||||
|
}))
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 等待所有枚举请求完成
|
||||||
|
const results = await Promise.all(enumPromises);
|
||||||
|
// 存储枚举结果到data中(键为枚举名称,值为处理后的数据)
|
||||||
|
results.forEach(({
|
||||||
|
enumName,
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
|
this.enumsData[enumName] = data;
|
||||||
|
// 生成文本列表(如需要)
|
||||||
|
this.enumsText[enumName] = data.map(item => item.name);
|
||||||
|
});
|
||||||
|
// 所有枚举获取完成后,执行loadData
|
||||||
|
this.loadData();
|
||||||
|
} catch (error) {
|
||||||
|
console.error('枚举请求失败:', error);
|
||||||
|
uni.showToast({
|
||||||
|
title: '枚举数据加载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
|
||||||
this.loadData()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
loadData() {
|
loadData() {
|
||||||
const json = initFilter(this.orgId, "", "CODE", 1)
|
const json = initFilter(this.orgId, "", "CODE", 1)
|
||||||
@ -148,7 +174,7 @@
|
|||||||
extendInclude(json, 'Nav_LaunchDepartment');
|
extendInclude(json, 'Nav_LaunchDepartment');
|
||||||
extendInclude(json, 'Nav_LaunchUser');
|
extendInclude(json, 'Nav_LaunchUser');
|
||||||
extendInclude(json, 'Nav_TrainType');
|
extendInclude(json, 'Nav_TrainType');
|
||||||
// extendInclude(json, 'Nav_TrainCheckType');
|
extendInclude(json, 'Nav_TrainCheckType');
|
||||||
extendInclude(json, 'Nav_TrainContentList');
|
extendInclude(json, 'Nav_TrainContentList');
|
||||||
extendInclude(json, 'Nav_TrainContentList.Nav_Point');
|
extendInclude(json, 'Nav_TrainContentList.Nav_Point');
|
||||||
extendInclude(json, 'Nav_TrainUserList');
|
extendInclude(json, 'Nav_TrainUserList');
|
||||||
@ -180,11 +206,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.model.CHECKTYPE_NAME = res.CHECKTYPE !== undefined ? this.Lists.find(item => item.ID === res.CHECKTYPE).name : '';
|
|
||||||
this.model.TRAIN_MODEL = this.returnModel(this.model.TRAIN_MODEL);
|
this.model.TRAIN_MODEL = this.returnModel(this.model.TRAIN_MODEL);
|
||||||
this.model.LEVEL = this.transLevel(this.model.LEVEL);
|
this.model.LEVEL = this.transLevel(this.model.LEVEL);
|
||||||
this.model.TRAINCONTENT = trainContent;
|
this.model.TRAINCONTENT = trainContent;
|
||||||
this.model.users = users;
|
this.model.users = users;
|
||||||
|
this.model.TRAINTYPE_SHOW = res.TRAINTYPE !== undefined ? this.enumsData['TrainType'].find(item => item.code === res.TRAINTYPE).name : '';
|
||||||
|
this.model.CHECKTYPE_SHOW = res.CHECKTYPE !== undefined ? this.enumsData['PlanCheckType'].find(item => item.code === res.CHECKTYPE).name : '';
|
||||||
this.isLoadOK = true;
|
this.isLoadOK = true;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@ -51,11 +51,11 @@
|
|||||||
slot="right" inputAlign="right" fontSize="14px"></u--input>
|
slot="right" inputAlign="right" fontSize="14px"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="培训形式:" prop="TRAIN_MODEL" borderBottom>
|
<u-form-item label="培训形式:" prop="TRAIN_MODEL" borderBottom>
|
||||||
<u--input v-if="model.Nav_Notify" :value="model.Nav_Notify.TRAIN_MODEL_SHOW" border="none"
|
<u--input v-if="model.Nav_Notify" :value="model.Nav_Notify.TRAINTYPE_SHOW" border="none"
|
||||||
inputAlign="right" disabled disabledColor="#fff" fontSize="14px"></u--input>
|
inputAlign="right" disabled disabledColor="#fff" fontSize="14px"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="考核方式:" prop="Nav_TrainCheckType.NAME" borderBottom>
|
<u-form-item label="考核方式:" prop="Nav_TrainCheckType.NAME" borderBottom>
|
||||||
<u--input v-if="model.Nav_Notify" v-model="model.Nav_Notify.CHECKTYPE_NAME"
|
<u--input v-if="model.Nav_Notify" v-model="model.Nav_Notify.CHECKTYPE_SHOW"
|
||||||
border="none" inputAlign="right" disabled disabledColor="#fff" fontSize="14px"></u--input>
|
border="none" inputAlign="right" disabled disabledColor="#fff" fontSize="14px"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item class="custom-form-item" label="培训内容:" prop="DetailPost" :borderBottom="false">
|
<u-form-item class="custom-form-item" label="培训内容:" prop="DetailPost" :borderBottom="false">
|
||||||
@ -163,28 +163,56 @@
|
|||||||
},
|
},
|
||||||
currItem: '',
|
currItem: '',
|
||||||
formatter: null,
|
formatter: null,
|
||||||
|
enumsData: {}, // 存储所有枚举数据(键:枚举名称,值:处理后的枚举列表)
|
||||||
|
enumsText: {}, // 存储枚举文本列表(用于下拉选择等场景)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.TaskID = option.taskID ? option.taskID : '';
|
this.TaskID = option.taskID ? option.taskID : '';
|
||||||
this.model.ID = option.ID ? option.ID : '';
|
this.model.ID = option.ID ? option.ID : '';
|
||||||
this.tableKey = option.tableKey ? option.tableKey : '0';
|
this.tableKey = option.tableKey ? option.tableKey : '0';
|
||||||
this.getEnums();
|
this.fetchEnums(['TrainType', 'PlanCheckType']);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getEnums(){
|
async fetchEnums(enumNames) {
|
||||||
var dataParm = {
|
try {
|
||||||
'name': "PlanCheckType"
|
// 存储所有枚举请求的Promise
|
||||||
}
|
const enumPromises = enumNames.map(name => {
|
||||||
getEnum(dataParm).then(res => {
|
return getEnum({
|
||||||
this.Lists = res.map(i => {
|
name
|
||||||
|
}).then(res => {
|
||||||
|
// 统一处理枚举格式:添加name/code字段,便于后续映射
|
||||||
return {
|
return {
|
||||||
...i,
|
enumName: name,
|
||||||
name: i.NAME,
|
data: res.map(item => ({
|
||||||
|
...item,
|
||||||
|
name: item.NAME, // 统一显示名称字段
|
||||||
|
code: item.ID // 统一值字段
|
||||||
|
}))
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 等待所有枚举请求完成
|
||||||
|
const results = await Promise.all(enumPromises);
|
||||||
|
// 存储枚举结果到data中(键为枚举名称,值为处理后的数据)
|
||||||
|
results.forEach(({
|
||||||
|
enumName,
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
|
this.enumsData[enumName] = data;
|
||||||
|
// 生成文本列表(如需要)
|
||||||
|
this.enumsText[enumName] = data.map(item => item.name);
|
||||||
|
});
|
||||||
|
// 所有枚举获取完成后,执行loadData
|
||||||
|
this.loadData();
|
||||||
|
} catch (error) {
|
||||||
|
console.error('枚举请求失败:', error);
|
||||||
|
uni.showToast({
|
||||||
|
title: '枚举数据加载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
|
||||||
this.loadData()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
sectionChange(index, item) {
|
sectionChange(index, item) {
|
||||||
item.STATUS = index;
|
item.STATUS = index;
|
||||||
@ -240,7 +268,7 @@
|
|||||||
extendInclude(json, "Nav_Notify")
|
extendInclude(json, "Nav_Notify")
|
||||||
extendInclude(json, "Nav_Notify.Nav_TrainType")
|
extendInclude(json, "Nav_Notify.Nav_TrainType")
|
||||||
extendInclude(json, "Nav_Notify.Nav_LaunchDepartment")
|
extendInclude(json, "Nav_Notify.Nav_LaunchDepartment")
|
||||||
// extendInclude(json, "Nav_Notify.Nav_TrainCheckType")
|
extendInclude(json, "Nav_Notify.Nav_TrainCheckType")
|
||||||
extendInclude(json, "Nav_Notify.Nav_TrainContentList.Nav_Point")
|
extendInclude(json, "Nav_Notify.Nav_TrainContentList.Nav_Point")
|
||||||
extendInclude(json, "Nav_Files.Nav_ImgFile")
|
extendInclude(json, "Nav_Files.Nav_ImgFile")
|
||||||
extendRule(json, 'ID', 1, this.model.ID)
|
extendRule(json, 'ID', 1, this.model.ID)
|
||||||
@ -255,6 +283,8 @@
|
|||||||
} else if (this.model.Nav_Notify.LEVEL == 3) {
|
} else if (this.model.Nav_Notify.LEVEL == 3) {
|
||||||
this.model.Nav_Notify.LEVEL_SHOW = "公司";
|
this.model.Nav_Notify.LEVEL_SHOW = "公司";
|
||||||
}
|
}
|
||||||
|
this.model.Nav_Notify.TRAINTYPE_SHOW = res.Nav_Notify.TRAINTYPE !== undefined ? this.enumsData['TrainType'].find(item => item.code === res.Nav_Notify.TRAINTYPE).name : '';
|
||||||
|
this.model.Nav_Notify.CHECKTYPE_SHOW = res.Nav_Notify.CHECKTYPE !== undefined ? this.enumsData['PlanCheckType'].find(item => item.code === res.Nav_Notify.CHECKTYPE).name : '';
|
||||||
this.model.Nav_Notify.TRAIN_MODEL_SHOW = "";
|
this.model.Nav_Notify.TRAIN_MODEL_SHOW = "";
|
||||||
if (this.model.Nav_Notify.TRAIN_MODEL.indexOf(1) > 0) {
|
if (this.model.Nav_Notify.TRAIN_MODEL.indexOf(1) > 0) {
|
||||||
this.model.Nav_Notify.TRAIN_MODEL_SHOW += "讲授法 ";
|
this.model.Nav_Notify.TRAIN_MODEL_SHOW += "讲授法 ";
|
||||||
@ -265,7 +295,6 @@
|
|||||||
} else if (this.model.Nav_Notify.TRAIN_MODEL.indexOf(4) > 0) {
|
} else if (this.model.Nav_Notify.TRAIN_MODEL.indexOf(4) > 0) {
|
||||||
this.model.Nav_Notify.TRAIN_MODEL_SHOW += "演示法 ";
|
this.model.Nav_Notify.TRAIN_MODEL_SHOW += "演示法 ";
|
||||||
}
|
}
|
||||||
this.model.Nav_Notify.CHECKTYPE_NAME = res.Nav_Notify.CHECKTYPE !== undefined ? this.Lists.find(item => item.ID === res.Nav_Notify.CHECKTYPE).name : '';
|
|
||||||
this.model.Nav_TrainContentList_SHOW = "";
|
this.model.Nav_TrainContentList_SHOW = "";
|
||||||
for (let i = 0; i < this.model.Nav_Notify.Nav_TrainContentList.length; i++) {
|
for (let i = 0; i < this.model.Nav_Notify.Nav_TrainContentList.length; i++) {
|
||||||
this.model.Nav_TrainContentList_SHOW += (i + 1) + "." + this.model.Nav_Notify
|
this.model.Nav_TrainContentList_SHOW += (i + 1) + "." + this.model.Nav_Notify
|
||||||
|
|||||||
@ -29,10 +29,10 @@
|
|||||||
<u--input v-if="model.Nav_Notify" v-model="model.Nav_Notify.TRAIN_TEACHER" border="none" slot="right" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
|
<u--input v-if="model.Nav_Notify" v-model="model.Nav_Notify.TRAIN_TEACHER" border="none" slot="right" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="培训形式:" prop="" borderBottom>
|
<u-form-item label="培训形式:" prop="" borderBottom>
|
||||||
<u--input v-if="model.Nav_Notify" v-model="model.TRAIN_MODEL" border="none" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
|
<u--input v-if="model.Nav_Notify" v-model="model.Nav_Notify.TRAINTYPE_SHOW" border="none" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="考核方式:" prop="Nav_TrainCheckType.NAME" borderBottom>
|
<u-form-item label="考核方式:" prop="Nav_TrainCheckType.NAME" borderBottom>
|
||||||
<u--input v-if="model.Nav_Notify" v-model="model.Nav_Notify.CHECKTYPE_NAME" border="none" slot="right" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
|
<u--input v-if="model.Nav_Notify" v-model="model.Nav_Notify.CHECKTYPE_SHOW" border="none" slot="right" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="培训内容:" prop="TRAINCONTENT" borderBottom>
|
<u-form-item label="培训内容:" prop="TRAINCONTENT" borderBottom>
|
||||||
<u-textarea autoHeight v-html="model.TRAINCONTENT" border="none" disabled></u-textarea>
|
<u-textarea autoHeight v-html="model.TRAINCONTENT" border="none" disabled></u-textarea>
|
||||||
@ -52,7 +52,7 @@
|
|||||||
</u-form-item>
|
</u-form-item>
|
||||||
<rich-text autoHeight v-html="model.Users" border="none" disabled style="font-size: 14px;"></rich-text>
|
<rich-text autoHeight v-html="model.Users" border="none" disabled style="font-size: 14px;"></rich-text>
|
||||||
<view style="margin-top: 10px;">
|
<view style="margin-top: 10px;">
|
||||||
<u-button type="primary" class="bottom" v-if='isLoadOK&&tableKey!=1&&model.Nav_Notify.CHECKTYPE==51' @click="openTest(model.ID)">查看试卷</u-button>
|
<u-button type="primary" class="bottom" v-if='isLoadOK&&tableKey!=1&&model.Nav_Notify.Nav_TrainCheckType.NAME=="笔试"' @click="openTest(model.ID)">查看试卷</u-button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</u--form>
|
</u--form>
|
||||||
@ -93,29 +93,57 @@
|
|||||||
listPropUpload: ['RECORD_ID'],
|
listPropUpload: ['RECORD_ID'],
|
||||||
listPropValUpload: [],
|
listPropValUpload: [],
|
||||||
isAgree: false,
|
isAgree: false,
|
||||||
Lists:[]
|
enumsData: {}, // 存储所有枚举数据(键:枚举名称,值:处理后的枚举列表)
|
||||||
|
enumsText: {}, // 存储枚举文本列表(用于下拉选择等场景)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.model.ID = option.ID;
|
this.model.ID = option.ID;
|
||||||
this.TaskID = option.taskID;
|
this.TaskID = option.taskID;
|
||||||
this.tableKey = option.tableKey ? option.tableKey : '0'
|
this.tableKey = option.tableKey ? option.tableKey : '0'
|
||||||
this.getEnums()
|
this.fetchEnums(['TrainType', 'PlanCheckType']);
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getEnums(){
|
async fetchEnums(enumNames) {
|
||||||
var dataParm = {
|
try {
|
||||||
'name': "PlanCheckType"
|
// 存储所有枚举请求的Promise
|
||||||
}
|
const enumPromises = enumNames.map(name => {
|
||||||
getEnum(dataParm).then(res => {
|
return getEnum({
|
||||||
this.Lists = res.map(i => {
|
name
|
||||||
|
}).then(res => {
|
||||||
|
// 统一处理枚举格式:添加name/code字段,便于后续映射
|
||||||
return {
|
return {
|
||||||
...i,
|
enumName: name,
|
||||||
name: i.NAME,
|
data: res.map(item => ({
|
||||||
|
...item,
|
||||||
|
name: item.NAME, // 统一显示名称字段
|
||||||
|
code: item.ID // 统一值字段
|
||||||
|
}))
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 等待所有枚举请求完成
|
||||||
|
const results = await Promise.all(enumPromises);
|
||||||
|
// 存储枚举结果到data中(键为枚举名称,值为处理后的数据)
|
||||||
|
results.forEach(({
|
||||||
|
enumName,
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
|
this.enumsData[enumName] = data;
|
||||||
|
// 生成文本列表(如需要)
|
||||||
|
this.enumsText[enumName] = data.map(item => item.name);
|
||||||
|
});
|
||||||
|
// 所有枚举获取完成后,执行loadData
|
||||||
|
this.loadData();
|
||||||
|
} catch (error) {
|
||||||
|
console.error('枚举请求失败:', error);
|
||||||
|
uni.showToast({
|
||||||
|
title: '枚举数据加载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
|
||||||
this.loadData()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
loadData() {
|
loadData() {
|
||||||
const json = initFilter(this.ORG_ID, "", "", 1)
|
const json = initFilter(this.ORG_ID, "", "", 1)
|
||||||
@ -123,7 +151,7 @@
|
|||||||
extendInclude(json, 'Nav_Notify.Nav_LaunchDepartment');
|
extendInclude(json, 'Nav_Notify.Nav_LaunchDepartment');
|
||||||
extendInclude(json, 'Nav_Notify.Nav_LaunchUser');
|
extendInclude(json, 'Nav_Notify.Nav_LaunchUser');
|
||||||
extendInclude(json, 'Nav_Notify.Nav_TrainType');
|
extendInclude(json, 'Nav_Notify.Nav_TrainType');
|
||||||
// extendInclude(json, 'Nav_Notify.Nav_TrainCheckType');
|
extendInclude(json, 'Nav_Notify.Nav_TrainCheckType');
|
||||||
extendInclude(json, 'Nav_Notify.Nav_TrainContentList');
|
extendInclude(json, 'Nav_Notify.Nav_TrainContentList');
|
||||||
extendInclude(json, 'Nav_Notify.Nav_TrainContentList.Nav_Point');
|
extendInclude(json, 'Nav_Notify.Nav_TrainContentList.Nav_Point');
|
||||||
extendInclude(json, 'Nav_Users.Nav_User');
|
extendInclude(json, 'Nav_Users.Nav_User');
|
||||||
@ -174,7 +202,8 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.model.Nav_Notify.CHECKTYPE_NAME = res.Nav_Notify.CHECKTYPE !== undefined ? this.Lists.find(item => item.ID === res.Nav_Notify.CHECKTYPE).name : '';
|
this.model.Nav_Notify.TRAINTYPE_SHOW = res.Nav_Notify.TRAINTYPE !== undefined ? this.enumsData['TrainType'].find(item => item.code === res.Nav_Notify.TRAINTYPE).name : '';
|
||||||
|
this.model.Nav_Notify.CHECKTYPE_SHOW = res.Nav_Notify.CHECKTYPE !== undefined ? this.enumsData['PlanCheckType'].find(item => item.code === res.Nav_Notify.CHECKTYPE).name : '';
|
||||||
this.model.TRAIN_MODEL = this.returnModel(this.model.Nav_Notify.TRAIN_MODEL);
|
this.model.TRAIN_MODEL = this.returnModel(this.model.Nav_Notify.TRAIN_MODEL);
|
||||||
this.model.LEVEL = this.transLevel(this.model.Nav_Notify.LEVEL);
|
this.model.LEVEL = this.transLevel(this.model.Nav_Notify.LEVEL);
|
||||||
this.model.TRAIN_TIME = this.model.Nav_Notify.TRAIN_START_TIME?.substring(0, 16) + "~" + this
|
this.model.TRAIN_TIME = this.model.Nav_Notify.TRAIN_START_TIME?.substring(0, 16) + "~" + this
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user