Commit f3f885ae authored by chuan.liu's avatar chuan.liu

市场线索查询联调

parent 754220b5
...@@ -17,18 +17,26 @@ ...@@ -17,18 +17,26 @@
<view class="tab-item_line" :class="{'tab-item_line-active':activeTabIndex===1}"></view> <view class="tab-item_line" :class="{'tab-item_line-active':activeTabIndex===1}"></view>
</view> </view>
</view> </view>
<view class="search-block"> <view class="search-block" v-if="activeTabIndex===0">
<view class="search-type"> <view class="search-type">
<picker class="search-type-text" @change="bindPickerYearChange" mode="date" <picker class="picker-block" @change="bindPickerTypesChange" range-key='name' mode="selector"
:value="condition.RT_GJAHR[0].LOW" fields='year'> :value="viloationTypeSelected.name" :range="violationTypeData">
<text class="uni-input-text">{{condition.RT_GJAHR[0].LOW}}</text> <text class="uni-input">{{viloationTypeSelected.name}}</text>
</picker> </picker>
<image class="icon-arrow-down" src="@/static/image/arrow_down@3x.png" mode=""></image> <image class="icon-arrow-down" src="@/static/image/arrow_down@3x.png" mode=""></image>
<view class="icon-line"></view> <view class="icon-line"></view>
</view> </view>
<view class="search-input-block"> <view class="search-input-block">
<image class="icon-search" src="@/static/image/search_b@3x.png" mode=""></image> <image class="icon-search" src="@/static/image/search_b@3x.png" mode=""></image>
<input class="search-input" type="text" v-model="condition.search" placeholder="请输入产品名称" /> <input class="search-input" type="text" @blur="getClueList" v-model="condition.productName"
placeholder="请输入产品名称" />
</view>
</view>
<view class="search-block" v-if="activeTabIndex===1">
<view class="search-input-block">
<image class="icon-search" src="@/static/image/search_b@3x.png" mode=""></image>
<input class="search-input" type="text" @blur="getClueList" v-model="condition.pwd"
placeholder="请输入口令进行查询" />
</view> </view>
</view> </view>
</view> </view>
...@@ -86,14 +94,9 @@ ...@@ -86,14 +94,9 @@
} from 'vuex' } from 'vuex'
import { import {
apiSalesPlanTypesSelect apiGetClueList,
} from '@/servers/common.js' apiGetClueInfoPwdList
} from '@/servers/breakwords.js'
import {
apiSalesPlan
} from '@/servers/purchasePlan.js'
import timeFormat from '@/uview-ui/libs/function/timeFormat.js'
export default { export default {
data() { data() {
...@@ -103,24 +106,17 @@ ...@@ -103,24 +106,17 @@
loadingText: '加载中...', loadingText: '加载中...',
refreshing: false, refreshing: false,
condition: { condition: {
MV_BP: '0081000010', viloationTypes: [],
ROLE: 'WLYALL', submitSource: 'DISTRIBUTER',
RT_GJAHR: [{ submitUserId: '',
SIGN: 'I', status: '',
OPTION: 'EQ', productName: '',
LOW: '', submitMethod: '',
HIGH: '' pwd: ''
}],
RT_PLAN_TYPE: [{
SIGN: 'I',
OPTION: 'EQ',
LOW: '',
HIGH: ''
}]
}, },
page: { page: {
"PAGE": "1", "currentPage": "1",
"PAGESIZE": "10", "pageSize": "10",
}, },
loadParams: { loadParams: {
total: 0, total: 0,
...@@ -128,12 +124,24 @@ ...@@ -128,12 +124,24 @@
isDone: false, isDone: false,
isRefresh: false isRefresh: false
}, },
selectedSalePlan: {}, viloationTypeSelected: {
selectedSalePlanTypes: [], 'code': '',
typesIndex: 0, 'name': '全部类型'
lists: [{ },
'sss': '2' violationTypeData: [{
}], 'code': '',
'name': '全部类型'
},
{
'code': 'EFFECT_ORDER',
'name': '影响秩序'
},
{
'code': 'EFFECT_QUALITY',
'name': '影响质量'
}
],
lists: [],
activeTabIndex: 0 activeTabIndex: 0
} }
}, },
...@@ -157,19 +165,33 @@ ...@@ -157,19 +165,33 @@
}, },
created() { created() {
this.condition.RT_GJAHR[0].LOW = timeFormat(new Date(), 'yyyy') this.condition.submitUserId = this.userInfo.code
this.condition.MV_BP = '0081000010' || this.userInfo.code
this.reset() this.reset()
}, },
methods: { methods: {
async getSalesPlan(isRefresh) { async getClueList(isRefresh) {
if (this.loadParams.isDone) { if (this.loadParams.isDone) {
return return
} }
const params = { let params = {}
...this.page,
...this.condition if (this.activeTabIndex === 0) {
this.condition.submitMethod = 'REAL_NAME'
this.condition.viloationTypes[0] = this.viloationTypeSelected.code
const {
pwd,
...other
} = this.condition
params = {
...this.page,
...other
}
} else {
params = {
...this.page,
pwd: this.condition.pwd
}
} }
uni.showLoading({ uni.showLoading({
...@@ -178,31 +200,23 @@ ...@@ -178,31 +200,23 @@
setTimeout(function() { setTimeout(function() {
uni.hideLoading(); uni.hideLoading();
}, 2000); }, 2000);
// const res = await apiSalesPlan(params) const api = [apiGetClueList, apiGetClueInfoPwdList]
const res = [] const res = await api[this.activeTabIndex](params)
uni.hideLoading(); uni.hideLoading();
const { const {
lt_result, totalNumberOfResults,
page, numberOfPages
pagesize, } = res.data.pagination
total this.loadParams.total = totalNumberOfResults
} = res this.loadParams.totalPage = numberOfPages
this.page.PAGE = page
this.page.PAGESIZE = pagesize
this.loadParams.total = total
this.loadParams.totalPage = Math.ceil(total * 1 / this.page.PAGESIZE * 1)
const dataMap = lt_result && lt_result.map((item) => {
item.checked = false
return item
})
if (isRefresh) { if (isRefresh) {
this.lists = dataMap this.lists = res.data.results
this.loadParams.isDone = false this.loadParams.isDone = false
} else { } else {
this.lists = this.lists.concat(dataMap) this.lists = this.lists.concat(res.data.results)
} }
setTimeout(() => { setTimeout(() => {
...@@ -213,7 +227,7 @@ ...@@ -213,7 +227,7 @@
refresh(e) { refresh(e) {
this.refreshing = true; this.refreshing = true;
this.reset() this.reset()
this.getSalesPlan(true) this.getClueList(true)
// #ifdef APP-NVUE // #ifdef APP-NVUE
try { try {
// console.log('-------', this.$refs.list) // console.log('-------', this.$refs.list)
...@@ -226,9 +240,9 @@ ...@@ -226,9 +240,9 @@
}, },
scrolltolower() { scrolltolower() {
console.log('onReachBottom'); console.log('onReachBottom');
if (this.page.PAGE < this.loadParams.totalPage) { if (this.page.currentPage < this.loadParams.totalPage) {
this.page.PAGE++ this.page.currentPage++
this.getSalesPlan() this.getClueList()
} else { } else {
this.loadParams.isDone = true this.loadParams.isDone = true
this.loadingText = '-- 到底了 --' this.loadingText = '-- 到底了 --'
...@@ -241,38 +255,13 @@ ...@@ -241,38 +255,13 @@
isDone: false, isDone: false,
isRefresh: false isRefresh: false
} }
this.page.PAGE = 1 this.page.currentPage = 1
this.lists = [] this.lists = []
this.loadingText = '加载中' this.loadingText = '加载中'
}, },
async getSalesPlanTypes() {
const res = await apiSalesPlanTypesSelect()
this.selectedSalePlanTypes = res.DATA
this.selectedSalePlan = this.selectedSalePlanTypes[this.typesIndex]
this.condition.RT_PLAN_TYPE[0].LOW = this.selectedSalePlanTypes[this.typesIndex].KEY
this.getSalesPlan()
},
bindPickerTypesChange(e) { bindPickerTypesChange(e) {
console.log('bindPickerTypesChange', e.detail.value) console.log('bindPickerTypesChange', e.detail.value)
this.typesIndex = e.detail.value this.viloationTypeSelected = this.violationTypeData[e.detail.value]
this.condition.RT_PLAN_TYPE[0].LOW = this.selectedSalePlanTypes[this.typesIndex].KEY
this.getSalesPlan()
},
bindPickerYearChange(e) {
console.log('bindPickerYearChange', e.detail.value)
this.condition.RT_GJAHR[0].LOW = e.detail.value
this.getSalesPlan()
},
handleClick(e, content, index) {
console.log('click当前索引:', e, content, index);
},
nextStep() {
this.$emit('click', 'orderUpload')
},
preStep() {
uni.switchTab({
url: `/pages/go-order/go-order`
})
}, },
checkTab(i) { checkTab(i) {
this.activeTabIndex = i this.activeTabIndex = i
...@@ -392,6 +381,7 @@ ...@@ -392,6 +381,7 @@
align-items: center; align-items: center;
background: #f5f6f7; background: #f5f6f7;
border-radius: 0 8rpx 8rpx 0; border-radius: 0 8rpx 8rpx 0;
padding-left: 10px;
} }
.icon-search { .icon-search {
...@@ -443,6 +433,11 @@ ...@@ -443,6 +433,11 @@
line-height: normal; line-height: normal;
} }
.uni-input-placeholder {
color: #DBDBDB;
font-size: 12px;
}
.uni-list-cell { .uni-list-cell {
flex: 1; flex: 1;
} }
...@@ -453,6 +448,8 @@ ...@@ -453,6 +448,8 @@
.picker-block { .picker-block {
flex: 1; flex: 1;
height: 60rpx;
line-height: 60rpx;
} }
.uni-input-text { .uni-input-text {
......
...@@ -48,4 +48,24 @@ export async function apiGetClueDistributer(params) { ...@@ -48,4 +48,24 @@ export async function apiGetClueDistributer(params) {
export async function apiClueSubmit(params) { export async function apiClueSubmit(params) {
const res = await apiHelper.post('/wmdpwebservices/clue/submit', params) const res = await apiHelper.post('/wmdpwebservices/clue/submit', params)
return res return res
}
/**
* 市场线索查询
* @param name 账户名
* @returns {Promise<AxiosResponse<T>>}
*/
export async function apiGetClueList(params) {
const res = await apiHelper.post('/wmdpwebservices/clue/search', params)
return res
}
/**
* 线索口令查询
* @param name 账户名
* @returns {Promise<AxiosResponse<T>>}
*/
export async function apiGetClueInfoPwdList(params) {
const res = await apiHelper.post('/wmdpwebservices/clue/info/pwd', params)
return 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