Commit 8962c2c3 authored by chuan.liu's avatar chuan.liu

生产计划联调

parent 7507986e
...@@ -172,6 +172,27 @@ ...@@ -172,6 +172,27 @@
"bounce": "none" "bounce": "none"
} }
} }
}, {
"path": "pages/select-product-pro/select-product-pro",
"style": {
"app-plus": {
"titleNView": {
"titleAlign": "left",
"titleColor": "#333",
"titleSize": "17px",
"backgroundColor": "transparent",
"titleText": "产品查询",
"autoBackButton": true,
"buttons": [{
"type": "none",
"text": "选择",
"fontSize": "14px",
"color": "#555"
}]
},
"bounce": "none"
}
}
}, { }, {
"path": "pages/select-business/select-business", "path": "pages/select-business/select-business",
"style": { "style": {
......
...@@ -4,28 +4,29 @@ ...@@ -4,28 +4,29 @@
<view class="cell-list"> <view class="cell-list">
<view class="middle view planout-block-item"> <view class="middle view planout-block-item">
<view class="item-block item-block-code"> <view class="item-block item-block-code">
<text class="item-block-label">单号:TP10000021</text> <text class="item-block-label">单号:{{itemHead.PRODPL_ID}}</text>
<button class="item-block-btn" type="default"><text <button class="item-block-btn" type="default"><text
class="item-block-btn__text">待审批</text></button> class="item-block-btn__text">{{itemHead.STATUS}}</text></button>
</view> </view>
<view class="item-block item-block-name"> <view class="item-block item-block-name">
<text class="item-block-label item-block__label">高端总经销材料计划</text> <text class="item-block-label item-block__label">高端总经销材料计划</text>
</view> </view>
<view class="item-block"> <view class="item-block">
<text class="item-block-label-des">2021-08-06 05:14</text> <text class="item-block-label-des">{{itemHead.DATUM}}</text>
</view> </view>
<view class="item-block item-block-date"> <view class="item-block item-block-date">
<text class="detal-item-label">下单日期</text> <text class="detal-item-label">下单日期</text>
</view> </view>
<view class="block-detal"> <view class="block-detal" :class="{'block-detal-last':index === itemLists.length-1}"
v-for="(item,index) in itemLists" :key="index">
<view class="block-detal-item"> <view class="block-detal-item">
<text class="detal-item-label">产品</text> <text class="detal-item-label">产品</text>
<text class="detal-item-value">1618五粮液 500ml*6</text> <text class="detal-item-value">{{item.DESCRIPTION}}</text>
</view> </view>
<view class="block-detal-item"> <view class="block-detal-item">
<text class="detal-item-label">件数</text> <text class="detal-item-label">件数</text>
<text class="detal-item-value">220</text> <text class="detal-item-value">{{item.PLANQTY_BOX}}</text>
</view> </view>
<view class="block-detal-item block-detal-item-last"> <view class="block-detal-item block-detal-item-last">
<text class="detal-item-label">吨数</text> <text class="detal-item-label">吨数</text>
...@@ -57,7 +58,10 @@ ...@@ -57,7 +58,10 @@
newsItem: { newsItem: {
type: Object, type: Object,
default: function(e) { default: function(e) {
return {} return {
HEAD: {},
ITEM: []
}
} }
} }
}, },
...@@ -72,6 +76,12 @@ ...@@ -72,6 +76,12 @@
'height': `${this.sysinfo.safeArea.top + 44}px` 'height': `${this.sysinfo.safeArea.top + 44}px`
} }
}, },
itemHead() {
return this.newsItem.HEAD || {}
},
itemLists() {
return this.newsItem.ITEM || []
},
...mapState(['sysinfo']) ...mapState(['sysinfo'])
}, },
methods: { methods: {
......
...@@ -56,6 +56,10 @@ ...@@ -56,6 +56,10 @@
mapState mapState
} from 'vuex' } from 'vuex'
import {
apiGetProduceOrder
} from '@/servers/produceOrder.js'
export default { export default {
components: { components: {
uniList, uniList,
...@@ -99,7 +103,20 @@ ...@@ -99,7 +103,20 @@
}, },
ishowDetail: false, ishowDetail: false,
filterActiveIndex: 0, filterActiveIndex: 0,
refreshIcon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAB5QTFRFcHBw3Nzct7e39vb2ycnJioqK7e3tpqam29vb////D8oK7wAAAAp0Uk5T////////////ALLMLM8AAABxSURBVHja7JVBDoAgDASrjqj//7CJBi90iyYeOHTPMwmFZrHjYyyFYYUy1bwUZqtJIYVxhf1a6u0R7iUvWsCcrEtwJHp8MwMdvh2amHduiZD3rpWId9+BgPd7Cc2LIkPyqvlQvKxKBJ//Qwq/CacAAwDUv0a0YuKhzgAAAABJRU5ErkJggg==" refreshIcon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAB5QTFRFcHBw3Nzct7e39vb2ycnJioqK7e3tpqam29vb////D8oK7wAAAAp0Uk5T////////////ALLMLM8AAABxSURBVHja7JVBDoAgDASrjqj//7CJBi90iyYeOHTPMwmFZrHjYyyFYYUy1bwUZqtJIYVxhf1a6u0R7iUvWsCcrEtwJHp8MwMdvh2amHduiZD3rpWId9+BgPd7Cc2LIkPyqvlQvKxKBJ//Qwq/CacAAwDUv0a0YuKhzgAAAABJRU5ErkJggg==",
condition: {
PARTNER: '0050000215',
DATUM: {
"SIGN": "I",
"OPTION": "BT",
LOW: '',
HIGH: ''
}
},
page: {
"PAGE": "1",
"PAGESIZE": "10",
}
} }
}, },
computed: { computed: {
...@@ -128,22 +145,9 @@ ...@@ -128,22 +145,9 @@
}, },
created() { created() {
this.pullTimer = null; this.pullTimer = null;
this.requestParams = {
columnId: this.nid,
minId: 0,
pageSize: 10,
column: 'id,post_id,title,author_name,cover,published_at,comments_count'
};
this._isWidescreen = false; this._isWidescreen = false;
// #ifdef H5 this.loadData()
var mediaQueryOb = uni.createMediaQueryObserver(this)
mediaQueryOb.observe({
minWidth: 768
}, matches => {
this._isWidescreen = matches;
})
// #endif
}, },
methods: { methods: {
loadData(refresh) { loadData(refresh) {
...@@ -153,71 +157,58 @@ ...@@ -153,71 +157,58 @@
this.isLoading = true; this.isLoading = true;
this.isNoData = false; this.isNoData = false;
this.requestParams.time = new Date().getTime() + '';
var startTime = new Date();
uni.request({
// url: this.$host + 'api/news',
url: 'https://unidemo.dcloud.net.cn/api/news',
data: this.requestParams,
success: (result) => {
var endTime = new Date();
const data = result.data;
this.isNoData = (data.length <= 0);
const data_list = data.map((news) => {
return {
id: this.newGuid() + news.id,
newsid: news.id,
article_type: 1,
datetime: (new Date(news.published_at.replace(/\-/g, '/')).getTime()),
title: news.title,
image_url: news.cover,
source: news.author_name,
comment_count: news.comments_count,
post_id: news.post_id
};
});
if (refresh) {
this.dataList = data_list;
this.requestParams.minId = 0;
} else {
this.dataList = this.dataList.concat(data_list);
this.requestParams.minId = data[data.length - 1].id;
}
if (this.dataList.length > 0 && this._isWidescreen && this.dataList.length <= 10) { const params = {
this.goDetail(this.dataList[0]); ...this.condition,
} ...this.page
}, }
fail: (err) => {
if (this.dataList.length == 0) { apiGetProduceOrder(params).then((res) => {
this.isNoData = true; console.log('loadData', res)
} const {
}, DATA,
complete: (e) => { PAGE,
this.isLoading = false; TOTAL
if (refresh) { } = res
this.refreshing = false; const data_list = DATA;
this.refreshFlag = false; this.page.PAGE = PAGE
this.refreshText = "已刷新";
if (this.pullTimer) { this.isNoData = (data_list.length <= 0);
clearTimeout(this.pullTimer);
} if (refresh) {
this.pullTimer = setTimeout(() => { this.dataList = data_list;
this.pulling = false; } else {
}, 1000); this.dataList = this.dataList.concat(data_list);
}
if (this.dataList.length > 0 && this._isWidescreen && this.dataList.length <= 10) {
this.goDetail(this.dataList[0]);
}
}).catch(() => {
if (this.dataList.length == 0) {
this.isNoData = true;
}
}).finally(() => {
this.isLoading = false;
if (refresh) {
this.refreshing = false;
this.refreshFlag = false;
this.refreshText = "已刷新";
if (this.pullTimer) {
clearTimeout(this.pullTimer);
} }
this.pullTimer = setTimeout(() => {
this.pulling = false;
}, 1000);
} }
}); })
}, },
loadMore(e) { loadMore(e) {
this.page.PAGE++
this.loadData(); this.loadData();
}, },
clear() { clear() {
this.dataList.length = 0; this.dataList.length = 0;
this.requestParams.minId = 0;
}, },
goDetail(detail) { goDetail(detail) {
...@@ -229,6 +220,7 @@ ...@@ -229,6 +220,7 @@
this.pulling = true; this.pulling = true;
this.refreshing = true; this.refreshing = true;
this.refreshText = "正在刷新..."; this.refreshText = "正在刷新...";
this.page.PAGE = 1
this.loadData(true); this.loadData(true);
}, },
onrefresh(e) { onrefresh(e) {
......
...@@ -14,6 +14,23 @@ ...@@ -14,6 +14,23 @@
</view> </view>
</view> </view>
<view class="middle upload salescenter">
<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">
<picker class="picker-block" @change="bindPickerSalesCenterChange" mode="selector"
:value="salesCenterIndex" range-key='TEXT' :range="selectedSalesCenterArr">
<view class="uni-input">
{{selectedSalesCenterArr[salesCenterIndex] && selectedSalesCenterArr[salesCenterIndex].TEXT || '请选择'}}
</view>
</picker>
</view>
</view>
<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode="aspectFit"></image>
</view>
</view>
<!-- <uni-list :border="false"> <!-- <uni-list :border="false">
<uni-list-item :border="false"> <uni-list-item :border="false">
<template v-slot:header> <template v-slot:header>
...@@ -100,12 +117,35 @@ ...@@ -100,12 +117,35 @@
mapState mapState
} from 'vuex' } from 'vuex'
import {
apiProducePlanInit,
apiUpdateProducePlanData,
apiUpdateProduceOrder
} from '@/servers/produceOrder.js'
export default { export default {
data() { data() {
return { return {
isChecked: false, isChecked: false,
orderNo: '', orderNo: '',
scrollTop: 0 scrollTop: 0,
selectedSalesCenterArr: [{
KEY: -1,
VALUE: ''
}],
selectedSalesCenter: {},
salesCenterIndex: -1,
planinnerLists: [{
checked: false,
'quantity': 0,
'total': 0,
'product_info': {},
}],
HEADINFO: {},
productInitInfo: {},
orderInfo: {
OBJECT_ID: ''
},
} }
}, },
computed: { computed: {
...@@ -132,8 +172,15 @@ ...@@ -132,8 +172,15 @@
url: `/pages/produce-material/produce-material` url: `/pages/produce-material/produce-material`
}) })
}, },
handleDel() { // 选择营销中心
console.log(1) bindPickerSalesCenterChange(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.salesCenterIndex = e.detail.value
this.selectedSalesCenter = this.selectedSalesCenterArr[this.salesCenterIndex]
this.HEADINFO.SALS_CENTER = this.selectedSalesCenter.VALUE
},
handleDel(index, ) {
this.planinnerLists.splice(index, 1)
}, },
preStep() { preStep() {
uni.switchTab({ uni.switchTab({
...@@ -258,17 +305,17 @@ ...@@ -258,17 +305,17 @@
.upload-text { .upload-text {
flex: 2; flex: 2;
color: #333; color: #333;
font-size: 28rpx; font-size: 28rpx;
font-weight: 600; font-weight: 600;
} }
.upload-text-2{ .upload-text-2 {
font-size: 24rpx; font-size: 24rpx;
} }
.summary-num-2{ .summary-num-2 {
color: #333; color: #333;
font-size: 24rpx; font-size: 24rpx;
} }
.summary { .summary {
...@@ -282,13 +329,13 @@ ...@@ -282,13 +329,13 @@
flex: 1; flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin-bottom: 8rpx; margin-bottom: 8rpx;
} }
.summary-line-last { .summary-line-last {
margin-top: 12rpx; margin-top: 12rpx;
padding-right: 8rpx; padding-right: 8rpx;
margin-bottom: 0; margin-bottom: 0;
} }
......
<template> <template>
<view class="order view"> <view class="order view">
<view class="listview"> <view class="listview">
<view class="cell-list"> <view class="cell-list">
<view class="middle view planout-block-item"> <view class="middle view planout-block-item">
<view class="item-block item-block-code"> <view class="item-block item-block-code">
<text class="item-block-label">单号:TP10000021</text> <text class="item-block-label">单号:{{itemHead.PRODPL_ID}}</text>
<button class="item-block-btn" type="default"><text class="item-block-btn__text">待审批</text></button> <button class="item-block-btn" type="default"><text
</view> class="item-block-btn__text">{{itemHead.STATUS}}</text></button>
<view class="item-block item-block-name"> </view>
<text class="item-block-label item-block__label">配额生产计划</text> <view class="item-block item-block-name">
</view> <text class="item-block-label item-block__label">配额生产计划</text>
<view class="item-block"> </view>
<text class="item-block-label-des">2021-08-06 05:14</text> <view class="item-block">
</view> <text class="item-block-label-des">{{itemHead.DATUM}}</text>
<view class="item-block item-block-date"> </view>
<text class="detal-item-label">下单日期</text> <view class="item-block item-block-date">
</view> <text class="detal-item-label">下单日期</text>
</view>
<view class="block-detal">
<view class="block-detal-item"> <view class="block-detal" :class="{'block-detal-last':index === itemLists.length-1}"
<text class="detal-item-label">产品</text> v-for="(item,index) in itemLists" :key="index">
<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.DESCRIPTION}}</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.PLANQTY_BOX}}</text>
<text class="detal-item-label">期望交货期</text> </view>
<text class="detal-item-value">7</text> <view class="block-detal-item block-detal-item-last">
</view> <text class="detal-item-label">期望交货期</text>
</view> <!-- <text class="detal-item-value">7</text> -->
</view>
<view class="block-detal block-detal-last"> </view>
<view class="block-detal-item">
<text class="detal-item-label">产品</text> <view class="item-block">
<text class="detal-item-value">1618五粮液 500ml*6</text> <text class="item-block-label-des">sap返回无</text>
</view> </view>
<view class="block-detal-item"> <view class="item-block item-block-date">
<text class="detal-item-label">件数</text> <text class="detal-item-label">备注</text>
<text class="detal-item-value">220</text> </view>
</view>
<view class="block-detal-item block-detal-item-last">
<text class="detal-item-label">期望交货期</text>
<text class="detal-item-value">7</text>
</view>
</view>
<view class="item-block">
<text class="item-block-label-des">尽快发货</text>
</view>
<view class="item-block item-block-date">
<text class="detal-item-label">备注</text>
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -66,14 +53,17 @@ ...@@ -66,14 +53,17 @@
} from 'vuex' } from 'vuex'
export default { export default {
props: { props: {
newsItem: { newsItem: {
type: Object, type: Object,
default: function(e) { default: function(e) {
return {} return {
} HEAD: {},
} ITEM: []
}
}
}
}, },
data() { data() {
return { return {
...@@ -86,10 +76,16 @@ ...@@ -86,10 +76,16 @@
'height': `${this.sysinfo.safeArea.top + 44}px` 'height': `${this.sysinfo.safeArea.top + 44}px`
} }
}, },
itemHead() {
return this.newsItem.HEAD || {}
},
itemLists() {
return this.newsItem.ITEM || []
},
...mapState(['sysinfo']) ...mapState(['sysinfo'])
}, },
methods: { methods: {
} }
} }
</script> </script>
...@@ -101,7 +97,7 @@ ...@@ -101,7 +97,7 @@
.order { .order {
flex: 1; flex: 1;
padding: 0 16rpx; padding: 0 16rpx;
margin-top: 28rpx; margin-top: 28rpx;
} }
...@@ -112,14 +108,14 @@ ...@@ -112,14 +108,14 @@
.cell-list { .cell-list {
flex-direction: column; flex-direction: column;
} }
.date{ .date {
font-size: 28rpx; font-size: 28rpx;
color: #999999; color: #999999;
font-size: 28rpx; font-size: 28rpx;
text-align: center; text-align: center;
margin-bottom: 24rpx; margin-bottom: 24rpx;
} }
.icon-address { .icon-address {
...@@ -131,7 +127,7 @@ ...@@ -131,7 +127,7 @@
.cell-list-block__content { .cell-list-block__content {
display: flex; display: flex;
flex: 1; flex: 1;
flex-direction: column; flex-direction: column;
margin-bottom: 40rpx; margin-bottom: 40rpx;
} }
...@@ -148,8 +144,8 @@ ...@@ -148,8 +144,8 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background: #fff; background: #fff;
padding: 20rpx 24rpx; padding: 20rpx 24rpx;
border-radius: 20rpx; border-radius: 20rpx;
margin-bottom: 56rpx; margin-bottom: 56rpx;
} }
...@@ -162,104 +158,103 @@ ...@@ -162,104 +158,103 @@
.list-block-title__text { .list-block-title__text {
color: #999999; color: #999999;
font-size: 26rpx; font-size: 26rpx;
} }
.planout-block-item { .planout-block-item {
flex: 1; flex: 1;
padding: 40rpx 32rpx; padding: 40rpx 32rpx;
background-color: #fff; background-color: #fff;
border-radius: 16rpx 100rpx 16rpx 16rpx; border-radius: 16rpx 100rpx 16rpx 16rpx;
} }
.item-block { .item-block {
overflow: hidden; overflow: hidden;
background-color: #fff; background-color: #fff;
padding: 0 16rpx; padding: 0 16rpx;
} }
.item-block-label { .item-block-label {
font-size: 24rpx; font-size: 24rpx;
color: #333; color: #333;
} }
.item-block__label { .item-block__label {
flex: 1; flex: 1;
text-align: left; text-align: left;
font-size: 32rpx; font-size: 32rpx;
color: #333; color: #333;
font-weight: 500; font-weight: 500;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.item-block-code { .item-block-code {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.item-block-btn{ .item-block-btn {
width: 120rpx; height: 48rpx;
height: 48rpx; line-height: 44rpx;
line-height: 48rpx; background: #f61d30;
background: #f61d30; border-radius: 80rpx 200rpx 200rpx 80rpx;
border-radius: 80rpx 200rpx 200rpx 80rpx; text-align: center;
text-align: center; }
}
.item-block-btn__text {
.item-block-btn__text{ font-size: 12px;
font-size: 12px; color: #fff;
color: #fff; }
}
.item-block-name {
.item-block-name { margin-top: 32rpx;
margin-top: 32rpx; margin-bottom: 32rpx;
margin-bottom: 32rpx; }
}
.item-block-date {
.item-block-date{ margin-top: 12rpx;
margin-top: 12rpx; margin-bottom: 48rpx;
margin-bottom: 48rpx; }
}
.item-block-label-des {
.item-block-label-des { flex: 1;
flex: 1; text-align: left;
text-align: left; font-size: 28rpx;
font-size: 28rpx; color: #333;
color: #333; }
}
.block-detal {
.block-detal { display: flex;
display: flex; flex-direction: column;
flex-direction: column; background: #f8f8f8;
background: #f8f8f8; border-radius: 20rpx;
border-radius: 20rpx; padding: 28rpx 32rpx;
padding: 28rpx 32rpx; margin-bottom: 16rpx;
margin-bottom: 16rpx; }
}
.block-detal-last {
.block-detal-last{ margin-bottom: 32rpx;
margin-bottom: 32rpx; }
}
.block-detal-item {
.block-detal-item { display: flex;
display: flex; margin-bottom: 32rpx;
margin-bottom: 32rpx; justify-content: space-between;
justify-content: space-between; }
}
.block-detal-item-last {
.block-detal-item-last{ margin-bottom: 0;
margin-bottom: 0; }
}
.detal-item-label {
.detal-item-label { color: #999;
color: #999; font-size: 24rpx;
font-size: 24rpx; }
}
.detal-item-value {
.detal-item-value{ color: #333;
color: #333; font-size: 28rpx;
font-size: 28rpx;
} }
</style> </style>
This diff is collapsed.
This diff is collapsed.
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,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="bindPickerYearChange" mode="date" <picker class="picker-block" @change="bindPickerYearChange" mode="date"
:value="condition.RT_GJAHR.LOW" fields='year'> :value="condition.RT_GJAHR[0].LOW" fields='year'>
<text class="uni-input">{{condition.RT_GJAHR.LOW}}</text> <text class="uni-input">{{condition.RT_GJAHR[0].LOW}}</text>
</picker> </picker>
</view> </view>
</view> </view>
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<text class="item-block-label">单号:{{item.plan_number}}</text> <text class="item-block-label">单号:{{item.plan_number}}</text>
</view> </view>
<view class="item-block item-block-name"> <view class="item-block item-block-name">
<text class="item-block-label item-block__label">{{item.plan_type}}</text> <text class="item-block-label item-block__label">{{item.plan_type_text}}</text>
</view> </view>
<view class="item-block"> <view class="item-block">
<text class="item-block-label-des">{{item.gjahr}}-{{item.monat}}</text> <text class="item-block-label-des">{{item.gjahr}}-{{item.monat}}</text>
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<view class="block-detal"> <view class="block-detal">
<view class="block-detal-item"> <view class="block-detal-item">
<text class="detal-item-label">存货分类</text> <text class="detal-item-label">存货分类</text>
<text class="detal-item-value">{{item.wlybrand}}</text> <text class="detal-item-value">{{item.wlybrand_text}}</text>
</view> </view>
<view class="block-detal-item"> <view class="block-detal-item">
<text class="detal-item-label">总计划(件)</text> <text class="detal-item-label">总计划(件)</text>
...@@ -101,18 +101,18 @@ ...@@ -101,18 +101,18 @@
condition: { condition: {
MV_BP: '0081000010', MV_BP: '0081000010',
ROLE: 'WLYALL', ROLE: 'WLYALL',
RT_GJAHR: { RT_GJAHR: [{
SIGN: 'I', SIGN: 'I',
OPTION: 'EQ', OPTION: 'EQ',
LOW: '', LOW: '',
HIGH: '' HIGH: ''
}, }],
RT_PLAN_TYPE: { RT_PLAN_TYPE: [{
SIGN: 'I', SIGN: 'I',
OPTION: 'EQ', OPTION: 'EQ',
LOW: '', LOW: '',
HIGH: '' HIGH: ''
} }]
}, },
page: { page: {
"PAGE": "1", "PAGE": "1",
...@@ -133,9 +133,8 @@ ...@@ -133,9 +133,8 @@
}, },
}, },
created() { created() {
this.condition.RT_GJAHR.LOW = timeFormat(new Date(), 'yyyy') this.condition.RT_GJAHR[0].LOW = timeFormat(new Date(), 'yyyy')
this.getSalesPlanTypes(); this.getSalesPlanTypes();
this.getSalesPlan()
}, },
methods: { methods: {
async getSalesPlan() { async getSalesPlan() {
...@@ -160,16 +159,19 @@ ...@@ -160,16 +159,19 @@
async getSalesPlanTypes() { async getSalesPlanTypes() {
const res = await apiSalesPlanTypesSelect() const res = await apiSalesPlanTypesSelect()
this.selectedSalePlanTypes = res.DATA 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.typesIndex = e.detail.value
this.condition.RT_PLAN_TYPE.LOW = this.selectedSalePlanTypes[this.typesIndex].KEY this.condition.RT_PLAN_TYPE[0].LOW = this.selectedSalePlanTypes[this.typesIndex].KEY
this.getSalesPlan() this.getSalesPlan()
}, },
bindPickerYearChange(e) { bindPickerYearChange(e) {
console.log('bindPickerYearChange', e.detail.value) console.log('bindPickerYearChange', e.detail.value)
this.condition.RT_GJAHR.LOW = e.detail.value this.condition.RT_GJAHR[0].LOW = e.detail.value
this.getSalesPlan() this.getSalesPlan()
}, },
handleClick(e, content, index) { handleClick(e, content, index) {
...@@ -256,6 +258,7 @@ ...@@ -256,6 +258,7 @@
position: relative; position: relative;
border-radius: 4px; border-radius: 4px;
align-items: center; align-items: center;
line-height: normal;
} }
.uni-list-cell { .uni-list-cell {
......
<template>
<view class="lists">
<view class="status_bar" :style="navHeight"></view>
<view class="header-bg"></view>
<view class="main">
<view class="middle view">
<view class="text-block ">
<text class="middle-date">产品名称</text>
<input class="middle-date-des" type="text" v-model="condition.product" placeholder="模糊查询,请手动加*" />
</view>
<view class="text-block text-block-last">
<text class="middle-date">产品编码</text>
<input class="middle-date-des" type="text" v-model="condition.code" placeholder="请输入" />
</view>
</view>
<view class="planout-block">
<button class="btn" type="default" @tap="search">
<text class="btn-text">查询</text>
</button>
</view>
<uni-swipe-action class="planout-block-lists">
<uni-swipe-action-item v-for="(item,index) in lists" :key='item.PRODUCT_ID' :auto-close="false"
:disabled='true' :show="isOpened" @click="handleClick">
<template v-slot:left>
<view class="swipe-right-block" @click="handleChecked($event,item, index)"><text
class="swipe-right-block__text"
:class="{'swipe-right-block__active':item.checked}"></text>
</view>
</template>
<view class="middle view planout-block-item">
<view class="text-block">
<text class="middle-date middle-date-select">产品编码</text>
<text class="middle-date-des middle-date-des-select">{{item.PRODUCT_ID}}</text>
</view>
<view class="text-block">
<text class="middle-date middle-date-select">描述</text>
<text class="middle-date-des middle-date-des-select">{{item.SHORT_TEXT}}</text>
</view>
<view class="text-block">
<text class="middle-date middle-date-select">产品类型</text>
<text class="middle-date-des middle-date-des-select">{{item.CHFL_D}}</text>
</view>
<view class="text-block text-block-last">
<text class="middle-date middle-date-select">价格</text>
<text class="middle-date-des middle-date-des-select">{{item.NORMS}}</text>
</view>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</view>
</template>
<script>
import {
mapState
} from 'vuex'
import {
apiProductSelect
} from '@/servers/produceOrder.js'
const modeMap = {
'produceOrder': 'QUOTA',
}
export default {
data() {
return {
isOpened: 'none',
condition: {
product: '',
code: '',
},
page: {
"PAGE": "1",
"PAGESIZE": "10",
},
lists: [{
checked: false,
"PRODUCT_ID": "040001005280116160",
"SHORT_TEXT": "新品五粮液091 52%500mL×6",
"NORMS": "52%500ML×6",
"MSEHT": "盒",
"ISPEJ": "X",
"NRATE": 1.000,
"WRATE": 1.000,
"PECYCLE": "Z001"
}, ],
selectedProduct: {},
toPageParams: {
page: '',
mode: '',
index: 0,
head: {}
}
}
},
computed: {
...mapState(['sysinfo', 'userInfo']),
navHeight() {
return {
'height': `${this.sysinfo.safeArea.top + 44}px`
}
}
},
onNavigationBarButtonTap(e) {
// console.log('onNavigationBarButtonTap:', e, this.isOpened, this.selectedProduct);
if (this.isOpened === 'left' && this.selectedProduct && this.selectedProduct.PRODUCT_ID) {
uni.$emit('selectedProduct', {
selectedProduct: this.selectedProduct,
mode: this.toPageParams.mode,
index: this.toPageParams.index
})
uni.navigateBack({})
return
}
this.isOpened = this.isOpened === 'none' ? 'left' : 'none';
// #ifdef APP-PLUS
let pages = getCurrentPages()
let page = pages[pages.length - 1]
let webView = page.$getAppWebview();
console.log('webView', webView)
webView.setTitleNViewButtonStyle(0, {
text: this.isOpened === 'none' ? '选择' : '完成',
});
// let titleObj = webView.getStyle().titleNView;
// if(!titleObj.buttons){
// returnl
// }
// titleObj.buttons[0].text = 'dd';
// webView.setStyle({
// titleNView:titleObj
// })
// #endif
},
onLoad(option) {
console.log('select-product', option)
const {
from,
mode,
index,
head
} = option
this.toPageParams.index = index
this.toPageParams.mode = mode
this.toPageParams.page = from
this.toPageParams.head = JSON.parse(head)
},
created() {
this.getProduct();
},
methods: {
search() {
this.page.PAGE = 1
this.getProduct()
},
async getProduct() {
let SHORT = []
let PRODUCT_ID = []
if (this.condition.code) {
SHORT = [{
SIGN: 'I',
OPTION: 'EQ',
LOW: this.condition.code,
HIGH: '',
}]
}
if (this.condition.product) {
PRODUCT_ID = [{
SIGN: 'I',
OPTION: 'CP',
LOW: this.condition.product,
HIGH: '',
}]
}
const params = {
...this.page,
'PARTNER': this.userInfo.customerCode,
SHORT,
PRODUCT_ID,
}
const res = await apiProductSelect(params)
this.lists = res && res.DATA.map((item) => {
item.checked = false
return item
})
},
bindPickerChange(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.index = e.detail.value
},
handleClick(e, content, index) {
console.log('click当前索引:', e, content, index);
},
handleChecked(e, item, index) {
console.log('当前索引:', e, index);
this.lists.forEach((cur) => {
if (cur.PRODUCT_ID === item.PRODUCT_ID) {
cur.checked = !cur.checked
} else {
cur.checked = false
}
})
if (item.checked === true) {
// this.selectedProduct.push(item)
this.selectedProduct = item
} else {
// const selectIndex = this.selectedProduct.findIndex((saleplan)=>{
// return saleplan.id === item.id
// })
// this.selectedProduct.splice(selectIndex,1)
this.selectedProduct = {}
}
},
nextStep() {
this.$emit('click', 'orderUpload')
},
preStep() {
uni.switchTab({
url: `/pages/go-order/go-order`
})
},
}
}
</script>
<style lang="scss" scoped>
.view {
flex-direction: column;
}
.header-bg {
height: 284rpx;
margin-top: -88rpx;
background: linear-gradient(232deg, #f4e2e2 25%, #faf3f3 98%);
}
.lists {
position: relative;
flex-direction: column;
overflow-y: scroll;
background: #f0f4f5;
overflow-x: hidden;
height: 100%;
}
.main {
flex-direction: column;
margin-top: -164rpx;
padding: 0 16rpx;
}
.middle {
background-color: #fff;
border-radius: 16rpx;
padding: 32rpx 64rpx 32rpx 48rpx;
}
.text-block {
display: flex;
overflow: hidden;
height: 96rpx;
margin-bottom: 14rpx;
border-bottom: 1px solid #f4f5f6;
}
.text-block-last {
margin-bottom: 0;
border-bottom: 0;
}
.middle-date {
flex: 2;
font-size: 28rpx;
line-height: 96rpx;
color: #333;
margin-bottom: 8rpx;
}
.middle-date-des {
flex: 3;
font-size: 28rpx;
line-height: 96rpx;
height: 96rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #888;
}
.middle-date-select {
color: #888;
}
.middle-date-des-select {
color: #333;
}
.picker-year {
position: relative;
border-radius: 4px;
align-items: center;
}
.uni-list-cell {
flex: 1;
}
.uni-list-cell-db {
flex: 1;
}
.picker-block {
flex: 1;
}
.icon-arrow {
position: absolute;
right: 0;
top: 16px;
width: 12rpx;
height: 20rpx;
z-index: 10;
}
.planout-block-lists {
display: flex;
flex-direction: column;
overflow: hidden;
}
.uni-swipe {
flex: 1;
margin-bottom: 26rpx;
}
/deep/ .uni-swipe_box {
flex: 1;
}
.swipe-right-block {
display: flex;
width: 100rpx;
justify-content: center;
align-items: center;
}
.swipe-right-block__text {
display: inline-block;
width: 52rpx;
height: 52rpx;
border-radius: 50%;
background-color: #fff;
}
.swipe-right-block__active {
width: 52rpx;
height: 52rpx;
border-radius: 50%;
background-color: $wly-primary-color;
}
.planout-block {
display: flex;
justify-content: space-between;
height: 84rpx;
margin-top: 64rpx;
margin-bottom: 48rpx;
padding: 0 24rpx;
}
.planout-block-item {
flex: 1;
width: 750rpx;
}
.btn {
flex: 1;
height: 92rpx;
background: $wly-primary-color;
border-radius: 46rpx;
}
.btn-text {
color: #fff;
font-size: 34rpx;
}
</style>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</view> </view>
<view class="text-block"> <view class="text-block">
<text class="middle-date middle-date-select">产品类型</text> <text class="middle-date middle-date-select">产品类型</text>
<text class="middle-date-des middle-date-des-select">{{item.PRODUCT_ID}}</text> <text class="middle-date-des middle-date-des-select">{{item.CHFL_D}}</text>
</view> </view>
<view class="text-block text-block-last"> <view class="text-block text-block-last">
<text class="middle-date middle-date-select">价格</text> <text class="middle-date middle-date-select">价格</text>
......
...@@ -2,8 +2,6 @@ import apiHelper from './api.helper.js' ...@@ -2,8 +2,6 @@ import apiHelper from './api.helper.js'
/** /**
* 产品查询 * 产品查询
* @param name 账户名
* @param password 账户密码
* @param captcha 验证码 * @param captcha 验证码
* @returns {Promise<AxiosResponse<T>>} * @returns {Promise<AxiosResponse<T>>}
*/ */
...@@ -14,9 +12,7 @@ export async function apiProductSelect(params) { ...@@ -14,9 +12,7 @@ export async function apiProductSelect(params) {
/** /**
* 销售计划查询 * 销售计划查询
* @param name 账户名
* @param password 账户密码 * @param password 账户密码
* @param captcha 验证码
* @returns {Promise<AxiosResponse<T>>} * @returns {Promise<AxiosResponse<T>>}
*/ */
export async function apiSalesPlanSelect(params) { export async function apiSalesPlanSelect(params) {
......
import apiHelper from './api.helper.js'
/**
* 根据搜索条件查询生产计划信息。
* @param name 账户名
* @returns {Promise<AxiosResponse<T>>}
*/
export async function apiGetProduceOrder(params) {
const res = await apiHelper.post('/sap/bc/ztpm/to_new_crm/transdata/get_p_plan_app', params)
return res
}
/**
* 生产计划创建初始化数据。
* @param name 账户名
* @returns {Promise<AxiosResponse<T>>}
*/
export async function apiProducePlanInit(params) {
const res = await apiHelper.post('/sap/bc/ztpm/to_new_crm/transdata/p_plan_init', params)
return res
}
/**
* 生产计划项目更新数据
* @param name 账户名
* @returns {Promise<AxiosResponse<T>>}
*/
export async function apiUpdateProducePlanData(params) {
const res = await apiHelper.post('/sap/bc/ztpm/to_new_crm/transdata/prodplan05', params)
return res
}
/**
* 生产计划单提交。
* @param
* @returns {Promise<AxiosResponse<T>>}
*/
export async function apiUpdateProduceOrder(params) {
const res = await apiHelper.post('/sap/bc/ztpm/to_new_crm/transdata/prodplan003', params)
return res
}
/**
* 查询客户可售产品。
* @param captcha 验证码
* @returns {Promise<AxiosResponse<T>>}
*/
export async function apiProductSelect(params) {
const res = await apiHelper.post('/sap/bc/ztpm/to_new_crm/transdata/bp_pro_search', 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