diff --git a/resources/assets/js/pages/manage/approve/details.vue b/resources/assets/js/pages/manage/approve/details.vue index ac04c630f..7d6143700 100644 --- a/resources/assets/js/pages/manage/approve/details.vue +++ b/resources/assets/js/pages/manage/approve/details.vue @@ -10,43 +10,46 @@

- {{$L(datas.proc_def_name)}} + {{$L(datas.proc_def_name || '- -')}} {{$L('待审批')}} {{$L('审批中')}} {{$L('已通过')}} {{$L('已拒绝')}} {{$L('已撤回')}}

-

{{datas.start_user_name}}

+

+ + {{datas.start_user_name}} +

{{$L('提交于')}} {{datas.start_time}}

{{$L('假期类型')}}

-

{{$L(datas.var?.type)}}

+

{{$L(datas.var?.type || '- -')}}

{{$L('开始时间')}}

- {{datas.var?.start_time}} - ({{getWeekday(datas.var?.start_time)}}) + {{datas.var?.start_time || '- -'}} + ({{getWeekday(datas.var?.start_time)}})

{{$L('结束时间')}}

- {{datas.var?.end_time}} - ({{getWeekday(datas.var?.end_time)}}) + {{datas.var?.end_time || '- -'}} + ({{getWeekday(datas.var?.end_time)}})

{{ $L('时长') }}({{getTimeDifference(datas.var?.start_time,datas.var?.end_time)['unit']}})

-

{{ datas.var?.start_time ? getTimeDifference(datas.var?.start_time,datas.var?.end_time)['time'] : 0 }}

+

{{ datas.var?.start_time ? getTimeDifference(datas.var?.start_time,datas.var?.end_time)['time'] : '- -' }}

{{$L('事由')}}

-

{{datas.var?.description}}

+

{{datas.var?.description || '- -'}}

{{$L('图片')}}

@@ -273,7 +276,6 @@ export default { init() { this.modalTransferIndex = window.modalTransferIndex = window.modalTransferIndex + 1 if (this.$route.query.id) { - this.data.id = this.$route.query.id; this.getInfo() } }, @@ -326,7 +328,7 @@ export default { method: 'get', url: 'approve/process/detail', data: { - id: this.data.id, + id: this.$route.query.id || this.data.id, } }).then(({data}) => { var show = true; @@ -422,7 +424,7 @@ export default { method: 'post', url: 'approve/process/addGlobalComment', data: { - proc_inst_id: this.data.id, + proc_inst_id: this.$route.query.id || this.data.id, content: JSON.stringify({ 'content': this.commentData.content, 'pictures': this.commentData.pictures.map(h => { diff --git a/resources/assets/js/pages/manage/approve/index.vue b/resources/assets/js/pages/manage/approve/index.vue index d72e74d0d..9d67cff37 100644 --- a/resources/assets/js/pages/manage/approve/index.vue +++ b/resources/assets/js/pages/manage/approve/index.vue @@ -41,22 +41,23 @@
-
-
{{$L('暂无数据')}}
-
-
-
-
- -
-
- -
+
+ +
+
{{ $L('暂无数据')}}
+
+
+
+
+ +
+
+
-
- -
+
+
+
@@ -71,7 +72,10 @@
-
{{$L('暂无数据')}}
+
+ +
+
{{$L('暂无数据')}}
@@ -101,7 +105,10 @@
-
{{$L('暂无数据')}}
+
+ +
+
{{$L('暂无数据')}}
@@ -132,7 +139,10 @@
-
{{$L('暂无数据')}}
+
+ +
+
{{$L('暂无数据')}}
@@ -383,6 +393,9 @@ export default { this.isShowIcon = val < 515 } }, + activated() { + this.showType = 1 + }, mounted() { this.tabsValue = "unread" this.init() @@ -536,29 +549,8 @@ export default { username: this.approvalName, } }).then(({data}) => { - let activeId = 0; - let activeIndex = 0; - this.unreadTotal = data.total; - if( this.unreadList.length == 0 || this.unreadList.length == data.rows.length){ - this.unreadList?.map((res)=>{ if(res._active) activeId = res.id }) - } - let lists = data.rows.map((h,index)=>{ - h._active = activeId > 0 ? h.id == activeId : index == 0; - if(h._active) activeIndex = index - if(type == 'scroll' && this.unreadList.map(item=>{return item.id}).indexOf(h.id) == -1 ){ - this.unreadList.push(h) - } - return h; - }) - if(type != 'scroll'){ - this.unreadList = lists; - } - if(this.tabsValue == 'unread'){ - this.$nextTick(()=>{ - this.details = this.unreadList[activeIndex] || {} - }) - } - }).catch(({msg}) => { + this.updateData('unread',data,type) + }).catch((msg) => { $A.modalError(msg); }).finally(_ => { this.loadIng = false; @@ -578,28 +570,7 @@ export default { username: this.approvalName, } }).then(({data}) => { - let activeId = 0; - let activeIndex = 0; - this.doneTotal = data.total; - if( this.doneList.length == 0 || this.doneList.length == data.total){ - this.doneList?.map((res)=>{ if(res._active) activeId = res.id }) - } - let lists = data.rows.map((h,index)=>{ - h._active = activeId > 0 ? h.id == activeId : index == 0; - if(h._active) activeIndex = index - if(type == 'scroll' && this.doneList.map(item=>{return item.id}).indexOf(h.id) == -1 ){ - this.doneList.push(h) - } - return h; - }) - if(type != 'scroll'){ - this.doneList = lists; - } - if(this.tabsValue == 'done'){ - this.$nextTick(()=>{ - this.details = this.doneList[activeIndex] || {} - }) - } + this.updateData('done',data,type) }).catch(({msg}) => { $A.modalError(msg); }).finally(_ => { @@ -620,28 +591,7 @@ export default { username: this.approvalName, } }).then(({data}) => { - let activeId = 0; - let activeIndex = 0; - this.notifyTotal = data.total; - if( this.notifyList.length == 0 || this.notifyList.length == data.rows.length){ - this.notifyList?.map((res)=>{ if(res._active) activeId = res.id }) - } - let lists = data.rows.map((h,index)=>{ - h._active = activeId > 0 ? h.id == activeId : index == 0; - if(h._active) activeIndex = index - if(type == 'scroll' && this.notifyList.map(item=>{return item.id}).indexOf(h.id) == -1 ){ - this.notifyList.push(h) - } - return h; - }) - if(type != 'scroll'){ - this.notifyList = lists; - } - if(this.tabsValue == 'notify'){ - this.$nextTick(()=>{ - this.details = this.notifyList[activeIndex] || {} - }) - } + this.updateData('notify',data,type) }).catch(({msg}) => { $A.modalError(msg); }).finally(_ => { @@ -663,28 +613,7 @@ export default { username: this.approvalName, } }).then(({data}) => { - let activeId = 0; - let activeIndex = 0; - this.initiatedTotal = data.total; - if( this.initiatedList.length == 0 || this.initiatedList.length == data.rows.length){ - this.initiatedList?.map((res)=>{ if(res._active) activeId = res.id }) - } - let lists = data.rows.map((h,index)=>{ - h._active = activeId > 0 ? h.id == activeId : index == 0; - if(h._active) activeIndex = index - if(type == 'scroll' && this.initiatedList.map(item=>{return item.id}).indexOf(h.id) == -1 ){ - this.initiatedList.push(h) - } - return h; - }) - if(type != 'scroll'){ - this.initiatedList = lists; - } - if(this.tabsValue == 'initiated'){ - this.$nextTick(()=>{ - this.details = this.initiatedList[activeIndex] || {} - }) - } + this.updateData('initiated',data,type) }).catch(({msg}) => { $A.modalError(msg); }).finally(_ => { @@ -717,6 +646,26 @@ export default { }); }, + // 更新数据 + updateData(key,data,type) { + let listKey = key + 'List' + let activeIndex = this[listKey].map((h, index) => h._active ? index : -1).filter(h => h > -1)[0] || 0 + this[key + 'Total'] = data.total; + type != 'scroll' ? (this[listKey] = data.rows) : data.rows.map(h => { + if (this[listKey].map(item => { return item.id }).indexOf(h.id) == -1) { + this[listKey].push(h) + } + }); + if(this[listKey].length > 0){ + this[listKey][activeIndex]._active = true; + if (this.tabsValue == key) { + this.$nextTick(() => { + this.details = this[listKey][activeIndex] || {} + }) + } + } + }, + // 提交发起 onInitiate(){ this.$refs.initiateRef.validate((valid) => { diff --git a/resources/assets/sass/pages/page-approve.scss b/resources/assets/sass/pages/page-approve.scss index c6aae5bb9..31bbab87e 100644 --- a/resources/assets/sass/pages/page-approve.scss +++ b/resources/assets/sass/pages/page-approve.scss @@ -66,6 +66,11 @@ } } + .approve-load { + text-align: center; + padding-top: 20px; + } + .noData { text-align: center; line-height: 150px; @@ -278,13 +283,18 @@ .approve-process-state { font-size: 12px; color: #19be6b; + height: 21px; } .approve-process-left { margin-left: 10px; flex: 1; + width: 0; .approve-process-desc{ font-size: 12px; + max-width: 100%; + overflow: auto; + word-break:break-all; } } @@ -386,13 +396,15 @@ .approve-load { position: absolute; - top: 0; - left: 24px; - right: 0; - bottom: 0; + top: 1px; + left: 1px; + right: 1px; + bottom: 1px; display: flex; z-index: 9; - background: #ffffff; + // background: #ffffff; + background: #00000005; + } .comment { @@ -492,8 +504,5 @@ body.window-portrait { .approve-head { margin: 24px 16px 6px 16px; } - .approve-mains { - height: calc(100vh - 250px); - } } } \ No newline at end of file