diff --git a/app.js b/app.js index 1534535..169287b 100644 --- a/app.js +++ b/app.js @@ -3,6 +3,14 @@ var app = getApp(); App({ onShow: function (options) { + var that = this; + wx.getSystemInfo({ + success: function (res) { + that.globalData.winWidth = res.windowWidth; + that.globalData.winHeight = res.windowHeight; + } + }); + var extraData = null; //options.referrerInfo.extraData = { orderID: 33 }; // 判断是否点击其他小程序分享进入 @@ -13,6 +21,8 @@ App({ }, globalData: { + winHeight: 0, + winWidth: 0, UserName:"", shareOrderID: 0, OpenId: "", diff --git a/app.json b/app.json index 92b8bbd..944fd91 100644 --- a/app.json +++ b/app.json @@ -9,7 +9,9 @@ "pages/myCars/myCars", "pages/myCars/carsDetail/carsDetail", "pages/myCars/creatNewCar/creatNewCar", - "pages/message/messageDetail/messageDetail" + "pages/message/messageDetail/messageDetail", + "pages/saleOutStore/saleOutStore", + "pages/saleOutStore/saleOutStoreDetail/saleOutStoreDetail" ], "window": { "backgroundTextStyle": "light", diff --git a/pages/homePage/homePage.js b/pages/homePage/homePage.js index 31c16d9..9ad8144 100644 --- a/pages/homePage/homePage.js +++ b/pages/homePage/homePage.js @@ -25,7 +25,7 @@ Page({ break; // 销售出库 case "3": - transferURL = '/pages/orderList/orderList'; + transferURL = '/pages/saleOutStore/saleOutStore'; break; } diff --git a/pages/orderList/orderDetail/orderDetail.wxml b/pages/orderList/orderDetail/orderDetail.wxml index 2f48076..348dcd6 100644 --- a/pages/orderList/orderDetail/orderDetail.wxml +++ b/pages/orderList/orderDetail/orderDetail.wxml @@ -97,20 +97,20 @@ - + 主数量:{{orderInfo.UnitNumber}} - 辅数量:222{{orderInfo.SecondNumber}} + 辅数量:{{orderInfo.SecondNumber}} - + @@ -135,35 +135,43 @@ - 报价数量 + 辅单位 - {{item}} + {{item.SecondUnit}} - 辅数量 + 报价数量 - 单据明细{{customerName}} + {{item.UnitNumber}} - 政策单价 + 辅数量 - 单据明细{{customerName}} + {{item.SecondNumber}} - + + 确认数量 + + {{item.ConfirmNumber}} + + + + + \ No newline at end of file diff --git a/pages/saleOutStore/saleOutStore.js b/pages/saleOutStore/saleOutStore.js new file mode 100644 index 0000000..4061a6a --- /dev/null +++ b/pages/saleOutStore/saleOutStore.js @@ -0,0 +1,178 @@ +// pages/saleOutStore/saleOutStore.js +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/Driver/SaleOutStoreRpc/GetList' + +// 未审核订单列表 +function getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, successaction) { + let getArr = []; + let method = getListPath; + let params = [true, UnCheckPageIndex, 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 = { + orderState: true, + ID: array[i].ID, + Employee_Name: array[i].Employee_Name, + TotalNumber: array[i].TotalNumber, + Customer_Name: array[i].Customer_Name, + LoadTime: timechage.formatTimeTwo(array[i].LoadTime.substring(6, 19), 'Y/M/D'), + Address: array[i].Address, + } + getArr.push(dmo); + } + let arrLast = that.data.unCheckDataArr.concat(getArr); + that.setData({ + unCheckDataArr: arrLast, + }) + }) +} + +// 已审核订单列表 +function getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize) { + let getArr = []; + let method = getListPath; + let params = [true, UnCheckPageIndex, 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: true, + ID: array[i].ID, + Employee_Name: array[i].Employee_Name, + TotalNumber: array[i].TotalNumber, + Customer_Name: array[i].Customer_Name, + LoadTime: timechage.formatTimeTwo(array[i].LoadTime.substring(6, 19), 'Y/M/D'), + Address: array[i].Address, + } + getArr.push(dmo); + } + let arrLast = that.data.checkedDataArr.concat(getArr); + that.setData({ + checkedDataArr: arrLast, + }) + }) +} + +Page({ + + data: { + checkedDataArr: [], + unCheckDataArr: [], + winHeight: app.globalData.winHeight, + currentTab: 0, + }, + + /** + * 滑动切换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 + }) + } + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.setData({ + checkedDataArr: [1], + unCheckDataArr: [], + }) + var that = this; + + UnCheckPageIndex = 0; + CheckedPageIndex = 0; + getUnCheckOrderList(that, UnCheckPageIndex, PageSize, function (res) { + getCheckedOrderList(that, CheckedPageIndex, PageSize); + + }); + + }, + + //未审核订单滑动到底部加载 + unCheckedScrollLower: function (event) { + var that = this; + UnCheckPageIndex = UnCheckPageIndex + 1; + getUnCheckOrderList(that, UnCheckPageIndex, PageSize, function (res) { + + }); + }, + + //已审核订单滑动到底部加载 + checkedScrollLower: function (event) { + var that = this; + CheckedPageIndex = CheckedPageIndex + 1; + getCheckedOrderList(that, CheckedPageIndex, PageSize); + }, + + // 进入订单详情 + transToOrderDetail: function (e) { + wx.navigateTo({ + url: 'saleOutStoreDetail/saleOutStoreDetail?id=' + e.currentTarget.dataset.detailitemid, + }) + }, + + // 长按删除一条单据 + longPressDelete: function (event) { + var that = this; + var itemID = event.currentTarget.dataset.detailitemid; + wx.showModal({ + title: '提示', + content: '确定要删除' + itemID + '号单据吗?', + success: function (res) { + if (res.confirm) { + var params = [itemID]; + network.transfer_request(deleteItem, params, function (res) { + wx.showToast({ + title: '操作成功', + }) + that.onShow(); + }) + } else if (res.cancel) { + console.log('点击取消了'); + return false; + } + } + }) + }, + + +}) \ No newline at end of file diff --git a/pages/saleOutStore/saleOutStore.json b/pages/saleOutStore/saleOutStore.json new file mode 100644 index 0000000..40e7eda --- /dev/null +++ b/pages/saleOutStore/saleOutStore.json @@ -0,0 +1,5 @@ +{ + "navigationBarBackgroundColor": "white", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "出库列表" +} \ No newline at end of file diff --git a/pages/saleOutStore/saleOutStore.wxml b/pages/saleOutStore/saleOutStore.wxml new file mode 100644 index 0000000..1966914 --- /dev/null +++ b/pages/saleOutStore/saleOutStore.wxml @@ -0,0 +1,53 @@ + + + 未确认 + 已确认 + + + + + + + + + +