Commit 7507986e authored by chuan.liu's avatar chuan.liu

销售计划查询 联调

parent e396f332
...@@ -4,17 +4,18 @@ ...@@ -4,17 +4,18 @@
<view class="header-bg"></view> <view class="header-bg"></view>
<view class="main"> <view class="main">
<view class="middle view planout-block-item"> <view class="middle view planout-block-item">
<view class="text-block text-block-last"> <view class="text-block">
<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">
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<picker class="picker-block" @change="bindPickerChange" :value="index" :range="array"> <picker class="picker-block" @change="bindPickerYearChange" mode="date"
<text class="uni-input">{{array[index]}}</text> :value="condition.RT_GJAHR.LOW" fields='year'>
<text class="uni-input">{{condition.RT_GJAHR.LOW}}</text>
</picker> </picker>
</view> </view>
</view> </view>
<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="aspectFit"></image>
</view> </view>
</view> </view>
<view class="text-block text-block-last"> <view class="text-block text-block-last">
...@@ -22,48 +23,55 @@ ...@@ -22,48 +23,55 @@
<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">
<picker class="picker-block" @change="bindPickerChange" :value="index" :range="array"> <picker class="picker-block" @change="bindPickerTypesChange" range-key='VALUE'
<text class="uni-input">{{array[index]}}</text> mode="selector" :value="typesIndex" :range="selectedSalePlanTypes">
<view class="uni-input">
{{selectedSalePlanTypes[typesIndex] && selectedSalePlanTypes[typesIndex].VALUE || '请选择'}}
</view>
</picker> </picker>
</view> </view>
</view> </view>
<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="aspectFit"></image>
</view> </view>
</view> </view>
</view> </view>
<view class="middle view planout-block-item"> <view class="lists-block">
<view class="item-block item-block-code"> <scroll-view class="scroll-area" :scroll-top="scrollTop" scroll-y="true">
<text class="item-block-label">单号:100820638</text> <view class="middle view planout-block-item" v-for="(item,index) in lists" :key="item.plan_number">
</view> <view class="item-block item-block-code">
<view class="item-block item-block-name"> <text class="item-block-label">单号:{{item.plan_number}}</text>
<text class="item-block-label item-block__label">电商配额酒年度计划(1-5月)</text> </view>
</view> <view class="item-block item-block-name">
<view class="item-block"> <text class="item-block-label item-block__label">{{item.plan_type}}</text>
<text class="item-block-label-des">2021-08</text> </view>
</view> <view class="item-block">
<view class="block-detal"> <text class="item-block-label-des">{{item.gjahr}}-{{item.monat}}</text>
<view class="block-detal-item"> </view>
<text class="detal-item-label">存货分类</text> <view class="block-detal">
<text class="detal-item-value">1618五粮液 500ml*6</text> <view class="block-detal-item">
</view> <text class="detal-item-label">存货分类</text>
<view class="block-detal-item"> <text class="detal-item-value">{{item.wlybrand}}</text>
<text class="detal-item-label">总计划(件)</text> </view>
<text class="detal-item-value">220</text> <view class="block-detal-item">
</view> <text class="detal-item-label">总计划(件)</text>
<view class="block-detal-item"> <text class="detal-item-value">{{item.total_qty}}</text>
<text class="detal-item-label">初始计划(件)</text> </view>
<text class="detal-item-value">7</text> <view class="block-detal-item">
</view> <text class="detal-item-label">初始计划(件)</text>
<view class="block-detal-item"> <text class="detal-item-value">{{item.initplan_qty}}</text>
<text class="detal-item-label">已开票计划(件)</text> </view>
<text class="detal-item-value">220</text> <view class="block-detal-item">
</view> <text class="detal-item-label">已开票计划(件)</text>
<view class="block-detal-item block-detal-item-last"> <text class="detal-item-value">{{item.billing_qty}}</text>
<text class="detal-item-label">已占用计划(件)</text> </view>
<text class="detal-item-value">7</text> <view class="block-detal-item block-detal-item-last">
<text class="detal-item-label">已占用计划(件)</text>
<text class="detal-item-value">{{item.atp_qty}}</text>
</view>
</view>
</view> </view>
</view> </scroll-view>
</view> </view>
</view> </view>
...@@ -75,27 +83,45 @@ ...@@ -75,27 +83,45 @@
mapState mapState
} from 'vuex' } from 'vuex'
import {
apiSalesPlanTypesSelect
} from '@/servers/common.js'
import {
apiSalesPlan
} from '@/servers/purchasePlan.js'
import timeFormat from '@/uview-ui/libs/function/timeFormat.js'
export default { export default {
data() { data() {
return { return {
scrollTop: 0,
isOpened: 'none', isOpened: 'none',
array: ['2021', '2020', '2019', '2018'], condition: {
index: 0, MV_BP: '0081000010',
lists: [{ ROLE: 'WLYALL',
id: 1, RT_GJAHR: {
checked: false, SIGN: 'I',
product: '新品五粮液', OPTION: 'EQ',
quantity: 2, LOW: '',
price: 100 HIGH: ''
}, },
{ RT_PLAN_TYPE: {
id: 2, SIGN: 'I',
checked: false, OPTION: 'EQ',
product: '新品五粮液91 52%', LOW: '',
quantity: 4, HIGH: ''
price: 200
} }
], },
page: {
"PAGE": "1",
"PAGESIZE": "10",
},
selectedSalePlan: {},
selectedSalePlanTypes: [],
typesIndex: 0,
lists: [],
} }
}, },
computed: { computed: {
...@@ -106,10 +132,45 @@ ...@@ -106,10 +132,45 @@
} }
}, },
}, },
created() {
this.condition.RT_GJAHR.LOW = timeFormat(new Date(), 'yyyy')
this.getSalesPlanTypes();
this.getSalesPlan()
},
methods: { methods: {
bindPickerChange(e) { async getSalesPlan() {
console.log('picker发送选择改变,携带值为', e.detail.value) const params = {
this.index = e.detail.value ...this.page,
...this.condition
}
const res = await apiSalesPlan(params)
const {
lt_result,
page,
pagesize
} = res
this.page.PAGE = page
this.page.PAGESIZE = pagesize
this.lists = lt_result.map((item) => {
item.checked = false
return item
})
},
async getSalesPlanTypes() {
const res = await apiSalesPlanTypesSelect()
this.selectedSalePlanTypes = res.DATA
},
bindPickerTypesChange(e) {
console.log('bindPickerTypesChange', e.detail.value)
this.typesIndex = e.detail.value
this.condition.RT_PLAN_TYPE.LOW = this.selectedSalePlanTypes[this.typesIndex].KEY
this.getSalesPlan()
},
bindPickerYearChange(e) {
console.log('bindPickerYearChange', e.detail.value)
this.condition.RT_GJAHR.LOW = e.detail.value
this.getSalesPlan()
}, },
handleClick(e, content, index) { handleClick(e, content, index) {
console.log('click当前索引:', e, content, index); console.log('click当前索引:', e, content, index);
...@@ -151,6 +212,8 @@ ...@@ -151,6 +212,8 @@
flex-direction: column; flex-direction: column;
margin-top: -164rpx; margin-top: -164rpx;
padding: 0 16rpx; padding: 0 16rpx;
height: calc(100% - 147px + 85px);
overflow: hidden;
} }
.middle { .middle {
...@@ -221,6 +284,15 @@ ...@@ -221,6 +284,15 @@
flex-direction: column; flex-direction: column;
} }
.lists-block {
height: calc(100% - 140px);
overflow-y: scroll;
}
.scroll-area {
padding-bottom: 40px;
}
.planout-block-item { .planout-block-item {
flex: 1; flex: 1;
margin-bottom: 32rpx; margin-bottom: 32rpx;
......
...@@ -39,12 +39,12 @@ const install = (Vue, vm) => { ...@@ -39,12 +39,12 @@ const install = (Vue, vm) => {
// 如果把originalData设置为了true,这里得到将会是服务器返回的所有的原始数据 // 如果把originalData设置为了true,这里得到将会是服务器返回的所有的原始数据
// 判断可能变成了res.statueCode,或者res.data.code之类的,请打印查看结果 // 判断可能变成了res.statueCode,或者res.data.code之类的,请打印查看结果
console.log('response-----', res) console.log('response-----', res)
if (res.MSGTYPE === 'S') { if (res.MSGTYPE === 'S' || res.msgtype === 'S') {
// 如果把originalData设置为了true,这里return回什么,this.$u.post的then回调中就会得到什么 // 如果把originalData设置为了true,这里return回什么,this.$u.post的then回调中就会得到什么
return res; return res;
} else { } else {
uni.showToast({ uni.showToast({
title: res.MESSAGE, title: res.MESSAGE || res.message,
duration: 2000, duration: 2000,
icon: 'none' icon: 'none'
}); });
......
import apiHelper from './api.helper.js'
/**
* 根据搜索条件查询销售计划信息。
* @param name 账户名
* @returns {Promise<AxiosResponse<T>>}
*/
export async function apiSalesPlan(params) {
const res = await apiHelper.post('/sap/bc/ztpm/to_new_crm/transdata/planserch', 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