@@ -62,12 +62,12 @@ Page({ | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad(options) { | |||
this.setData({itemId:options.id}); | |||
//this.getApprovalItemList(); | |||
this.groupList(); | |||
this.townList(); | |||
this.villageList(); | |||
this.getApprovalItemsById(); | |||
// this.getApprovalItemList(); | |||
}, | |||
getApprovalItemsById(){ | |||
let _this = this | |||
@@ -308,7 +308,19 @@ Page({ | |||
_this.setData({templateDetailList:list}) | |||
} | |||
} | |||
} | |||
let li = this.data.templateDetailList | |||
li = li.filter(function(e,i,s){ | |||
s[i].name = i+1 | |||
return true | |||
}) | |||
this.setData({templateDetailList:li}) | |||
}, | |||
back:function(){ | |||
wx.navigateBack({ | |||
delta: 1 | |||
}) | |||
}, | |||
save:function(){ | |||
let _this = this | |||
@@ -295,7 +295,7 @@ Page({ | |||
} | |||
}) | |||
}, | |||
/* 获取区镇村*/ | |||
/* 获取账套*/ | |||
getBookList:function(){ | |||
let d = { | |||
loginDeptID : this.data.userInfoObj.loginDeptId | |||
@@ -441,7 +441,9 @@ Page({ | |||
lastCitys: this.data.citys, | |||
lastAreas: this.data.areas, | |||
regionValue: value, | |||
deptId:this.getRegionId('areas') | |||
deptId:this.getRegionId('areas'), | |||
bookName:"", | |||
bookId:"" | |||
}, () => { | |||
let data={ | |||
loginDeptID : this.getRegionId('areas') | |||
@@ -18,24 +18,24 @@ | |||
<view class="flex_block"> | |||
<!-- <view class="desc">未完成</view> --> | |||
<view class="event" bindtap="pickAddress"> | |||
<view class="icon" style="background:url('../../image/index/local.png') no-repeat; background-size: 100% 100%;"></view> | |||
{{ region || "请选择" }} | |||
</view> | |||
</view> | |||
<view class="flex_block unfinished"> | |||
</view> | |||
<view class="task_wrap "> | |||
<view class="flex_block"> | |||
<!-- <view class="desc">已完成</view> --> | |||
<view class="event"> | |||
<picker bindchange="bindPickerChange" value="{{index}}" range-key="bookName" range="{{bookList}}"> | |||
<view class="picker"> | |||
<view class="icon" style="background:url('../../image/index/dept.png') no-repeat; background-size: 100% 100%;"></view> | |||
{{array[index]|| bookName}} | |||
</view> | |||
</picker> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="address_wrap"> | |||
<view class="icon"></view> | |||
{{userInfoObj.allDeptName}} | |||
</view> | |||
</view> | |||
</view> | |||
@@ -73,7 +73,14 @@ | |||
border-radius: 44rpx; | |||
border:2rpx solid #2c8e68; | |||
text-align: center; | |||
font-size: 28rpx; | |||
font-size: 24rpx; | |||
} | |||
.information_header .task_wrap .flex_block .icon{ | |||
width: 30rpx; | |||
height: 30rpx; | |||
vertical-align: sub; | |||
display:inline-block; | |||
} | |||
.information_header .task_wrap .flex_block .desc{ | |||
width: 115rpx; | |||
@@ -105,7 +112,7 @@ | |||
.information_header .task_wrap .flex_block .event{ | |||
color: #2c8e68; | |||
margin-left: -2%; | |||
padding:0 8rpx 0 5rpx; | |||
padding:0 20rpx 0 20rpx; | |||
} | |||
@@ -12,16 +12,43 @@ Page({ | |||
isEmpty: true, | |||
baseItem:"", | |||
item:{}, | |||
url:"", | |||
isShow:false | |||
}, | |||
onLoad: function(options) { | |||
this.setData({baseItem:options.item}); | |||
this.setData({item:JSON.parse(options.item)}); | |||
console.log(this.data.item); | |||
var ctx = wx.createCanvasContext('handWriting'); | |||
const data = { | |||
devicePixelRatio: pix, | |||
}; | |||
signaturePad = new SignaturePad(ctx, data); | |||
this.getUserInfo(); | |||
this.getBaseUrl() | |||
}, | |||
/* 获取用户信息*/ | |||
getUserInfo(){ | |||
UTIL.httpRequest(API.URL_GET_GETINFO, {method:'GET'}, { | |||
success: (res) => { | |||
if (res.code == API.SUCCESS_CODE) { | |||
this.setData({item:res.user}) | |||
if(this.data.item.electronicSignature==null||this.data.item.electronicSignature==""){ | |||
this.setData({isShow:false}) | |||
var ctx = wx.createCanvasContext('handWriting'); | |||
const data = { | |||
devicePixelRatio: pix, | |||
}; | |||
signaturePad = new SignaturePad(ctx, data); | |||
}else{ | |||
this.setData({isShow:true}) | |||
} | |||
} | |||
} | |||
}) | |||
}, | |||
getBaseUrl:function(){ | |||
let params={ | |||
configKey: "system.attachment.url"} | |||
UTIL.httpRequest(API.URL_GET_SYSCONFIG,params,{ | |||
success: (res) => { | |||
if (res.code == API.SUCCESS_CODE) { | |||
this.setData({url:res.rows[0].configValue+this.data.item.electronicSignature}) | |||
} | |||
} | |||
}) | |||
}, | |||
uploadScaleStart(e) { | |||
const item = { | |||
@@ -46,6 +73,12 @@ Page({ | |||
}) | |||
}, | |||
retDraw: function() { | |||
this.setData({isShow:false}) | |||
var ctx = wx.createCanvasContext('handWriting'); | |||
const data = { | |||
devicePixelRatio: pix, | |||
}; | |||
signaturePad = new SignaturePad(ctx, data); | |||
signaturePad.clear(); | |||
const isEmpty = signaturePad.isEmpty(); | |||
this.setData({ | |||
@@ -73,7 +106,6 @@ Page({ | |||
wx.canvasToTempFilePath({ | |||
canvasId: 'handWriting', | |||
success: function(res) { | |||
console.log(res); | |||
wx.uploadFile({ | |||
url: API.URL_POST_UPLOADFILE, //服务器地址 | |||
filePath:res.tempFilePath,//本地照片地址 | |||
@@ -84,11 +116,6 @@ Page({ | |||
}, | |||
success (res){ | |||
let dd = JSON.parse(res.data) | |||
// console.log(dd); | |||
// let a = _this.data.item | |||
// a.electronicSignature = dd.fileName | |||
// _this.setData({item:a}); | |||
// _this.saveESign(JSON.stringify(_this.data.item)); | |||
if(dd.code==200){ | |||
wx.showToast({ | |||
title: dd.msg, | |||
@@ -117,9 +144,12 @@ Page({ | |||
saveESign : function(item){ | |||
UTIL.httpRequest(API.URL_POST_USEREDIT,item,{ | |||
success: (res) => { | |||
console.log(res); | |||
if (res.code == API.SUCCESS_CODE) { | |||
console.log(res); | |||
wx.showToast({ | |||
title: "保存成功!", | |||
duration: 2000, | |||
icon:"success" | |||
}) | |||
} | |||
} | |||
}) | |||
@@ -9,8 +9,9 @@ | |||
<button catchtap="subCanvas" class="sub-btn">保存</button> | |||
</view> | |||
<view class="hand-center"> | |||
<canvas class="hand-writing" disable-scroll="true" bindtouchstart="uploadScaleStart" bindtouchmove="uploadScaleMove" bindtouchend="uploadScaleEnd" canvas-id="handWriting"> | |||
<canvas class="hand-writing" wx:if="{{!isShow}}" disable-scroll="true" bindtouchstart="uploadScaleStart" bindtouchmove="uploadScaleMove" bindtouchend="uploadScaleEnd" canvas-id="handWriting"> | |||
</canvas> | |||
<image mode="scaleToFill" class="hand-writing" wx:if="{{isShow}}" src="{{url}}"></image> | |||
</view> | |||
<view class="hand-right"> | |||
<view class="hand-title">手写签名</view> | |||
@@ -20,9 +20,17 @@ Page({ | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function (options) { | |||
this.setData({baseItem:options.item}); | |||
this.setData({item:JSON.parse(options.item)}); | |||
console.log(this.data.item); | |||
this.getUserInfo() | |||
}, | |||
/* 获取用户信息*/ | |||
getUserInfo(){ | |||
UTIL.httpRequest(API.URL_GET_GETINFO, {method:'GET'}, { | |||
success: (res) => { | |||
if (res.code == API.SUCCESS_CODE) { | |||
this.setData({item:res.user}) | |||
} | |||
} | |||
}) | |||
}, | |||
bindOldInput: function (e) { | |||
console.log(e); | |||
@@ -86,20 +94,6 @@ updatePassword(){ | |||
console.log(response); | |||
} | |||
}) | |||
// UTIL.httpRequest(API.URL_POST_UPDATEPWD, d, { | |||
// success: (res) => { | |||
// console.log(res); | |||
// if (res.code == API.SUCCESS_CODE) { | |||
// } | |||
// }, | |||
// fail:(res) => { | |||
// console.log(res); | |||
// }, | |||
// complete:(res) => { | |||
// console.log(res); | |||
// } | |||
// }) | |||
} | |||
}, | |||
back:function(){ | |||
@@ -92,6 +92,8 @@ const URL_POST_APPROVALITEMSEDIT = `${URL_PREFIX}/yinnong/approvalItems/edit`; | |||
const URL_POST_TEMPLATEEDIT = `${URL_PREFIX}/service/templateDetail/editBatch`; | |||
//审核事项申请 | |||
const URL_POST_APPROVALITEMSSUBMIT = `${URL_PREFIX}/yinnong/approvalItems/approvalItemsSubmit/`; | |||
//附件上传配置列表 | |||
const URL_GET_SYSCONFIG = `${URL_PREFIX}/system/config/list`; | |||
/****************接口地址end****************/ | |||
export { | |||
@@ -135,5 +137,6 @@ export { | |||
URL_GET_APPROVALITEMSBYID, | |||
URL_POST_APPROVALITEMSEDIT, | |||
URL_POST_TEMPLATEEDIT, | |||
URL_POST_APPROVALITEMSSUBMIT | |||
URL_POST_APPROVALITEMSSUBMIT, | |||
URL_GET_SYSCONFIG | |||
} |