@@ -33,7 +33,8 @@ | |||||
"pages/contract/add/add", | "pages/contract/add/add", | ||||
"pages/fixedAssets/fixedAssets", | "pages/fixedAssets/fixedAssets", | ||||
"pages/fixedAssets/add/add", | "pages/fixedAssets/add/add", | ||||
"pages/finance/finance" | |||||
"pages/finance/finance", | |||||
"pages/contractAssets/fixedAssets" | |||||
], | ], | ||||
"window": { | "window": { | ||||
"backgroundTextStyle": "light", | "backgroundTextStyle": "light", | ||||
@@ -4,7 +4,7 @@ | |||||
<text style="top:{{isIPX?'54px':'30px'}};">开户行</text> | <text style="top:{{isIPX?'54px':'30px'}};">开户行</text> | ||||
</view> | </view> | ||||
<view class="search_box" style="margin-top:{{isIPX?'100px':'75px'}};"> | |||||
<view class="search_box" id="top_view" style="margin-top:{{isIPX?'100px':'75px'}};"> | |||||
<van-search | <van-search | ||||
value="{{ value }}" | value="{{ value }}" | ||||
shape="round" | shape="round" | ||||
@@ -15,8 +15,8 @@ | |||||
/> | /> | ||||
<view class="add_btn" bindtap="goAdd"><text>新增</text></view> | <view class="add_btn" bindtap="goAdd"><text>新增</text></view> | ||||
</view> | </view> | ||||
<van-swipe-cell right-width="{{ 65 }}" class="workflow" wx:for="{{depositList}}" wx:key="index"> | |||||
<scroll-view scroll-y refresher-threshold="0" id="top_view2" style="height:{{scrollHeight}}px" bindscrolltolower="paging" lower-threshold="100"> | |||||
<van-swipe-cell right-width="{{ 65 }}" class="workflow" wx:for="{{depositList}}" wx:key="index" wx:for-item="item"> | |||||
<view class="li" bindtap="goUpdate" data-id="{{item.id}}"> | <view class="li" bindtap="goUpdate" data-id="{{item.id}}"> | ||||
<view class="tit_box"> | <view class="tit_box"> | ||||
<image src="/image/apply/{{iOf.indexOf(item.bankTypeText,'中国银行') > -1 ? 'ICBC':iOf.indexOf(item.bankTypeText,'农商行') > -1 ? 'RCB':iOf.indexOf(item.bankTypeText,'农业银行') > -1 ? 'ABC':iOf.indexOf(item.bankTypeText,'建设银行') > -1 ? 'CCB':'QT'}}.png" style="width: 25px;height: 25px;"></image> | <image src="/image/apply/{{iOf.indexOf(item.bankTypeText,'中国银行') > -1 ? 'ICBC':iOf.indexOf(item.bankTypeText,'农商行') > -1 ? 'RCB':iOf.indexOf(item.bankTypeText,'农业银行') > -1 ? 'ABC':iOf.indexOf(item.bankTypeText,'建设银行') > -1 ? 'CCB':'QT'}}.png" style="width: 25px;height: 25px;"></image> | ||||
@@ -32,12 +32,12 @@ | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view slot="right" class="deleteBox"> | <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 style="flex: 1;height: 100%;display: flex;align-items: center;" data-id="{{item.id}}" data-index="{{index}}" bindtap="delete"> | |||||
<image src="../../image/apply/icon_delete.png" style="width: 25px;height: 25px;margin: 0 auto;" ></image> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
</van-swipe-cell> | </van-swipe-cell> | ||||
</scroll-view> | |||||
<wxs module="iOf"> | <wxs module="iOf"> | ||||
var indexOf = function(name,value){ | var indexOf = function(name,value){ | ||||
return name.indexOf(value); | return name.indexOf(value); | ||||
@@ -26,7 +26,8 @@ Page({ | |||||
showRelevance:false, | showRelevance:false, | ||||
relevanceList:[], | relevanceList:[], | ||||
fileEvent:{}, | fileEvent:{}, | ||||
itemId:"" | |||||
itemId:"", | |||||
contractionId:"" | |||||
}, | }, | ||||
goAdd(){ | goAdd(){ | ||||
wx.navigateTo({ | wx.navigateTo({ | ||||
@@ -43,7 +44,6 @@ Page({ | |||||
*/ | */ | ||||
onLoad(options) { | onLoad(options) { | ||||
var that = this; | var that = this; | ||||
let qu = wx.createSelectorQuery() | let qu = wx.createSelectorQuery() | ||||
qu.select("#top_view").boundingClientRect() | qu.select("#top_view").boundingClientRect() | ||||
qu.select("#top_ban").boundingClientRect() | qu.select("#top_ban").boundingClientRect() | ||||
@@ -107,6 +107,11 @@ Page({ | |||||
url: '/pages/contract/add/add?id='+e.currentTarget.dataset.id, | url: '/pages/contract/add/add?id='+e.currentTarget.dataset.id, | ||||
}) | }) | ||||
}, | }, | ||||
addAssets(e){ | |||||
wx.navigateTo({ | |||||
url: '/pages/contractAssets/fixedAssets?id='+this.data.contractionId, | |||||
}) | |||||
}, | |||||
delete(e){ | delete(e){ | ||||
UTIL.httpRequest(API.URL_GET_CONTRACTDELETE + e.currentTarget.dataset.id, {method:'GET'}, { | UTIL.httpRequest(API.URL_GET_CONTRACTDELETE + e.currentTarget.dataset.id, {method:'GET'}, { | ||||
success: (res) => { | success: (res) => { | ||||
@@ -122,17 +127,50 @@ Page({ | |||||
} | } | ||||
}) | }) | ||||
}, | }, | ||||
relevanceBack(){ | |||||
let params = { | |||||
contractionId:this.data.contractionId | |||||
} | |||||
UTIL.httpRequest(API.URL_GET_ASSETLIST, params, { | |||||
success: (rr) => { | |||||
this.setData({ | |||||
'revelanceList':rr.rows, | |||||
'showRelevance':true | |||||
}) | |||||
}, | |||||
}) | |||||
}, | |||||
relevanceDelete(e){ | |||||
console.log(e); | |||||
UTIL.httpRequest(API.URL_GET_ASSETREMOVE+ e.currentTarget.dataset.id, {method:'GET'}, { | |||||
success: (res) => { | |||||
if(res.code==200){ | |||||
let new_list = this.data.revelanceList | |||||
new_list.splice(e.currentTarget.dataset.index,1) | |||||
this.setData({'revelanceList':new_list}) | |||||
UTIL.showToastNoneIcon('删除成功!'); | |||||
}else{ | |||||
UTIL.showToastNoneIcon('删除失败!'); | |||||
} | |||||
}, | |||||
fail:(rr) =>{ | |||||
console.log(rr); | |||||
}, | |||||
complete:(rr) => { | |||||
console.log(rr); | |||||
} | |||||
}) | |||||
}, | |||||
relevance(e){ | relevance(e){ | ||||
console.log(e) | |||||
let params = { | let params = { | ||||
contractionId:e.currentTarget.dataset.id | contractionId:e.currentTarget.dataset.id | ||||
} | } | ||||
UTIL.httpRequest(API.URL_GET_ASSETLIST, params, { | UTIL.httpRequest(API.URL_GET_ASSETLIST, params, { | ||||
success: (rr) => { | success: (rr) => { | ||||
console.log(rr) | |||||
this.setData({ | this.setData({ | ||||
'revelanceList':rr.rows, | 'revelanceList':rr.rows, | ||||
'showRelevance':true | |||||
'showRelevance':true, | |||||
'contractionId':e.currentTarget.dataset.id | |||||
}) | }) | ||||
}, | }, | ||||
fail:(rr) =>{ | fail:(rr) =>{ | ||||
@@ -302,7 +340,10 @@ Page({ | |||||
* 生命周期函数--监听页面显示 | * 生命周期函数--监听页面显示 | ||||
*/ | */ | ||||
onShow() { | onShow() { | ||||
console.log(this.data.contractionId) | |||||
if(this.data.contractionId!=""&&this.data.contractionId!=null){ | |||||
this.relevanceBack() | |||||
} | |||||
}, | }, | ||||
/** | /** | ||||
@@ -108,12 +108,12 @@ | |||||
</view> | </view> | ||||
<van-swipe-cell right-width="{{ 50 }}" wx:for="{{revelanceList}}" wx:key="index" wx:for-item="item" > | <van-swipe-cell right-width="{{ 50 }}" wx:for="{{revelanceList}}" wx:key="index" wx:for-item="item" > | ||||
<view class="tr"> | <view class="tr"> | ||||
<view class="th">{{item.assetTable}}</view> | |||||
<view class="th">固定资产</view> | |||||
<view class="th">{{item.name}}</view> | <view class="th">{{item.name}}</view> | ||||
<view class="th">{{item.num}}{{item.unit}}</view> | <view class="th">{{item.num}}{{item.unit}}</view> | ||||
</view> | </view> | ||||
<view slot="right" class="deleteBoxAsset"> | <view slot="right" class="deleteBoxAsset"> | ||||
<view style="flex: 1;height: 100%;display: flex;align-items: center;flex-direction: column;justify-content: center;background-color: rgb(255,0,0,0.2);" bindtap="delete" data-id="{{item.id}}" data-index="{{index}}" > | |||||
<view style="flex: 1;height: 100%;display: flex;align-items: center;flex-direction: column;justify-content: center;background-color: rgb(255,0,0,0.2);" bindtap="relevanceDelete" data-id="{{item.id}}" data-index="{{index}}" > | |||||
<view> | <view> | ||||
<text style="color:red">删除</text> | <text style="color:red">删除</text> | ||||
</view> | </view> | ||||
@@ -121,35 +121,7 @@ | |||||
</view> | </view> | ||||
</van-swipe-cell> | </van-swipe-cell> | ||||
<view class="tr" > | <view class="tr" > | ||||
<button type="primary">新增</button> | |||||
</view> | |||||
</view> | |||||
</scroll-view> | |||||
</van-action-sheet> | |||||
<van-action-sheet show="{{showRelevance}}" title="可关联资产" bind:close="closeBox"> | |||||
<scroll-view scroll-y="true" style="height: 700rpx;" bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" scroll-top="0"> | |||||
<view class="table"> | |||||
<view class="tr" style="background:#62AD66;color: #fff;border-radius:10px;"> | |||||
<view class="th">资产类型</view> | |||||
<view class="th">资产名称</view> | |||||
<view class="th">数量(单位)</view> | |||||
</view> | |||||
<van-swipe-cell right-width="{{ 50 }}" wx:for="{{revelanceList}}" wx:key="index" wx:for-item="item" > | |||||
<view class="tr"> | |||||
<view class="th">{{item.assetTable}}</view> | |||||
<view class="th">{{item.name}}</view> | |||||
<view class="th">{{item.num}}{{item.unit}}</view> | |||||
</view> | |||||
<view slot="right" class="deleteBoxAsset"> | |||||
<view style="flex: 1;height: 100%;display: flex;align-items: center;flex-direction: column;justify-content: center;background-color: rgb(255,0,0,0.2);" bindtap="delete" data-id="{{item.id}}" data-index="{{index}}" > | |||||
<view> | |||||
<text style="color:red">删除</text> | |||||
</view> | |||||
</view> | |||||
</view> | |||||
</van-swipe-cell> | |||||
<view class="tr" > | |||||
<button type="primary">新增关联资产</button> | |||||
<button type="primary" size="mini" bindtap="addAssets">+</button> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
</scroll-view> | </scroll-view> | ||||
@@ -295,6 +295,12 @@ const URL_GET_PAYEEEDIT = `${URL_PREFIX}/yinnong/payee/edit`; | |||||
//合同关联资产 | //合同关联资产 | ||||
const URL_GET_ASSETLIST = `${URL_PREFIX}/contraction/asset/list`; | const URL_GET_ASSETLIST = `${URL_PREFIX}/contraction/asset/list`; | ||||
//新增合同关联资产 | |||||
const URL_GET_ASSETADD = `${URL_PREFIX}/contraction/asset/add`; | |||||
//删除合同关联资产 | |||||
const URL_GET_ASSETREMOVE = `${URL_PREFIX}/contraction/asset/remove/`; | |||||
/****************接口地址end****************/ | /****************接口地址end****************/ | ||||
@@ -407,5 +413,7 @@ export { | |||||
URL_GET_PROJECTGET, | URL_GET_PROJECTGET, | ||||
URL_POST_PROJECTUPDATE, | URL_POST_PROJECTUPDATE, | ||||
URL_GET_DEPOSITDETAIL, | URL_GET_DEPOSITDETAIL, | ||||
URL_POST_DEPOSITUPDATE | |||||
URL_POST_DEPOSITUPDATE, | |||||
URL_GET_ASSETADD, | |||||
URL_GET_ASSETREMOVE | |||||
} | } |