Commit e111a349 authored by daywrite's avatar daywrite

save待办事项

parent c9d53052
import createRequestor from 'create-requestor'
import { default as API } from '@/api'
const dev = process.env.NODE_ENV === 'development'
let config = {
ajaxOption: {
method: 'GET',
method: dev ? 'GET' : 'POST',
dataType: 'json',
contentType: 'application/x-www-form-urlencoded; charset=UTF-8'
},
......@@ -34,12 +36,23 @@ let config = {
let ajax = createRequestor(config)
let setUrlK = (o) => {
let params = ''
Object.keys(o).forEach(item => {
params += `&${item}=${o[item]}`
})
return params
}
export function requestAPI (option, data) {
let params = { data: JSON.stringify(data) }
return ajax.requestAPI(option, params)
}
export function requestWithJsonAPI (option, data) {
if (dev && data) {
option.url += setUrlK(data)
data = {}
}
return ajax.requestAPI(option, data)
}
......
......@@ -7,5 +7,16 @@ export default {
// 新建待办事项获取下拉列表配置项
getSaveNew: {
url: '/vue/schedule/get-new' + urlEnd
},
// 搜索客户名称
getClientByName: {
url: '/vue/search/client-by-name' + urlEnd
},
// 保存待办事项
saveNewSchedule: {
url: '/vue/schedule/save-new' + urlEnd
}
}
......@@ -22,7 +22,7 @@
v-for="item in timeTypeArray"
:key="item.key"
:label="item.name"
:value="item.id">
:value="item.key">
</el-option>
</el-select>
</el-form-item>
......@@ -48,7 +48,7 @@
v-for="item in alarmBeforeArray"
:key="item.key"
:label="item.name"
:value="item.id">
:value="item.key">
</el-option>
</el-select>
</el-form-item>
......@@ -66,7 +66,7 @@
v-for="item in repeatTypeArray"
:key="item.key"
:label="item.name"
:value="item.id">
:value="item.key">
</el-option>
</el-select>
</el-form-item>
......@@ -80,7 +80,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="是否共享" prop="actName" class="ec-clear-left is-required">
<el-form-item label="是否共享" prop="is_public" class="ec-clear-left is-required">
<el-radio-group v-model="model.is_public" size="small">
<el-radio :label="1" border>共享</el-radio>
<el-radio :label="0" border>私人</el-radio>
......@@ -93,7 +93,7 @@
import depSelect from './depSelect'
import settingMixin from '../common/settingMixin'
export default {
name: 'fullCutForm',
name: 'scheduleForm',
mixins: [settingMixin],
......@@ -118,7 +118,6 @@ export default {
},
created () {
// this.initSetting(['getNewArray'])
if (this.isCreate) {
this.queryOaDeptViaJanus()
}
......
......@@ -6,12 +6,16 @@
</ScheduleForm>
<div slot="footer" class="dialog-footer" style="text-align: center;">
<el-button @click="diaVis = false" size="mini">取 消</el-button>
<el-button type="primary" @click="diaVis = false" size="mini">确 定</el-button>
<el-button type="primary" @click="save" size="mini">确 定</el-button>
</div>
</el-dialog>
</section>
</template>
<script>
import {
requestWithJsonAPI,
api
} from '@/lib/commonMixin'
import ScheduleForm from './scheduleForm'
export default {
......@@ -23,7 +27,7 @@ export default {
return {
diaVis: false,
model: {
client_id: '',
client_id: '111',
schedule_title: '',
start_at: '',
end_at: '',
......@@ -39,6 +43,14 @@ export default {
methods: {
show () {
this.diaVis = true
},
save () {
console.log('this.model', this.model)
requestWithJsonAPI(api.saveNewSchedule, this.model)
.then((res) => {
console.log(res)
})
}
}
}
......
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