Commit db86cf10 authored by huai.li's avatar huai.li

添加待办事项获取客户信息

parent 30032cad
......@@ -53,11 +53,12 @@ export function requestAPI (option, data) {
}
export function requestWithJsonAPI (option, data) {
let _option = Object.assign({}, option)
if (dev && data) {
option.url += setUrlK(data)
_option.url += setUrlK(data)
data = {}
}
return ajax.requestAPI(option, data)
return ajax.requestAPI(_option, data)
}
export function requestJanusAPI (option, data) {
......
......@@ -30,7 +30,7 @@
import $ from 'jquery'
import {
api,
requestAPI
requestWithJsonAPI
} from '@/lib/commonMixin'
export default {
......@@ -69,6 +69,7 @@ export default {
computed: {
textFormat () {
debugger
let text = this.text
let value = this.value
let newValue = (value !== '' && value !== '-1') ? ('(' + value + ')') : ''
......@@ -123,7 +124,7 @@ export default {
},
getList () {
if (!this.apiName) return
if (!this.apiName || this.searchText.trim() === '') return
let params = {
q: this.searchText.trim(),
......@@ -133,8 +134,7 @@ export default {
if (this.paramsFilter) {
params = this.paramsFilter(this.searchText)
}
return requestAPI(api[this.apiName], params)
return requestWithJsonAPI(api[this.apiName], params)
.then((res = {}) => {
if (this.dataFilter) {
this.list = this.dataFilter(res)
......
......@@ -29,11 +29,11 @@ export default {
},
keyName: {
type: String,
default: 'departmentCode'
default: 'client_id'
},
labelKeyName: {
type: String,
default: 'departmentName'
default: 'client_name'
},
inputWidth: {
type: Number,
......@@ -43,7 +43,7 @@ export default {
data () {
return {
apiName: 'getRmDepartmentList',
apiName: 'getClientByName',
labelText: '部门'
}
},
......@@ -68,16 +68,16 @@ export default {
paramsFilter (keyword = '') {
return {
value: keyword.trim()
name: keyword.trim()
}
},
listFilter (res) {
let list = res.list || []
let list = res || []
return list.map(item => {
return {
text: item.label,
value: item.value
text: item.name,
value: item.key
}
})
}
......
......@@ -3,7 +3,7 @@
<el-form label-width="120px" ref="form" :rules="rules" :model="model" class="ec-create-form">
<el-form-item label="客户名称" prop="actName" class="ec-clear-left" v-if="isCreate">
<dep-select
:query="query"
:query="model"
:inputWidth="340"
:startLoadInitial="false"/>
</el-form-item>
......@@ -131,9 +131,9 @@ export default {
},
created () {
if (this.isCreate) {
this.queryOaDeptViaJanus()
}
// if (this.isCreate) {
// this.queryOaDeptViaJanus()
// }
},
mounted () {
......@@ -142,7 +142,7 @@ export default {
computed: {
isCreate () {
return !this.model.client_id
return true
}
},
......
......@@ -29,6 +29,7 @@ export default {
diaVis: false,
model: {
client_id: '',
client_name: '',
schedule_title: '',
start_at: '',
end_at: '',
......
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