Commit a321021d authored by wangqinghua's avatar wangqinghua

会议意向

parent b34972b9
...@@ -66,6 +66,21 @@ export const meetEnd = params =>req('get','/meeting/end',params); ...@@ -66,6 +66,21 @@ export const meetEnd = params =>req('get','/meeting/end',params);
//获取所有未上会的意向数据 //获取所有未上会的意向数据
export const getIntentionOfUnUse = params =>req('get','/intention/getIntentionOfUnUse',params); export const getIntentionOfUnUse = params =>req('get','/intention/getIntentionOfUnUse',params);
//会议中新增议程
export const addAgendaByMeet = params =>req('post','/agenda/addAgenda',params);
//会议中修改议程
export const updateAgendaByMeet = params =>req('post','/agenda/updateAgenda',params);
//会议中删除议程
export const removeAgendaByIdByMeet = params =>req('post','/agenda/removeAgendaById',params);
//会议中通过ID获取议程
export const getAgendaByIdByMeet = params =>req('get','/agenda/getAgendaById',params);
//意向列表分页
export const getIntentionPage = params =>req('get','/intention/getIntentionPage',params);
......
export function formatDate(date,fmt){
if(/(y+)/.test(fmt)){
fmt = fmt.replace(RegExp.$1, (date.getFullYear()+'').substr(4-RegExp.$1.length));
}
let o = {
'M+': date.getMonth()+1,
'd+': date.getDate(),
'h+': date.getHours(),
'm+': date.getMinutes(),
's+': date.getSeconds()
}
for(let k in o){
let str = o[k]+'';
if(new RegExp(`(${k})`).test(fmt)){
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length===1)?str:padLeftZero(str));
}    }
return fmt;
};
function padLeftZero(str){
return ('00'+str).substr(str.length);
}
...@@ -57,19 +57,19 @@ ...@@ -57,19 +57,19 @@
} }
}, },
mounted(){ mounted(){
getAttendInfoList().then(
(res)=>{
this.tableData = res.data
}
)
}, },
methods:{ methods:{
handleSelectionChange(val) { handleSelectionChange(val) {
console.log(val)
this.multipleSelection = val; this.multipleSelection = val;
}, },
showDialog(){ showDialog(){
this.dialogFormVisible = true; this.dialogFormVisible = true;
getAttendInfoList().then(
(res)=>{
this.tableData = res.data
}
)
}, },
submitList(){ submitList(){
this.dialogFormVisible = false; this.dialogFormVisible = false;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<el-col :span="18"> <el-col :span="18">
<div class="border padding-10-0"> <div class="border padding-10-0">
<template v-for="(item,i) in list"> <template v-for="(item,i) in list">
<p class="padding-5-10 pointer" :class="sIndex == i ? 'select':''" @click="selectIndex(i)"> {{item.name}}</p> <p class="padding-5-10 pointer" :class="sIndex == i ? 'select':''" @click="selectIndex(i)"> {{item.title}}</p>
</template> </template>
</div> </div>
</el-col> </el-col>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</el-row> </el-row>
</div> </div>
<div slot="footer" class="dialog-footer text-center"> <div slot="footer" class="dialog-footer text-center">
<el-button size="small" @click="dialogFormVisible = false">保存</el-button> <el-button size="small" @click="save()">保存</el-button>
<el-button size="small" @click="dialogFormVisible = false">关闭</el-button> <el-button size="small" @click="dialogFormVisible = false">关闭</el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -39,22 +39,17 @@ ...@@ -39,22 +39,17 @@
data(){ data(){
return{ return{
id:"", id:"",
title:"", title:"排序",
sIndex:null, sIndex:null,
dialogFormVisible:false, dialogFormVisible:false,
list:[] list:[]
} }
}, },
methods:{ methods:{
showDialog(title,id){ showDialog(list,type){
this.title = title this.list = list
this.type = type
this.dialogFormVisible = true this.dialogFormVisible = true
this.id = id
getByRefId({id:id}).then(
(res)=>{
}
)
}, },
// //
selectIndex(i){ selectIndex(i){
...@@ -64,12 +59,9 @@ ...@@ -64,12 +59,9 @@
toTop(){ toTop(){
if (this.sIndex != 0) { if (this.sIndex != 0) {
const index = this.sIndex const index = this.sIndex
// this.list.unshift( this.list.splice(this.sIndex,1)[0] )
const a = this.list.splice(index,1)[0] const a = this.list.splice(index,1)[0]
this.list.unshift(a) this.list.unshift(a)
this.sIndex = 0 this.sIndex = 0
// this.swapArray(this.list, this.sIndex, 0);
} else { } else {
this.$message.warning('已经处于顶部,无法置顶'); this.$message.warning('已经处于顶部,无法置顶');
} }
...@@ -99,6 +91,13 @@ ...@@ -99,6 +91,13 @@
this.sIndex = index2 this.sIndex = index2
arr[index1] = arr.splice(index2,1,arr[index1])[0] arr[index1] = arr.splice(index2,1,arr[index1])[0]
return arr return arr
},
save(){
const data = {
list:this.list,
type:this.type
}
this.$emit("update",this.list,type)
} }
} }
} }
......
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
) )
}, },
done(){ done(){
this.dialogFormVisible = false;
this.$emit('update',this.multipleSelection) this.$emit('update',this.multipleSelection)
} }
} }
......
<!--选择意向--> <!--选择特俗议程-->
<template> <template>
<div class="select-intention"> <div class="select-intention">
<el-dialog title="选择意向" :visible.sync="dialogFormVisible"> <el-dialog title="选择特俗议程" :visible.sync="dialogFormVisible">
<el-table <el-table
:data="tableData" :data="tableData"
tooltip-effect="dark" tooltip-effect="dark"
......
...@@ -2,20 +2,20 @@ ...@@ -2,20 +2,20 @@
<template> <template>
<div class="code"> <div class="code">
<el-dialog :title="title" :visible.sync="dialogFormVisible" :before-close="initForm"> <el-dialog :title="title" :visible.sync="dialogFormVisible" :before-close="initForm">
<el-checkbox @change="changeCheck" v-model="checked">特殊议程</el-checkbox> <el-checkbox class="margin-bottom-20" @change="changeCheck" v-model="checked">特殊议程</el-checkbox>
<el-form :model="form" :rules="rules" ref="form" label-width="100px"> <el-form :model="form" :rules="rules" ref="form" label-width="100px">
<el-form-item label="议程主题" prop="title" :label-width="formLabelWidth"> <el-form-item label="议程主题" prop="title" :label-width="formLabelWidth">
<el-input v-model="form.title" autocomplete="off"></el-input> <el-input :disabled="disabled" v-model="form.title" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="汇报处室" prop="url" :label-width="formLabelWidth"> <el-form-item label="汇报处室" prop="url" :label-width="formLabelWidth">
<el-input v-model="form.url" autocomplete="off"></el-input> <el-input :disabled="disabled" v-model="form.url" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="reportDep" :label-width="formLabelWidth"> <el-form-item label="备注" prop="remark" :label-width="formLabelWidth">
<el-input v-model="form.reportDep" autocomplete="off"></el-input> <el-input v-model="form.reportDep" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="列席人员" :label-width="formLabelWidth"> <el-form-item label="列席人员" :label-width="formLabelWidth">
<el-input :disabled="true" v-model="attendPerson" autocomplete="off"> <el-input :disabled="true" v-model="attendPerson" autocomplete="off">
<el-button @click="selectPerson" slot="append">选择</el-button> <el-button v-if="!disabled" @click="selectPerson" slot="append">选择</el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="相关附件" :label-width="formLabelWidth"> <el-form-item label="相关附件" :label-width="formLabelWidth">
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer text-center">
<el-button size="small" @click="initForm">取 消</el-button> <el-button size="small" @click="initForm">取 消</el-button>
<el-button size="small" type="primary" @click="submitForm('form')">确 定</el-button> <el-button size="small" type="primary" @click="submitForm('form')">确 定</el-button>
</div> </div>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</template> </template>
<script> <script>
import {updateSpecialAgenda, addSpecialAgenda,getSpecialAgendaById} from "../api/api" import {addAgendaByMeet, updateAgendaByMeet,getSpecialAgendaById,uploadFile} from "../api/api"
import AttendList from "./attendList"; import AttendList from "./attendList";
import SelectSpecialAgenda from "./selectSpecialAgenda"; import SelectSpecialAgenda from "./selectSpecialAgenda";
...@@ -52,17 +52,19 @@ ...@@ -52,17 +52,19 @@
name: "special-dialog", name: "special-dialog",
data() { data() {
return { return {
checked:"", checked:"", //是否选择特殊议程
fileList:[], fileList:[], //文件列表
title: "", title: "", //弹窗标题
id:"", id:"",
disabled:false,
attendPerson:"", attendPerson:"",
linkSpecial:"", linkSpecial:"", //选择特殊议程
form: { form: {
title: "", title: "",
reportDep: "", reportDep: "",
linkAttends: null, linkAttends: [],
remark:"", remark:"",
accessories:[]
}, },
rules:{ rules:{
title:[{required:true,message:"请输入议程名称",trigger:'blur'},{min:1,max:20,message:'长度在1到20个字符之间',trigger:'blur'}] title:[{required:true,message:"请输入议程名称",trigger:'blur'},{min:1,max:20,message:'长度在1到20个字符之间',trigger:'blur'}]
...@@ -92,23 +94,36 @@ ...@@ -92,23 +94,36 @@
) )
}, },
initForm() { initForm() {
this.disabled = false
this.linkSpecial = null
this.fileList = []
this.$refs['form'].resetFields(); this.$refs['form'].resetFields();
this.form = { this.form = {
title: "", title: "",
url: "",
reportDep: "", reportDep: "",
attendPerson: "", linkAttends: null,
ips: "", remark:"",
accessories:[]
} }
this.attendPerson = "" this.attendPerson = ""
this.dialogFormVisible = false this.dialogFormVisible = false
}, },
//选择列席人员 //选择列席人员弹窗
selectPerson(){ selectPerson(){
this.$refs.attendList.showDialog() this.$refs.attendList.showDialog()
}, },
handleUpload(){ handleUpload(file,fileList){
const formData = new FormData()
formData.append('file',file.raw)
uploadFile(formData).then(
(res)=>{
const d = {
name: res.data.name,
saveName: res.data.saveName,
}
this.form.accessories.push(d)
}
)
}, },
//选择特殊议程 //选择特殊议程
changeCheck(){ changeCheck(){
...@@ -121,13 +136,15 @@ ...@@ -121,13 +136,15 @@
this.form.linkAttends = "" this.form.linkAttends = ""
} }
}, },
//获取特殊议程 //获取特殊议程数据
getInfo(data){ getInfo(data){
this.disabled = data === null ? false: true
this.form.title = data.title this.form.title = data.title
this.form.remark = data.remark this.form.remark = data.remark
this.form.linkAttends = data.linkAttends this.form.linkAttends = data.linkAttends
this.linkSpecial = data.id this.linkSpecial = data.id
}, },
//选择列席人员
getPerson(data){ getPerson(data){
this.attendPerson = "" this.attendPerson = ""
this.form.linkAttends = data.map(e=>{ this.form.linkAttends = data.map(e=>{
...@@ -140,37 +157,50 @@ ...@@ -140,37 +157,50 @@
this.attendPerson = this.attendPerson.substr(0,this.attendPerson.length -1) this.attendPerson = this.attendPerson.substr(0,this.attendPerson.length -1)
}, },
//提交 //提交
submitForm(formName) { submitForm() {
this.$refs[formName].validate((valid)=>{ let data;
console.log(valid) this.form.accessories.forEach((e,index)=>{
console.log(this.form) e.sortNum = index +1
if(valid){
if (this.title == "添加议程") {
addSpecialAgenda(this.form).then(
(res) => {
this.dialogFormVisible = false;
this.$message.success('添加成功')
this.$emit('update', res.data)
this.form.name = ""
this.initForm()
}
)
} else {
this.form.id = this.id
updateSpecialAgenda(this.form).then(
(res) => {
this.dialogFormVisible = false;
this.$emit('update', res.data)
this.$message.success('编辑成功')
this.form.name = ""
this.initForm()
}
)
}
}else{
return false
}
}) })
if(this.checked){ //特殊议程
data = {
remark : this.form.remark,
accessories:this.form.accessories,
linkSpecial:this.linkSpecial
}
}else{
data = {
title:this.form.title,
reportDep:this.form.reportDep,
remark:this.form.remark,
linkAttends:this.form.linkAttends,
accessories:this.form.accessories,
}
}
if(this.title == '添加议程'){
this.create(data);
}else{
this.update(data)
}
},
create(data){
addAgendaByMeet(data).then(
(res)=>{
this.$message.success("新增议程成功")
this.dialogFormVisible = false
this.$emit('update',res.data)
this.initForm()
}
)
},
update(data){
updateAgendaByMeet(data).then(
(res)=>{
this.$message.success("修改议程成功")
this.dialogFormVisible = false
this.initForm()
}
)
} }
} }
} }
......
...@@ -7,20 +7,12 @@ ...@@ -7,20 +7,12 @@
<span>意向主题:</span> <span>意向主题:</span>
<el-input style="width: 180px;" size="small" <el-input style="width: 180px;" size="small"
placeholder="会议名称" placeholder="会议名称"
v-model="input1"> v-model="form.title">
</el-input> </el-input>
</el-col> </el-col>
<el-col :span="8"> <el-col :offset="8" class="text-right" :span="8">
<span>汇报处室:</span>
<el-input style="width: 180px;" size="small"
placeholder="会议名称"
v-model="input2">
</el-input>
</el-col>
<el-col class="text-right" :span="8">
<el-button size="small" plain>查询</el-button> <el-button size="small" plain>查询</el-button>
<el-button size="small" @click="handleAdd" plain>添加</el-button> <el-button size="small" @click="handleAdd" plain>添加</el-button>
<el-button size="small" @click="handleEdit" plain>编辑测试</el-button>
</el-col> </el-col>
</el-row> </el-row>
<div class="margin-20-0"> <div class="margin-20-0">
...@@ -31,16 +23,12 @@ ...@@ -31,16 +23,12 @@
width="90"> width="90">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="name" prop="title"
label="意向主题" label="意向主题"
width="180"> width="180">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="address" prop="remark"
label="汇报处室">
</el-table-column>
<el-table-column
prop="address"
cell-class-name="text-center" cell-class-name="text-center"
label="备注"> label="备注">
</el-table-column> </el-table-column>
...@@ -48,9 +36,14 @@ ...@@ -48,9 +36,14 @@
prop="address" prop="address"
cell-class-name="text-center" cell-class-name="text-center"
label="上会情况"> label="上会情况">
<template slot-scope="scope">
<span v-if="scope.row.currentStatus == 0">未上会</span>
<span v-if="scope.row.currentStatus == 1">待上会</span>
<span v-if="scope.row.currentStatus == 2">已上会</span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="address" prop="meetingName"
cell-class-name="text-center" cell-class-name="text-center"
label="已关联会议名称"> label="已关联会议名称">
</el-table-column> </el-table-column>
...@@ -59,9 +52,9 @@ ...@@ -59,9 +52,9 @@
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="font-size-20 pointer"> <span class="font-size-20 pointer">
<i @click="handleEdit(scope.row)" class="el-icon-edit-outline margin-right-10"></i> <i v-if="scope.row.currentStatus == 0 || scope.row.currentStatus == 1" @click="handleEdit(scope.row)" class="el-icon-edit-outline margin-right-10"></i>
<i class="el-icon-view margin-right-10"></i> <i v-if="scope.row.currentStatus == 2" class="el-icon-view margin-right-10"></i>
<i @click="handleDelete(scope.row)" class="el-icon-delete"></i> <i v-if="scope.row.currentStatus == 0 || scope.row.currentStatus == 1" @click="handleDelete(scope.row)" class="el-icon-delete"></i>
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
...@@ -71,10 +64,10 @@ ...@@ -71,10 +64,10 @@
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="currentPage" :current-page="currentPage"
:page-sizes="[100, 200, 300, 400]" :page-sizes="[10, 20, 40]"
:page-size="100" :page-size="100"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="400"> :total="total">
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
...@@ -84,27 +77,42 @@ ...@@ -84,27 +77,42 @@
<script> <script>
import IntentionDialog from "../components/intentionDialog"; import IntentionDialog from "../components/intentionDialog";
import {getIntentionPage} from "../api/api"
export default { export default {
components: {IntentionDialog}, components: {IntentionDialog},
name: "intention", name: "intention",
data() { data() {
return { return {
input1:"", form:{
input2:"", title:"",
pageNo:'1',
pageSize:'10'
},
total:null,
currentPage:1, currentPage:1,
tableData: [], tableData: [],
} }
}, },
mounted(){
this.getList()
},
methods: { methods: {
getList(){ getList(){
console.log('getlist') getIntentionPage(this.form).then(
(res)=>{
this.tableData = res.data.data
this.total = res.data.count
}
)
}, },
//更改每页条数 //更改每页条数
handleSizeChange() { handleSizeChange(val) {
this.form.pageSize = val
this.getList()
}, },
handleCurrentChange() { handleCurrentChange(val) {
this.form.pageNo = val
this.getList()
}, },
handleAdd(){ handleAdd(){
this.$refs.intentionDialog.showDialog() this.$refs.intentionDialog.showDialog()
......
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
<el-table-column <el-table-column
prop="meetingTime" prop="meetingTime"
label="会议日期"> label="会议日期">
<template slot-scope="scope">
{{scope.row.meetingTime | formatDate}}
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="remark" prop="remark"
...@@ -57,10 +60,10 @@ ...@@ -57,10 +60,10 @@
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="currentPage" :current-page="currentPage"
:page-sizes="[100, 200, 300, 400]" :page-sizes="[10, 20, 40]"
:page-size="100" :page-size="100"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="400"> :total="total">
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
...@@ -69,13 +72,14 @@ ...@@ -69,13 +72,14 @@
<script> <script>
import {getMeetingPage,removeMeetingById} from '../api/api' import {getMeetingPage,removeMeetingById} from '../api/api'
import {formatDate} from "../common/date";
export default { export default {
name: "meet-list", name: "meet-list",
data() { data() {
return { return {
currentPage: 1, currentPage: 1,
input1: "", total:null,
form: { form: {
pageNo: '1', pageNo: '1',
pageSize: '10', pageSize: '10',
...@@ -93,6 +97,7 @@ ...@@ -93,6 +97,7 @@
getMeetingPage(this.form).then( getMeetingPage(this.form).then(
(res) => { (res) => {
this.tableData = res.data.data this.tableData = res.data.data
this.total = res.data.count
} }
) )
}, },
...@@ -101,12 +106,14 @@ ...@@ -101,12 +106,14 @@
this.getList() this.getList()
}, },
//更改每页条数 //更改每页条数
handleSizeChange() { handleSizeChange(val) {
this.form.pageSize = val
this.getList()
}, },
//翻页 //翻页
handleCurrentChange() { handleCurrentChange(val) {
this.form.pageNo = val
this.getList()
}, },
//新增会议 //新增会议
handleAdd(){ handleAdd(){
...@@ -136,6 +143,13 @@ ...@@ -136,6 +143,13 @@
) )
}) })
} }
},
filters:{
formatDate(time){
let date = new Date(time);
return formatDate(date,'yyyy-MM-dd hh:mm');
}
} }
} }
</script> </script>
......
...@@ -93,23 +93,29 @@ ...@@ -93,23 +93,29 @@
width="90"> width="90">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="name" prop="title"
label="意向/议程主题" label="意向/议程主题"
width="180"> width="180">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="address" prop="accessories"
label="附件名称"> label="附件名称">
<template slot-scope="scope">
<p v-for="item of scope.row.accessories">{{item.name}}</p>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="address" prop="reportDep"
cell-class-name="text-center" cell-class-name="text-center"
label="汇报处室"> label="汇报处室">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="address" prop="linkAttends"
cell-class-name="text-center" cell-class-name="text-center"
label="列席人员"> label="列席人员">
<template slot-scope="scope">
<p v-for="item of scope.row.linkAttends">{{item.name}}</p>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="address" prop="address"
...@@ -127,16 +133,17 @@ ...@@ -127,16 +133,17 @@
</div> </div>
<div class="text-center margin-top-20"> <div class="text-center margin-top-20">
<el-button size="small" plain>预览</el-button> <el-button size="small" plain>预览</el-button>
<el-button size="small" plain>导出</el-button> <el-button :disabled="true" size="small" plain>导出</el-button>
<el-button @click="showIndexDialog" size="small" plain>议程排序</el-button> <el-button @click="showIndexDialog('agenda')" size="small" plain>议程排序</el-button>
<el-button size="small" plain>办结</el-button> <el-button @click="showIndexDialog('intention')" size="small" plain>意向排序</el-button>
<el-button :disabled="true" size="small" plain>办结</el-button>
<el-button @click="doEnd" size="small" plain>结束</el-button> <el-button @click="doEnd" size="small" plain>结束</el-button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<select-intention-dialog ref="selectIntentionDialog" @update="selectIntention"></select-intention-dialog> <select-intention-dialog ref="selectIntentionDialog" @update="selectIntention"></select-intention-dialog>
<index-dialog ref="indexDialog"></index-dialog> <index-dialog ref="indexDialog" @update="updateTableData"></index-dialog>
<special-dialog ref="specialDialog" @update="getAgenda"></special-dialog> <special-dialog ref="specialDialog" @update="getAgenda"></special-dialog>
</div> </div>
</template> </template>
...@@ -145,7 +152,7 @@ ...@@ -145,7 +152,7 @@
import ElRow from "element-ui/packages/row/src/row"; import ElRow from "element-ui/packages/row/src/row";
import SelectIntentionDialog from "../components/selectIntentionDialog"; import SelectIntentionDialog from "../components/selectIntentionDialog";
import IndexDialog from "../components/indexDialog"; import IndexDialog from "../components/indexDialog";
import {addMeeting,updateMeeting,getMeetingById,meetEnd} from "../api/api" import {addMeeting,updateMeeting,getMeetingById,meetEnd,getAgendaByIdByMeet} from "../api/api"
import SpecialDialog from "../components/specialDialog"; import SpecialDialog from "../components/specialDialog";
export default { export default {
components: { components: {
...@@ -186,7 +193,14 @@ ...@@ -186,7 +193,14 @@
for(const i in this.form){ for(const i in this.form){
this.form[i] = res.data[i] this.form[i] = res.data[i]
} }
console.log(this.form) res.data.intentionList.forEach(e=>{
e.type ="intention"
this.tableData.push(e)
})
res.data.agendaList.forEach(d=>{
d.type ="agenda"
this.tableData.push(d)
})
} }
) )
} }
...@@ -196,23 +210,60 @@ ...@@ -196,23 +210,60 @@
showDialog() { showDialog() {
this.$refs.selectIntentionDialog.showDialog() this.$refs.selectIntentionDialog.showDialog()
}, },
showIndexDialog() { showIndexDialog(type) {
this.$refs.indexDialog.showDialog("议程排序") let list = []
if(type === "intention"){
this.tableData.forEach(e=>{
if(e.type === 'intention'){
list.push(e)
}
})
}else{
this.tableData.forEach(e=>{
if(e.type === 'agenda'){
list.push(e)
}
})
}
this.$refs.indexDialog.showDialog(list,type)
}, },
//选择议程窗口 //选择议程窗口
showAgendaDialog(){ showAgendaDialog(){
this.$refs.specialDialog.showAddDialog() this.$refs.specialDialog.showAddDialog("添加议程")
}, },
//选择意向 //选择意向
selectIntention(data){ selectIntention(data){
this.tableData = data data.forEach(e=>{
e.type = "intention"
})
this.form.intentionList.push(data)
this.tableData = this.tableData.concat(data)
}, },
//选择议程 //选择议程
getAgenda(data){ getAgenda(data){
this.form.agendaList = data getAgendaByIdByMeet({id:data}).then(
(res)=>{
res.data.type = "agenda"
this.form.agendaList.push(res.data)
this.tableData.push(res.data)
}
)
}, },
//保存 //保存
save(){ save(){
this.tableData.forEach((e,index)=>{
if(e.type === "agenda"){ //议程
this.form.agendaList.push({
id:e.id,
sortNum:index +1
})
}else{
this.form.intentionList.push({
id:e.id,
sortNum:index +1
})
}
})
if(this.item){ if(this.item){
this.update() this.update()
}else{ }else{
...@@ -223,15 +274,22 @@ ...@@ -223,15 +274,22 @@
create(){ create(){
addMeeting(this.form).then( addMeeting(this.form).then(
(res)=>{ (res)=>{
this.$message.success("新增会议成功")
this.$router.push({
path:'meetList'
})
} }
) )
}, },
//修改 //修改
update(){ update(){
this.form.id = this.item.id
updateMeeting(this.form).then( updateMeeting(this.form).then(
(res)=>{ (res)=>{
this.$message.success("修改会议成功")
this.$router.push({
path:'meetList'
})
} }
) )
}, },
...@@ -239,9 +297,21 @@ ...@@ -239,9 +297,21 @@
doEnd(){ doEnd(){
meetEnd({id:this.item.id}).then( meetEnd({id:this.item.id}).then(
(res)=>{ (res)=>{
this.$message.success("会议结束")
this.$router.push({
path:'meetList'
})
} }
) )
},
updateTableData(data){
console.log(data)
if(data.type === 'intention'){
this.form.intentionList = data.list
}else{
this.form.agendaList = data.list
}
this.tableData = this.form.intentionList.concat(this.form.agendaList)
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment