@@ -18,7 +18,11 @@ Page({ | |||
payeePaymentLines: "", //联行号 //必填 | |||
} | |||
}, | |||
back:function(){ | |||
wx.navigateBack({ | |||
delta: 1 | |||
}) | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
@@ -60,7 +64,6 @@ Page({ | |||
}) | |||
}, | |||
onConfirm(even){ | |||
console.log(even); | |||
var that = this ; | |||
if(even.currentTarget.dataset.name == "showBankType"){ | |||
// 付款方式类型字典查询 | |||
@@ -79,7 +82,6 @@ Page({ | |||
}) | |||
}, | |||
onConfirmDeposit(even){ | |||
console.log(even); | |||
this.setData({ | |||
[even.currentTarget.dataset.value]:even.detail.value.bankDeposit, | |||
[even.currentTarget.dataset.value+"Text"]:even.detail.value.bankDeposit, | |||
@@ -94,23 +96,39 @@ Page({ | |||
}) | |||
}, | |||
goSubmit(){ | |||
console.log(this.data.form); | |||
var that = this; | |||
that.data.form.method = 'POST'; | |||
UTIL.httpRequest(API.URL_GET_DEPOSITADD, that.data.form, { | |||
success: (res) => { | |||
wx.showToast({ | |||
title: "提交成功!", | |||
duration: 2000, | |||
icon:"success" | |||
}) | |||
setTimeout(function(){ | |||
wx.navigateBack({ | |||
delta:1 | |||
if(this.data.form.sheng===''||this.data.form.code==sheng){ //省 | |||
UTIL.showToastNoneIcon('请填写省!'); | |||
return false; | |||
}else if(this.data.form.shi===''||this.data.form.shi==null){ //市 | |||
UTIL.showToastNoneIcon('请输入市!'); | |||
return false; | |||
}else if(this.data.form.bankType===''||this.data.form.bankType==null){ //所属银行 | |||
UTIL.showToastNoneIcon('请输入所属银行!'); | |||
return false; | |||
}else if(this.data.form.bankDeposit===''||this.data.form.bankDeposit==null){ //开户行 | |||
UTIL.showToastNoneIcon('请输入开户行!'); | |||
return false; | |||
}else if(this.data.form.payeePaymentLines === ''||this.data.form.payeePaymentLines==null){//联行号 | |||
UTIL.showToastNoneIcon('请输入联行号!'); | |||
return false; | |||
}else{ | |||
var that = this; | |||
that.data.form.method = 'POST'; | |||
UTIL.httpRequest(API.URL_GET_DEPOSITADD, that.data.form, { | |||
success: (res) => { | |||
wx.showToast({ | |||
title: "提交成功!", | |||
duration: 2000, | |||
icon:"success" | |||
}) | |||
},2000) | |||
} | |||
}) | |||
setTimeout(function(){ | |||
wx.navigateBack({ | |||
delta:1 | |||
}) | |||
},2000) | |||
} | |||
}) | |||
} | |||
}, | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
@@ -1,7 +1,7 @@ | |||
<!--pages/payee/add/add.wxml--> | |||
<view class="ns" style="height:{{isIPX?'88px':'64px'}};"> | |||
<image src="/image/apply/back.png" style="top:{{isIPX?'54px':'30px'}};" mode="widthFix" bindtap="back"></image> | |||
<text style="top:{{isIPX?'54px':'30px'}};">新增开户行</text> | |||
<text style="top:{{isIPX?'54px':'30px'}};">{{form.id?"查看":"新增"}}开户行</text> | |||
</view> | |||
<view class="main-box table-box" style="margin-top:{{isIPX?'100px':'75px'}};"> | |||
@@ -30,8 +30,8 @@ | |||
data-value="form.bankDeposit" | |||
/> | |||
</van-popup> | |||
<van-field readonly label="开户行" value="{{ form.bankDepositText }}" placeholder="请选择" border="{{ false }}" bind:change="onChange" input-align="right" required is-link arrow-direction ="down" bindtap="openBox" data-name="showDeposit" /> | |||
<van-field label="联行号" value="{{ form.payeePaymentLines }}" placeholder="请输入" border="{{ false }}" bind:change="onChange" input-align="right" required data-formname="form.payeePaymentLines"/> | |||
<van-field label="开户行" value="{{ form.bankDepositText }}" placeholder="请输入开户银行" border="{{ false }}" bind:change="onChange" input-align="right" required data-formname="form.bankDepositText" /> | |||
<van-field label="联行号" value="{{ form.payeePaymentLines }}" placeholder="请输入联行号" border="{{ false }}" bind:change="onChange" input-align="right" required data-formname="form.payeePaymentLines"/> | |||
</view> | |||
<view class="bottom"> | |||
<view class="btn2" bindtap="goSubmit">确认</view> |
@@ -10,7 +10,8 @@ Page({ | |||
data: { | |||
isIPX: app.globalData.isIPX, | |||
depositList:[], | |||
bankTypeOptions:[] | |||
bankTypeOptions:[], | |||
value:"" | |||
}, | |||
goAdd(){ | |||
wx.navigateTo({ | |||
@@ -26,14 +27,14 @@ Page({ | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad(options) { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady() { | |||
this.onShow(); | |||
}, | |||
/** | |||
@@ -45,27 +46,34 @@ Page({ | |||
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, { | |||
success: (res) => { | |||
this.setData({ | |||
bankTypeOptions:res.data | |||
bankTypeOptions:res.data, | |||
}); | |||
UTIL.httpRequest(API.URL_GET_DEPOSITLIST, {method:'GET'},{ | |||
let param = { | |||
'bankDeposit':this.data.value | |||
} | |||
console.log(2); | |||
UTIL.httpRequest(API.URL_GET_DEPOSITLIST, param,{ | |||
success: (response) => { | |||
if (response.code == API.SUCCESS_CODE) { | |||
for (let i = 0; i < response.rows.length; i++) { | |||
response.rows[i].bankTypeText = UTIL.getTransform(response.rows[i].bankType,res.data); | |||
response.rows[i].payeePaymentLines = response.rows[i].payeePaymentLines.substr(0,4)+'****' | |||
if(i == response.rows.length-1){ | |||
that.setData({ | |||
depositList:response.rows | |||
}) | |||
} | |||
} | |||
that.setData({ | |||
depositList:response.rows | |||
}) | |||
} | |||
} | |||
}) | |||
} | |||
}) | |||
}, | |||
goSearch(e){ | |||
this.setData({'value':e.detail}) | |||
this.onShow() | |||
}, | |||
delete(e){ | |||
var that = this; | |||
UTIL.httpRequest(API.URL_GET_DEPOSITDELETE + e.currentTarget.dataset.id, {method:'GET'},{ | |||
@@ -84,8 +92,10 @@ Page({ | |||
} | |||
}) | |||
}, | |||
goUpdate(){ | |||
goUpdate(e){ | |||
wx.navigateTo({ | |||
url: 'add/add?id='+ e.currentTarget.dataset.id, | |||
}) | |||
}, | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
@@ -86,23 +86,51 @@ Page({ | |||
}); | |||
}, | |||
goSubmit(){ | |||
//三、 新增银行汇票 | |||
var that = this; | |||
that.data.form.method = 'POST'; | |||
UTIL.httpRequest(API.URL_GET_MONEYORDERADD, that.data.form , { | |||
success: (res) => { | |||
wx.showToast({ | |||
title: '保存成功', | |||
icon: 'success', | |||
duration: 2000, | |||
complete(){ | |||
setTimeout(function(){ | |||
that.back(); | |||
},2000) | |||
} | |||
}) | |||
} | |||
}) | |||
if(this.data.form.orderNum===''||this.data.form.orderNum==null){ //汇票号码 | |||
UTIL.showToastNoneIcon('请填写汇票号码!'); | |||
return false; | |||
}else if(this.data.form.orderType===''||this.data.form.orderType==null){ //汇票类型 | |||
UTIL.showToastNoneIcon('汇票类型不能为空!'); | |||
return false; | |||
}else if(this.data.form.orderAmount===''||this.data.form.orderAmount==null){ //出票金额 | |||
UTIL.showToastNoneIcon('请输入出票金额!'); | |||
return false; | |||
}else if(this.data.form.billPayUnit===''||this.data.form.billPayUnit==null){ //付飘单位 | |||
UTIL.showToastNoneIcon('请输入付飘单位!'); | |||
return false; | |||
}else if(this.data.form.billReceiveUnit === ''||this.data.form.billReceiveUnit==null){//收票单位 | |||
UTIL.showToastNoneIcon('请输入收票单位!'); | |||
return false; | |||
}else if(this.data.form.startTime === ''||this.data.form.startTime==null){//开票日期 | |||
UTIL.showToastNoneIcon('请输入开票日期!'); | |||
return false; | |||
}else if(this.data.form.endTime === ''||this.data.form.endTime==null){//到期日期 | |||
UTIL.showToastNoneIcon('请输入到期日期!'); | |||
return false; | |||
}else if(this.data.form.orderStatus === ''||this.data.form.orderStatus==null){//联行号 | |||
UTIL.showToastNoneIcon('汇票状态不能为空!'); | |||
return false; | |||
}else if(this.data.form.orderStatus === ''||this.data.form.orderStatus==null){//联行号 | |||
UTIL.showToastNoneIcon('汇票状态不能为空!'); | |||
return false; | |||
}else{ | |||
var that = this; | |||
that.data.form.method = 'POST'; | |||
UTIL.httpRequest(API.URL_GET_MONEYORDERADD, that.data.form , { | |||
success: (res) => { | |||
wx.showToast({ | |||
title: '保存成功', | |||
icon: 'success', | |||
duration: 2000, | |||
complete(){ | |||
setTimeout(function(){ | |||
that.back(); | |||
},2000) | |||
} | |||
}) | |||
} | |||
}) | |||
} | |||
}, | |||
onConfirmTime(event){ | |||
this.setData({ | |||
@@ -44,7 +44,7 @@ | |||
/> | |||
</van-popup> | |||
<van-field label="汇票状态" value="{{ form.orderStatusText }}" placeholder="汇票状态" border="{{ false }}" bind:change="onChange" input-align="right" required data-value="form.orderStatus" is-link arrow-direction ="down" bindtap="openBox" data-name="showOrderStatus"/> | |||
<van-field label="备注" value="{{ form.remark }}" placeholder="备注" border="{{ false }}" bind:change="onChange" input-align="right" required data-value="form.remark"/> | |||
<van-field label="备注" value="{{ form.remark }}" placeholder="备注" border="{{ false }}" bind:change="onChange" input-align="right" data-value="form.remark"/> | |||
</view> | |||
<view class="bottom"> | |||
<view class="btn2" bindtap="goSubmit">确认</view> |
@@ -1,6 +1,11 @@ | |||
// pages/bankDraft/bankDraft.js | |||
import * as UTIL from '../../utils/util.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(); | |||
Page({ | |||
@@ -23,14 +28,40 @@ Page({ | |||
], | |||
value1: '', | |||
value2: '', | |||
moneyorderList:[] | |||
moneyorderList:[], | |||
value:'', | |||
pageNums:1, | |||
showUpload:false, | |||
uploadOptions:[], | |||
fileList:[], | |||
itemId:"", | |||
list:[], | |||
fileEvent:{}, | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad(options) { | |||
var _this = this; | |||
let qu = wx.createSelectorQuery() | |||
qu.select("#top_view").boundingClientRect() | |||
qu.select("#top_ban").boundingClientRect() | |||
qu.select("#top_view1").boundingClientRect() | |||
qu.select("#top_view2").boundingClientRect() | |||
qu.exec(res => { | |||
_this.setData({ | |||
scrollHeight:wx.getSystemInfoSync().windowHeight-res[3].top | |||
}) | |||
}) | |||
//获取附件字典 | |||
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'common_attach', {method:'GET'}, { | |||
success: (res) => { | |||
this.setData({ | |||
uploadOptions:res.data, | |||
}) | |||
} | |||
}) | |||
}, | |||
goAdd(){ | |||
wx.navigateTo({ | |||
@@ -46,9 +77,19 @@ Page({ | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady() { | |||
}, | |||
goSearch(e){ | |||
this.setData({'value':e.detail}) | |||
this.onShow(); | |||
}, | |||
paging(){ | |||
console.log(1); | |||
this.setData({ | |||
pageNums:this.data.pageNums+1, | |||
}) | |||
this.onShow(); | |||
}, | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
@@ -59,17 +100,20 @@ Page({ | |||
this.setData({ | |||
orderTypeOptions:res.data | |||
}); | |||
UTIL.httpRequest(API.URL_GET_GETMONEYORDERLIST, {method:'GET'},{ | |||
let param = { | |||
'billPayUnit' : this.data.value, | |||
pageNum:this.data.pageNums, | |||
pageSize:10, | |||
} | |||
UTIL.httpRequest(API.URL_GET_GETMONEYORDERLIST, param,{ | |||
success: (response) => { | |||
if (response.code == API.SUCCESS_CODE) { | |||
for (let i = 0; i < response.rows.length; i++) { | |||
response.rows[i].orderTypeText = UTIL.getTransform(response.rows[i].orderType,res.data); | |||
response.rows[i].startTime = response.rows[i].startTime.replace(/-/g,"."); | |||
response.rows[i].endTime = response.rows[i].endTime.replace(/-/g,"."); | |||
response.rows[i].orderAmount = parseFloat(response.rows[i].orderAmount).toFixed(2); | |||
} | |||
that.setData({ | |||
moneyorderList:response.rows | |||
}) | |||
@@ -78,9 +122,26 @@ Page({ | |||
}) | |||
} | |||
}) | |||
}, | |||
delete(e){ | |||
var that = this; | |||
UTIL.httpRequest(API.URL_GET_MONEYORDERDELETE + e.currentTarget.dataset.id, {method:'GET'},{ | |||
success: (res) => { | |||
if (res.code == API.SUCCESS_CODE) { | |||
let list = that.data.moneyorderList | |||
list.splice(e.currentTarget.dataset.index, 1); | |||
wx.showToast({ | |||
title: '删除成功!', | |||
icon: 'success', | |||
duration: 2000 | |||
}) | |||
that.setData({ | |||
moneyorderList : list, | |||
}) | |||
} | |||
} | |||
}) | |||
}, | |||
changeTab(e){ | |||
var that = this ; | |||
that.setData({value1:e.detail}) | |||
@@ -137,7 +198,160 @@ Page({ | |||
}, | |||
upload(e){ | |||
this.setData({itemId:e.currentTarget.dataset.id}); | |||
this.asyncFun(e.currentTarget.dataset.id) | |||
}, | |||
asyncFun(id){ | |||
this.setData({"fileList":[]}) | |||
let uploadList = this.data.uploadOptions | |||
let newList = [] | |||
let _this = this | |||
uploadList.map( res => { | |||
let oData = { | |||
tableId: id, | |||
tableName: "t_yinnong_moneyorder", //上传表 | |||
bizPath: "yinnong", | |||
fileType: res.dictValue, //附件类型 1原始发票 2会议纪要 3会议照片 4 参会人员签字 | |||
method:'GET' | |||
} | |||
UTIL.httpRequest(API.URL_GET_ATTACHMENTLIST, oData, { | |||
success: (rr) => { | |||
if(rr.rows.length>0){ | |||
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}) | |||
} | |||
}) | |||
}else{ | |||
let newuploadList = uploadList | |||
newuploadList.map(rd => { | |||
rd.list = newList | |||
}) | |||
_this.setData({"fileList":newuploadList}); | |||
_this.setData({"showUpload":true}) | |||
} | |||
}, | |||
fail:(rr) =>{ | |||
}, | |||
complete:(rr) => { | |||
} | |||
}) | |||
}) | |||
}, | |||
closeBox(){ | |||
this.setData({"showUpload":false}) | |||
}, | |||
deleteImg(event){ | |||
this.setData({"fileEvent":event}) | |||
this.setData({"showPopup":true}); | |||
}, | |||
cancelTem:function(e){ | |||
this.setData({"fileEvent":"{}"}); | |||
this.setData({"showPopup":false}); | |||
}, | |||
confirmTem:function(e){ | |||
let event = this.data.fileEvent | |||
console.log(event); | |||
UTIL.httpRequest(API.URL_GET_GETFILEREMOVE+event.detail.file.id , {method:'GET'}, { | |||
success: (res) => { | |||
if(res.code==200){ | |||
let ll = this.data.fileList | |||
var jsonlist = ll[event.target.dataset.idx].list; | |||
jsonlist.splice(event.detail.index, 1) | |||
ll[event.target.dataset.idx].list = jsonlist | |||
this.setData({"fileList":ll}) | |||
this.setData({showPopup:false}); | |||
wx.showToast({ | |||
title: '删除成功!', | |||
icon: 'success', | |||
duration: 2000, | |||
}) | |||
} | |||
} | |||
}) | |||
}, | |||
uploadFile(uploadFile,event) { | |||
let _this = this | |||
return new Promise((resolve, reject) => { | |||
wx.uploadFile({ | |||
url: API.URL_GET_UPLOAD, | |||
filePath: uploadFile.file.file[0].url, | |||
name: 'file', | |||
header: { | |||
"Content-Type": "multipart/form-data",//记得设置 | |||
"chartset":"utf-8", | |||
'Authorization':'Bearer '+getApp().globalData.userInfo.token | |||
}, | |||
formData:uploadFile, | |||
success: (res) => { | |||
res.data = JSON.parse(res.data); | |||
if(res.statusCode == 200){ | |||
let files = _this.data.fileList | |||
let fName = res.data.fileUrl.split('/') | |||
let fLength = fName.length | |||
files[event.currentTarget.dataset.idx].list.push({ | |||
"fileName": fName[fLength-1], | |||
"fileType": "0", | |||
"fileUrl":res.data.fileUrl , | |||
"id": res.data.id, | |||
"tableId": 6, | |||
"url":URL_PREFIX+res.data.fileUrl | |||
}) | |||
_this.setData({"fileList":files}) | |||
wx.hideLoading() | |||
} | |||
}, | |||
fail: (err) => { | |||
//上传失败:修改pedding为reject | |||
reject(err) | |||
} | |||
}); | |||
}) | |||
}, | |||
afterRead(event) { | |||
let _this = this | |||
wx.showLoading({ | |||
title: '上传中...' | |||
}) | |||
let fileForm={ | |||
file: event.detail, | |||
fileType:event.currentTarget.dataset.idx, | |||
tableName: "t_yinnong_moneyorder", //上传表 | |||
bizPath: "yinnong", | |||
tableId:_this.data.itemId | |||
} | |||
this.uploadFile(fileForm,event) | |||
}, | |||
lookDown(file,detail){ | |||
// 获取指定字符串最后一次出现的位置,返回index | |||
var index1 = file.detail.url.lastIndexOf('.'); | |||
// substr(start, length) 抽取从start下标开始的length个字符,返回新的字符串; | |||
var style = file.detail.url.substr(index1 + 1) | |||
//判断图片类型,不需要下载,不做处理 | |||
if(style=='png'||style=='jpg'||style=='jpeg'||style=='bmp'||style=='gif'||style=='webp'||style=='psd'||style== 'svg'||style=='tiff'){ | |||
//判断非图片类型 | |||
}else{ | |||
wx.downloadFile({ | |||
url: file.detail.url, | |||
success(data){ | |||
wx.openDocument({ | |||
filePath: data.tempFilePath, | |||
fileType: style, | |||
showMenu:true, | |||
success(res){ | |||
} | |||
}) | |||
} | |||
}) | |||
} | |||
}, | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
*/ | |||
@@ -10,6 +10,8 @@ | |||
"van-swipe-cell": "@vant/weapp/swipe-cell/index", | |||
"van-dropdown-menu": "@vant/weapp/dropdown-menu/index", | |||
"van-dropdown-item": "@vant/weapp/dropdown-item/index", | |||
"van-tag": "@vant/weapp/tag/index" | |||
"van-action-sheet": "@vant/weapp/action-sheet/index", | |||
"van-tag": "@vant/weapp/tag/index", | |||
"van-upload": "@vant/weapp/uploader/index" | |||
} | |||
} |
@@ -1,10 +1,10 @@ | |||
<!--pages/bank/bank.wxml--> | |||
<view class="ns" style="height:{{isIPX?'88px':'64px'}};"> | |||
<view class="ns" id="top_ban" style="height:{{isIPX?'88px':'64px'}};"> | |||
<image src="../../image/apply/back.png" style="top:{{isIPX?'54px':'30px'}};" mode="widthFix" bindtap="back"></image> | |||
<text style="top:{{isIPX?'54px':'30px'}};">银行汇票</text> | |||
</view> | |||
<view class="search_box" style="margin-top:{{isIPX?'100px':'75px'}};"> | |||
<view class="search_box" id="top_view" style="margin-top:{{isIPX?'100px':'75px'}};"> | |||
<van-search | |||
value="{{ value }}" | |||
shape="round" | |||
@@ -16,12 +16,12 @@ | |||
<view class="add_btn" bindtap="goAdd"><text>新增</text></view> | |||
</view> | |||
<van-dropdown-menu active-color="#5CAE77" bind:change="changeTab"> | |||
<van-dropdown-menu active-color="#5CAE77" bind:change="changeTab" id="top_view1" > | |||
<van-dropdown-item value="{{ value1 }}" options="{{ option1 }}" bind:change="changeTab" /> | |||
<van-dropdown-item value="{{ value2 }}" options="{{ option2 }}" bind:change="changeTab2" /> | |||
</van-dropdown-menu> | |||
<van-swipe-cell right-width="{{ 65 }}" class="workflow" wx:for="{{moneyorderList}}" wx:key="index"> | |||
<scroll-view scroll-y refresher-threshold="0" id="top_view2" style="height:{{scrollHeight}}px" bindscrolltolower="paging" lower-threshold="100"> | |||
<van-swipe-cell right-width="{{ 130 }}" class="workflow" wx:for="{{moneyorderList}}" wx:key="index"> | |||
<view class="li" bindtap="goUpdate"> | |||
<view class="tit_box"> | |||
<view class="tit_box_left"> | |||
@@ -51,12 +51,36 @@ | |||
<view class="detail_time"> | |||
<image src="/image/icon/icon_date.png" style="width: 14px;height: 14px;"></image> | |||
<text>{{item.startTime}} - {{item.endTime}}</text> | |||
<text>{{item.startTime}} ~ {{item.endTime}}</text> | |||
</view> | |||
</view> | |||
<view slot="right" class="deleteBox"> | |||
<view style="flex: 1;height: 100%;display: flex;align-items: center;"> | |||
<image src="../../image/apply/icon_delete.png" style="width: 25px;height: 25px;margin: 0 auto;" data-id="{{item.id}}" data-index="{{index}}" bindtap="delete"></image> | |||
</view> | |||
<view style="flex: 1;height: 100%;display: flex;align-items: center;"> | |||
<image src="../../image/apply/icon_add.png" style="width: 25px;height: 25px;margin: 0 auto;" data-id="{{item.id}}" data-index="{{index}}" bindtap="upload"></image> | |||
</view> | |||
</view> | |||
</van-swipe-cell> | |||
</van-swipe-cell> | |||
</scroll-view> | |||
<van-action-sheet show="{{showUpload}}" title="附件" bind:close="closeBox"> | |||
<scroll-view scroll-y="true" style="height: 600rpx;" bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" scroll-top="0"> | |||
<view class="fj-box"> | |||
<view class="fj-li" wx:for="{{fileList}}" wx:key="index" wx:for-item="item" > | |||
<view> | |||
<text>{{item.dictLabel}}</text> | |||
</view> | |||
<view class="img_box"> | |||
<view class="img_li"> | |||
<van-upload file-list="{{ item.list }}" bind:after-read="afterRead" bind:delete="deleteImg" bind:click-preview="lookDown" multiple="{{true}}" data-idx="{{index}}"> | |||
</van-upload> | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
</scroll-view> | |||
</van-action-sheet> | |||
<modal hidden="{{!showPopup}}" title="是否删除?" confirm-text="是" cancel-text="否" bindcancel="cancelTem" bindconfirm="confirmTem"> | |||
</modal> |
@@ -64,7 +64,7 @@ text{display: block;} | |||
color: #31936c; | |||
} | |||
.deleteBox{ | |||
width: 65px; | |||
width: 130px; | |||
text-align: center; | |||
height: 100%; | |||
background: #F6F6F6; | |||
@@ -321,4 +321,31 @@ text{display: block;} | |||
} | |||
.van-dropdown-menu { | |||
margin-bottom: 15px; | |||
} | |||
.fj-box text{ | |||
background-color: #5CAE77; | |||
color: #ffffff; | |||
text-align: center; | |||
border-radius: 5px; | |||
white-space:pre-wrap; | |||
padding: 5rpx 8rpx; | |||
width: 50rpx; | |||
margin: 0px 14px; | |||
font-size: 24rpx; | |||
} | |||
.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; | |||
} | |||
.van-icon-description{ | |||
font-size: 60px; | |||
} |
@@ -62,9 +62,19 @@ Page({ | |||
var that = this ; | |||
let data = that.data.form; | |||
data.method = 'POST'; | |||
UTIL.httpRequest(API.URL_GET_PROJECTADD, data, { | |||
success: (res) => { | |||
wx.showToast({ | |||
title: "提交成功!", | |||
duration: 2000, | |||
icon:"success" | |||
}) | |||
setTimeout(function(){ | |||
wx.navigateBack({ | |||
delta:1 | |||
}) | |||
},2000) | |||
} | |||
}) | |||
}, | |||
@@ -1,6 +1,11 @@ | |||
// pages/project/project.js | |||
import * as UTIL from '../../utils/util.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(); | |||
Page({ | |||
@@ -9,20 +14,49 @@ Page({ | |||
*/ | |||
data: { | |||
isIPX: app.globalData.isIPX, | |||
name:"", | |||
value:'', | |||
pageNums:1, | |||
showUpload:false, | |||
uploadOptions:[], | |||
fileList:[], | |||
itemId:"", | |||
list:[], | |||
fileEvent:{}, | |||
projectList:[] | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad(options) { | |||
var _this = this; | |||
let qu = wx.createSelectorQuery() | |||
qu.select("#top_view").boundingClientRect() | |||
qu.exec(res => { | |||
_this.setData({ | |||
scrollHeight:wx.getSystemInfoSync().windowHeight-res[0].height-res[0].top | |||
}) | |||
}) | |||
//获取附件字典 | |||
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'common_attach', {method:'GET'}, { | |||
success: (res) => { | |||
this.setData({ | |||
uploadOptions:res.data, | |||
}) | |||
} | |||
}) | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady() { | |||
this.onShow(); | |||
}, | |||
goSearch(e){ | |||
this.setData({name:e.detail}) | |||
this.onShow(); | |||
}, | |||
goAdd(){ | |||
wx.navigateTo({ | |||
@@ -44,10 +78,13 @@ Page({ | |||
this.setData({ | |||
ynProjcetStatusOptions:res.data | |||
}); | |||
UTIL.httpRequest(API.URL_GET_GETPROJECTLIST, {method:'GET'},{ | |||
let params= { | |||
projectName:this.data.name, | |||
method:'GET' | |||
} | |||
UTIL.httpRequest(API.URL_GET_GETPROJECTLIST, params,{ | |||
success: (response) => { | |||
if (response.code == API.SUCCESS_CODE) { | |||
for (let i = 0; i < response.rows.length; i++) { | |||
response.rows[i].ynProjcetStatusText = UTIL.getTransform(response.rows[i].ynProjcetStatus,res.data); | |||
response.rows[i].startTime = response.rows[i].startTime.replace(/-/g,"."); | |||
@@ -64,7 +101,234 @@ Page({ | |||
} | |||
}) | |||
}, | |||
delete(e){ | |||
var that = this; | |||
UTIL.httpRequest(API.URL_GET_PROJECTDELETE + e.currentTarget.dataset.id, {method:'GET'},{ | |||
success: (res) => { | |||
if (res.code == API.SUCCESS_CODE) { | |||
let list = that.data.projectList | |||
list.splice(e.currentTarget.dataset.index, 1); | |||
wx.showToast({ | |||
title: '删除成功!', | |||
icon: 'success', | |||
duration: 2000 | |||
}) | |||
that.setData({ | |||
projectList : list, | |||
}) | |||
} | |||
} | |||
}) | |||
}, | |||
changeTab(e){ | |||
var that = this ; | |||
that.setData({value1:e.detail}) | |||
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'order_type', {method:'GET'}, { | |||
success: (res) => { | |||
UTIL.httpRequest(API.URL_GET_GETMONEYORDERLIST, {method:'GET',orderType:that.data.value1,orderStatus:that.data.value2},{ | |||
success: (response) => { | |||
if (response.code == API.SUCCESS_CODE) { | |||
for (let i = 0; i < response.rows.length; i++) { | |||
response.rows[i].orderTypeText = UTIL.getTransform(response.rows[i].orderType,res.data); | |||
response.rows[i].startTime = response.rows[i].startTime.replace(/-/g,"."); | |||
response.rows[i].endTime = response.rows[i].endTime.replace(/-/g,"."); | |||
response.rows[i].orderAmount = parseFloat(response.rows[i].orderAmount).toFixed(2); | |||
} | |||
that.setData({ | |||
moneyorderList:response.rows | |||
}) | |||
} | |||
} | |||
}) | |||
} | |||
}) | |||
}, | |||
changeTab2(e){ | |||
var that = this ; | |||
that.setData({value2:e.detail}) | |||
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'order_type', {method:'GET'}, { | |||
success: (res) => { | |||
UTIL.httpRequest(API.URL_GET_GETMONEYORDERLIST, {method:'GET',orderType:that.data.value1,orderStatus:that.data.value2},{ | |||
success: (response) => { | |||
if (response.code == API.SUCCESS_CODE) { | |||
for (let i = 0; i < response.rows.length; i++) { | |||
response.rows[i].orderTypeText = UTIL.getTransform(response.rows[i].orderType,res.data); | |||
response.rows[i].startTime = response.rows[i].startTime.replace(/-/g,"."); | |||
response.rows[i].endTime = response.rows[i].endTime.replace(/-/g,"."); | |||
response.rows[i].orderAmount = parseFloat(response.rows[i].orderAmount).toFixed(2); | |||
} | |||
that.setData({ | |||
moneyorderList:response.rows | |||
}) | |||
} | |||
} | |||
}) | |||
} | |||
}) | |||
}, | |||
upload(e){ | |||
this.setData({itemId:e.currentTarget.dataset.id}); | |||
this.asyncFun(e.currentTarget.dataset.id) | |||
}, | |||
asyncFun(id){ | |||
this.setData({"fileList":[]}) | |||
let uploadList = this.data.uploadOptions | |||
let newList = [] | |||
let _this = this | |||
uploadList.map( res => { | |||
let oData = { | |||
tableId: id, | |||
tableName: "t_yinnong_project", //上传表 | |||
bizPath: "yinnong", | |||
fileType: res.dictValue, //附件类型 1原始发票 2会议纪要 3会议照片 4 参会人员签字 | |||
method:'GET' | |||
} | |||
UTIL.httpRequest(API.URL_GET_ATTACHMENTLIST, oData, { | |||
success: (rr) => { | |||
if(rr.rows.length>0){ | |||
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}) | |||
} | |||
}) | |||
}else{ | |||
let newuploadList = uploadList | |||
newuploadList.map(rd => { | |||
rd.list = newList | |||
}) | |||
_this.setData({"fileList":newuploadList}); | |||
_this.setData({"showUpload":true}) | |||
} | |||
}, | |||
fail:(rr) =>{ | |||
}, | |||
complete:(rr) => { | |||
} | |||
}) | |||
}) | |||
}, | |||
closeBox(){ | |||
this.setData({"showUpload":false}) | |||
}, | |||
deleteImg(event){ | |||
this.setData({"fileEvent":event}) | |||
this.setData({"showPopup":true}); | |||
}, | |||
cancelTem:function(e){ | |||
this.setData({"fileEvent":"{}"}); | |||
this.setData({"showPopup":false}); | |||
}, | |||
confirmTem:function(e){ | |||
let event = this.data.fileEvent | |||
console.log(event); | |||
UTIL.httpRequest(API.URL_GET_GETFILEREMOVE+event.detail.file.id , {method:'GET'}, { | |||
success: (res) => { | |||
if(res.code==200){ | |||
let ll = this.data.fileList | |||
var jsonlist = ll[event.target.dataset.idx].list; | |||
jsonlist.splice(event.detail.index, 1) | |||
ll[event.target.dataset.idx].list = jsonlist | |||
this.setData({"fileList":ll}) | |||
this.setData({showPopup:false}); | |||
wx.showToast({ | |||
title: '删除成功!', | |||
icon: 'success', | |||
duration: 2000, | |||
}) | |||
} | |||
} | |||
}) | |||
}, | |||
uploadFile(uploadFile,event) { | |||
let _this = this | |||
return new Promise((resolve, reject) => { | |||
wx.uploadFile({ | |||
url: API.URL_GET_UPLOAD, | |||
filePath: uploadFile.file.file[0].url, | |||
name: 'file', | |||
header: { | |||
"Content-Type": "multipart/form-data",//记得设置 | |||
"chartset":"utf-8", | |||
'Authorization':'Bearer '+getApp().globalData.userInfo.token | |||
}, | |||
formData:uploadFile, | |||
success: (res) => { | |||
res.data = JSON.parse(res.data); | |||
if(res.statusCode == 200){ | |||
let files = _this.data.fileList | |||
let fName = res.data.fileUrl.split('/') | |||
let fLength = fName.length | |||
files[event.currentTarget.dataset.idx].list.push({ | |||
"fileName": fName[fLength-1], | |||
"fileType": "0", | |||
"fileUrl":res.data.fileUrl , | |||
"id": res.data.id, | |||
"tableId": 6, | |||
"url":URL_PREFIX+res.data.fileUrl | |||
}) | |||
_this.setData({"fileList":files}) | |||
wx.hideLoading() | |||
} | |||
}, | |||
fail: (err) => { | |||
//上传失败:修改pedding为reject | |||
reject(err) | |||
} | |||
}); | |||
}) | |||
}, | |||
afterRead(event) { | |||
let _this = this | |||
wx.showLoading({ | |||
title: '上传中...' | |||
}) | |||
let fileForm={ | |||
file: event.detail, | |||
fileType:event.currentTarget.dataset.idx, | |||
tableName: "t_yinnong_project", //上传表 | |||
bizPath: "yinnong", | |||
tableId:_this.data.itemId | |||
} | |||
this.uploadFile(fileForm,event) | |||
}, | |||
lookDown(file,detail){ | |||
// 获取指定字符串最后一次出现的位置,返回index | |||
var index1 = file.detail.url.lastIndexOf('.'); | |||
// substr(start, length) 抽取从start下标开始的length个字符,返回新的字符串; | |||
var style = file.detail.url.substr(index1 + 1) | |||
//判断图片类型,不需要下载,不做处理 | |||
if(style=='png'||style=='jpg'||style=='jpeg'||style=='bmp'||style=='gif'||style=='webp'||style=='psd'||style== 'svg'||style=='tiff'){ | |||
//判断非图片类型 | |||
}else{ | |||
wx.downloadFile({ | |||
url: file.detail.url, | |||
success(data){ | |||
wx.openDocument({ | |||
filePath: data.tempFilePath, | |||
fileType: style, | |||
showMenu:true, | |||
success(res){ | |||
} | |||
}) | |||
} | |||
}) | |||
} | |||
}, | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
*/ | |||
@@ -10,6 +10,8 @@ | |||
"van-swipe-cell": "@vant/weapp/swipe-cell/index", | |||
"van-dropdown-menu": "@vant/weapp/dropdown-menu/index", | |||
"van-dropdown-item": "@vant/weapp/dropdown-item/index", | |||
"van-tag": "@vant/weapp/tag/index" | |||
"van-tag": "@vant/weapp/tag/index", | |||
"van-action-sheet": "@vant/weapp/action-sheet/index", | |||
"van-upload": "@vant/weapp/uploader/index" | |||
} | |||
} |
@@ -1,12 +1,12 @@ | |||
<!--pages/project/project.wxml--> | |||
<view class="ns" style="height:{{isIPX?'88px':'64px'}};"> | |||
<image src="../../image/apply/back.png" style="top:{{isIPX?'54px':'30px'}};" mode="widthFix" bindtap="back"></image> | |||
<view class="ns" id="top_ban" style="height:{{isIPX?'88px':'64px'}};"> | |||
<image src="../../image/apply/back.png" style="top:{{isIPX?'54px':'30px'}};" mode="widthFix" bindtap="back" referrer="no-referrer|origin|unsafe-url"></image> | |||
<text style="top:{{isIPX?'54px':'30px'}};">工程项目</text> | |||
</view> | |||
<view class="search_box" style="margin-top:{{isIPX?'100px':'75px'}};"> | |||
<view class="search_box" id="top_view" style="margin-top:{{isIPX?'100px':'75px'}};"> | |||
<van-search | |||
value="{{ value }}" | |||
value="{{ name }}" | |||
shape="round" | |||
background="transparent" | |||
placeholder="请输入搜索关键词" | |||
@@ -15,8 +15,8 @@ | |||
/> | |||
<view class="add_btn" bindtap="goAdd"><text>新增</text></view> | |||
</view> | |||
<van-swipe-cell right-width="{{ 65 }}" class="workflow" wx:for="{{projectList}}" wx:key="index"> | |||
<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="{{projectList}}" wx:key="index"> | |||
<view class="li" bindtap="goUpdate"> | |||
<view class="tit_box"> | |||
<view class="tit_box_left"> | |||
@@ -36,7 +36,7 @@ | |||
<view class="detail_time_box"> | |||
<view class="detail_time"> | |||
<image src="/image/icon/icon_date.png" style="width: 14px;height: 14px;"></image> | |||
<text>{{item.startTime}}-{{item.endTime}}</text> | |||
<text>{{item.startTime}} ~ {{item.endTime}}</text> | |||
</view> | |||
<view class="detail_time"> | |||
<text class="detail_box_money"><text style="font-size:12px;display: inline-block;color: #E90000;">¥</text>{{item.projectAmount}}</text> | |||
@@ -47,5 +47,29 @@ | |||
<view style="flex: 1;height: 100%;display: flex;align-items: center;"> | |||
<image src="../../image/apply/icon_delete.png" style="width: 25px;height: 25px;margin: 0 auto;" data-id="{{item.id}}" data-index="{{index}}" bindtap="delete"></image> | |||
</view> | |||
<view style="flex: 1;height: 100%;display: flex;align-items: center;"> | |||
<image src="../../image/apply/icon_add.png" style="width: 25px;height: 25px;margin: 0 auto;" data-id="{{item.id}}" data-index="{{index}}" bindtap="upload"></image> | |||
</view> | |||
</view> | |||
</van-swipe-cell> | |||
</scroll-view> | |||
<van-action-sheet show="{{showUpload}}" title="附件" bind:close="closeBox"> | |||
<scroll-view scroll-y="true" style="height: 600rpx;" bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" scroll-top="0"> | |||
<view class="fj-box"> | |||
<view class="fj-li" wx:for="{{fileList}}" wx:key="index" wx:for-item="item" > | |||
<view> | |||
<text>{{item.dictLabel}}</text> | |||
</view> | |||
<view class="img_box"> | |||
<view class="img_li"> | |||
<van-upload file-list="{{ item.list }}" bind:after-read="afterRead" bind:delete="deleteImg" bind:click-preview="lookDown" multiple="{{true}}" data-idx="{{index}}"> | |||
</van-upload> | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
</scroll-view> | |||
</van-action-sheet> | |||
<modal hidden="{{!showPopup}}" title="是否删除?" confirm-text="是" cancel-text="否" bindcancel="cancelTem" bindconfirm="confirmTem"> | |||
</modal> |
@@ -64,7 +64,7 @@ text{display: block;} | |||
color: #31936c; | |||
} | |||
.deleteBox{ | |||
width: 65px; | |||
width: 130px; | |||
text-align: center; | |||
height: 100%; | |||
background: #F6F6F6; | |||
@@ -127,9 +127,6 @@ text{display: block;} | |||
.detail_box text{ | |||
color:#878787; | |||
} | |||
.li view text{ | |||
/* margin-top: 15px; */ | |||
} | |||
.fkmc { | |||
line-height: 20px; | |||
font-size: 16px; | |||
@@ -165,9 +162,6 @@ text{display: block;} | |||
color: #666666; | |||
font-size: 12px; | |||
text-align: center; | |||
} | |||
.li .detail_box_right{ | |||
} | |||
.li .detail_box_right text{ | |||
text-align: center; | |||
@@ -324,4 +318,31 @@ text{display: block;} | |||
} | |||
.van-dropdown-menu { | |||
margin-bottom: 15px; | |||
} | |||
.fj-box text{ | |||
background-color: #5CAE77; | |||
color: #ffffff; | |||
text-align: center; | |||
border-radius: 5px; | |||
white-space:pre-wrap; | |||
padding: 5rpx 8rpx; | |||
width: 50rpx; | |||
margin: 0px 14px; | |||
font-size: 24rpx; | |||
} | |||
.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; | |||
} | |||
.van-icon-description{ | |||
font-size: 60px; | |||
} |
@@ -1,6 +1,6 @@ | |||
{ | |||
"setting": { | |||
"compileHotReLoad": false | |||
"compileHotReLoad": true | |||
}, | |||
"condition": { | |||
"miniprogram": { | |||
@@ -236,6 +236,9 @@ const URL_GET_ATTACHMENTLIST = `${URL_PREFIX}/system/attachment/query/`; | |||
//新增银行汇票 | |||
const URL_GET_MONEYORDERADD = `${URL_PREFIX}/yinnong/moneyorder/add`; | |||
//删除银行汇票 | |||
const URL_GET_MONEYORDERDELETE = `${URL_PREFIX}/yinnong/moneyorder/remove/`; | |||
//新增工程项目 | |||
const URL_GET_PROJECTADD = `${URL_PREFIX}/yinnong/project/add`; | |||
@@ -263,7 +266,8 @@ const URL_GET_FINANCIALLIST = `${URL_PREFIX}/finance/open/financialAmountPublicM | |||
//删除开户行 | |||
const URL_GET_DEPOSITDELETE = `${URL_PREFIX}/yinnong/deposit/remove/`; | |||
//删除工程项目 | |||
const URL_GET_PROJECTDELETE = `${URL_PREFIX}/yinnong/project/remove/`; | |||
/****************接口地址end****************/ | |||
@@ -364,5 +368,8 @@ export { | |||
URL_POST_PERMANENTADD, | |||
URL_POST_PERMANENTUPDATE, | |||
URL_GET_FINANCIALLIST, | |||
URL_GET_SUBJECTLIST | |||
URL_GET_SUBJECTLIST, | |||
URL_GET_MONEYORDERDELETE, | |||
URL_GET_PROJECTADD, | |||
URL_GET_PROJECTDELETE | |||
} |
@@ -438,7 +438,6 @@ function convertToChinaNum (num) { | |||
} | |||
function getTransform(dictValue,options){ | |||
var dictLabel2 = ""; | |||
console.log(options); | |||
options.map(item=>{ | |||
if(item.dictValue == dictValue){ | |||
dictLabel2 = item.dictLabel | |||