|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
+ <div v-if="info">
|
|
|
<!-- 顶部条-->
|
|
|
<div class="navBarTOP">
|
|
|
<van-nav-bar
|
|
|
@@ -43,10 +43,11 @@
|
|
|
style="background-color: #fff; width: 94%; margin: 0px auto; border-radius: 6px">
|
|
|
<componVisitSummary
|
|
|
:collectionItemLists="collectionItemLists"
|
|
|
+ :approvalStatus="info.approvalStatus"
|
|
|
ref="componVisitSummary"></componVisitSummary>
|
|
|
</div>
|
|
|
<br />
|
|
|
- <div class="approvalRemarh">
|
|
|
+ <div class="approvalRemarh" v-if="source == 'SUPTaskApproval' && approvalType == '1'">
|
|
|
<div class="approvalLabel">审批意见</div>
|
|
|
<div class="remark">
|
|
|
<van-field
|
|
|
@@ -56,15 +57,26 @@
|
|
|
placeholder="请输入审批意见" />
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="bottomBtn">
|
|
|
- <van-button color="red" round @click="approvalStoreFun('Nopass')">拒绝</van-button>
|
|
|
- <van-button type="primary" round @click="approvalStoreFun('pass')">通过</van-button>
|
|
|
- </div>
|
|
|
- <div class="tc" style="padding: 0 16px" v-if="writeAgain">
|
|
|
- <van-button class="submitBtn" block type="info" color="#0057ba" @click="onSubmit">
|
|
|
- 补填保存
|
|
|
- </van-button>
|
|
|
- </div>
|
|
|
+ <!-- 从查询列表来 -->
|
|
|
+ <!-- approvalStatus//1-待审批 2-审批通过 3-拒绝待提交 -->
|
|
|
+ <template v-if="source == 'VisitSummary'">
|
|
|
+ <div class="tc" style="padding: 0 16px" v-if="writeAgain && !info.approvalStatus">
|
|
|
+ <van-button class="submitBtn" block type="info" color="#0057ba" @click="onSubmit">
|
|
|
+ 补填保存
|
|
|
+ </van-button>
|
|
|
+ </div>
|
|
|
+ <div class="tc" style="padding: 0 16px" v-if="info.approvalStatus == '3'">
|
|
|
+ <van-button class="submitBtn" block type="info" color="#0057ba" @click="onSubmit">
|
|
|
+ 提交审批
|
|
|
+ </van-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-if="source == 'SUPTaskApproval' && approvalType == '1'">
|
|
|
+ <div class="bottomBtn">
|
|
|
+ <van-button color="red" round @click="approvalStoreFun('Nopass')">拒绝</van-button>
|
|
|
+ <van-button type="primary" round @click="approvalStoreFun('pass')">通过</van-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<br />
|
|
|
<br />
|
|
|
<br />
|
|
|
@@ -81,12 +93,13 @@ import { ImagePreview } from 'vant';
|
|
|
import deleteUploadImg from '@/components/deleteUploadImg';
|
|
|
import componVisitSummary from '@/views/week/componVisitSummary';
|
|
|
import { writeAgainCustomAnswer } from '@/api/week';
|
|
|
+import { changeApproval } from '@/api/SUPTaskApproval.js';
|
|
|
export default {
|
|
|
name: 'daily',
|
|
|
components: { deleteUploadImg, componVisitSummary },
|
|
|
data() {
|
|
|
return {
|
|
|
- info: {},
|
|
|
+ info: null,
|
|
|
zw: zw,
|
|
|
tm: tm,
|
|
|
ry: ry,
|
|
|
@@ -111,10 +124,14 @@ export default {
|
|
|
collectionItemLists: [],
|
|
|
writeAgain: false,
|
|
|
approvalMessage: '',
|
|
|
+ source: '',
|
|
|
+ approvalType: '',
|
|
|
//
|
|
|
};
|
|
|
},
|
|
|
activated() {
|
|
|
+ this.source = this.$route.query.source || '';
|
|
|
+ this.approvalType = this.$route.query.approvalType || '';
|
|
|
this.powerGrade = localStorage.getItem('powerGrade');
|
|
|
this.getDetailById();
|
|
|
this.num = 0;
|
|
|
@@ -190,9 +207,18 @@ export default {
|
|
|
// });
|
|
|
},
|
|
|
onClickLeft() {
|
|
|
- this.$router.replace({
|
|
|
- path: '/VisitSummary',
|
|
|
- });
|
|
|
+ if (this.source == 'SUPTaskApproval') {
|
|
|
+ this.$router.replace({
|
|
|
+ path: '/SUPTaskApproval',
|
|
|
+ query: {
|
|
|
+ tabVal: this.approvalType,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$router.replace({
|
|
|
+ path: '/VisitSummary',
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
onSubmit() {
|
|
|
let collectionAnswerlisd = this.$refs.componVisitSummary.collectionAnswerlisd;
|
|
|
@@ -236,31 +262,30 @@ export default {
|
|
|
},
|
|
|
approvalStoreFun(type) {
|
|
|
if (type == 'pass') {
|
|
|
- for (var c = 0; c < this.collectionAnswerlisd.length; c++) {
|
|
|
- for (var b = 0; b < this.collectionItemList.length; b++) {
|
|
|
- if (this.collectionAnswerlisd[c].id == this.collectionItemList[b].customId) {
|
|
|
- this.collectionItemList[b].customOptionList = this.collectionAnswerlisd[c].value;
|
|
|
- }
|
|
|
- }
|
|
|
+ this.changeApprovalFun('1');
|
|
|
+ } else {
|
|
|
+ if (this.approvalMessage != '') {
|
|
|
+ this.changeApprovalFun('2');
|
|
|
+ } else {
|
|
|
+ this.$notify({ type: 'warning', message: '请输入审批意见' });
|
|
|
}
|
|
|
- if (this.flagclick) {
|
|
|
- this.flagclick = false;
|
|
|
- this.timer = null;
|
|
|
- this.timer = setTimeout(() => {
|
|
|
- this.flagclick = true;
|
|
|
- }, 2000);
|
|
|
- insertCustomAnswer({
|
|
|
- userSummaryId: this.userSummaryId, // Long 用户总结id,如果为新增则不填,编辑则必填
|
|
|
- summaryId: this.summaryId, //Long 主管任务id
|
|
|
- customItemList: this.collectionItemList, //List<Object> 答案列表
|
|
|
- }).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.$router.go(-1);
|
|
|
- }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ changeApprovalFun(approvalStatus) {
|
|
|
+ this.toastLoading(0, '加载中...', true);
|
|
|
+ changeApproval({
|
|
|
+ summaryApprovalId: this.$route.query.summaryApprovalId || '', // Long 主管任务审批id
|
|
|
+ userSummaryId: this.$route.query.userSummaryId, // Long 主管任务填写主键id
|
|
|
+ approvalStatus: approvalStatus, // string 审批状态:1-通过 2-拒绝
|
|
|
+ approvalOpinion: this.approvalMessage, // string 审批意见,如果审批状态为拒绝则不能为空
|
|
|
+ }).then((res) => {
|
|
|
+ this.toastLoading().clear();
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$router.replace({
|
|
|
+ path: '/SUPTaskApproval',
|
|
|
});
|
|
|
}
|
|
|
- } else {
|
|
|
- }
|
|
|
+ });
|
|
|
},
|
|
|
},
|
|
|
};
|
|
|
@@ -332,6 +357,7 @@ export default {
|
|
|
width: 94%;
|
|
|
margin: 0px auto;
|
|
|
border-radius: 6px;
|
|
|
+ margin-bottom: 40px;
|
|
|
.approvalLabel {
|
|
|
font-size: 14px;
|
|
|
padding: 5px 0;
|