Commit 9e76b2de authored by daywrite's avatar daywrite

新建待办事项成功

parent d60f2bfa
......@@ -50,7 +50,7 @@ let setUrlK = (o) => {
export function requestAPI (option, data) {
let _option = Object.assign({}, option)
if (dev && data) {
if (dev && data && option.method === 'GET') {
_option.url += setUrlK(data)
data = {}
}
......
import {
requestWithJsonAPI,
requestAPI,
api
} from '@/lib/commonMixin'
export default {
......@@ -48,7 +48,7 @@ export default {
},
getNewArray () {
requestWithJsonAPI(api.getSaveNew)
requestAPI(api.getSaveNew)
.then((res) => {
this.retNewArray = res.options
})
......
......@@ -30,7 +30,7 @@
import $ from 'jquery'
import {
api,
requestWithJsonAPI
requestAPI
} from '@/lib/commonMixin'
export default {
......@@ -69,7 +69,6 @@ export default {
computed: {
textFormat () {
debugger
let text = this.text
let value = this.value
let newValue = (value !== '' && value !== '-1') ? ('(' + value + ')') : ''
......@@ -134,7 +133,7 @@ export default {
if (this.paramsFilter) {
params = this.paramsFilter(this.searchText)
}
return requestWithJsonAPI(api[this.apiName], params)
return requestAPI(api[this.apiName], params)
.then((res = {}) => {
if (this.dataFilter) {
this.list = this.dataFilter(res)
......
......@@ -94,6 +94,11 @@
import depSelect from './depSelect'
import singleRadio from '../common/singleRadio'
import settingMixin from '../common/settingMixin'
import { setModule } from '@/lib/viewHelper'
import {
requestAPI,
api
} from '@/lib/commonMixin'
export default {
name: 'scheduleForm',
......@@ -158,10 +163,11 @@ export default {
saveEvent () {
this.$refs['form'].validate((valid) => {
if (valid) {
this.$model.createFullCutAct()
let _params = Object.assign({}, setModule(this.model, 'Schedules'))
console.log(_params)
requestAPI(api.requestAPI, _params)
.then((res) => {
this.$message.success('添加成功')
this.go()
console.log(res)
})
}
})
......
......@@ -18,6 +18,7 @@ import {
UTIL
} from '@/lib/commonMixin'
import ScheduleForm from './scheduleForm'
import { setModule } from '@/lib/viewHelper'
export default {
components: {
......@@ -55,9 +56,11 @@ export default {
},
save () {
requestAPI(Object.assign({}, api.saveNewSchedule, { method: 'POST' }), this.model)
let _params = Object.assign({}, setModule(this.model, 'Schedules'))
requestAPI(Object.assign(api.saveNewSchedule, { method: 'POST' }), _params)
.then((res) => {
console.log(res)
this.diaVis = false
this.$message.success('添加待办事项成功')
})
}
}
......
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