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

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

parent 19dbf056
......@@ -123,7 +123,55 @@
<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode=""></image>
</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>
<view class="middle-date-des uni-list picker-year">
<view class="uni-list-cell">
......@@ -136,7 +184,7 @@
src="@/static/image/search_b@3x.png" mode=""></image>
</view>
</view>
<view class="text-block">
<view class="text-block" v-if="condition.supplyType==='TERMINAL' || condition.supplyType==='MARKET' ">
<text class="middle-date">终端地址</text>
<input class="middle-date-des" type="text" v-model="condition.terminalAddress" placeholder="" />
</view>
......@@ -146,8 +194,8 @@
<view class="uni-list-cell">
<view class="uni-list-cell-db">
<picker class="picker-block" @change="bindPickerChange($event,'date')" mode="date"
:value="condition.submitTime" fields='day'>
<text class="uni-input">{{condition.submitTime}}</text>
:value="condition.auditTime" fields='day'>
<text class="uni-input">{{condition.auditTime}}</text>
</picker>
</view>
</view>
......@@ -166,22 +214,22 @@
<view class="middle view">
<view class="text-block">
<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 class="text-block">
<text class="middle-date">物流码行项目</text>
<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>
<text class="diy-entry-text">扫码</text>
</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>
<text class="diy-entry-text">增加</text>
</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>
<text class="diy-entry-text">删除</text>
......@@ -190,7 +238,7 @@
</view>
</view>
<view class="planout-block">
<button class="btn" type="default">
<button class="btn" type="default" @click="addProductByBarcode">
<text class="btn-text">查询</text>
</button>
</view>
......@@ -198,15 +246,15 @@
<view class="middle view planout-block-item">
<view class="text-block">
<text class="middle-date">产品名称</text>
<text class="middle-date-des">300820638</text>
<text class="middle-date-des">{{productByBarcode.productId}}</text>
</view>
<view class="text-block">
<text class="middle-date">物流码</text>
<text class="middle-date-des">迎新年退休职工团拜会</text>
<text class="middle-date-des">{{productByBarcode.barcode}}</text>
</view>
<view class="text-block">
<text class="middle-date">出库时间</text>
<text class="middle-date-des">山东省淄博市张店区</text>
<text class="middle-date-des">{{productByBarcode.outboundTime}}</text>
</view>
</view>
......@@ -216,7 +264,7 @@
<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.code"
<input class="middle-date-des" type="text" v-model="condition.receiveAmount"
placeholder="请输入收货金额,保留2位小数" />
</view>
</view>
......@@ -228,11 +276,11 @@
</view>
<view class="text-block no-border">
<text class="middle-date">事发战区</text>
<text class="middle-date-des">四川营销战区</text>
<text class="middle-date-des">{{distributerByBarcode.productDisSalesAreaName}}</text>
</view>
<view class="text-block no-border">
<text class="middle-date">事发基地</text>
<text class="middle-date-des">青蒿基地</text>
<text class="middle-date-des">{{distributerByBarcode.productDisSubSalesAreaName}}</text>
</view>
</view>
......@@ -292,14 +340,18 @@
import {
apiGetDictionary,
apiClueSubmit
apiClueSubmit,
apiGetClueProduct,
apiGetClueDistributer
} from '@/servers/breakwords.js'
import {
apiGetProvinceCode
} from '@/servers/common.js'
import timeFormat from '@/uview-ui/libs/function/timeFormat.js'
export default {
data() {
return {
......@@ -316,16 +368,29 @@
childTypeName: '',
happenChannelId: '',
happenChannelIdName: '',
SupplyType: '',
productChannelId: '',
productChannelName: '',
supplyType: '',
supplyTypeName: '',
provinceCode: '',
provinceName: '',
cityCode: '',
cityName: '',
// terminalName: '',
terminalId: '',
terminalName: '',
terminalAddress: '',
submitTime: '',
platformName: '',
storeName: '',
storeAddress: '',
marketName: '',
auditTime: '',
auditNotes: '',
barcode: '',
receiveAmount: '',
doorPicUrl: '',
productPicUrl: '',
invoicePicUrl: '',
receiptPicUrl: '',
},
pickerIndexs: {
submitMethodIndex: 0
......@@ -338,11 +403,13 @@
'ChannelType': [],
'provincecode': [],
'citycode': [],
}
},
productByBarcode: {},
distributerByBarcode: {},
}
},
computed: {
...mapState(['sysinfo']),
...mapState(['sysinfo', 'userInfo']),
navHeight() {
return {
'height': `${this.sysinfo.safeArea.top + 44}px`
......@@ -359,6 +426,7 @@
},
},
created() {
this.condition.auditTime = timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss')
// 提交方式
this.getDictionary('SubmitMethod')
// 违规类型
......@@ -378,7 +446,9 @@
let _this = this
uni.$on('selectClueTerminal', function(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: {
......@@ -412,8 +482,11 @@
this.condition.childTypeName = this.selectDataOptions[type][index].name
break;
case 'ChannelType':
this.condition.happenChannelId = this.selectDataOptions[type][index].code
this.condition.happenChannelIdName = this.selectDataOptions[type][index].name
this.condition.happenChannelId = this.condition.productChannelId = this.selectDataOptions[type][
index
].code
this.condition.happenChannelIdName = this.condition.productChannelName = this.selectDataOptions[
type][index].name
break;
case 'SupplyType':
this.condition.supplyType = this.selectDataOptions[type][index].code
......@@ -429,17 +502,101 @@
this.condition.cityName = this.selectDataOptions[type][index].description
break;
case 'date':
this.condition.submitTime = index
this.condition.auditTime = index
break;
}
},
selectClueTerminal() {
uni.navigateTo({
url: `/pages/select-clue-terminal/select-clue-terminal`
url: `/pages/select-clue-terminal/select-clue-terminal?keywords=${this.condition.terminalName}`
});
},
submit() {
this.$emit('submit')
async addProductByBarcode() {
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) {
......@@ -529,7 +686,7 @@
.middle-date-des {
display: flex;
align-items: center;
flex: 3;
flex: 7;
font-size: 28rpx;
color: $text-base-color;
height: 96rpx;
......@@ -545,7 +702,7 @@
.picker-year {
position: relative;
align-items: center;
padding-left: 14rpx;
// padding-left: 14rpx;
}
.uni-list-cell {
......
......@@ -4,17 +4,18 @@
<view class="listview">
<list class="cell-list" v-if="lists.length > 0" :show-scrollbar='false' loadmoreoffset='100'
@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__content">
<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>
</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>
</view>
</cell>
......@@ -30,8 +31,8 @@
} from 'vuex'
import {
apiGetPengmaInfo
} from '@/servers/groupOrder.js'
apiGetTerminal
} from '@/servers/breakwords.js'
import noData from '@/components/nodata.nvue';
......@@ -49,11 +50,14 @@
isDone: false,
isRefresh: false
},
page: {
"currentPage": "1",
"pageSize": "15",
},
lists: [],
selectedPaintDesign: {},
selectedClueTerminal: {},
toPageParams: {
page: '',
head: ""
keywords: '',
}
}
},
......@@ -63,31 +67,34 @@
'height': `${this.sysinfo.safeArea.top + 44}px`
}
},
...mapState(['sysinfo', 'userInfo'])
...mapState(['sysinfo'])
},
onLoad(option) {
console.log('select-saleplan', option)
if (option && option.from) {
if (option && option.keywords) {
const {
from,
head
keywords
} = option
this.toPageParams.page = from
this.toPageParams.head = JSON.parse(head)
this.toPageParams.keywords = keywords || ''
}
},
onPullDownRefresh() {
console.log('refresh');
this.getPengmaInfo()
this.reset()
this.getTerminal()
setTimeout(function() {
uni.stopPullDownRefresh();
}, 600);
},
created() {
this.getPengmaInfo()
this.reset()
this.getTerminal()
},
methods: {
async getPengmaInfo(isRefresh) {
async getTerminal(isRefresh) {
if (this.loadParams.isDone) {
return
}
uni.showLoading({
title: '加载中'
......@@ -95,25 +102,59 @@
setTimeout(function() {
uni.hideLoading();
}, 2000);
const res = await apiGetPengmaInfo()
const params = {
id: '',
name: this.toPageParams.keywords,
...this.page
}
const res = await apiGetTerminal(params)
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() {
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) {
this.selectedPaintDesign = item
uni.$emit('selectedPaintDesign', {
selectedPaintDesign: item
this.selectedClueTerminal = item
uni.$emit('selectClueTerminal', {
selectedClueTerminal: item
})
uni.navigateBack()
},
loadMore() {
// this.getPengmaInfo()
this.reset()
this.getTerminal(true)
}
}
}
......@@ -179,13 +220,14 @@
.list-block-item {
display: flex;
align-items: center;
flex-direction: column;
}
.list-block-item__title1 {
color: #333;
font-weight: 400;
font-size: 28rpx;
margin-bottom: 4px;
}
.list-block-item__label {
......@@ -218,7 +260,7 @@
.cell-list-block {
display: flex;
flex: 1;
height: 100rpx;
height: 120rpx;
background: #fff;
align-items: center;
border-bottom: 1px solid #f4f5f6;
......
......@@ -20,6 +20,26 @@ export async function apiGetTerminal(params) {
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 账户名
......
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