@@ -754,13 +754,12 @@ Page({ | |||
// 所属银行字典查询 | |||
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+'.bankTypeText']: UTIL.getTransform(event.detail.value.bankType,that.data.bankTypeOptions), | |||
[event.currentTarget.dataset.value+'.bankType']: event.detail.value.bankType, | |||
[event.currentTarget.dataset.value+'.payerAccount']:event.detail.value.balance, | |||
}); | |||
@@ -33,20 +33,10 @@ Page({ | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad(options) { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady() { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow() { | |||
var that = this ; | |||
that.setData({ | |||
projectId:options.id | |||
}) | |||
var that = this; | |||
// 所属银行字典查询 | |||
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, { | |||
@@ -73,6 +63,44 @@ Page({ | |||
}) | |||
} | |||
}) | |||
if(options.id){ | |||
UTIL.httpRequest(API.URL_GET_PAYEEGET + options.id, {method:'GET'}, { | |||
success: (res) => { | |||
UTIL.httpRequest(API.URL_GET_DEPOSITLIST, {method:'GET',bankType:res.data.bankType,status:'0'}, { | |||
success: (res2) => { | |||
that.setData({ | |||
depositOptions:res2.rows, | |||
}) | |||
console.log(res.data.bankType) | |||
console.log(res2.rows) | |||
if(res.data.bankType!="999"){ | |||
res.data.bankDepositText = res2.rows.filter(function (e) { return e.id == res.data.bankDeposit; })[0].bankDeposit; | |||
} | |||
res.data.payeeTypeText = UTIL.getTransform(res.data.payeeType,that.data.payeeTypeOptions); | |||
res.data.bankTypeText = UTIL.getTransform(res.data.bankType,that.data.bankTypeOptions); | |||
that.setData({ | |||
form:res.data, | |||
}) | |||
} | |||
}) | |||
} | |||
}) | |||
} | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady() { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow() { | |||
}, | |||
back:function(){ | |||
@@ -176,7 +204,17 @@ Page({ | |||
that.setData({ | |||
['form.method']:'POST' | |||
}) | |||
UTIL.httpRequest(API.URL_GET_PAYEEADD, that.data.form, { | |||
let url = ''; | |||
if(this.data.projectId){ | |||
url = API.URL_GET_PAYEEEDIT; | |||
console.log("修改"); | |||
}else{ | |||
url = API.URL_GET_PAYEEADD; | |||
console.log("新增"); | |||
} | |||
UTIL.httpRequest(url, that.data.form, { | |||
success: (res) => { | |||
if (res.code == API.SUCCESS_CODE) { | |||
wx.showToast({ | |||
@@ -40,27 +40,29 @@ Page({ | |||
} | |||
console.log(prames); | |||
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, { | |||
success: (res) => { | |||
success: (res2) => { | |||
that.setData({ | |||
bankTypeOptions:res.data, | |||
bankTypeOptions:res2.data, | |||
}) | |||
} | |||
}) | |||
UTIL.httpRequest(API.URL_GET_SELECTLIST , prames, { | |||
success: (res) => { | |||
let array = res.rows ; | |||
var payeeType = that.data.payeeType; | |||
var list = []; | |||
array.map(res=>{ | |||
res.payeeAccountText = res.payeeAccount.replace(/^(.{6})(?:\d+)(.{4})$/,"\$1****\$2"); | |||
res.bankTypeText = (that.data.bankTypeOptions.filter(function (e) { return e.dictValue == res.bankType; }))[0].dictLabel; | |||
list.push(res) | |||
}) | |||
that.setData({ | |||
list:list, | |||
UTIL.httpRequest(API.URL_GET_SELECTLIST , prames, { | |||
success: (res) => { | |||
let array = res.rows ; | |||
var list = []; | |||
res.rows.map(res3=>{ | |||
res3.payeeAccountText = res3.payeeAccount.replace(/^(.{6})(?:\d+)(.{4})$/,"\$1****\$2"); | |||
res3.bankTypeText = UTIL.getTransform(res3.bankType,that.data.bankTypeOptions); | |||
list.push(res3) | |||
}) | |||
console.log(list); | |||
that.setData({ | |||
list:list, | |||
}) | |||
} | |||
}) | |||
} | |||
}) | |||
}, | |||
goAdd(){ | |||
wx.navigateTo({ | |||
@@ -156,6 +158,29 @@ Page({ | |||
onReady() { | |||
}, | |||
delete(e){ | |||
var that = this; | |||
UTIL.httpRequest(API.URL_GET_PAYEEREMOVE + e.currentTarget.dataset.id, {method:'GET'},{ | |||
success: (res) => { | |||
if (res.code == API.SUCCESS_CODE) { | |||
that.data.list.splice(e.currentTarget.dataset.index, 1); | |||
wx.showToast({ | |||
title: '删除成功!', | |||
icon: 'success', | |||
duration: 2000 | |||
}) | |||
that.setData({ | |||
list : that.data.list, | |||
}) | |||
} | |||
} | |||
}) | |||
}, | |||
goEdit(e){ | |||
wx.navigateTo({ | |||
url: '/pages/payee/add/add?id='+e.currentTarget.dataset.id, | |||
}) | |||
}, | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
@@ -6,6 +6,7 @@ | |||
"van-cell-group": "@vant/weapp/cell-group/index", | |||
"van-search": "@vant/weapp/search/index", | |||
"van-radio": "@vant/weapp/radio/index", | |||
"van-radio-group": "@vant/weapp/radio-group/index" | |||
"van-swipe-cell": "@vant/weapp/swipe-cell/index", | |||
"van-radio-group": "@vant/weapp/radio-group/index" | |||
} | |||
} |
@@ -15,14 +15,11 @@ | |||
/> | |||
<view class="add_btn" bindtap="goAdd"><text>新增</text></view> | |||
</view> | |||
<van-cell-group> | |||
<van-swipe-cell right-width="{{ 65 }}" class="workflow" wx:for="{{list}}" data-index="{{ index }}" data-id="{{item.id}}" bindtap="goEdit" wx:key="index"> | |||
<van-cell | |||
wx:for="{{ list }}" | |||
wx:key="index" | |||
value-class="value-class" | |||
clickable | |||
data-index="{{ index }}" | |||
bind:click="toggle" | |||
use-label-slot | |||
> | |||
<view slot="icon" style="margin-right: 10px;"> | |||
@@ -39,7 +36,12 @@ | |||
<text decode = "{{true}}">{{item.payeeAccountText}}    {{item.bankTypeText}}</text> | |||
</view> | |||
</van-cell> | |||
</van-cell-group> | |||
<view slot="right" class="deleteBox"> | |||
<view style="flex: 1;height: 100%;display: flex;align-items: center;"> | |||
<image src="/image/apply/icon_delete.png" style="width: 25px;height: 25px;margin: 0 auto;" data-id="{{item.id}}" data-index="{{index}}" bindtap="delete"></image> | |||
</view> | |||
</view> | |||
</van-swipe-cell> | |||
<view class="ipXbtn"></view> | |||
</scroll-view> |
@@ -63,4 +63,13 @@ van-search { | |||
.van-radio-group{ | |||
padding-bottom: 100px; | |||
} | |||
.deleteBox{ | |||
width: 65px; | |||
text-align: center; | |||
height: 100%; | |||
background: #F6F6F6; | |||
align-items: center; | |||
display: flex; | |||
} |
@@ -1,6 +1,6 @@ | |||
{ | |||
"setting": { | |||
"compileHotReLoad": true | |||
"compileHotReLoad": false | |||
}, | |||
"condition": { | |||
"miniprogram": { | |||
@@ -24,7 +24,7 @@ const MSG_ERROR_TO = '提交异常,请重试'; | |||
const MSG_INVALID_USER_TOKEN='登陆信息失效,请重新登陆'; | |||
/****************接口提示信息end**************** | |||
/****************接口地址start****************/ | |||
/****************接口地址start****************/ | |||
//获取openId | |||
const URL_GET_OPENID=`${URL_PREFIX}/wechat/codeLogin`; | |||
// 获取手机号解密接口 | |||
@@ -300,6 +300,12 @@ const URL_GET_ASSETADD = `${URL_PREFIX}/contraction/asset/add`; | |||
//删除合同关联资产 | |||
const URL_GET_ASSETREMOVE = `${URL_PREFIX}/contraction/asset/remove/`; | |||
//收款人查询 | |||
const URL_GET_PAYEEGET = `${URL_PREFIX}/yinnong/payee/get/`; | |||
//收款人删除 | |||
const URL_GET_PAYEEREMOVE = `${URL_PREFIX}/yinnong/payee/remove/`; | |||
/****************接口地址end****************/ | |||
@@ -394,7 +400,7 @@ export { | |||
URL_POST_CONTRACTUPDATE, | |||
URL_GET_CONTRACTDELETE, | |||
URL_GET_ATTACHMENTLIST, | |||
URL_POST_MONEYORDERADD, | |||
URL_GET_MONEYORDERADD, | |||
URL_GET_PERMANENTLIST, | |||
URL_GET_PERMANENTDELETE, | |||
URL_GET_PERMANENTDETAIL, | |||
@@ -416,4 +422,7 @@ export { | |||
URL_POST_DEPOSITUPDATE, | |||
URL_GET_ASSETADD, | |||
URL_GET_ASSETREMOVE | |||
URL_GET_PAYEEEDIT, | |||
URL_GET_PAYEEGET, | |||
URL_GET_PAYEEREMOVE | |||
} |