终端培训更新

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({ return request({
url: terminalTrainApi.get, url: terminalTrainApi.get,
method: 'get', method: 'get',
params: params params: {
id:params,
}
}) })
} }

View File

@ -1,59 +1,37 @@
<template> <template>
<a-card :bordered="false" :title="titleName"> <a-card :bordered="false" :title="titleName">
<a-form-model @submit="handleSubmit" :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" layout="horizontal"> <a-form-model @submit="handleSubmit" :model="form" >
<a-row :gutter="24"> <a-form-model-item label="培训名称">
<a-col :md="24" :sm="24"> <a-input v-model="form.trainName" />
<a-form-model-item label="培训名称"> </a-form-model-item>
<a-input v-model="form.trainName" /> <a-form-item label="培训时间" style="margin-bottom: 0">
</a-form-model-item> <a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
</a-col> <a-date-picker v-model="form.trainSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
<a-col :span="24"> </a-form-item>
<a-form-item label="培训时间" style="margin-bottom: 0"> <span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }"> <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-date-picker v-model="form.trainEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
</a-form-item> </a-form-item>
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span> </a-form-item>
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }"> <a-form-model-item label="主持人">
<a-date-picker v-model="form.trainEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" /> <a-input v-model="form.host" />
</a-form-item> </a-form-model-item>
</a-form-item> <a-form-model-item label="会议人数">
</a-col> <a-input-number v-model="form.personNum" />
<a-col :md="24" :sm="24"> </a-form-model-item>
<a-form-model-item label="主持人"> <a-form-model-item label="学习内容">
<a-input v-model="form.host" /> <a-input v-model="form.learningContent" type="textarea" />
</a-form-model-item> </a-form-model-item>
</a-col> <a-form-model-item label="联系人">
<a-col :md="24" :sm="24"> <a-input v-model="form.contact" />
<a-form-model-item label="会议人数"> </a-form-model-item>
<a-input-number v-model="form.personNum" /> <a-form-model-item label="联系方式">
</a-form-model-item> <a-input v-model="form.phone" />
</a-col> </a-form-model-item>
<a-col :span="24"> <a-form-model-item label="备注">
<a-form-model-item label="学习内容"> <a-input v-model="form.remark" type="textarea" />
<a-input v-model="form.learningContent" type="textarea" /> </a-form-model-item>
</a-form-model-item> <a-button htmlType="submit" type="primary"> 保存 </a-button>
</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> </a-form-model>
</a-card> </a-card>
</template> </template>
@ -61,15 +39,31 @@
<script> <script>
//jsjsjson //jsjsjson
//import from '' //import from ''
import { terminalTrainEdit, terminalTrainGet } from '@/api/project/terminalTrain'
export default { export default {
//import使 //import使
components: {}, components: {
terminalTrainEdit,
terminalTrainGet,
},
props: {}, props: {},
data() { data() {
// //
return { return {
form: {}, form: {
id: '',
orgId: '',
trainName: '',
trainSdate: '',
trainEdate: '',
host: '',
personNum: 1,
learningContent: '',
contact: '',
phone: '',
remark: '',
},
titleName: '新增终端培训', titleName: '新增终端培训',
} }
}, },
@ -79,9 +73,31 @@ export default {
watch: {}, watch: {},
// //
methods: { 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 mounted() {}, // - 访DOM
beforeCreate() {}, // - beforeCreate() {}, // -
beforeMount() {}, // - beforeMount() {}, // -

View File

@ -40,7 +40,7 @@
<a href="javascript:;" @click="getDetail(record)">详情</a> <a href="javascript:;" @click="getDetail(record)">详情</a>
</a-menu-item> </a-menu-item>
<a-menu-item v-if="hasPerm('terminal:train:edit')"> <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-menu-item> <a-menu-item>
<a-popconfirm <a-popconfirm
@ -196,7 +196,7 @@ export default {
this.$router.push({ this.$router.push({
path: '/project/terminalTrain/form', path: '/project/terminalTrain/form',
query: { query: {
type: 2, // id: record.id, //
terminalTrainName: this.$route.query.terminalTrainName, terminalTrainName: this.$route.query.terminalTrainName,
terminalTrainStatus: this.$route.query.terminalTrainStatus, terminalTrainStatus: this.$route.query.terminalTrainStatus,
terminalTrainStartDate: this.$route.query.terminalTrainStartDate, terminalTrainStartDate: this.$route.query.terminalTrainStartDate,