Browse Source

特价申请页面变更

master
chenxuhui 7 years ago
parent
commit
dace3ed9f6
4 changed files with 226 additions and 118 deletions
  1. +123
    -55
      pages/specialOrderApplication/specialOrderApplication.js
  2. +2
    -0
      pages/specialOrderApplication/specialOrderApplication.json
  3. +51
    -33
      pages/specialOrderApplication/specialOrderApplication.wxml
  4. +50
    -30
      pages/specialOrderApplication/specialOrderApplication.wxss

+ 123
- 55
pages/specialOrderApplication/specialOrderApplication.js View File

@ -1,95 +1,163 @@
// pages/specialOrderApplication/specialOrderApplication.js
var app = getApp()
const app = getApp();
var network = require("../../utils/net.js");
var timechage = require("../../utils/dateTimeUtil.js");
var UnCheckPageIndex = 0
var CheckedPageIndex = 0
var pageSize = 10
var getList = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/SaleForecastRpc/GetList'
var deleteItem = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/SaleForecastRpc/Delete"
// 未审核订单列表
function getUnCheckOrderList(that, UnCheckPageIndex, pageSize, successaction) {
let getArr = [];
let method = getList;
let params = [{
"BillState": 0,
"Customer_ID": that.data.Customer_ID,
"PageIndex": UnCheckPageIndex,
"PageSize": pageSize,
}];
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 = {
//添加单据状态的传递,在详情页面判断此值,进行是否允许提交的操作 true : 可提交
orderState: true,
orderID: array[i].ID,
Customer_Name: array[i].Customer_Name,
time: timechage.formatTimeTwo(array[i].Date.substring(6, 19), 'Y/M/D'),
workFlowName: array[i].DepartmentWorkFlow_Detail_Name,
}
getArr.push(dmo);
}
let arrLast = that.data.unCheckDataArr.concat(getArr);
that.setData({
unCheckDataArr: arrLast,
})
})
}
// 已审核订单列表
function getCheckedOrderList(that, CheckedPageIndex, pageSize) {
let getArr = [];
let method = getList;
let params = [{
"BillState": 20,
"Customer_ID": that.data.Customer_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;
}
for (var i = 0; i < array.length; i++) {
var dmo = {
//添加单据状态的传递,在详情页面判断此值,进行是否允许提交的操作
orderState: false,
orderID: array[i].ID,
Customer_Name: array[i].Customer_Name,
time: timechage.formatTimeTwo(array[i].Date.substring(6, 19), 'Y/M/D'),
workFlowName: array[i].DepartmentWorkFlow_Detail_Name,
}
getArr.push(dmo);
}
let arrLast = that.data.checkedDataArr.concat(getArr);
that.setData({
checkedDataArr: arrLast,
})
})
}
Page({
/**
* 页面的初始数据
*/
data: {
checkedDataArr: [],
unCheckDataArr: [],
currentTab: 0,
winHeight: app.globalData.winHeight,
unCheckDataArr: [1, 2, 3, 4, 5, ],
dates: new Date().getFullYear() + '-' + (new Date().getMonth() + 1),
searchDate: timechage.formatTimeTwo(Date.parse(new Date()), 'Y-M-D'),
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
// 时间检索条件发生变化,重新请求数据
bindDateChange: function (e) {
bindDateChange: function(e) {
this.setData({
dates: e.detail.value,
})
searchDate: e.detail.value,
})
console.log(e.detail.value)
// 装换成时间戳
let time = timechage.formatymdERTDate(this.data.searchDate);
console.log(time)
},
// 新建特价申请
creatNew:function(){
createNew: function() {
wx.navigateTo({
url: 'creatNewSpecialOrder/creatNewSpecialOrder',
})
},
// 页面滚动到顶
cscrollViewScrollUpper: function (){
},
// 页面滚动到底
scrollViewScrollLower: function (){
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
CheckedScrollLower: function() {
},
/**
* 生命周期函数--监听页面初次渲染完成
* 滑动切换tab
*/
onReady: function () {
bindChange: function(e) {
var that = this;
that.setData({
currentTab: e.detail.current
});
},
/**
* 生命周期函数--监听页面显示
* 点击tab切换
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: 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
})
}
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

+ 2
- 0
pages/specialOrderApplication/specialOrderApplication.json View File

@ -1,3 +1,5 @@
{
"navigationBarBackgroundColor": "white",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "特价申请"
}

+ 51
- 33
pages/specialOrderApplication/specialOrderApplication.wxml View File

@ -1,42 +1,60 @@
<!--pages/specialOrderApplication/specialOrderApplication.wxml-->
<view class='searchView'>
<view class='imput_goodsName'>
<picker mode="date" value="{{date}}" start="2018-01-01" end="2037-12-31" bindchange="bindDateChange" fields='month'>
<view class="picker">
{{dates}}
</view>
</picker>
</view>
<view class='storageView' catchtap='creatNew'>新建</view>
<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>
<view class='pageContainer' style='height:{{winHeight-50}}px'>
<scroll-view class="scroll-views" scroll-x="false" scroll-y="true" bindscrolltoupper="cscrollViewScrollUpper" bindscrolltolower="scrollViewScrollLower">
<block wx:for="{{unCheckDataArr}}" wx:key="item">
<template is="specialOrderApplicationTemplate" data="{{item}}" />
</block>
</scroll-view>
<swiper current="{{currentTab}}" class="swiper-box" style='height:{{winHeight -95}}px' duration="300" bindchange="bindChange">
<!-- 未审核 -->
<swiper-item class="swiper-items1">
<scroll-view scroll-x="false" scroll-y="true" class='scroll-views' bindscrolltolower="unCheckedScrollLower">
<view class='backGroundContainer'>
<block wx:for="{{unCheckDataArr}}" wx:for-item="item" wx:key="item">
<template is="outStoreOrderTemplate" data="{{item}}" />
</block>
</view>
</scroll-view>
</swiper-item>
<!-- 已审核 -->
<swiper-item class="swiper-items2">
<scroll-view scroll-x="false" scroll-y="true" class='scroll-views' bindscrolltolower="CheckedScrollLower">
<view class='backGroundContainer'>
<block wx:for="{{checkedDataArr}}" wx:for-item="item" wx:key="item">
<template is="outStoreOrderTemplate" data="{{item}}" />
</block>
</view>
</scroll-view>
</swiper-item>
</swiper>
<image class='xinjian' bindtap="createNew" src="/imgs/create.png"></image>
<!-- <button class='chose' catchtap='bindDateChange'>{{searchDate}}</button> -->
<view class='searchView'>
<picker mode="date" value="{{date}}" start="2018-01-01" end="2037-12-31" bindchange="bindDateChange" fields='day'>
<view class="picker">筛选</view>
</picker>
</view>
<template name="specialOrderApplicationTemplate">
<view class='listContainer'>
<view class='listItem' catchtap='transToOrderDetail' data-detailitemid='{{item.orderID}}' data-detailitemstate='{{item.orderState}}'>
<view class='topView'>
<view class='goodsNum'>
<text class='goodsIDText'>{{item.orderID}}审核状态</text>
</view>
<view class='goodsMoney'>
<text class='goodsIDText'>{{item.workFlowState}}招远72号店</text>
</view>
<template name="outStoreOrderTemplate">
<view class='listItem' catchtap='transToOrderDetail' bindlongpress="longPressDelete" data-detailitemid='{{item.orderID}}' data-detailitemstate='{{item.orderState}}'>
<view class='bottomView'>
<view class='goodsNum'>
<text class='goodsIDText'>NO:{{item.orderID}}</text>
</view>
<view class='goodsMoney'>
<text class='goodsMoneyText'>流程状态:{{item.workFlowName}}</text>
</view>
</view>
<view class='bottomView'>
<view class='goodsNum'>
<text class='goodsNumText'>{{item.Customer_Name}}</text>
</view>
<view class='bottomView'>
<view class='goodsNum'>
<text class='goodsNumText'>{{item.Customer_Name}}单号:32364</text>
</view>
<view class='goodsMoney'>
<text class='goodsMoneyText'>{{item.time}}未审核</text>
</view>
<view class='goodsMoney'>
<text class='goodsMoneyText'>发货日期:{{item.time}}</text>
</view>
</view>
<view class='horizontallineView'></view>
</view>
<view class='horizontallineView'></view>
</template>

+ 50
- 30
pages/specialOrderApplication/specialOrderApplication.wxss View File

@ -1,38 +1,36 @@
/* pages/specialOrderApplication/specialOrderApplication.wxss */
page {
background:#EAF1F8;
height: calc(100%-10px);
}
.searchView{
margin: 20rpx 20rpx;
height: 30px;
.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;
}
.imput_goodsName{
border: 1rpx solid rgb(236, 231, 231);
color:rgb(202, 202, 202);
height: 30px;
width: 85%;
border-radius: 10rpx;
background-color: #fff;
text-align: center;
line-height: 30px;
.swiper-tab-list {
height: 100%;
width: 50%;
font-size: 30rpx;
color: #777;
}
.storageView{
height: 100%;
padding-top: 10rpx;
width: 15%;
color: orange;
text-align: center;
justify-content: center;
font-size: 20px;
.on {
background-color:#2E8CF5 ;
color: white;
}
.pageContainer {
margin-top: 10px;
.swiper-box {
width: 100%;
display: block;
overflow: hidden;
@ -45,15 +43,17 @@ page {
flex-direction: column;
}
.listContainer{
background-color: #fff;
.backGroundContainer{
background: #fff;
}
.listItem{
height: 100rpx;
display: flex;
flex-direction: column;
padding: 20rpx 20rpx;
background: white;
/* border-bottom: 1rpx solid #ddd; */
}
.horizontallineView {
@ -63,20 +63,17 @@ page {
margin-right: 0rpx;
}
.topView{
.orderID{
height: 50%;
width: 100%;
display: flex;
flex-direction: row;
}
.bottomView{
margin-top: 10rpx;
height: 50%;
width: 100%;
display: flex;
flex-direction: row;
}
.goodsNum{
height: 100%;
width: 50%;
@ -100,4 +97,27 @@ page {
font-size: 14px;
color: #666;
}
.xinjian{
width: 160rpx;
height: 160rpx;
position: fixed;
bottom: 60rpx;
right: 20rpx;
}
.searchView{
width: 100%;
height: 40px;
background-color: #fff;
position: fixed;
bottom: 0rpx;
line-height: 40px;
text-align: center;
}
.chose{
width: 100%;
height: 40px;
position: fixed;
bottom: 0rpx;
}

Loading…
Cancel
Save