diff --git a/env/env.js b/env/env.js index bf32610..d406330 100644 --- a/env/env.js +++ b/env/env.js @@ -7,5 +7,8 @@ module.exports = { }, PROD: { 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/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 8a3627a..b60b18a 100644 --- a/pages/apply/index.js +++ b/pages/apply/index.js @@ -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) diff --git a/pages/apply/index.wxml b/pages/apply/index.wxml index 3e7ea39..462759e 100644 --- a/pages/apply/index.wxml +++ b/pages/apply/index.wxml @@ -49,47 +49,19 @@ - + - + - 日常支付水电模板默认 + {{item.templateName}}默认 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + \ No newline at end of file diff --git a/pages/apply/paymentTemplate/add/add.js b/pages/apply/paymentTemplate/add/add.js index 12336d4..89272e3 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({ @@ -19,12 +24,14 @@ Page({ showProject:false, showProjectFundType:false, showAccount:false, + showDialog:false, capitalExpenditureTypeOptions:[], transferTypeOptions:[], projectOptions:[], projectFundTypeOptions:[], contractionOptions:[], accountOptions:[], + moneyorderOptions:[], form:{ approvalItemTemplate:{ approvalItems:'',//审批事项 @@ -35,47 +42,46 @@ Page({ totalAmount:'',//合计金额 templateName:'',//模板名称 选择保存模板的时候添加 dataType:'',//数据类型 - transfers:[{//事项信息集合以下是List对象信息 - capitalExpenditureType:'',//资金支出类别 - capitalExpenditureTypeText:'',//资金支出类别(展示用) - succeedAmount:'',//成功支付金额 - payer:'',//付款方 - payerAccount:'',//付款方账户 - bankType:'',//所属银行 - bankTypeText:'',//所属银行(展示用) - isPeers:'',//是否同行 - operatorCode:'',//操作员代码 - enterpriseCode:'',//企业编码 - expenditureAmount:'',//支出总金额 - applyDate:'',//申请时间 - transferStatus:'',//转账状态 - auditStatus:'',//审批状态 - paymentState:'',//支付状态 - approvalMode:'',//审批模式 - paymentTime:'',//支付时间 - bankPriority:'',//银行处理优先级 - clientPriority:'',//客户处理优先级 - transferType:'',//付款方式 - transferTypeText:'',//付款方式(展示用) - requiredTransferTime:'',//要求转账时间 - remark:'',//付款事由 - startTime:'',//开票日期 - endTime:'',//到期日期 - orderType:'',//汇票类型 - bankAccountType:'',//账户类别 - villageAccountType:'',//账户分类 - }], - bankAccountType:'1',//账户类别1 公户2私户 + }, + transfers:[{//事项信息集合以下是List对象信息 + num:"一", + capitalExpenditureType:'',//资金支出类别 + capitalExpenditureTypeText:'',//资金支出类别(展示用) + succeedAmount:'',//成功支付金额 + payer:'',//付款方 + payerAccount:'',//付款方账户 + bankType:'',//所属银行 + bankTypeText:'',//所属银行(展示用) + isPeers:'',//是否同行 + operatorCode:'',//操作员代码 + enterpriseCode:'',//企业编码 + expenditureAmount:'',//支出总金额 + applyDate:'',//申请时间 + transferStatus:'',//转账状态 + auditStatus:'',//审批状态 + paymentState:'',//支付状态 + approvalMode:'',//审批模式 + paymentTime:'',//支付时间 + bankPriority:'',//银行处理优先级 + clientPriority:'',//客户处理优先级 + transferType:'',//付款方式 + transferTypeText:'',//付款方式(展示用) + requiredTransferTime:'',//要求转账时间 + remark:'',//付款事由 + startTime:'',//开票日期 + endTime:'',//到期日期 + orderType:'',//汇票类型 + bankAccountType:'',//账户类别1 公户2私户 + villageAccountType:'',//账户分类 payeeList:[{//收款方账户集合 - payeeId:'',//收款方id + payeeId:'0',//收款方id payee:'',//收款方 bankDeposit:'',//开户行 incomeAmount:'',//收入金额 bankType:'',//所属银行0其他银行1中国银行2农商行(山东省)3农业银行4建设银行5工商银行 payeeAccount:'',//收款账户 }], - - } + }], }, projectForm:{ projectId:'', @@ -93,14 +99,105 @@ Page({ code:'', totalAmount:'', }, - accountForm:{} + accountForm:{}, + fileForm:[] }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { + var that = this; + setTimeout(function(){ + UTIL.httpRequest(API.URL_GET_USERAPPRO, {method:'GET'}, { + success: (res) => { + if (res.code == API.SUCCESS_CODE) { + console.log(that.data.capitalExpenditureTypeOptions); + 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_approval_item_template', + 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_approval_item_template', + 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_approval_item_template', + 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) + }, /** @@ -115,6 +212,7 @@ Page({ */ onShow() { var that = this; + UTIL.httpRequest(API.URL_GET_GETINFO, {method:'GET'}, { success: (res) => { if (res.code == API.SUCCESS_CODE) { @@ -128,6 +226,14 @@ Page({ } } }) + //所属银行 + 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) => { @@ -168,22 +274,7 @@ Page({ }) } }) - // 获取合同信息列表 - let prames = { - pageNum:1, - pageSize:999, - isPeers:'', - orderByColumn:'id', - isAsc:'asc', - status:'0' - } - UTIL.httpRequest(API.URL_GET_SELECTLIST , {method:'GET'}, { - success: (res) => { - that.setData({ - contractionOptions:res.rows, - }) - } - }) + }, openBox(even){ this.setData({ @@ -220,6 +311,7 @@ Page({ 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, @@ -237,6 +329,8 @@ Page({ [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){//村账户查询参数 @@ -308,6 +402,20 @@ Page({ } }) } + 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, @@ -334,6 +442,202 @@ Page({ ['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, + }) + }, + onChange(event){ + console.log(event); + this.setData({ + [event.currentTarget.dataset.value]: event.detail, + }) + }, + onChangeMoney(event){ + console.log(event); + this.setData({ + [event.currentTarget.dataset.value]: event.detail, + ["form.approvalItemTemplate.totalAmount"]:event.detail, + ["form.transfers[0].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; + } + } + that.setData({ + ['form.method']:'POST', + ["form.approvalItemTemplate.dataType"]:e.currentTarget.dataset.type + }) + UTIL.httpRequest(API.URL_GET_SAVE, that.data.form, { + success: (res) => { + if (res.code == API.SUCCESS_CODE) { + for (let i = 0; i < that.data.fileForm.length; i++) { + that.data.fileForm[i].tableId = res.data.id + const element = that.data.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 (res){ + console.log(res); + }, + fail(res){ + console.log(res) + } + }) + } + } + } + }) + }, + bindKeyInput(even){ + this.setData({ + ["form.approvalItemTemplate.approvalItems"]: even.detail.value, + }) + }, + SJtakephoto(){ + var that = this; + let fileForm = that.data.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_approval_item_template', + tableId:'' + }) + }) + that.setData({ + SJimage:res.tempFiles, + fileForm:fileForm + }) + } + }) + }, + FPtakephoto(){ + var that = this; + let fileForm = that.data.fileForm; + wx.chooseMedia({ + count: 9, + mediaType: ['image','video'], + sourceType: ['album', 'camera'], + maxDuration: 30, + camera: 'back', + success(res) { + res.tempFiles.forEach(item => { + fileForm.push({ + file: item.tempFilePath, + fileType:'2', + bizPath:'transfer', + tableName:'t_yinnong_approval_item_template', + tableId:'' + }) + }) + that.setData({ + FPimage:res.tempFiles, + fileForm:fileForm + }) + } + }) + }, + QTtakephoto(){ + var that = this; + let fileForm = that.data.fileForm; + wx.chooseMedia({ + count: 9, + mediaType: ['image','video'], + sourceType: ['album', 'camera'], + maxDuration: 30, + camera: 'back', + success(res) { + res.tempFiles.forEach(item => { + fileForm.push({ + file: item.tempFilePath, + fileType:'3', + bizPath:'transfer', + tableName:'t_yinnong_approval_item_template', + tableId:'' + }) + }) + that.setData({ + QTimage:res.tempFiles, + fileForm:fileForm + }) + } + }) + }, + addList(){ + let transList = this.data.form.transfers; + transList.push({ + num:UTIL.convertToChinaNum(transList.length+1) + }); + 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] + }) + }, /** * 生命周期函数--监听页面隐藏 */ diff --git a/pages/apply/paymentTemplate/add/add.json b/pages/apply/paymentTemplate/add/add.json index 88dadef..c230a0f 100644 --- a/pages/apply/paymentTemplate/add/add.json +++ b/pages/apply/paymentTemplate/add/add.json @@ -14,6 +14,7 @@ "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-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 5599e89..93e0db4 100644 --- a/pages/apply/paymentTemplate/add/add.wxml +++ b/pages/apply/paymentTemplate/add/add.wxml @@ -12,17 +12,17 @@ 提 交 人:{{form.approvalItemTemplate.submitter}} 联系电话:{{form.approvalItemTemplate.telephone}} - - 事项一 + + 事项{{form.transfers[index].num}} 基础信息 - - + + - - + + - + - + 关联项目 @@ -71,7 +71,7 @@ - + 关联合同 @@ -103,10 +103,10 @@ bind:cancel="closeBox" bind:confirm="onConfirmaTransfer" data-name="showTransferType" - data-value="form.approvalItemTemplate.transfers[{{index}}]" + data-value="form.transfers[{{index}}]" /> - + - + 付款方必填 - + + + + + + + + + + + + + - - + + 收款方信息 - + - + 公户 私户 @@ -148,17 +169,33 @@ - - + + + + + + + + + + + + + 姓名收款方 - - - + + + - + @@ -180,21 +217,24 @@ 收 据 - + + 发 票 - + + 其 他 - + + @@ -235,24 +275,38 @@ --> - - - - 保存模板 - - - - 新增事项 - - - - - 保存 - 下一步 - + + + + + 保存模板 + + + + 新增事项 + + + + + 保存 + 下一步 + + + + \ No newline at end of file diff --git a/pages/apply/paymentTemplate/add/add.wxss b/pages/apply/paymentTemplate/add/add.wxss index 2e14633..046760d 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); @@ -121,6 +121,7 @@ text{display: block;} } .fj-li image{ width: 22%; + height: 18.5vw; margin-left: 5%; } .fj-li image:nth-child(4n+1){ @@ -133,7 +134,6 @@ text{display: block;} display: flex; width: 94%; margin: 0 auto; - margin-top: 25px; justify-content:space-between; } .bottomBtn view{ @@ -306,7 +306,7 @@ text{display: block;} margin: 0 auto; text-align: center; margin-top: 30px; - margin-bottom: 30px; + margin-bottom: 80px; } .bottom button { @@ -320,4 +320,13 @@ 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; } \ No newline at end of file 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..dec919d 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,100 @@ 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,//申请转帐类型 + }) + + // 获取收款账号列表 + 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 +117,7 @@ Page({ }, onChange(event) { + console.log(event); this.setData({ result: event.detail, }); @@ -42,7 +128,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[0].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..7fb9557 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -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 b846b70..9802900 100644 --- a/utils/API.js +++ b/utils/API.js @@ -60,11 +60,35 @@ 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_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`; + /****************接口地址end****************/ @@ -95,5 +119,13 @@ export { URL_GET_GETPROJECTLIST, URL_GET_CONTRACTIONLIST, URL_GET_SELECTLIST, - URL_GET_SELECTACCOUNTLIST + URL_GET_SELECTACCOUNTLIST, + URL_GET_MONEYORDERLIST, + URL_GET_PAYEESELECTLIST, + URL_GET_DEPOSITLIST, + URL_GET_PAYEEADD, + URL_GET_SAVE, + URL_GET_UPLOAD, + URL_GET_USERAPPRO, + URL_GET_FINDLIST } \ No newline at end of file diff --git a/utils/util.js b/utils/util.js index 26a1cd7..5ba79c0 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 }