提交 efef4073 编写于 作者: yi.li's avatar yi.li

新建计划修改

上级 989a7988
......@@ -10,7 +10,7 @@
center :lock-scroll="false">
<div class="selected-dialog-content">
<div class="title-div">
<el-button type="primary" @click="continueAdd">继续添加</el-button>
<el-button type="primary" size="small" @click="continueAdd">继续添加</el-button>
</div>
<el-table
:data="hasSelectedList"
......
......@@ -9,7 +9,7 @@
:close-on-press-escape="false"
center>
<div class="finish-content">
<el-form ref="searchData" :model="searchData" :inline="true" class="select-width">
<el-form ref="searchData" :model="searchData" :inline="true" class="select-width" size="small">
<el-form-item>
<el-select v-model="searchData.sex">
<el-option
......@@ -113,8 +113,8 @@
</el-row>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="clickClose" plain>取 消</el-button>
<el-button type="primary" @click="sureClick">确 定</el-button>
<el-button @click="clickClose" size="small" plain>取 消</el-button>
<el-button type="primary" size="small" @click="sureClick">确 定</el-button>
</div>
</el-dialog>
</div>
......
......@@ -26,7 +26,7 @@
</el-select>
</el-form-item>
<el-form-item prop="followupMark" class="ml20">
<el-select v-model="timeFormHas.followupMark" placeholder="请选择">
<el-select v-model="timeFormHas.followupMark" placeholder="请选择" :disabled="timeFormHas.isDisabled">
<el-option
v-for="item in markOptions"
:key="item.value"
......@@ -113,7 +113,7 @@
</el-select>
</el-form-item>
<el-form-item prop="followupMark" class="ml20">
<el-select v-model="timeForm.followupMark" placeholder="请选择">
<el-select v-model="timeForm.followupMark" placeholder="请选择" :disabled="timeForm.isDisabled">
<el-option
v-for="item in markOptions"
:key="item.value"
......@@ -192,7 +192,7 @@
<script>
import _ from 'lodash';
import SelectCartoon from '@/views/followup/plan-manage/dialog/select-cartoon';
import { mapState } from 'vuex'
const timeFormInit = {
formRef: '',
followupTime: '',
......@@ -202,6 +202,7 @@
remindTime: [],
followupForm: [],
hasSelected: '',
isDisabled: false,
};
export default {
......@@ -212,7 +213,6 @@
return {
isSelectCartoon: false,
activeTab: null,
setTimeNodeList: [],
currentFormRef: 1,
showSetBtn: true,
timeForm: _.cloneDeep(timeFormInit),
......@@ -293,31 +293,50 @@
},
}
},
props: {},
computed: {
...mapState('planManage',{
setTimeNodeList: state => state.setTimeNodeList,
}),
setTimeNodeList1:function(){
return this.sortKey(this.setTimeNodeList,'followupTime')
}
},
followupMarkOne() {
return this.setTimeNodeList1[0].followupMark;
},
},
created() {
//初始化一个随访时间节点
if(this.setTimeNodeList.length === 0){
this.activeTab = 'setNewRef';
this.timeForm.formRef = this.getNowTime();
this.activeTab = 'setNewRef';
this.timeForm.formRef = this.getNowTime();
if(this.setTimeNodeList.length>0) {
this.timeForm.isDisabled = true;
this.timeForm.followupMark = this.setTimeNodeList[0].followupMark;
}
},
watch: {},
methods: {
getNowTime() {
const date = new Date();
const year = date.getFullYear();
const month = date.getMonth() + 1;
const day = date.getDate();
const hour = date.getHours();
const minute = date.getMinutes();
const second = date.getSeconds();
let formName = `form${year}${month}${day}${hour}${minute}${second}`;
return formName;
watch: {
timeForm(newVal, oldVal) {
if(this.setTimeNodeList.length>0) {
this.timeForm.isDisabled = true;
this.timeForm.followupMark = this.setTimeNodeList[0].followupMark;
}
},
setTimeNodeList1(newVal, oldVal) {
this.setTimeNodeList1.map(item=>{
item.isDisabled = true;
item.followupMark = this.setTimeNodeList1[0].followupMark
});
this.setTimeNodeList1[0].isDisabled = false;
},
followupMarkOne(newVal, oldVal){
if(newVal != oldVal){
this.setTimeNodeList1.map(item=>{
item.followupMark = this.setTimeNodeList1[0].followupMark
});
}
}
},
methods: {
addNewNode(formName) {
if(this.activeTab !== 'setNewRef') {
this.activeTab = 'setNewRef';
......@@ -328,9 +347,9 @@
this.$refs[formName].validate((valid) => {
if (valid) {
this.setTimeNodeList.push(this.timeForm);
// this.store.commit('SET_TIME_NODE_LIST',this.setTimeNodeList)
this.timeForm = _.cloneDeep(timeFormInit);
this.timeForm.formRef = this.getNowTime(); //新增一个form
this.timeForm.isDisabled = true; //新增一个form
} else {
return;
}
......@@ -358,16 +377,28 @@
this.setTimeNodeList.splice(index, 1)
this.activeTab = 0;
if(this.setTimeNodeList.length == 0) {
//新增一个form
this.activeTab = 'setNewRef';
this.showSetBtn = true;
this.timeForm = _.cloneDeep(timeFormInit);
this.timeForm.formRef = this.getNowTime(); //新增一个form
this.timeForm.formRef = this.getNowTime();
}
},
deleteAddNode() {
this.showSetBtn = false;
this.activeTab = 0;
},
getNowTime() {
const date = new Date();
const year = date.getFullYear();
const month = date.getMonth() + 1;
const day = date.getDate();
const hour = date.getHours();
const minute = date.getMinutes();
const second = date.getSeconds();
let formName = `form${year}${month}${day}${hour}${minute}${second}`;
return formName;
},
sortKey(array,key) {
return array.sort(function(a,b){
var x = a[key];
......
......@@ -22,6 +22,7 @@
<el-button type="primary" size="small" @click="saveEdit">保 存</el-button>
</div>
</div>
<div class="edit-plan-content" v-if="activeTab === 'first'">
<el-form ref="baseInfo" :model="baseInfo" :rules="rules" label-suffix=":" label-width="140px" :inline-message="true" size="small">
<el-form-item label="随访计划名称" prop="name">
......@@ -76,9 +77,8 @@
</div>
<div class="edit-plan-content" v-if="activeTab === 'second'">
<set-time-node></set-time-node>
<set-time-node ref="getTimeNodeList"></set-time-node>
</div>
</div>
<select-patient :isShowSelectPatient="isShowSelectPatient" @closeSelectPatient="closeSelectPatient" @sureSelectPatient="sureSelectPatient(arguments)"></select-patient>
......@@ -92,7 +92,7 @@
import HasSelectedPatient from '@/views/followup/plan-manage/dialog/has-selected-patient';
import SetTimeNode from '@/views/followup/plan-manage/dialog/set-time-node';
// import { mapState, mapActions } from 'vuex'
import { mapState, mapActions } from 'vuex'
export default {
name: "addNewPlan",
components: {
......@@ -152,19 +152,15 @@
}
},
created() {
},
mounted() {
// this.getResidentList({
// planId: this.$route.query.planId
// });
// this.getGroupList(); //获取分组列表
//清理store中存的数据setTimeNodeList
},
computed: {
// ...mapState('planManage',{
// residentList: state => state.residentList,
// groupList: state => state.groupList
// })
...mapState('planManage',{
setTimeNodeList: state => state.setTimeNodeList,
})
},
methods: {
// ...mapActions('planManage', ['getResidentList', 'getGroupList']),
......@@ -204,28 +200,35 @@
},
nextClick(formName) {
//为方便调试,不做校验
this.activeTab = 'second';
// this.activeTab = 'second';
//用作校验
// if(!this.baseInfo.hasSelectedNum) {
// this.noChoice = true
// return;
// }else {
// this.noChoice = false
// }
// this.$refs[formName].validate((valid) => {
// if (valid) {
// // this.$refs['statusForm'].resetFields();
// this.activeTab = 'second';
// } else {
// return false;
// }
// });
if(!this.baseInfo.hasSelectedNum) {
this.noChoice = true
return;
}else {
this.noChoice = false
}
this.$refs[formName].validate((valid) => {
if (valid) {
// this.$refs['statusForm'].resetFields();
this.activeTab = 'second';
} else {
return false;
}
});
},
preClick() {
this.activeTab = 'first';
},
saveEdit() {
console.log('保存')
console.log('保存setTimeNodeList1',this.$refs.getTimeNodeList.setTimeNodeList1)
console.log('保存timeForm',this.$refs.getTimeNodeList.timeForm)
// 各种校验通过后,提交编辑内容,toast提示
this.$notify.success({
title: '',
message: '创建成功',
showClose: false
});
},
},
watch: {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册