Commit 2f999c92 authored by huai.li's avatar huai.li

添加弹框

parent 5e403896
import createRequestor from 'create-requestor' import createRequestor from 'create-requestor'
import { default as API } from '@/api' import { default as API } from '@/api'
import { MessageBox } from 'element-ui'
const dev = process.env.NODE_ENV === 'development' const dev = process.env.NODE_ENV === 'development'
...@@ -28,8 +29,11 @@ let config = { ...@@ -28,8 +29,11 @@ let config = {
base: '' base: ''
}, },
// alert: function (msg) { alert: function (msg) {
// }, msg.forEach(item => {
MessageBox.alert(item.error)
})
},
failedMsg: '请求失败,请稍后重试!' failedMsg: '请求失败,请稍后重试!'
} }
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
<div class="pull-right search-form"> <div class="pull-right search-form">
<el-form-item v-if="searchKey"> <el-form-item v-if="searchKey">
<el-input size="small" v-model="search['ClientSearch[keyword]']" placeholder="关键词"> <el-input size="small" v-model="search['ClientSearch[keyword]']" placeholder="关键词">
<el-button slot="append" type="primary" @click="searchKeyword">搜索</el-button> <el-button slot="append" type="primary" @click.stop.prevent="searchKeyword">搜索</el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item v-if="searchKey"> <el-form-item v-if="searchKey">
<el-button type="primary" size="mini" @click="addNew"> <el-button type="primary" size="mini" @click.stop.prevent="addNew">
<i class="fa fa-plus faa-pulse animated"></i> {{addTitle}} <i class="fa fa-plus faa-pulse animated"></i> {{addTitle}}
</el-button> </el-button>
</el-form-item> </el-form-item>
......
<template> <template>
<section class="select-comp-wrap" @click="showList"> <section class="select-comp-wrap" @click.stop.prevent="showList">
<div class="el-select"> <div class="el-select">
<div class="el-input" :class="{'is-disabled': disabled}"> <div class="el-input" :class="{'is-disabled': disabled}">
<i ref="icon" class="el-input__icon el-icon-caret-top" /> <i ref="icon" class="el-input__icon el-icon-caret-top" />
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<div> <div>
<ul v-if="noEmptyList"> <ul v-if="noEmptyList">
<li v-for="item in list" :class="{ 'active': item.value == value }" @click.stop="select( item )"> <li v-for="item in list" :class="{ 'active': item.value == value }" @click.stop.prevent="select( item )">
{{ item.text }} {{ item.text }}
<template v-if="showValue && item.value !== '' && item.value !== '-1'">({{ item.value }})</template> <template v-if="showValue && item.value !== '' && item.value !== '-1'">({{ item.value }})</template>
</li> </li>
......
<template> <template>
<section> <section>
<sidePopup ref="scheduleSidePopup"> <sidePopup ref="scheduleSidePopup" title="新建待办事项" :width="40">
<ScheduleForm <ScheduleForm
:model="model"> :model="model">
</ScheduleForm> </ScheduleForm>
<div slot="footer" class="dialog-footer" style="text-align: center;"> <div class="mt20" style="margin-left: 150px;">
<el-button type="cancel" @click="diaVis = false" size="mini">取 消</el-button> <el-button type="cancel" @click.stop.prevent="handleClose" size="mini">取 消</el-button>
<el-button type="confirm" @click="save" size="mini">确 定</el-button> <el-button type="confirm" @click.stop.prevent="save" size="mini">确 定</el-button>
</div> </div>
</sidePopup> </sidePopup>
<!-- <el-dialog title="新建待办事项" :visible.sync="diaVis" :modal-append-to-body="false" :close="handleClose">
</el-dialog> -->
</section> </section>
</template> </template>
<script> <script>
...@@ -51,7 +49,6 @@ export default { ...@@ -51,7 +49,6 @@ export default {
show (model) { show (model) {
model && UTIL.flatten(this.model, model) model && UTIL.flatten(this.model, model)
model && (this.model.client_name = model.client.name) model && (this.model.client_name = model.client.name)
// this.diaVis = true
this.$refs.scheduleSidePopup.show() this.$refs.scheduleSidePopup.show()
}, },
...@@ -59,6 +56,7 @@ export default { ...@@ -59,6 +56,7 @@ export default {
Object.keys(this.model).forEach(item => { Object.keys(this.model).forEach(item => {
this.model[item] = '' this.model[item] = ''
}) })
this.$refs.scheduleSidePopup.close()
}, },
save () { save () {
...@@ -67,7 +65,7 @@ export default { ...@@ -67,7 +65,7 @@ export default {
!this.model.id && delete _params['Schedules[id]'] !this.model.id && delete _params['Schedules[id]']
requestAPI(Object.assign(_apiUrl, { method: 'POST' }), _params) requestAPI(Object.assign(_apiUrl, { method: 'POST' }), _params)
.then((res) => { .then((res) => {
this.diaVis = false this.$refs.scheduleSidePopup.close()
this.$message.success('操作成功') this.$message.success('操作成功')
}) })
} }
......
...@@ -38,7 +38,10 @@ ...@@ -38,7 +38,10 @@
</leave-message> </leave-message>
</div> </div>
</div> </div>
<ScheduleModal ref="scheduleModal"></ScheduleModal> <ScheduleModal
ref="scheduleModal"
v-click-outside="scheduleClose">
</ScheduleModal>
</section> </section>
</template> </template>
...@@ -174,6 +177,11 @@ export default { ...@@ -174,6 +177,11 @@ export default {
this.$refs.leaveMessage.isClose() this.$refs.leaveMessage.isClose()
}, },
scheduleClose () {
this.$refs.scheduleModal &&
this.$refs.scheduleModal.handleClose()
},
addSch () { addSch () {
this.$refs.scheduleModal.show() this.$refs.scheduleModal.show()
}, },
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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