终端培训更新
This commit is contained in:
parent
5f1d4b31fd
commit
418d8dce3d
|
@ -38,6 +38,8 @@ export function terminalTrainGet(params) {
|
|||
return request({
|
||||
url: terminalTrainApi.get,
|
||||
method: 'get',
|
||||
params: params
|
||||
params: {
|
||||
id:params,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,59 +1,37 @@
|
|||
<template>
|
||||
<a-card :bordered="false" :title="titleName">
|
||||
<a-form-model @submit="handleSubmit" :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" layout="horizontal">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="24" :sm="24">
|
||||
<a-form-model-item label="培训名称">
|
||||
<a-input v-model="form.trainName" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="培训时间" style="margin-bottom: 0">
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
|
||||
<a-date-picker v-model="form.trainSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||
</a-form-item>
|
||||
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
|
||||
<a-date-picker v-model="form.trainEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||
</a-form-item>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="24" :sm="24">
|
||||
<a-form-model-item label="主持人">
|
||||
<a-input v-model="form.host" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :md="24" :sm="24">
|
||||
<a-form-model-item label="会议人数">
|
||||
<a-input-number v-model="form.personNum" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="学习内容">
|
||||
<a-input v-model="form.learningContent" type="textarea" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :md="12" :sm="12">
|
||||
<a-form-model-item label="联系人">
|
||||
<a-input v-model="form.contact" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :md="12" :sm="12">
|
||||
<a-form-model-item label="联系方式">
|
||||
<a-input v-model="form.phone" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="备注">
|
||||
<a-input v-model="form.remark" type="textarea" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item :wrapper-col="{ span: 14, offset: 4 }">
|
||||
<a-button type="primary" @click="saveTrain"> 保存 </a-button>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-form-model @submit="handleSubmit" :model="form" >
|
||||
<a-form-model-item label="培训名称">
|
||||
<a-input v-model="form.trainName" />
|
||||
</a-form-model-item>
|
||||
<a-form-item label="培训时间" style="margin-bottom: 0">
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
|
||||
<a-date-picker v-model="form.trainSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||
</a-form-item>
|
||||
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
|
||||
<a-date-picker v-model="form.trainEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||
</a-form-item>
|
||||
</a-form-item>
|
||||
<a-form-model-item label="主持人">
|
||||
<a-input v-model="form.host" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="会议人数">
|
||||
<a-input-number v-model="form.personNum" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="学习内容">
|
||||
<a-input v-model="form.learningContent" type="textarea" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="联系人">
|
||||
<a-input v-model="form.contact" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="联系方式">
|
||||
<a-input v-model="form.phone" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="备注">
|
||||
<a-input v-model="form.remark" type="textarea" />
|
||||
</a-form-model-item>
|
||||
<a-button htmlType="submit" type="primary"> 保存 </a-button>
|
||||
</a-form-model>
|
||||
</a-card>
|
||||
</template>
|
||||
|
@ -61,15 +39,31 @@
|
|||
<script>
|
||||
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
||||
//例如:import 《组件名称》 from '《组件路径》'
|
||||
import { terminalTrainEdit, terminalTrainGet } from '@/api/project/terminalTrain'
|
||||
|
||||
export default {
|
||||
//import引入的组件需要注入到对象中才能使用
|
||||
components: {},
|
||||
components: {
|
||||
terminalTrainEdit,
|
||||
terminalTrainGet,
|
||||
},
|
||||
props: {},
|
||||
data() {
|
||||
//这里存放数据
|
||||
return {
|
||||
form: {},
|
||||
form: {
|
||||
id: '',
|
||||
orgId: '',
|
||||
trainName: '',
|
||||
trainSdate: '',
|
||||
trainEdate: '',
|
||||
host: '',
|
||||
personNum: 1,
|
||||
learningContent: '',
|
||||
contact: '',
|
||||
phone: '',
|
||||
remark: '',
|
||||
},
|
||||
titleName: '新增终端培训',
|
||||
}
|
||||
},
|
||||
|
@ -79,9 +73,31 @@ export default {
|
|||
watch: {},
|
||||
//方法集合
|
||||
methods: {
|
||||
saveTrain() {},
|
||||
handleSubmit(e) {
|
||||
console.log('提交的数据', this.form)
|
||||
terminalTrainEdit(this.form).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$message.success('新增成功')
|
||||
this.handleCancel()
|
||||
} else {
|
||||
this.$message.error('新增失败:' + res.msg)
|
||||
this.handleCancel()
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {}, //生命周期 - 创建完成(可以访问当前this实例)
|
||||
created() {
|
||||
if(this.$route.query.id){
|
||||
this.form = terminalTrainGet(this.$route.query.id).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.form = res.data;
|
||||
} else {
|
||||
this.$message.error('获取数据失败:' + res.msg)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}, //生命周期 - 创建完成(可以访问当前this实例)
|
||||
mounted() {}, //生命周期 - 挂载完成(可以访问DOM元素)
|
||||
beforeCreate() {}, //生命周期 - 创建之前
|
||||
beforeMount() {}, //生命周期 - 挂载之前
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<a href="javascript:;" @click="getDetail(record)">详情</a>
|
||||
</a-menu-item>
|
||||
<a-menu-item v-if="hasPerm('terminal:train:edit')">
|
||||
<a href="javascript:;" @click="executeEdit(record)">修改</a>
|
||||
<a href="javascript:;" @click="executeEdit(record)">编辑</a>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a-popconfirm
|
||||
|
@ -196,7 +196,7 @@ export default {
|
|||
this.$router.push({
|
||||
path: '/project/terminalTrain/form',
|
||||
query: {
|
||||
type: 2, //编辑
|
||||
id: record.id, //编辑
|
||||
terminalTrainName: this.$route.query.terminalTrainName,
|
||||
terminalTrainStatus: this.$route.query.terminalTrainStatus,
|
||||
terminalTrainStartDate: this.$route.query.terminalTrainStartDate,
|
||||
|
|
Loading…
Reference in New Issue