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

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

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