From e71c283e0f4bf4d35ab9aded51c5d5db55e84ec2 Mon Sep 17 00:00:00 2001 From: chenxuhui Date: Fri, 23 Nov 2018 15:16:54 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E7=89=B9=E4=BB=B7=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=202=E3=80=81=E7=89=B9?= =?UTF-8?q?=E4=BB=B7=E7=94=B3=E8=AF=B7=E6=96=B0=E5=BB=BA=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 4 +- pages/guarantee/guarantee.js | 8 +- pages/homePage/homePage.js | 2 +- pages/homePage/homePage.wxss | 1 + pages/saleForecastList/newBill/newBill.js | 8 + pages/saleForecastList/saleForecastList.js | 11 +- .../creatNewSpecialOrder.js | 176 ++++++++++++++++ .../creatNewSpecialOrder.json | 5 + .../creatNewSpecialOrder.wxml | 191 ++++++++++++++++++ .../creatNewSpecialOrder.wxss | 161 +++++++++++++++ .../specialOrderApplication.js | 91 +++++++++ .../specialOrderApplication.json | 3 + .../specialOrderApplication.wxml | 36 ++++ .../specialOrderApplication.wxss | 103 ++++++++++ utils/net.js | 2 +- 15 files changed, 792 insertions(+), 10 deletions(-) create mode 100644 pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.js create mode 100644 pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.json create mode 100644 pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.wxml create mode 100644 pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.wxss create mode 100644 pages/specialOrderApplication/specialOrderApplication.js create mode 100644 pages/specialOrderApplication/specialOrderApplication.json create mode 100644 pages/specialOrderApplication/specialOrderApplication.wxml create mode 100644 pages/specialOrderApplication/specialOrderApplication.wxss diff --git a/app.json b/app.json index cf5abbf..54ebabf 100644 --- a/app.json +++ b/app.json @@ -18,7 +18,9 @@ "pages/guarantee/selectbill/selectbill", "pages/guarantee/detailshow/detailshow", "pages/goodaNameChooseTemplate/goodaNameChooseTemplate", - "pages/customerChooseTemplate/customerChooseTemplate" + "pages/customerChooseTemplate/customerChooseTemplate", + "pages/specialOrderApplication/specialOrderApplication", + "pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder" ], "window": { "backgroundTextStyle": "light", diff --git a/pages/guarantee/guarantee.js b/pages/guarantee/guarantee.js index a33de85..fbb9a84 100644 --- a/pages/guarantee/guarantee.js +++ b/pages/guarantee/guarantee.js @@ -7,10 +7,11 @@ var PageSizeN = 10 var PageIndexY = 0 var PageSizeY = 10 -function getListN(that, PageIndex, PageSize) { +function getListN(that, PageIndex, PageSize, successation) { let method = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/BusinessGuaranteeRpc/GetList'; let params = [0,PageIndex, PageSize]; network.transfer_request(method, params, function (res) { + successation(); that.setData({ arrayNN:res.result }) @@ -81,8 +82,9 @@ Page({ */ onLoad: function (options) { var that = this; - getListN(that, PageIndexN, PageSizeN) - getListY(that, PageIndexY, PageSizeY) + getListN(that, PageIndexN, PageSizeN, function (res){ + getListY(that, PageIndexY, PageSizeY); + }) }, /** diff --git a/pages/homePage/homePage.js b/pages/homePage/homePage.js index 8ac255f..3517d72 100644 --- a/pages/homePage/homePage.js +++ b/pages/homePage/homePage.js @@ -33,7 +33,7 @@ Page({ break; // 特价申请 case "3": - transferURL = '/pages/orderList/orderList'; + transferURL = '/pages/specialOrderApplication/specialOrderApplication'; break; // 销售出库 case "4": diff --git a/pages/homePage/homePage.wxss b/pages/homePage/homePage.wxss index 693b4e5..3d95c25 100644 --- a/pages/homePage/homePage.wxss +++ b/pages/homePage/homePage.wxss @@ -2,6 +2,7 @@ page{ background:#EAF1F8; + height: 100%; } .imageContainer{ diff --git a/pages/saleForecastList/newBill/newBill.js b/pages/saleForecastList/newBill/newBill.js index 6ae81e2..f3dfae8 100644 --- a/pages/saleForecastList/newBill/newBill.js +++ b/pages/saleForecastList/newBill/newBill.js @@ -228,6 +228,14 @@ Page({ }, + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + app.globalData.goodsNameArray = []; + app.globalData.customerArray = []; + }, + /** * 滑动切换tab */ diff --git a/pages/saleForecastList/saleForecastList.js b/pages/saleForecastList/saleForecastList.js index 6ca6466..e829a97 100644 --- a/pages/saleForecastList/saleForecastList.js +++ b/pages/saleForecastList/saleForecastList.js @@ -9,7 +9,7 @@ var getList = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/SaleForecastRpc/GetL // 未审核订单列表 -function getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize) { +function getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, successaction) { let getArr = []; let method = getList; let params = [{ @@ -18,8 +18,9 @@ function getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize) { "PageIndex": UnCheckPageIndex, "PageSize": UnCheckPageSize, }]; - // let params = [false, UnCheckPageIndex, UnCheckPageSize]; + network.transfer_request(method, params, function (res) { + successaction(); var array = res.result; if (array.length <= 0) { wx.showToast({ @@ -161,8 +162,10 @@ Page({ var that = this; UnCheckPageIndex = 0; CheckedPageIndex = 0; - getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize); - getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize); + getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, function (res){ + getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize); + + }); }, /** diff --git a/pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.js b/pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.js new file mode 100644 index 0000000..cd7f1ef --- /dev/null +++ b/pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.js @@ -0,0 +1,176 @@ +// pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.js + +var network = require("../../../utils/net.js"); +const app = getApp(); +var dateTimePicker = require('../../../utils/dateTimePicker.js'); +Page({ + + /** + * 页面的初始数据 + */ + data: { + currentTab: 0, + winHeight: app.globalData.winHeight, + winWidth: 0, + detaileList: [1, 1, 3, 4, 5, 6, 7, 7, 4, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 4, 7, 7, 7], + + dateTimeArray: null, + dateTime: null, + dateTimeArray1: null, + dateTime1: null, + startYear: 2018, + endYear: 2030, + // 用户数组 + customerArr:[], + // 存货数组 + goodsNameArr:[], + }, + + changeDateTime1(e) { + this.setData({ + dateTime1: e.detail.value + }); + + }, + + // 添加客户 + addCustomer: function(){ + wx.navigateTo({ + url: '../../customerChooseTemplate/customerChooseTemplate', + }) + }, + + // 添加存货 + addGoodsName: function(){ + wx.navigateTo({ + url: '../../goodaNameChooseTemplate/goodaNameChooseTemplate', + }) + }, + + /** + * 滑动切换tab + */ + bindChange: function (e) { + var that = this; + that.setData({ + currentTab: e.detail.current + }); + }, + /** + * 点击tab切换 + */ + swichNav: function (e) { + var that = this; + if (this.data.currentTab === e.target.dataset.current) { + return false; + } else { + that.setData({ + currentTab: e.target.dataset.current + }) + } + }, + + /** + * 存货明细保存按钮 点击新建单据 内部做逻辑判断 存储值是否都已经加载 + */ + creatNewSpecialOrder:function (){ + let year = this.data.dateTimeArray1[0][this.data.dateTime1[0]] + let month = this.data.dateTimeArray1[1][this.data.dateTime1[1]] + let date = this.data.dateTimeArray1[2][this.data.dateTime1[2]] + let hour = this.data.dateTimeArray1[3][this.data.dateTime1[3]] + let minu = this.data.dateTimeArray1[4][this.data.dateTime1[4]] + + let stringTime = year + "/" + month + "/" + date + " " + hour + ":" + minu + ":00" + let timestamp2 = Date.parse(new Date(stringTime)); + let update = "/Date(" + timestamp2 + "+0800)/"; + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + // 获取完整的年月日 时分秒,以及默认显示的数组 + var obj1 = dateTimePicker.dateTimePicker(this.data.startYear, this.data.endYear); + // 精确到分的处理,将数组的秒去掉 + var lastArray = obj1.dateTimeArray.pop(); + var lastTime = obj1.dateTime.pop(); + + this.setData({ + dateTimeArray: obj1.dateTimeArray, + dateTime: obj1.dateTime, + dateTimeArray1: obj1.dateTimeArray, + dateTime1: obj1.dateTime + }); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + var that = this; + + // 返回的用户只能是一条,所以index只能为0 + var currentCustomerArr = app.globalData.customerArray; + if (currentCustomerArr.length > 0) { + this.setData({ + customerArr: currentCustomerArr, + }) + } + + // 获取存货 加载完成后计算价格政策 + 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; + var id = goodsArr[i].SaleGoods_ID; + var pp = goodsArr[i].PolicyPrice; + var price = goodsArr[i].Price; + var mainUnitRatio = goodsArr[i].Goods_MainUnitRatio; + var secondUnitRatio = goodsArr[i].Goods_SecondUnitRatio; + var unitConvertDirection = goodsArr[i].Goods_UnitConvertDirection; + var rightRatio = goodsArr[i].RightRatio; + var leftRatio = goodsArr[i].LeftRatio; + + if (pp == null) { + pp = Number(0); + } + if (rightRatio == null) { + rightRatio = Number(1); + } + if (leftRatio == null) { + leftRatio = Number(1); + } + + let goodsNameObj = { + Goods_MainUnitRatio: Number(mainUnitRatio), + Goods_SecondUnitRatio: Number(secondUnitRatio), + SaleGoods_ID: Number(id), + Goods_Name: name, + Price: Number(price), + PolicyPrice: Number(pp), + Goods_UnitConvertDirection: Number(unitConvertDirection), + RightRatio: rightRatio, + LeftRatio: leftRatio, + } + backGoodsArr.push(goodsNameObj) + } + + this.setData({ + goodsNameArr: backGoodsArr, + }) + } + + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + app.globalData.goodsNameArray = []; + app.globalData.customerArray = []; + }, + +}) \ No newline at end of file diff --git a/pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.json b/pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.json new file mode 100644 index 0000000..087e695 --- /dev/null +++ b/pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.json @@ -0,0 +1,5 @@ +{ + "navigationBarBackgroundColor": "white", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "特价申请新建" +} \ No newline at end of file diff --git a/pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.wxml b/pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.wxml new file mode 100644 index 0000000..fbf74d5 --- /dev/null +++ b/pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.wxml @@ -0,0 +1,191 @@ + + + 基本信息 + 客户明细 + 存货明细 + + + + + + + + 名称 + + {{customerName}}基本信息 + + + + + + 日期 + + + {{dateTimeArray1[0][dateTime1[0]]}}-{{dateTimeArray1[1][dateTime1[1]]}}-{{dateTimeArray1[2][dateTime1[2]]}} {{dateTimeArray1[3][dateTime1[3]]}}:{{dateTimeArray1[4][dateTime1[4]]}} + + + + + + + + 会计单位 + + {{customerName}} + + + + + + 销售部门 + + {{customerName}} + + + + + + 摘要 + + {{customerName}} + + + + + + + + + + + + +