| @@ -36,7 +36,8 @@ | |||
| "pages/finance/finance", | |||
| "pages/Bookkeeping/seeBook/seeBook", | |||
| "pages/Bookkeeping/seeBookZC/seeBookZC", | |||
| "pages/contractAssets/fixedAssets" | |||
| "pages/contractAssets/fixedAssets", | |||
| "pages/fixedAssets/change/change" | |||
| ], | |||
| "window": { | |||
| "backgroundTextStyle": "light", | |||
| @@ -272,8 +272,6 @@ Page({ | |||
| UTIL.httpRequest(API.URL_GET_CONTRACTDETAIL + this.data.id, {method:'GET'}, { | |||
| success: (res) => { | |||
| this.setData({'form':res.data}); | |||
| res.data.biddingDate = res.data.biddingDate.slice(0,9) | |||
| res.data.reviewTime = res.data.reviewTime.slice(0,9) | |||
| let that = this; | |||
| //获取收入合同状态 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'type_of_contract', {method:'GET'}, { | |||
| @@ -174,6 +174,34 @@ Page({ | |||
| }, | |||
| }) | |||
| }, | |||
| terminate(e){ | |||
| UTIL.httpRequest(API.URL_GET_TERMINATEINFO+ e.currentTarget.dataset.id, {method:'GET'}, { | |||
| success: (res) => { | |||
| if(res.code==200){ | |||
| let list = this.data.list | |||
| list[e.currentTarget.dataset.index].contractionStatus = '3' | |||
| this.setData({'list':list}) | |||
| UTIL.showToastNoneIcon('终止成功!'); | |||
| }else{ | |||
| UTIL.showToastNoneIcon('终止失败!: '+res.msg); | |||
| } | |||
| } | |||
| }) | |||
| }, | |||
| cancel(e){ | |||
| UTIL.httpRequest(API.URL_GET_CANCELINFO+ e.currentTarget.dataset.id, {method:'GET'}, { | |||
| success: (res) => { | |||
| if(res.code==200){ | |||
| let list = this.data.list | |||
| list[e.currentTarget.dataset.index].contractionStatus = '2' | |||
| this.setData({'list':list}) | |||
| UTIL.showToastNoneIcon('撤销成功!'); | |||
| }else{ | |||
| UTIL.showToastNoneIcon('撤销失败!: '+res.msg); | |||
| } | |||
| } | |||
| }) | |||
| }, | |||
| relevanceDelete(e){ | |||
| UTIL.httpRequest(API.URL_GET_ASSETREMOVE+ e.currentTarget.dataset.id, {method:'GET'}, { | |||
| success: (res) => { | |||
| @@ -16,7 +16,7 @@ | |||
| <view class="add_btn" bindtap="goAdd"><text>新增</text></view> | |||
| </view> | |||
| <scroll-view scroll-y refresher-threshold="0" style="height:{{scrollHeight}}px" bindscrolltolower="paging" lower-threshold="100"> | |||
| <van-swipe-cell right-width="{{ 150 }}" class="workflow" wx:for="{{list}}" wx:key="index" wx:for-item="item" > | |||
| <van-swipe-cell left-width="{{ 100 }}" right-width="{{ 150 }}" class="workflow" wx:for="{{list}}" wx:key="index" wx:for-item="item" > | |||
| <view class="li" bindtap="goUpdate" data-id="{{item.id}}"> | |||
| <view class="tit_box"> | |||
| <image src="/image/icon/contract_icon.png" style="width: 15px;height: 15px;margin-right: 10px;" referrer="no-referrer|origin|unsafe-url"></image> | |||
| @@ -79,6 +79,24 @@ | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <view slot="left" class="moreBox"> | |||
| <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);" data-id="{{item.id}}" data-index="{{index}}" bindtap="terminate"> | |||
| <view> | |||
| <image src="../../image/icon/terminate_icon.png" style="width: 25px;height: 25px;margin: 0 auto;display: block;" ></image> | |||
| </view> | |||
| <view> | |||
| <text style="color:red">终止</text> | |||
| </view> | |||
| </view> | |||
| <view style="flex: 1;height: 100%;display: flex;align-items: center;flex-direction: column;justify-content: center;background-color: rgb(179,219,98,0.2);" data-id="{{item.id}}" data-index="{{index}}" bindtap="cancel"> | |||
| <view> | |||
| <image src="../../image/icon/cancel_icon.png" style="width: 25px;height: 25px;margin: 0 auto;display: block;" ></image> | |||
| </view> | |||
| <view> | |||
| <text style="color: #B3DB62;">撤销</text> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </van-swipe-cell> | |||
| </scroll-view> | |||
| @@ -109,7 +127,7 @@ | |||
| </view> | |||
| <van-swipe-cell right-width="{{ 50 }}" wx:for="{{revelanceList}}" wx:key="index" wx:for-item="item" > | |||
| <view class="tr"> | |||
| <view class="th">固定资产</view> | |||
| <view class="th">{{item.assetTable=='t_asset_permanent'?"固定资产":"资源资产"}}</view> | |||
| <view class="th">{{item.name}}</view> | |||
| <view class="th">{{item.num}}{{item.unit}}</view> | |||
| </view> | |||
| @@ -71,6 +71,14 @@ text{display: block;} | |||
| align-items: center; | |||
| display: flex; | |||
| } | |||
| .moreBox{ | |||
| width: 100px; | |||
| text-align: center; | |||
| height: 100%; | |||
| background: #F6F6F6; | |||
| align-items: center; | |||
| display: flex; | |||
| } | |||
| .deleteBoxAsset{ | |||
| width: 50px; | |||
| text-align: center; | |||
| @@ -15,6 +15,7 @@ Page({ | |||
| data: { | |||
| isIPX: app.globalData.isIPX, | |||
| list:[], | |||
| list1:[], | |||
| isLoading:false, | |||
| pageNums:1, | |||
| scrollHeight:"", | |||
| @@ -27,6 +28,11 @@ Page({ | |||
| itemId:"", | |||
| assetTypeOptions:[], | |||
| status:0, | |||
| index:0, | |||
| array:[ | |||
| {assetTable:'t_asset_permanent',assetTableName:'固定资产'}, | |||
| {assetTable:'t_asset_resource',assetTableName:'资源性资产'} | |||
| ], | |||
| }, | |||
| goAdd(){ | |||
| wx.navigateTo({ | |||
| @@ -45,6 +51,10 @@ Page({ | |||
| } | |||
| }) | |||
| }, | |||
| bindPickerChange:function(e){ | |||
| this.setData({index:e.detail.value}); | |||
| this.getList() | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| @@ -80,64 +90,77 @@ Page({ | |||
| this.getList(); | |||
| }, | |||
| getList:function(){ | |||
| let params = { | |||
| pageNum:this.data.pageNums, | |||
| pageSize:10, | |||
| if(this.data.index == 0){ | |||
| let params = { | |||
| name:this.data.name, | |||
| isMin:"Y", | |||
| useType:'2', | |||
| operationType:'1', | |||
| assetStatus:'1' | |||
| OperationType:'1', | |||
| assetStatus:'1', | |||
| isMin:'Y' | |||
| } | |||
| UTIL.httpRequest(API.URL_GET_PERMANENTLIST,params,{ | |||
| success: (res) => { | |||
| let _this = this | |||
| if(res.code == 200){ | |||
| if(this.data.pageNums!=1&&this.data.list.length<res.total){ | |||
| let lists = this.data.list.concat(res.rows) | |||
| //获取资产类别 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'asset_type', {method:'GET'}, { | |||
| success: (r) => { | |||
| if(r.data.length>0){ | |||
| let li = lists.map( res => { | |||
| r.data.map(rr => { | |||
| if(res.assetType == rr.dictValue){ | |||
| res.assetType = rr.dictLabel | |||
| } | |||
| }) | |||
| return res | |||
| UTIL.httpRequest(API.URL_GET_PERMANENTLIST,params,{ | |||
| success: (res) => { | |||
| let _this = this | |||
| if(res.code == 200){ | |||
| //获取资产类别 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'asset_type', {method:'GET'}, { | |||
| success: (r) => { | |||
| if(r.data.length>0){ | |||
| let li = res.rows.map( ress => { | |||
| r.data.map(rr => { | |||
| if(ress.assetType == rr.dictValue){ | |||
| ress.assetType = rr.dictLabel | |||
| } | |||
| }) | |||
| _this.setData({list:li}) | |||
| }else{ | |||
| _this.setData({list:lists}) | |||
| } | |||
| return ress | |||
| }) | |||
| _this.setData({list:li}) | |||
| }else{ | |||
| _this.setData({list:res.rows}) | |||
| } | |||
| }) | |||
| }else if(this.data.pageNums==1){ | |||
| //获取资产类别 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'asset_type', {method:'GET'}, { | |||
| success: (r) => { | |||
| if(r.data.length>0){ | |||
| let li = res.rows.map( ress => { | |||
| r.data.map(rr => { | |||
| if(ress.assetType == rr.dictValue){ | |||
| ress.assetType = rr.dictLabel | |||
| } | |||
| }) | |||
| return ress | |||
| } | |||
| }) | |||
| }else{ | |||
| UTIL.showToastNoneIcon(res.msg); | |||
| } | |||
| } | |||
| }) | |||
| }else{ | |||
| let params = { | |||
| name:this.data.name, | |||
| useType : '2', | |||
| status : '0' | |||
| } | |||
| UTIL.httpRequest(API.URL_GET_RESOURCELIST,params,{ | |||
| success: (res) => { | |||
| let _this = this | |||
| if(res.code == 200){ | |||
| //获取资产类别 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'resource_type', {method:'GET'}, { | |||
| success: (r) => { | |||
| if(r.data.length>0){ | |||
| let li = res.rows.map( ress => { | |||
| r.data.map(rr => { | |||
| if(ress.resourceType == rr.dictValue){ | |||
| ress.resourceType = rr.dictLabel | |||
| } | |||
| }) | |||
| _this.setData({list:li}) | |||
| }else{ | |||
| _this.setData({list:res.rows}) | |||
| } | |||
| return ress | |||
| }) | |||
| _this.setData({list1:li}) | |||
| }else{ | |||
| _this.setData({list1:res.rows}) | |||
| } | |||
| }) | |||
| } | |||
| }) | |||
| }else{ | |||
| UTIL.showToastNoneIcon(res.msg); | |||
| } | |||
| }else{ | |||
| UTIL.showToastNoneIcon(res.msg); | |||
| } | |||
| } | |||
| }) | |||
| }) | |||
| } | |||
| }, | |||
| paging(){ | |||
| this.setData({ | |||
| @@ -155,12 +178,12 @@ Page({ | |||
| this.setData({'status':1}) | |||
| let data = e.currentTarget.dataset.item; | |||
| data.method = "POST"; | |||
| data.assetTable = "t_asset_permanent" | |||
| data.assetTable = 't_asset_permanent' | |||
| data.assetId = e.currentTarget.dataset.item.id | |||
| data.contractionId = this.data.itemId | |||
| data.num = e.currentTarget.dataset.item.quantity | |||
| if(data.unit==""||data.unit==null){ | |||
| data.unit = '1' | |||
| data.unit = '台' | |||
| } | |||
| UTIL.httpRequest(API.URL_GET_ASSETADD,data,{ | |||
| success: (res) => { | |||
| @@ -178,6 +201,34 @@ Page({ | |||
| }) | |||
| } | |||
| }, | |||
| goUpdate1(e){ | |||
| if(this.data.status=='0'){ | |||
| this.setData({'status':1}) | |||
| let data = e.currentTarget.dataset.item; | |||
| data.method = "POST"; | |||
| data.assetTable = 't_asset_resource' | |||
| data.assetId = e.currentTarget.dataset.item.id | |||
| data.contractionId = this.data.itemId | |||
| data.num = e.currentTarget.dataset.item.totalArea | |||
| if(data.unit==""||data.unit==null){ | |||
| data.unit = '亩' | |||
| } | |||
| UTIL.httpRequest(API.URL_GET_ASSETADD,data,{ | |||
| success: (res) => { | |||
| if(res.code == 200){ | |||
| UTIL.showToastNoneIcon(res.msg); | |||
| this.setData({'status':0}) | |||
| wx.navigateBack({ | |||
| delta: 1 | |||
| }) | |||
| }else{ | |||
| UTIL.showToastNoneIcon(res.msg); | |||
| this.setData({'status':0}) | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| }, | |||
| delete(e){ | |||
| UTIL.httpRequest(API.URL_GET_PERMANENTDELETE + e.currentTarget.dataset.id, {method:'GET'}, { | |||
| success: (res) => { | |||
| @@ -1,11 +1,12 @@ | |||
| <!--pages/fixedAssets/fixedAssets.wxml--> | |||
| <view class="ns" id="top_ban" style="height:{{isIPX?'88px':'64px'}};"> | |||
| <image src="../../image/apply/back.png" style="top:{{isIPX?'54px':'30px'}};height: 19.0909px;" mode="widthFix" bindtap="back" referrer="no-referrer|origin|unsafe-url"></image> | |||
| <text style="top:{{isIPX?'54px':'30px'}};">可关联固定资产</text> | |||
| <text style="top:{{isIPX?'54px':'30px'}};">可关联资产</text> | |||
| </view> | |||
| <view class="search_box" id="top_view" style="margin-top:{{isIPX?'100px':'75px'}};"> | |||
| <van-search | |||
| <view style="width:61%;"> | |||
| <van-search | |||
| value="{{ name }}" | |||
| shape="round" | |||
| background="transparent" | |||
| @@ -13,9 +14,18 @@ | |||
| clearable | |||
| bind:change="goSearch" | |||
| /> | |||
| </view> | |||
| <view style="border:1px solid #ddd;background: #fff;border-radius: 30px;padding: 0 25rpx;width:34%;margin-top: 9px;line-height: 38px;height: 38px;"> | |||
| <picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}" range-key="assetTableName"> | |||
| <view class="picker" style="text-align: center;"> | |||
| {{array[index].assetTableName}} | |||
| <image src="../../image/icon/triangle.png" style="height:25rpx;width:25rpx;margin-right: 10rpx;"></image> | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| </view> | |||
| <scroll-view scroll-y refresher-threshold="0" style="height:{{scrollHeight}}px" bindscrolltolower="paging" lower-threshold="100"> | |||
| <van-swipe-cell class="workflow" wx:for="{{list}}" wx:key="index" wx:for-item="item" > | |||
| <scroll-view scroll-y refresher-threshold="0" wx:if="{{index == '0'}}" style="height:{{scrollHeight}}px" bindscrolltolower="paging" lower-threshold="100"> | |||
| <van-swipe-cell class="workflow" wx:for="{{list}}" wx:key="index" wx:for-item="item"> | |||
| <view class="li" bindtap="goUpdate" data-item="{{item}}"> | |||
| <view class="tit_box"> | |||
| <image src="/image/icon/fixedAssets_icon.png" style="width: 15px;height: 15px;margin-right: 10px;" referrer="no-referrer|origin|unsafe-url"></image> | |||
| @@ -47,6 +57,36 @@ | |||
| </view> | |||
| </van-swipe-cell> | |||
| </scroll-view> | |||
| <modal hidden="{{!showPopup}}" title="是否删除?" confirm-text="是" cancel-text="否" bindcancel="cancelTem" bindconfirm="confirmTem"> | |||
| </modal> | |||
| <scroll-view scroll-y refresher-threshold="0" wx:if="{{index == '1'}}" style="height:{{scrollHeight}}px" bindscrolltolower="paging" lower-threshold="100"> | |||
| <van-swipe-cell class="workflow" wx:for="{{list1}}" wx:key="index" wx:for-item="item" > | |||
| <view class="li" bindtap="goUpdate1" data-item="{{item}}"> | |||
| <view class="tit_box"> | |||
| <image src="/image/icon/fixedAssets_icon.png" style="width: 15px;height: 15px;margin-right: 10px;" referrer="no-referrer|origin|unsafe-url"></image> | |||
| <text class="tit">{{item.name}}</text> | |||
| <view style="flex:1;"> | |||
| <text wx:if="{{item.useType=='1'}}" style="text-align: center;float:right;font-size:12px;background:rgb(235, 154, 4,0.2);color:rgb(235, 154, 4);width:50px;line-height: 20px;">自用</text> | |||
| <text wx:if="{{item.useType=='2'}}" style="text-align: center;float:right;font-size:12px;background:rgb(235, 154, 4,0.2);color:rgb(235, 154, 4);width:50px;line-height: 20px;">闲置</text> | |||
| <text wx:if="{{item.useType=='3'}}" style="text-align: center;float:right;font-size:12px;background:rgb(235, 154, 4,0.2);color:rgb(235, 154, 4);width:70px;line-height: 20px;">出租或出借</text> | |||
| <text wx:if="{{item.useType=='4'}}" style="text-align: center;float:right;font-size:12px;background:rgb(235, 4, 4,0.2);color:rgb(235, 4, 4);width:50px;line-height: 20px;">其他</text> | |||
| </view> | |||
| </view> | |||
| <view class="detail_box"> | |||
| <view style="width: 55%;margin-left:5%;">{{item.code}}</view> | |||
| <view style="width: 40%;"> | |||
| {{item.resourceType}} | |||
| </view> | |||
| </view> | |||
| <view class="detail_box"> | |||
| <view style="width: 60%;"> | |||
| <image src="/image/icon/clock_icon.png" style="width: 15px;height: 15px;border-radius:5px;margin-right: 5px;"></image> | |||
| <text>{{item.createTime}}</text> | |||
| </view> | |||
| <view style="width: 40%;text-align: right;"> | |||
| 数量/面积: | |||
| <text style="color:red">{{item.totalArea}}</text> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </van-swipe-cell> | |||
| </scroll-view> | |||
| @@ -0,0 +1,629 @@ | |||
| // pages/contract/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, | |||
| id:null, | |||
| form:{}, | |||
| assetTypeindex:'0', | |||
| changeTypeindex:'0', | |||
| depreciationTypeindex:'0', | |||
| changeValueindex:'0', | |||
| // 折旧方式字典 | |||
| depreciationTypeOptions:[], | |||
| // 资产类别字典 | |||
| assetTypeOptions: [], | |||
| // 变更类型字典 | |||
| changeTypeOptions: [ | |||
| { 'dictLabel':'数量/面积变更','dictValue':'1'}, | |||
| { 'dictLabel':'原值变更','dictValue':'2'}, | |||
| { 'dictLabel':'预计使用年数变更','dictValue':'3'}, | |||
| { 'dictLabel':'累计折旧变更','dictValue':'4'}, | |||
| { 'dictLabel':'已折旧年数变更','dictValue':'5'}, | |||
| { 'dictLabel':'残值率变更','dictValue':'6'}, | |||
| { 'dictLabel':'折旧方式变更','dictValue':'7'}, | |||
| ], | |||
| status:0, | |||
| }, | |||
| back:function(){ | |||
| wx.navigateBack({ | |||
| delta: 1 | |||
| }) | |||
| }, | |||
| openBox(even){ | |||
| this.setData({ | |||
| [even.currentTarget.dataset.name]:true | |||
| }) | |||
| }, | |||
| onChange(event){ | |||
| this.setData({ | |||
| [event.currentTarget.dataset.formname]: event.detail, | |||
| }) | |||
| }, | |||
| closeBox(even){ | |||
| this.setData({ | |||
| [even.currentTarget.dataset.name]:false | |||
| }) | |||
| }, | |||
| onConfirmChangeType (e) { | |||
| let obj = e.detail.value; | |||
| this.setData({ | |||
| 'form.changeType':this.data.changeTypeOptions[obj].dictValue, | |||
| 'changeTypeindex':obj | |||
| }) | |||
| }, | |||
| onConfirmChangeValue(e){ | |||
| let obj = e.detail.value; | |||
| this.setData({ | |||
| 'form.changeValue':this.data.depreciationTypeOptions[obj].dictValue, | |||
| 'changeValueindex':obj | |||
| }) | |||
| }, | |||
| onConfirmDepreciationType(e){ | |||
| let obj = e.detail.value; | |||
| this.setData({ | |||
| 'form.depreciationType':this.data.depreciationTypeOptions[obj].dictValue, | |||
| 'depreciationTypeindex':obj | |||
| }) | |||
| }, | |||
| onConfirmAssetType (e) { | |||
| let obj = e.detail.value; | |||
| this.setData({ | |||
| 'form.assetType':this.data.assetTypeOptions[obj].dictValue, | |||
| 'assetTypeindex':obj | |||
| }) | |||
| }, | |||
| getNewDate(date){ | |||
| //date是传过来的时间戳,注意需为13位,10位需*1000 | |||
| //也可以不传,获取的就是当前时间 | |||
| var time | |||
| if(date){ | |||
| time = new Date(date); | |||
| }else{ | |||
| time = new Date(); | |||
| } | |||
| var year= time.getFullYear() //年 | |||
| var month = ("0" + (time.getMonth() + 1)).slice(-2); //月 | |||
| var day = ("0" + time.getDate()).slice(-2); //日 | |||
| var mydate = year + "-" + month + "-" + day; | |||
| return mydate | |||
| }, | |||
| goSubmit:function(){ | |||
| if(this.data.changeTypeindex != 6&&(this.data.form.changeValue===''||this.data.form.changeValue==null)){ //变更后值 | |||
| UTIL.showToastNoneIcon('变更后值不能给你为空!'); | |||
| return false; | |||
| }else if(this.data.status == '0'){ | |||
| let that = this | |||
| this.setData({'status':'1'}) | |||
| let data = this.data.form; | |||
| data.method = "POST"; | |||
| if(this.data.changeTypeindex == 0){ | |||
| data.quantity = data.changeValue | |||
| UTIL.httpRequest(API.URL_POST_UPDATEQUANTITY,data,{ | |||
| success: (res) => { | |||
| that.setData({'status':'0'}) | |||
| if(res.code == 200){ | |||
| UTIL.showToastNoneIcon("变更成功"); | |||
| setTimeout(function(){ | |||
| wx.navigateBack({ | |||
| delta:1 | |||
| }) | |||
| },2000) | |||
| }else{ | |||
| UTIL.showToastNoneIcon("变更失败:"+res.msg); | |||
| } | |||
| }, | |||
| fail: function (response) { | |||
| if (typeof fail === FUNCTION_TEXT) { | |||
| fail(handleFail(response)); | |||
| } else { | |||
| showToastNoneIcon(API.MSG_FAIL_HTTP); | |||
| } | |||
| that.setData({'status':0}) | |||
| }, | |||
| complete: function (response) { | |||
| wx.hideNavigationBarLoading(); | |||
| } | |||
| }) | |||
| }else if(this.data.changeTypeindex == 1){ | |||
| data.originalValue = data.changeValue | |||
| UTIL.httpRequest(API.URL_POST_UPDATEORIGINALVALUE,data,{ | |||
| success: (res) => { | |||
| that.setData({'status':'0'}) | |||
| if(res.code == 200){ | |||
| UTIL.showToastNoneIcon("变更成功"); | |||
| setTimeout(function(){ | |||
| wx.navigateBack({ | |||
| delta:1 | |||
| }) | |||
| },2000) | |||
| }else{ | |||
| UTIL.showToastNoneIcon("变更失败:"+res.msg); | |||
| } | |||
| }, | |||
| fail: function (response) { | |||
| if (typeof fail === FUNCTION_TEXT) { | |||
| fail(handleFail(response)); | |||
| } else { | |||
| showToastNoneIcon(API.MSG_FAIL_HTTP); | |||
| } | |||
| that.setData({'status':0}) | |||
| }, | |||
| complete: function (response) { | |||
| wx.hideNavigationBarLoading(); | |||
| } | |||
| }) | |||
| }else if(this.data.changeTypeindex == 2){ | |||
| data.expectedYears = data.changeValue | |||
| UTIL.httpRequest(API.URL_POST_UPDATEEXPECTEDYEARS,data,{ | |||
| success: (res) => { | |||
| that.setData({'status':'0'}) | |||
| if(res.code == 200){ | |||
| UTIL.showToastNoneIcon("变更成功"); | |||
| setTimeout(function(){ | |||
| wx.navigateBack({ | |||
| delta:1 | |||
| }) | |||
| },2000) | |||
| }else{ | |||
| UTIL.showToastNoneIcon("变更失败:"+res.msg); | |||
| } | |||
| }, | |||
| fail: function (response) { | |||
| if (typeof fail === FUNCTION_TEXT) { | |||
| fail(handleFail(response)); | |||
| } else { | |||
| showToastNoneIcon(API.MSG_FAIL_HTTP); | |||
| } | |||
| that.setData({'status':0}) | |||
| }, | |||
| complete: function (response) { | |||
| wx.hideNavigationBarLoading(); | |||
| } | |||
| }) | |||
| }else if(this.data.changeTypeindex == 3){ | |||
| data.depreciationValue = data.changeValue | |||
| UTIL.httpRequest(API.URL_POST_UPDATEDEPRECIATIONVALUE,data,{ | |||
| success: (res) => { | |||
| that.setData({'status':'0'}) | |||
| if(res.code == 200){ | |||
| UTIL.showToastNoneIcon("变更成功"); | |||
| setTimeout(function(){ | |||
| wx.navigateBack({ | |||
| delta:1 | |||
| }) | |||
| },2000) | |||
| }else{ | |||
| UTIL.showToastNoneIcon("变更失败:"+res.msg); | |||
| } | |||
| }, | |||
| fail: function (response) { | |||
| if (typeof fail === FUNCTION_TEXT) { | |||
| fail(handleFail(response)); | |||
| } else { | |||
| showToastNoneIcon(API.MSG_FAIL_HTTP); | |||
| } | |||
| that.setData({'status':0}) | |||
| }, | |||
| complete: function (response) { | |||
| wx.hideNavigationBarLoading(); | |||
| } | |||
| }) | |||
| }else if(this.data.changeTypeindex == 4){ | |||
| data.depreciationYears = data.changeValue | |||
| UTIL.httpRequest(API.URL_POST_UPDATEDEPRECIATIONYEARS,data,{ | |||
| success: (res) => { | |||
| that.setData({'status':'0'}) | |||
| if(res.code == 200){ | |||
| UTIL.showToastNoneIcon("变更成功"); | |||
| setTimeout(function(){ | |||
| wx.navigateBack({ | |||
| delta:1 | |||
| }) | |||
| },2000) | |||
| }else{ | |||
| UTIL.showToastNoneIcon("变更失败:"+res.msg); | |||
| } | |||
| }, | |||
| fail: function (response) { | |||
| if (typeof fail === FUNCTION_TEXT) { | |||
| fail(handleFail(response)); | |||
| } else { | |||
| showToastNoneIcon(API.MSG_FAIL_HTTP); | |||
| } | |||
| that.setData({'status':0}) | |||
| }, | |||
| complete: function (response) { | |||
| wx.hideNavigationBarLoading(); | |||
| } | |||
| }) | |||
| }else if(this.data.changeTypeindex == 5){ | |||
| data.residualsRate = data.changeValue | |||
| UTIL.httpRequest(API.URL_POST_UPDATERESIDUALSRATE,data,{ | |||
| success: (res) => { | |||
| that.setData({'status':'0'}) | |||
| if(res.code == 200){ | |||
| UTIL.showToastNoneIcon("变更成功"); | |||
| setTimeout(function(){ | |||
| wx.navigateBack({ | |||
| delta:1 | |||
| }) | |||
| },2000) | |||
| }else{ | |||
| UTIL.showToastNoneIcon("变更失败:"+res.msg); | |||
| } | |||
| }, | |||
| fail: function (response) { | |||
| if (typeof fail === FUNCTION_TEXT) { | |||
| fail(handleFail(response)); | |||
| } else { | |||
| showToastNoneIcon(API.MSG_FAIL_HTTP); | |||
| } | |||
| that.setData({'status':0}) | |||
| }, | |||
| complete: function (response) { | |||
| wx.hideNavigationBarLoading(); | |||
| } | |||
| }) | |||
| }else if(this.data.changeTypeindex == 6){ | |||
| data.depreciationType = this.data.depreciationTypeOptions[this.data.changeValueindex].dictValue | |||
| UTIL.httpRequest(API.URL_POST_UPDATEDEPRECIATIONMETHOD,data,{ | |||
| success: (res) => { | |||
| that.setData({'status':'0'}) | |||
| if(res.code == 200){ | |||
| UTIL.showToastNoneIcon("变更成功"); | |||
| setTimeout(function(){ | |||
| wx.navigateBack({ | |||
| delta:1 | |||
| }) | |||
| },2000) | |||
| }else{ | |||
| UTIL.showToastNoneIcon("变更失败:"+res.msg); | |||
| } | |||
| }, | |||
| fail: function (response) { | |||
| if (typeof fail === FUNCTION_TEXT) { | |||
| fail(handleFail(response)); | |||
| } else { | |||
| showToastNoneIcon(API.MSG_FAIL_HTTP); | |||
| } | |||
| that.setData({'status':0}) | |||
| }, | |||
| complete: function (response) { | |||
| wx.hideNavigationBarLoading(); | |||
| } | |||
| }) | |||
| } | |||
| } | |||
| }, | |||
| bindNewInput: function (e) { | |||
| this.setData({ | |||
| [e.currentTarget.dataset.name]: e.detail.value | |||
| }) | |||
| if(e.currentTarget.dataset.name == 'form.originalValue' ){ | |||
| this.setData({ | |||
| 'form.netSalvage' : (this.data.form.residualsRate*e.detail.value/100).toFixed(2), | |||
| 'form.perYearDepreciationValue' : ((e.detail.value-(this.data.form.residualsRate*e.detail.value/100))/this.data.form.expectedYears).toFixed(2), | |||
| 'form.netValue':this.data.form.originalValue-this.data.form.depreciationValue | |||
| }) | |||
| } | |||
| if(e.currentTarget.dataset.name == 'form.residualsRate' &&e.detail.value<=100){ | |||
| this.setData({ | |||
| 'form.netSalvage' : (this.data.form.originalValue*e.detail.value/100)<this.data.form.originalValue?(this.data.form.originalValue*e.detail.value/100).toFixed(2):this.data.form.originalValue, | |||
| }) | |||
| this.setData({ | |||
| 'form.perYearDepreciationValue' : ((this.data.form.originalValue-this.data.form.netSalvage)/this.data.form.expectedYears).toFixed(2), | |||
| }) | |||
| } | |||
| if(e.currentTarget.dataset.name == 'form.residualsRate' &&e.detail.value>100){ | |||
| this.setData({ | |||
| 'form.residualsRate' : 5, | |||
| }) | |||
| } | |||
| if(e.currentTarget.dataset.name == 'form.netSalvage' ){ | |||
| this.setData({ | |||
| 'form.perYearDepreciationValue' : ((this.data.form.originalValue-e.detail.value)/this.data.form.expectedYears).toFixed(2) | |||
| }) | |||
| } | |||
| if(e.currentTarget.dataset.name == 'form.expectedYears' ){ | |||
| this.setData({ | |||
| 'form.perYearDepreciationValue' : ((this.data.form.originalValue-this.data.form.netSalvage)/e.detail.value).toFixed(2) | |||
| }) | |||
| } | |||
| if(e.currentTarget.dataset.name == 'form.depreciationYears' ){ | |||
| this.setData({ | |||
| 'form.depreciationValue' : (this.data.form.perYearDepreciationValue*e.detail.value)>this.data.form.originalValue?this.data.form.originalValue:(this.data.form.perYearDepreciationValue*e.detail.value).toFixed(2), | |||
| 'form.netValue' : (this.data.form.originalValue-(this.data.form.perYearDepreciationValue*e.detail.value))>=0?(this.data.form.originalValue-(this.data.form.perYearDepreciationValue*e.detail.value).toFixed(2)):0 | |||
| }) | |||
| } | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad(options) { | |||
| if(options.id!=null&&options.id!=""){ | |||
| this.setData({id:options.id}) | |||
| //获取收入合同状态 | |||
| UTIL.httpRequest(API.URL_GET_PERMANENTDETAIL + this.data.id, {method:'GET'}, { | |||
| success: (res) => { | |||
| this.setData({'form':res.data}); | |||
| let that = this; | |||
| //获取资产类别 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'asset_type', {method:'GET'}, { | |||
| success: (r) => { | |||
| if(r.data.length>0){ | |||
| that.setData({ | |||
| assetTypeOptions:r.data, | |||
| }) | |||
| r.data.map((rr,ind) => { | |||
| if(rr.dictValue == res.data.assetType){ | |||
| that.setData({'assetTypeindex':ind}) | |||
| } | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| //获取经营属性 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'operation_type', {method:'GET'}, { | |||
| success: (r) => { | |||
| if(r.data.length>0){ | |||
| that.setData({ | |||
| operationTypeOptions:r.data, | |||
| }) | |||
| r.data.map((rr,ind) => { | |||
| if(rr.dictValue == res.data.operationType){ | |||
| that.setData({'operationTypeindex':ind}) | |||
| } | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| //获取增加方式 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'add_type', {method:'GET'}, { | |||
| success: (r) => { | |||
| if(r.data.length>0){ | |||
| that.setData({ | |||
| addTypeOptions:r.data, | |||
| }) | |||
| r.data.map((rr,ind) => { | |||
| if(rr.dictValue == res.data.addType){ | |||
| that.setData({'addTypeindex':ind}) | |||
| } | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| //获取使用情况 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'use_type', {method:'GET'}, { | |||
| success: (r) => { | |||
| if(r.data.length>0){ | |||
| that.setData({ | |||
| useTypeOptions:r.data, | |||
| }) | |||
| r.data.map((rr,ind) => { | |||
| if(rr.dictValue == res.data.useType){ | |||
| that.setData({'useTypeindex':ind}) | |||
| } | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| //获取折旧方式 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'depreciation_type', {method:'GET'}, { | |||
| success: (r) => { | |||
| if(r.data.length>0){ | |||
| that.setData({ | |||
| depreciationTypeOptions:r.data, | |||
| }) | |||
| r.data.map((rr,ind) => { | |||
| if(rr.dictValue == res.data.depreciationType){ | |||
| that.setData({'depreciationTypeindex':ind}) | |||
| } | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| //获取资产状态 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'asset_status', {method:'GET'}, { | |||
| success: (r) => { | |||
| if(r.data.length>0){ | |||
| that.setData({ | |||
| assetStatusOptions:r.data, | |||
| }) | |||
| r.data.map((rr,ind) => { | |||
| if(rr.dictValue == res.data.assetStatus){ | |||
| that.setData({'assetStatusindex':ind}) | |||
| } | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| //获取单位 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'fixed_assets_unit', {method:'GET'}, { | |||
| success: (r) => { | |||
| if(r.data.length>0){ | |||
| that.setData({ | |||
| unitOptions:r.data, | |||
| }) | |||
| r.data.map((rr,ind) => { | |||
| if(rr.dictValue == res.data.unit){ | |||
| that.setData({'unitindex':ind}) | |||
| } | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| //获取系统是否 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'sys_yes_no', {method:'GET'}, { | |||
| success: (r) => { | |||
| if(r.data.length>0){ | |||
| that.setData({ | |||
| sysYesNoOptions:r.data, | |||
| }) | |||
| r.data.map((rr,ind) => { | |||
| if(rr.dictValue == res.data.isMin){ | |||
| that.setData({'isMinindex':ind}) | |||
| } | |||
| if(rr.dictValue == res.data.isFormAsset){ | |||
| that.setData({'isFormAssetindex':ind}) | |||
| } | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| }) | |||
| }else{ | |||
| let that = this; | |||
| //获取资产类别 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'asset_type', {method:'GET'}, { | |||
| success: (res) => { | |||
| if(res.data.length>0){ | |||
| that.setData({ | |||
| assetTypeOptions:res.data, | |||
| 'form.assetType':res.data[0].dictValue | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| //获取经营属性 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'operation_type', {method:'GET'}, { | |||
| success: (res) => { | |||
| if(res.data.length>0){ | |||
| that.setData({ | |||
| operationTypeOptions:res.data, | |||
| 'form.operationType':res.data[0].dictValue | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| //获取增加方式 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'add_type', {method:'GET'}, { | |||
| success: (res) => { | |||
| if(res.data.length>0){ | |||
| that.setData({ | |||
| addTypeOptions:res.data, | |||
| 'form.addType':res.data[0].dictValue | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| //获取使用情况 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'use_type', {method:'GET'}, { | |||
| success: (res) => { | |||
| if(res.data.length>0){ | |||
| that.setData({ | |||
| useTypeOptions:res.data, | |||
| 'form.useType':res.data[0].dictValue | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| //获取折旧方式 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'depreciation_type', {method:'GET'}, { | |||
| success: (res) => { | |||
| if(res.data.length>0){ | |||
| that.setData({ | |||
| depreciationTypeOptions:res.data, | |||
| 'form.depreciationType':res.data[1].dictValue | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| //获取资产状态 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'asset_status', {method:'GET'}, { | |||
| success: (res) => { | |||
| if(res.data.length>0){ | |||
| that.setData({ | |||
| assetStatusOptions:res.data, | |||
| 'form.assetStatus':res.data[0].dictValue | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| //获取单位 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'fixed_assets_unit', {method:'GET'}, { | |||
| success: (res) => { | |||
| if(res.data.length>0){ | |||
| that.setData({ | |||
| unitOptions:res.data, | |||
| 'form.unit':res.data[0].dictValue | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| //获取是否 | |||
| UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'sys_yes_no', {method:'GET'}, { | |||
| success: (res) => { | |||
| if(res.data.length>0){ | |||
| that.setData({ | |||
| sysYesNoOptions:res.data, | |||
| 'form.isMin':res.data[0].dictValue, | |||
| 'form.isFormAsset':res.data[0].dictValue | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面初次渲染完成 | |||
| */ | |||
| onReady() { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面显示 | |||
| */ | |||
| onShow() { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面隐藏 | |||
| */ | |||
| onHide() { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面卸载 | |||
| */ | |||
| onUnload() { | |||
| }, | |||
| /** | |||
| * 页面相关事件处理函数--监听用户下拉动作 | |||
| */ | |||
| onPullDownRefresh() { | |||
| }, | |||
| /** | |||
| * 页面上拉触底事件的处理函数 | |||
| */ | |||
| onReachBottom() { | |||
| }, | |||
| /** | |||
| * 用户点击右上角分享 | |||
| */ | |||
| onShareAppMessage() { | |||
| } | |||
| }) | |||
| @@ -0,0 +1,10 @@ | |||
| { | |||
| "navigationStyle": "custom", | |||
| "usingComponents": { | |||
| "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-icon":"@vant/weapp/icon/index" | |||
| } | |||
| } | |||
| @@ -0,0 +1,280 @@ | |||
| <!--pages/contract/add/add.wxml--> | |||
| <view class="ns" style="height:{{isIPX?'88px':'64px'}};"> | |||
| <image src="../../../image/apply/back.png" style="top:{{isIPX?'54px':'30px'}};height: 19.0909px;" mode="widthFix" bindtap="back" referrer="no-referrer|origin|unsafe-url"></image> | |||
| <text style="top:{{isIPX?'54px':'30px'}};">{{form.id?"":"新增"}}资产信息</text> | |||
| </view> | |||
| <view class="main-box table-box" style="margin-top:{{isIPX?'100px':'75px'}};"> | |||
| <view style="margin-bottom:15px;"> | |||
| <image src="../../../image/icon/fixed_contract_icon.png" referrer="no-referrer|origin|unsafe-url" style="width: 15px;height: 15px;margin-right: 10px;"></image> | |||
| <text class="tit">基本信息</text> | |||
| </view> | |||
| <view class="table-boxs"> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 10rpx;">*</text>资产编码</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.code}}" bindinput="bindNewInput" disabled="true" data-name="form.code" placeholder="资产编码" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 10rpx;">*</text>资产名称</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.name}}" bindinput="bindNewInput" disabled="true" data-name="form.name" placeholder="资产名称" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| <view class="section"> | |||
| <view class="section__title"><text style="color:red;margin-right: 10rpx;">*</text>资产类别</view> | |||
| <picker bindchange="onConfirmAssetType" value="{{assetTypeindex}}" disabled="true" range="{{assetTypeOptions}}" range-key="{{'dictLabel'}}"> | |||
| <view class="picker"> | |||
| {{assetTypeOptions[assetTypeindex].dictLabel?assetTypeOptions[assetTypeindex].dictLabel:"选择资产类别"}} | |||
| <van-icon name="arrow-down" /> | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <view class="section"> | |||
| <view class="section__title"><text style="color:red;margin-right: 10rpx;">*</text>变更类型</view> | |||
| <picker bindchange="onConfirmChangeType" value="{{changeTypeindex}}" range="{{changeTypeOptions}}" range-key="{{'dictLabel'}}"> | |||
| <view class="picker"> | |||
| {{changeTypeOptions[changeTypeindex].dictLabel?changeTypeOptions[changeTypeindex].dictLabel:"选择变更类型"}} | |||
| <van-icon name="arrow-down" /> | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <view class="main-box table-box" style="margin-top:15px;" wx:if="{{changeTypeindex == 0}}"> | |||
| <view style="margin-bottom:15px;"> | |||
| <image src="../../../image/icon/target_icon.png" style="width: 15px;height: 15px;margin-right: 10px;" referrer="nor-referrer|origin|unsafe-url"></image> | |||
| <text class="tit">变更信息</text> | |||
| </view> | |||
| <view class="table-boxs"> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>数量/面积</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.quantity}}" bindinput="bindNewInput" disabled="true" placeholder="" data-name="form.quantity" type="digit" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>变更后</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.changeValue}}" bindinput="bindNewInput" placeholder="变更后数据" data-name="form.changeValue" type="digit" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>备注</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.remark}}" bindinput="bindNewInput" data-name="form.remark" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <view class="main-box table-box" style="margin-top:15px;" wx:if="{{changeTypeindex == 1}}"> | |||
| <view style="margin-bottom:15px;"> | |||
| <image src="../../../image/icon/target_icon.png" style="width: 15px;height: 15px;margin-right: 10px;" referrer="nor-referrer|origin|unsafe-url"></image> | |||
| <text class="tit">变更信息</text> | |||
| </view> | |||
| <view class="table-boxs"> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>资产原值</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.originalValue}}" disabled="true" bindinput="bindNewInput" placeholder="" data-name="form.originalValue" type="digit" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>变更后</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.changeValue}}" bindinput="bindNewInput" placeholder="变更后数据" data-name="form.changeValue" type="digit" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>备注</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.remark}}" bindinput="bindNewInput" data-name="form.remark" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <view class="main-box table-box" style="margin-top:15px;" wx:if="{{changeTypeindex == 2}}"> | |||
| <view style="margin-bottom:15px;"> | |||
| <image src="../../../image/icon/target_icon.png" style="width: 15px;height: 15px;margin-right: 10px;" referrer="nor-referrer|origin|unsafe-url"></image> | |||
| <text class="tit">变更信息</text> | |||
| </view> | |||
| <view class="table-boxs"> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>预计使用年数</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.expectedYears}}" disabled="true" bindinput="bindNewInput" placeholder="" data-name="form.expectedYears" type="digit" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>变更后</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.changeValue}}" bindinput="bindNewInput" placeholder="变更后数据" data-name="form.changeValue" type="digit" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>备注</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.remark}}" bindinput="bindNewInput" data-name="form.remark" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <view class="main-box table-box" style="margin-top:15px;" wx:if="{{changeTypeindex == 3}}"> | |||
| <view style="margin-bottom:15px;"> | |||
| <image src="../../../image/icon/target_icon.png" style="width: 15px;height: 15px;margin-right: 10px;" referrer="nor-referrer|origin|unsafe-url"></image> | |||
| <text class="tit">变更信息</text> | |||
| </view> | |||
| <view class="table-boxs"> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>累计折旧</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.depreciationValue}}" disabled="true" bindinput="bindNewInput" placeholder="" data-name="form.depreciationValue" type="digit" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>变更后</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.changeValue}}" bindinput="bindNewInput" placeholder="变更后数据" data-name="form.changeValue" type="digit" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>备注</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.remark}}" bindinput="bindNewInput" data-name="form.remark" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <view class="main-box table-box" style="margin-top:15px;" wx:if="{{changeTypeindex == 4}}"> | |||
| <view style="margin-bottom:15px;"> | |||
| <image src="../../../image/icon/target_icon.png" style="width: 15px;height: 15px;margin-right: 10px;" referrer="nor-referrer|origin|unsafe-url"></image> | |||
| <text class="tit">变更信息</text> | |||
| </view> | |||
| <view class="table-boxs"> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>已折旧年数</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.depreciationYears}}" disabled="true" bindinput="bindNewInput" placeholder="" data-name="form.depreciationYears" type="digit" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>变更后</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.changeValue}}" bindinput="bindNewInput" placeholder="变更后数据" data-name="form.changeValue" type="digit" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>备注</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.remark}}" bindinput="bindNewInput" data-name="form.remark" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <view class="main-box table-box" style="margin-top:15px;" wx:if="{{changeTypeindex == 5}}"> | |||
| <view style="margin-bottom:15px;"> | |||
| <image src="../../../image/icon/target_icon.png" style="width: 15px;height: 15px;margin-right: 10px;" referrer="nor-referrer|origin|unsafe-url"></image> | |||
| <text class="tit">变更信息</text> | |||
| </view> | |||
| <view class="table-boxs"> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>残值率</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.residualsRate}}" disabled="true" bindinput="bindNewInput" placeholder="" data-name="form.residualsRate" type="digit" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>变更后</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.changeValue}}" bindinput="bindNewInput" placeholder="变更后数据" data-name="form.changeValue" type="digit" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>备注</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.remark}}" bindinput="bindNewInput" data-name="form.remark" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <view class="main-box table-box" style="margin-top:15px;" wx:if="{{changeTypeindex == 6}}"> | |||
| <view style="margin-bottom:15px;"> | |||
| <image src="../../../image/icon/target_icon.png" style="width: 15px;height: 15px;margin-right: 10px;" referrer="nor-referrer|origin|unsafe-url"></image> | |||
| <text class="tit">变更信息</text> | |||
| </view> | |||
| <view class="table-boxs"> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>折旧方式</text> | |||
| </view> | |||
| <picker bindchange="onConfirmDepreciationType" disabled="true" value="{{depreciationTypeindex}}" range="{{depreciationTypeOptions}}" range-key="{{'dictLabel'}}"> | |||
| <view class="picker"> | |||
| {{depreciationTypeOptions[depreciationTypeindex].dictLabel?depreciationTypeOptions[depreciationTypeindex].dictLabel:"选择折旧方式"}} | |||
| <van-icon name="arrow-down" /> | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>变更后</text> | |||
| </view> | |||
| <picker bindchange="onConfirmChangeValue" value="{{changeValueindex}}" range="{{depreciationTypeOptions}}" range-key="{{'dictLabel'}}"> | |||
| <view class="picker"> | |||
| {{depreciationTypeOptions[changeValueindex].dictLabel?depreciationTypeOptions[changeValueindex].dictLabel:"选择折旧方式"}} | |||
| <van-icon name="arrow-down" /> | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <view> | |||
| <view> | |||
| <text><text style="color:red;margin-right: 22rpx;"></text>备注</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" value="{{form.remark}}" bindinput="bindNewInput" data-name="form.remark" style="text-align: right;margin-top: 20rpx;" /> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <view class="bottom"> | |||
| <view class="btn2" bindtap="goSubmit">保存</view> | |||
| </view> | |||
| @@ -0,0 +1,69 @@ | |||
| /* pages/payee/add/add.wxss */ | |||
| .main-box{ | |||
| background: #ffffff; | |||
| padding: 20px; | |||
| width: 94%; | |||
| margin: 0 auto; | |||
| border-radius: 10px; | |||
| box-shadow: 0px 5px 5px rgba(0, 0, 0, 0.16); | |||
| } | |||
| .table-box van-field van-cell .van-cell{ | |||
| margin-bottom: 15px; | |||
| } | |||
| .table-box van-field:last-child van-cell .van-cell{ | |||
| margin-bottom: 0px; | |||
| } | |||
| .van-cell{ | |||
| padding: 0!important; | |||
| margin-bottom: 15px; | |||
| } | |||
| .van-cell__value { | |||
| display: flex; | |||
| justify-content: flex-end; | |||
| } | |||
| .van-radio--horizontal { | |||
| margin-right: 0!important; | |||
| margin-left: var(--padding-sm,12px) | |||
| } | |||
| .van-cell--required:before { | |||
| left: 0!important; | |||
| } | |||
| .van-field__label { | |||
| padding-left: 10px; | |||
| } | |||
| .tit{ | |||
| line-height: 20px; | |||
| font-size: 16px; | |||
| font-weight: bold; | |||
| } | |||
| .bottom{ | |||
| width: 100%; | |||
| margin: 0 auto; | |||
| text-align: center; | |||
| margin-top: 30px; | |||
| margin-bottom: 30px; | |||
| display: flex; | |||
| } | |||
| .bottom view { | |||
| width: 47%; | |||
| margin: 0 auto; | |||
| border-radius: 30px; | |||
| display: inline-block; | |||
| } | |||
| .bottom .btn2{ | |||
| border: 1px solid transparent; | |||
| padding: 8px 0px; | |||
| background-image: linear-gradient(to right, #2C8E68, #5CAE77); | |||
| color: #fff; | |||
| } | |||
| .table-boxs>view{ | |||
| display: flex; | |||
| justify-content: space-between; | |||
| line-height: 80rpx; | |||
| } | |||
| .table-box text{ | |||
| line-height: 80rpx; | |||
| } | |||
| @@ -159,6 +159,57 @@ Page({ | |||
| url: '/pages/fixedAssets/add/add?id='+e.currentTarget.dataset.id, | |||
| }) | |||
| }, | |||
| scrap(e){ | |||
| console.log(e.currentTarget.dataset.data.id,e.currentTarget.dataset.data.index); | |||
| if(e.currentTarget.dataset.data.assetStatus != 1){ | |||
| UTIL.showToastNoneIcon('只允许修改资产状态为正常的资产!'); | |||
| return false; | |||
| }else if(e.currentTarget.dataset.data.useType == 3){ | |||
| UTIL.showToastNoneIcon('使用状态为出租或出借不允许操作!'); | |||
| return false; | |||
| }else{ | |||
| UTIL.httpRequest(API.URL_GET_UPDATERSCRAP + e.currentTarget.dataset.data.id , {method:'GET'}, { | |||
| success: (res) => { | |||
| if(res.code==200){ | |||
| let new_list = this.data.list | |||
| new_list.splice(e.currentTarget.dataset.data.index,1) | |||
| this.setData({'list':new_list}) | |||
| UTIL.showToastNoneIcon('报废成功!'); | |||
| }else{ | |||
| UTIL.showToastNoneIcon('报废失败!:'+res.msg); | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| }, | |||
| sell(e){ | |||
| console.log(e.currentTarget.dataset.data.id,e.currentTarget.dataset.data.index); | |||
| if(e.currentTarget.dataset.data.assetStatus != 1){ | |||
| UTIL.showToastNoneIcon('只允许修改资产状态为正常的资产!'); | |||
| return false; | |||
| }else if(e.currentTarget.dataset.data.useType == 3){ | |||
| UTIL.showToastNoneIcon('使用状态为出租或出借不允许操作!'); | |||
| return false; | |||
| }else{ | |||
| UTIL.httpRequest(API.URL_GET_UPDATERSALE + e.currentTarget.dataset.data.id , {method:'GET'}, { | |||
| success: (res) => { | |||
| if(res.code==200){ | |||
| let new_list = this.data.list | |||
| new_list.splice(e.currentTarget.dataset.data.index,1) | |||
| this.setData({'list':new_list}) | |||
| UTIL.showToastNoneIcon('出售成功!'); | |||
| }else{ | |||
| UTIL.showToastNoneIcon('出售失败!:'+res.msg); | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| }, | |||
| change(e){ | |||
| wx.navigateTo({ | |||
| url: '/pages/fixedAssets/change/change?id='+e.currentTarget.dataset.id, | |||
| }) | |||
| }, | |||
| delete(e){ | |||
| this.setData({ | |||
| 'itemId':e.currentTarget.dataset.id, | |||
| @@ -16,7 +16,7 @@ | |||
| <view class="add_btn" bindtap="goAdd"><text>新增</text></view> | |||
| </view> | |||
| <scroll-view scroll-y refresher-threshold="0" style="height:{{scrollHeight}}px" bindscrolltolower="paging" lower-threshold="100"> | |||
| <van-swipe-cell right-width="{{ 130 }}" class="workflow" wx:for="{{list}}" wx:key="index" wx:for-item="item" > | |||
| <van-swipe-cell right-width="{{ 130 }}" left-width="{{ 90 }}" class="workflow" wx:for="{{list}}" wx:key="index" wx:for-item="item" > | |||
| <view class="li" bindtap="goUpdate" data-id="{{item.id}}"> | |||
| <view class="tit_box"> | |||
| <image src="/image/icon/fixedAssets_icon.png" style="width: 15px;height: 15px;margin-right: 10px;" referrer="no-referrer|origin|unsafe-url"></image> | |||
| @@ -46,6 +46,24 @@ | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <view slot="left" class="moreBox" > | |||
| <view style="flex: 1;height: 100%;display: flex;align-items: center;flex-direction: column;justify-content: center;background-color: rgb(165,165,165,0.2);" data-data="{{item}}" data-index="{{index}}" bindtap="scrap"> | |||
| <view> | |||
| <image src="../../image/icon/scrap_icon.png" style="width: 25px;height: 25px;margin: 0 auto;display: block;" ></image> | |||
| </view> | |||
| <view> | |||
| <text style="color:#A5A5A5">报废</text> | |||
| </view> | |||
| </view> | |||
| <view style="flex: 1;height: 100%;display: flex;align-items: center;flex-direction: column;justify-content: center;background-color: rgb(238,95,0,0.2);" data-data="{{item}}" data-index="{{index}}" bindtap="sell"> | |||
| <view> | |||
| <image src="../../image/icon/sell_icon.png" style="width: 25px;height: 25px;margin: 0 auto;display: block;" ></image> | |||
| </view> | |||
| <view> | |||
| <text style="color: rgb(238,95,0);">出售</text> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <view slot="right" class="deleteBox"> | |||
| <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);" data-id="{{item.id}}" data-index="{{index}}" bindtap="delete"> | |||
| <view> | |||
| @@ -63,6 +81,14 @@ | |||
| <text style="color: #62AD66;">附件</text> | |||
| </view> | |||
| </view> | |||
| <view style="flex: 1;height: 100%;display: flex;align-items: center;flex-direction: column;justify-content: center;background-color: rgb(239,135,7,0.2);" data-id="{{item.id}}" data-index="{{index}}" bindtap="change"> | |||
| <view> | |||
| <image src="../../image/icon/relevance_icon.png" style="width: 25px;height: 25px;margin: 0 auto;display: block;" ></image> | |||
| </view> | |||
| <view> | |||
| <text style="color: rgb(239,135,7);">变更</text> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </van-swipe-cell> | |||
| </scroll-view> | |||
| @@ -71,6 +71,14 @@ text{display: block;} | |||
| align-items: center; | |||
| display: flex; | |||
| } | |||
| .moreBox{ | |||
| width: 90px; | |||
| text-align: center; | |||
| height: 100%; | |||
| background: #F6F6F6; | |||
| align-items: center; | |||
| display: flex; | |||
| } | |||
| .workflow .workflow_list{ | |||
| height: 150rpx; | |||
| background-color: #fff; | |||
| @@ -266,6 +266,12 @@ const URL_GET_SUBJECTLIST = `${URL_PREFIX}/finance/subject/list?is_last=Y`; | |||
| //固定资产列表 | |||
| const URL_GET_PERMANENTLIST = `${URL_PREFIX}/asset/permanent/list/`; | |||
| //可关联固定资产列表 | |||
| const URL_GET_PERMANENTLISTS = `${URL_PREFIX}/asset/permanent/listContractPermanentList/`; | |||
| //可关联资源性资产列表 | |||
| const URL_GET_RESOURCELIST = `${URL_PREFIX}/asset/resource/listContractResourceList/`; | |||
| //固定资产删除 | |||
| const URL_GET_PERMANENTDELETE = `${URL_PREFIX}/asset/permanent/remove/`; | |||
| @@ -312,7 +318,41 @@ const URL_GET_UPLOADFILE = `${URL_PREFIX}/yinnong/transfer/importData`; | |||
| //下载收款人模板 | |||
| const URL_GET_DOWNFILE = `${URL_PREFIX}/yinnong/transfer/importTemplate`; | |||
| //合同终止 | |||
| const URL_GET_TERMINATEINFO = `${URL_PREFIX}/contraction/info/terminateInfo/`; | |||
| //合同撤销 | |||
| const URL_GET_CANCELINFO = `${URL_PREFIX}/contraction/info/cancelnfo/`; | |||
| //可关联合同列表 | |||
| const URL_GET_ASSETLISTALL = `${URL_PREFIX}/contraction/asset/list/`; | |||
| //固定资产变更(数量) | |||
| const URL_POST_UPDATEQUANTITY = `${URL_PREFIX}/asset/permanent/updateQuantity`; | |||
| //固定资产变更(原值) | |||
| const URL_POST_UPDATEORIGINALVALUE = `${URL_PREFIX}/asset/permanent/updateOriginalValuePermanent`; | |||
| //固定资产变更(折旧方式) | |||
| const URL_POST_UPDATEDEPRECIATIONMETHOD = `${URL_PREFIX}/asset/permanent/updateDepreciationMethod`; | |||
| //固定资产变更(预计使用年数) | |||
| const URL_POST_UPDATEEXPECTEDYEARS = `${URL_PREFIX}/asset/permanent/updateExpectedYears`; | |||
| //固定资产变更(已折旧年数) | |||
| const URL_POST_UPDATEDEPRECIATIONYEARS = `${URL_PREFIX}/asset/permanent/updateDepreciationYears`; | |||
| //固定资产变更(累计折旧) | |||
| const URL_POST_UPDATEDEPRECIATIONVALUE = `${URL_PREFIX}/asset/permanent/updateDepreciationValue`; | |||
| //固定资产变更(残值率) | |||
| const URL_POST_UPDATERESIDUALSRATE = `${URL_PREFIX}/asset/permanent/updateResidualsRate`; | |||
| //出售固定资产 | |||
| const URL_GET_UPDATERSALE = `${URL_PREFIX}/asset/permanent/updateSale/`; | |||
| //作废固定资产 | |||
| const URL_GET_UPDATESCRAP = `${URL_PREFIX}/asset/permanent/updateScrap/`; | |||
| /****************接口地址end****************/ | |||
| @@ -431,5 +471,19 @@ export { | |||
| URL_GET_PAYEEGET, | |||
| URL_GET_PAYEEREMOVE, | |||
| URL_GET_UPLOADFILE, | |||
| URL_GET_DOWNFILE | |||
| URL_GET_DOWNFILE, | |||
| URL_GET_TERMINATEINFO, | |||
| URL_GET_CANCELINFO, | |||
| URL_GET_ASSETLISTALL, | |||
| URL_GET_RESOURCELIST, | |||
| URL_GET_PERMANENTLISTS, | |||
| URL_POST_UPDATEQUANTITY, | |||
| URL_POST_UPDATEORIGINALVALUE, | |||
| URL_POST_UPDATEDEPRECIATIONMETHOD, | |||
| URL_POST_UPDATEEXPECTEDYEARS, | |||
| URL_POST_UPDATEDEPRECIATIONYEARS, | |||
| URL_POST_UPDATEDEPRECIATIONVALUE, | |||
| URL_POST_UPDATERESIDUALSRATE, | |||
| URL_GET_UPDATERSALE, | |||
| URL_GET_UPDATESCRAP | |||
| } | |||