终端培训更新

This commit is contained in:
Yuanjianghong 2021-10-28 19:51:52 +08:00
parent a7e8633c2e
commit aa17681e80
4 changed files with 256 additions and 27 deletions

View File

@ -3,16 +3,18 @@ import request from '@/utils/request'
const terminalTrainApi = {
edit: '/project/terminal/addOrUpdate',
del: '/project/terminal/del',
list: '/project/terminal/pageList'
list: '/project/terminal/pageList',
get: '/project/terminal/get'
}
export function terminalTrainEdit(params) {
return request({
url: terminalTrainApi.add,
url: terminalTrainApi.edit,
method: 'post',
data: params
})
}
export function terminalTrainDel (params) {
return request({
url: terminalTrainApi.del,
@ -20,6 +22,7 @@ export function terminalTrainDel (params) {
params: params
})
}
export function terminalTrainList(params) {
console.log("terminalTrainList------------{}", params)
return request({
@ -28,3 +31,13 @@ export function terminalTrainList(params) {
params: params
})
}
export function terminalTrainGet(params) {
console.log("terminalTrainGet------------{}", params)
return request({
url: terminalTrainApi.get,
method: 'get',
params: params
})
}

View File

@ -0,0 +1,66 @@
<template>
<a-card :bordered="false" title="终端培训详情">
<template slot="extra">
<a-button size="small" @click="close">返回</a-button>
</template>
<a-descriptions title="" layout="horizontal" bordered size="small" :column="1">
<a-descriptions-item label="培训名称">{{ detailData.trainName }}</a-descriptions-item>
<a-descriptions-item label="培训时间"
>{{ detailData.trainSdate }} {{ detailData.trainEdate }}</a-descriptions-item
>
<a-descriptions-item label="主持人">{{ detailData.host }}</a-descriptions-item>
<a-descriptions-item label="会议人数">{{ detailData.personNum }}</a-descriptions-item>
<a-descriptions-item label="学习内容">{{ detailData.learningContent }}</a-descriptions-item>
<a-descriptions-item label="联系人">{{ detailData.contact }}:{{ detailData.phone }}</a-descriptions-item>
<a-descriptions-item label="备注">{{ detailData.remark }}</a-descriptions-item>
</a-descriptions>
<br />
<div style="width: 100%; height: 32px; margin-bottom: 8px">
<a-button type="primary"> </a-button>
<a-button type="primary">会议签到信息</a-button>
</div>
</a-card>
</template>
<script>
import { terminalTrainGet } from '@/api/project/terminalTrain'
export default {
components: {
terminalTrainGet,
},
data() {
return {
queryParam: { id: this.$route.query.terminalTrainId },
detailData: {},
}
},
created: function () {
let parameter = {}
terminalTrainGet(Object.assign(parameter, this.queryParam)).then((res) => {
this.detailData = res.data
})
},
methods: {
close() {
this.$router.push({
path: '/project/project/terminalTrain/list',
query: {
terminalTrainName: this.$route.query.terminalTrainName,
terminalTrainStatus: this.$route.query.terminalTrainStatus,
terminalTrainStartDate: this.$route.query.terminalTrainStartDate,
terminalTrainEndDate: this.$route.query.terminalTrainEndDate,
terminalTrainPageNum: this.$route.query.terminalTrainPageNum,
},
})
},
},
}
</script>
<style>
.ant-descriptions-item-label {
width: 100px;
text-align: center;
}
</style>

View File

@ -0,0 +1,96 @@
<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>
</a-card>
</template>
<script>
//jsjsjson
//import from ''
export default {
//import使
components: {},
props: {},
data() {
//
return {
form: {},
titleName: '新增终端培训',
}
},
// data
computed: {},
//data
watch: {},
//
methods: {
saveTrain() {},
},
created() {}, // - 访this
mounted() {}, // - 访DOM
beforeCreate() {}, // -
beforeMount() {}, // -
beforeUpdate() {}, // -
updated() {}, // -
beforeDestroy() {}, // -
destroyed() {}, // -
activated() {}, //keep-alive
}
</script>
<style scoped>
</style>

View File

@ -11,6 +11,9 @@
}
"
></SearchCom>
<a-space class="table-operator" direction="horizontal">
<a-button v-if="hasPerm('project:edit')" type="primary" icon="plus" @click="handledCreate">新增项目</a-button>
</a-space>
</div>
<s-table ref="table" size="default" rowKey="id" :columns="columns" :data="loadData">
<span slot="serial" slot-scope="text, record, index">
@ -19,10 +22,10 @@
<template slot="action" slot-scope="text, record">
<a-dropdown
v-if="
hasPerm('archives:user:autotrain:list') ||
hasPerm('archives:user:terminaltrain:list') ||
hasPerm('archives:user:selfStudy:list') ||
hasPerm('archives:user:violation:list')
hasPerm('terminal:train:list') ||
hasPerm('terminal:train:edit') ||
hasPerm('terminal:train:del') ||
hasPerm('terminal:train:release')
"
>
<a class="ant-dropdown-link"
@ -30,17 +33,21 @@
<a-icon type="down" />
</a>
<a-menu slot="overlay">
<a-menu-item v-if="hasPerm('archives:user:autotrain:list') || hasPerm('archives:user:terminaltrain:list')">
<a href="javascript:;" @click="archivesProject(record)">发布</a>
<a-menu-item v-if="hasPerm('terminal:train:release')">
<a href="javascript:;" @click="executeRelease(record)">发布</a>
</a-menu-item>
<a-menu-item v-if="hasPerm('archives:user:selfStudy:list')">
<a href="javascript:;" @click="archivesSelfStudy(record)">详情</a>
<a-menu-item v-if="hasPerm('terminal:train:list')">
<a href="javascript:;" @click="getDetail(record)">详情</a>
</a-menu-item>
<a-menu-item v-if="hasPerm('archives:user:violation:list')">
<a href="javascript:;" @click="archivesViolation(record)">修改</a>
<a-menu-item v-if="hasPerm('terminal:train:edit')">
<a href="javascript:;" @click="executeEdit(record)">修改</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="是否删除?" @confirm="() => delTerminalTrain(record)">
<a-popconfirm
v-if="hasPerm('terminal:train:del')"
title="是否删除?"
@confirm="() => delTerminalTrain(record)"
>
<a href="javascript:;">删除</a>
</a-popconfirm>
</a-menu-item>
@ -65,10 +72,10 @@ export default {
//
return {
queryParam: {
status: this.$route.query.terminalTrainQueryProjectStatus || null,
name: this.$route.query.terminalTrainQueryProjectName || null,
startDate: this.$route.query.terminalTrainQueryStartDate || null,
endDate: this.$route.query.terminalTrainQueryEndDate || null,
status: this.$route.query.terminalTrainStatus || null,
name: this.$route.query.terminalTrainName || null,
startDate: this.$route.query.terminalTrainStartDate || null,
endDate: this.$route.query.terminalTrainEndDate || null,
},
columns: [
{
@ -117,8 +124,6 @@ export default {
],
loadData: (parameter) => {
return terminalTrainList(Object.assign(parameter, this.queryParam)).then((res) => {
const record = {signNum : 20, personNum: 40}
console.log(record.signNum + '/' + record.personNum)
return res
})
},
@ -157,14 +162,63 @@ export default {
console.log('handleRefresh', this.queryParam)
this.$refs.table.refresh(bool)
},
//
delTerminalTrain(record) {
console.log("delete Id:",record.id)
terminalTrainDel({ids:record.id}).then((res => {
console.log('delete Id:', record.id)
terminalTrainDel({ ids: record.id }).then((res) => {
console.log(res)
if (res.code == 200) {
this.$message.info('删除成功')
}
}))
})
},
//
executeRelease(record) {
console.log('发布项目 id:', record.id)
},
//
getDetail(record) {
this.$router.push({
path: '/project/terminalTrain/detail',
query: {
terminalTrainId: record.id,
terminalTrainName: this.$route.query.terminalTrainName,
terminalTrainStatus: this.$route.query.terminalTrainStatus,
terminalTrainStartDate: this.$route.query.terminalTrainStartDate,
terminalTrainEndDate: this.$route.query.terminalTrainEndDate,
terminalTrainPageNum: this.$route.query.terminalTrainPageNum,
},
})
console.log('跳转详情页面 id:', record.id)
},
//
executeEdit(record) {
this.$router.push({
path: '/project/terminalTrain/form',
query: {
type: 2, //
terminalTrainName: this.$route.query.terminalTrainName,
terminalTrainStatus: this.$route.query.terminalTrainStatus,
terminalTrainStartDate: this.$route.query.terminalTrainStartDate,
terminalTrainEndDate: this.$route.query.terminalTrainEndDate,
terminalTrainPageNum: this.$route.query.terminalTrainPageNum,
},
})
console.log('编辑 id:', record)
},
handledCreate() {
this.$router.push({
path: '/project/terminalTrain/form',
query: {
type: 1, //
terminalTrainName: this.$route.query.terminalTrainName,
terminalTrainStatus: this.$route.query.terminalTrainStatus,
terminalTrainStartDate: this.$route.query.terminalTrainStartDate,
terminalTrainEndDate: this.$route.query.terminalTrainEndDate,
terminalTrainPageNum: this.$route.query.terminalTrainPageNum,
},
})
console.log('新增')
},
},
created() {}, // - 访this