diff --git a/env/env.js b/env/env.js index ed2622d..d406330 100644 --- a/env/env.js +++ b/env/env.js @@ -1,12 +1,14 @@ module.exports = { DEV: { - URL_PREFIX: 'http://192.168.31.228:8080', + URL_PREFIX: 'http://192.168.31.178/api', }, PRE: { - URL_PREFIX: 'http://192.168.31.228:8080', + URL_PREFIX: 'http://192.168.31.178:8080/api', }, PROD: { - URL_PREFIX: 'http://192.168.31.228:8080', - + URL_PREFIX: 'http://192.168.31.178:8080/api', + }, + IMGURL: { + URL_PREFIX: 'http://192.168.31.178:8080', } } \ No newline at end of file diff --git a/image/apply/ABC.png b/image/apply/ABC.png new file mode 100644 index 0000000..ad9676a Binary files /dev/null and b/image/apply/ABC.png differ diff --git a/image/apply/CCB.png b/image/apply/CCB.png new file mode 100644 index 0000000..441d754 Binary files /dev/null and b/image/apply/CCB.png differ diff --git a/image/apply/ICBC.png b/image/apply/ICBC.png new file mode 100644 index 0000000..eea2dab Binary files /dev/null and b/image/apply/ICBC.png differ diff --git a/image/apply/RCB.png b/image/apply/RCB.png new file mode 100644 index 0000000..5c39d59 Binary files /dev/null and b/image/apply/RCB.png differ diff --git a/image/apply/icon_ABC.png b/image/apply/icon_ABC.png new file mode 100644 index 0000000..d8c00ef Binary files /dev/null and b/image/apply/icon_ABC.png differ diff --git a/image/apply/icon_CCB.png b/image/apply/icon_CCB.png new file mode 100644 index 0000000..f9794f9 Binary files /dev/null and b/image/apply/icon_CCB.png differ diff --git a/image/apply/icon_RCB.png b/image/apply/icon_RCB.png new file mode 100644 index 0000000..3e6f09a Binary files /dev/null and b/image/apply/icon_RCB.png differ diff --git a/image/apply/icon_other.png b/image/apply/icon_other.png new file mode 100644 index 0000000..9d3d3cb Binary files /dev/null and b/image/apply/icon_other.png differ diff --git a/pages/apply/index.js b/pages/apply/index.js index d18c031..c735ad2 100644 --- a/pages/apply/index.js +++ b/pages/apply/index.js @@ -47,9 +47,9 @@ swichPaymentApply:function(e){ show: false, }) }, - goTemplate:function(){ + goTemplate:function(e){ wx.navigateTo({ - url: 'paymentTemplate/paymentTemplate' + url: 'paymentTemplate/paymentTemplate?id='+e.currentTarget.dataset.id }) }, @@ -88,13 +88,16 @@ swichPaymentApply:function(e){ UTIL.httpRequest(API.URL_GET_APPROVALITEMSLIST, {method:'GET',dataType:'1'}, { success: (res) => { if (res.code == API.SUCCESS_CODE) { - + that.setData({ + approvalItemsOptions : res.rows + }) } } }) UTIL.httpRequest(API.URL_GET_ACCOUNTLIST, sendData,{ success: (res) => { for (let i = 0; i < res.rows.length; i++) { + if(res.rows[i].bankAccountNumber==null){continue;} res.rows[i].bankAccountNumber = res.rows[i].bankAccountNumber.replace(/(\d{4})(?=\d)/g, "$1 ") } console.log(res.rows) @@ -104,7 +107,14 @@ swichPaymentApply:function(e){ } }) }, - + delete(e){ + console.log(e); + UTIL.httpRequest(API.URL_GET_REMOVEAPPROVAL + e.currentTarget.dataset.id, {method:'GET'},{ + success: (res) => { + UTIL.showToastNoneIcon('删除成功!'); + } + }) + }, /** * 生命周期函数--监听页面隐藏 */ diff --git a/pages/apply/index.wxml b/pages/apply/index.wxml index 7734e12..c8686cf 100644 --- a/pages/apply/index.wxml +++ b/pages/apply/index.wxml @@ -13,31 +13,22 @@ - + 一般户 - - - - 6217 0021 9000 7972 186卡号 + + + + {{item.bankType == 1 ? '中国银行':item.bankType == 2 ? '农商行(山东省)':item.bankType == 3 ? '农业银行':item.bankType == 4 ? '建设银行':''}} + + + {{item.bankAccountNumber}}卡号 可用余额 - 10,288.83 + {{item.balance}} - - - 一般户 - - - - - 6217 0021 9000 7972 186卡号 - 可用余额 - 10,288.83 - - - + @@ -61,47 +52,19 @@ - + - + - 日常支付水电模板默认 + {{item.templateName}}默认 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + + \ No newline at end of file diff --git a/pages/apply/index.wxss b/pages/apply/index.wxss index a0d02b2..f61fe60 100644 --- a/pages/apply/index.wxss +++ b/pages/apply/index.wxss @@ -26,7 +26,7 @@ color: #fff; } .main{ - width: 94%; + width: 100%; margin: 0 auto; margin-top: 3vw; } @@ -37,13 +37,38 @@ .bank_content{ color: #fff; - background:linear-gradient(to right, #176AB7, #318DE5); width: 100%; - border-radius: 10px; - /* height: 100%; */ - padding: 2vh 2vh 3vh; + padding: 2vh; +} + +.ICBC{ + background:url('http://192.168.31.196:81/bj/bg_ICBC.png') no-repeat center; + background-size: 100% 100%; +} +.ABC{ + background:url('http://192.168.31.196:81/bj/bg_ABC.png') no-repeat center; + background-size: 100% 100%; +} +.CCB{ + background:url('http://192.168.31.196:81/bj/bg_CCB.png') no-repeat center; + background-size: 100% 100%; +} +.RCB{ + background:url('http://192.168.31.196:81/bj/bg_RCB.png') no-repeat center; + background-size: 100% 100%; } +.bankName{ + margin-top: 0!important; +} +.bankName image{ + vertical-align: middle; + margin-right: 5px; +} +.bankName text{ + margin: 0!important; + display: inline-block; +} .bank_content view{ margin-top: 1vh; } @@ -55,6 +80,11 @@ .bank_box{ position: relative; + box-shadow: 0px 5px 9px #ccc; + overflow: hidden; + border-radius: 15px; + width: 94%; + margin: 0 auto; margin-top: 20px; } .zt { diff --git a/pages/apply/paymentTemplate/add/add.js b/pages/apply/paymentTemplate/add/add.js index e637a63..e70e33c 100644 --- a/pages/apply/paymentTemplate/add/add.js +++ b/pages/apply/paymentTemplate/add/add.js @@ -1,6 +1,11 @@ // pages/apply/paymentTemplate/add/add.js import * as UTIL from '../../../../utils/util.js'; import * as API from '../../../../utils/API.js'; +let EVN_CONFIG = require('../../../../env/env'); +const DISTRIBUTE_ENVIROMENT = 'IMGURL'; +let { + URL_PREFIX, +} = EVN_CONFIG[DISTRIBUTE_ENVIROMENT]; const app = getApp(); Page({ @@ -10,68 +15,339 @@ Page({ data: { isIPX: app.globalData.isIPX, radio:'1', - steps: [ - { - assigneeName: '同意', - activityName: '测试测试', - durationInMillis: '描述信息', - endTime: '2022-01-02', - comment: '同意', - type: '1' + active:0, + projectText:'', + balance:0, + showCapitalExpenditureType:false, + showApplyDate:false, + showTransferType:false, + showProject:false, + showProjectFundType:false, + showAccount:false, + showDialog:false, + capitalExpenditureTypeOptions:[], + transferTypeOptions:[], + projectOptions:[], + projectFundTypeOptions:[], + contractionOptions:[], + accountOptions:[], + moneyorderOptions:[], + form:{ + approvalItemTemplate:{ + approvalItems:'',//审批事项 + submitCompany:'',//提交单位 + submitDate:'',//提交日期 + submitter:'',//提交人 + telephone:'',//联系方式 + totalAmount:0,//合计金额 + templateName:'',//模板名称 选择保存模板的时候添加 + dataType:'',//数据类型 }, - { - assigneeName: '申请中', - activityName: '测试测试', - durationInMillis: '描述信息', - endTime: '2022-01-02', - comment: '同意', - type: '2' - }, - { - assigneeName: '驳回', - activityName: '测试测试', - durationInMillis: '描述信息', - endTime: '2022-01-02', - comment: '同意', - type: '3' - }, - { - assigneeName: '步骤四', - activityName: '测试测试', - durationInMillis: '描述信息', - endTime: '2022-01-02', - comment: '同意' - }, - ], - active:0 + transfers:[{//事项信息集合以下是List对象信息 + num:"一", + capitalExpenditureType:'',//资金支出类别 + capitalExpenditureTypeText:'',//资金支出类别(展示用) + succeedAmount:'',//成功支付金额 + payer:'',//付款方 + payerAccount:'',//付款方账户 + bankType:'',//所属银行 + bankTypeText:'',//所属银行(展示用) + isPeers:'',//是否同行 + operatorCode:'',//操作员代码 + enterpriseCode:'',//企业编码 + expenditureAmount:'',//支出总金额 + applyDate:'',//申请时间 + transferStatus:'',//转账状态 + auditStatus:'0',//审批状态 + paymentState:'',//支付状态 + approvalMode:'1',//审批模式 + paymentTime:'',//支付时间 + bankPriority:'',//银行处理优先级 + clientPriority:'',//客户处理优先级 + transferType:'',//付款方式 + transferTypeText:'',//付款方式(展示用) + requiredTransferTime:'',//要求转账时间 + remark:'',//付款事由 + startTime:'',//开票日期 + endTime:'',//到期日期 + orderType:'',//汇票类型 + bankAccountType:'',//账户类别1 公户2私户 + villageAccountType:'',//账户分类 + payeeList:[{//收款方账户集合 + payeeId:'0',//收款方id + payee:'',//收款方 + bankDeposit:'',//开户行 + incomeAmount:'',//收入金额 + bankType:'',//所属银行0其他银行1中国银行2农商行(山东省)3农业银行4建设银行5工商银行 + payeeAccount:'',//收款账户 + }], + }], + }, + projectForm:{ + projectId:'', + projectName:'', + projectContractor:'', + projectAmount:'', + projectBillNum:'', + projectFundType:'', + outId:'', + ynType:'1', + }, + contractionForm:{ + id:'', + name:'', + code:'', + totalAmount:'', + }, + accountForm:{}, + fileForm:[], + isUpdate:false, + SJimage: [], + FPimage: [], + QTimage: [], + imgcount:0 }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { - - }, - back:function(){ - wx.navigateBack({ - delta: 1 - }) - }, - //跳转支出申请 - goApproval:function(e){ - console.log(e.currentTarget.dataset.current); - // let cur = e.currentTarget.dataset.current; - // if (this.data.currentTaB == cur) { - // return false; - // }else{ - // wx.navigateTo({ - // url: '../inCome/index?id=' + id, - // }) - // } - wx.navigateTo({ - url: '/pages/apply/approval/approval', - }) + var that = this; + if(options.id){ + setTimeout(function(){ + UTIL.httpRequest(API.URL_GET_APPROVALITEMS+options.id, {method:'GET'}, { + success: (res) => { + if (res.code == API.SUCCESS_CODE) { + console.log(that.data.capitalExpenditureTypeOptions); + if(res.data.approvalItemTemplate == null){return;} + res.data.transfers.forEach( (item,index) => { + res.data.transfers[index].capitalExpenditureTypeText = UTIL.getTransform(item.capitalExpenditureType,that.data.capitalExpenditureTypeOptions); + res.data.transfers[index].transferTypeText = UTIL.getTransform(item.transferType,that.data.transferTypeOptions); + + res.data.transfers[index].bankTypeText = UTIL.getTransform(item.bankType,that.data.bankTypeOptions); + + res.data.transfers[index].payeeList.forEach( (response,i) => { + res.data.transfers[index].payeeList[i].bankTypeText = UTIL.getTransform(response.bankType,that.data.bankTypeOptions); + }) + }) + that.setData({ + form:res.data + }) + //收据附件 + UTIL.httpRequest( + API.URL_GET_FINDLIST, + { + method:'GET', + tableName:'t_yinnong_transfer', + tableId:res.data.approvalItemTemplate.id, + fileType:1 + }, + { + success: (res) => { + let list = []; + res.data.forEach(item=>{ + list.push({ + tempFilePath:URL_PREFIX+item.fileUrl + }) + }) + that.setData({ + SJimage:list + }); + } + }) + //发票 + UTIL.httpRequest( + API.URL_GET_FINDLIST, + { + method:'GET', + tableName:'t_yinnong_transfer', + tableId:res.data.approvalItemTemplate.id, + fileType:2 + }, + { + success: (res) => { + let list = []; + res.data.forEach(item=>{ + list.push({ + tempFilePath:URL_PREFIX+item.fileUrl + }) + }) + that.setData({ + FPimage:list + }); + } + }) + //其他 + UTIL.httpRequest( + API.URL_GET_FINDLIST, + { + method:'GET', + tableName:'t_yinnong_transfer', + tableId:res.data.approvalItemTemplate.id, + fileType:3 + }, + { + success: (res) => { + let list = []; + res.data.forEach(item=>{ + list.push({ + tempFilePath:URL_PREFIX+item.fileUrl + }) + }) + that.setData({ + QTimage:list + }); + } + }) + } + } + }) + },1000) + }else if(options.type == 'update'&!options.id){ + console.log(options); + setTimeout(function(){ + let array = JSON.parse(options.array); + array.transfers.forEach( (item,index) => { + item.capitalExpenditureTypeText = UTIL.getTransform(item.capitalExpenditureType,that.data.capitalExpenditureTypeOptions); + item.transferTypeText = UTIL.getTransform(item.transferType,that.data.transferTypeOptions); + + item.bankTypeText = UTIL.getTransform(item.bankType,that.data.bankTypeOptions); + + item.payeeList.forEach( (response,i) => { + item.payeeList[i].bankTypeText = UTIL.getTransform(response.bankType,that.data.bankTypeOptions); + }) + //收据附件 + UTIL.httpRequest( + API.URL_GET_FINDLIST, + { + method:'GET', + tableName:'t_yinnong_transfer', + tableId:item.id, + fileType:1 + }, + { + success: (res) => { + + let list = []; + + res.data.forEach((item2,index2)=>{ + + wx.downloadFile({ + url: URL_PREFIX+item2.fileUrl, //仅为示例,并非真实的资源 + success (response) { + if (response.statusCode === 200) { + let fileForm = item.fileForm?item.fileForm:[]; + fileForm.push({ + file: response.tempFilePath, + fileType:'1', + bizPath:'transfer', + tableName:'t_yinnong_transfer', + tableId:'' + }) + console.log("--------------fileForm2 start----------------"); + console.log(fileForm); + console.log("--------------fileForm2 end----------------"); + list.push({ + tempFilePath:response.tempFilePath + }) + that.setData({ + ["form.transfers["+index+"].SJimage"]:list, + ["form.transfers["+index+"].fileForm"]:fileForm + }); + } + } + }) + }) + + } + }) + //发票 + UTIL.httpRequest( + API.URL_GET_FINDLIST, + { + method:'GET', + tableName:'t_yinnong_transfer', + tableId:item.id, + fileType:2 + }, + { + success: (res) => { + let list = []; + res.data.forEach((item2,index2)=>{ + wx.downloadFile({ + url: URL_PREFIX+item2.fileUrl, //仅为示例,并非真实的资源 + success (response) { + if (response.statusCode === 200) { + let fileForm = item.fileForm?item.fileForm:[]; + fileForm.push({ + file: response.tempFilePath, + fileType:'2', + bizPath:'transfer', + tableName:'t_yinnong_transfer', + tableId:item.id + }) + list.push({ + tempFilePath:response.tempFilePath + }) + that.setData({ + ["form.transfers["+index+"].FPimage"]:list, + ["form.transfers["+index+"].fileForm"]:fileForm + }); + } + } + }) + }) + } + }) + //其他 + UTIL.httpRequest( + API.URL_GET_FINDLIST, + { + method:'GET', + tableName:'t_yinnong_transfer', + tableId:item.id, + fileType:3 + }, + { + success: (res) => { + let list = []; + let fileForm = item.fileForm?item.fileForm:[]; + res.data.forEach((item2,index2)=>{ + wx.downloadFile({ + url: URL_PREFIX+item2.fileUrl, //仅为示例,并非真实的资源 + success (response) { + if (response.statusCode === 200) { + let fileForm = item.fileForm?item.fileForm:[]; + fileForm.push({ + file: response.tempFilePath, + fileType:'3', + bizPath:'transfer', + tableName:'t_yinnong_transfer', + tableId:item.id + }) + list.push({ + tempFilePath:response.tempFilePath + }) + that.setData({ + ["form.transfers["+index+"].QTimage"]:list, + ["form.transfers["+index+"].fileForm"]:fileForm + }); + } + } + }) + }) + } + }) + }) + that.setData({ + form : array, + isUpdate : true + }) + },1000) + + } }, + /** * 生命周期函数--监听页面初次渲染完成 */ @@ -83,9 +359,507 @@ Page({ * 生命周期函数--监听页面显示 */ onShow() { + var that = this; + + UTIL.httpRequest(API.URL_GET_GETINFO, {method:'GET'}, { + success: (res) => { + if (res.code == API.SUCCESS_CODE) { + that.setData({ + ["form.approvalItemTemplate.submitCompany"]:res.user.bookName, + ["form.approvalItemTemplate.submitDate"]:UTIL.js_date_time(new Date()), + ["form.approvalItemTemplate.submitter"]:res.user.nickName, + ["form.approvalItemTemplate.telephone"]:res.user.phonenumber, + }) + } + } + }) + //所属银行 + UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, { + success: (res) => { + this.setData({ + bankTypeOptions:res.data + }); + } + }) + // 资金支出类别字典查询 + UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'capital_expenditure_type', {method:'GET'}, { + success: (res) => { + that.setData({ + capitalExpenditureTypeOptions:res.data, + }) + } + }) + // 付款方式类型字典查询 + UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'transfer_type', {method:'GET'}, { + success: (res) => { + that.setData({ + transferTypeOptions:res.data, + }) + } + }) + // 项目工程列表 + UTIL.httpRequest(API.URL_GET_GETPROJECTLIST , {method:'GET'}, { + success: (res) => { + that.setData({ + projectOptions:res.rows, + }) + } + }) + // 工程款类型字典查询 + UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'project_fund_type', {method:'GET'}, { + success: (res) => { + that.setData({ + projectFundTypeOptions:res.data, + }) + } + }) + // 获取合同信息列表 + UTIL.httpRequest(API.URL_GET_CONTRACTIONLIST , {method:'GET'}, { + success: (res) => { + that.setData({ + contractionOptions:res.rows, + }) + } + }) + + }, + openBox(even){ + this.setData({ + [even.currentTarget.dataset.name]:true + }) + }, + closeBox(even){ + console.log(even.currentTarget.dataset.name); + this.setData({ + [even.currentTarget.dataset.name]:false + }) + }, + onConfirm(event) { + this.setData({ + [event.currentTarget.dataset.name]: false, + [event.currentTarget.dataset.value]: UTIL.formatDate(event.detail), + }); }, + onConfirmPick(event) { + console.log(event); + this.setData({ + [event.currentTarget.dataset.name]: false, + [event.currentTarget.dataset.value]: event.detail.value.dictValue, + [event.currentTarget.dataset.value+'Text']: event.detail.value.dictLabel, + }); + }, + onConfirmAccount(event) { + console.log(event); + var that = this; + // 所属银行字典查询 + UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, { + success: (res) => { + let array = res.data.filter(function (e) { return e.dictValue == event.detail.value.bankType; }); + this.setData({ + [event.currentTarget.dataset.name]: false, + [event.currentTarget.dataset.value+'.payer']: event.detail.value.accountName, + [event.currentTarget.dataset.value+'.cashierId']: event.detail.value.id, + [event.currentTarget.dataset.value+'.payerAccount']: event.detail.value.bankAccountNumber, + [event.currentTarget.dataset.value+'.bankTypeText']: array[0].dictLabel, + [event.currentTarget.dataset.value+'.bankType']: event.detail.value.bankType, + balance:event.detail.value.balance, + }); + } + }) + }, + onConfirmaTransfer(event) { + console.log(event); + var that = this; + let perames = {}; + this.setData({ + [event.currentTarget.dataset.value+'.payer']: '', + [event.currentTarget.dataset.value+'.payerAccount']: '', + [event.currentTarget.dataset.value+'.bankTypeText']: '', + [event.currentTarget.dataset.value+'.bankType']: '', + [event.currentTarget.dataset.value+'.bankAccountType']: '', + [event.currentTarget.dataset.value+'.isPeers']: '', + balance:0, + }); + if(event.detail.value.dictValue == 1){//村账户查询参数 + perames = { + pageNum:1, + pageSize:999, + accountType:'102', + method:'post', +   params: { +         "townAccountType":"0" +     } + } + // 付款方列表 + UTIL.httpRequest(API.URL_GET_SELECTACCOUNTLIST , perames, { + success: (res) => { + that.setData({ + accountOptions:res.rows, + }) + } + }) + } + if(event.detail.value.dictValue == 2 || event.detail.value.dictValue == 10){//公务卡和现金提现查询参数 + perames = { + pageNum:1, + pageSize:999, + accountType:'102', + method:'GET', + villageAccountType:'' + } + // 付款方列表 + UTIL.httpRequest(API.URL_GET_ACCOUNTLIST , perames, { + success: (res) => { + that.setData({ + accountOptions:res.rows, + }) + } + }) + } + if(event.detail.value.dictValue == 11){//现金使用查询参数 + perames = { + pageNum:1, + pageSize:999, + accountType:'101', + method:'GET' + } + // 付款方列表 + UTIL.httpRequest(API.URL_GET_ACCOUNTLIST , perames, { + success: (res) => { + that.setData({ + accountOptions:res.rows + }) + } + }) + } + if(event.detail.value.dictValue == 4){//代管账户查询参数 + perames = { + pageNum:1, + pageSize:999, + accountType:'102', + method:'GET', + villageAccountType:'1' + } + // 付款方列表 + UTIL.httpRequest(API.URL_GET_ACCOUNTLIST , perames, { + success: (res) => { + that.setData({ + accountOptions:res.rows, + }) + } + }) + } + if(event.detail.value.dictValue == 12){//汇票支出查询参数 + perames = { + pageNum:1, + pageSize:999, + } + // 付款方列表 + UTIL.httpRequest(API.URL_GET_MONEYORDERLIST , perames, { + success: (res) => { + that.setData({ + moneyorderOptions:res.rows, + }) + } + }) + } + this.setData({ + [event.currentTarget.dataset.name]: false, + [event.currentTarget.dataset.value+'.transferType']: event.detail.value.dictValue, + [event.currentTarget.dataset.value+'.transferTypeText']: event.detail.value.dictLabel, + }); + }, + onConfirmProject(event) { + console.log(event); + this.setData({ + [event.currentTarget.dataset.name]: false, + [event.currentTarget.dataset.value]: event.detail.value.projectName, + ['projectForm.projectId']: event.detail.value.id, + ['projectForm.projectContractor']: event.detail.value.projectContractor, + ['projectForm.projectAmount']: event.detail.value.projectAmount, + }); + }, + onConfirmContraction(event) { + console.log(event); + this.setData({ + [event.currentTarget.dataset.name]: false, + [event.currentTarget.dataset.value]: event.detail.value.name, + ['contractionForm.code']: event.detail.value.code, + ['contractionForm.totalAmount']: event.detail.value.totalAmount, + ['contractionForm.id']: event.detail.value.id, + }); + }, + onConfirmMoneyorder(event) { + console.log(event); + this.setData({ + [event.currentTarget.dataset.name]: false, + [event.currentTarget.dataset.value]: event.detail.value.name, + ['contractionForm.code']: event.detail.value.code, + ['contractionForm.totalAmount']: event.detail.value.totalAmount, + ['contractionForm.id']: event.detail.value.id, + }); + }, + goPayeeList(event){ + console.log(event); + wx.navigateTo({ + url: '/pages/payee/index?isPeers='+event.currentTarget.dataset.ispeers+'&bankType='+event.currentTarget.dataset.banktype+'&accountType='+event.currentTarget.dataset.accounttype+'&transferType='+event.currentTarget.dataset.transfertype + '&index='+event.currentTarget.dataset.index, + }) + }, + onChange(event){ + console.log(event); + this.setData({ + [event.currentTarget.dataset.value]: event.detail, + }) + }, + onChangeMoney(event){ + console.log(event); + var that = this; + + this.setData({ + ["form.transfers["+event.currentTarget.dataset.index+"].payeeList["+event.currentTarget.dataset.childrenindex+"].incomeAmount"]: event.detail, + ["form.transfers["+event.currentTarget.dataset.index+"].expenditureAmount"]:event.detail, + }) + }, + back:function(){ + wx.navigateBack({ + delta: 1 + }) + }, + goSubmitMB(){ + this.setData({ + showDialog:true + }) + }, + onClose(){ + this.setData({ + showDialog:false + }) + }, + bindNameInput(even){ + this.setData({ + ["form.approvalItemTemplate.templateName"]:even.detail.value + }) + }, + goSubmit(e){ + var that = this; + if(e.currentTarget.dataset.type == 1){ + if(that.data.form.approvalItemTemplate.templateName == ''){ + UTIL.showToastNoneIcon('请输入模板名称!'); + return; + } + } + if(e.currentTarget.dataset.type == 3){ + for (let i = 0; i < that.data.form.transfers.length; i++) { + that.data.form.transfers[i].approvalMode = '2'; + } + that.data.form.approvalItemTemplate.dataType = e.currentTarget.dataset.type + } + that.data.form.method = 'POST'; + that.data.form.approvalItemTemplate.dataType = e.currentTarget.dataset.type; + let totalAmount = 0 ; + for (let i = 0; i < that.data.form.transfers.length; i++) { + totalAmount += parseInt(that.data.form.transfers[i].expenditureAmount); + } + that.data.form.approvalItemTemplate.totalAmount = totalAmount; + UTIL.httpRequest(API.URL_GET_SAVE, that.data.form, { + success: (res) => { + if (res.code == API.SUCCESS_CODE) { + for (let j = 0; j < res.data.transfers.length; j++) { + for (let i = 0; i < that.data.form.transfers[j].fileForm.length; i++) { + that.data.form.transfers[j].fileForm[i].tableId = res.data.transfers[j].id + const element = that.data.form.transfers[j].fileForm[i]; + wx.uploadFile({ + url: API.URL_GET_UPLOAD, + filePath: element.file, + name: 'file', + header: { + "Content-Type": "multipart/form-data",//记得设置 + "chartset":"utf-8", + 'Authorization':'Bearer '+getApp().globalData.userInfo.token + }, + formData:element, + success (response){ + console.log(res); + if((j+1) == that.data.form.transfers[j].length && (i+1) == that.data.form.transfers[j].fileForm[i].length && e.currentTarget.dataset.type == 0){ + wx.navigateTo({ + url: '/pages/apply/approval/approval?id='+res.data.id, + }) + } + }, + fail(res){ + console.log(res) + } + }) + } + } + } + } + }) + }, + bindKeyInput(even){ + this.setData({ + ["form.approvalItemTemplate.approvalItems"]: even.detail.value, + }) + }, + SJtakephoto(e){ + var that = this; + let fileForm = that.data.form.transfers[e.currentTarget.dataset.index].fileForm?that.data.form.transfers[e.currentTarget.dataset.index].fileForm:[]; + wx.chooseMedia({ + count: 9, + mediaType: ['image','video'], + sourceType: ['album', 'camera'], + maxDuration: 30, + camera: 'back', + success(res) { + console.log(res); + res.tempFiles.forEach(item => { + fileForm.push({ + file: item.tempFilePath, + fileType:'1', + bizPath:'transfer', + tableName:'t_yinnong_transfer', + tableId:'' + }) + }) + console.log(fileForm); + that.setData({ + ["form.transfers["+e.currentTarget.dataset.index+"].SJimage"]:res.tempFiles, + ["form.transfers["+e.currentTarget.dataset.index+"].fileForm"]:fileForm + }) + } + }) + }, + FPtakephoto(e){ + var that = this; + let fileForm = that.data.form.transfers[e.currentTarget.dataset.index].fileForm?that.data.form.transfers[e.currentTarget.dataset.index].fileForm:[]; + wx.chooseMedia({ + count: 9, + mediaType: ['image','video'], + sourceType: ['album', 'camera'], + maxDuration: 30, + camera: 'back', + success(res) { + console.log(res); + res.tempFiles.forEach(item => { + fileForm.push({ + file: item.tempFilePath, + fileType:'2', + bizPath:'transfer', + tableName:'t_yinnong_transfer', + tableId:'' + }) + }) + console.log(fileForm); + that.setData({ + ["form.transfers["+e.currentTarget.dataset.index+"].FPimage"]:res.tempFiles, + ["form.transfers["+e.currentTarget.dataset.index+"].fileForm"]:fileForm + }) + } + }) + }, + QTtakephoto(e){ + var that = this; + let fileForm = that.data.form.transfers[e.currentTarget.dataset.index].fileForm?that.data.form.transfers[e.currentTarget.dataset.index].fileForm:[]; + wx.chooseMedia({ + count: 9, + mediaType: ['image','video'], + sourceType: ['album', 'camera'], + maxDuration: 30, + camera: 'back', + success(res) { + console.log(res); + res.tempFiles.forEach(item => { + fileForm.push({ + file: item.tempFilePath, + fileType:'3', + bizPath:'transfer', + tableName:'t_yinnong_transfer', + tableId:'' + }) + }) + console.log(fileForm); + that.setData({ + ["form.transfers["+e.currentTarget.dataset.index+"].QTimage"]:res.tempFiles, + ["form.transfers["+e.currentTarget.dataset.index+"].fileForm"]:fileForm + }) + } + }) + }, + addList(){ + let transList = this.data.form.transfers; + transList.push({ + num:UTIL.convertToChinaNum(transList.length+1), + capitalExpenditureType:'',//资金支出类别 + capitalExpenditureTypeText:'',//资金支出类别(展示用) + succeedAmount:'',//成功支付金额 + payer:'',//付款方 + payerAccount:'',//付款方账户 + bankType:'',//所属银行 + bankTypeText:'',//所属银行(展示用) + isPeers:'',//是否同行 + operatorCode:'',//操作员代码 + enterpriseCode:'',//企业编码 + expenditureAmount:'',//支出总金额 + applyDate:'',//申请时间 + transferStatus:'',//转账状态 + auditStatus:'0',//审批状态 + paymentState:'',//支付状态 + approvalMode:'1',//审批模式 + paymentTime:'',//支付时间 + bankPriority:'',//银行处理优先级 + clientPriority:'',//客户处理优先级 + transferType:'',//付款方式 + transferTypeText:'',//付款方式(展示用) + requiredTransferTime:'',//要求转账时间 + remark:'',//付款事由 + startTime:'',//开票日期 + endTime:'',//到期日期 + orderType:'',//汇票类型 + bankAccountType:'',//账户类别1 公户2私户 + villageAccountType:'',//账户分类 + payeeList:[{//收款方账户集合 + payeeId:'0',//收款方id + payee:'',//收款方 + bankDeposit:'',//开户行 + incomeAmount:'',//收入金额 + bankType:'',//所属银行0其他银行1中国银行2农商行(山东省)3农业银行4建设银行5工商银行 + payeeAccount:'',//收款账户 + }], + }); + this.setData({ + ["form.transfers"] : transList + }) + }, + openPreview(e){ + let array = []; + console.log(e); + e.currentTarget.dataset.option.forEach(item=>{ + array.push(item.tempFilePath) + }) + console.log(array); + wx.previewImage({ + urls: array, + showmenu:true, + current:array[e.currentTarget.dataset.index] + }) + }, + goKeep(){ + var that = this; + let pages = getCurrentPages(); + let currentPage = null; //当前页面 + let prevPage = null; //上一个页面 + currentPage = pages[pages.length - 1]; //获取当前页面,将其赋值 + prevPage = pages[pages.length - 2]; //获取上一个页面,将其赋值 + console.log(that.data.form); + if (prevPage) { + prevPage.setData({ + form : that.data.form,//将想要传的信息赋值给上一个页面data中的值 + }) + that.back() + } + }, /** * 生命周期函数--监听页面隐藏 */ diff --git a/pages/apply/paymentTemplate/add/add.json b/pages/apply/paymentTemplate/add/add.json index d2f2434..c230a0f 100644 --- a/pages/apply/paymentTemplate/add/add.json +++ b/pages/apply/paymentTemplate/add/add.json @@ -11,6 +11,10 @@ "van-button": "@vant/weapp/button/index", "van-radio": "@vant/weapp/radio/index", "van-radio-group": "@vant/weapp/radio-group/index", - "van-field": "@vant/weapp/field/index" + "van-field": "@vant/weapp/field/index", + "van-popup": "@vant/weapp/popup/index", + "van-picker": "@vant/weapp/picker/index", + "van-calendar": "@vant/weapp/calendar/index", + "van-dialog": "@vant/weapp/dialog/index" } } \ No newline at end of file diff --git a/pages/apply/paymentTemplate/add/add.wxml b/pages/apply/paymentTemplate/add/add.wxml index 71f2c13..9967556 100644 --- a/pages/apply/paymentTemplate/add/add.wxml +++ b/pages/apply/paymentTemplate/add/add.wxml @@ -6,159 +6,318 @@ 审批事项 - - 提交单位:龙华村联合社 - 提交日期:2022年1月18日 - 提 交 人:报账员 - 联系电话:13906311234 + + 提交单位:{{form.approvalItemTemplate.submitCompany}} + 提交日期:{{form.approvalItemTemplate.submitDate}} + 提 交 人:{{form.approvalItemTemplate.submitter}} + 联系电话:{{form.approvalItemTemplate.telephone}} -事项一 - - 基础信息 - - - - - - - - 关联项目 - - - - 付款方信息 - - - - - - 付款方名称必填 - - - - - - - 收款方信息 - + + 事项{{form.transfers[index].num}} + + 基础信息 - - - - 公户 - 私户 - - - + + + + + + + + + + + + 关联项目 + + + + + + + + + + + + + + + + + + + 关联合同 + + + + + + + + + + + + + 付款方信息 - + + + + + + + + + - 姓名收款方 + 付款方必填 - - - - - - - - - - - 附件可拍照 - - - 总数 0张 - - - - - -收 -据 - - + + + + + + + + + + + + + + + + + + + + 收款方信息 + + + + + + 公户 + 私户 + + + - - -发 -票 - - + + + + + + + + + - - -其 -他 - - + + + + + 姓名收款方 + + + + + + + - - + + 附件可拍照 + + + 总数 {{form.transfers[index].imgcount}}张 + + + + + + 收\n据 - - - - - - + + + - - - - - {{ item.assigneeName }} - {{ item.assigneeName }} - {{ item.assigneeName }} - - - - - {{ item.durationInMillis }} + + + + 发\n票 - {{ item.endTime }} - - - - --> + + + + + + + + 其\n他 + + + + + + + + + + + + + + + - + 保存模板 - + 新增事项 - 保存 - 下一步 + 提交复核 + 下一步 - - + + + + 保存 + + + + + \ No newline at end of file diff --git a/pages/apply/paymentTemplate/add/add.wxss b/pages/apply/paymentTemplate/add/add.wxss index 2e14633..35d03a4 100644 --- a/pages/apply/paymentTemplate/add/add.wxss +++ b/pages/apply/paymentTemplate/add/add.wxss @@ -33,7 +33,7 @@ text{display: block;} z-index: -1; } .center{ - padding-bottom: 50px; + padding-bottom: 28px; } .main-title{ background-image: linear-gradient(to right, #2C8E68 , #B3DB62); @@ -109,23 +109,21 @@ text{display: block;} .fj-box text{ background-color: #5CAE77; color: #ffffff; - display: inline-block; text-align: center; border-radius: 5px; - white-space:pre-wrap + white-space:pre-wrap; + padding: 22px 15px; } .fj-li{ margin-top: 20px; display: flex; - flex-wrap: wrap; + /* flex-wrap: wrap; */ } .fj-li image{ - width: 22%; + width: 25%; + height: 18.5vw; margin-left: 5%; } -.fj-li image:nth-child(4n+1){ - margin-left: 0; -} .fj-li image:nth-child(n+5){ margin-top: 15px; } @@ -133,7 +131,6 @@ text{display: block;} display: flex; width: 94%; margin: 0 auto; - margin-top: 25px; justify-content:space-between; } .bottomBtn view{ @@ -185,6 +182,13 @@ text{display: block;} margin-left: 6%; color: #fff; } +.bottom .btn3{ + border: 1px solid transparent; + padding: 8px 0px; + background-image: linear-gradient(to right, #2C8E68, #5CAE77); + color: #fff; + width: 100%; +} .steps-box{ padding: 0; margin-top: 15px; @@ -306,7 +310,7 @@ text{display: block;} margin: 0 auto; text-align: center; margin-top: 30px; - margin-bottom: 30px; + margin-bottom: 80px; } .bottom button { @@ -320,4 +324,17 @@ text{display: block;} border: 1px solid transparent; background-image: linear-gradient(to right, #2C8E68, #5CAE77); margin-left: 6%; + } + + .input_tit{ + border: 1px solid #DCDCDC; + padding: 0px 10px; + height: 32px; + line-height: 32px; + border-radius: 5px; + margin-bottom: 15px; + } + .img_box{ + position: relative; + width: 100%; } \ No newline at end of file diff --git a/pages/apply/paymentTemplate/paymentTemplate.js b/pages/apply/paymentTemplate/paymentTemplate.js index 7273b79..3a48698 100644 --- a/pages/apply/paymentTemplate/paymentTemplate.js +++ b/pages/apply/paymentTemplate/paymentTemplate.js @@ -1,4 +1,6 @@ // pages/apply/paymentTemplate/paymentTemplate.js +import * as UTIL from '../../../utils/util.js'; +import * as API from '../../../utils/API.js'; const app = getApp(); Page({ @@ -7,12 +9,83 @@ Page({ */ data: { isIPX: app.globalData.isIPX, - show: false + show: false, + countMoney:0, + form:{}, + SJimage: [], + FPimage: [], + QTimage: [], + fileForm:[], }, showPopup() { this.setData({ show: true }); }, - + bindNameInput(even){ + this.setData({ + ["form.approvalItemTemplate.templateName"]:even.detail.value + }) + }, + goSubmit(e){ + var that = this; + if(e.currentTarget.dataset.type == 1){ + if(that.data.form.approvalItemTemplate.templateName == ''){ + UTIL.showToastNoneIcon('请输入模板名称!'); + return; + } + } + if(e.currentTarget.dataset.type == 3){ + for (let i = 0; i < that.data.form.transfers.length; i++) { + that.data.form.transfers[i].approvalMode = '2'; + } + that.data.form.approvalItemTemplate.dataType = e.currentTarget.dataset.type + } + that.data.form.method = 'POST'; + that.data.form.approvalItemTemplate.dataType = e.currentTarget.dataset.type; + that.data.form.approvalItemTemplate.id = null; + for (let i = 0; i < that.data.form.transfers.length; i++) { + that.data.form.transfers[i].id = null; + } + console.log(that.data.form); + UTIL.httpRequest(API.URL_GET_SAVE, that.data.form, { + success: (res) => { + if (res.code == API.SUCCESS_CODE) { + for (let j = 0; j < res.data.transfers.length; j++) { + for (let i = 0; i < that.data.form.transfers[j].fileForm.length; i++) { + that.data.form.transfers[j].fileForm[i].tableId = res.data.transfers[j].id + const element = that.data.form.transfers[j].fileForm[i]; + wx.uploadFile({ + url: API.URL_GET_UPLOAD, + filePath: element.file, + name: 'file', + header: { + "Content-Type": "multipart/form-data",//记得设置 + "chartset":"utf-8", + 'Authorization':'Bearer '+getApp().globalData.userInfo.token + }, + formData:element, + success (response){ + console.log(res); + if((j+1) == that.data.form.transfers.length && (i+1) == that.data.form.transfers[j].fileForm.length && e.currentTarget.dataset.type == 0){ + wx.navigateTo({ + url: '/pages/apply/approval/approval?id='+res.data.id, + }) + } + if((j+1) == that.data.form.transfers.length && (i+1) == that.data.form.transfers[j].fileForm.length && e.currentTarget.dataset.type != 0){ + UTIL.showToastNoneIcon('操作成功!'); + that.back(); + } + }, + fail(res){ + console.log(res) + } + }) + } + } + + } + } + }) + }, onClose() { this.setData({ show: false }); }, @@ -27,11 +100,33 @@ Page({ url: 'see/see', }) }, + goUpdate(){ + let array = JSON.stringify(this.data.form) + wx.navigateTo({ + url: 'add/add?type=update&array='+array, + }) + }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { - + var that = this ; + UTIL.httpRequest(API.URL_GET_APPROVALITEMS + options.id, {method:'GET'}, { + success: (res) => { + let transList = res.data.transfers; + let countMoney = that.data.countMoney + transList.forEach((item,index) => { + item.num = UTIL.convertToChinaNum(index+1) + countMoney += parseInt(item.expenditureAmount); + }); + res.data.transfers = transList + + that.setData({ + form:res.data, + countMoney:countMoney + }); + } + }) }, /** diff --git a/pages/apply/paymentTemplate/paymentTemplate.wxml b/pages/apply/paymentTemplate/paymentTemplate.wxml index 3fb239c..328dba4 100644 --- a/pages/apply/paymentTemplate/paymentTemplate.wxml +++ b/pages/apply/paymentTemplate/paymentTemplate.wxml @@ -6,53 +6,55 @@ 审批事项 - + 支出总金额 - - 提交单位:龙华村联合社 - 提交日期:2022年1月18日 - 提 交 人:报账员 - 联系电话:13906311234 + + 提交单位:{{form.approvalItemTemplate.submitCompany}} + 提交日期:{{form.approvalItemTemplate.submitDate}} + 提 交 人:{{form.approvalItemTemplate.submitter}} + 联系电话:{{form.approvalItemTemplate.telephone}} - -事项一 + +事项{{item.num}} 支出金额 - + - + 事由: - + - + - - + + + + 保存模板 - + 新增事项 - 提交复核 - 下一步 + 提交复核 + 下一步 - + \ No newline at end of file diff --git a/pages/apply/paymentTemplate/paymentTemplate.wxss b/pages/apply/paymentTemplate/paymentTemplate.wxss index 56ed9bb..edd2ef2 100644 --- a/pages/apply/paymentTemplate/paymentTemplate.wxss +++ b/pages/apply/paymentTemplate/paymentTemplate.wxss @@ -90,6 +90,7 @@ text{display: block;} font-size: 26px; display: inline-block; width: 50%; + text-align: center; } .money_box{ diff --git a/pages/payee/add/add.js b/pages/payee/add/add.js index ccd11df..5596101 100644 --- a/pages/payee/add/add.js +++ b/pages/payee/add/add.js @@ -1,4 +1,6 @@ // pages/payee/add/add.js +import * as UTIL from '../../../utils/util.js'; +import * as API from '../../../utils/API.js'; const app = getApp(); Page({ @@ -7,6 +9,23 @@ Page({ */ data: { isIPX: app.globalData.isIPX, + form:{ + payee:'', + payeeAccount:'', + bankType:'', + bankDeposit:'', + accountType:'', + payeeType:'', + payeePaymentLines:'', + status:'0', + }, + showBankType:false, + showAccountType:false, + bankTypeOptions:[], + bankTypeText:'', + accountTypeOptions:[], + payeeTypeOptions:[], + accountTypeText:'', }, /** @@ -27,9 +46,109 @@ Page({ * 生命周期函数--监听页面显示 */ onShow() { - + var that = this; + // 所属银行字典查询 + UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, { + success: (res) => { + // let array = res.data.filter(function (e) { return e.dictValue == event.detail.value.bankType; }); + this.setData({ + bankTypeOptions:res.data + }); + } + }) + // 付款方式类型字典查询 + UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'account_type', {method:'GET'}, { + success: (res) => { + that.setData({ + accountTypeOptions:res.data, + }) + } + }) + // 付款方式类型字典查询 + UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'payee_type', {method:'GET'}, { + success: (res) => { + that.setData({ + payeeTypeOptions:res.data, + }) + } + }) + + }, + back:function(){ + wx.navigateBack({ + delta: 1 + }) + }, + openBox(even){ + console.log(even); + var that = this ; + if(even.currentTarget.dataset.name == "showDeposit"){ + if(that.data.form.bankType == ''){ + UTIL.showToastNoneIcon('请先选择所属银行!'); + that.setData({ + [even.currentTarget.dataset.name]:false, + }) + return; + } + } + this.setData({ + [even.currentTarget.dataset.name]:true + }) + }, + onConfirm(even){ + console.log(even); + var that = this ; + if(even.currentTarget.dataset.name == "showBankType"){ + // 付款方式类型字典查询 + UTIL.httpRequest(API.URL_GET_DEPOSITLIST, {method:'GET',bankType:even.detail.value.dictValue,status:'0'}, { + success: (res) => { + that.setData({ + depositOptions:res.rows, + }) + } + }) + } + this.setData({ + [even.currentTarget.dataset.value]:even.detail.value.dictValue, + [even.currentTarget.dataset.value+"Text"]:even.detail.value.dictLabel, + [even.currentTarget.dataset.name]:false, + }) + }, + onConfirmDeposit(even){ + this.setData({ + [even.currentTarget.dataset.value]:even.detail.value.id, + [even.currentTarget.dataset.value+"Text"]:even.detail.value.bankDeposit, + [even.currentTarget.dataset.name]:false, + }) + }, + closeBox(even){ + console.log(even.currentTarget.dataset.name); + this.setData({ + [even.currentTarget.dataset.name]:false + }) + }, + goSubmit(){ + console.log(this.data.form); + var that = this; + that.setData({ + ['form.method']:'POST' + }) + UTIL.httpRequest(API.URL_GET_PAYEEADD, that.data.form, { + success: (res) => { + if (res.code == API.SUCCESS_CODE) { + wx.navigateBack({ + delta:1 + }) + } + } + }) + }, + onChange(even){ + console.log(even); + this.setData({ + [even.currentTarget.dataset.formname]:even.detail + }) }, - /** * 生命周期函数--监听页面隐藏 */ diff --git a/pages/payee/add/add.json b/pages/payee/add/add.json index c1b784d..88dadef 100644 --- a/pages/payee/add/add.json +++ b/pages/payee/add/add.json @@ -1,6 +1,19 @@ { "navigationStyle": "custom", "usingComponents": { - "van-field": "@vant/weapp/field/index" + "van-row": "@vant/weapp/row/index", + "van-col": "@vant/weapp/col/index", + "van-cell": "@vant/weapp/cell/index", + "van-cell-group": "@vant/weapp/cell-group/index", + "van-tag": "@vant/weapp/tag/index", + "van-icon": "@vant/weapp/icon/index", + "van-steps": "@vant/weapp/steps/index", + "van-button": "@vant/weapp/button/index", + "van-radio": "@vant/weapp/radio/index", + "van-radio-group": "@vant/weapp/radio-group/index", + "van-field": "@vant/weapp/field/index", + "van-popup": "@vant/weapp/popup/index", + "van-picker": "@vant/weapp/picker/index", + "van-calendar": "@vant/weapp/calendar/index" } } \ No newline at end of file diff --git a/pages/payee/add/add.wxml b/pages/payee/add/add.wxml index 5c5e0aa..3b0dc95 100644 --- a/pages/payee/add/add.wxml +++ b/pages/payee/add/add.wxml @@ -1,16 +1,64 @@ - - 支出申请 + + 新增收款人 - - - - - - + + + + + + + + + + + + + + + + + + + + + + - 确认 + 确认 \ No newline at end of file diff --git a/pages/payee/index.js b/pages/payee/index.js index d56a790..d4d6fb6 100644 --- a/pages/payee/index.js +++ b/pages/payee/index.js @@ -1,4 +1,6 @@ // pages/payee/index.js +import * as UTIL from '../../utils/util.js'; +import * as API from '../../utils/API.js'; const app = getApp(); Page({ @@ -7,17 +9,101 @@ Page({ */ data: { isIPX: app.globalData.isIPX, - list: ['a', 'b', 'c'], - result: ['a', 'b'], + list: {}, + result: "", + bankTypeOptions:[] }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { - + console.log(options) + var that = this; + that.setData({ + isPeers:options.isPeers,//是否同行 + bankType:options.bankType,//所属银行 + accountType:options.accountType,//账户类型 + payeeType:options.transferType,//申请转帐类型 + index:options.index + }) + + // 获取收款账号列表 + let prames = { + pageNum:1, + pageSize:999, + orderByColumn:'id', + isAsc:'asc', + isPeers:options.isPeers,//是否同行 + bankType:options.bankType,//所属银行 + accountType:options.accountType,//账户类型 + payeeType:options.transferType,//申请转帐类型 + status:'0', + method:'GET' + } + console.log(prames); + UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, { + success: (res) => { + that.setData({ + bankTypeOptions:res.data, + }) + } + }) + UTIL.httpRequest(API.URL_GET_SELECTLIST , prames, { + success: (res) => { + let array = res.rows ; + for (let i = 0; i < array.length; i++) { + array[i].payeeAccountText = array[i].payeeAccount.replace(/^(.{6})(?:\d+)(.{4})$/,"\$1****\$2"); + array[i].bankTypeText = (that.data.bankTypeOptions.filter(function (e) { return e.dictValue == array[i].bankType; }))[0].dictLabel; + } + that.setData({ + list:array, + }) + } + }) + }, + goAdd(){ + wx.navigateTo({ + url: 'add/add', + }) + }, + goSearch(e){ + var that = this; + // 获取收款账号列表 + let prames = { + pageNum:1, + pageSize:999, + orderByColumn:'id', + isAsc:'asc', + isPeers:that.data.isPeers,//是否同行 + bankType:that.data.bankType,//所属银行 + accountType:that.data.accountType,//账户类型 + payeeType:that.data.payeeType,//申请转帐类型 + status:'0', + name:e.detail, + method:'GET' + } + console.log(prames); + UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, { + success: (res) => { + that.setData({ + bankTypeOptions:res.data, + }) + } + }) + UTIL.httpRequest(API.URL_GET_PAYEESELECTLIST , prames, { + success: (res) => { + let array = res.rows ; + for (let i = 0; i < array.length; i++) { + array[i].payeeAccountText = array[i].payeeAccount.replace(/^(.{6})(?:\d+)(.{4})$/,"\$1****\$2"); + array[i].bankTypeText = (that.data.bankTypeOptions.filter(function (e) { return e.dictValue == array[i].bankType; }))[0].dictLabel; + } + that.setData({ + list:array, + }) + } + }) }, - /** * 生命周期函数--监听页面初次渲染完成 */ @@ -32,6 +118,7 @@ Page({ }, onChange(event) { + console.log(event); this.setData({ result: event.detail, }); @@ -42,7 +129,32 @@ Page({ const checkbox = this.selectComponent(`.checkboxes-${index}`); checkbox.toggle(); }, + back:function(){ + wx.navigateBack({ + delta: 1 + }) + }, noop() {}, + goSubmit(){ + var that = this; + if(that.data.result == ''){ + UTIL.showToastNoneIcon('请选择一个收款人!'); + return; + } + let array = that.data.list.filter(function (e) { return e.id == that.data.result; }); + console.log(array); + let pages = getCurrentPages(); + let currentPage = null; //当前页面 + let prevPage = null; //上一个页面 + currentPage = pages[pages.length - 1]; //获取当前页面,将其赋值 + prevPage = pages[pages.length - 2]; //获取上一个页面,将其赋值 + if (prevPage) { + prevPage.setData({ + ["form.transfers["+that.data.index+"].payeeList[0]"]: array[0]//将想要传的信息赋值给上一个页面data中的值 + }) + that.back() + } + }, /** * 生命周期函数--监听页面隐藏 */ diff --git a/pages/payee/index.json b/pages/payee/index.json index 15b1747..fc8dd62 100644 --- a/pages/payee/index.json +++ b/pages/payee/index.json @@ -4,6 +4,8 @@ "van-checkbox-group": "@vant/weapp/checkbox-group/index", "van-cell": "@vant/weapp/cell/index", "van-cell-group": "@vant/weapp/cell-group/index", - "van-search": "@vant/weapp/search/index" + "van-search": "@vant/weapp/search/index", + "van-radio": "@vant/weapp/radio/index", + "van-radio-group": "@vant/weapp/radio-group/index" } } \ No newline at end of file diff --git a/pages/payee/index.wxml b/pages/payee/index.wxml index fa7fc04..0d78ceb 100644 --- a/pages/payee/index.wxml +++ b/pages/payee/index.wxml @@ -9,11 +9,13 @@ shape="round" background="transparent" placeholder="请输入搜索关键词" + clearable + bind:change="goSearch" /> - 新增 + 新增 - + - + + + + + - 张亮亮 + {{item.payee}} - 6217****2186 中国银行 + {{item.payeeAccountText}}    {{item.bankTypeText}} - - + - 确认 + 确认 \ No newline at end of file diff --git a/pages/payee/index.wxss b/pages/payee/index.wxss index 587c3a1..44eba18 100644 --- a/pages/payee/index.wxss +++ b/pages/payee/index.wxss @@ -31,12 +31,16 @@ van-search { box-shadow: 0px 5px 5px #ddd; } .bottom{ - width: 84%; + width: 100%; margin: 0 auto; text-align: center; - margin-top: 30px; - margin-bottom: 30px; + padding-top: 30px; + padding-bottom: 30px; display: flex; + position: fixed; + bottom: 0; + background: #FFF; + box-shadow: 0px -5px 9px #eee; } .bottom view { @@ -51,4 +55,8 @@ van-search { padding: 8px 0px; background-image: linear-gradient(to right, #2C8E68, #5CAE77); color: #fff; +} + +.van-radio-group{ + padding-bottom: 100px; } \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json index 3513a52..c9b84ca 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -35,7 +35,7 @@ { "name": "支出模板查看", "pathName": "pages/apply/paymentTemplate/paymentTemplate", - "query": "", + "query": "id=32", "launchMode": "default", "scene": null }, @@ -59,10 +59,25 @@ "query": "", "launchMode": "default", "scene": null + }, + { + "name": "收款人列表", + "pathName": "pages/payee/index", + "query": "isPeers=N", + "launchMode": "default", + "scene": null + }, + { + "name": "新增收款人", + "pathName": "pages/payee/add/add", + "query": "", + "launchMode": "default", + "scene": null } ] } }, "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", - "projectname": "WXMB" + "projectname": "WXMB", + "libVersion": "2.23.3" } \ No newline at end of file diff --git a/utils/API.js b/utils/API.js index f0657f6..9b10539 100644 --- a/utils/API.js +++ b/utils/API.js @@ -67,9 +67,12 @@ const URL_GET_GETPROJECTLIST = `${URL_PREFIX}/yinnong/project/list`; const URL_GET_CONTRACTIONLIST = `${URL_PREFIX}/contraction/info/list`; //查询收款账号列表 -const URL_GET_SELECTLIST = `${URL_PREFIX}/yinnong/payee/selectList`; +const URL_GET_SELECTLIST = `${URL_PREFIX}/yinnong/payee/selectlist`; -//查询收款账号列表 +//查询收款账号列表2 +const URL_GET_PAYEESELECTLIST = `${URL_PREFIX}/yinnong/payee/list`; + +//当前账套付款账户列表 const URL_GET_SELECTACCOUNTLIST = `${URL_PREFIX}/cashier/account/accountList`; //查询审批流模板列表 const URL_GET_TEMPLATELIST = `${URL_PREFIX}/service/template/list`; @@ -94,6 +97,34 @@ const URL_POST_TEMPLATEEDIT = `${URL_PREFIX}/service/templateDetail/editBatch`; const URL_POST_APPROVALITEMSSUBMIT = `${URL_PREFIX}/yinnong/approvalItems/approvalItemsSubmit/`; //附件上传配置列表 const URL_GET_SYSCONFIG = `${URL_PREFIX}/system/config/list`; + +//汇票列表 +const URL_GET_MONEYORDERLIST = `${URL_PREFIX}/yinnong/moneyorder/list`; + +//通过所属银行查询开户行信息 +const URL_GET_DEPOSITLIST = `${URL_PREFIX}/yinnong/deposit/list`; + +//新增收款方账户 +const URL_GET_PAYEEADD = `${URL_PREFIX}/yinnong/payee/add`; + +//增加支出申请/模板 +const URL_GET_SAVE = `${URL_PREFIX}/yinnong/approvalItems/save`; + +//附件上传 +const URL_GET_UPLOAD = `${URL_PREFIX}/common/attach`; + +//获取当前用户的审批事项信息 +const URL_GET_USERAPPRO = `${URL_PREFIX}/yinnong/approvalItems/getUserApprovalItems`; + +//查看附件列表 +const URL_GET_FINDLIST = `${URL_PREFIX}/system/attachment/find`; + +//查看附件列表 +const URL_GET_APPROVALITEMS = `${URL_PREFIX}/yinnong/approvalItems/getApprovalItem/`; + +//通过审批事项id删除审批模板 +const URL_GET_REMOVEAPPROVAL = `${URL_PREFIX}/yinnong/approvalItems/remove/`; + /****************接口地址end****************/ export { @@ -138,5 +169,15 @@ export { URL_POST_APPROVALITEMSEDIT, URL_POST_TEMPLATEEDIT, URL_POST_APPROVALITEMSSUBMIT, - URL_GET_SYSCONFIG + URL_GET_SYSCONFIG, + URL_GET_MONEYORDERLIST, + URL_GET_PAYEESELECTLIST, + URL_GET_DEPOSITLIST, + URL_GET_PAYEEADD, + URL_GET_SAVE, + URL_GET_UPLOAD, + URL_GET_USERAPPRO, + URL_GET_FINDLIST, + URL_GET_APPROVALITEMS, + URL_GET_REMOVEAPPROVAL } \ No newline at end of file diff --git a/utils/util.js b/utils/util.js index 99d2da3..138e9f6 100644 --- a/utils/util.js +++ b/utils/util.js @@ -383,6 +383,47 @@ function formatDate(unixtime) { // return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;//年月日时分秒 return y + '-' + m + '-' + d; } +/** + * 将数字(整数)转为汉字 + * @param num + * @description 从零到一亿亿,需要小数的可自行截取小数点后面的数字直接替换对应arr1的读法就行了 + */ +function convertToChinaNum (num) { + var arr1 = new Array('零', '一', '二', '三', '四', '五', '六', '七', '八', '九'); + var arr2 = new Array('', '十', '百', '千', '万', '十', '百', '千', '亿', '十', '百', '千','万', '十', '百', '千','亿');//可继续追加更高位转换值 + if(!num || isNaN(num)){ + return "零"; + } + var english = num.toString().split("") + var result = ""; + for (var i = 0; i < english.length; i++) { + var des_i = english.length - 1 - i;//倒序排列设值 + result = arr2[i] + result; + var arr1_index = english[des_i]; + result = arr1[arr1_index] + result; + } + //将【零千、零百】换成【零】 【十零】换成【十】 + result = result.replace(/零(千|百|十)/g, '零').replace(/十零/g, '十'); + //合并中间多个零为一个零 + result = result.replace(/零+/g, '零'); + //将【零亿】换成【亿】【零万】换成【万】 + result = result.replace(/零亿/g, '亿').replace(/零万/g, '万'); + //将【亿万】换成【亿】 + result = result.replace(/亿万/g, '亿'); + //移除末尾的零 + result = result.replace(/零+$/, '') + //将【零一十】换成【零十】 + //result = result.replace(/零一十/g, '零十');//貌似正规读法是零一十 + //将【一十】换成【十】 + result = result.replace(/^一十/g, '十'); + return result; +} +function getTransform(dictValue,options){ + var dictLabel = ""; + console.log(options); + dictLabel = (options.filter(function (e) { return e.dictValue == dictValue; }))[0].dictLabel; + return dictLabel; +} export { getCurrentPageUrl, getCurrentPageUrlWithArgs, @@ -399,5 +440,7 @@ export { convert_length, isIPhoneX, js_date_time, - formatDate + formatDate, + convertToChinaNum, + getTransform }