|
@@ -8,88 +8,60 @@
|
|
|
</van-tab>
|
|
|
<van-tab title="审批意见">
|
|
|
<div class="flowOpinionBox">
|
|
|
- <template v-for="(tItem,tIndex) in templateOpinions">
|
|
|
- <template v-if="tItem['opinions'].length > 0">
|
|
|
- <div v-for="(item,index) in tItem['opinions']" :key="tIndex-index" :class="{'flowOpinionItem': true, 'disabled': !item['isEditor']}">
|
|
|
- <h4>{{ tItem['opinionName'] }}</h4>
|
|
|
- <div class="content">
|
|
|
- <template v-if="item['isEditor']">
|
|
|
- <van-field
|
|
|
- v-model="currentOpinion.opinionContent"
|
|
|
- rows="3"
|
|
|
- autosize
|
|
|
- label=""
|
|
|
- type="textarea"
|
|
|
- maxlength="50"
|
|
|
- placeholder="请输入留言"
|
|
|
- />
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <van-field
|
|
|
- v-model="item.opinionContent"
|
|
|
- rows="3"
|
|
|
- autosize
|
|
|
- label=""
|
|
|
- type="textarea"
|
|
|
- :disabled="true"
|
|
|
- maxlength="50"
|
|
|
- placeholder="请输入留言"
|
|
|
- />
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- <div class="footer">
|
|
|
- <p>
|
|
|
- <span>办理人:</span>
|
|
|
- <span v-if="item['isEditor']">
|
|
|
- <template v-if="currentOpinion['sign'] && currentOpinion['sign'].indexOf('http') !== -1">
|
|
|
- <img class="signImg" :src="currentOpinion['sign']" />
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- {{ currentOpinion['sign'] }}
|
|
|
- </template>
|
|
|
- </span>
|
|
|
- <span v-else>
|
|
|
- <template v-if="item['sign'] && item['sign'].indexOf('http') !== -1">
|
|
|
- <img class="signImg" :src="item['sign']" />
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- {{ item['sign'] }}
|
|
|
- </template>
|
|
|
- </span>
|
|
|
- </p>
|
|
|
- <p>
|
|
|
- <span>办理时间:</span>
|
|
|
- <span>{{ item['isEditor'] ? currentOpinion['opinionTime'] : item['opinionTime']}}</span>
|
|
|
- </p>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <div class="flowOpinionItem" :key="tIndex">
|
|
|
- <h4>{{ tItem['opinionName'] }}</h4>
|
|
|
- <div class="content">
|
|
|
+ <template v-if="templateOpinion.length > 0">
|
|
|
+ <div v-for="(item,index) in templateOpinion" :key="index" :class="{'flowOpinionItem': true, 'disabled': !item['isEditor']}">
|
|
|
+ <h4>{{ item['opinionName'] }}</h4>
|
|
|
+ <div class="content">
|
|
|
+ <template v-if="item['isEditor']">
|
|
|
+ <van-field
|
|
|
+ v-model="currentOpinion.opinionContent"
|
|
|
+ rows="3"
|
|
|
+ autosize
|
|
|
+ label=""
|
|
|
+ type="textarea"
|
|
|
+ maxlength="50"
|
|
|
+ placeholder="请输入留言"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
<van-field
|
|
|
- rows="3"
|
|
|
- autosize
|
|
|
- label=""
|
|
|
- type="textarea"
|
|
|
- :disabled="true"
|
|
|
- maxlength="50"
|
|
|
- placeholder="请输入留言"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div class="footer">
|
|
|
- <p>
|
|
|
- <span>办理人:</span>
|
|
|
- <span></span>
|
|
|
- </p>
|
|
|
- <p>
|
|
|
- <span>办理时间:</span>
|
|
|
- <span></span>
|
|
|
- </p>
|
|
|
- </div>
|
|
|
+ v-model="item.opinionContent"
|
|
|
+ rows="3"
|
|
|
+ autosize
|
|
|
+ label=""
|
|
|
+ type="textarea"
|
|
|
+ :disabled="true"
|
|
|
+ maxlength="50"
|
|
|
+ placeholder="请输入留言"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <div class="footer">
|
|
|
+ <p>
|
|
|
+ <span>办理人:</span>
|
|
|
+ <span v-if="item['isEditor']">
|
|
|
+ <template v-if="currentOpinion['sign'] && currentOpinion['sign'].indexOf('http') !== -1">
|
|
|
+ <img class="signImg" :src="currentOpinion['sign']" />
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ {{ currentOpinion['sign'] ?? currentUserName }}
|
|
|
+ </template>
|
|
|
+ </span>
|
|
|
+ <span v-else>
|
|
|
+ <template v-if="item['sign'] && item['sign'].indexOf('http') !== -1">
|
|
|
+ <img class="signImg" :src="item['sign']" />
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ {{ item['sign'] ?? userMap[item['userId'] ]}}
|
|
|
+ </template>
|
|
|
+ </span>
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ <span>办理时间:</span>
|
|
|
+ <span>{{ item['isEditor'] ? currentOpinion['opinionTime'] : item['opinionTime']}}</span>
|
|
|
+ </p>
|
|
|
</div>
|
|
|
- </template>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</van-tab>
|
|
@@ -110,6 +82,7 @@
|
|
|
<script setup lang="ts">
|
|
|
import { showNotify } from 'vant';
|
|
|
import { closePage } from 'dingtalk-jsapi';
|
|
|
+import { getSimpleUserMap } from '@/service/user'
|
|
|
import { formatDate, jsonToFormData } from "@/utils/common";
|
|
|
import { FlowDTO, getNextActivity } from "@/service/flow";
|
|
|
import { getTemplateOpinionListByFlowInstanceId, getOpinionListByFlowInstanceId } from '@/service/flow';
|
|
@@ -122,6 +95,13 @@ const isSubmitDisabled = ref<boolean>(false)
|
|
|
const userInfo = JSON.parse(localStorage.getItem('_userInfo') as string);
|
|
|
const signatureUrl: string = userInfo ? userInfo['signatureUrl'] ?? '' : ''
|
|
|
const currentUserName: string = userInfo ? userInfo['nickname'] ?? '' : ''
|
|
|
+
|
|
|
+const userMap = ref<any>({})
|
|
|
+async function initSimpleUserMap() {
|
|
|
+ userMap.value = await getSimpleUserMap()
|
|
|
+}
|
|
|
+initSimpleUserMap()
|
|
|
+
|
|
|
defineProps<{
|
|
|
data: any
|
|
|
}>();
|
|
@@ -147,52 +127,52 @@ const currentOpinion = ref({
|
|
|
sign: ''
|
|
|
})
|
|
|
const isShowTab = ref<boolean>(true)
|
|
|
-const templateOpinions = ref<any[]>([]);
|
|
|
-getTemplateOpinionListByFlowInstanceId(flowInstanceId).then((tResult) => {
|
|
|
+const templateOpinion = ref<any[]>([]) //用来缓存展示节点
|
|
|
+
|
|
|
+const initTemplateOptinionFunc = async () => {
|
|
|
+ const templateOpinions = [];
|
|
|
+ const tResult = await getTemplateOpinionListByFlowInstanceId(flowInstanceId);
|
|
|
const tList = tResult.data ?? []
|
|
|
- getOpinionListByFlowInstanceId(flowInstanceId).then((oResult) => {
|
|
|
- const oList = oResult.data ?? []
|
|
|
- if(oList.length === 0){
|
|
|
- isShowTab.value = false;
|
|
|
+ const oResult = await getOpinionListByFlowInstanceId(flowInstanceId);
|
|
|
+ const oList = oResult.data ?? []
|
|
|
+ if (oList.length === 0) {
|
|
|
+ isShowTab.value = false;
|
|
|
+ }
|
|
|
+ for (let j = 0; j < oList.length; j++) {
|
|
|
+ const oItem = oList[j]
|
|
|
+ if (oItem['status'] == '40') {
|
|
|
+ oList.splice(j, 1);
|
|
|
+ j--;
|
|
|
+ continue;
|
|
|
}
|
|
|
- if (oList.length > 0) {
|
|
|
- for (let i = 0; i < tList.length; i++) {
|
|
|
- const tItem = tList[i];
|
|
|
- if (tItem['iDisplayOpinion'] === 0) {
|
|
|
- tList.splice(i, 1)
|
|
|
- i--;
|
|
|
- continue;
|
|
|
- }
|
|
|
- tItem['opinions'] = []
|
|
|
-
|
|
|
- for (let j = 0; j < oList.length; j++) {
|
|
|
- const oItem = oList[j]
|
|
|
- if (tItem['id'] === oItem['flowOpinionId']) {
|
|
|
- if (_o !== 'v' && oItem['activityInstanceId'] === activityInstanceId) {
|
|
|
- oItem['isEditor'] = true;
|
|
|
- currentOpinion.value.id = oItem['id']
|
|
|
- currentOpinion.value.opinionContent = oItem['opinionContent'] ?? '同意'
|
|
|
- currentOpinion.value.opinionTime = formatDate(new Date())
|
|
|
- currentOpinion.value.sign = signatureUrl ? signatureUrl : currentUserName;
|
|
|
- }
|
|
|
- oItem['opinionTime'] = oItem['opinionTime'] ? formatDate(new Date(oItem['opinionTime'])) : ''
|
|
|
- tItem['opinions'].push(oItem);
|
|
|
- break;
|
|
|
- } else {
|
|
|
- if (j === oList.length - 1) {
|
|
|
- if (tItem['iHideNonFilledComment'] == 1) {
|
|
|
- tList.splice(i, 1)
|
|
|
- i--;
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ const tItems = tList.filter((item: any) => {
|
|
|
+ return item['id'] === oItem['flowOpinionId']
|
|
|
+ })
|
|
|
+ if (tItems.length > 0) {
|
|
|
+ const tItem = tItems[0]
|
|
|
+ if (_o !== 'v' && oItem['activityInstanceId'] === activityInstanceId && oItem['participantId'] === participant) {
|
|
|
+ oItem['isEditor'] = true;
|
|
|
+ currentOpinion.value.id = oItem['id']
|
|
|
+ currentOpinion.value.opinionContent = oItem['opinionContent'] ?? '同意'
|
|
|
+ currentOpinion.value.opinionTime = formatDate(new Date())
|
|
|
+ currentOpinion.value.sign = signatureUrl ? signatureUrl : null;
|
|
|
}
|
|
|
+ oItem['opinionTime'] = oItem['opinionTime'] ? formatDate(new Date(oItem['opinionTime'])) : ''
|
|
|
+ if (tItem['iHideNonFilledComment'] == 1 && !oItem['opinionContent'] && oItem['activityInstanceId'] !== activityInstanceId) continue;
|
|
|
+ templateOpinions.push({
|
|
|
+ opinionName: tItem['opinionName'],
|
|
|
+ opinionUserText: tItem['opinionUserText'],
|
|
|
+ opinionTimeText: tItem['opinionTimeText'],
|
|
|
+ ...oItem
|
|
|
+ })
|
|
|
}
|
|
|
- templateOpinions.value = tList
|
|
|
+ }
|
|
|
+ templateOpinions.sort((a, b) => {
|
|
|
+ return a.isEditor === b.isEditor ? 0 : a.isEditor ? -1 : 1
|
|
|
})
|
|
|
-})
|
|
|
+ templateOpinion.value = templateOpinions;
|
|
|
+}
|
|
|
+initTemplateOptinionFunc();
|
|
|
|
|
|
const activityData: FlowDTO = {
|
|
|
activityInstanceId,
|