|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371 |
- // pages/apply/paymentTemplate/add/add.js
- import * as UTIL from '../../../../utils/util.js';
- import * as API from '../../../../utils/API.js';
- const app = getApp();
- Page({
-
- /**
- * 页面的初始数据
- */
- data: {
- 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:'',//审批事项
- submitCompany:'',//提交单位
- submitDate:'',//提交日期
- submitter:'',//提交人
- telephone:'',//联系方式
- 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私户
- payeeList:[{//收款方账户集合
- payeeId:'',//收款方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:{}
- },
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
-
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
-
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- 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 + '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({
- [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+'.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,
- });
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
-
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
-
- }
- })
|