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,50 +157,38 @@ ...@@ -153,50 +157,38 @@
this.isLoading = true; this.isLoading = true;
this.isNoData = false; this.isNoData = false;
this.requestParams.time = new Date().getTime() + '';
const params = {
var startTime = new Date(); ...this.condition,
uni.request({ ...this.page
// url: this.$host + 'api/news', }
url: 'https://unidemo.dcloud.net.cn/api/news',
data: this.requestParams, apiGetProduceOrder(params).then((res) => {
success: (result) => { console.log('loadData', res)
var endTime = new Date(); const {
const data = result.data; DATA,
this.isNoData = (data.length <= 0); PAGE,
TOTAL
const data_list = data.map((news) => { } = res
return { const data_list = DATA;
id: this.newGuid() + news.id, this.page.PAGE = PAGE
newsid: news.id,
article_type: 1, this.isNoData = (data_list.length <= 0);
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) { if (refresh) {
this.dataList = data_list; this.dataList = data_list;
this.requestParams.minId = 0;
} else { } else {
this.dataList = this.dataList.concat(data_list); 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) { if (this.dataList.length > 0 && this._isWidescreen && this.dataList.length <= 10) {
this.goDetail(this.dataList[0]); this.goDetail(this.dataList[0]);
} }
}, }).catch(() => {
fail: (err) => {
if (this.dataList.length == 0) { if (this.dataList.length == 0) {
this.isNoData = true; this.isNoData = true;
} }
}, }).finally(() => {
complete: (e) => {
this.isLoading = false; this.isLoading = false;
if (refresh) { if (refresh) {
this.refreshing = false; this.refreshing = false;
...@@ -209,15 +201,14 @@ ...@@ -209,15 +201,14 @@
this.pulling = false; this.pulling = false;
}, 1000); }, 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({
...@@ -262,11 +309,11 @@ ...@@ -262,11 +309,11 @@
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;
} }
......
...@@ -4,51 +4,38 @@ ...@@ -4,51 +4,38 @@
<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
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>
<text class="detal-item-value">7</text> <!-- <text class="detal-item-value">7</text> -->
</view>
</view>
<view class="block-detal block-detal-last">
<view class="block-detal-item">
<text class="detal-item-label">产品</text>
<text class="detal-item-value">1618五粮液 500ml*6</text>
</view>
<view class="block-detal-item">
<text class="detal-item-label">件数</text>
<text class="detal-item-value">220</text>
</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> </view>
<view class="item-block"> <view class="item-block">
<text class="item-block-label-des">尽快发货</text> <text class="item-block-label-des">sap返回无</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>
...@@ -71,7 +58,10 @@ ...@@ -71,7 +58,10 @@
newsItem: { newsItem: {
type: Object, type: Object,
default: function(e) { default: function(e) {
return {} return {
HEAD: {},
ITEM: []
}
} }
} }
}, },
...@@ -86,6 +76,12 @@ ...@@ -86,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: {
...@@ -114,7 +110,7 @@ ...@@ -114,7 +110,7 @@
flex-direction: column; flex-direction: column;
} }
.date{ .date {
font-size: 28rpx; font-size: 28rpx;
color: #999999; color: #999999;
font-size: 28rpx; font-size: 28rpx;
...@@ -199,16 +195,15 @@ ...@@ -199,16 +195,15 @@
justify-content: space-between; justify-content: space-between;
} }
.item-block-btn{ .item-block-btn {
width: 120rpx;
height: 48rpx; height: 48rpx;
line-height: 48rpx; line-height: 44rpx;
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;
} }
...@@ -218,7 +213,7 @@ ...@@ -218,7 +213,7 @@
margin-bottom: 32rpx; margin-bottom: 32rpx;
} }
.item-block-date{ .item-block-date {
margin-top: 12rpx; margin-top: 12rpx;
margin-bottom: 48rpx; margin-bottom: 48rpx;
} }
...@@ -239,7 +234,7 @@ ...@@ -239,7 +234,7 @@
margin-bottom: 16rpx; margin-bottom: 16rpx;
} }
.block-detal-last{ .block-detal-last {
margin-bottom: 32rpx; margin-bottom: 32rpx;
} }
...@@ -249,7 +244,7 @@ ...@@ -249,7 +244,7 @@
justify-content: space-between; justify-content: space-between;
} }
.block-detal-item-last{ .block-detal-item-last {
margin-bottom: 0; margin-bottom: 0;
} }
...@@ -258,7 +253,7 @@ ...@@ -258,7 +253,7 @@
font-size: 24rpx; font-size: 24rpx;
} }
.detal-item-value{ .detal-item-value {
color: #333; color: #333;
font-size: 28rpx; font-size: 28rpx;
} }
......
...@@ -3,19 +3,24 @@ ...@@ -3,19 +3,24 @@
<view class="status_bar" :style="navHeight"></view> <view class="status_bar" :style="navHeight"></view>
<view class="conditon-block" :style="conditionTop" :class="{'conditon-block-auto':ishowDetail}"> <view class="conditon-block" :style="conditionTop" :class="{'conditon-block-auto':ishowDetail}">
<view class="filter-title"> <view class="filter-title">
<button type="default" class="filter-btn filter-btn-active"><text class="filter-btn__text filter-btn-active__text">一周内</text></button> <button type="default" class="filter-btn filter-btn-active"><text
<button type="default" @click="handleFilter(item)" :class="{'filter-btn-active':item === filterActiveIndex}" class="filter-btn__text filter-btn-active__text">一周内</text></button>
class="filter-btn" v-for="item in 3" :key='item'><text class="filter-btn__text" :class="{'filter-btn-active__text':item === filterActiveIndex}">{{item}}月内</text></button> <button type="default" @click="handleFilter(item)"
:class="{'filter-btn-active':item === filterActiveIndex}" class="filter-btn" v-for="item in 3"
:key='item'><text class="filter-btn__text"
:class="{'filter-btn-active__text':item === filterActiveIndex}">{{item}}月内</text></button>
<image @click="handleShowDetail" class="icon-arrow" :class="{'icon-arrow-rotate':ishowDetail}" <image @click="handleShowDetail" class="icon-arrow" :class="{'icon-arrow-rotate':ishowDetail}"
src="@/static/image/arrow_up@3x.png" mode="aspectFit"></image> src="@/static/image/arrow_up@3x.png" mode="aspectFit"></image>
</view> </view>
<view class="filter-content"> <view class="filter-content">
<button type="default" @click="handleFilter(item+3)" class="filter-btn" <button type="default" @click="handleFilter(item+3)" class="filter-btn"
:class="{'filter-btn-active':item+3 === filterActiveIndex}" v-for="item in 9" :key='item'> :class="{'filter-btn-active':item+3 === filterActiveIndex}" v-for="item in 9" :key='item'>
<text class="filter-btn__text" :class="{'filter-btn-active__text':item+3 === filterActiveIndex}">{{item+3}}月内</text></button> <text class="filter-btn__text"
:class="{'filter-btn-active__text':item+3 === filterActiveIndex}">{{item+3}}月内</text></button>
</view> </view>
</view> </view>
<uni-list :style="listTop" ref="list" class="listview" :enableBackToTop="true" :scroll-y="true" @scrolltolower="loadMore()"> <uni-list :style="listTop" ref="list" class="listview" :enableBackToTop="true" :scroll-y="true"
@scrolltolower="loadMore()">
<uni-refresh class="refresh" @refresh="onrefresh" @pullingdown="onpullingdown" <uni-refresh class="refresh" @refresh="onrefresh" @pullingdown="onpullingdown"
:display="refreshing ? 'show' : 'hide'"> :display="refreshing ? 'show' : 'hide'">
<div class="refresh-view"> <div class="refresh-view">
...@@ -51,6 +56,10 @@ ...@@ -51,6 +56,10 @@
mapState mapState
} from 'vuex' } from 'vuex'
import {
apiGetProduceOrder
} from '@/servers/produceOrder.js'
export default { export default {
components: { components: {
uniList, uniList,
...@@ -68,15 +77,7 @@ ...@@ -68,15 +77,7 @@
}, },
data() { data() {
return { return {
dataList: [{ dataList: [],
id: "tab01",
name: '最新',
newsid: 0
}, {
id: "tab02",
name: '大公司',
newsid: 23
}],
navigateFlag: false, navigateFlag: false,
pulling: false, pulling: false,
refreshing: false, refreshing: false,
...@@ -92,9 +93,22 @@ ...@@ -92,9 +93,22 @@
contentrefresh: '', contentrefresh: '',
contentnomore: '' contentnomore: ''
}, },
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: {
...@@ -103,42 +117,29 @@ ...@@ -103,42 +117,29 @@
'height': `${this.sysinfo.safeArea.top + 44}px` 'height': `${this.sysinfo.safeArea.top + 44}px`
} }
}, },
conditionTop(){ conditionTop() {
return { return {
'top': `${this.sysinfo.safeArea.top + 44 + 4}px` 'top': `${this.sysinfo.safeArea.top + 44 + 4}px`
} }
}, },
listTop(){ listTop() {
return { return {
'top': `${this.sysinfo.safeArea.top + 120}px` 'top': `${this.sysinfo.safeArea.top + 120}px`
} }
}, },
...mapState(['sysinfo']) ...mapState(['sysinfo'])
}, },
onNavigationBarButtonTap(e){ onNavigationBarButtonTap(e) {
console.log('onNavigationBarButtonTap:',e); console.log('onNavigationBarButtonTap:', e);
uni.navigateTo({ uni.navigateTo({
url: `/pages/produce-order/produce-plan` url: `/pages/produce-order/produce-plan`
}); });
}, },
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) {
...@@ -148,50 +149,37 @@ ...@@ -148,50 +149,37 @@
this.isLoading = true; this.isLoading = true;
this.isNoData = false; this.isNoData = false;
this.requestParams.time = new Date().getTime() + '';
const params = {
var startTime = new Date(); ...this.condition,
uni.request({ ...this.page
// url: this.$host + 'api/news', }
url: 'https://unidemo.dcloud.net.cn/api/news', apiGetProduceOrder(params).then((res) => {
data: this.requestParams, console.log('loadData', res)
success: (result) => { const {
var endTime = new Date(); DATA,
const data = result.data; PAGE,
this.isNoData = (data.length <= 0); TOTAL
} = res
const data_list = data.map((news) => { const data_list = DATA;
return { this.page.PAGE = PAGE
id: this.newGuid() + news.id,
newsid: news.id, this.isNoData = (data_list.length <= 0);
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) { if (refresh) {
this.dataList = data_list; this.dataList = data_list;
this.requestParams.minId = 0;
} else { } else {
this.dataList = this.dataList.concat(data_list); 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) { if (this.dataList.length > 0 && this._isWidescreen && this.dataList.length <= 10) {
this.goDetail(this.dataList[0]); this.goDetail(this.dataList[0]);
} }
}, }).catch(() => {
fail: (err) => {
if (this.dataList.length == 0) { if (this.dataList.length == 0) {
this.isNoData = true; this.isNoData = true;
} }
}, }).finally(() => {
complete: (e) => {
this.isLoading = false; this.isLoading = false;
if (refresh) { if (refresh) {
this.refreshing = false; this.refreshing = false;
...@@ -204,16 +192,15 @@ ...@@ -204,16 +192,15 @@
this.pulling = false; this.pulling = false;
}, 1000); }, 1000);
} }
} })
});
}, },
loadMore(e) { loadMore(e) {
console.log('loadMore') console.log('loadMore')
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) {
...@@ -225,6 +212,7 @@ ...@@ -225,6 +212,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) {
...@@ -253,17 +241,10 @@ ...@@ -253,17 +241,10 @@
this.refreshText = "下拉可以刷新"; this.refreshText = "下拉可以刷新";
} }
}, },
newGuid() {
let s4 = function() {
return (65536 * (1 + Math.random()) | 0).toString(16).substring(1);
}
return (s4() + s4() + "-" + s4() + "-4" + s4().substr(0, 3) + "-" + s4() + "-" + s4() + s4() + s4())
.toUpperCase();
},
handleShowDetail() { handleShowDetail() {
this.ishowDetail = !this.ishowDetail this.ishowDetail = !this.ishowDetail
}, },
handleFilter(item){ handleFilter(item) {
this.filterActiveIndex = item this.filterActiveIndex = item
} }
} }
...@@ -321,25 +302,25 @@ ...@@ -321,25 +302,25 @@
/* #endif */ /* #endif */
} }
.conditon-block{ .conditon-block {
position: fixed; position: fixed;
left: 0; left: 0;
top: 88rpx; top: 88rpx;
right: 0; right: 0;
bottom: 0; bottom: 0;
z-index:10; z-index: 10;
height: 124rpx; height: 124rpx;
overflow:hidden; overflow: hidden;
background-color: #fff; background-color: #fff;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 40rpx 32rpx 0 16rpx; padding: 40rpx 32rpx 0 16rpx;
} }
.conditon-block-auto{ .conditon-block-auto {
height: 460rpx; height: 460rpx;
overflow:auto; overflow: auto;
max-height:230px; max-height: 230px;
} }
.icon-arrow { .icon-arrow {
...@@ -356,17 +337,17 @@ ...@@ -356,17 +337,17 @@
transform: rotate(180deg); transform: rotate(180deg);
} }
.filter-title{ .filter-title {
display: flex; display: flex;
} }
.filter-btn{ .filter-btn {
flex: 1; flex: 1;
min-width:148rpx; min-width: 148rpx;
max-width:148rpx; max-width: 148rpx;
height: 68rpx; height: 68rpx;
line-height:unset; line-height: unset;
background: #f8f8f8; background: #f8f8f8;
border-radius: 16rpx; border-radius: 16rpx;
margin-right: 20rpx; margin-right: 20rpx;
...@@ -375,24 +356,24 @@ ...@@ -375,24 +356,24 @@
border: 2rpx solid #f8f8f8; border: 2rpx solid #f8f8f8;
} }
.filter-btn__text{ .filter-btn__text {
height: 68rpx; height: 68rpx;
line-height: 68rpx; line-height: 68rpx;
color: #8e8e8e; color: #8e8e8e;
font-size: 24rpx; font-size: 24rpx;
} }
.filter-btn-active{ .filter-btn-active {
background: #f61d30; background: #f61d30;
border: 2rpx solid #f61d30; border: 2rpx solid #f61d30;
box-shadow: 0px 4rpx 12rpx 0px rgba(255,29,50,0.56); box-shadow: 0px 4rpx 12rpx 0px rgba(255, 29, 50, 0.56);
} }
.filter-btn-active__text{ .filter-btn-active__text {
color: #fff; color: #fff;
} }
.filter-content{ .filter-content {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
......
...@@ -12,24 +12,42 @@ ...@@ -12,24 +12,42 @@
</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>
<view class="planout-block"> <view class="planout-block">
<text class="planout-block-title">生产产品</text> <text class="planout-block-title">生产产品</text>
<image class="planout-block-icon" src="@/static/image/shop_more@3x.png" mode="aspectFit"></image> <image class="planout-block-icon" src="@/static/image/shop_more@3x.png" @click="addPlanout()"
mode="aspectFit"></image>
</view> </view>
<scroll-view class="scroll-area view" :scroll-top="scrollTop" scroll-y="true" :show-scrollbar='false'> <scroll-view class="scroll-area view" :scroll-top="scrollTop" scroll-y="true" :show-scrollbar='false'>
<uni-swipe-action class="planout-block-lists"> <uni-swipe-action class="planout-block-lists">
<uni-swipe-action-item v-for="item in 2" :key='item'> <uni-swipe-action-item v-for="(item,index) in planinnerLists" :key='index'>
<view class="middle view planout-block-item"> <view class="middle view planout-block-item">
<view class="text-block title-first"> <view class="text-block title-first">
<text class="middle-date title-first__text">1</text> <text class="middle-date title-first__text">{{index+1}}</text>
</view> </view>
<view class="text-block"> <view class="text-block" @click="selectProduct(index,'inner')">
<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">
<text class="middle-date-des">请选择</text> <text class="middle-date-des">{{item.DESCRIPTION}}</text>
</view> </view>
</view> </view>
<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode="aspectFit"></image> <image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode="aspectFit"></image>
...@@ -37,20 +55,21 @@ ...@@ -37,20 +55,21 @@
</view> </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" value="" placeholder="请填写" /> <input class="middle-date-des" type="text" @blur="updateNoQuotaData(index,'',item)"
v-model="item.quantity" placeholder="请填写" />
</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">789</text> <text class="middle-date-des">{{item.PUR_DATE}}</text>
</view> </view>
<view class="text-block text-block-last"> <view class="text-block text-block-last">
<text class="middle-date">备注</text> <text class="middle-date">备注</text>
<text class="middle-date-des">789*6*4</text> <input class="middle-date-des" type="text" v-model="item.REMARK" placeholder="请填写" />
</view> </view>
</view> </view>
<template v-slot:right> <template v-slot:right>
<view class="swipe-right-block" @click="handleDel"><text <view class="swipe-right-block" @click="handleDel(index)">
class="swipe-right-block__text">删除</text> <text class="swipe-right-block__text">删除</text>
</view> </view>
</template> </template>
</uni-swipe-action-item> </uni-swipe-action-item>
...@@ -64,8 +83,8 @@ ...@@ -64,8 +83,8 @@
</view> </view>
<view class="popup-content-content"> <view class="popup-content-content">
<text class="popup-content-content__title">提交成功</text> <text class="popup-content-content__title">提交成功</text>
<text class="popup-content-content__title2">生产计划编号:{{ orderNo }}</text> <text class="popup-content-content__title2">生产计划编号:{{ orderInfo.OBJECT_ID }}</text>
<text class="popup-content-content__title2">生产计划单号:{{ orderNo }}</text> <text class="popup-content-content__title2">生产计划单号:{{ orderInfo.PRODPL_ID }}</text>
</view> </view>
<view class="popup-content-foot"> <view class="popup-content-foot">
<text class="popup-content-foot__btn" @click="fnBackHome()">继续添加</text> <text class="popup-content-foot__btn" @click="fnBackHome()">继续添加</text>
...@@ -83,12 +102,35 @@ ...@@ -83,12 +102,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,
scrollTop: 0, scrollTop: 0,
orderNo: '', orderNo: '',
selectedSalesCenterArr: [{
KEY: -1,
VALUE: ''
}],
selectedSalesCenter: {},
salesCenterIndex: -1,
planinnerLists: [{
checked: false,
'quantity': 0,
'total': 0,
'product_info': {},
}],
HEADINFO: {},
productInitInfo: {},
orderInfo: {
OBJECT_ID: ''
},
} }
}, },
computed: { computed: {
...@@ -97,16 +139,160 @@ ...@@ -97,16 +139,160 @@
'height': `${this.sysinfo.safeArea.top + 44}px` 'height': `${this.sysinfo.safeArea.top + 44}px`
} }
}, },
...mapState(['sysinfo']) ...mapState(['sysinfo', 'userInfo'])
}, },
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
this.$refs.popup.open('center') this.submit()
},
created() {
this.initProducePlanData()
},
mounted() {
console.log('监听到事件来自 onShow');
let _this = this
uni.$on('selectedProduct', function(data) {
console.log('监听到事件来自 selectedProduct ,携带参数 msg 为:', data);
const fromIndex = data.index * 1
const selectedProduct = data.selectedProduct
let product = {}
_this.planinnerLists = _this.planinnerLists.map((item, i) => {
if (i === fromIndex) {
item.product_info = {
...selectedProduct
}
product = {
...item
}
}
return item
})
_this.updateNoQuotaData(fromIndex, '', product);
})
},
onUnload() {
uni.$off('selectedProduct')
}, },
methods: { methods: {
// 初始化订单数据
async initProducePlanData() {
const params = {
'PARTNER': this.userInfo.customerCode
}
const res = await apiProducePlanInit(params)
const {
INFO,
YXDY,
ITEM
} = res.DATA
this.selectedSalesCenterArr = YXDY
this.planinnerLists[0] = {
...this.planinnerLists[0],
...ITEM[0]
}
this.HEADINFO = INFO
this.productInitInfo = ITEM[0]
},
async updateNoQuotaData(productIndex, mode = '', product) {
console.log('updateNoQuotaData---entry', productIndex, mode, product)
let item_inner = []
let productAfterInit = this.updateProductByInit(productIndex, mode, product)
console.log('productAfterInit', productAfterInit)
// 产品编号和件数 都有才请求
if (!(productAfterInit?.product_info?.PRODUCT_ID &&
productAfterInit?.PLANQTY_BOX)) {
return
}
item_inner = [productAfterInit]
const params = {
"INFO": this.HEADINFO,
"ITEM": item_inner,
}
const res = await apiUpdateProducePlanData(params)
console.log('updateNoQuotaData', res)
this.planinnerLists = this.planinnerLists.map((item, i) => {
if (i === productIndex) {
item = {
...item,
...product,
...res.DATA[0]
}
}
return item
})
console.log('planinnerLists', this.planinnerLists)
},
// 更新选中的产品
updateProductByInit(productIndex, mode, product) {
const {
PRODUCT_ID,
SHORT_TEXT
} = product.product_info
let obj = {}
this.planinnerLists = this.planinnerLists.map((item, i) => {
if (i === productIndex) {
item.ORDERED_PROD = PRODUCT_ID
item.DESCRIPTION = SHORT_TEXT
item.PLANQTY_BOX = item.quantity
obj = item
}
return item
})
return obj
},
selectProduct(index) {
if (this.salesCenterIndex !== -1) {
uni.navigateTo({
url: `/pages/select-product-pro/select-product-pro?from=produceOrder&mode=&index=${index*1}&head=${JSON.stringify(this.HEADINFO)}`
});
} else {
uni.showToast({
title: '请先选择营销中心',
duration: 2000,
icon: 'none'
});
}
},
addPlanout() {
let product = {
checked: false,
"PRODUCT_ID": "",
"ORDERED_PROD": "",
"DESCRIPTION": "",
"SHORT_TEXT": "",
'NET_PRICE': '',
'NET_VALUE': '',
'product_info': {}
}
this.planinnerLists.unshift(product)
},
// 选择营销中心
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)
},
change(e) { change(e) {
console.log('当前模式:' + e.type + ',状态:' + e.show); console.log('当前模式:' + e.type + ',状态:' + e.show);
}, },
fnBackHome() { fnBackHome() {
this.resetData()
this.$refs.popup.close() this.$refs.popup.close()
}, },
fnCheckOrderByNo() { fnCheckOrderByNo() {
...@@ -115,9 +301,6 @@ ...@@ -115,9 +301,6 @@
url: `/pages/produce-order/produce-order` url: `/pages/produce-order/produce-order`
}) })
}, },
handleDel() {
console.log(1)
},
preStep() { preStep() {
uni.switchTab({ uni.switchTab({
url: `/pages/go-order/go-order` url: `/pages/go-order/go-order`
...@@ -126,7 +309,26 @@ ...@@ -126,7 +309,26 @@
switchChange(e) { switchChange(e) {
console.log('switch1 发生 change 事件,携带值为', e.detail.value) console.log('switch1 发生 change 事件,携带值为', e.detail.value)
this.isChecked = e.detail.value this.isChecked = e.detail.value
this.HEADINFO.PREORDER = e.detail.value === false ? 0 : 1
},
async submit() {
const params = {
INFO: this.HEADINFO,
ITEM: this.planinnerLists
}
const res = await apiUpdateProduceOrder(params)
this.orderInfo = res.DATA1
this.$refs.popup.open('center')
}, },
resetData() {
this.planinnerLists = []
this.salesCenterIndex = -1
this.selectedSalesCenter = {}
this.initProducePlanData()
}
} }
} }
</script> </script>
...@@ -250,6 +452,13 @@ ...@@ -250,6 +452,13 @@
padding: 32rpx 48rpx; padding: 32rpx 48rpx;
} }
.salescenter {
display: flex;
align-items: center;
height: 100rpx;
padding: 0 16px 0 24px;
}
.summary-line { .summary-line {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -288,11 +497,9 @@ ...@@ -288,11 +497,9 @@
width: 152rpx; width: 152rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center;
color: #fff; color: #fff;
font-size: 34rpx; font-size: 34rpx;
font-weight: 500; font-weight: 500;
text-align: center;
padding-left: 24rpx; padding-left: 24rpx;
} }
......
...@@ -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