Browse Source

预报详情页面及存货逻辑变更

master
chenxuhui 7 years ago
parent
commit
a1d68f3def
4 changed files with 162 additions and 8 deletions
  1. +78
    -6
      pages/saleForecastList/Detail/Detail.js
  2. +31
    -2
      pages/saleForecastList/Detail/Detail.wxml
  3. +52
    -0
      pages/saleForecastList/Detail/Detail.wxss
  4. +1
    -0
      pages/saleForecastList/newBill/newBill.js

+ 78
- 6
pages/saleForecastList/Detail/Detail.js View File

@ -62,7 +62,7 @@ function GetGoodsInfo(that, dmo, detail) {
detail.Price = res.result.Price;
detail.PolicyPrice = res.result.PolicyPrice;
that.setData({
dmo: dmo
dmo: that.data.dmo
});
});
}
@ -91,7 +91,8 @@ Page({
rowIdx: -1,
dmo: {},
dateTimeArray1: null,
dateTime1: null
dateTime1: null,
backPage: '',
},
onLoad: function (options) {
@ -106,6 +107,27 @@ Page({
})
},
onShow: function () {
var that = this;
if (this.data.backPage == "goodsNameChoosePage") {
this.data.backPage = "";
var goodsArr = app.globalData.goodsNameArray;
app.globalData.goodsNameArray = [];
if (goodsArr.length > 0) {
// 在此添加货品价格的请求
for (var i = 0; i < goodsArr.length; i++) {
let newobj = {};
this.data.dmo.Details.push(newobj);
var itemIndex = this.data.dmo.Details.length - 1;
var detail = this.data.dmo.Details[itemIndex];
detail.SaleGoods_ID = goodsArr[i].SaleGoods_ID;
detail.Goods_Name = goodsArr[i].Goods_Name;
GetGoodsInfo(this, this.data.dmo, detail);
}
}
}
},
/**
* 滑动切换tab
*/
@ -360,13 +382,63 @@ Page({
},
add: function (e) {
let newobj = {};
this.data.dmo.Details.push(newobj);
this.setData({
dmo: this.data.dmo
// let newobj = {};
// this.data.dmo.Details.push(newobj);
// this.setData({
// dmo: this.data.dmo
// })
var dmo = this.data.dmo;
if (dmo.Customer_ID == null) {
wx.showToast({
title: '请选择购货客户'
})
return;
}
if (dmo.AccountingUnit_ID == null) {
wx.showToast({
title: '请选择会计单位'
})
return;
}
wx.navigateTo({
url: '../../goodaNameChooseTemplate/goodaNameChooseTemplate?unitID=' + dmo.AccountingUnit_ID + '&customerID' + dmo.Customer_ID,
})
},
// 存货明细页面更多按钮
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;


+ 31
- 2
pages/saleForecastList/Detail/Detail.wxml View File

@ -105,12 +105,41 @@
<view class='delete' catchtap='deleteItem' data-idx='{{idx}}'>删除</view>
</block>
<view class='add' catchtap='add'>
<!-- <view class='add' catchtap='add'>
<image class="ico" src="/imgs/tianjia.png"></image>
</view> -->
</view>
<view class='imageView' catchtap='add'>
<image class='currentImage' src="/imgs/longBlueBtn.png">
<view class='btnTextView'>
<text class='btnText'>添加存货</text>
</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='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>


+ 52
- 0
pages/saleForecastList/Detail/Detail.wxss View File

@ -225,4 +225,56 @@ 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;
}

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

@ -104,6 +104,7 @@ Page({
var that = this;
if (this.data.backPage == "goodsNameChoosePage") {
this.data.backPage ="";
var goodsArr = app.globalData.goodsNameArray;
app.globalData.goodsNameArray = [];
if (goodsArr.length > 0) {


Loading…
Cancel
Save