diff --git a/env/env.js b/env/env.js index c87839d..bf32610 100644 --- a/env/env.js +++ b/env/env.js @@ -1,11 +1,11 @@ module.exports = { DEV: { - URL_PREFIX: 'http://192.168.31.228/api', + URL_PREFIX: 'http://192.168.31.178/api', }, PRE: { - URL_PREFIX: 'http://192.168.31.228:8080/api', + URL_PREFIX: 'http://192.168.31.178:8080/api', }, PROD: { - URL_PREFIX: 'http://192.168.31.228:8080/api', + URL_PREFIX: 'http://192.168.31.178:8080/api', } } \ No newline at end of file diff --git a/pages/apply/index.wxml b/pages/apply/index.wxml index 92b74b8..3e7ea39 100644 --- a/pages/apply/index.wxml +++ b/pages/apply/index.wxml @@ -5,7 +5,7 @@ - + 付款单位 {{bookName}} diff --git a/pages/apply/index.wxss b/pages/apply/index.wxss index a0d02b2..f5b54f7 100644 --- a/pages/apply/index.wxss +++ b/pages/apply/index.wxss @@ -7,6 +7,7 @@ border-radius: 10px; margin-top: 3vw; overflow: hidden; + position: relative; } .top view{ padding: 18px 15px; @@ -16,7 +17,8 @@ } .top image{ position: absolute; - width: 94%; + width: 100%; + height: 100%; } .top-title{ flex: 1; diff --git a/pages/apply/paymentTemplate/add/add.js b/pages/apply/paymentTemplate/add/add.js index 95ee3cd..12336d4 100644 --- a/pages/apply/paymentTemplate/add/add.js +++ b/pages/apply/paymentTemplate/add/add.js @@ -11,7 +11,20 @@ Page({ isIPX: app.globalData.isIPX, radio:'1', active:0, + projectText:'', + balance:0, showCapitalExpenditureType:false, + showApplyDate:false, + showTransferType:false, + showProject:false, + showProjectFundType:false, + showAccount:false, + capitalExpenditureTypeOptions:[], + transferTypeOptions:[], + projectOptions:[], + projectFundTypeOptions:[], + contractionOptions:[], + accountOptions:[], form:{ approvalItemTemplate:{ approvalItems:'',//审批事项 @@ -24,10 +37,12 @@ Page({ dataType:'',//数据类型 transfers:[{//事项信息集合以下是List对象信息 capitalExpenditureType:'',//资金支出类别 + capitalExpenditureTypeText:'',//资金支出类别(展示用) succeedAmount:'',//成功支付金额 payer:'',//付款方 payerAccount:'',//付款方账户 bankType:'',//所属银行 + bankTypeText:'',//所属银行(展示用) isPeers:'',//是否同行 operatorCode:'',//操作员代码 enterpriseCode:'',//企业编码 @@ -40,7 +55,8 @@ Page({ paymentTime:'',//支付时间 bankPriority:'',//银行处理优先级 clientPriority:'',//客户处理优先级 - transferType:'',//申请类型 + transferType:'',//付款方式 + transferTypeText:'',//付款方式(展示用) requiredTransferTime:'',//要求转账时间 remark:'',//付款事由 startTime:'',//开票日期 @@ -60,7 +76,24 @@ Page({ }], } - } + }, + projectForm:{ + projectId:'', + projectName:'', + projectContractor:'', + projectAmount:'', + projectBillNum:'', + projectFundType:'', + outId:'', + ynType:'1', + }, + contractionForm:{ + id:'', + name:'', + code:'', + totalAmount:'', + }, + accountForm:{} }, /** @@ -95,6 +128,62 @@ Page({ } } }) + // 资金支出类别字典查询 + 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, + }) + } + }) + // 获取合同信息列表 + 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({ @@ -102,10 +191,149 @@ Page({ }) }, 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+'.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']: '', + 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, + }) + } + }) + } + 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, + }); + }, /** * 生命周期函数--监听页面隐藏 */ diff --git a/pages/apply/paymentTemplate/add/add.json b/pages/apply/paymentTemplate/add/add.json index 8a34b83..88dadef 100644 --- a/pages/apply/paymentTemplate/add/add.json +++ b/pages/apply/paymentTemplate/add/add.json @@ -13,6 +13,7 @@ "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-picker": "@vant/weapp/picker/index", + "van-calendar": "@vant/weapp/calendar/index" } } \ No newline at end of file diff --git a/pages/apply/paymentTemplate/add/add.wxml b/pages/apply/paymentTemplate/add/add.wxml index 50b873d..5599e89 100644 --- a/pages/apply/paymentTemplate/add/add.wxml +++ b/pages/apply/paymentTemplate/add/add.wxml @@ -18,36 +18,119 @@ 基础信息 - + + + - - - 关联项目 - - + + + 关联项目 + + + + + + + + + + + + + + + + + + + 关联合同 + + + + + + + + + + + + 付款方信息 - - + + + + - + + + + - 付款方名称必填 + 付款方必填 - - - - + + + + + + + 收款方信息 diff --git a/utils/API.js b/utils/API.js index 089872d..b846b70 100644 --- a/utils/API.js +++ b/utils/API.js @@ -50,6 +50,22 @@ const URL_GET_ACCOUNTLIST = `${URL_PREFIX}/cashier/account/list`; //查看事项审批模板列表 const URL_GET_APPROVALITEMSLIST = `${URL_PREFIX}/yinnong/approvalItems/list`; +//字典查询 +const URL_GET_GETDICTTYPE = `${URL_PREFIX}/system/dict/data/type/`; + +//项目工程列表 +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_SELECTACCOUNTLIST = `${URL_PREFIX}/cashier/account/accountList`; + + /****************接口地址end****************/ export { @@ -74,5 +90,10 @@ export { URL_POST_UPLOADFILE, URL_POST_USEREDIT, URL_GET_ACCOUNTLIST, - URL_GET_APPROVALITEMSLIST + URL_GET_APPROVALITEMSLIST, + URL_GET_GETDICTTYPE, + URL_GET_GETPROJECTLIST, + URL_GET_CONTRACTIONLIST, + URL_GET_SELECTLIST, + URL_GET_SELECTACCOUNTLIST } \ No newline at end of file diff --git a/utils/util.js b/utils/util.js index b54975f..26a1cd7 100644 --- a/utils/util.js +++ b/utils/util.js @@ -114,14 +114,14 @@ function httpRequest(url, data, { let finalData = {}; Object.assign(finalData, data); - finalData.token = getApp().globalData.userInfo.token; + finalData.token = getApp().globalData.userInfo.token; wx.request({ url, - data: finalData, + data: finalData, method:data.method, timeout: 60000, header: { - 'Authorization':'Bearer '+getApp().globalData.userInfo.token, + 'Authorization':'Bearer '+getApp().globalData.userInfo.token }, success: function (response) { if (response.data && response.data._code == API.INVALID_USER_TOKEN_CODE) { @@ -363,7 +363,25 @@ function js_date_time(unixtime) { second = second < 10 ? ('0' + second) : second; // return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;//年月日时分秒 return y + '-' + m + '-' + d + ' ' + h + ':' + minute; - +} +/** + * 获取当前年-月-日 + */ +function formatDate(unixtime) { + var date = new Date(unixtime); + var y = date.getFullYear(); + var m = date.getMonth() + 1; + m = m < 10 ? ('0' + m) : m; + var d = date.getDate(); + d = d < 10 ? ('0' + d) : d; + var h = date.getHours(); + h = h < 10 ? ('0' + h) : h; + var minute = date.getMinutes(); + var second = date.getSeconds(); + minute = minute < 10 ? ('0' + minute) : minute; + second = second < 10 ? ('0' + second) : second; + // return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;//年月日时分秒 + return y + '-' + m + '-' + d; } export { getCurrentPageUrl, @@ -380,5 +398,6 @@ export { getUserInfoFomWX, convert_length, isIPhoneX, - js_date_time + js_date_time, + formatDate }