| @ -0,0 +1,386 @@ | |||
| // pages/waitForApproval/approvalDetail/approvalDetail.js | |||
| var app = getApp(); | |||
| var network = require("../../../utils/net.js"); | |||
| var timechage = require("../../../utils/dateTimeUtil.js"); | |||
| // 销售 - 销售订单 | |||
| var saleOrderMethod = '/MainSystem/B3MiniProgramRpc/Rpcs/ManagerRpc/OrderRpc/Load'; | |||
| // 销售 - 销售预报 | |||
| var saleForecastMethod = '/MainSystem/B3MiniProgramRpc/Rpcs/ManagerRpc/SaleForecastRpc/Load'; | |||
| // 销售 - 业务担保 | |||
| var businessGuaranteeMethod = '/MainSystem/B3MiniProgramRpc/Rpcs/ManagerRpc/BusinessGuaranteeRpc/Load'; | |||
| // 屠宰分割-生产通知单 | |||
| var productNoticeMethod = '/MainSystem/B3MiniProgramRpc/Rpcs/ManagerRpc/ProductNoticeRpc/Load'; | |||
| /** | |||
| * 确定按钮点击进行审核的方法 | |||
| */ | |||
| // 销售 - 销售订单 | |||
| var saleOrderForward = '/MainSystem/B3MiniProgramRpc/Rpcs/ManagerRpc/OrderRpc/Forward'; | |||
| var saleOrderBackward = "/MainSystem/B3MiniProgramRpc/Rpcs/ManagerRpc/OrderRpc/Backward" | |||
| // 销售 - 销售预报 | |||
| var saleForecastForward = '/MainSystem/B3MiniProgramRpc/Rpcs/ManagerRpc/SaleForecastRpc/Forward'; | |||
| var saleForecastBackward = '/MainSystem/B3MiniProgramRpc/Rpcs/ManagerRpc/SaleForecastRpc/Backward'; | |||
| // 销售 - 业务担保 | |||
| var businessGuaranteeForward = '/MainSystem/B3MiniProgramRpc/Rpcs/ManagerRpc/BusinessGuaranteeRpc/Forward'; | |||
| var businessGuaranteeBackward = '/MainSystem/B3MiniProgramRpc/Rpcs/ManagerRpc/BusinessGuaranteeRpc/Backward'; | |||
| // 屠宰分割-生产通知单 | |||
| var productNoticeForward = '/MainSystem/B3MiniProgramRpc/Rpcs/ManagerRpc/ProductNoticeRpc/Forward'; | |||
| var productNoticeBackward = '/MainSystem/B3MiniProgramRpc/Rpcs/ManagerRpc/ProductNoticeRpc/Backward'; | |||
| //将要获取的表头模版名称 | |||
| var formTitleTemplate = ""; | |||
| //将要获取的详情模版名称 | |||
| var detailInfoTemplate = ""; | |||
| var detailItemType = ""; | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| dataArr: [], | |||
| titleObj: {}, | |||
| templateName: "", | |||
| titleTemplateName: "", | |||
| showBottomView: true, | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad: function(options) { | |||
| //正常登录流程进入值为0,分享页面直接进入值为1 | |||
| if (app.globalData.shareInState == 1) { | |||
| return; | |||
| } | |||
| var that = this; | |||
| if (app.globalData.shareInParameter.id) { | |||
| var detailItemID = parseInt(app.globalData.shareInParameter.id); | |||
| detailItemType = app.globalData.shareInParameter.detailItemType; | |||
| } else { | |||
| var detailItemID = parseInt(options.id); | |||
| detailItemType = options.detailItemType; | |||
| var detailItemState = options.detailItemState; | |||
| if (detailItemState == "true") { | |||
| that.setData({ | |||
| showBottomView: true, | |||
| }); | |||
| } else { | |||
| that.setData({ | |||
| showBottomView: false, | |||
| }); | |||
| } | |||
| } | |||
| if (!detailItemID || !detailItemType) { | |||
| wx.showModal({ | |||
| title: '提示', | |||
| content: '单据信息不明确,无法获取详情数据', | |||
| success:function(res){ | |||
| app.globalData.shareInParameter = {}; | |||
| app.globalData.shareInPath = ''; | |||
| if (res.confirm) { | |||
| wx.navigateBack({ | |||
| delta:1, | |||
| }) | |||
| } | |||
| }, | |||
| }); | |||
| return; | |||
| } | |||
| console.log("获取到的详情ID = " + detailItemID); | |||
| console.log("获取到的详情类型 = " + detailItemType); | |||
| let method = ''; | |||
| switch (detailItemType) { | |||
| case "销售-销售订单": | |||
| method = saleOrderMethod; | |||
| break; | |||
| case "销售-销售预报": | |||
| method = saleForecastMethod; | |||
| break; | |||
| case "销售-业务担保": | |||
| method = businessGuaranteeMethod; | |||
| break; | |||
| case "屠宰分割-生产通知单": | |||
| method = productNoticeMethod; | |||
| break; | |||
| } | |||
| let params = [detailItemID]; | |||
| network.transfer_request(method, params, function(res) { | |||
| // let DepartmentWorkFlow_Detail_Name = res.result.DepartmentWorkFlow_Detail_Name | |||
| // if (DepartmentWorkFlow_Detail_Name == "初始") { | |||
| // that.setData({ | |||
| // showBottomView: true, | |||
| // }); | |||
| // } else { | |||
| // that.setData({ | |||
| // showBottomView: true, | |||
| // }); | |||
| // } | |||
| // 置空公众号跳转信息json 防止下次进入 | |||
| app.globalData.shareInParameter = {}; | |||
| app.globalData.shareInPath = ''; | |||
| var array = res.result; | |||
| if (array.length <= 0) { | |||
| wx.showToast({ | |||
| title: '无数据更新', | |||
| }) | |||
| return; | |||
| } | |||
| switch (detailItemType) { | |||
| case "销售-销售订单": | |||
| formTitleTemplate = "commonFormTitleTemplate"; | |||
| detailInfoTemplate = "saleOrderTemplate"; | |||
| that.saleOrder(array, detailInfoTemplate, formTitleTemplate); | |||
| break; | |||
| case "销售-销售预报": | |||
| formTitleTemplate = "commonFormTitleTemplate"; | |||
| detailInfoTemplate = "saleOrderTemplate"; | |||
| // that.saleForecast(array, detailInfoTemplate, formTitleTemplate) | |||
| that.saleOrder(array, detailInfoTemplate, formTitleTemplate); | |||
| break; | |||
| case "销售-业务担保": | |||
| formTitleTemplate = "guaranteeFormTitleTemplate"; | |||
| detailInfoTemplate = "businessGuaranteeTemplate"; | |||
| that.businessGuarantee(array, detailInfoTemplate, formTitleTemplate); | |||
| break; | |||
| case "屠宰分割-生产通知单": | |||
| formTitleTemplate = "commonFormTitleTemplate"; | |||
| detailInfoTemplate = "productNoticeTemplate"; | |||
| that.productNotice(array, detailInfoTemplate, formTitleTemplate); | |||
| break; | |||
| } | |||
| }) | |||
| }, | |||
| // 销售订单 销售预报 数据解析 | |||
| saleOrder: function(result, infoTemplate, titleTemplate) { | |||
| var formTitle = { | |||
| //返回的订单ID | |||
| orderID: result.ID, | |||
| // 购货客户 | |||
| Customer_Name: result.Customer_Name, | |||
| // 会计单位 | |||
| AccountingUnit_Name: result.AccountingUnit_Name, | |||
| // 部门 | |||
| Department_Name: result.Department_Name, | |||
| // 日期 | |||
| CreateTime: timechage.formatTimeTwo(result.CreateTime.substring(6, 19), 'Y/M/D h:m') | |||
| } | |||
| let arrayLast = []; | |||
| var detailArr = result.Details; | |||
| for (var i = 0; i < detailArr.length; i++) { | |||
| var policyPrice = detailArr[i].PolicyPrice; | |||
| if (!policyPrice) { | |||
| policyPrice = 0; | |||
| } | |||
| var dmo = { | |||
| listNumber: i + 1, | |||
| // 存活名称 | |||
| Goods_Name: detailArr[i].Goods_Name, | |||
| // 主数量 | |||
| Number: detailArr[i].Number, | |||
| // 单价 | |||
| Price: detailArr[i].Price, | |||
| // 辅数量 | |||
| SecondNumber: detailArr[i].SecondNumber, | |||
| // 政策单价 | |||
| PolicyPrice: policyPrice, | |||
| } | |||
| arrayLast.push(dmo); | |||
| } | |||
| this.setData({ | |||
| // 表头模版 | |||
| titleTemplateName: titleTemplate, | |||
| // 详情模版名称 | |||
| templateName: infoTemplate, | |||
| // 详情数组 | |||
| dataArr: arrayLast, | |||
| // 表头明细 | |||
| titleObj: formTitle, | |||
| }) | |||
| }, | |||
| // 业务担保数据解析 | |||
| businessGuarantee: function(result, infoTemplate, titleTemplate) { | |||
| var formTitle = { | |||
| //返回的订单ID | |||
| orderID: result.ID, | |||
| // 购货客户 | |||
| Customer_Name: result.Customer_Name, | |||
| // 会计单位 | |||
| AccountingUnit_Name: result.AccountingUnit_Name, | |||
| // 部门 | |||
| Department_Name: result.Department_Name, | |||
| // 担保日期 | |||
| GuaranteeDate: timechage.formatTimeTwo(result.GuaranteeDate.substring(6, 19), 'Y/M/D h:m'), | |||
| // 承诺回款日期 | |||
| CashBackDate: timechage.formatTimeTwo(result.CashBackDate.substring(6, 19), 'Y/M/D h:m'), | |||
| // 担保金额 | |||
| GuaranteeMoney: result.GuaranteeMoney, | |||
| } | |||
| let arrayLast = []; | |||
| var detailArr = result.Details; | |||
| for (var i = 0; i < detailArr.length; i++) { | |||
| var money = detailArr[i].Value; | |||
| if (!money) { | |||
| money = 0; | |||
| } | |||
| var dmo = { | |||
| listNumber: i + 1, | |||
| // 客户名称 | |||
| Customer_Name: detailArr[i].Customer_Name, | |||
| // 单据类型 | |||
| DmoTypeIDName: detailArr[i].DmoTypeIDName, | |||
| // 单号 | |||
| ID: detailArr[i].ID, | |||
| // 单据日期 | |||
| Date: timechage.formatTimeTwo(detailArr[i].Date.substring(6, 19), 'Y/M/D h:m'), | |||
| // 单据金额 | |||
| Value: money, | |||
| } | |||
| arrayLast.push(dmo); | |||
| } | |||
| this.setData({ | |||
| // 表头模版 | |||
| titleTemplateName: titleTemplate, | |||
| // 详情模版名称 | |||
| templateName: infoTemplate, | |||
| // 详情数组 | |||
| dataArr: arrayLast, | |||
| // 表头明细 | |||
| titleObj: formTitle, | |||
| }) | |||
| }, | |||
| // 生产通知单数据解析 | |||
| productNotice: function(result, infoTemplate, titleTemplate) { | |||
| var formTitle = { | |||
| //返回的订单ID | |||
| // 生产通知订单ID在表头内取不到,包含在详情数组内 | |||
| // orderID: result.ID, | |||
| orderID: result.Details[0].ProductNotice_ID, | |||
| // 购货客户 | |||
| Customer_Name: result.Customer_Name, | |||
| // 会计单位 | |||
| AccountingUnit_Name: result.AccountingUnit_Name, | |||
| // 部门 | |||
| Department_Name: result.Department_Name, | |||
| // 日期 | |||
| CreateTime: timechage.formatTimeTwo(result.Date.substring(6, 19), 'Y/M/D'), | |||
| } | |||
| let arrayLast = []; | |||
| var detailArr = result.Details; | |||
| for (var i = 0; i < detailArr.length; i++) { | |||
| var dmo = { | |||
| listNumber: i + 1, | |||
| // 存活名称 | |||
| Goods_Name: detailArr[i].Goods_Name, | |||
| // 主数量 | |||
| Number: detailArr[i].Number, | |||
| // 辅数量 | |||
| SecondNumber: detailArr[i].SecondNumber, | |||
| // 生产日期 | |||
| ProduceDate: timechage.formatTimeTwo(detailArr[i].ProduceDate.substring(6, 19), 'Y/M/D'), | |||
| // 交货日期 | |||
| DeliveryDate: timechage.formatTimeTwo(detailArr[i].DeliveryDate.substring(6, 19), 'Y/M/D'), | |||
| // 加工要求 | |||
| ProduceRequest: detailArr[i].ProduceRequest, | |||
| } | |||
| arrayLast.push(dmo); | |||
| } | |||
| this.setData({ | |||
| // 表头模版 | |||
| titleTemplateName: titleTemplate, | |||
| // 详情模版名称 | |||
| templateName: infoTemplate, | |||
| // 详情数组 | |||
| dataArr: arrayLast, | |||
| // 表头明细 | |||
| titleObj: formTitle, | |||
| }) | |||
| }, | |||
| /** | |||
| * 确定按钮点击事件 | |||
| */ | |||
| sureBtnClicked: function(event) { | |||
| var id = event.currentTarget.dataset.orderid; | |||
| console.log("点击的按钮ID == " + id); | |||
| let method = ''; | |||
| switch (detailItemType) { | |||
| case "销售-销售订单": | |||
| method = saleOrderForward; | |||
| break; | |||
| case "销售-销售预报": | |||
| method = saleForecastForward; | |||
| break; | |||
| case "销售-业务担保": | |||
| method = businessGuaranteeForward; | |||
| break; | |||
| case "屠宰分割-生产通知单": | |||
| method = productNoticeForward; | |||
| break; | |||
| } | |||
| let params = [id]; | |||
| network.transfer_request(method, params, function(res) { | |||
| wx.showToast({ | |||
| title: '审批成功', | |||
| success: function() { | |||
| wx.navigateBack({ | |||
| delta: 1, | |||
| }) | |||
| } | |||
| }) | |||
| }) | |||
| }, | |||
| /** | |||
| * 退回按钮点击事件 | |||
| */ | |||
| cancleBtnClicked: function(event) { | |||
| var id = event.currentTarget.dataset.orderid; | |||
| console.log("点击的按钮ID == " + id); | |||
| let method = ''; | |||
| switch (detailItemType) { | |||
| case "销售-销售订单": | |||
| method = saleOrderBackward; | |||
| break; | |||
| case "销售-销售预报": | |||
| method = saleForecastBackward; | |||
| break; | |||
| case "销售-业务担保": | |||
| method = businessGuaranteeBackward; | |||
| break; | |||
| case "屠宰分割-生产通知单": | |||
| method = productNoticeBackward; | |||
| break; | |||
| } | |||
| let params = [id]; | |||
| network.transfer_request(method, params, function(res) { | |||
| wx.showToast({ | |||
| title: '退回成功', | |||
| success: function() { | |||
| wx.navigateBack({ | |||
| delta: 1, | |||
| }) | |||
| } | |||
| }) | |||
| }) | |||
| }, | |||
| }) | |||
| @ -0,0 +1,3 @@ | |||
| { | |||
| "navigationBarTitleText": "审批单详情" | |||
| } | |||
| @ -0,0 +1,70 @@ | |||
| <!--pages/waitForApproval/approvalDetail/approvalDetail.wxml--> | |||
| <view class='listContainer'> | |||
| <template is="{{titleTemplateName}}" data="{{titleObj}}" /> | |||
| </view> | |||
| <view class='detaileListContainer'> | |||
| <block wx:for="{{dataArr}}" wx:for-item="item"> | |||
| <template is="{{templateName}}" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| <view class='bottomView' wx:if="{{showBottomView}}"> | |||
| <view class='sureBtnView'> | |||
| <view class='sureBtn' data-orderid='{{titleObj.orderID}}' catchtap='sureBtnClicked'> | |||
| <text class='sureBtnText'>确认</text></view> | |||
| </view> | |||
| <view class='cancleBtnView'> | |||
| <view class='cancleBtn' data-orderid='{{titleObj.orderID}}' catchtap='cancleBtnClicked'><text class='cancleBtnText'>退回</text></view> | |||
| </view> | |||
| </view> | |||
| <!-- 销售预报 + 销售订单 + 生产通知 表头--> | |||
| <template name="commonFormTitleTemplate"> | |||
| <view class='listItem'><text class='lightGray'>购货客户:</text>{{titleObj.Customer_Name}}</view> | |||
| <view class='listItem'><text class='lightGray'>会计单位:</text>{{titleObj.AccountingUnit_Name}}</view> | |||
| <view class='listItem'><text class='lightGray'>部门:</text>{{titleObj.Department_Name}}</view> | |||
| <view class='listItem'><text class='lightGray'>日期:</text>{{titleObj.CreateTime}}</view> | |||
| </template> | |||
| <!-- 业务担保 表头--> | |||
| <template name="guaranteeFormTitleTemplate"> | |||
| <view class='listItem'><text class='lightGray'>结账客户:</text>{{titleObj.Customer_Name}}</view> | |||
| <view class='listItem'><text class='lightGray'>会计单位:</text>{{titleObj.AccountingUnit_Name}}</view> | |||
| <view class='listItem'><text class='lightGray'>部门:</text>{{titleObj.Department_Name}}</view> | |||
| <view class='listItem'><text class='lightGray'>担保日期:</text>{{titleObj.GuaranteeDate}}</view> | |||
| <view class='listItem'><text class='lightGray'>承诺回款日期:</text>{{titleObj.CashBackDate}}</view> | |||
| <view class='listItem'><text class='lightGray'>担保金额:</text>{{titleObj.GuaranteeMoney}}</view> | |||
| </template> | |||
| <!-- 销售预报 + 销售订单 明细详情--> | |||
| <template name="saleOrderTemplate"> | |||
| <view class='listNumberView'><text class='lightGray'>明细清单:</text>{{item.listNumber}}</view> | |||
| <view class='listItem'><text class='lightGray'>存货名称:</text>{{item.Goods_Name}}</view> | |||
| <view class='listItem'><text class='lightGray'>主数量:</text>{{item.Number}}</view> | |||
| <view class='listItem'><text class='lightGray'>辅数量:</text>{{item.SecondNumber}}</view> | |||
| <view class='listItem'><text class='lightGray'>单价:</text>{{item.Price}}</view> | |||
| <view class='listItem'><text class='lightGray'>政策单价:</text>{{item.PolicyPrice}}</view> | |||
| </template> | |||
| <!-- 生产通知单 明细详情--> | |||
| <template name="productNoticeTemplate"> | |||
| <view class='listNumberView'><text class='lightGray'>明细清单:</text>{{item.listNumber}}</view> | |||
| <view class='listItem'><text class='lightGray'>存货名称:</text>{{item.Goods_Name}}</view> | |||
| <view class='listItem'><text class='lightGray'>主数量:</text>{{item.Number}}</view> | |||
| <view class='listItem'><text class='lightGray'>辅数量:</text>{{item.SecondNumber}}</view> | |||
| <view class='listItem'><text class='lightGray'>生产日期:</text>{{item.ProduceDate}}</view> | |||
| <view class='listItem'><text class='lightGray'>交货日期:</text>{{item.DeliveryDate}}</view> | |||
| <view class='listItem'><text class='lightGray'>加工要求:</text>{{item.ProduceRequest}}</view> | |||
| </template> | |||
| <!-- 业务担保 明细详情--> | |||
| <template name="businessGuaranteeTemplate"> | |||
| <view class='listNumberView'><text class='lightGray'>担保明细:</text>{{item.listNumber}}</view> | |||
| <view class='listItem'><text class='lightGray'>客户名称:</text>{{item.Customer_Name}}</view> | |||
| <view class='listItem'><text class='lightGray'>单据类型:</text>{{item.DmoTypeIDName}}</view> | |||
| <view class='listItem'><text class='lightGray'>单号:</text>{{item.ID}}</view> | |||
| <view class='listItem'><text class='lightGray'>单据日期:</text>{{item.Date}}</view> | |||
| <view class='listItem'><text class='lightGray'>单据金额:</text>{{item.Value}}</view> | |||
| </template> | |||
| @ -0,0 +1,91 @@ | |||
| /* pages/waitForApproval/approvalDetail/approvalDetail.wxss */ | |||
| .listContainer { | |||
| margin-top: 10rpx; | |||
| display: flex; | |||
| flex-direction: column; | |||
| /* padding: 20rpx 20rpx 20rpx 20rpx; */ | |||
| background-color: #fff; | |||
| } | |||
| .listItem { | |||
| padding: 20rpx 20rpx 20rpx 20rpx; | |||
| border-bottom: 0.1px solid #dbdbdb; | |||
| font-size: 16px; | |||
| color: black; | |||
| } | |||
| .lightGray{ | |||
| color: #666; | |||
| } | |||
| .detaileListContainer { | |||
| display: flex; | |||
| flex-direction: column; | |||
| background-color: #fff; | |||
| } | |||
| .listNumberView { | |||
| background-color: #f0eff5; | |||
| padding: 10rpx 10rpx 10rpx 10rpx; | |||
| font-size: 16px; | |||
| color: #666; | |||
| } | |||
| .bottomView { | |||
| height: 40px; | |||
| width: 100%; | |||
| display: flex; | |||
| flex-direction: row; | |||
| margin-top: 30rpx; | |||
| margin-bottom: 30rpx; | |||
| } | |||
| .sureBtnView { | |||
| height: 100%; | |||
| width: 50%; | |||
| align-items: center; | |||
| justify-content: center; | |||
| display: flex; | |||
| } | |||
| .cancleBtnView { | |||
| height: 100%; | |||
| width: 50%; | |||
| align-items: center; | |||
| justify-content: center; | |||
| display: flex; | |||
| } | |||
| .sureBtn { | |||
| height: 40px; | |||
| width: 80%; | |||
| border: 1; | |||
| border-radius: 8rpx; | |||
| background-color: #2E8CF5; | |||
| text-align: center; | |||
| line-height: 40px; | |||
| } | |||
| .sureBtnText{ | |||
| color: white; | |||
| } | |||
| .cancleBtn { | |||
| height: 40px; | |||
| width: 80%; | |||
| border: 1; | |||
| border-radius: 8rpx; | |||
| background-color: #d6d6d6; | |||
| text-align: center; | |||
| line-height: 40px; | |||
| } | |||
| .cancleBtnText{ | |||
| color: #666; | |||
| } | |||
| page { | |||
| background-color: #f0eff5; | |||
| height: 100%; | |||
| } | |||
| @ -0,0 +1,167 @@ | |||
| const app = getApp(); | |||
| var network = require("../../utils/net.js"); | |||
| var timechage = require("../../utils/dateTimeUtil.js"); | |||
| var UnCheckPageIndex = 0 | |||
| var UnCheckPageSize = 10 | |||
| var CheckedPageIndex = 0 | |||
| var CheckedPageSize = 10 | |||
| var outStoreMethod = '/MainSystem/B3MiniProgramRpc/Rpcs/ManagerRpc/WorkFlowApproveRecordRpc/GetList' | |||
| // 未审核订单列表 | |||
| function getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, successaction) { | |||
| let getArr = []; | |||
| let method = outStoreMethod; | |||
| let params = [false, UnCheckPageIndex, UnCheckPageSize]; | |||
| network.transfer_request(method, params, function(res) { | |||
| var array = res.result; | |||
| successaction(); | |||
| if (array.length <= 0) { | |||
| wx.showToast({ | |||
| title: '无数据更新', | |||
| }) | |||
| if (UnCheckPageIndex > 0) { | |||
| UnCheckPageIndex = UnCheckPageIndex - 1; | |||
| } | |||
| return; | |||
| } | |||
| for (var i = 0; i < array.length; i++) { | |||
| var dmo = { | |||
| //是否显示审批按钮所在bottom | |||
| billState: true, | |||
| billType: array[i].BillType_Name, | |||
| billID: array[i].Bill_ID, | |||
| remark: array[i].EndStateName, | |||
| time: timechage.formatTimeTwo(array[i].CreateTime.substring(6, 19), 'Y/M/D h:m') | |||
| } | |||
| getArr.push(dmo); | |||
| } | |||
| let arrLast = that.data.unCheckDataArr.concat(getArr); | |||
| that.setData({ | |||
| unCheckDataArr: arrLast, | |||
| }) | |||
| }) | |||
| } | |||
| // 已审核订单列表 | |||
| function getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize) { | |||
| let getArr = []; | |||
| let method = outStoreMethod; | |||
| let params = [true, CheckedPageIndex, CheckedPageSize]; | |||
| network.transfer_request(method, params, function(res) { | |||
| var array = res.result; | |||
| if (array.length <= 0) { | |||
| wx.showToast({ | |||
| title: '无数据更新', | |||
| }) | |||
| if (CheckedPageIndex > 0) { | |||
| CheckedPageIndex = CheckedPageIndex - 1; | |||
| } | |||
| return; | |||
| } | |||
| for (var i = 0; i < array.length; i++) { | |||
| var dmo = { | |||
| //是否显示审批按钮所在bottom | |||
| billState: false, | |||
| billType: array[i].BillType_Name, | |||
| billID: array[i].Bill_ID, | |||
| remark: array[i].Remark, | |||
| time: timechage.formatTimeTwo(array[i].CreateTime.substring(6, 19), 'Y/M/D h:m') | |||
| } | |||
| getArr.push(dmo); | |||
| } | |||
| let arrLast = that.data.checkedDataArr.concat(getArr); | |||
| that.setData({ | |||
| checkedDataArr: arrLast, | |||
| }) | |||
| }) | |||
| } | |||
| Page({ | |||
| data: { | |||
| checkedDataArr: [], | |||
| unCheckDataArr: [], | |||
| currentTab: 0, | |||
| winHeight: 0, | |||
| winWidth: 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 | |||
| }) | |||
| } | |||
| }, | |||
| //点击进入详情页面 | |||
| transToOrderDetail: function(event) { | |||
| var itemID = event.currentTarget.dataset.detailitemid; | |||
| var itemType = event.currentTarget.dataset.detailitemtype; | |||
| var itemState = event.currentTarget.dataset.detailitemstate; | |||
| wx.navigateTo({ | |||
| url: 'approvalDetail/approvalDetail?id=' + itemID + '&detailItemType=' + itemType + '&detailItemState=' + itemState, | |||
| }) | |||
| }, | |||
| onShow: function(options) { | |||
| this.setData({ | |||
| checkedDataArr: [], | |||
| unCheckDataArr: [], | |||
| }) | |||
| var that = this; | |||
| wx.getSystemInfo({ | |||
| success: function(res) { | |||
| that.setData({ | |||
| winWidth: res.windowWidth, | |||
| winHeight: res.windowHeight | |||
| }); | |||
| } | |||
| }); | |||
| UnCheckPageIndex = 0; | |||
| CheckedPageIndex = 0; | |||
| getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize,function (res){ | |||
| getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize); | |||
| }); | |||
| }, | |||
| //未审核订单滑动到底部加载 | |||
| unCheckedScrollLower: function(event) { | |||
| var that = this; | |||
| UnCheckPageIndex = UnCheckPageIndex + 1; | |||
| getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, function (res) { }); | |||
| }, | |||
| //已审核订单滑动到底部加载 | |||
| CheckedScrollLower: function(event) { | |||
| var that = this; | |||
| CheckedPageIndex = CheckedPageIndex + 1; | |||
| getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize); | |||
| }, | |||
| /** | |||
| * 页面上拉触底事件的处理函数 | |||
| */ | |||
| onReachBottom: function() { | |||
| var that = this; | |||
| if (this.data.currentTab === 0) { | |||
| UnCheckPageIndex = UnCheckPageIndex + 1; | |||
| getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, function(res) { }); | |||
| } else { | |||
| CheckedPageIndex = CheckedPageIndex + 1; | |||
| getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize); | |||
| } | |||
| }, | |||
| }) | |||
| @ -0,0 +1,3 @@ | |||
| { | |||
| "navigationBarTitleText": "待办审批" | |||
| } | |||
| @ -0,0 +1,44 @@ | |||
| <!--pages/saleOutStore/saleOutStore.wxml--> | |||
| <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> | |||
| <swiper current="{{currentTab}}" class="swiper-box" style='height:{{winHeight -48}}px' duration="300" bindchange="bindChange"> | |||
| <!-- 未审核 --> | |||
| <swiper-item class="swiper-items1"> | |||
| <scroll-view scroll-x="false" scroll-y="true" class='scroll-views' bindscrolltoupper="unCheckedScrollUpper" bindscrolltolower="unCheckedScrollLower"> | |||
| <block wx:for="{{unCheckDataArr}}" wx:for-item="item"> | |||
| <template is="outStoreOrderTemplate" data="{{item}}" /> | |||
| </block> | |||
| </scroll-view> | |||
| </swiper-item> | |||
| <!-- 已审核 --> | |||
| <swiper-item class="swiper-items2"> | |||
| <scroll-view scroll-x="false" scroll-y="true" class='scroll-views' bindscrolltoupper="checkedScrollUpper" bindscrolltolower="CheckedScrollLower"> | |||
| <block wx:for="{{checkedDataArr}}" wx:for-item="item"> | |||
| <template is="outStoreOrderTemplate" data="{{item}}" /> | |||
| </block> | |||
| </scroll-view> | |||
| </swiper-item> | |||
| </swiper> | |||
| <template name="outStoreOrderTemplate"> | |||
| <view class='listItem' catchtap='transToOrderDetail' data-detailitemid='{{item.billID}}' data-detailitemtype='{{item.billType}}' data-detailitemstate='{{item.billState}}'> | |||
| <view class='orderID'> | |||
| <text class='goodsIDText'>状态:{{item.remark}}</text> | |||
| </view> | |||
| <view class='orderID'> | |||
| <text class='goodsMoneyText'>时间:{{item.time}}</text> | |||
| </view> | |||
| <view class='bottomView'> | |||
| <view class='goodsNum'> | |||
| <text class='goodsNumText'>单号:{{item.billID}}</text> | |||
| </view> | |||
| <view class='goodsMoney'> | |||
| <text class='goodsNumText'>类型:{{item.billType}}</text> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </template> | |||
| @ -0,0 +1,100 @@ | |||
| /* pages/saleOutStore/saleOutStore.wxss */ | |||
| .swiper-tab { | |||
| width: 100%; | |||
| /* height: 40px; */ | |||
| text-align: center; | |||
| line-height: 45px; | |||
| background: white; | |||
| display: flex; | |||
| flex-direction: row; | |||
| justify-content: space-around; | |||
| border-bottom: 0.2rpx solid rgb(236, 231, 231); | |||
| } | |||
| .swiper-tab-list { | |||
| font-size: 30rpx; | |||
| width: 25%; | |||
| color: #777; | |||
| } | |||
| .on { | |||
| border-bottom: 1.5px solid #2E8CF5 ; | |||
| color: #2E8CF5; | |||
| } | |||
| .swiper-box { | |||
| margin-top: 3px; | |||
| display: block; | |||
| width: 100%; | |||
| overflow: hidden; | |||
| } | |||
| .swiper-items1 { | |||
| height: 100%; | |||
| /* padding-top: 3%; */ | |||
| } | |||
| .swiper-items2 { | |||
| height: 100%; | |||
| /* padding-top: 3%; */ | |||
| } | |||
| .scroll-views { | |||
| height: 100%; | |||
| width: 100%; | |||
| display: flex; | |||
| flex-direction: column; | |||
| } | |||
| .listItem{ | |||
| /* width: 100%; */ | |||
| /* height: 200rpx; */ | |||
| display: flex; | |||
| flex-direction: column; | |||
| background-color: #fff; | |||
| padding: 20rpx 20rpx; | |||
| border-bottom: 1rpx solid #ddd; | |||
| background: white; | |||
| } | |||
| .orderID{ | |||
| /* height: 50%; | |||
| width: 100%; */ | |||
| } | |||
| .bottomView{ | |||
| /* height: 50%;*/ | |||
| width: 100%; | |||
| display: flex; | |||
| flex-direction: row; | |||
| } | |||
| .goodsNum{ | |||
| /* height: 100%; */ | |||
| width: 50%; | |||
| } | |||
| .goodsIDText{ | |||
| font-size: 16px; | |||
| } | |||
| .goodsNumText{ | |||
| font-size: 14px; | |||
| color: #666; | |||
| } | |||
| .goodsMoney{ | |||
| /* height: 100%;*/ | |||
| width: 50%; | |||
| text-align: right; | |||
| } | |||
| .goodsMoneyText{ | |||
| font-size: 14px; | |||
| color: #666; | |||
| } | |||
| page{ | |||
| background-color: #F0EFF5; | |||
| height: 100%; | |||
| } | |||