| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- /*******************************************************************************
- * Copyright(c) 2024 dongke All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:
- * 2.功能描述:oa 交易记录
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 王英杰 2024-1-19 1.00 列表查询
- *******************************************************************************/
- const Constants = require('@/utils/Constants.js');
- const util = require('@/utils/util.js')
- const mixins = require('@/mixins/index.js')
- Page({
- mixins: [mixins],
- /**
- * 页面的初始数据
- */
- data: {
- pageFlag: false,
- searchContent: [{
- code: 'tradeTime',
- title: mixins.$t("pastThirthtyDays"),
- defaultValue: 5,
- searchType: Constants.searchType.date
- },
- // {
- // code: 'sort',
- // title: '开票状态',
- // searchType: Constants.searchType.radio,
- // value: 1,
- // options: [{
- // "text": "未开票",
- // "value": 1
- // },
- // {
- // "text": "开票中",
- // "value": 2
- // },
- // {
- // "text": "已开票",
- // "value": 3
- // }
- // ],
- // },
- ],
- // 列表区(内容)
- contentList: [{
- name: 'tradeTime',
- title: mixins.$t('orderDate')
- },
- {
- name: 'orderAmount',
- title: mixins.$t('orderAmount'),
- type:'amount'
- },
- {
- name: 'integral',
- title: mixins.$t('usingCloudCoins')
- },
- {
- name: 'discountName',
- title: mixins.$t('useDiscountCoupons')
- },
- {
- name: 'tradeAmount',
- title: mixins.$t('paidInAmount'),
- type:'amount'
- },
- ],
- buttonSaveList: [{
- code: 'drawBill',
- title: '开发票',
- width: '120rpx',
- }, {
- code: 'commonInvoiceHeader',
- title: '常用发票抬头',
- width: '120rpx',
- }],
- tagList: [{
- title: mixins.$t('notInvoiced'), //"未开票"
- }, {
- title: mixins.$t('invoicingInProgress'), //"开票中"
- }, {
- title: mixins.$t('invoiced'), //"已开票"
- }],
- active: 0, //默认查询 未开票
- routeObjName: 'trade',
- },
- /**
- * @desc : 设置查询参数
- * @date : 2024年3月8日
- * @author : 王英杰
- */
- setSearchParams(params) {
- params.tradeStatus = '交易状态-生效'
- // params.receiptStatus = params.sort ? (params.sort == 1 ? '开票状态-未开票' : (params.sort == 2) ? '开票状态-开票中' : '开票状态-已开票') : '开票状态-未开票'
- params.buyEndDate = params.createtimeEnd
- if (this.data.active == 0) { //入库中的查询参数
- params.receiptStatus = '开票状态-未开票'
- }
- if (this.data.active == 1) { //入库中的查询参数
- params.receiptStatus = '开票状态-开票中'
- }
- if (this.data.active == 2) { //已入库的查询参数
- params.receiptStatus ='开票状态-已开票'
- }
- return params;
- },
- /**
- * @desc : 查询 入库单
- * @date : 2024年3月8日
- * @author : 王英杰
- */
- getData(params) {
- return this.excute(this.data.service, this.data.service.selectByCond, params);
- },
- /**
- * @desc : 处理接口返回数据
- * @date : 2024年3月8日
- * @author : 王英杰
- */
- handleSearchData(tableData) {
- let temp = tableData
- temp.forEach(it => {
- it.tradeTime = this.formatDateOnly(it.tradeTime)
- it.integral = it.integral+"枚"
- it.receiptStatusName = it.receiptStatusName?it.receiptStatusName:'未开票'
- it.discountName = it.discount!=null? it.discount +"折优惠卷":"-"
- })
- this.setData({
- tableData: temp,
- })
- },
- /**
- * @desc : 底部按钮事件
- * @date : 2024/2/1 15:49
- * @author : 王英杰
- */
- saveButton(e) {
- let name = e.detail.name
- let url = ""
- if (name == 'drawBill') { //开发票
- url= '/package-basic-data/pages/draw-bill/draw-bill'
- } else if (name == 'commonInvoiceHeader') { //常用发票抬头
- url= '/package-basic-data/pages/invoice-header/invoice-header'
- }
- let _this = this
- wx.navigateTo({
- url: url,
- events: {
- // 回调后,在这里给页面赋值
- refresh: function (e) {
- }
- },
- success: function (res) {
- // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
- res.eventChannel.emit('params', {})
- }
- })
- },
- /**
- * @desc : 跳转明细
- * @date : 2024/2/1 15:49
- * @author : 王英杰
- */
- toDetail(e){
- wx.navigateTo({
- url: '/package-basic-data/pages/historical-purchase-history/detail/detail',
- events: {
- // 回调后,在这里给页面赋值
- refresh: function (e) {
- }
- },
- success: function (res) {
- // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
- res.eventChannel.emit('params', {
- item:e.detail.item
- })
- }
- })
- },
- /**
- * @desc : 切换 未开票 开票中 已开票
- * @date : 2024年3月8日
- * @author : 王英杰
- */
- onChangeTabs(e) {
- let index = e.detail.detail.index
- this.setData({
- active: index,
- })
- this.searchData()
- },
- })
|