Browse Source

1、销售预报添加流程状态字段

2、销售订单变更列表显示样式
master
chenxuhui 7 years ago
parent
commit
be7b513e7f
6 changed files with 207 additions and 128 deletions
  1. +113
    -99
      pages/order/order.js
  2. +3
    -3
      pages/order/order.json
  3. +48
    -17
      pages/order/order.wxml
  4. +36
    -3
      pages/order/order.wxss
  5. +6
    -5
      pages/saleForecastList/saleForecastList.js
  6. +1
    -1
      pages/saleForecastList/saleForecastList.wxml

+ 113
- 99
pages/order/order.js View File

@ -1,156 +1,170 @@
// pages/order/order.js
var app = getApp();
var network = require("../../utils/net.js")
var timechage = require("../../utils/dateTimeUtil.js")
var PageIndex = 0
const app = getApp();
var network = require("../../utils/net.js");
var timechage = require("../../utils/dateTimeUtil.js");
var PageSize = 10
var UnCheckPageIndex = 0
var CheckedPageIndex = 0
var getListPath = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/OrderRpc/GetList'
function getList(that, PageIndex, PageSize) {
let method = getListPath
// 未审核订单列表
function getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, successaction) {
let getArr = [];
let method = getListPath;
let params = [{
"BillState": app.globalData.selectBillState,
"BillState": 0,
"StartLoadTime": app.globalData.selectStartDate,
"EndLoadTime": app.globalData.selectEndDate,
"Customer_ID": app.globalData.selectCustomer_ID,
"PageIndex": PageIndex,
"PageSize": PageSize
"PageIndex": UnCheckPageIndex,
"PageSize": PageSize,
}];
network.transfer_request(method, params, function(res) {
network.transfer_request(method, params, function (res) {
successaction();
var array = res.result;
if (array.length <= 0) {
wx.showToast({
title: '无数据更新',
})
UnCheckPageIndex = UnCheckPageIndex - 1;
return;
}
for (var i = 0; i < array.length; i++) {
var dmo = {
orderState: true,
workFlowName: array[i].DepartmentWorkFlow_Detail_Name,
orderID: array[i].ID,
Customer_Name: array[i].Customer_Name,
time: timechage.formatTimeTwo(array[i].LoadTime.substring(6, 19), 'Y/M/D')
}
getArr.push(dmo);
}
let arrLast = that.data.unCheckDataArr.concat(getArr);
that.setData({
arry: res.result
unCheckDataArr: arrLast,
})
setColor(that)
})
}
function setColor(that) {
let array = [];
for (var i = 0; i < that.data.arry.length; i++) {
var color = "";
if (that.data.arry[i].BillState == "未审核") {
color = "rgb(231,20,20)"
} else if (that.data.arry[i].BillState == "已审核") {
color = "rgb(136,136,136)"
// 已审核订单列表
function getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize) {
let getArr = [];
let method = getListPath;
let params = [{
"BillState": 20,
"StartLoadTime": app.globalData.selectStartDate,
"EndLoadTime": app.globalData.selectEndDate,
"Customer_ID": app.globalData.selectCustomer_ID,
"PageIndex": CheckedPageIndex,
"PageSize": PageSize,
}];
network.transfer_request(method, params, function (res) {
var array = res.result;
if (array.length <= 0) {
wx.showToast({
title: '无数据更新',
})
CheckedPageIndex = CheckedPageIndex - 1;
return;
}
var dmo = {
Customer_Name: that.data.arry[i].Customer_Name,
LoadTime: timechage.formatTimeTwo(that.data.arry[i].LoadTime.substring(6, 19), 'Y/M/D h:m'),
BillState: that.data.arry[i].BillState,
ID: that.data.arry[i].ID,
DepartmentWorkFlow_Detail_Name: that.data.arry[i].DepartmentWorkFlow_Detail_Name,
color: color,
Money: that.data.arry[i].Money,
Number: that.data.arry[i].Number
};
array.push(dmo);
}
that.setData({
array: array
for (var i = 0; i < array.length; i++) {
var dmo = {
//添加单据状态的传递,在详情页面判断此值,进行是否允许提交的操作
orderState: false,
workFlowName: array[i].DepartmentWorkFlow_Detail_Name,
orderID: array[i].ID,
Customer_Name: array[i].Customer_Name,
time: timechage.formatTimeTwo(array[i].LoadTime.substring(6, 19),'Y/M/D')
}
getArr.push(dmo);
}
let arrLast = that.data.checkedDataArr.concat(getArr);
that.setData({
checkedDataArr: arrLast,
})
})
}
Page({
/**
* 页面的初始数据
*/
data: {
array: [],
arry: [],
scrollTop: 0,
scrollHeight: 0,
checkedDataArr: [],
unCheckDataArr: [],
winHeight: app.globalData.winHeight,
currentTab: 0,
},
/**
* 生命周期函数--监听页面加载
* 滑动切换tab
*/
onLoad: function(options) {
bindChange: function (e) {
var that = this;
PageIndex = 0
PageSize = 10
getList(that, PageIndex, PageSize)
},
that.setData({
currentTab: e.detail.current
});
},
/**
* 生命周期函数--监听页面初次渲染完成
* 点击tab切换
*/
onReady: function() {
swichNav: function (e) {
var that = this;
if (this.data.currentTab === e.target.dataset.current) {
return false;
} else {
that.setData({
currentTab: e.target.dataset.current
})
}
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
this.setData({
checkedDataArr: [],
unCheckDataArr: [],
})
var that = this;
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
UnCheckPageIndex = 0;
CheckedPageIndex = 0;
getUnCheckOrderList(that, UnCheckPageIndex, PageSize, function (res) {
getCheckedOrderList(that, CheckedPageIndex, PageSize);
});
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
PageIndex = 0
PageSize = 10
this.setData({
array: [],
arry: []
})
app.globalData.selectCustomer_ID = null
app.globalData.selectStartDate = null
app.globalData.selectEndDate = null
app.globalData.selectBillState = 0
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
onReachBottom: function() {
},
refesh: function() {
console.log('00000-----------')
//未审核订单滑动到底部加载
unCheckedScrollLower: function (event) {
var that = this;
PageIndex = 0;
PageSize = 10;
getList(that, PageIndex, PageSize)
wx.stopPullDownRefresh() //停止下拉刷新
UnCheckPageIndex = UnCheckPageIndex + 1;
getUnCheckOrderList(that, UnCheckPageIndex, PageSize, function (res) {
});
},
//未审核订单滑动到底部加载
scrollLower: function(event) {
console.log('111111-----------')
//已审核订单滑动到底部加载
checkedScrollLower: function (event) {
var that = this;
PageIndex = PageIndex + 1;
PageSize = 10;
let method = getListPath;
let params = [{
"BillState": app.globalData.selectBillState,
"StartLoadTime": app.globalData.selectStartDate,
"EndLoadTime": app.globalData.selectEndDate,
"Customer_ID": app.globalData.selectCustomer_ID,
"PageIndex": PageIndex,
"PageSize": PageSize
}];
network.transfer_request(method, params, function(res) {
let addarry = that.data.arry.concat(res.result)
that.setData({
arry: addarry
})
setColor(that)
})
CheckedPageIndex = CheckedPageIndex + 1;
getCheckedOrderList(that, CheckedPageIndex, PageSize);
},
itemclick: function(e) {


+ 3
- 3
pages/order/order.json View File

@ -1,5 +1,5 @@
{
"navigationBarTitleText": "订单列表",
"enablePullDownRefresh": true,
"onReachBottomDistance": 50
"navigationBarBackgroundColor": "white",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "订单列表"
}

+ 48
- 17
pages/order/order.wxml View File

@ -1,21 +1,52 @@
<!--pages/order/order.wxml-->
<scroll-view scroll-y="true" class='scroll-views' style='height:{{winHeight -43}}px' bindscrolltolower="scrollLower" bindscrolltoupper="refesh">
<view class="custmer_list_view_main" wx:for="{{array}}" wx:key="item">
<view class='custmer_list_view' catchtap='itemclick' data-Data='{{item}}'>
<view class='phone_h'>
<text class='text_name'>{{item.Customer_Name}}</text>
<text style='color:{{item.color}}' class='text_state'>{{item.BillState}}</text>
<view class="swiper-tab">
<view class="swiper-tab-list {{currentTab==0 ? 'on' : ''}}" data-current="0" bindtap="swichNav">未审核</view>
<view class="swiper-tab-list {{currentTab==1 ? 'on' : ''}}" data-current="1" bindtap="swichNav">已审核</view>
</view>
<swiper current="{{currentTab}}" class="swiper-box" style='height:{{winHeight -95}}px' duration="300" bindchange="bindChange">
<!-- 未审核 -->
<swiper-item class="swiper-items1">
<scroll-view scroll-y="true" class='scroll-views' style='height:{{winHeight -43}}px' bindscrolltolower="unCheckedScrollLower">
<view class="custmer_list_view_main" wx:for="{{unCheckDataArr}}" wx:key="item">
<view class='custmer_list_view' catchtap='itemclick' data-Data='{{item}}'>
<view class='phone_h'>
<text class='text_name'>{{item.Customer_Name}}</text>
<text style='color:{{item.color}}' class='text_state'>流程状态:{{item.workFlowName}}</text>
</view>
<view class='phone_h'>
<text class='text_id'>No.{{item.orderID}}</text>
<text class='text_time'>发货时间:{{item.time}}</text>
</view>
</view>
<view class='view_line_main'>
</view>
</view>
<view class='phone_h'>
<text class='text_id'>No.{{item.ID}}</text>
<text class='text_time'>发货时间:{{item.LoadTime}}</text>
</scroll-view>
</swiper-item>
<swiper-item class="swiper-items2">
<scroll-view scroll-y="true" class='scroll-views' style='height:{{winHeight -43}}px' bindscrolltolower="checkedScrollLower">
<view class="custmer_list_view_main" wx:for="{{checkedDataArr}}" wx:key="item">
<view class='custmer_list_view' catchtap='itemclick' data-Data='{{item}}'>
<view class='phone_h'>
<text class='text_name'>{{item.Customer_Name}}</text>
<text style='color:{{item.color}}' class='text_state'>流程状态:{{item.workFlowName}}</text>
</view>
<view class='phone_h'>
<text class='text_id'>No.{{item.orderID}}</text>
<text class='text_time'>发货时间:{{item.time}}</text>
</view>
</view>
<view class='view_line_main'>
</view>
</view>
</view>
<view class='view_line_main'>
<!-- <view class='view_line'></view> -->
</view>
</view>
</scroll-view>
</scroll-view>
</swiper-item>
</swiper>
<image class='xinjian' bindtap="createNew" src="/imgs/create.png"></image>
<button class='chose' catchtap='chose'>筛选</button>
<button class='chose' catchtap='chose'>筛选</button>

+ 36
- 3
pages/order/order.wxss View File

@ -1,7 +1,39 @@
/* pages/order/order.wxss */
page{
page {
background:#EAF1F8;
height: 100%;
height: calc(100%-10px);
}
.swiper-tab {
/* height: 30px; */
margin: 10px 20px;
text-align: center;
line-height: 30px;
background: white;
display: flex;
flex-direction: row;
border-radius: 5px;
border: 1px solid#2E8CF5;
overflow: hidden;
}
.swiper-tab-list {
height: 100%;
width: 50%;
font-size: 30rpx;
color: #777;
}
.on {
background-color:#2E8CF5 ;
color: white;
}
.swiper-box {
width: 100%;
display: block;
overflow: hidden;
}
.custmer_list_view_main{
@ -10,6 +42,7 @@ page{
.scroll-views {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
@ -70,11 +103,11 @@ page{
.chose{
width: 100%;
height: 40px;
position: fixed;
bottom: 0rpx;
}
.xinjian{
width: 160rpx;
height: 160rpx;


+ 6
- 5
pages/saleForecastList/saleForecastList.js View File

@ -45,7 +45,8 @@ function getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, successact
orderState: true,
orderID: array[i].ID,
Customer_Name: array[i].Customer_Name,
time: timechage.formatTimeTwo(array[i].Date.substring(6, 19), 'Y/M/D')
time: timechage.formatTimeTwo(array[i].Date.substring(6, 19), 'Y/M/D'),
workFlowName: array[i].DepartmentWorkFlow_Detail_Name,
}
getArr.push(dmo);
}
@ -82,7 +83,9 @@ function getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize) {
orderState: false,
orderID: array[i].ID,
Customer_Name: array[i].Customer_Name,
time: timechage.formatTimeTwo(array[i].Date.substring(6, 19), 'Y/M/D')
time: timechage.formatTimeTwo(array[i].Date.substring(6, 19), 'Y/M/D'),
workFlowName: array[i].DepartmentWorkFlow_Detail_Name,
}
getArr.push(dmo);
}
@ -168,9 +171,7 @@ Page({
console.log('点击取消了');
return false;
}
// that.setData({
// images
// });
}
})


+ 1
- 1
pages/saleForecastList/saleForecastList.wxml View File

@ -39,7 +39,7 @@
<text class='goodsIDText'>NO:{{item.orderID}}</text>
</view>
<view class='goodsMoney'>
<text class='goodsMoneyText'>流程状态:{{item.workFlowState}}</text>
<text class='goodsMoneyText'>流程状态:{{item.workFlowName}}</text>
</view>
</view>
<view class='bottomView'>


Loading…
Cancel
Save