终端培训更新

This commit is contained in:
Yuanjianghong 2021-11-01 20:51:15 +08:00
parent 5f1d4b31fd
commit 418d8dce3d
3 changed files with 79 additions and 61 deletions

View File

@ -38,6 +38,8 @@ export function terminalTrainGet(params) {
return request({
url: terminalTrainApi.get,
method: 'get',
params: params
params: {
id:params,
}
})
}

View File

@ -1,13 +1,9 @@
<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 @submit="handleSubmit" :model="form" >
<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" />
@ -17,43 +13,25 @@
<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-button htmlType="submit" type="primary"> 保存 </a-button>
</a-form-model>
</a-card>
</template>
@ -61,15 +39,31 @@
<script>
//jsjsjson
//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() {}, // -

View File

@ -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,