@@ -46,6 +46,11 @@ Page({ | |||||
} | } | ||||
}) | }) | ||||
that.SRSelect(); | |||||
that.ZCSelect(); | |||||
}, | |||||
SRSelect(){ | |||||
var that = this; | |||||
//收入事项 | //收入事项 | ||||
let data = { | let data = { | ||||
pageNum:'1', | pageNum:'1', | ||||
@@ -70,6 +75,9 @@ Page({ | |||||
} | } | ||||
} | } | ||||
}) | }) | ||||
}, | |||||
ZCSelect(){ | |||||
var that = this; | |||||
//支出事项 | //支出事项 | ||||
let data2 = { | let data2 = { | ||||
pageNum:'1', | pageNum:'1', | ||||
@@ -82,7 +90,13 @@ Page({ | |||||
success: (res) => { | success: (res) => { | ||||
if (res.code == API.SUCCESS_CODE) { | if (res.code == API.SUCCESS_CODE) { | ||||
let list = res.rows; | let list = res.rows; | ||||
for (let i = 0; i < list.length; i++) { | |||||
const element = list[i]; | |||||
list[i].checkedStatusText = UTIL.getTransform(element.checkedStatus,that.data.capitalExpenditureTypeOptions); | |||||
list[i].expenditureTypeText = UTIL.getTransform(element.expenditureType,that.data.expenditureTypeOptions); | |||||
} | |||||
this.setData({ | this.setData({ | ||||
flowListZC:list, | |||||
flowListZCNum:res.total | flowListZCNum:res.total | ||||
}); | }); | ||||
} | } | ||||
@@ -236,28 +250,61 @@ Page({ | |||||
}, | }, | ||||
goSubmit(){ | goSubmit(){ | ||||
var that = this ; | var that = this ; | ||||
let url = API.URL_GET_GETBOOKKEEP | |||||
wx.request({ | |||||
url, | |||||
method:"POST", | |||||
timeout: 60000, | |||||
data:that.data.result, | |||||
header: { | |||||
'Authorization':'Bearer '+getApp().globalData.userInfo.token | |||||
}, | |||||
success: function (response) { | |||||
wx.showToast({ | |||||
title: "提交成功!", | |||||
duration: 2000, | |||||
icon:"success" | |||||
}) | |||||
setTimeout(function(){ | |||||
wx.reLaunch({ | |||||
url: '/pages/index/index' | |||||
console.log(that.data.showGroup); | |||||
if(that.data.showGroup){ | |||||
if(that.data.result.length==0){ | |||||
UTIL.showToastNoneIcon('至少选择一个收入事项!'); | |||||
return; | |||||
} | |||||
let url = API.URL_GET_GETBOOKKEEP | |||||
wx.request({ | |||||
url, | |||||
method:"POST", | |||||
timeout: 60000, | |||||
data:that.data.result, | |||||
header: { | |||||
'Authorization':'Bearer '+getApp().globalData.userInfo.token | |||||
}, | |||||
success: function (response) { | |||||
wx.showToast({ | |||||
title: "提交成功!", | |||||
duration: 2000, | |||||
icon:"success" | |||||
}) | |||||
that.setData({ | |||||
result:[] | |||||
}) | }) | ||||
},2000) | |||||
that.SRSelect(); | |||||
} | |||||
}) | |||||
}else{ | |||||
if(that.data.result2.length==0){ | |||||
UTIL.showToastNoneIcon('至少选择一个支出事项!'); | |||||
return; | |||||
} | } | ||||
}) | |||||
let url = API.URL_GET_GETBOOKKEEP | |||||
wx.request({ | |||||
url, | |||||
method:"POST", | |||||
timeout: 60000, | |||||
data:that.data.result2, | |||||
header: { | |||||
'Authorization':'Bearer '+getApp().globalData.userInfo.token | |||||
}, | |||||
success: function (response) { | |||||
wx.showToast({ | |||||
title: "提交成功!", | |||||
duration: 2000, | |||||
icon:"success" | |||||
}) | |||||
that.setData({ | |||||
result2:[] | |||||
}) | |||||
that.ZCSelect(); | |||||
} | |||||
}) | |||||
} | |||||
}, | }, | ||||
goUpdate(event){ | goUpdate(event){ | ||||
wx.navigateTo({ | wx.navigateTo({ | ||||
@@ -1,6 +1,11 @@ | |||||
// pages/apply/index.js | // pages/apply/index.js | ||||
import * as UTIL from '../../../utils/util.js'; | import * as UTIL from '../../../utils/util.js'; | ||||
import * as API from '../../../utils/API.js'; | import * as API from '../../../utils/API.js'; | ||||
let EVN_CONFIG = require('../../../env/env'); | |||||
const DISTRIBUTE_ENVIROMENT = 'IMGURL'; | |||||
let { | |||||
URL_PREFIX, | |||||
} = EVN_CONFIG[DISTRIBUTE_ENVIROMENT]; | |||||
const app = getApp(); | const app = getApp(); | ||||
Page({ | Page({ | ||||
@@ -37,6 +42,25 @@ Page({ | |||||
crzhShow:false, | crzhShow:false, | ||||
accountListOptions:[], //存入账户类型选项 | accountListOptions:[], //存入账户类型选项 | ||||
crlxShow:false, //收入类型弹窗显隐 | crlxShow:false, //收入类型弹窗显隐 | ||||
subjectOptions:[],//科目类型 | |||||
showKm:false, | |||||
fileForm:[],//上传文件列表 | |||||
fileNum:0,//附件总数 | |||||
}, | |||||
selectKM(){ | |||||
this.setData({showKm:true}) | |||||
}, | |||||
closeBoxKM(){ | |||||
this.setData({showKm:false}) | |||||
}, | |||||
onConfirmContractionKm(value){ | |||||
console.log(value); | |||||
let obj = value.detail.value; | |||||
this.setData({ | |||||
'formData.subjectNameAll':obj.subjectNameAll, | |||||
showKm:false, | |||||
'formData.subjectId':obj.subjectId, | |||||
}) | |||||
}, | }, | ||||
onCancelcrlx(){ | onCancelcrlx(){ | ||||
this.setData({crlxShow:false,}) | this.setData({crlxShow:false,}) | ||||
@@ -112,46 +136,53 @@ Page({ | |||||
* 生命周期函数--监听页面初次渲染完成 | * 生命周期函数--监听页面初次渲染完成 | ||||
*/ | */ | ||||
onLoad: function (options) { | onLoad: function (options) { | ||||
console.log(options); | |||||
var that = this; | var that = this; | ||||
that.setData({ | |||||
tableId:options.id | |||||
}) | |||||
//获取附件字典 | //获取附件字典 | ||||
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bookkeeping_type', {method:'GET'}, { | |||||
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bookkeeping_type', {method:'GET'}, {//查询附件字典 | |||||
success: (res) => { | success: (res) => { | ||||
if(res.data.length>0){ | if(res.data.length>0){ | ||||
this.setData({ | this.setData({ | ||||
uploadOptions:res.data, | uploadOptions:res.data, | ||||
}) | }) | ||||
let uploadList = res.data | let uploadList = res.data | ||||
let newList = [] | |||||
let _this = this | |||||
uploadList.map( res => { | |||||
uploadList.map( (item,index) => { | |||||
console.log(index); | |||||
let oData = { | let oData = { | ||||
tableId: id, | |||||
tableName: "t_contraction_info", //上传表 | |||||
bizPath: "contraction", | |||||
fileType: res.dictValue, //附件类型 1原始发票 2会议纪要 3会议照片 4 参会人员签字 | |||||
tableId: options.id, | |||||
fileType:index+1, | |||||
bizPath:'transfer', | |||||
tableName:'t_cashier_account_flow', | |||||
method:'GET' | method:'GET' | ||||
} | } | ||||
UTIL.httpRequest(API.URL_GET_ATTACHMENTLIST, oData, { | |||||
success: (rr) => { | |||||
console.log(rr.rows); | |||||
rr.rows.map((rrr,index) => { | |||||
rrr.url = URL_PREFIX + rrr.fileUrl | |||||
if(index==rr.rows.length-1){ | |||||
newList.push(Object.assign({},res,{"list":rr.rows})) | |||||
_this.setData({"fileList":_this.data.fileList.concat(newList)}); | |||||
_this.setData({"showUpload":true}) | |||||
} | |||||
UTIL.httpRequest( API.URL_GET_FINDLIST, oData ,{//查询每个附件字典下的附件 | |||||
success: (res2) => { | |||||
console.log(res2); | |||||
let list = []; | |||||
let fileForm = that.data.fileForm?that.data.fileForm:[]; | |||||
res2.data.forEach((item2,index2)=>{ | |||||
fileForm.push({ | |||||
file: URL_PREFIX+item2.fileUrl, | |||||
fileType:index+1, | |||||
bizPath:'transfer', | |||||
tableName:'t_cashier_account_flow', | |||||
tableId:'' | |||||
}) | |||||
list.push({ | |||||
tempFilePath:URL_PREFIX+item2.fileUrl, | |||||
id:item2.id | |||||
}) | |||||
}) | }) | ||||
}, | |||||
fail:(rr) =>{ | |||||
console.log(rr); | |||||
}, | |||||
complete:(rr) => { | |||||
console.log(rr); | |||||
that.setData({ | |||||
["uploadOptions["+index+"].Pics"]:list, | |||||
fileForm:fileForm, | |||||
fileNum:fileForm.length | |||||
}); | |||||
console.log(that.data) | |||||
} | } | ||||
}) | |||||
}) | |||||
}) | }) | ||||
} | } | ||||
} | } | ||||
@@ -189,6 +220,16 @@ Page({ | |||||
console.log(res); | console.log(res); | ||||
} | } | ||||
}) | }) | ||||
UTIL.httpRequest(API.URL_GET_SUBJECTLIST , {method:'GET'}, { | |||||
success: (res2) => { | |||||
if(res2.rows.length>0){ | |||||
that.setData({ | |||||
subjectOptions:res2.rows, | |||||
}) | |||||
} | |||||
} | |||||
}) | |||||
}, | }, | ||||
/** | /** | ||||
@@ -227,12 +268,34 @@ Page({ | |||||
}, | }, | ||||
deleteimg:function(e){ | deleteimg:function(e){ | ||||
var that = this ; | |||||
let oData = e.currentTarget.dataset; | let oData = e.currentTarget.dataset; | ||||
let file = this.data[oData.status]; | |||||
file.splice(oData.id,1) | |||||
this.setData({ | |||||
[oData.status]:file | |||||
}) | |||||
let index = oData.index | |||||
let file = that.data.fileForm; | |||||
console.log(that.data.uploadOptions[index].Pics); | |||||
for (let i = 0; i < file.length; i++) { | |||||
const element = file[i]; | |||||
if(element.file == that.data.uploadOptions[index].Pics[oData.id].tempFilePath){ | |||||
file.splice(i,1); | |||||
} | |||||
} | |||||
that.data.uploadOptions[index].Pics.splice(oData.id,1); | |||||
// let length = this.data.form.transfers[e.currentTarget.dataset.parentsindex].fileNum - 1; | |||||
this.setData({ | |||||
// ["form.transfers["+e.currentTarget.dataset.parentsindex+"].fileNum"]:length, | |||||
[oData.status]:that.data.uploadOptions[index], | |||||
fileForm:file, | |||||
fileNum:that.data.fileNum-1 | |||||
}) | |||||
UTIL.httpRequest(API.URL_GET_GETFILEREMOVE+e.currentTarget.dataset.imgid , {method:'GET'}, { | |||||
success: (res) => { | |||||
wx.showToast({ | |||||
title: '删除成功!', | |||||
icon: 'success', | |||||
duration: 2000, | |||||
}) | |||||
} | |||||
}) | |||||
}, | }, | ||||
back:function(){ | back:function(){ | ||||
wx.navigateBack({ | wx.navigateBack({ | ||||
@@ -242,7 +305,7 @@ Page({ | |||||
uploadSjPics: function (e) { //这里是选取图片的方法 | uploadSjPics: function (e) { //这里是选取图片的方法 | ||||
var that = this; | var that = this; | ||||
var detailPics = that.data.sjPics; | |||||
var detailPics = that.data.uploadOptions[e.currentTarget.dataset.index].Pics; | |||||
if (detailPics.length >= that.data.count) { | if (detailPics.length >= that.data.count) { | ||||
wx.showToast({ | wx.showToast({ | ||||
title: '最多选择' + that.data.count + '张!', | title: '最多选择' + that.data.count + '张!', | ||||
@@ -254,18 +317,25 @@ Page({ | |||||
sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有 | sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有 | ||||
sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有 | sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有 | ||||
success: function (res) { | success: function (res) { | ||||
let fileForm = that.data.sjPics | |||||
console.log(res) | |||||
let fileForm = that.data.fileForm; | |||||
let tem = that.data.uploadOptions[e.currentTarget.dataset.index].Pics?that.data.uploadOptions[e.currentTarget.dataset.index].Pics:[]; | |||||
res.tempFilePaths.forEach(item => { | res.tempFilePaths.forEach(item => { | ||||
fileForm.push({ | fileForm.push({ | ||||
file: item, | file: item, | ||||
fileType:'1', | |||||
fileType:e.currentTarget.dataset.index+1, | |||||
bizPath:'cashier', | bizPath:'cashier', | ||||
tableName:'t_cashier_account_flow', | tableName:'t_cashier_account_flow', | ||||
tableId:'' | tableId:'' | ||||
}) | }) | ||||
tem.push({ | |||||
tempFilePath:item | |||||
}) | |||||
}) | }) | ||||
that.setData({ | that.setData({ | ||||
sjPics:fileForm | |||||
['uploadOptions['+e.currentTarget.dataset.index+'].Pics']:tem, | |||||
fileForm:fileForm, | |||||
fileNum:fileForm.length | |||||
}) | }) | ||||
}, | }, | ||||
@@ -343,9 +413,6 @@ Page({ | |||||
}else if(formDataObj.accountName==''){ //存入账户 | }else if(formDataObj.accountName==''){ //存入账户 | ||||
UTIL.showToastNoneIcon('请选择存入账户!'); | UTIL.showToastNoneIcon('请选择存入账户!'); | ||||
return false; | return false; | ||||
}else if(formDataObj.billNum==''){ //单据编码 | |||||
UTIL.showToastNoneIcon('请输入单据编码!'); | |||||
return false; | |||||
}else if(formDataObj.accountSummary==''){ //备注说明 | }else if(formDataObj.accountSummary==''){ //备注说明 | ||||
UTIL.showToastNoneIcon('请输入备注说明!'); | UTIL.showToastNoneIcon('请输入备注说明!'); | ||||
return false; | return false; | ||||
@@ -26,7 +26,7 @@ | |||||
</view> | </view> | ||||
<view class="flex-block"> | <view class="flex-block"> | ||||
<text class="rules">收入金额</text> | <text class="rules">收入金额</text> | ||||
<input class="wrap" data-prop="formData.jieAmount" type="number" value="{{formData.jieAmount}}" bindinput="inputChange" placeholder="请输入收入金额"/> | |||||
<input class="wrap" data-prop="formData.jieAmount" type="digit" value="{{formData.jieAmount}}" bindinput="inputChange" placeholder="请输入收入金额"/> | |||||
</view> | </view> | ||||
<view class="flex-block"><text class="rules">存入账户</text> | <view class="flex-block"><text class="rules">存入账户</text> | ||||
@@ -75,8 +75,26 @@ | |||||
range-key="dictLabel"> | range-key="dictLabel"> | ||||
</picker> --> | </picker> --> | ||||
</van-popup> | </van-popup> | ||||
<view class="flex-block"><text class="rules">单据编码</text> <input class="wrap" type="number" bindinput="inputChange" data-prop="formData.billNum" value="{{formData.billNum}}" placeholder="请输入单据编码"/></view> | |||||
<view class="flex-block"><text class="rules">备注说明</text> <input class="wrap" type="number" bindinput="inputChange" data-prop="formData.accountSummary" placeholder="请输入备注说明" value="{{formData.accountSummary}}"/></view> | |||||
<view class="flex-block"><text class="rules no">单据编码</text> <input class="wrap" bindinput="inputChange" data-prop="formData.billNum" value="{{formData.billNum}}" placeholder="请输入单据编码"/></view> | |||||
<view class="flex-block"> | |||||
<text class="rules no">对方科目</text> | |||||
<view class="wrap" bindtap="selectKM"> | |||||
<text wx:if="{{formData.subjectNameAll==''}}" class="color-gray">请选择对方科目</text> | |||||
<text wx:else>{{formData.subjectNameAll}}</text> | |||||
</view> | |||||
<van-popup show="{{showKm}}" round position="bottom" bind:close="closeBoxKM" > | |||||
<van-picker | |||||
columns="{{subjectOptions}}" | |||||
show-toolbar | |||||
value-key="subjectNameAll" | |||||
bind:cancel="closeBoxKM" | |||||
bind:confirm="onConfirmContractionKm" | |||||
/> | |||||
</van-popup> | |||||
</view> | |||||
<view class="flex-block"><text class="rules">备注说明</text> <input class="wrap" bindinput="inputChange" data-prop="formData.accountSummary" placeholder="请输入备注说明" value="{{formData.accountSummary}}"/></view> | |||||
<view class="flex-block" wx:if="{{formData.checkedStatus == 4}}"><text class="rules">挂起原因</text> <input class="wrap" bindinput="inputChange" data-prop="formData.remark" placeholder="请输入挂起原因" value="{{formData.remark}}"/></view> | |||||
</view> | </view> | ||||
<block wx:if="{{incomeType == 2}}"> | <block wx:if="{{incomeType == 2}}"> | ||||
<view class="title"> | <view class="title"> | ||||
@@ -118,52 +136,24 @@ | |||||
<view class="van-cell-text">附件<van-tag type="danger" style="margin-left: 10px;">可拍照</van-tag></view> | <view class="van-cell-text">附件<van-tag type="danger" style="margin-left: 10px;">可拍照</van-tag></view> | ||||
</view> | </view> | ||||
<view> | <view> | ||||
<view class="van-cell-text">总数<van-tag round color="#5CAE77" plain style="margin-left: 10px;"> {{form.transfers[index].fileNum?form.transfers[index].fileNum:0}}张 </van-tag></view> | |||||
<view class="van-cell-text">总数<van-tag round color="#5CAE77" plain style="margin-left: 10px;"> {{fileNum}}张 </van-tag></view> | |||||
</view> | </view> | ||||
</van-cell> | </van-cell> | ||||
<view class="fj-box"> | <view class="fj-box"> | ||||
<view class="fj-li"> | |||||
<view class="fj-li" wx:for="{{uploadOptions}}" wx:key="index"> | |||||
<view> | <view> | ||||
<text>收\n据</text> | |||||
<text>{{item.dictLabel}}</text> | |||||
</view> | </view> | ||||
<view class="img_box"> | <view class="img_box"> | ||||
<view class="img_list" wx:for="{{sjPics}}" wx:for-index="index" wx:key="index"> | |||||
<image class="img_li" src="{{item.file}}"bindlongpress="bindlongpressimg" data-status="sjPics" bindtap="imgPreviewImage" data-id='{{index}}'></image> | |||||
<van-icon name="/image/apply/img_delete.png" data-id="{{index}}" size="20px" data-status="sjPics" bindtap="deleteimg" /> | |||||
<view class="img_list" wx:for="{{item.Pics}}" wx:for-index="childrenIndex" wx:for-item="item2" wx:key="childrenIndex"> | |||||
<image class="img_li" src="{{item2.tempFilePath}}" bindlongpress="bindlongpressimg" data-status="sjPics" bindtap="imgPreviewImage" data-id='{{childrenIndex}}'></image> | |||||
<van-icon name="/image/apply/img_delete.png" data-id="{{childrenIndex}}" data-imgid="{{item2.id}}" size="20px" data-status="uploadOptions[{{index}}]" data-index="{{index}}" bindtap="deleteimg" /> | |||||
</view> | </view> | ||||
<view class="img_list"> | <view class="img_list"> | ||||
<image class="img_li img_add" src="/image/apply/fj_upload.png" data-index="{{index}}" bindtap="uploadSjPics"></image> | <image class="img_li img_add" src="/image/apply/fj_upload.png" data-index="{{index}}" bindtap="uploadSjPics"></image> | ||||
</view> | </view> | ||||
</view> | |||||
</view> | |||||
<view class="fj-li"> | |||||
<view> | |||||
<text>发\n票</text> | |||||
</view> | |||||
<view class="img_box"> | |||||
<view class="img_list" wx:for="{{fpPics}}" wx:for-index="index" wx:key="index"> | |||||
<image class="img_li" src="{{item.file}}" data-status="fpPics" bindtap="imgPreviewImage" bindlongpress="bindlongpressimg" data-id='{{index}}'></image> | |||||
<van-icon name="/image/apply/img_delete.png" size="20px" data-id="{{index}}" data-status="fpPics" bindtap="deleteimg" /> | |||||
</view> | |||||
<view class="img_list"> | |||||
<image class="img_li img_add" src="/image/apply/fj_upload.png" data-index="{{index}}" bindtap="uploadFpPics"></image> | |||||
</view> | |||||
</view> | |||||
</view> | |||||
<view class="fj-li"> | |||||
<view> | |||||
<text>其\n他</text> | |||||
</view> | |||||
<view class="img_box"> | |||||
<view class="img_list" wx:for="{{qtPics}}" wx:for-index="index" wx:key="index"> | |||||
<image class="img_li" src="{{item.file}}" data-status="qtPics" bindtap="imgPreviewImage" bindlongpress="bindlongpressimg" data-id='{{index}}'></image> | |||||
<van-icon name="/image/apply/img_delete.png" size="20px" data-id="{{index}}" data-status="qtPics" bindtap="deleteimg" /> | |||||
</view> | |||||
<view class="img_list"> | |||||
<image class="img_li img_add" src="/image/apply/fj_upload.png" data-index="{{index}}" bindtap="uploadQtPics"></image> | |||||
</view> | |||||
</view> | |||||
</view> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
@@ -1,6 +1,11 @@ | |||||
// pages/apply/index.js | // pages/apply/index.js | ||||
import * as UTIL from '../../../utils/util.js'; | import * as UTIL from '../../../utils/util.js'; | ||||
import * as API from '../../../utils/API.js'; | import * as API from '../../../utils/API.js'; | ||||
let EVN_CONFIG = require('../../../env/env'); | |||||
const DISTRIBUTE_ENVIROMENT = 'IMGURL'; | |||||
let { | |||||
URL_PREFIX, | |||||
} = EVN_CONFIG[DISTRIBUTE_ENVIROMENT]; | |||||
const app = getApp(); | const app = getApp(); | ||||
Page({ | Page({ | ||||
@@ -38,7 +43,9 @@ Page({ | |||||
accountListOptions:[], //存入账户类型选项 | accountListOptions:[], //存入账户类型选项 | ||||
crlxShow:false, //收入类型弹窗显隐 | crlxShow:false, //收入类型弹窗显隐 | ||||
subjectOptions:[],//科目类型 | subjectOptions:[],//科目类型 | ||||
showKm:false | |||||
showKm:false, | |||||
fileForm:[],//上传文件列表 | |||||
fileNum:0,//附件总数 | |||||
}, | }, | ||||
onCancelcrlx(){ | onCancelcrlx(){ | ||||
this.setData({crlxShow:false,}) | this.setData({crlxShow:false,}) | ||||
@@ -131,6 +138,57 @@ Page({ | |||||
onLoad: function (options) { | onLoad: function (options) { | ||||
console.log(options); | console.log(options); | ||||
var that = this; | var that = this; | ||||
that.setData({ | |||||
tableId:options.id | |||||
}) | |||||
//获取附件字典 | |||||
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bookkeeping_type', {method:'GET'}, {//查询附件字典 | |||||
success: (res) => { | |||||
if(res.data.length>0){ | |||||
this.setData({ | |||||
uploadOptions:res.data, | |||||
}) | |||||
let uploadList = res.data | |||||
uploadList.map( (item,index) => { | |||||
console.log(index); | |||||
let oData = { | |||||
tableId: options.id, | |||||
fileType:index+1, | |||||
bizPath:'transfer', | |||||
tableName:'t_cashier_account_flow', | |||||
method:'GET' | |||||
} | |||||
UTIL.httpRequest( API.URL_GET_FINDLIST, oData ,{//查询每个附件字典下的附件 | |||||
success: (res2) => { | |||||
console.log(res2); | |||||
let list = []; | |||||
let fileForm = that.data.fileForm?that.data.fileForm:[]; | |||||
res2.data.forEach((item2,index2)=>{ | |||||
fileForm.push({ | |||||
file: URL_PREFIX+item2.fileUrl, | |||||
fileType:index+1, | |||||
bizPath:'transfer', | |||||
tableName:'t_cashier_account_flow', | |||||
tableId:'' | |||||
}) | |||||
list.push({ | |||||
tempFilePath:URL_PREFIX+item2.fileUrl, | |||||
id:item2.id | |||||
}) | |||||
}) | |||||
that.setData({ | |||||
["uploadOptions["+index+"].Pics"]:list, | |||||
fileForm:fileForm, | |||||
fileNum:fileForm.length | |||||
}); | |||||
console.log(that.data) | |||||
} | |||||
}) | |||||
}) | |||||
} | |||||
} | |||||
}) | |||||
//查询收入详情 | //查询收入详情 | ||||
UTIL.httpRequest(API.URL_GET_FLOWGET + options.id , {method:'GET'}, { | UTIL.httpRequest(API.URL_GET_FLOWGET + options.id , {method:'GET'}, { | ||||
success: (res) => { | success: (res) => { | ||||
@@ -201,12 +259,35 @@ Page({ | |||||
}, | }, | ||||
deleteimg:function(e){ | deleteimg:function(e){ | ||||
var that = this ; | |||||
let oData = e.currentTarget.dataset; | let oData = e.currentTarget.dataset; | ||||
let file = this.data[oData.status]; | |||||
file.splice(oData.id,1) | |||||
this.setData({ | |||||
[oData.status]:file | |||||
}) | |||||
let index = oData.index | |||||
let file = that.data.fileForm; | |||||
console.log(that.data.uploadOptions[index].Pics); | |||||
for (let i = 0; i < file.length; i++) { | |||||
const element = file[i]; | |||||
if(element.file == that.data.uploadOptions[index].Pics[oData.id].tempFilePath){ | |||||
file.splice(i,1); | |||||
} | |||||
} | |||||
that.data.uploadOptions[index].Pics.splice(oData.id,1); | |||||
// let length = this.data.form.transfers[e.currentTarget.dataset.parentsindex].fileNum - 1; | |||||
this.setData({ | |||||
// ["form.transfers["+e.currentTarget.dataset.parentsindex+"].fileNum"]:length, | |||||
[oData.status]:that.data.uploadOptions[index], | |||||
fileForm:file, | |||||
fileNum:that.data.fileNum-1 | |||||
}) | |||||
UTIL.httpRequest(API.URL_GET_GETFILEREMOVE+e.currentTarget.dataset.imgid , {method:'GET'}, { | |||||
success: (res) => { | |||||
wx.showToast({ | |||||
title: '删除成功!', | |||||
icon: 'success', | |||||
duration: 2000, | |||||
}) | |||||
} | |||||
}) | |||||
}, | }, | ||||
back:function(){ | back:function(){ | ||||
wx.navigateBack({ | wx.navigateBack({ | ||||
@@ -216,7 +297,7 @@ Page({ | |||||
uploadSjPics: function (e) { //这里是选取图片的方法 | uploadSjPics: function (e) { //这里是选取图片的方法 | ||||
var that = this; | var that = this; | ||||
var detailPics = that.data.sjPics; | |||||
var detailPics = that.data.uploadOptions[e.currentTarget.dataset.index].Pics; | |||||
if (detailPics.length >= that.data.count) { | if (detailPics.length >= that.data.count) { | ||||
wx.showToast({ | wx.showToast({ | ||||
title: '最多选择' + that.data.count + '张!', | title: '最多选择' + that.data.count + '张!', | ||||
@@ -228,18 +309,25 @@ Page({ | |||||
sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有 | sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有 | ||||
sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有 | sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有 | ||||
success: function (res) { | success: function (res) { | ||||
let fileForm = that.data.sjPics | |||||
console.log(res) | |||||
let fileForm = that.data.fileForm; | |||||
let tem = that.data.uploadOptions[e.currentTarget.dataset.index].Pics?that.data.uploadOptions[e.currentTarget.dataset.index].Pics:[]; | |||||
res.tempFilePaths.forEach(item => { | res.tempFilePaths.forEach(item => { | ||||
fileForm.push({ | fileForm.push({ | ||||
file: item, | file: item, | ||||
fileType:'1', | |||||
fileType:e.currentTarget.dataset.index+1, | |||||
bizPath:'cashier', | bizPath:'cashier', | ||||
tableName:'t_cashier_account_flow', | tableName:'t_cashier_account_flow', | ||||
tableId:'' | tableId:'' | ||||
}) | }) | ||||
tem.push({ | |||||
tempFilePath:item | |||||
}) | |||||
}) | }) | ||||
that.setData({ | that.setData({ | ||||
sjPics:fileForm | |||||
['uploadOptions['+e.currentTarget.dataset.index+'].Pics']:tem, | |||||
fileForm:fileForm, | |||||
fileNum:fileForm.length | |||||
}) | }) | ||||
}, | }, | ||||
@@ -309,6 +397,7 @@ Page({ | |||||
}, | }, | ||||
swichAccounting:function(e){ | swichAccounting:function(e){ | ||||
var that = this; | |||||
let codeStr = e.currentTarget.dataset.code; | let codeStr = e.currentTarget.dataset.code; | ||||
let formDataObj = this.data.formData; | let formDataObj = this.data.formData; | ||||
if(formDataObj.jieAmount==''){ //收入金额 | if(formDataObj.jieAmount==''){ //收入金额 | ||||
@@ -317,23 +406,26 @@ Page({ | |||||
}else if(formDataObj.accountName==''){ //存入账户 | }else if(formDataObj.accountName==''){ //存入账户 | ||||
UTIL.showToastNoneIcon('请选择存入账户!'); | UTIL.showToastNoneIcon('请选择存入账户!'); | ||||
return false; | return false; | ||||
}else if(formDataObj.billNum==''){ //单据编码 | |||||
UTIL.showToastNoneIcon('请输入单据编码!'); | |||||
return false; | |||||
}else if(formDataObj.accountSummary==''){ //备注说明 | }else if(formDataObj.accountSummary==''){ //备注说明 | ||||
UTIL.showToastNoneIcon('请输入备注说明!'); | UTIL.showToastNoneIcon('请输入备注说明!'); | ||||
return false; | return false; | ||||
}else if(formDataObj.incomeType == '2' && formDataObj.contractionId==''){ | |||||
UTIL.showToastNoneIcon('收入类型为发包收入,必须选择关联合同!'); | |||||
return false; | |||||
} | } | ||||
let data = this.data.formData; | let data = this.data.formData; | ||||
data.method = "POST"; | data.method = "POST"; | ||||
data.checkedStatus = codeStr; | data.checkedStatus = codeStr; | ||||
console.log(data); | console.log(data); | ||||
console.log(that.data.fileForm); | |||||
UTIL.httpRequest(API.URL_POST_GERFLOWEDIT,data,{ | UTIL.httpRequest(API.URL_POST_GERFLOWEDIT,data,{ | ||||
success: (res) => { | success: (res) => { | ||||
if(res.code == 200){ | if(res.code == 200){ | ||||
let vouerId = res.data; | |||||
let vouerId = that.data.tableId; | |||||
// let vouerId = 1; | // let vouerId = 1; | ||||
let updataList = [...this.data.sjPics,...this.data.fpPics,...this.data.qtPics]; | |||||
// let updataList = [...this.data.sjPics,...this.data.fpPics,...this.data.qtPics]; | |||||
let updataList = that.data.fileForm; | |||||
console.log(updataList); | |||||
for(let i=0; i<updataList.length; i++){ | for(let i=0; i<updataList.length; i++){ | ||||
let arrData=updataList[i]; | let arrData=updataList[i]; | ||||
arrData.tableId = vouerId; | arrData.tableId = vouerId; | ||||
@@ -351,7 +443,7 @@ Page({ | |||||
console.log(response); | console.log(response); | ||||
}, | }, | ||||
fail(res){ | fail(res){ | ||||
console.log(response) | |||||
// console.log(response) | |||||
} | } | ||||
}) | }) | ||||
} | } | ||||
@@ -26,7 +26,7 @@ | |||||
</view> | </view> | ||||
<view class="flex-block"> | <view class="flex-block"> | ||||
<text class="rules">支出金额</text> | <text class="rules">支出金额</text> | ||||
<input class="wrap" data-prop="formData.jieAmount" type="number" value="{{formData.daiAmount}}" bindinput="inputChange" placeholder="请输入收入金额"/> | |||||
<input class="wrap" data-prop="formData.jieAmount" type="digit" value="{{formData.daiAmount}}" bindinput="inputChange" placeholder="请输入收入金额"/> | |||||
</view> | </view> | ||||
<view class="flex-block"><text class="rules">账户名称</text> | <view class="flex-block"><text class="rules">账户名称</text> | ||||
@@ -75,10 +75,10 @@ | |||||
range-key="dictLabel"> | range-key="dictLabel"> | ||||
</picker> --> | </picker> --> | ||||
</van-popup> | </van-popup> | ||||
<view class="flex-block"><text class="rules">单据编码</text> <input class="wrap" type="number" bindinput="inputChange" data-prop="formData.billNum" value="{{formData.billNum}}" placeholder="请输入单据编码"/></view> | |||||
<view class="flex-block"><text class="rules no">单据编码</text> <input class="wrap" bindinput="inputChange" data-prop="formData.billNum" value="{{formData.billNum}}" placeholder="请输入单据编码"/></view> | |||||
<view class="flex-block"> | <view class="flex-block"> | ||||
<text class="rules">对方科目</text> | |||||
<text class="rules no">对方科目</text> | |||||
<view class="wrap" bindtap="selectKM"> | <view class="wrap" bindtap="selectKM"> | ||||
<text wx:if="{{formData.subjectNameAll==''}}" class="color-gray">请选择对方科目</text> | <text wx:if="{{formData.subjectNameAll==''}}" class="color-gray">请选择对方科目</text> | ||||
<text wx:else>{{formData.subjectNameAll}}</text> | <text wx:else>{{formData.subjectNameAll}}</text> | ||||
@@ -96,7 +96,7 @@ | |||||
</view> | </view> | ||||
<view class="flex-block"><text class="rules">备注说明</text> <input class="wrap" bindinput="inputChange" data-prop="formData.accountSummary" placeholder="请输入备注说明" value="{{formData.accountSummary}}"/></view> | <view class="flex-block"><text class="rules">备注说明</text> <input class="wrap" bindinput="inputChange" data-prop="formData.accountSummary" placeholder="请输入备注说明" value="{{formData.accountSummary}}"/></view> | ||||
<view class="flex-block"><text class="rules">挂起原因</text> <input class="wrap" bindinput="inputChange" data-prop="formData.accountSummary" placeholder="请输入挂起原因" value="{{formData.remark}}" wx:if="{{formData.checkedStatus == 4}}"/></view> | |||||
<view class="flex-block" wx:if="{{formData.checkedStatus == 4}}"><text class="rules">挂起原因</text> <input class="wrap" bindinput="inputChange" data-prop="formData.remark" placeholder="请输入挂起原因" value="{{formData.remark}}"/></view> | |||||
</view> | </view> | ||||
<block wx:if="{{incomeType == 2}}"> | <block wx:if="{{incomeType == 2}}"> | ||||
<view class="title"> | <view class="title"> | ||||
@@ -138,25 +138,26 @@ | |||||
<view class="van-cell-text">附件<van-tag type="danger" style="margin-left: 10px;">可拍照</van-tag></view> | <view class="van-cell-text">附件<van-tag type="danger" style="margin-left: 10px;">可拍照</van-tag></view> | ||||
</view> | </view> | ||||
<view> | <view> | ||||
<view class="van-cell-text">总数<van-tag round color="#5CAE77" plain style="margin-left: 10px;"> {{form.transfers[index].fileNum?form.transfers[index].fileNum:0}}张 </van-tag></view> | |||||
<view class="van-cell-text">总数<van-tag round color="#5CAE77" plain style="margin-left: 10px;"> {{fileNum}}张 </van-tag></view> | |||||
</view> | </view> | ||||
</van-cell> | </van-cell> | ||||
<view class="fj-box"> | <view class="fj-box"> | ||||
<view class="fj-li"> | |||||
<view class="fj-li" wx:for="{{uploadOptions}}" wx:key="index"> | |||||
<view> | <view> | ||||
<text>收\n据</text> | |||||
<text>{{item.dictLabel}}</text> | |||||
</view> | </view> | ||||
<view class="img_box"> | <view class="img_box"> | ||||
<view class="img_list" wx:for="{{sjPics}}" wx:for-index="index" wx:key="index"> | |||||
<image class="img_li" src="{{item.file}}"bindlongpress="bindlongpressimg" data-status="sjPics" bindtap="imgPreviewImage" data-id='{{index}}'></image> | |||||
<van-icon name="/image/apply/img_delete.png" data-id="{{index}}" size="20px" data-status="sjPics" bindtap="deleteimg" /> | |||||
<view class="img_list" wx:for="{{item.Pics}}" wx:for-index="childrenIndex" wx:for-item="item2" wx:key="childrenIndex"> | |||||
<image class="img_li" src="{{item2.tempFilePath}}" bindlongpress="bindlongpressimg" data-status="sjPics" bindtap="imgPreviewImage" data-id='{{childrenIndex}}'></image> | |||||
<van-icon name="/image/apply/img_delete.png" data-id="{{childrenIndex}}" data-imgid="{{item2.id}}" size="20px" data-status="uploadOptions[{{index}}]" data-index="{{index}}" bindtap="deleteimg" /> | |||||
</view> | </view> | ||||
<view class="img_list"> | <view class="img_list"> | ||||
<image class="img_li img_add" src="/image/apply/fj_upload.png" data-index="{{index}}" bindtap="uploadSjPics"></image> | <image class="img_li img_add" src="/image/apply/fj_upload.png" data-index="{{index}}" bindtap="uploadSjPics"></image> | ||||
</view> | </view> | ||||
</view> | |||||
</view> | |||||
</view> | </view> | ||||
<view class="fj-li"> | |||||
<!-- <view class="fj-li"> | |||||
<view> | <view> | ||||
<text>发\n票</text> | <text>发\n票</text> | ||||
</view> | </view> | ||||
@@ -184,7 +185,7 @@ | |||||
<image class="img_li img_add" src="/image/apply/fj_upload.png" data-index="{{index}}" bindtap="uploadQtPics"></image> | <image class="img_li img_add" src="/image/apply/fj_upload.png" data-index="{{index}}" bindtap="uploadQtPics"></image> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | |||||
</view> --> | |||||
</view> | </view> | ||||
<!-- <view style="margin:10px 0 5px;" class="flex-block"> | <!-- <view style="margin:10px 0 5px;" class="flex-block"> | ||||
@@ -215,11 +215,24 @@ Page({ | |||||
let data = { | let data = { | ||||
method:"GET" | method:"GET" | ||||
} | } | ||||
UTIL.httpRequest(API.URL_GET_GETINFO, {method:'GET'}, { | |||||
success: (res) => { | |||||
if (res.code == API.SUCCESS_CODE) { | |||||
that.setData({ | |||||
username:res.user.nickName, | |||||
}) | |||||
} | |||||
} | |||||
}) | |||||
UTIL.httpRequest(API.URL_GET_GETAPPROVALBYID+e.currentTarget.dataset.id, data, { | UTIL.httpRequest(API.URL_GET_GETAPPROVALBYID+e.currentTarget.dataset.id, data, { | ||||
success: (res) => { | success: (res) => { | ||||
if (res.code == API.SUCCESS_CODE) { | if (res.code == API.SUCCESS_CODE) { | ||||
let list = []; | let list = []; | ||||
res.data.map(rr => { | |||||
res.data.map((rr,index) => { | |||||
if(rr.nickName == that.data.username){ | |||||
res.data.splice(index,1); | |||||
} | |||||
list.push(rr.userId+"") | list.push(rr.userId+"") | ||||
}) | }) | ||||
this.setData({templateDetailList:res.data,result:list}); | this.setData({templateDetailList:res.data,result:list}); | ||||
@@ -240,6 +253,16 @@ Page({ | |||||
'Authorization':'Bearer '+getApp().globalData.userInfo.token | 'Authorization':'Bearer '+getApp().globalData.userInfo.token | ||||
}, | }, | ||||
success: function (response) { | success: function (response) { | ||||
console.log(e); | |||||
_this.data.templateList.splice(e.currentTarget.dataset.index, 1); | |||||
wx.showToast({ | |||||
title: '删除成功!', | |||||
icon: 'success', | |||||
duration: 2000 | |||||
}) | |||||
_this.setData({ | |||||
templateList : _this.data.templateList, | |||||
}) | |||||
_this.getApprovalItemList() | _this.getApprovalItemList() | ||||
} | } | ||||
}) | }) | ||||
@@ -100,7 +100,7 @@ | |||||
<van-cell title="{{item.name}}" bindtap='chooseTemplate' data-id="{{item.id}}"> | <van-cell title="{{item.name}}" bindtap='chooseTemplate' data-id="{{item.id}}"> | ||||
<van-icon slot="icon" name="https://636c-cloud1-8gya17a31667774d-1310628902.tcb.qcloud.la/icon_mb.png?sign=2a8bbe2cb4d4e0f28a99fddbe042d26c&t=1648620032" class="custom-icon" size="40" style="margin-right: 10px;" /> | <van-icon slot="icon" name="https://636c-cloud1-8gya17a31667774d-1310628902.tcb.qcloud.la/icon_mb.png?sign=2a8bbe2cb4d4e0f28a99fddbe042d26c&t=1648620032" class="custom-icon" size="40" style="margin-right: 10px;" /> | ||||
</van-cell> | </van-cell> | ||||
<view slot="right" class="deleteBox" bindtap='deleteTemplate' data-id="{{item.id}}"> | |||||
<view slot="right" class="deleteBox" bindtap='deleteTemplate' data-index="{{index}}" data-id="{{item.id}}"> | |||||
<image src="/image/apply/icon_delete.png" style="width: 25px;height: 25px;margin: 0 auto;"></image> | <image src="/image/apply/icon_delete.png" style="width: 25px;height: 25px;margin: 0 auto;"></image> | ||||
</view> | </view> | ||||
</van-swipe-cell> | </van-swipe-cell> | ||||
@@ -126,6 +126,15 @@ swichPaymentApply:function(e){ | |||||
method:'GET', | method:'GET', | ||||
accountType:101 | accountType:101 | ||||
} | } | ||||
var sendData3 = { | |||||
pageNum:'1', | |||||
pageSize:'100', | |||||
accountName:'', | |||||
bankAccountNumber:'', | |||||
status:'N', | |||||
method:'GET', | |||||
accountType:100 | |||||
} | |||||
UTIL.httpRequest(API.URL_GET_GETINFO, {method:'GET'}, { | UTIL.httpRequest(API.URL_GET_GETINFO, {method:'GET'}, { | ||||
success: (res) => { | success: (res) => { | ||||
if (res.code == API.SUCCESS_CODE) { | if (res.code == API.SUCCESS_CODE) { | ||||
@@ -172,6 +181,19 @@ swichPaymentApply:function(e){ | |||||
}) | }) | ||||
} | } | ||||
}) | }) | ||||
UTIL.httpRequest(API.URL_GET_ACCOUNTLIST, sendData3,{ | |||||
success: (res) => { | |||||
for (let i = 0; i < res.rows.length; i++) { | |||||
// if(res.rows[i].bankAccountNumber==null){continue;} | |||||
// res.rows[i].bankAccountNumber = res.rows[i].bankAccountNumber.replace(/(\d{4})(?=\d)/g, "$1 "); | |||||
res.rows[i].balance = parseFloat(res.rows[i].balance).toFixed(2); | |||||
console.log(res.rows[i].balance) | |||||
} | |||||
that.setData({ | |||||
accountListGWK:res.rows | |||||
}) | |||||
} | |||||
}) | |||||
}, | }, | ||||
delete(e){ | delete(e){ | ||||
console.log(e); | console.log(e); | ||||
@@ -62,9 +62,9 @@ | |||||
<!-- <van-empty wx:if="{{accountList.length == 0}}" description="暂无银行账户" /> --> | <!-- <van-empty wx:if="{{accountList.length == 0}}" description="暂无银行账户" /> --> | ||||
</van-tab> | </van-tab> | ||||
<van-tab title="公务卡"> | |||||
<!-- <van-tab title="公务卡"> | |||||
<view class="bank_box"> | |||||
<view class="bank_box" wx:for="{{accountListGWK}}" wx:key="index"> | |||||
<view class="bank_content gwk"> | <view class="bank_content gwk"> | ||||
<view class="bankName"> | <view class="bankName"> | ||||
<image src="../../image/apply/icon_GWK.png" style="width: 25px" mode="widthFix"></image> | <image src="../../image/apply/icon_GWK.png" style="width: 25px" mode="widthFix"></image> | ||||
@@ -77,8 +77,7 @@ | |||||
<view class="holder">持有人:王强</view> | <view class="holder">持有人:王强</view> | ||||
</view> | </view> | ||||
<!-- <van-empty wx:if="{{accountList.length == 0}}" description="暂无银行账户" /> --> | |||||
</van-tab> | |||||
</van-tab> --> | |||||
</van-tabs> | </van-tabs> | ||||
</view> | </view> | ||||
@@ -440,6 +440,19 @@ Page({ | |||||
applyDate: list.applyData.transfers[0].applyDate, | applyDate: list.applyData.transfers[0].applyDate, | ||||
["form.approvalItemTemplate.totalAmount"]:parseFloat(0).toFixed(2), | ["form.approvalItemTemplate.totalAmount"]:parseFloat(0).toFixed(2), | ||||
}) | }) | ||||
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, | |||||
}) | |||||
} | |||||
} | |||||
}) | |||||
wx.hideLoading(); | wx.hideLoading(); | ||||
},3000) | },3000) | ||||
}else if(options.id && options.type != 'template'){ | }else if(options.id && options.type != 'template'){ | ||||
@@ -635,6 +648,19 @@ Page({ | |||||
form:res.data, | form:res.data, | ||||
activeNames:null | activeNames:null | ||||
}) | }) | ||||
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.hideLoadingHaveMask(); | UTIL.hideLoadingHaveMask(); | ||||
} | } | ||||
@@ -662,20 +688,21 @@ Page({ | |||||
}) | }) | ||||
} | } | ||||
}) | }) | ||||
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_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, | |||||
}) | |||||
} | |||||
} | |||||
}) | |||||
}, | }, | ||||
onChangeBox(event) { | onChangeBox(event) { | ||||
console.log(event); | console.log(event); | ||||
@@ -1086,7 +1113,7 @@ Page({ | |||||
["form.transfers["+i+"].expenditureAmountTirme"]:true | ["form.transfers["+i+"].expenditureAmountTirme"]:true | ||||
}) | }) | ||||
return; | return; | ||||
}else if(element.expenditureAmount>element.payerAccount){ | |||||
}else if((element.expenditureAmount > element.payerAccount) && element.transferType == 11){ | |||||
UTIL.showToastNoneIcon('事项'+UTIL.convertToChinaNum(i+1)+'的支出金额不能超过付款账户余额!'); | UTIL.showToastNoneIcon('事项'+UTIL.convertToChinaNum(i+1)+'的支出金额不能超过付款账户余额!'); | ||||
return; | return; | ||||
} | } | ||||
@@ -32,10 +32,10 @@ | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<van-empty wx:if="{{accountList.length == 0}}" description="暂无银行账户" /> | <van-empty wx:if="{{accountList.length == 0}}" description="暂无银行账户" /> | ||||
<view class="addBtn" data-url="/pages/drawee/add/add" bindtap="navigate"> | |||||
<!-- <view class="addBtn" data-url="/pages/drawee/add/add" bindtap="navigate"> | |||||
<image src="/image/icon/icon_add.png"></image> | <image src="/image/icon/icon_add.png"></image> | ||||
<text>添加银行账户</text> | <text>添加银行账户</text> | ||||
</view> | |||||
</view> --> | |||||
</van-tab> | </van-tab> | ||||
<van-tab title="现金账户"> | <van-tab title="现金账户"> | ||||
@@ -55,17 +55,17 @@ | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="addBtn"> | |||||
<!-- <view class="addBtn"> | |||||
<image src="/image/icon/icon_add.png"></image> | <image src="/image/icon/icon_add.png"></image> | ||||
<text>添加现金账户</text> | <text>添加现金账户</text> | ||||
</view> | |||||
</view> --> | |||||
<van-empty wx:if="{{accountList.length == 0}}" description="暂无现金账户" /> | <van-empty wx:if="{{accountList.length == 0}}" description="暂无现金账户" /> | ||||
<!-- <van-empty wx:if="{{accountList.length == 0}}" description="暂无银行账户" /> --> | <!-- <van-empty wx:if="{{accountList.length == 0}}" description="暂无银行账户" /> --> | ||||
</van-tab> | </van-tab> | ||||
<van-tab title="公务卡"> | |||||
<!-- <van-tab title="公务卡"> | |||||
<view class="bank_box"> | <view class="bank_box"> | ||||
<view class="bank_content gwk"> | <view class="bank_content gwk"> | ||||
@@ -82,12 +82,12 @@ | |||||
<!-- <van-empty wx:if="{{accountList.length == 0}}" description="暂无银行账户" /> --> | <!-- <van-empty wx:if="{{accountList.length == 0}}" description="暂无银行账户" /> --> | ||||
<view class="addBtn"> | |||||
<!--<view class="addBtn"> | |||||
<image src="/image/icon/icon_add.png"></image> | <image src="/image/icon/icon_add.png"></image> | ||||
<text>添加公务卡</text> | <text>添加公务卡</text> | ||||
</view> | </view> | ||||
</van-tab> | |||||
</van-tab> --> | |||||
</van-tabs> | </van-tabs> | ||||
</view> | </view> | ||||
@@ -20,6 +20,7 @@ Page({ | |||||
accountSummary:'', //备注说明 | accountSummary:'', //备注说明 | ||||
contractionId:'', //合同编码 | contractionId:'', //合同编码 | ||||
incomeExpensesType:1, //收支类别 | incomeExpensesType:1, //收支类别 | ||||
subjectNameAll:'',//对方科目 | |||||
isBill:0 | isBill:0 | ||||
}, | }, | ||||
incomeTypeOptions:[], //收入类型选项 | incomeTypeOptions:[], //收入类型选项 | ||||
@@ -39,6 +40,23 @@ Page({ | |||||
crzhShow:false, | crzhShow:false, | ||||
accountListOptions:[], //存入账户类型选项 | accountListOptions:[], //存入账户类型选项 | ||||
crlxShow:false, //收入类型弹窗显隐 | crlxShow:false, //收入类型弹窗显隐 | ||||
subjectOptions:[],//科目类型 | |||||
showKm:false, | |||||
}, | |||||
selectKM(){ | |||||
this.setData({showKm:true}) | |||||
}, | |||||
closeBoxKM(){ | |||||
this.setData({showKm:false}) | |||||
}, | |||||
onConfirmContractionKm(value){ | |||||
console.log(value); | |||||
let obj = value.detail.value; | |||||
this.setData({ | |||||
'formData.subjectNameAll':obj.subjectNameAll, | |||||
showKm:false, | |||||
'formData.subjectId':obj.subjectId, | |||||
}) | |||||
}, | }, | ||||
onCancelcrlx(){ | onCancelcrlx(){ | ||||
this.setData({crlxShow:false,}) | this.setData({crlxShow:false,}) | ||||
@@ -152,6 +170,17 @@ Page({ | |||||
}) | }) | ||||
} | } | ||||
}) | }) | ||||
//查询对方科目 | |||||
UTIL.httpRequest(API.URL_GET_SUBJECTLIST , {method:'GET'}, { | |||||
success: (res2) => { | |||||
if(res2.rows.length>0){ | |||||
that.setData({ | |||||
subjectOptions:res2.rows, | |||||
}) | |||||
} | |||||
} | |||||
}) | |||||
}, | }, | ||||
/** | /** | ||||
* 生命周期函数--监听页面初次渲染完成 | * 生命周期函数--监听页面初次渲染完成 | ||||
@@ -284,9 +313,6 @@ Page({ | |||||
}else if(formDataObj.accountName==''){ //存入账户 | }else if(formDataObj.accountName==''){ //存入账户 | ||||
UTIL.showToastNoneIcon('请选择存入账户!'); | UTIL.showToastNoneIcon('请选择存入账户!'); | ||||
return false; | return false; | ||||
}else if(formDataObj.billNum==''){ //单据编码 | |||||
UTIL.showToastNoneIcon('请输入单据编码!'); | |||||
return false; | |||||
}else if(formDataObj.accountSummary==''){ //备注说明 | }else if(formDataObj.accountSummary==''){ //备注说明 | ||||
UTIL.showToastNoneIcon('请输入备注说明!'); | UTIL.showToastNoneIcon('请输入备注说明!'); | ||||
return false; | return false; | ||||
@@ -75,7 +75,26 @@ | |||||
range-key="dictLabel"> | range-key="dictLabel"> | ||||
</picker> --> | </picker> --> | ||||
</van-popup> | </van-popup> | ||||
<view class="flex-block"><text class="rules">单据编码</text> <input class="wrap" type="number" bindinput="inputChange" data-prop="formData.billNum" value="{{formData.billNum}}" placeholder="请输入单据编码"/></view> | |||||
<view class="flex-block"><text class="rules no">单据编码</text> <input class="wrap" type="number" bindinput="inputChange" data-prop="formData.billNum" value="{{formData.billNum}}" placeholder="请输入单据编码"/></view> | |||||
<view class="flex-block"> | |||||
<text class="rules no">对方科目</text> | |||||
<view class="wrap" bindtap="selectKM"> | |||||
<text wx:if="{{formData.subjectNameAll==''}}" class="color-gray">请选择对方科目</text> | |||||
<text wx:else>{{formData.subjectNameAll}}</text> | |||||
</view> | |||||
<van-popup show="{{showKm}}" round position="bottom" bind:close="closeBoxKM" > | |||||
<van-picker | |||||
columns="{{subjectOptions}}" | |||||
show-toolbar | |||||
value-key="subjectNameAll" | |||||
bind:cancel="closeBoxKM" | |||||
bind:confirm="onConfirmContractionKm" | |||||
/> | |||||
</van-popup> | |||||
</view> | |||||
<view class="flex-block"><text class="rules">备注说明</text> <input class="wrap" type="number" bindinput="inputChange" data-prop="formData.accountSummary" placeholder="请输入备注说明" value="{{formData.accountSummary}}"/></view> | <view class="flex-block"><text class="rules">备注说明</text> <input class="wrap" type="number" bindinput="inputChange" data-prop="formData.accountSummary" placeholder="请输入备注说明" value="{{formData.accountSummary}}"/></view> | ||||
</view> | </view> | ||||
<block wx:if="{{incomeType == 2}}"> | <block wx:if="{{incomeType == 2}}"> | ||||
@@ -179,11 +179,11 @@ Page({ | |||||
UTIL.httpRequest(API.URL_GET_PAYEEADD, that.data.form, { | UTIL.httpRequest(API.URL_GET_PAYEEADD, that.data.form, { | ||||
success: (res) => { | success: (res) => { | ||||
if (res.code == API.SUCCESS_CODE) { | if (res.code == API.SUCCESS_CODE) { | ||||
wx.hideLoading(); | |||||
wx.showToast({ | wx.showToast({ | ||||
title: "提交成功!", | title: "提交成功!", | ||||
duration: 2000, | duration: 2000, | ||||
icon:"success" | |||||
icon:"success", | |||||
mask:true | |||||
}) | }) | ||||
let pages = getCurrentPages(); | let pages = getCurrentPages(); | ||||
let currentPage = null; //当前页面 | let currentPage = null; //当前页面 | ||||
@@ -195,6 +195,7 @@ Page({ | |||||
wx.navigateBack({ | wx.navigateBack({ | ||||
delta:1 | delta:1 | ||||
}) | }) | ||||
wx.hideLoading(); | |||||
},2000) | },2000) | ||||
}else{ | }else{ | ||||
wx.hideLoading(); | wx.hideLoading(); | ||||
@@ -27,11 +27,7 @@ | |||||
use-label-slot | use-label-slot | ||||
> | > | ||||
<view slot="icon" style="margin-right: 10px;"> | <view slot="icon" style="margin-right: 10px;"> | ||||
<image wx:if="{{item.bankType == 999}}" src="/image/apply/icon_other.png" style="width: 20px;height: 20px;vertical-align: middle;"></image> | |||||
<image wx:if="{{item.bankType == 1}}" src="/image/apply/icon_icbc.png" style="width: 20px;height: 20px;vertical-align: middle;"></image> | |||||
<image wx:if="{{item.bankType == 2}}" src="/image/apply/icon_RCB.png" style="width: 20px;height: 20px;vertical-align: middle;"></image> | |||||
<image wx:if="{{item.bankType == 3}}" src="/image/apply/icon_ABC.png" style="width: 20px;height: 20px;vertical-align: middle;"></image> | |||||
<image wx:if="{{item.bankType == 4}}" src="/image/apply/icon_CCB.png" style="width: 20px;height: 20px;vertical-align: middle;"></image> | |||||
<image src="/image/apply/{{iOf.indexOf(item.bankTypeText,'中国银行') > -1 ? 'icon_icbc':iOf.indexOf(item.bankTypeText,'农商行') > -1 ? 'icon_RCB':iOf.indexOf(item.bankTypeText,'农业银行') > -1 ? 'icon_ABC':iOf.indexOf(item.bankTypeText,'建设银行') > -1 ? 'icon_CCB':'icon_other'}}.png" style="width: 20px;height: 20px;vertical-align: middle;"></image> | |||||
</view> | </view> | ||||
<view slot="title"> | <view slot="title"> | ||||
{{item.payee}} | {{item.payee}} | ||||
@@ -50,4 +46,11 @@ | |||||
</van-radio-group> | </van-radio-group> | ||||
<view class="bottom"> | <view class="bottom"> | ||||
<view class="btn2" bindtap="goSubmit">确认</view> | <view class="btn2" bindtap="goSubmit">确认</view> | ||||
</view> | |||||
</view> | |||||
<wxs module="iOf"> | |||||
var indexOf = function(name,value){ | |||||
return name.indexOf(value); | |||||
} | |||||
module.exports.indexOf = indexOf; | |||||
</wxs> |