소스 검색

前端优化

master
pangdongxu 3 년 전
부모
커밋
7e9e520a5a
6개의 변경된 파일71개의 추가작업 그리고 54개의 파일을 삭제
  1. +48
    -35
      pages/handle/expenditureAudit/expenditureAudit.js
  2. +10
    -10
      pages/handle/expenditureAudit/expenditureAudit.wxml
  3. +1
    -1
      pages/index/index.js
  4. +6
    -6
      pages/index/index.wxml
  5. +5
    -1
      utils/API.js
  6. +1
    -1
      utils/util.js

+ 48
- 35
pages/handle/expenditureAudit/expenditureAudit.js 파일 보기

@@ -14,40 +14,8 @@ Page({
*/
data: {
isIPX: app.globalData.isIPX,
steps: [
{
assigneeName: '同意',
activityName: '测试测试',
durationInMillis: '描述信息',
endTime: '2022-01-02',
comment: '同意',
type: '1'
},
{
assigneeName: '申请中',
activityName: '测试测试',
durationInMillis: '描述信息',
endTime: '2022-01-02',
comment: '同意',
type: '2'
},
{
assigneeName: '驳回',
activityName: '测试测试',
durationInMillis: '描述信息',
endTime: '2022-01-02',
comment: '同意',
type: '3'
},
{
assigneeName: '步骤四',
activityName: '测试测试',
durationInMillis: '描述信息',
endTime: '2022-01-02',
comment: '同意'
},
],
active:0
active:0,
spsxOptions:[]
},

/**
@@ -56,6 +24,9 @@ Page({
onLoad: function (options) {
var that = this;
console.log(options);
that.setData({
taskId:options.taskId
})
UTIL.httpRequest(API.URL_GET_GETINFO, {method:'GET'}, {
success: (res) => {
if (res.code == API.SUCCESS_CODE) {
@@ -264,10 +235,52 @@ Page({
UTIL.httpRequest(API.URL_GET_GETPROCESS+options.id , {method:'GET'}, {
success: (res) => {
console.log(res);
that.setData({
spsxOptions:res.data.processSchedule.spsx,
instanceId:res.data.instanceId
})
}
})
},
goDis(){
var that = this ;
let data = {
taskId:that.data.taskId,
instanceId:that.data.instanceId,
variables:JSON.stringify({
comment:'驳回',
pass:false,
}),
method:'POST'
};
UTIL.httpRequest(API.URL_GET_PROCESSCOMPLETE , data, {
success: (res) => {
console.log(res);
// that.setData({
// spsxOptions:res.data.processSchedule.spsx
// })
}
})
},
goAgree(){
var that = this ;
let data = {
taskId:that.data.taskId,
instanceId:that.data.instanceId,
variables:JSON.stringify({
"comment":'同意',
"pass":true,
})
};
UTIL.httpRequest(API.URL_GET_PROCESSCOMPLETE ,data, {
success: (res) => {
console.log(res);
// that.setData({
// spsxOptions:res.data.processSchedule.spsx
// })
}
})
},

/**
* 生命周期函数--监听页面初次渲染完成
*/


+ 10
- 10
pages/handle/expenditureAudit/expenditureAudit.wxml 파일 보기

@@ -164,7 +164,7 @@

<view class="main-box steps-box">
<view class="steps-tit">审批流程</view>
<van-row wx:for="{{steps}}" wx:key="index">
<van-row wx:for="{{spsxOptions}}" wx:key="index">
<van-col span="3">
<view class="index">{{index+1}}</view>
<!-- :class="{'indexCenter':index==0 ? false : true}" -->
@@ -172,29 +172,29 @@
<view class="indexBorder">
<view class="ssT" wx:if="{{index>0}}"></view>
<view class="yq"></view>
<view class="ss" wx:if="{{steps.length != index+1}}"></view>
<view class="ss" wx:if="{{spsxOptions.length != index+1}}"></view>
</view>
</block>
<block wx:else>
<view class="indexBorder indexCenter">
<view class="ssT" wx:if="{{index>0}}"></view>
<view class="yq"></view>
<view class="ss" wx:if="{{steps.length != index+1}}"></view>
<view class="ss" wx:if="{{spsxOptions.length != index+1}}"></view>
</view>
</block>
</van-col>
<van-col span="21">
<van-cell title="{{item.activityName}}" center="{{true}}" border="{{false}}">
<view class="agree" wx:if="{{item.type=='1'}}">{{ item.assigneeName }}</view>
<view class="in" wx:if="{{item.type=='2'}}">{{ item.assigneeName }}</view>
<view class="disagree" wx:if="{{item.type=='3'}}">{{ item.assigneeName }}</view>
<van-cell title="{{item.assigneeName}}{{item.deptLabel}}" center="{{true}}" border="{{false}}">
<view class="agree" wx:if="{{item.type=='1'}}">{{ item.comment }}</view>
<view class="in" wx:if="{{item.type=='2'}}">{{ item.comment }}</view>
<view class="disagree" wx:if="{{item.type=='3'}}">{{ item.comment }}</view>
</van-cell>

<van-cell center border="{{false}}">
<view slot="title">
<view style="color: #999999;">{{ item.durationInMillis }}</view>
</view>
<view style="color: #999999;font-size: 12px;">{{ item.endTime }}</view>
<view style="color: #999999;font-size: 12px;">{{ item.time.substr(0,10) }}</view>
</van-cell>
</van-col>
</van-row>
@@ -202,6 +202,6 @@
</view>
</block>
<view class="bottom">
<button type="warn" plain class="btnDis">驳回</button>
<button type="primary" class="btnAgree">同意</button>
<button type="warn" plain class="btnDis" bindtap="goDis">驳回</button>
<button type="primary" class="btnAgree" bindtap="goAgree">同意</button>
</view>

+ 1
- 1
pages/index/index.js 파일 보기

@@ -473,7 +473,7 @@ Page({
},
gosee:function(e){
wx.navigateTo({
url: '/pages/handle/expenditureAudit/expenditureAudit?id='+e.currentTarget.dataset.id,
url: '/pages/handle/expenditureAudit/expenditureAudit?id='+e.currentTarget.dataset.id+'&taskId='+e.currentTarget.dataset.taskid,
})
},
})

+ 6
- 6
pages/index/index.wxml 파일 보기

@@ -100,7 +100,7 @@
</view>

<scroll-view scroll-y="true" style="height: {{wrokScrollHeight}}px;" >
<view class="workflow" wx:if="{{active=='1'}}" wx:for-item="item" wx:for="{{todoList}}" wx:key="id" data-id="{{item.formData.id}}" bindtap="gosee">
<view class="workflow" wx:if="{{active=='1'}}" wx:for-item="item" wx:for="{{todoList}}" wx:key="id" data-id="{{item.formData.id}}" data-taskId="{{item.taskId}}" bindtap="gosee">
<!--1-->
<view class="workflow_list">
<view class="process_intro">
@@ -111,7 +111,7 @@
<view class="process_pay">
<view class="describe">
<image class="amount_icon" src="../../image/index/process_icon.png" mode="aspectFit"></image>
<text class="textLimit">{{item.formData.remark}}</text>
<text class="textLimit">{{item.formData.activityBusinessType=='35'?'现金转账':'银行转账'}}</text>
</view>
<view class="amount"><text class="unit">¥</text>{{item.formData.totalAmount}}</view>
</view>
@@ -121,16 +121,16 @@
<!--1-->
<view class="workflow_list">
<view class="process_intro">
<view class="name">{{item.formData.payer}}</view>
<view class="name">{{item.formData.approvalItems}}</view>
<!-- <view class="state">已审</view> -->
<view class="time">{{item.formData.applyDate}}</view>
<view class="time">{{item.formData.applyTime}}</view>
</view>
<view class="process_pay">
<view class="describe">
<image class="amount_icon" src="../../image/index/process_icon.png" mode="aspectFit"></image>
<text class="textLimit">{{item.formData.remark}}</text>
<text class="textLimit">{{item.formData.activityBusinessType=='35'?'现金转账':'银行转账'}}</text>
</view>
<view class="amount"><text class="unit">¥</text>{{item.formData.expenditureAmount}}</view>
<view class="amount"><text class="unit">¥</text>{{item.formData.totalAmount}}</view>
</view>
</view>
</view>


+ 5
- 1
utils/API.js 파일 보기

@@ -128,6 +128,9 @@ const URL_GET_REMOVEAPPROVAL = `${URL_PREFIX}/yinnong/approvalItems/remove/`;
//查询审批事项流转进度
const URL_GET_GETPROCESS = `${URL_PREFIX}/yinnong/approvalItems/getProcessSchedule/`;

//审批流办理
const URL_GET_PROCESSCOMPLETE = `${URL_PREFIX}/activiti/process/mobileComplete`;

/****************接口地址end****************/

export {
@@ -183,5 +186,6 @@ export {
URL_GET_FINDLIST,
URL_GET_APPROVALITEMS,
URL_GET_REMOVEAPPROVAL,
URL_GET_GETPROCESS
URL_GET_GETPROCESS,
URL_GET_PROCESSCOMPLETE
}

+ 1
- 1
utils/util.js 파일 보기

@@ -118,7 +118,7 @@ function httpRequest(url, data, {
wx.request({
url,
data: finalData,
method:data.method,
method:data.method?data.method:'POST',
timeout: 60000,
header: {
'Authorization':'Bearer '+getApp().globalData.userInfo.token


불러오는 중...
취소
저장