Commit 754220b5 authored by chuan.liu's avatar chuan.liu

提报市场违约线索提交接口调试

parent 19dbf056
...@@ -123,7 +123,55 @@ ...@@ -123,7 +123,55 @@
<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode=""></image> <image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode=""></image>
</view> </view>
</view> </view>
<view class="text-block"> <view class="text-block" v-if="condition.supplyType==='MARKET'">
<text class="middle-date">市场名称</text>
<view class="middle-date-des uni-list picker-year">
<view class="uni-list-cell">
<view class="uni-list-cell-db">
<input class="middle-date-des" type="text" v-model="condition.marketName"
placeholder="" />
</view>
</view>
<!-- <image class="icon-arrow icon-search" src="@/static/image/search_b@3x.png" mode=""></image> -->
</view>
</view>
<view class="text-block" v-if="condition.supplyType==='PLATFORM'">
<text class="middle-date">平台名称</text>
<view class="middle-date-des uni-list picker-year">
<view class="uni-list-cell">
<view class="uni-list-cell-db">
<input class="middle-date-des" type="text" v-model="condition.platformName"
placeholder="" />
</view>
</view>
<!-- <image class="icon-arrow icon-search" src="@/static/image/search_b@3x.png" mode=""></image> -->
</view>
</view>
<view class="text-block" v-if="condition.supplyType==='PLATFORM'">
<text class="middle-date">商家名称</text>
<view class="middle-date-des uni-list picker-year">
<view class="uni-list-cell">
<view class="uni-list-cell-db">
<input class="middle-date-des" type="text" v-model="condition.storeName"
placeholder="" />
</view>
</view>
<!-- <image class="icon-arrow icon-search" src="@/static/image/search_b@3x.png" mode=""></image> -->
</view>
</view>
<view class="text-block" v-if="condition.supplyType==='PLATFORM'">
<text class="middle-date">网址</text>
<view class="middle-date-des uni-list picker-year">
<view class="uni-list-cell">
<view class="uni-list-cell-db">
<input class="middle-date-des" type="text" v-model="condition.storeAddress"
placeholder="" />
</view>
</view>
<!-- <image class="icon-arrow icon-search" src="@/static/image/search_b@3x.png" mode=""></image> -->
</view>
</view>
<view class="text-block" v-if="condition.supplyType==='TERMINAL' || condition.supplyType==='MARKET' ">
<text class="middle-date">终端名称</text> <text class="middle-date">终端名称</text>
<view class="middle-date-des uni-list picker-year"> <view class="middle-date-des uni-list picker-year">
<view class="uni-list-cell"> <view class="uni-list-cell">
...@@ -136,7 +184,7 @@ ...@@ -136,7 +184,7 @@
src="@/static/image/search_b@3x.png" mode=""></image> src="@/static/image/search_b@3x.png" mode=""></image>
</view> </view>
</view> </view>
<view class="text-block"> <view class="text-block" v-if="condition.supplyType==='TERMINAL' || condition.supplyType==='MARKET' ">
<text class="middle-date">终端地址</text> <text class="middle-date">终端地址</text>
<input class="middle-date-des" type="text" v-model="condition.terminalAddress" placeholder="" /> <input class="middle-date-des" type="text" v-model="condition.terminalAddress" placeholder="" />
</view> </view>
...@@ -146,8 +194,8 @@ ...@@ -146,8 +194,8 @@
<view class="uni-list-cell"> <view class="uni-list-cell">
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<picker class="picker-block" @change="bindPickerChange($event,'date')" mode="date" <picker class="picker-block" @change="bindPickerChange($event,'date')" mode="date"
:value="condition.submitTime" fields='day'> :value="condition.auditTime" fields='day'>
<text class="uni-input">{{condition.submitTime}}</text> <text class="uni-input">{{condition.auditTime}}</text>
</picker> </picker>
</view> </view>
</view> </view>
...@@ -166,22 +214,22 @@ ...@@ -166,22 +214,22 @@
<view class="middle view"> <view class="middle view">
<view class="text-block"> <view class="text-block">
<text class="middle-date">物流码</text> <text class="middle-date">物流码</text>
<input class="middle-date-des" type="text" v-model="condition.code" placeholder="请输入" /> <input class="middle-date-des" type="text" v-model="condition.barcode" placeholder="请输入" />
</view> </view>
<view class="text-block"> <view class="text-block">
<text class="middle-date">物流码行项目</text> <text class="middle-date">物流码行项目</text>
<view class="middle-date-des middle-date-buttons"> <view class="middle-date-des middle-date-buttons">
<button class="diy-entry" type="default"> <button class="diy-entry" type="default" @click="handleScan">
<image class="diy-icon" src="@/static/image/scan@3x.png" mode=""> <image class="diy-icon" src="@/static/image/scan@3x.png" mode="">
</image> </image>
<text class="diy-entry-text">扫码</text> <text class="diy-entry-text">扫码</text>
</button> </button>
<button class="diy-entry" type="default"> <button class="diy-entry" type="default" @click="addProductByBarcode">
<image class="diy-icon" src="@/static/image/add@3x.png" mode=""> <image class="diy-icon" src="@/static/image/add@3x.png" mode="">
</image> </image>
<text class="diy-entry-text">增加</text> <text class="diy-entry-text">增加</text>
</button> </button>
<button class="diy-entry" type="default"> <button class="diy-entry" type="default" @click="deleteProductByBarcode">
<image class="diy-icon" src="@/static/image/del@3x.png" mode=""> <image class="diy-icon" src="@/static/image/del@3x.png" mode="">
</image> </image>
<text class="diy-entry-text">删除</text> <text class="diy-entry-text">删除</text>
...@@ -190,7 +238,7 @@ ...@@ -190,7 +238,7 @@
</view> </view>
</view> </view>
<view class="planout-block"> <view class="planout-block">
<button class="btn" type="default"> <button class="btn" type="default" @click="addProductByBarcode">
<text class="btn-text">查询</text> <text class="btn-text">查询</text>
</button> </button>
</view> </view>
...@@ -198,15 +246,15 @@ ...@@ -198,15 +246,15 @@
<view class="middle view planout-block-item"> <view class="middle view planout-block-item">
<view class="text-block"> <view class="text-block">
<text class="middle-date">产品名称</text> <text class="middle-date">产品名称</text>
<text class="middle-date-des">300820638</text> <text class="middle-date-des">{{productByBarcode.productId}}</text>
</view> </view>
<view class="text-block"> <view class="text-block">
<text class="middle-date">物流码</text> <text class="middle-date">物流码</text>
<text class="middle-date-des">迎新年退休职工团拜会</text> <text class="middle-date-des">{{productByBarcode.barcode}}</text>
</view> </view>
<view class="text-block"> <view class="text-block">
<text class="middle-date">出库时间</text> <text class="middle-date">出库时间</text>
<text class="middle-date-des">山东省淄博市张店区</text> <text class="middle-date-des">{{productByBarcode.outboundTime}}</text>
</view> </view>
</view> </view>
...@@ -216,7 +264,7 @@ ...@@ -216,7 +264,7 @@
<view class="middle-date-des uni-list picker-year"> <view class="middle-date-des uni-list picker-year">
<view class="uni-list-cell"> <view class="uni-list-cell">
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<input class="middle-date-des" type="text" v-model="condition.code" <input class="middle-date-des" type="text" v-model="condition.receiveAmount"
placeholder="请输入收货金额,保留2位小数" /> placeholder="请输入收货金额,保留2位小数" />
</view> </view>
</view> </view>
...@@ -228,11 +276,11 @@ ...@@ -228,11 +276,11 @@
</view> </view>
<view class="text-block no-border"> <view class="text-block no-border">
<text class="middle-date">事发战区</text> <text class="middle-date">事发战区</text>
<text class="middle-date-des">四川营销战区</text> <text class="middle-date-des">{{distributerByBarcode.productDisSalesAreaName}}</text>
</view> </view>
<view class="text-block no-border"> <view class="text-block no-border">
<text class="middle-date">事发基地</text> <text class="middle-date">事发基地</text>
<text class="middle-date-des">青蒿基地</text> <text class="middle-date-des">{{distributerByBarcode.productDisSubSalesAreaName}}</text>
</view> </view>
</view> </view>
...@@ -292,14 +340,18 @@ ...@@ -292,14 +340,18 @@
import { import {
apiGetDictionary, apiGetDictionary,
apiClueSubmit apiClueSubmit,
apiGetClueProduct,
apiGetClueDistributer
} from '@/servers/breakwords.js' } from '@/servers/breakwords.js'
import { import {
apiGetProvinceCode apiGetProvinceCode
} from '@/servers/common.js' } from '@/servers/common.js'
import timeFormat from '@/uview-ui/libs/function/timeFormat.js'
export default { export default {
data() { data() {
return { return {
...@@ -316,16 +368,29 @@ ...@@ -316,16 +368,29 @@
childTypeName: '', childTypeName: '',
happenChannelId: '', happenChannelId: '',
happenChannelIdName: '', happenChannelIdName: '',
SupplyType: '', productChannelId: '',
productChannelName: '',
supplyType: '',
supplyTypeName: '', supplyTypeName: '',
provinceCode: '', provinceCode: '',
provinceName: '', provinceName: '',
cityCode: '', cityCode: '',
cityName: '', cityName: '',
// terminalName: '', terminalId: '',
terminalName: '',
terminalAddress: '', terminalAddress: '',
submitTime: '', platformName: '',
storeName: '',
storeAddress: '',
marketName: '',
auditTime: '',
auditNotes: '', auditNotes: '',
barcode: '',
receiveAmount: '',
doorPicUrl: '',
productPicUrl: '',
invoicePicUrl: '',
receiptPicUrl: '',
}, },
pickerIndexs: { pickerIndexs: {
submitMethodIndex: 0 submitMethodIndex: 0
...@@ -338,11 +403,13 @@ ...@@ -338,11 +403,13 @@
'ChannelType': [], 'ChannelType': [],
'provincecode': [], 'provincecode': [],
'citycode': [], 'citycode': [],
} },
productByBarcode: {},
distributerByBarcode: {},
} }
}, },
computed: { computed: {
...mapState(['sysinfo']), ...mapState(['sysinfo', 'userInfo']),
navHeight() { navHeight() {
return { return {
'height': `${this.sysinfo.safeArea.top + 44}px` 'height': `${this.sysinfo.safeArea.top + 44}px`
...@@ -359,6 +426,7 @@ ...@@ -359,6 +426,7 @@
}, },
}, },
created() { created() {
this.condition.auditTime = timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss')
// 提交方式 // 提交方式
this.getDictionary('SubmitMethod') this.getDictionary('SubmitMethod')
// 违规类型 // 违规类型
...@@ -378,7 +446,9 @@ ...@@ -378,7 +446,9 @@
let _this = this let _this = this
uni.$on('selectClueTerminal', function(data) { uni.$on('selectClueTerminal', function(data) {
console.log('监听到事件来自 selectClueTerminal ,携带参数 msg 为:', data); console.log('监听到事件来自 selectClueTerminal ,携带参数 msg 为:', data);
_this.condition.ZZFLD000098 = data.selectedPaintDesign.zzfld000098 _this.condition.terminalName = data.selectedClueTerminal.name
_this.condition.terminalId = data.selectedClueTerminal.id
_this.condition.terminalAddress = data.selectedClueTerminal.address
}) })
}, },
methods: { methods: {
...@@ -412,8 +482,11 @@ ...@@ -412,8 +482,11 @@
this.condition.childTypeName = this.selectDataOptions[type][index].name this.condition.childTypeName = this.selectDataOptions[type][index].name
break; break;
case 'ChannelType': case 'ChannelType':
this.condition.happenChannelId = this.selectDataOptions[type][index].code this.condition.happenChannelId = this.condition.productChannelId = this.selectDataOptions[type][
this.condition.happenChannelIdName = this.selectDataOptions[type][index].name index
].code
this.condition.happenChannelIdName = this.condition.productChannelName = this.selectDataOptions[
type][index].name
break; break;
case 'SupplyType': case 'SupplyType':
this.condition.supplyType = this.selectDataOptions[type][index].code this.condition.supplyType = this.selectDataOptions[type][index].code
...@@ -429,17 +502,101 @@ ...@@ -429,17 +502,101 @@
this.condition.cityName = this.selectDataOptions[type][index].description this.condition.cityName = this.selectDataOptions[type][index].description
break; break;
case 'date': case 'date':
this.condition.submitTime = index this.condition.auditTime = index
break; break;
} }
}, },
selectClueTerminal() { selectClueTerminal() {
uni.navigateTo({ uni.navigateTo({
url: `/pages/select-clue-terminal/select-clue-terminal` url: `/pages/select-clue-terminal/select-clue-terminal?keywords=${this.condition.terminalName}`
}); });
}, },
submit() { async addProductByBarcode() {
this.$emit('submit') const params = {
barcode: this.condition.barcode
}
const res = await apiGetClueProduct(params)
if (res.data) {
this.productByBarcode = res.data
this.productByBarcode.id = 1
this.productByBarcode.group = res.data.classGroupId
this.productByBarcode.productId = res.data.productId
this.productByBarcode.productName = res.data.barcodeTypeName
}
this.addDistributerByBarcode()
},
async addDistributerByBarcode() {
const params = {
barcode: this.condition.barcode
}
const res = await apiGetClueDistributer(params)
if (res.data) {
this.distributerByBarcode = res.data
}
},
deleteProductByBarcode() {
this.productByBarcode = {}
this.distributerByBarcode = {}
},
async submit() {
let params = {
'supplyType': this.condition.supplyType,
'auditTime': this.condition.auditTime,
'auditNotes': this.condition.auditNotes,
// 'channelId': this.condition.happenChannelId,
'childType': this.condition.childType,
'childTypeName': this.condition.childTypeName,
'cityCode': this.condition.cityCode,
'cityName': this.condition.cityName,
'doorPicUrl': this.condition.doorPicUrl,
'entries': [this.productByBarcode],
'happenSalesAreaCode': this.distributerByBarcode.productDisSalesAreaId,
'happenSalesAreaName': this.distributerByBarcode.productDisSalesAreaName,
'happenSubSalesAreaCode': this.distributerByBarcode.productDisSubSalesAreaId,
'happenSubSalesAreaName': this.distributerByBarcode.productDisSubSalesAreaName,
'happenChannelId': this.condition.happenChannelId,
'invoicePicUrl': this.condition.invoicePicUrl,
'productChannelId': this.condition.productChannelId,
'productChannelName': this.condition.productChannelName,
'productDisChaManagerId': this.distributerByBarcode.productDisChaManagerId,
'productDisChaManagerName': this.distributerByBarcode.productDisChaManagerName,
'productDisSalesAreaId': this.distributerByBarcode.productDisSalesAreaId,
'productDisSalesAreaName': this.distributerByBarcode.productDisSalesAreaName,
'productDisSubSalesAreaId': this.distributerByBarcode.productDisSubSalesAreaId,
'productDisSubSalesAreaName': this.distributerByBarcode.productDisSubSalesAreaName,
'productDistributerId': this.distributerByBarcode.productDistributerId,
'productDistributerName': this.distributerByBarcode.productDistributerName,
'productPicUrl': this.condition.productPicUrl,
'provinceCode': this.condition.provinceCode,
'provinceName': this.condition.provinceName,
'pwdInfo': this.condition.pwdInfo,
'receiptPicUrl': this.condition.receiptPicUrl,
'receiveAmount': this.condition.receiveAmount,
'submitMethod': this.condition.submitMethod,
'submitSource': 'DISTRIBUTER',
'submitUserId': this.userInfo.code,
'submitUserName': this.userInfo.name,
'terminalAddress': this.condition.terminalAddress,
'terminalId': this.condition.terminalId,
'terminalName': this.condition.terminalName,
'viloationType': this.condition.viloationType,
'platformName': this.condition.platformName,
'storeName': this.condition.storeName,
'marketName': this.condition.marketName,
'storeAddress': this.condition.storeAddress
}
const res = await apiClueSubmit(params)
},
handleScan() {
uni.scanCode({
scanType: ['barCode'],
success: function(res) {
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
this.condition.barcode = res.result
}
});
}, },
// 获取上传进度 // 获取上传进度
progress(e) { progress(e) {
...@@ -529,7 +686,7 @@ ...@@ -529,7 +686,7 @@
.middle-date-des { .middle-date-des {
display: flex; display: flex;
align-items: center; align-items: center;
flex: 3; flex: 7;
font-size: 28rpx; font-size: 28rpx;
color: $text-base-color; color: $text-base-color;
height: 96rpx; height: 96rpx;
...@@ -545,7 +702,7 @@ ...@@ -545,7 +702,7 @@
.picker-year { .picker-year {
position: relative; position: relative;
align-items: center; align-items: center;
padding-left: 14rpx; // padding-left: 14rpx;
} }
.uni-list-cell { .uni-list-cell {
......
...@@ -4,17 +4,18 @@ ...@@ -4,17 +4,18 @@
<view class="listview"> <view class="listview">
<list class="cell-list" v-if="lists.length > 0" :show-scrollbar='false' loadmoreoffset='100' <list class="cell-list" v-if="lists.length > 0" :show-scrollbar='false' loadmoreoffset='100'
@loadmore="scrolltolower"> @loadmore="scrolltolower">
<cell @click="handleChecked(item)" v-for="item in lists" :key='item.zcode'> <cell @click="handleChecked(item)" v-for="item in lists" :key='item.id'>
<view class="cell-list-block"> <view class="cell-list-block">
<view class="cell-list-block__content"> <view class="cell-list-block__content">
<view class="list-block-item"> <view class="list-block-item">
<text class="list-block-item__title1">{{item.zzfld000098}}</text> <text class="list-block-item__title1">{{item.name}}</text>
<text class="list-block-item__label">{{item.address}}</text>
</view> </view>
</view> </view>
</view> </view>
</cell> </cell>
<cell> <cell>
<view class="loading-more" v-if='lists.length>14'> <view class="loading-more" v-if='lists.length>15'>
<text class="loading-more-text">{{loadingText}}</text> <text class="loading-more-text">{{loadingText}}</text>
</view> </view>
</cell> </cell>
...@@ -30,8 +31,8 @@ ...@@ -30,8 +31,8 @@
} from 'vuex' } from 'vuex'
import { import {
apiGetPengmaInfo apiGetTerminal
} from '@/servers/groupOrder.js' } from '@/servers/breakwords.js'
import noData from '@/components/nodata.nvue'; import noData from '@/components/nodata.nvue';
...@@ -49,11 +50,14 @@ ...@@ -49,11 +50,14 @@
isDone: false, isDone: false,
isRefresh: false isRefresh: false
}, },
page: {
"currentPage": "1",
"pageSize": "15",
},
lists: [], lists: [],
selectedPaintDesign: {}, selectedClueTerminal: {},
toPageParams: { toPageParams: {
page: '', keywords: '',
head: ""
} }
} }
}, },
...@@ -63,31 +67,34 @@ ...@@ -63,31 +67,34 @@
'height': `${this.sysinfo.safeArea.top + 44}px` 'height': `${this.sysinfo.safeArea.top + 44}px`
} }
}, },
...mapState(['sysinfo', 'userInfo']) ...mapState(['sysinfo'])
}, },
onLoad(option) { onLoad(option) {
console.log('select-saleplan', option) console.log('select-saleplan', option)
if (option && option.from) { if (option && option.keywords) {
const { const {
from, keywords
head
} = option } = option
this.toPageParams.page = from this.toPageParams.keywords = keywords || ''
this.toPageParams.head = JSON.parse(head)
} }
}, },
onPullDownRefresh() { onPullDownRefresh() {
console.log('refresh'); console.log('refresh');
this.getPengmaInfo() this.reset()
this.getTerminal()
setTimeout(function() { setTimeout(function() {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, 600); }, 600);
}, },
created() { created() {
this.getPengmaInfo() this.reset()
this.getTerminal()
}, },
methods: { methods: {
async getPengmaInfo(isRefresh) { async getTerminal(isRefresh) {
if (this.loadParams.isDone) {
return
}
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
...@@ -95,25 +102,59 @@ ...@@ -95,25 +102,59 @@
setTimeout(function() { setTimeout(function() {
uni.hideLoading(); uni.hideLoading();
}, 2000); }, 2000);
const res = await apiGetPengmaInfo() const params = {
id: '',
name: this.toPageParams.keywords,
...this.page
}
const res = await apiGetTerminal(params)
uni.hideLoading(); uni.hideLoading();
this.lists = res.info
this.loadingText = '-- 到底了 --' const {
totalNumberOfResults,
numberOfPages
} = res.data.pagination
this.loadParams.total = totalNumberOfResults
this.loadParams.totalPage = numberOfPages
if (isRefresh) {
this.lists = res.data.results
this.loadParams.isDone = false
} else {
this.lists = this.lists.concat(res.data.results)
}
}, },
scrolltolower() { scrolltolower() {
console.log('onReachBottom');
if (this.page.currentPage < this.loadParams.totalPage) {
this.page.currentPage++
this.getTerminal()
} else {
this.loadParams.isDone = true
this.loadingText = '-- 到底了 --'
}
},
reset() {
this.loadParams = {
total: 0,
totalPage: 1,
isDone: false,
isRefresh: false
}
this.page.currentPage = 1
this.lists = []
this.loadingText = '加载中'
}, },
handleChecked(item) { handleChecked(item) {
this.selectedPaintDesign = item this.selectedClueTerminal = item
uni.$emit('selectedPaintDesign', { uni.$emit('selectClueTerminal', {
selectedPaintDesign: item selectedClueTerminal: item
}) })
uni.navigateBack() uni.navigateBack()
}, },
loadMore() { loadMore() {
// this.getPengmaInfo() this.reset()
this.getTerminal(true)
} }
} }
} }
...@@ -179,13 +220,14 @@ ...@@ -179,13 +220,14 @@
.list-block-item { .list-block-item {
display: flex; display: flex;
align-items: center; flex-direction: column;
} }
.list-block-item__title1 { .list-block-item__title1 {
color: #333; color: #333;
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
margin-bottom: 4px;
} }
.list-block-item__label { .list-block-item__label {
...@@ -218,7 +260,7 @@ ...@@ -218,7 +260,7 @@
.cell-list-block { .cell-list-block {
display: flex; display: flex;
flex: 1; flex: 1;
height: 100rpx; height: 120rpx;
background: #fff; background: #fff;
align-items: center; align-items: center;
border-bottom: 1px solid #f4f5f6; border-bottom: 1px solid #f4f5f6;
......
...@@ -20,6 +20,26 @@ export async function apiGetTerminal(params) { ...@@ -20,6 +20,26 @@ export async function apiGetTerminal(params) {
return res return res
} }
/**
* 扫码查询产品信息
* @param name 账户名
* @returns {Promise<AxiosResponse<T>>}
*/
export async function apiGetClueProduct(params) {
const res = await apiHelper.post('/wmdpwebservices/clue/product', params)
return res
}
/**
* 扫码查询经销商信息
* @param name 账户名
* @returns {Promise<AxiosResponse<T>>}
*/
export async function apiGetClueDistributer(params) {
const res = await apiHelper.post('/wmdpwebservices/clue/distributer', params)
return res
}
/** /**
* 线索提交 * 线索提交
* @param name 账户名 * @param name 账户名
......
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