Browse Source

销售预报新建页面变更完成

master
chenxuhui 7 years ago
parent
commit
187d4c812b
4 changed files with 247 additions and 32 deletions
  1. +1
    -1
      pages/customerChooseTemplate/customerChooseTemplate.js
  2. +134
    -1
      pages/saleForecastList/newBill/newBill.js
  3. +61
    -30
      pages/saleForecastList/newBill/newBill.wxml
  4. +51
    -0
      pages/saleForecastList/newBill/newBill.wxss

+ 1
- 1
pages/customerChooseTemplate/customerChooseTemplate.js View File

@ -164,7 +164,7 @@ Page({
// 新建预报页面只允许选取一位客户
if (fromPage == "newForecast" && e.detail.value.length > 0) {
this.setData({
checkBoxArray: e.detail.value,
storageCheckBoxArray: e.detail.value,
})
this.storageAddCustomerArrayBack();
}


+ 134
- 1
pages/saleForecastList/newBill/newBill.js View File

@ -91,7 +91,8 @@ Page({
Details: [],
},
dateTimeArray1: null,
dateTime1: null
dateTime1: null,
backPage:'',
},
onLoad: function (options) {
@ -99,6 +100,78 @@ Page({
setTime(that);
},
onShow:function (){
var that = this;
// 客户收藏列表选取客户调用此方法
/*
if (this.data.backPage == "customerChoosePage") {
// 返回的用户只能是一条,所以index只能为0
var currentCustomerArr = app.globalData.customerArray;
if (currentCustomerArr.length > 0) {
this.data.dmo.Customer_ID = currentCustomerArr[0].ID;
this.data.dmo.Customer_Name = currentCustomerArr[0].Name;
this.setData({
//customerArr: currentCustomerArr,
dmo:this.data.dmo,
})
// 获取客户详情
GetCustomerInfo(that, this.data.dmo);
}
}
*/
if (this.data.backPage == "goodsNameChoosePage") {
// 获取存货 加载完成后计算价格政策
var goodsArr = app.globalData.goodsNameArray;
if (goodsArr.length > 0) {
// 在此添加货品价格的请求
let backGoodsArr = [];
for (var i = 0; i < goodsArr.length; i++) {
// 存货名称
var name = goodsArr[i].Goods_Name;
// 存货ID
var id = goodsArr[i].SaleGoods_ID;
// 获取价格
var unit = goodsArr[i].Unit;
// 原单价
var infoprice = goodsArr[i].Price;
if (infoprice == null) {
infoprice = "";
}
// 特价
var policyPrice = "";
// 开始时间
var infoStartTime = timechage.formatTimeTwo(Date.parse(new Date()), 'Y-M-D');
// 结束时间
var infoEndTime = timechage.formatTimeTwo(Date.parse(new Date()), 'Y-M-D');
// 申请数量
var infoNum = "";
let goodsNameObj = {
Goods_Name: name,
SaleGoods_ID: Number(id),
Price: infoprice,
applicationPrice: policyPrice,
applicationStartTime: infoStartTime,
applicationEndTime: infoEndTime,
applicationNum: infoNum,
applicationUnit: unit,
}
backGoodsArr.push(goodsNameObj)
// 获取原单价
that.GetGoodsPrice(id, unit, i);
}
this.setData({
goodsNameArr: backGoodsArr,
})
}
}
},
/**
* 滑动切换tab
*/
@ -352,6 +425,32 @@ Page({
})
},
// 添加客户
addCustomer: function () {
wx.navigateTo({
url: '../../customerChooseTemplate/customerChooseTemplate?fromePage=newForecast',
})
},
// 添加存货
addGoodsName: function () {
var that = this;
let unitID = that.data.unit[that.data.isUnit].ID;
var customerArr = that.data.customerArr;
if (unitID && customerArr.length > 0) {
let customerID = customerArr[0].ID;
wx.navigateTo({
url: '../../goodaNameChooseTemplate/goodaNameChooseTemplate?unitID=' + unitID + '&customerID' + customerID,
})
} else {
wx.showModal({
title: '提示',
content: '请先选择客户及会计单位',
})
}
},
// 添加存货按钮
add: function (e) {
let newobj = {};
this.data.dmo.Details.push(newobj);
@ -360,6 +459,40 @@ Page({
})
},
// 存货明细页面更多按钮
moreBtnClick: function (e) {
var that = this;
var itemList = [
"审核",
"撤销"
];
wx.showActionSheet({
itemList: itemList,
itemColor: "#2689f8",
success: function (res) {
// res.cancel 用户是不是点击了取消按钮
// res.tapIndex 数组元素的序号,从0开始
that.moreBtnClickedDetailInfo(itemList[res.tapIndex]);
}
})
},
// 更多 -> 撤销 -> 审核
moreBtnClickedDetailInfo: function (item) {
if (item == "审核") {
wx.showModal({
title: "提示",
content: "++++" + item + "++++",
})
} else {
wx.showModal({
title: "提示",
content: "++++" + item + "++++",
})
}
},
// 保存按钮
submitForm: function () {
var dmo = this.data.dmo;


+ 61
- 30
pages/saleForecastList/newBill/newBill.wxml View File

@ -66,52 +66,83 @@
<!-- 订单详细 -->
<swiper-item class="swiper-items2">
<scroll-view scroll-x="false" scroll-y="true" class='scroll-views'>
<view class='main-body'>
<view class="main-body {{dmo.Details.length > 0 ? '' : 'goodsNameImageToTopFar'}}" >
<block wx:for="{{dmo.Details}}" wx:key="item" wx:for-index="idx">
<view class='itemView'>
<view class='baseitem'>
<text class='baseitem_key'>存货名称</text>
<view class='baseitem_value' bindtap="powerDrawer" data-idx='{{idx}}' data-x='存货'>
{{item.Goods_Name?item.Goods_Name:"请选择存货"}}
<text class='baseitem_key'>存货名称</text>
<view class='baseitem_value' bindtap="powerDrawer" data-idx='{{idx}}' data-x='存货'>
{{item.Goods_Name?item.Goods_Name:"请选择存货"}}
</view>
</view>
</view>
<view class='horizontallineView'></view>
<view class='horizontallineView'></view>
<view class='baseitem'>
<text class='baseitem_key'>报货数量</text>
<input class='baseitem_value' bindinput='getGoodsNum' placeholder='请输入报货数量' type='digit' placeholder-style='color:rgb(202, 202, 202)' data-idx='{{idx}}' value='{{item.UnitNum}}'></input>
</view>
<view class='horizontallineView'></view>
<view class='baseitem'>
<text class='baseitem_key'>报货数量</text>
<input class='baseitem_value' bindinput='getGoodsNum' placeholder='请输入报货数量' type='digit' placeholder-style='color:rgb(202, 202, 202)' data-idx='{{idx}}' value='{{item.UnitNum}}'></input>
</view>
<view class='horizontallineView'></view>
<view class='baseitem'>
<text class='baseitem_key' space='ensp'>辅 数 量</text>
<input class='baseitem_value' bindinput='getSecondNum' placeholder='请输入辅数量' type='digit' placeholder-style='color:rgb(202, 202, 202)' data-idx='{{idx}}' value='{{item.SecondNumber}}'></input>
</view>
<view class='horizontallineView'></view>
<view class='baseitem'>
<text class='baseitem_key' space='ensp'>辅 数 量</text>
<input class='baseitem_value' bindinput='getSecondNum' placeholder='请输入辅数量' type='digit' placeholder-style='color:rgb(202, 202, 202)' data-idx='{{idx}}' value='{{item.SecondNumber}}'></input>
</view>
<view class='horizontallineView'></view>
<view class='baseitem'>
<text class='baseitem_key' space='emsp'>单 价</text>
<input class='baseitem_value' type='digit' bindinput='getPrice' placeholder='请输入单价' placeholder-style='color:rgb(202, 202, 202)' data-idx='{{idx}}' value='{{item.Price}}'></input>
</view>
<view class='horizontallineView'></view>
<view class='baseitem'>
<text class='baseitem_key'>政策单价</text>
<text class='baseitem_value' data-idx='{{idx}}'>{{item.PolicyPrice}}</text>
</view>
<view class='horizontallineView'></view>
<view class='baseitem'>
<text class='baseitem_key' space='emsp'>单 价</text>
<input class='baseitem_value' type='digit' bindinput='getPrice' placeholder='请输入单价' placeholder-style='color:rgb(202, 202, 202)' data-idx='{{idx}}' value='{{item.Price}}'></input>
</view>
<view class='horizontallineView'></view>
<view class='delete' catchtap='deleteItem' data-idx='{{idx}}'>删除</view>
</block>
<!-- <view class='add' catchtap='add'>
<image class="ico" src="/imgs/tianjia.png"></image>
</view> -->
</view>
<view class='baseitem'>
<text class='baseitem_key'>政策单价</text>
<text class='baseitem_value' data-idx='{{idx}}'>{{item.PolicyPrice}}</text>
<view class='imageView' catchtap='add'>
<image class='currentImage' src="/imgs/longBlueBtn.png">
<view class='btnTextView'>
<text class='btnText'>添加存货</text>
</view>
<view class='horizontallineView'></view>
</image>
</view>
<view class='bottomGroupView'>
<view class='imageViewNoMargin' catchtap='moreBtnClick'>
<image class='currentImage' src="/imgs/blueBtn.png">
<view class='btnTextView'>
<text class='btnText'>更多</text>
</view>
</image>
</view>
<view class='delete' catchtap='deleteItem' data-idx='{{idx}}'>删除</view>
</block>
<view class='add' catchtap='add'>
<image class="ico" src="/imgs/tianjia.png"></image>
<view class='imageViewNoMargin' catchtap='submitForm'>
<image class='currentImage' src="/imgs/blueBtn.png">
<view class='btnTextView'>
<text class='btnText'>保存</text>
</view>
</image>
</view>
</view>
<button class='submit' catchtap='submitForm'>保存</button>
<!-- <button class='submit' catchtap='submitForm'>保存</button> -->
</scroll-view>
</swiper-item>
</swiper>
@ -130,4 +161,4 @@
</block>
</view>
<view class="btn_ok" catchtap="dialogClose">取消</view>
</view>
</view>

+ 51
- 0
pages/saleForecastList/newBill/newBill.wxss View File

@ -226,4 +226,55 @@ page {
.text3 {
font-size: 18px;
color: rgb(48, 48, 48);
}
.imageView {
height: 80px;
width: 100%;
margin-top: 20rpx;
position: relative;
align-items: center;
justify-content: center;
box-sizing: content-box;
}
.imageViewNoMargin{
height: 80px;
width: 100%;
margin-top: -10rpx;
position: relative;
align-items: center;
justify-content: center;
box-sizing: content-box;
}
.currentImage {
width: 100%;
height: 100%;
}
.bottomGroupView{
margin-top: -10rpx;
width: 100%;
height: 80px;
display: flex;
flex-direction: row;
}
.btnTextView {
position: absolute;
width: 100%;
top:0;
line-height: 65px;
text-align: center;
}
.btnText {
color: white;
font-size: 20px;
}
.goodsNameImageToTopFar{
height: calc(100% - 180px);
background:#EAF1F8;
}

Loading…
Cancel
Save