diff --git a/image/icon/icon_no.png b/image/icon/icon_no.png new file mode 100644 index 0000000..2147546 Binary files /dev/null and b/image/icon/icon_no.png differ diff --git a/image/icon/icon_other.png b/image/icon/icon_other.png new file mode 100644 index 0000000..7c00014 Binary files /dev/null and b/image/icon/icon_other.png differ diff --git a/image/icon/icon_white.png b/image/icon/icon_white.png new file mode 100644 index 0000000..26be405 Binary files /dev/null and b/image/icon/icon_white.png differ diff --git a/image/icon/icon_yes.png b/image/icon/icon_yes.png new file mode 100644 index 0000000..023cce8 Binary files /dev/null and b/image/icon/icon_yes.png differ diff --git a/pages/Bookkeeping/update/update.js b/pages/Bookkeeping/update/update.js new file mode 100644 index 0000000..2e95361 --- /dev/null +++ b/pages/Bookkeeping/update/update.js @@ -0,0 +1,457 @@ +// pages/apply/index.js +import * as UTIL from '../../../utils/util.js'; +import * as API from '../../../utils/API.js'; +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + isIPX: app.globalData.isIPX, + bookName:'', //付款单位 + formData:{ + accountType:'', //账户类型 + accountDate:'', //收入时间 + jieAmount:'', //收入金额 + accountName:'', //存入账户 + incomeType:'', //收入类型 + billNum:'', //单据编码 + accountSummary:'', //备注说明 + contractionId:'', //合同编码 + incomeExpensesType:1, //收支类别 + isBill:0 + }, + incomeTypeOptions:[], //收入类型选项 + incomeTypeText:'222', //收入类型显示文字 + contractionOptions:[], //付款人合同信息列表接口 + showHt:false, + payerText:'', //付款人 + sjPics:[], //收据图片列表数据 + fpPics:[], //发票图片列表数据 + qtPics:[], //其他图片列表数据 + //收入时间弹窗显隐 + srShow:false, + minDate: new Date(2021, 6, 1).getTime(), + maxDate: new Date(2023, 0, 31).getTime(), + crzhShow:false, + accountListOptions:[], //存入账户类型选项 + crlxShow:false, //收入类型弹窗显隐 + }, + onCancelcrlx(){ + this.setData({crlxShow:false,}) + }, + oncrlxShow(){ this.setData({crlxShow:true})}, + onCancelcrzh(){ + this.setData({crzhShow:false}) + }, + oncrzhShow(){ this.setData({crzhShow:true})}, + onConfirmcrzh(e){ + let data = e.detail.value; + this.setData({ + crzhShow:false, + 'formData.accountName':data.accountName, + 'formData.accountId':data.id, + 'formData.accountType':data.accountType + }) + }, + onsrDate(){ + this.setData({srShow:true}) + }, + onClose(){ this.setData({srShow:false})}, + onConfirm(e){ + let data = this.getNewDate(new Date(e.detail)); + this.setData({'formData.accountDate':data}) + this.setData({srShow:false}) + }, + closeBox(){ + this.setData({showHt:false}) + }, + getNewDate(date){ + //date是传过来的时间戳,注意需为13位,10位需*1000 + //也可以不传,获取的就是当前时间 + var time = new Date(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 + }, + onConfirmContraction(value){ + let obj = value.detail.value; + this.setData({ + payerText:obj.name, + showHt:false, + 'formData.contractionId':obj.id, + contractionIdID:obj.code + }) + }, + selectContraction(){ + this.setData({showHt:true}) + }, + bindPickerChange (e) { + let obj = e.detail.value; + this.setData({ + crlxShow:false, + 'formData.incomeType':obj.dictValue, + incomeTypeText:obj.dictLabel + }) + }, + inputChange(e){ + this.setData({ + [e.currentTarget.dataset.prop]: e.detail.value + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onShow: function () { + + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onLoad: function (options) { + console.log(options); + var that = this; + //获取附件字典 + 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 + let newList = [] + let _this = this + uploadList.map( res => { + let oData = { + tableId: id, + tableName: "t_contraction_info", //上传表 + bizPath: "contraction", + fileType: res.dictValue, //附件类型 1原始发票 2会议纪要 3会议照片 4 参会人员签字 + 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}) + } + }) + + }, + fail:(rr) =>{ + console.log(rr); + }, + complete:(rr) => { + console.log(rr); + } + }) + }) + } + } + }) + + //查询收入详情 + UTIL.httpRequest(API.URL_GET_FLOWGET + options.id , {method:'GET'}, { + success: (res) => { + if(res.data.incomeType == 2){ + UTIL.httpRequest(API.URL_GET_INFOGET + res.data.contractionId , {method:'GET'}, { + success: (res3) => { + that.setData({ + contractionIdID:res3.data.code, + payerText:res3.data.name, + }) + } + }) + } + + //获取收入类型状态 + UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'income_type', {method:'GET'}, { + success: (res2) => { + if(res2.data.length>0){ + that.setData({ + incomeTypeOptions:res2.data, + }) + that.setData({ + formData:res.data, + contractionIdID:res.data.code, + incomeTypeText:UTIL.getTransform(res.data.incomeType,res2.data) + }) + } + } + }) + console.log(res); + } + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onReady: function () { + let that = this; + + //获取收入单位 + UTIL.httpRequest(API.URL_GET_GETINFO, {method:'GET'}, { + success: (res) => { + if (res.code == API.SUCCESS_CODE) { + this.setData({bookName:res.user.bookName}) + } + } + }) + + + // 获取合同信息列表 + UTIL.httpRequest(API.URL_GET_CONTRACTIONLIST , {method:'GET'}, { + success: (res) => { + that.setData({ + contractionOptions:res.rows, + }) + } + }) + + //获取当前账套付款账户列表 + UTIL.httpRequest(API.URL_GET_ACCOUNTLIST , {method:'GET'}, { + success: (res) => { + that.setData({ + accountListOptions:res.rows, + }) + } + }) + }, + + deleteimg:function(e){ + let oData = e.currentTarget.dataset; + let file = this.data[oData.status]; + file.splice(oData.id,1) + this.setData({ + [oData.status]:file + }) + }, + back:function(){ + wx.navigateBack({ + delta: 1 + }) + }, + + uploadSjPics: function (e) { //这里是选取图片的方法 + var that = this; + var detailPics = that.data.sjPics; + if (detailPics.length >= that.data.count) { + wx.showToast({ + title: '最多选择' + that.data.count + '张!', + }) + return; + } + wx.chooseImage({ + count: that.data.count, // 最多可以选择的图片张数,默认9 + sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有 + sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有 + success: function (res) { + let fileForm = that.data.sjPics + res.tempFilePaths.forEach(item => { + fileForm.push({ + file: item, + fileType:'1', + bizPath:'cashier', + tableName:'t_cashier_account_flow', + tableId:'' + }) + }) + that.setData({ + sjPics:fileForm + }) + + }, + }) + }, + uploadFpPics: function (e) { //这里是选取图片的方法 + var that = this; + var pics = []; + var detailPics = that.data.fpPics; + if (detailPics.length >= that.data.count) { + wx.showToast({ + title: '最多选择' + that.data.count + '张!', + }) + return; + } + wx.chooseImage({ + count: that.data.count, // 最多可以选择的图片张数,默认9 + sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有 + sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有 + success: function (res) { + let fileForm = that.data.fpPics + res.tempFilePaths.forEach(item => { + fileForm.push({ + file: item, + fileType:'2', + bizPath:'cashier', + tableName:'t_cashier_account_flow', + tableId:'' + }) + }) + that.setData({ + fpPics:fileForm + }) + }, + }) + }, + uploadQtPics: function (e) { //这里是选取图片的方法 + var that = this; + var pics = []; + var detailPics = that.data.qtPics; + if (detailPics.length >= that.data.count) { + wx.showToast({ + title: '最多选择' + that.data.count + '张!', + }) + return; + } + wx.chooseImage({ + count: that.data.count, // 最多可以选择的图片张数,默认9 + sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有 + sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有 + success: function (res) { + let fileForm = that.data.qtPics + res.tempFilePaths.forEach(item => { + fileForm.push({ + file: item, + fileType:'3', + bizPath:'cashier', + tableName:'t_cashier_account_flow', + tableId:'' + }) + }) + that.setData({ + qtPics:fileForm + }) + }, + }) + }, + + swichAccounting:function(e){ + let codeStr = e.currentTarget.dataset.code; + let formDataObj = this.data.formData; + if(formDataObj.jieAmount==''){ //收入金额 + UTIL.showToastNoneIcon('请填写收入金额!'); + return false; + }else if(formDataObj.accountName==''){ //存入账户 + UTIL.showToastNoneIcon('请选择存入账户!'); + return false; + }else if(formDataObj.billNum==''){ //单据编码 + UTIL.showToastNoneIcon('请输入单据编码!'); + return false; + }else if(formDataObj.accountSummary==''){ //备注说明 + UTIL.showToastNoneIcon('请输入备注说明!'); + return false; + }else if(formDataObj.incomeType == '2' && formDataObj.contractionId==''){ + UTIL.showToastNoneIcon('收入类型为发包收入,必须选择关联合同!'); + return false; + } + let data = this.data.formData; + data.method = "POST"; + data.checkedStatus = codeStr; + console.log(data); + UTIL.httpRequest(API.URL_POST_GERFLOWEDIT,data,{ + success: (res) => { + if(res.code == 200){ + let vouerId = res.data; + // let vouerId = 1; + let updataList = [...this.data.sjPics,...this.data.fpPics,...this.data.qtPics]; + for(let i=0; i + + + 收入登记 + + + + + 收入单位 + {{bookName}} + +基础信息 + + + 收入时间 + + {{formData.accountDate}} + + + + + 收入金额 + + + 存入账户 + + + + 请选择存入账户 + {{formData.accountName}} + + + + + + + + + + + + + 收入类型 + + 请选择收入类型 + {{incomeTypeText}} + + + + + + + 单据编码 + 备注说明 + + + + 关联合同 + + + + 付款人{{}} + + 请选择付款人 + {{payerText}} + + + + + + + 合同编码 + + 请选择合同编码 + {{contractionIdID}} + + + + + + + + + + 附件可拍照 + + + 总数 {{form.transfers[index].fileNum?form.transfers[index].fileNum:0}}张 + + + + + + 收\n据 + + + + + + + + + + + + + + 发\n票 + + + + + + + + + + + + + + + 其\n他 + + + + + + + + + + + + + + + + + + + 暂存 + 提交 + + + \ No newline at end of file diff --git a/pages/Bookkeeping/update/update.wxss b/pages/Bookkeeping/update/update.wxss new file mode 100644 index 0000000..2ee508b --- /dev/null +++ b/pages/Bookkeeping/update/update.wxss @@ -0,0 +1,292 @@ +/* pages/apply/index.wxss */ +.inComeUnit{ + border:1rpx solid #ddd; + width:90%; + margin:0 auto; + +} +.top{ + display: flex; + width: 94%; + margin: 0 auto; + border-radius: 10rpx; + margin-top: 3vw; + overflow: hidden; +} +.top view{ + padding: 40rpx 15rpx; + align-items: center; + justify-content: center; + position: relative; +} +.top image{ + position: absolute; + width: 94%; +} +.top-title{ + flex: 1; + text-align: center; +} +.top-tit{ + color: #fff; +} +.rules:before{ + content:'*'; + color:red; +} +.rules.no::before{ + content:' '; + padding-left: 14rpx; + color:'#fff'; +} +.main-title{ + background-image: linear-gradient(to right, #2C8E68 , #B3DB62); + color: #ffffff; + font-size: 18rpx; + padding: 10rpx 0; + text-align: center; +} +.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); +} +.main-box block{ + float: right; +} + +.main-box .color-gray{ + color: #888; +} +.title{ + padding: 10px calc(3% + 20px); + display: block; +} +.van-cell{ + padding-left: 0!important; + padding-right: 0!important; + padding-top: 0!important; + margin-bottom: 15px; +} +.table-box .flex-block{ + margin-bottom: 15px; + display: flex; + justify-content: space-between; + align-items: center; +} +.table-box .flex-block:last-child{ + margin-bottom: 0px; +} +.table-box .rules{ + width: 200rpx; +} +.table-box .picker_wrap{ + /* display: flex; + justify-content: flex-end; + align-items: center; */ +} +.table-box .picker{text-align: right;} +.table-box .wrap{flex:1; text-align: right;} +.fjLable{ + display: flex; + width:24px; + margin:25rpx 5rpx; + color:#fff; + background:#07c160; + text-align: center; + border-radius: 10rpx; + justify-content: center; /* 相对父元素水平居中 */ + align-items: center; + padding:25rpx 0; +} +.content { + width: 100%; + background-color: #fff; +} + +.img-list { + display: flex; + display: -webkit-flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + flex-wrap: wrap; +} + +.img-item { + width: 30%; + text-align: left; + margin-right: 3%; + margin-bottom: 10rpx; + position: relative; +} +.img-item .close-ico{ + position: absolute; + right: -10rpx; + top: -10rpx; +} +.img-item .imagea { + width: 160rpx; + height: 160rpx; +} + +.submit-btn { + width: 100%; + background-color: #fff; + height: 80rpx; + text-align: center; + line-height: 80rpx; + font-size: 30rpx; + position: fixed; + bottom: 100rpx; +} + +.chooseimg { + height: 160rpx; + background-color: #fff; + display: flex; + justify-content: center; /* 相对父元素水平居中 */ + align-items: center; +} + +.weui-uploader__input-box { + + float: left; + position: relative; + /* margin-right: 9rpx; + margin-bottom: 9rpx; */ + width: 120rpx; + height: 120rpx; + border: 1px solid #d9d9d9; +} + +.weui-uploader__input-box:before { + width: 2px; + height: 39.5px; +} + +.weui-uploader__input-box:after, .weui-uploader__input-box:before { + content: " "; + position: absolute; + top: 50%; + left: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + background-color: #d9d9d9; +} + +.weui-uploader__input-box:after { + width: 39.5px; + height: 2px; +} + +.weui-uploader__input-box:after, .weui-uploader__input-box:before { + content: " "; + position: absolute; + top: 50%; + left: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + background-color: #d9d9d9; +} + +.tips { + color: #666; + font-size: 24rpx; + padding-bottom: 20rpx; +} + +.img-box { + width: 92%; + margin: auto; + padding-top: 20rpx; +} +.btn button{ + line-height: 1.7; + padding-left:80rpx; + padding-right:80rpx; + border-radius: 30rpx; +} + +.fj-box text{ + background-color: #5CAE77; + color: #ffffff; + text-align: center; + border-radius: 5px; + white-space:pre-wrap; + padding: 22px 8px; + display: block; +} +.fj-li{ + margin-top: 20px; + display: flex; + /* flex-wrap: wrap; */ +} +.fj-li .img_li{ + width: 100%; + height: 18.5vw; +} + +.fj-li .img_add{ + overflow: hidden; +} +.img_box{ + position: relative; + width: 100%; + display: flex; + flex-wrap: wrap; +} +.img_box .img_list{ + width: 25%; + margin-left: 5%; + position: relative; +} +.img_box .img_list .van-icon{ + font-size: 20px; + position: absolute; + top: 0; + right: 0; + transform: translate(50%,-50%); +} +.img_box .img_list:nth-child(n+4){ + margin-top: 15px; +} +.bottom{ + width: 84%; + margin: 0 auto; + text-align: center; + margin-top: 50px; + margin-bottom: 50px; + display: flex; +} + +.bottom view { + width: 47%; + margin: 0 auto; + border-radius: 30px; + display: inline-block; +} + +.bottom .btn1{ + border: 1px solid #2C8E68; + padding: 8px 0px; + color: #2C8E68; +} + +.bottom .btn2{ + border: 1px solid transparent; + padding: 8px 0px; + background-image: linear-gradient(to right, #2C8E68, #5CAE77); + margin-left: 6%; + color: #fff; +} +.bottom .btn3{ + border: 1px solid transparent; + padding: 8px 0px; + background-image: linear-gradient(to right, #2C8E68, #5CAE77); + color: #fff; + width: 100%; +} \ No newline at end of file