培训通知 培训记录 字段修改

This commit is contained in:
yunkexin 2026-01-08 11:51:19 +08:00
parent 13cfbde0c6
commit a90a8ab907
4 changed files with 244 additions and 146 deletions

View File

@ -3,71 +3,51 @@
<view class="card">
<view class="background"></view>
<view>
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="model" :rules="rules"
ref="wForm" errorType="border-bottom" class="demo-ruleForm">
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="model" :rules="rules" ref="wForm" errorType="border-bottom" class="demo-ruleForm">
<u-form-item required label="培训名称" prop="NAME" borderBottom>
<u--input v-model="model.NAME" border="none" slot="right" inputAlign="right" fontSize="14px"
placeholder="请输入培训名称"></u--input>
<u--input v-model="model.NAME" border="none" slot="right" inputAlign="right" fontSize="14px" placeholder="请输入培训名称"></u--input>
</u-form-item>
<u-form-item required label="培训类型" prop="Nav_TrainType.NAME" borderBottom
@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-form-item required label="培训类型" prop="Nav_TrainType.NAME" borderBottom @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-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
</u-icon>
</u-form-item>
<u-form-item required label="培训级别" prop="LEVEL" borderBottom
@click="handleShowSheet({title: '层级', name: 'LEVEL'})">
<u--input :value="model.LEVEL_SHOW" placeholder="请选择层级" border="none" inputAlign="right"
disabled disabledColor="#fff" fontSize="14px"></u--input>
<u-form-item required label="培训级别" prop="LEVEL" borderBottom @click="handleShowSheet({title: '层级', name: 'LEVEL'})">
<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-form-item>
<u-form-item label="开始时间" required prop="TRAIN_START_TIME" borderBottom
@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-form-item label="开始时间" required prop="TRAIN_START_TIME" borderBottom @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"
customStyle="margin:0px;display:flex;padding:3px 0px" inputAlign="right">
</u--input>
</u-form-item>
<u-form-item label="结束时间" required prop="TRAIN_END_TIME" borderBottom
@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-form-item label="结束时间" required prop="TRAIN_END_TIME" borderBottom @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"
inputAlign="right" customStyle="margin:0px;display:flex;padding:3px 0px">
</u--input>
</u-form-item>
<u-form-item required label="培训地点" prop="TRAIN_ADDR" borderBottom>
<u--input v-model="model.TRAIN_ADDR" border="none" slot="right" inputAlign="right"
fontSize="14px" placeholder="请填写培训地点"></u--input>
<u--input v-model="model.TRAIN_ADDR" border="none" slot="right" inputAlign="right" fontSize="14px" placeholder="请填写培训地点"></u--input>
</u-form-item>
<u-form-item required label="培训学时" prop="HOURS" borderBottom>
<u--input v-model="model.HOURS" type="number" border="none" slot="right" placeholder="请填写培训学时"
inputAlign="right" fontSize="14px"></u--input>
<u--input v-model="model.HOURS" type="number" border="none" slot="right" placeholder="请填写培训学时" inputAlign="right" fontSize="14px"></u--input>
</u-form-item>
<u-form-item required label="培训老师" prop="TRAIN_TEACHER" borderBottom>
<u--input v-model="model.TRAIN_TEACHER" border="none" slot="right" placeholder="请填写培训老师"
inputAlign="right" fontSize="14px"></u--input>
<u--input v-model="model.TRAIN_TEACHER" border="none" slot="right" placeholder="请填写培训老师" inputAlign="right" fontSize="14px"></u--input>
</u-form-item>
<u-form-item required label="培训形式" prop="TRAIN_MODEL" borderBottom
@click="handleShowSheet({title: '培训形式', name: 'TRAIN_MODEL'})">
<u--input :value="model.TRAIN_MODEL_SHOW" placeholder="请选择培训形式" border="none" inputAlign="right"
disabled disabledColor="#fff" fontSize="14px"></u--input>
<u-form-item required label="培训形式" prop="TRAIN_MODEL" borderBottom @click="handleShowSheet({title: '培训形式', name: 'TrainType'})">
<u--input v-model="model.TRAINTYPE_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-form-item>
<u-form-item required label="考核方式" prop="Nav_TrainCheckType.NAME" borderBottom
@click="handleChange('Nav_TrainCheckType','')">
<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-form-item required label="考核方式" prop="Nav_TrainCheckType.NAME" borderBottom @click="handleShowSheet({title: '培训形式', name: 'PlanCheckType'})">
<u--input v-model="model.CHECKTYPE_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-form-item>
<u-form-item required class="custom-form-item" label="培训内容" prop="DetailPost" borderBottom
@click="handleQuerySelect({ formIndex: 'Nav_TrainContentList', isMultiple: true})">
<u-form-item required class="custom-form-item" label="培训内容" prop="DetailPost" borderBottom @click="handleQuerySelect({ formIndex: 'Nav_TrainContentList', isMultiple: true})">
<view slot="right" class="custom-form-item-right">
<view class="multi">
<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>
<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>
</view>
<u-icon class="icon" name="arrow-down" size="12">
</u-icon>
@ -76,52 +56,37 @@
<u-form-item label="培训安排及要求" prop="TRAIN_PLAN" borderBottom>
</u-form-item>
<u--textarea required v-model="model.TRAIN_PLAN" border="surround"></u--textarea>
<u-form-item label="是否需要培训效果评估" prop="NEED_EVALUATION" borderBottom
@click="handleShowSheet({title: '是否需要培训效果评估', name: 'NEED_EVALUATION'})">
<u--input :value="model.NEED_EVALUATION_SHOW" placeholder="请选择" border="none" inputAlign="right"
disabled disabledColor="#fff"></u--input>
<u-form-item label="是否需要培训效果评估" prop="NEED_EVALUATION" borderBottom @click="handleShowSheet({title: '是否需要培训效果评估', name: 'NEED_EVALUATION'})">
<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-form-item>
<u-form-item label="是否触发培训记录" prop="CREATE_NOTIFY_RECORD" borderBottom>
<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>
<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>
</u-form-item>
<u-form-item required label="记录人员" prop="Nav_RecordUser.NAME" borderBottom
@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-form-item required label="记录人员" prop="Nav_RecordUser.NAME" borderBottom @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-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
</u-icon>
</u-form-item>
<view class="upload-title">附件</view>
<full-upload v-model="model.Nav_Files" :isShowBtn='true' :listProp='listPropUpload'
:listPropVal='listPropValUpload'></full-upload>
<full-upload v-model="model.Nav_Files" :isShowBtn='true' :listProp='listPropUpload' :listPropVal='listPropValUpload'></full-upload>
<u-form-item required label="培训人员">
<u-icon name="man-add" @click="handleShowUserSelector()" size="24" color="#3d9cff"
slot="right"></u-icon>
<u-icon name="man-add" @click="handleShowUserSelector()" size="24" color="#3d9cff" slot="right"></u-icon>
</u-form-item>
<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)"
:key="k" :inverted="true" :text="i.NAME" type="primary" />
<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" />
</view>
</u--form>
</view>
</view>
<query-selector :show="showPopup" :lists="Lists" @close="handleClosePopup" @search="handleSearch"
@select="handleSelected" />
<u-picker :show="comPickerInfo.showSheet" :columns="comPickerInfo.columns" @confirm="onConfirmPicker"
:defaultIndex="[0]" @close="closePicker" @cancel="closePicker" keyName="NAME"></u-picker>
<query-selector :show="showPopup" :lists="Lists" @close="handleClosePopup" @search="handleSearch" @select="handleSelected" />
<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>
<u-datetime-picker :show="dateTimePickerInfo.showCheckDate" mode="datetime"
v-model='dateTimePickerInfo.defaultDateTime' :formatter="formatter" @confirm="handleCheckDate"
@close="dateTimePickerInfo.showCheckDate = false;"
@cancel="dateTimePickerInfo.showCheckDate = false;"></u-datetime-picker>
<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">
<u-datetime-picker :show="dateTimePickerInfo.showCheckDate" mode="datetime" v-model='dateTimePickerInfo.defaultDateTime' :formatter="formatter" @confirm="handleCheckDate"
@close="dateTimePickerInfo.showCheckDate = false;" @cancel="dateTimePickerInfo.showCheckDate = false;"></u-datetime-picker>
<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>
<view class="bottom-button">
<u-button type="primary" @click="submit" color="#3d4b70">提交</u-button>
@ -145,7 +110,7 @@
} from '../../../../services/apply/FOServices/FOServices';
import {
getEnum
} from '../../../../services/common'
} from '../../../../services/common';
export default {
data() {
return {
@ -266,21 +231,65 @@
name: ''
},
formatter: null,
enumsData: {}, //
enumsText: {}, //
}
},
onLoad(option) {
this.TaskID = option.taskID ? option.taskID : '';
this.model.ID = option.ID ? option.ID : '';
this.tableKey = option.tableKey ? option.tableKey : '0';
if (option.isAdd != 1) {
this.loadData();
} else {
this.isAdd = 1;
this.model.ID = guid();
this.model.CREATE_NOTIFY_RECORD = true;
}
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();
} else {
this.isAdd = 1;
this.model.ID = guid();
this.model.CREATE_NOTIFY_RECORD = true;
}
} catch (error) {
console.error('枚举请求失败:', error);
uni.showToast({
title: '枚举数据加载失败',
icon: 'none'
});
}
},
changeSwitch(e) {
this.model.CREATE_NOTIFY_RECORD = e;
},
@ -352,10 +361,7 @@
})
})
} else if (this.currSearchType == "Nav_TrainCheckType") {
var dataParm = {
'name': "PlanCheckType"
}
getEnum(dataParm).then(res => {
getRequest(json, "/SE/TrainCheckTypeEnum/OrderPaged").then(res => {
this.Lists = res.map(i => {
return {
...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") {
getRequest(json, "/FM/FMUser/OrderPagedUseful").then(res => {
this.Lists = res.map(i => {
@ -390,7 +388,7 @@
this.model.TRAIN_TYPE = val.ID;
} else if (this.currSearchType == 'Nav_TrainCheckType') {
this.model.Nav_TrainCheckType = val;
this.model.CHECKTYPE = val.ID;
this.model.CHECK_TYPE_ID = val.ID;
} else if (this.currSearchType == 'Nav_RecordUser') {
this.model.Nav_RecordUser = val;
this.model.RECORD_USER_ID = val.ID;
@ -517,7 +515,7 @@
extendInclude(json, "Nav_TrainContentList.Nav_Point")
extendInclude(json, "Nav_LaunchDepartment")
extendInclude(json, "Nav_TrainType")
// extendInclude(json, "Nav_TrainCheckType")
extendInclude(json, "Nav_TrainCheckType")
extendInclude(json, "Nav_RecordUser")
extendInclude(json, "Nav_TrainContentList")
extendInclude(json, "Nav_TrainUserList.Nav_User.Nav_Person")
@ -527,6 +525,8 @@
getRequest(json, "/SE/TrainNotify/Get").then(res => {
this.model = res
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() {
@ -588,6 +588,8 @@
ID: 1
},
]
} else if (p.name == 'TrainType' || p.name == 'PlanCheckType') {
column = this.enumsData[p.name]
}
if (column.length) {
this.comPickerInfo = {
@ -606,8 +608,19 @@
name,
formIndex
} = this.comPickerInfo
this.model[name] = e.value[0].ID
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 + '_SHOW'] = e.value[0].NAME
}
this.comPickerInfo.showSheet = false
},
transLevel(level) {

View File

@ -49,11 +49,11 @@
disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<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>
</u-form-item>
<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>
</u-form-item>
<u-form-item label="培训内容:" prop="TRAINCONTENT" borderBottom>
@ -117,30 +117,56 @@
orgId: uni.getStorageSync('orgId'),
listPropUpload: ['NOTIFY_ID'],
listPropValUpload: [],
Lists: [],
enumsData: {}, //
enumsText: {}, //
}
},
onLoad(option) {
this.model.ID = option.ID;
this.TaskID = option.taskID;
this.tableKey = option.tableKey ? option.tableKey : '0'
this.getEnums()
this.fetchEnums(['TrainType', 'PlanCheckType']);
},
methods: {
getEnums(){
var dataParm = {
'name': "PlanCheckType"
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
this.loadData();
} catch (error) {
console.error('枚举请求失败:', error);
uni.showToast({
title: '枚举数据加载失败',
icon: 'none'
});
}
getEnum(dataParm).then(res => {
this.Lists = res.map(i => {
return {
...i,
name: i.NAME,
}
})
this.loadData()
})
},
loadData() {
const json = initFilter(this.orgId, "", "CODE", 1)
@ -148,7 +174,7 @@
extendInclude(json, 'Nav_LaunchDepartment');
extendInclude(json, 'Nav_LaunchUser');
extendInclude(json, 'Nav_TrainType');
// extendInclude(json, 'Nav_TrainCheckType');
extendInclude(json, 'Nav_TrainCheckType');
extendInclude(json, 'Nav_TrainContentList');
extendInclude(json, 'Nav_TrainContentList.Nav_Point');
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.LEVEL = this.transLevel(this.model.LEVEL);
this.model.TRAINCONTENT = trainContent;
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;
})
},

View File

@ -51,11 +51,11 @@
slot="right" inputAlign="right" fontSize="14px"></u--input>
</u-form-item>
<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>
</u-form-item>
<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>
</u-form-item>
<u-form-item class="custom-form-item" label="培训内容:" prop="DetailPost" :borderBottom="false">
@ -163,28 +163,56 @@
},
currItem: '',
formatter: null,
enumsData: {}, //
enumsText: {}, //
}
},
onLoad(option) {
this.TaskID = option.taskID ? option.taskID : '';
this.model.ID = option.ID ? option.ID : '';
this.tableKey = option.tableKey ? option.tableKey : '0';
this.getEnums();
this.fetchEnums(['TrainType', 'PlanCheckType']);
},
methods: {
getEnums(){
var dataParm = {
'name': "PlanCheckType"
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
this.loadData();
} catch (error) {
console.error('枚举请求失败:', error);
uni.showToast({
title: '枚举数据加载失败',
icon: 'none'
});
}
getEnum(dataParm).then(res => {
this.Lists = res.map(i => {
return {
...i,
name: i.NAME,
}
})
this.loadData()
})
},
sectionChange(index, item) {
item.STATUS = index;
@ -240,7 +268,7 @@
extendInclude(json, "Nav_Notify")
extendInclude(json, "Nav_Notify.Nav_TrainType")
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_Files.Nav_ImgFile")
extendRule(json, 'ID', 1, this.model.ID)
@ -255,6 +283,8 @@
} else if (this.model.Nav_Notify.LEVEL == 3) {
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 = "";
if (this.model.Nav_Notify.TRAIN_MODEL.indexOf(1) > 0) {
this.model.Nav_Notify.TRAIN_MODEL_SHOW += "讲授法 ";
@ -265,7 +295,6 @@
} else if (this.model.Nav_Notify.TRAIN_MODEL.indexOf(4) > 0) {
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 = "";
for (let i = 0; i < this.model.Nav_Notify.Nav_TrainContentList.length; i++) {
this.model.Nav_TrainContentList_SHOW += (i + 1) + "." + this.model.Nav_Notify

View File

@ -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-form-item>
<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 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 label="培训内容:" prop="TRAINCONTENT" borderBottom>
<u-textarea autoHeight v-html="model.TRAINCONTENT" border="none" disabled></u-textarea>
@ -52,7 +52,7 @@
</u-form-item>
<rich-text autoHeight v-html="model.Users" border="none" disabled style="font-size: 14px;"></rich-text>
<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>
</u--form>
@ -93,29 +93,57 @@
listPropUpload: ['RECORD_ID'],
listPropValUpload: [],
isAgree: false,
Lists:[]
enumsData: {}, //
enumsText: {}, //
}
},
onLoad(option) {
this.model.ID = option.ID;
this.TaskID = option.taskID;
this.tableKey = option.tableKey ? option.tableKey : '0'
this.getEnums()
this.fetchEnums(['TrainType', 'PlanCheckType']);
},
methods: {
getEnums(){
var dataParm = {
'name': "PlanCheckType"
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
this.loadData();
} catch (error) {
console.error('枚举请求失败:', error);
uni.showToast({
title: '枚举数据加载失败',
icon: 'none'
});
}
getEnum(dataParm).then(res => {
this.Lists = res.map(i => {
return {
...i,
name: i.NAME,
}
})
this.loadData()
})
},
loadData() {
const json = initFilter(this.ORG_ID, "", "", 1)
@ -123,7 +151,7 @@
extendInclude(json, 'Nav_Notify.Nav_LaunchDepartment');
extendInclude(json, 'Nav_Notify.Nav_LaunchUser');
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.Nav_Point');
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.LEVEL = this.transLevel(this.model.Nav_Notify.LEVEL);
this.model.TRAIN_TIME = this.model.Nav_Notify.TRAIN_START_TIME?.substring(0, 16) + "~" + this