<template>
|
<view class="uni-task-detail">
|
<!-- #ifdef MP-DINGTALK-->
|
<!-- -->
|
<uni-nav-bar dark :fixed="true" shadow background-color="#007AFF" color="#fff" status-bar
|
:left-icon="taskData.atten=='0' ? 'star' : 'star-filled'" right-icon="" right-text="" left-text=""
|
leftWidth="45px" rightWidth="72px" :title="navigationBarTitle" @clickTitle="clickBarTitle">
|
<view class="uni-navbar-container-inner">
|
<text class="uni-nav-bar-text">{{navigationBarTitle }}</text>
|
</view>
|
<template v-slot:left>
|
<uni-icons v-if="!isNavigateToUrl" type="home" size="20" color="#fff"
|
@click="clickMainPage"></uni-icons>
|
<view :style="{display:'inline-block',width:isNavigateToUrl ?'22px':'4px'}"></view>
|
<uni-icons :type="taskData.atten=='0' ?'star-filled': 'star'" size="20"
|
:color="taskData.atten=='0'?'orange':'#fff'" @click="setAtten"></uni-icons>
|
|
</template>
|
</uni-nav-bar>
|
<!-- #endif-->
|
|
<!-- #ifdef MP-WEIXIN || MP-LARK -->
|
<uni-nav-bar :fixed="true" status-bar :left-icon="taskData.atten=='0' ? 'star' : 'star-filled'" right-icon=""
|
right-text="" left-text="" leftWidth="48px" rightWidth="72px" :title="navigationBarTitle"
|
@clickTitle="clickBarTitle">
|
<view class="uni-navbar-container-inner">
|
<text class="uni-nav-bar-text">{{navigationBarTitle }}</text>
|
</view>
|
<template v-slot:left>
|
<uni-icons v-if="isNavigateToUrl" type="left" size="20" color="#000"
|
@click="clickNavigateBack"></uni-icons>
|
<uni-icons v-else type="home" size="20" color="#000" @click="clickMainPage"></uni-icons>
|
<view :style="{display:'inline-block',width:'4px'}"></view>
|
|
<uni-icons :type="taskData.atten=='0' ?'star-filled': 'star'" size="22"
|
:color="taskData.atten=='0'?'orange':'#000'" @click="setAtten"></uni-icons>
|
</template>
|
</uni-nav-bar>
|
<!-- #endif-->
|
<view class="flex items-center flex-nowrap flex-clz">
|
<view class="flex flex-direction-column tabs-clz">
|
<view class="gungho-tabs text-center">
|
<view class="gungho-tab-item" :class="{'cur text-blue':index == currentPage}"
|
v-for="(item, index) in pageTabs" :key="index" @click="changeTabs(index)" :data-index="index">
|
<text :class="item.icon"></text>
|
<text style="padding-left: 5px;">{{item.text}}</text>
|
</view>
|
<view class="text-clz fs-Ellipsis-h" @click="clickMenu"></view>
|
</view>
|
</view>
|
</view>
|
|
<view class="uni-panel">
|
<swiper class="uni-panel-body" :current="currentPage" @change="changeSwiper">
|
<swiper-item><!-- :style="{'height':taskData.showBottomBtn ? 'calc(100% - '+ (bottomHeight + safeAreaBottom)+ 'px);' :'100%'}" -->
|
<view class="uni-panel-c">
|
<view class='uni-panel-cc'>
|
<view class="uni-panel-w">
|
<view class="uni-panel-w2">
|
<view class="uni-panel-h">
|
<view class="flex uni-panel-state">
|
<text v-if="taskData.stateIcon=='fs-mail_close'"
|
class="uni-panel-state fs-mail_close" style="color:#ffdf04 "></text>
|
<text v-else-if="taskData.stateIcon=='fs-run_man'"
|
class="uni-panel-state fs-run_man"></text>
|
<text v-else-if="taskData.stateIcon=='fs-mail_open'"
|
class="uni-panel-state fs-mail_open"></text>
|
<text v-else style="color:#5eac82" class="uni-panel-state"
|
:class='taskData.stateIcon'></text>
|
</view>
|
<view class="uni-panel-title">
|
<text class="uni-panel-title-text">{{taskData.Name}}</text>
|
<view v-if="taskData.Quadrant==3" class="uni-panel-tag">
|
<view class="uni-panel-tag-red">重 急</view>
|
</view>
|
<view v-else-if="taskData.Quadrant==2"
|
class="uni-panel-tag uni-panel-tag-blue">急</view>
|
<view v-else-if="taskData.Quadrant==1"
|
class="uni-panel-tag uni-panel-tag-orange">重</view>
|
<view v-else="taskData.Quadrant==0" class="uni-panel-tag ">
|
</view>
|
</view>
|
</view>
|
<view class="uni-panel-c2">
|
<view class="uni-panel-subline">
|
<text class="uni-panel-icon fs-digit_edit"></text>
|
<text class="uni-panel-text">{{taskData.Code}}</text>
|
</view>
|
<view class="uni-panel-subline">
|
<text class="uni-panel-icon fs-task1"></text>
|
<text class="uni-panel-text">{{taskData.State}}</text>
|
</view>
|
|
<view class="uni-panel-subline">
|
<text class="uni-panel-icon fs-create"></text>
|
<text class="uni-panel-text">{{taskData.CreatorName}}</text>
|
</view>
|
|
<!-- <view class="uni-panel-subline"
|
:class="{'text-blue':taskData.atten!='0'}" @click="setAtten">
|
<text class="uni-panel-icon fs-favor_fill_light"
|
:class="taskData.atten=='0' ?'fs-star':'fs-favor_fill_light'"></text>
|
<text class="uni-panel-text">关注</text>
|
</view> -->
|
<view class="uni-panel-subline">
|
<text class="uni-panel-icon fs-time_x"></text>
|
<text class="uni-panel-text">{{taskData.dateCreate}}</text>
|
</view>
|
<view class="uni-panel-subline">
|
<text class="uni-panel-icon fs-event_delay"></text>
|
<text class="uni-panel-text"
|
style="margin-right: 5px;">{{taskData.dateStart ? taskData.dateStart: "无"}}</text>
|
<text class="uni-panel-icon-set fs-set " @click="changePlanStart()"
|
v-if="canResetTask"></text>
|
</view>
|
<view class="uni-panel-subline">
|
<text class="uni-panel-icon fs-Due"></text>
|
<text class="uni-panel-text"
|
style="margin-right: 5px;">{{taskData.dateDue ? taskData.dateDue: "无"}}</text>
|
<text v-if="taskData.Minute" class="uni-panel-text"
|
:style="{color:taskData.MinuteColor}">{{taskData.Minute}}</text>
|
<text class="uni-panel-icon-set fs-set " @click="changePlanDue()"
|
v-if="canResetTask"></text>
|
</view>
|
<view class="uni-panel-subline" v-if="taskData.Takeon">
|
<text class="uni-panel-icon fs-run_man"></text>
|
<text class="uni-panel-text">{{taskData.TakeonName}}</text>
|
<text class="uni-panel-icon-set fs-set " @click="changeTakeonUser()"
|
v-if="canResetTask"></text>
|
<text class="uni-panel-icon-set fs-notice " @click="onUrging()"
|
v-if="canUrgingTask"></text>
|
</view>
|
<view class="uni-panel-subline" v-if="taskData.Pic">
|
<text class="uni-panel-icon fs-MyList2"></text>
|
<text class="uni-panel-text">{{taskData.PicName}}</text>
|
<text class="uni-panel-icon-set fs-set " @click="changePic()"
|
v-if="canResetTask"></text>
|
</view>
|
<view class="uni-panel-subline" v-if="taskData.PrjID">
|
<text class="uni-panel-icon fs-project" style="font-size: 14px"></text>
|
<text class="uni-panel-text">{{taskData.PrjName}}</text>
|
</view>
|
|
</view>
|
<view class="uni-panel-relpsn" v-if="hasAuditor || canResetTask">
|
<text class="uni-panel-icon fs-Audit" style="font-size: 14px"></text>
|
<view class="uni-panel-relpsn-user">
|
<view v-for="(itemAuditor,index) in taskData.AuditorSet" :key="index"
|
class="item" @longpress="clickDelAuditor(itemAuditor)">
|
<uni-tag :text="itemAuditor.Name" :circle="true"></uni-tag>
|
|
</view>
|
<view class="uni-panel-icon-add fs-CirclPlus " @click="AddAuditor"
|
v-if="canResetTask"></view>
|
|
</view>
|
|
<!-- <view class="uni-panel-relpsn-user"><text style="margin-right: 5px;"
|
v-for="(item,index) in taskData.auditors"
|
:key="item.ID">{{item.Name}}</text></view> -->
|
</view>
|
<view class="uni-panel-relpsn" v-if="hasRelUser || canResetTask">
|
<text class="uni-panel-icon fs-link" style="font-size: 14px"></text>
|
<view class="uni-panel-relpsn-user">
|
<view v-for="(itemRel,index) in taskData.RelPerson" :key="index"
|
class="item" @longpress="clickDelRelUser(itemRel)">
|
<uni-tag :text="itemRel.name" :circle="true"></uni-tag>
|
|
</view>
|
<view class="uni-panel-icon-add fs-CirclPlus " @click="AddRelPerson"
|
v-if="canResetTask"></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="uni-panel-w2" v-if="hasAttach || canResetTask"
|
style="border-bottom: 1px solid #ddd;">
|
<view class="uni-panel-h2" @click="clickAttachPanel">
|
<text class="uni-panel-icon fs-attach" style="padding-top: 8px;"></text>
|
<text class="uni-panel-subtitle">附件</text>
|
<text class="uni-panel-icon" style="padding-top: 8px;"
|
:class="isOpenAttachPanel? 'fs-ArrowUp' : 'fs-ArrowDown'"></text>
|
</view>
|
<view v-show="isOpenAttachPanel" class="uni-panel-attach">
|
<view class="uni-panel-hh" v-if="canResetTask">
|
<text class="uni-panel-text gray-text">
|
上传附件</text>
|
<view class="uni-panel-icon-btn fs-floder" v-if="isCanSelFile"
|
@click="clickSelFile(false)"></view>
|
<view class="uni-panel-icon-btn fu-yuyin" v-if="isVoiceRecord"
|
@touchstart="voiceStart" @touchmove.stop.prevent="voiceIng"
|
@touchend="voiceEnd" @touchcancel="voiceCancel">
|
</view>
|
|
<view class="uni-panel-icon-btn fs-picture"
|
@click="clickChooseImage(false)"></view>
|
<view class="uni-panel-icon-btn fs-camera" v-if="isMobilePlatform"
|
@click="clickCamera(false)"></view>
|
</view>
|
<view class="uni-panel-upfile" v-if="taskData.upfile_file">
|
<view class="uni-panel-upfile-item"
|
v-for="(item,index) in taskData.upfile_file"
|
:style="{background:item.color}" :key="index"
|
@click="openTaskFile(false,item)"
|
@longpress="clickDelTaskFile(false,item,index)">
|
<view
|
v-if="!(item.isImg|| item.isVideo|| item.isAudio) || ( ( item.isImg|| item.isVideo|| item.isAudio)&& !item.path)"
|
class="uni-panel-upfile-item-name">{{item.DispName }}</view>
|
<text v-if="!(item.isImg || item.isVideo|| item.isAudio)"
|
class="uni-panel-upfile-item-size">{{item.size}}</text>
|
<image v-if=" (item.isImg && item.path) && !item.isVideo"
|
class="uni-panel-upfile-img" :src="item.path" mode="widthFix" />
|
<!-- <image v-if="item.isVideo" class="uni-panel-video-playIcon" src="@/static/play.png" mode="widthFix"></image> -->
|
<jvideo v-if="item.isVideo && item.path" :url="item.path" width="192rpx"
|
height="192rpx" :len="item.duration || 0"></jvideo>
|
<viewAudio v-if="item.isAudio && item.path" class="voice"
|
:audioSrc="item.path" :playingSrc="playAudioPath"
|
:audioLen="item.duration || 0" @playVoice="playVoice(item)">
|
</viewAudio>
|
<text v-if="item.errMsg" class="uni-panel-icon fs-wrong"
|
style="position: absolute; bottom:5rpx; right: 5rpx; color: #fd3c46;"
|
@click="onErrInfo(item.errMsg)"></text>
|
<!-- #ifdef MP-WEIXIN -->
|
<circleProgressBar v-if="item.isTransferring"
|
style="position: absolute; top: 50rpx; left: 50rpx;" :size="100"
|
:border_width="16" border_back_color='#ccc' background='#ffffff80'
|
:pro="item.percent/100" />
|
<!-- #endif-->
|
</view>
|
</view>
|
</view>
|
</view>
|
|
<view class="uni-panel-w2">
|
<view class="uni-panel-h2">
|
<text class="uni-panel-subtitle">任务描述</text>
|
<text v-if="canResetTask" class="uni-panel-icon fs-txt_edit"
|
style="padding-top: 8px;" @click="clickEditDesc"></text>
|
</view>
|
<view class="uni-panel-desc">
|
<rich-text v-for="(item,index) in contentHtml" preview="true"
|
@click="previewDescImage" :key="index" :data-nodes="[item]"
|
:nodes="[item]"></rich-text>
|
<!-- <rich-text preview="true" @click="previewImage" :data-nodes="contentHtml" :nodes="contentHtml"></rich-text> -->
|
</view>
|
</view>
|
</view>
|
</view>
|
<view v-if="taskData.isrunner" class="uni-panel-bottom">
|
<view class="uni-panel-bottom-item" v-if="taskData.State=='已读'">
|
<button type="default" class="uni-bottom-btn" @click="taskConfirm">确认</button>
|
<button type="default" class="uni-bottom-btn" style="margin-left: 5px;"
|
@click="taskReturn">退回</button>
|
<!-- <text class="uni-panel-bottom-text">新任务到达,是否确认!</text> -->
|
</view>
|
<view class="uni-panel-bottom-item"
|
v-if="apptype != 'HangChaTesting' && taskData.State=='执行'">
|
<button type="default" class="uni-bottom-btn" style="margin-left: 5px;"
|
@click="taskComplete">完成</button>
|
</view>
|
<view v-else="taskData.State=='提交'">
|
</view>
|
<view class="uni-panel-safe-bottom" :style="{height:safeAreaBottom + 'px'}" />
|
</view>
|
<view v-else-if="taskData.ischecker" class="uni-panel-bottom">
|
<view class="uni-panel-bottom-item" v-if="taskData.State=='提交'">
|
<button type="default" class="uni-bottom-btn" style="margin-left: 5px;"
|
@click="agree">同意完成</button>
|
<button type="default" class="uni-bottom-btn" style="margin-left: 5px;"
|
@click="disagree">不同意</button>
|
</view>
|
<view class="uni-panel-safe-bottom" :style="{height:safeAreaBottom + 'px'}" />
|
</view>
|
</view>
|
</swiper-item>
|
<swiper-item v-if="!show3000ExtFunc">
|
<view class="uni-panel-c">
|
<taskchat class="container-fill" :taskId="taskId" :taskInfo="taskData">
|
</taskchat>
|
</view>
|
</swiper-item>
|
|
<swiper-item v-if="!show3000ExtFunc">
|
<view class="uni-panel-c">
|
<view class="uni-panel-tabs">
|
<view class="tab-item" :class="{'sel-tab':currentOutTab == index}" v-for=" index in 2"
|
@click="currentOutTab = index">
|
<text>{{index == 2 ? "发布说明" : "交付物"}}</text>
|
</view>
|
</view>
|
<view v-if="currentOutTab ==2" class="uni-panel-c uni-panel-tab-content">
|
<view class=" uni-panel-w2 uni-panel-tab-content" v-if="canAddOutFile">
|
<textarea auto-height fixed show-confirm-bar="{{false}}" type="text"
|
v-model="releaseNote" :maxlength="-1" :disabled="!canAddOutFile" />
|
<view>
|
</view>
|
</view>
|
<view class=" uni-panel-desc uni-panel-tab-content" v-else>
|
{{releaseNote}}
|
</view>
|
<view class="uni-panel-bottom" v-if="canAddOutFile">
|
<button class="uni-bottom-big-btn" @click="onReleaseNote">保存</button>
|
</view>
|
<view class="uni-panel-safe-bottom" :style="{height:safeAreaBottom + 'px'}" />
|
</view>
|
<view v-else class="uni-panel-c uni-panel-tab-content" style="overflow:scroll;">
|
|
<view class="uni-panel-w">
|
<view v-if="pagesock[2].pagedata.file || canAddOutFile" class="uni-panel-w2"
|
style="padding: 8px;">
|
<view class="uni-panel-hh" v-if="canAddOutFile">
|
<text class="uni-panel-text gray-text">上传交付物:</text>
|
<view class="uni-panel-icon-btn fs-floder " v-if="isCanSelFile"
|
@click="clickSelFile(true)"></view>
|
<view class="uni-panel-icon-btn fu-yuyin" v-if="isVoiceRecord"
|
@touchstart="voiceStart" @touchmove.stop.prevent="voiceIng"
|
@touchend="voiceEnd" @touchcancel="voiceCancel">
|
</view>
|
<view class="uni-panel-icon-btn fs-picture " @click="clickChooseImage(true)">
|
</view>
|
<view class="uni-panel-icon-btn fs-camera " v-if="isMobilePlatform"
|
@click="clickCamera(true)"></view>
|
</view>
|
<view class="uni-panel-upfile" v-if="pagesock[2].pagedata.file">
|
<view class="uni-panel-upfile-item"
|
v-for="(item,index) in pagesock[2].pagedata.file"
|
:style="{background:item.color}" :key="index"
|
@click="openTaskFile(true,item)"
|
@longpress="clickDelTaskFile(true,item,index)">
|
<view
|
v-if="!(item.isImg|| item.isVideo|| item.isAudio) || (( item.isImg) && !item.path)"
|
class="uni-panel-upfile-item-name">{{item.DispName }}</view>
|
<text v-if="!(item.isImg || item.isVideo|| item.isAudio)"
|
class="uni-panel-upfile-item-size">{{item.size}}</text>
|
<image v-if="(item.isImg && item.path) && !item.isVideo"
|
class="uni-panel-upfile-img" :src="item.path" mode="widthFix" />
|
<!-- <image v-if="item.isVideo" class="uni-panel-video-playIcon" src="@/static/play.png" mode="widthFix"></image> -->
|
<jvideo v-if="item.isVideo&& item.path" :url="item.path" width="192rpx"
|
height="192rpx" :len="item.duration || 0"></jvideo>
|
<viewAudio v-if="item.isAudio && item.path" class="voice"
|
:audioSrc="item.path" :playingSrc="playAudioPath"
|
:audioLen="item.duration || 0" @playVoice="playVoice(item)">
|
</viewAudio>
|
<text v-if="item.errMsg" class="uni-panel-icon fs-wrong"
|
style="position: absolute; bottom:5rpx; right: 5rpx; color: #fd3c46;"
|
@click="onErrInfo(item.errMsg)"></text>
|
<!-- #ifdef MP-WEIXIN -->
|
<circleProgressBar v-if="item.isTransferring"
|
style="position: absolute; top: 50rpx; left: 50rpx;" :size="100"
|
:border_width="16" border_back_color='#ccc' background='#ffffff80'
|
:pro="item.percent/100" />
|
<!-- #endif-->
|
</view>
|
</view>
|
</view>
|
<view v-else class="uni-panel-unfile_no item-center">
|
<view class="uni-panel-w">
|
<text style="color: gray;display: flex;justify-content: center;">没有交付文件</text>
|
<image mode="center" src="@/static/open-box.png"> </image>
|
</view>
|
</view>
|
</view>
|
<view class="uni-panel-safe-bottom" :style="{height:safeAreaBottom + 'px'}" />
|
</view>
|
</view>
|
</swiper-item>
|
|
<swiper-item v-if="!show3000ExtFunc">
|
<view class="uni-panel-c">
|
<view class="uni-panel-c" style="overflow:scroll;">
|
<view class="uni-panel-log">
|
<view :class="index +1 >=pagesock[3].pagedata.length ? 'log-item-end':'log-item'"
|
v-for="(item, index) in pagesock[3].pagedata" :key="index">
|
<view class="uni-panel-log-icon" :class="item.Font"
|
:style="{ color:item.Color,background:item.BackgroundColor}" />
|
<view :class="(index % 2)==1 ? 'uni-panel-logitem2':'uni-panel-logitem1'">
|
<view class="uni-panel-log-Level" />
|
<text>{{item.Content}}</text>
|
<view class="uni-panel-log-date">
|
<text class="uni-panel-log-name"> {{item.CreatorName}}</text>
|
|
<text style="color: gray;">{{item.CreateDate}}</text>
|
</view>
|
</view>
|
</view>
|
</view>
|
<view class="uni-panel-safe-bottom" :style="{height:safeAreaBottom + 'px'}" />
|
</view>
|
</view>
|
</swiper-item>
|
|
<swiper-item v-for="(item, index) in extPageData" :key="index">
|
<view class="uni-panel-c">
|
<dataObjList class="uni-func-data" ref="refDataList" :taskId="taskId"
|
:taskState="item.pagedata.state" :app="item.pagedata.app" :globalAttr="globalAttr"
|
@clickDataItem="">
|
</dataObjList>
|
<view v-if="taskData.isrunner" class="uni-panel-bottom">
|
<view class="uni-panel-bottom-item" v-if="taskData.State=='已读'">
|
<button type="default" class="uni-bottom-btn" @click="taskConfirm">确认</button>
|
<button type="default" class="uni-bottom-btn" style="margin-left: 5px;"
|
@click="taskReturn">退回</button>
|
<!-- <text class="uni-panel-bottom-text">新任务到达,是否确认!</text> -->
|
</view>
|
<view class="uni-panel-bottom-item"
|
v-if="apptype != 'HangChaTesting'&& taskData.State=='执行'">
|
<button type="default" class="uni-bottom-btn" style="margin-left: 5px;"
|
@click="taskComplete">完成</button>
|
</view>
|
<view v-else="taskData.State=='提交'">
|
</view>
|
<view class="uni-panel-safe-bottom" :style="{height:safeAreaBottom + 'px'}" />
|
</view>
|
<view v-else-if="taskData.ischecker" class="uni-panel-bottom">
|
<view class="uni-panel-bottom-item" v-if="taskData.State=='提交'">
|
<button type="default" class="uni-bottom-btn" style="margin-left: 5px;"
|
@click="agree">同意完成</button>
|
<button type="default" class="uni-bottom-btn" style="margin-left: 5px;"
|
@click="disagree">不同意</button>
|
</view>
|
<view class="uni-panel-safe-bottom" :style="{height:safeAreaBottom + 'px'}" />
|
</view>
|
</view>
|
</swiper-item>
|
</swiper>
|
</view>
|
<viewAudioRecord v-if="isVoiceRecord" ref="refAudioRecord" directionMoveCancel="left"
|
@recordEnd="recordVioceEnd"></viewAudioRecord>
|
<view>
|
<uni-popup ref="refPopupMenu" background-color="transparent" maskBackgroundColor="rgba(0, 0, 0, 0.2)">
|
<view class="popup-content" @click="closeMenu">
|
<view class="popup-content-menu ">
|
<button class="popup-content-menu-item" v-for="(item,index) in taskMenu" :key="index"
|
@click="taskMenuChange(item,index)"><text class="popup-content-menu-ico"
|
:class="item.fontClass"></text> {{item.text}}</button>
|
</view>
|
</view>
|
</uni-popup>
|
<uni-popup ref="refPopupDialog" type="dialog">
|
<view class="uni-popup-dialog">
|
<view class="uni-dialog-title">
|
<text class="uni-dialog-title-text">选择审核人</text>
|
</view>
|
<view class="uni-dialog-content">
|
<checkbox-group @change="checkboxUserChange">
|
<label v-for="(item,index) in auditors" class="uni-dialog-item" :key="item.ID">
|
<checkbox :value="item.ID" color="#007aff" :checked="item.checked" />
|
<text class="uni-dialog-item-ico fs-person4"></text>
|
<view class="">{{item.Name}}</view>
|
</label>
|
</checkbox-group>
|
</view>
|
<view class="uni-dialog-button-group">
|
<view class="uni-dialog-button" @click="closeDialog">
|
<text class="uni-dialog-button-text">取消</text>
|
</view>
|
<view class="uni-dialog-button uni-border-left" @click="clickAuditorOK">
|
<text class="uni-dialog-button-text uni-button-color">确定</text>
|
</view>
|
</view>
|
</view>
|
</uni-popup>
|
|
<!-- 普通弹窗 -->
|
<uni-popup ref="refPopupCalendar" background-color="#fff">
|
<view class="popup-content" style="padding: 2px 4px 12px;">
|
<calendar class="container-fill" @confirm="confirmSelCalendar" @close="closeSelCalendar"></calendar>
|
</view>
|
</uni-popup>
|
<uni-popup ref="refPopupFileSel" background-color="#fff">
|
<view class="popup-content" style="padding: 2px 4px 12px;">
|
<view class="popup-content-menu-item2" style="border-bottom: 1px solid #eeeeee;"
|
@click="clickSelMessageFile">从会话中选择</view>
|
<view class="popup-content-menu-item2" style="border-bottom: 1px solid #eeeeee;"
|
@click="clickSelLocalFile">从本地文件选择</view>
|
<view class="popup-content-menu-item2" @click="closeFileSelPopup">取消</view>
|
</view>
|
</uni-popup>
|
|
<!-- 输入框 -->
|
<uni-popup ref="refInputDialog" type="dialog">
|
<uni-popup-dialog ref="inputClose" :mode="inputDialog.mode ?inputDialog.mode:'input'"
|
:title="inputDialog.title" :value="inputDialog.value" :placeholder="inputDialog.tip"
|
@confirm="dialogInputConfirm">
|
<textarea v-if="inputDialog.mode =='textarea'" fixed auto-focus comfirm-type="done"
|
show-confirm-bar="{{false}}" type="text" v-model="inputDialog.value"
|
:placeholder="inputDialog.tip" :maxlength="-1" />
|
<input v-else auto-focus comfirm-type="done" type="text" v-model="inputDialog.value"
|
:placeholder="inputDialog.tip" :maxlength="-1" />
|
</uni-popup-dialog>
|
</uni-popup>
|
<!-- 提示信息弹窗 -->
|
<uni-popup ref="refMessageDialog" type="message">
|
|
<uni-popup-message :type="messageDialog.type" :message="messageDialog.content"
|
:duration="2000"></uni-popup-message>
|
</uni-popup>
|
<!-- 重要紧急度菜单 -->
|
<uni-popup ref="refPopupMenuQuadrant" background-color="#fff">
|
<view class="popup-content">
|
<view class="popup-content-menu-item2 divider-bottom" v-for="(item,index) in quadrantMenu"
|
:key="index" @click="menuQuadrantChange(item,index)">
|
<text class="uni-panel-square"
|
:style="{'background-color':item.color,'margin-right':'5px'}"></text>
|
{{item.text}}
|
</view>
|
<view class="popup-content-menu-item2" @click="closeMenuQuadrant">取消</view>
|
</view>
|
</uni-popup>
|
</view>
|
|
</view>
|
</template>
|
<script>
|
import parseHtml from "@/common/htmlParse.js"
|
import TaskInit from "@/common/extend.js"
|
import {
|
showModal,
|
showToast,
|
showLoading,
|
hideLoading,
|
getCurUserId,
|
getCurUserName
|
} from "@/common/Page.js"
|
import taskchat from "./infos/chat.vue"
|
import circleProgressBar from '@/components/circle-progress-bar/circle-progress-bar.vue'
|
import calendar from '@/components/calendar/index.vue'
|
import dataObjList from './infos/dataobj-list.vue'
|
import {
|
DOMParser
|
} from "xmldom"
|
import {
|
Base64
|
} from 'js-base64';
|
import jvideo from '@/components/j-video.vue'
|
import viewAudio from '@/components/audio.vue'
|
import viewAudioRecord from '@/components/audio-record.vue'
|
import {
|
getInfo as taskGetInfo,
|
attachList as taskAttachList,
|
setRelPerson as taskSetRelPerson,
|
setAuditorSet as taskSetAuditorSet,
|
setTakeon as taskSetTakeon,
|
setPic as taskSetPic,
|
setUrgentImportance as taskSetUrgentImportance,
|
setAttention as taskSetAttention,
|
submit as taskSubmit,
|
forward as taskForward,
|
del as taskDelete,
|
close as taskClose,
|
setState as taskSetState,
|
setPrj as taskSetPrj,
|
setDate as taskSetDate,
|
setAttr as taskSetAttr,
|
agree as taskAgree,
|
disagree as taskDisagree,
|
attachAdd as taskAttachAdd,
|
attachRemove as taskAttachRemove,
|
logGetDynamicList as taskLogGetDynamicList,
|
logAdd as taskLogAdd,
|
setReleaseNote as taskSetReleaseNote,
|
|
|
} from "@/api/gungho/task.js"
|
|
import {
|
uploadFile,
|
downloadFileUrl,
|
publicFileUrl,
|
downloadFileTask
|
} from "@/api/index.js"
|
import {
|
runCustomEvent
|
} from "@/api/data.js"
|
import {
|
loginWxQy
|
|
} from "@/api/index.js"
|
import {
|
sendMsg
|
} from "@/api/gungho/index.js"
|
// #ifndef MP-DINGTALK
|
const audioContext = uni.createInnerAudioContext();
|
// #endif
|
export default {
|
components: {
|
taskchat,
|
circleProgressBar,
|
calendar,
|
jvideo,
|
dataObjList,
|
viewAudio,
|
viewAudioRecord
|
},
|
name: "pageTaskDetail",
|
data() {
|
return {
|
apptype: getApp().globalData.apptype,
|
curUserId: "",
|
isMobilePlatform: false,
|
isCanSelFile: false,
|
isVoiceRecord: false,
|
isVoiceOutRecord: false,
|
pageType: "",
|
taskId: "",
|
taskType: "",
|
taskMenu: [],
|
auditors: [],
|
selAuditors: [],
|
isOpenAttachPanel: false,
|
currentPage: 0,
|
bottomHeight: 54,
|
safeAreaBottom: getApp().globalData.safeAreaBottom,
|
navigationBarTitle: "任务详情",
|
currentOutTab: 1,
|
releaseNote: "",
|
fileUploadType: 1, //1表示minio服务
|
taskData: {},
|
pagesock: [{
|
current: 0,
|
name: '',
|
icon: 'fs-TaskPad',
|
text: '属性',
|
color: 'black',
|
activecolor: 'blue',
|
show: 'true',
|
isload: false,
|
pagedata: {},
|
},
|
{
|
current: 1,
|
name: '',
|
icon: 'fs-dynamic',
|
text: '交流',
|
mpicon: 'comment',
|
color: 'black',
|
activecolor: 'blue',
|
show: 'true',
|
isload: false,
|
pagedata: {},
|
},
|
{
|
current: 2,
|
name: '',
|
icon: 'fs-upload_x',
|
text: '交付',
|
color: 'black',
|
activecolor: 'blue',
|
show: 'true',
|
isload: false,
|
pagedata: {},
|
},
|
{
|
current: 3,
|
name: '',
|
icon: 'fs-exchange',
|
text: '动态',
|
color: 'black',
|
activecolor: 'blue',
|
show: 'true',
|
isload: false,
|
pagedata: {},
|
}
|
],
|
extpagesock: [{
|
current: 0,
|
name: '',
|
icon: 'fs-TaskPad',
|
text: '属性',
|
color: 'black',
|
activecolor: 'blue',
|
show: 'true',
|
isload: false,
|
pagedata: {},
|
}],
|
showUserDefPage: true,
|
inputDialog: {
|
type: "",
|
title: "",
|
tip: "",
|
value: "",
|
mode: ""
|
},
|
messageDialog: {
|
type: "",
|
content: ""
|
},
|
selCalendarPopup: {
|
type: ""
|
},
|
globalAttr: undefined,
|
playAudioPath: ""
|
}
|
},
|
onLoad(option) {
|
this.currentPage = 0
|
this.setData({
|
taskId: option.taskId || "",
|
taskType: option.taskType || "",
|
pageType: option.type || "",
|
})
|
this.curUserId = getCurUserId()
|
|
|
|
this.loadPlatform()
|
|
if (this.apptype == "HangChaTesting") {
|
this.setData({
|
showUserDefPage: true,
|
extpagesock: [{
|
current: 0,
|
name: '',
|
icon: 'fs-TaskPad',
|
text: '属性',
|
color: 'black',
|
activecolor: 'blue',
|
show: 'true',
|
isload: false,
|
pagedata: {},
|
}]
|
})
|
} else {
|
this.setData({
|
showUserDefPage: false,
|
extpagesock: []
|
})
|
|
}
|
// #ifndef MP-DINGTALK
|
const _this = this
|
audioContext.onError = (err) => {
|
console.log("播放语音失败", err)
|
_this.setData({
|
playAudioPath: ""
|
})
|
this.showError("播放语音失败," + JSON.stringify(err))
|
return
|
}
|
|
audioContext.onEnded = () => {
|
console.log("播放语音结束")
|
_this.setData({
|
playAudioPath: ""
|
})
|
return
|
}
|
audioContext.onStop = () => {
|
console.log("播放语音停止事件")
|
_this.setData({
|
playAudioPath: ""
|
})
|
return
|
}
|
|
// #endif
|
this.getDetailData()
|
},
|
computed: {
|
isNavigateToUrl() {
|
const pages = getCurrentPages();
|
if (pages.length > 1)
|
return true
|
else
|
return false
|
},
|
|
contentHtml() {
|
if (this.taskData.Desc) {
|
let sRichText = ""
|
let arContent = parseHtml(this.taskData.Desc)
|
if (arContent.length != 1)
|
return arContent
|
if (arContent[0].name == "p") {
|
let childrens = arContent[0].children
|
return childrens
|
}
|
return arContent
|
} else
|
return []
|
},
|
pageTabs() {
|
return this.extpagesock.length > 0 ? this.extpagesock : this.pagesock
|
},
|
show3000ExtFunc() {
|
return this.extpagesock.length > 0 ? true : false
|
},
|
extPageData() {
|
if (this.extpagesock) {
|
const list = []
|
for (let i = 1; i < this.extpagesock.length; i++) {
|
list.push(this.extpagesock[i])
|
}
|
return list
|
}
|
return []
|
|
},
|
quadrantMenu() {
|
return [{
|
text: "不重要不紧急",
|
color: "#5eac82"
|
}, {
|
text: "重要不紧急",
|
color: "#59b2e0"
|
}, {
|
text: "紧急不重要",
|
color: "#ffb11b"
|
}, {
|
text: "重要紧急",
|
color: "#ff6010"
|
}]
|
},
|
isCreator() {
|
const creator = this.taskData?.Creator || ""
|
return this.curUserId == creator ? true : false
|
},
|
hasAttach() {
|
|
const list = this.taskData.upfile_file || []
|
return list.length > 0 ? true : false
|
},
|
|
hasRelUser() {
|
|
const relList = this.taskData.RelPerson || []
|
return relList.length > 0 ? true : false
|
},
|
hasAuditor() {
|
|
const list = this.taskData.AuditorSet || []
|
return list.length > 0 ? true : false
|
},
|
canResetTask() {
|
if (this.pageType == 'show') {
|
return false
|
}
|
const state = this.taskData?.State || ""
|
const creator = this.taskData?.Creator || ""
|
|
const states = ["未读", "已读", "执行"];
|
return (this.curUserId == creator &&
|
states.includes(state)) ?
|
true :
|
false;
|
},
|
canUrgingTask() {
|
if (this.pageType == 'show') {
|
return false
|
}
|
const state = this.taskData?.State || ""
|
const creator = this.taskData?.Creator || ""
|
const takeon = this.taskData?.Takeon || ""
|
const pic = this.taskData?.Pic || ""
|
|
const states = ["未读", "已读", "执行"];
|
return (takeon &&
|
takeon != creator &&
|
takeon != pic &&
|
(creator == this.curUserId ||
|
pic == this.curUserId) &&
|
states.includes(state)) ?
|
true :
|
false;
|
},
|
canAddOutFile() {
|
if (this.pageType == 'show') {
|
return false
|
}
|
const state = this.taskData?.State || ""
|
const takeon = this.taskData?.Takeon || ""
|
const states = ["执行"];
|
return (this.curUserId == takeon &&
|
states.includes(state)) ?
|
true :
|
false;
|
},
|
|
|
},
|
methods: {
|
setData(obj) {
|
let that = this;
|
let keys = [];
|
let val, data;
|
Object.keys(obj).forEach(function(key) {
|
keys = key.split(".");
|
val = obj[key];
|
data = that.$data;
|
keys.forEach(function(key2, index) {
|
if (index + 1 == keys.length) {
|
that.$set(data, key2, val);
|
} else {
|
if (!data[key2]) {
|
that.$set(data, key2, {});
|
}
|
}
|
data = data[key2];
|
});
|
});
|
},
|
loadPlatform() {
|
this.isCanSelFile = false
|
this.isMobilePlatform = false
|
const app = getApp()
|
if (app.globalData.platform == "ios" || app.globalData.platform == "android") {
|
this.isMobilePlatform = true
|
if (uni.canIUse("getRecorderManager")) {
|
this.setData({
|
isVoiceRecord: true
|
});
|
}
|
}
|
console.log("loadPlatform", app.globalData.osName)
|
if (app.globalData.osName == "ios") {
|
this.isCanSelFile = false
|
//#ifdef MP-WEIXIN
|
if (uni.canIUse('chooseMessageFile')) {
|
this.isCanSelFile = true
|
}
|
//#endif
|
}
|
},
|
clickBarTitle() {
|
this.inputDialog = {
|
type: "修改标题",
|
title: "修改标题",
|
tip: "请输入标题",
|
value: this.taskData.Name,
|
mode: ""
|
}
|
this.$refs.refInputDialog.open()
|
},
|
setAtten() {
|
var _this = this
|
let data = _this.pagesock
|
let atten = ""
|
if (this.taskData.atten == "0")
|
atten = '1'
|
else
|
atten = '0'
|
taskSetAttention({
|
id: _this.taskId,
|
prjId: this.taskData.PrjID ? this.taskData.PrjID : "{}",
|
isAtten: atten
|
}).then((res) => {
|
console.log("taskAtten success", res)
|
this.taskData.atten = atten
|
_this.setData({
|
pagesock: data
|
})
|
}).catch((rej) => {
|
console.log("taskAtten failed", rej)
|
this.showError(rej)
|
|
})
|
},
|
clickMainPage() {
|
uni.reLaunch({
|
url: "/pages/task/index"
|
})
|
},
|
clickNavigateBack() {
|
uni.navigateBack({
|
delta: 1
|
})
|
},
|
AddRelPerson() {
|
console.log("AddRelPerson")
|
const _this = this
|
uni.navigateTo({
|
url: "/pages/org/selpsn?multiselect=true&title=增加相关人",
|
events: {
|
selPsnOk: function(data) {
|
setTimeout(() => {
|
_this.selectedUser(data, 1)
|
}, 50)
|
}
|
}
|
})
|
|
},
|
|
changeTakeonUser() {
|
const _this = this
|
uni.navigateTo({
|
url: "/pages/org/selpsn?title=变更执行人",
|
events: {
|
selPsnOk: function(data) {
|
setTimeout(() => {
|
_this.selectedUser(data, 0)
|
}, 50)
|
}
|
}
|
})
|
},
|
/* 催办 */
|
onUrging() {
|
/* 发送消息 */
|
let sender = [];
|
/* 新执行人 */
|
const takeon = this.taskData?.Takeon || ""
|
if (takeon && takeon != this.curUserId)
|
sender.push(takeon);
|
if (sender.length > 0) {
|
let title = "任务催办通知";
|
let content = "任务催办";
|
content += `\n任务:${this.taskData.Name}`;
|
if (this.taskData.PrjName)
|
content += `\n项目:${this.taskData.PrjName}`;
|
content += `\n催办者:${getCurUserName()}`;
|
content += ` 日期:${TaskInit.dateUtils.toShortDateTimeString(new Date())} `;
|
this.taskSendMsg({
|
title,
|
content,
|
sender,
|
msgtype: 5,
|
msgobjtype: "1",
|
}).then(() => {
|
showToast("发送催办消息成功!")
|
});
|
}
|
},
|
changePic() {
|
const _this = this
|
uni.navigateTo({
|
url: "/pages/org/selpsn?title=变更负责人人",
|
events: {
|
selPsnOk: function(data) {
|
setTimeout(() => {
|
_this.selectedUser(data, 4)
|
}, 50)
|
}
|
}
|
})
|
},
|
AddAuditor() {
|
console.log("AddAuditor")
|
const _this = this
|
uni.navigateTo({
|
url: "/pages/org/selpsn?title=增加审核人",
|
events: {
|
selPsnOk: function(data) {
|
setTimeout(() => {
|
_this.selectedUser(data, 3)
|
}, 50)
|
}
|
}
|
})
|
},
|
changePlanStart() {
|
this.selCalendarPopup = {
|
type: "start"
|
}
|
this.$refs.refPopupCalendar.open("bottom")
|
},
|
changePlanDue() {
|
this.selCalendarPopup = {
|
type: "due"
|
}
|
this.$refs.refPopupCalendar.open("bottom")
|
},
|
confirmSelCalendar(data) {
|
const _this = this
|
_this.$refs.refPopupCalendar.close()
|
if (this.selCalendarPopup.type == "start") {
|
const oldPlanStart = _this.taskData.PlanStart
|
taskSetDate({
|
id: _this.taskId,
|
startDate: data.fulldate,
|
dueDate: _this.taskData.PlanDue
|
}).then((res) => {
|
/* 发送消息 */
|
let sender = [];
|
/* 新执行人 */
|
const takeon = _this.taskData?.Takeon || ""
|
if (takeon && takeon != _this.curUserId)
|
sender.push(takeon);
|
if (sender.length > 0) {
|
let title = "任务日期变更通知";
|
let content = "任务开始日期变更";
|
content += `\n任务:${_this.taskData.Name}`;
|
if (_this.taskData.PrjName)
|
content += `\n项目:${_this.taskData.PrjName}`;
|
content +=
|
`\n变更:【${oldPlanStart}】 -> 【${data.fulldate}】` +
|
`\n操作者:${getCurUserName()}`;
|
content += ` 日期:${TaskInit.dateUtils.toShortDateTimeString(new Date())}`;
|
_this.taskSendMsg({
|
title,
|
content,
|
sender,
|
msgtype: 4,
|
msgobjtype: "1",
|
});
|
}
|
_this.reloadDetailData()
|
}).catch((rej) => {
|
console.log("taskSetDate failed", rej)
|
this.showError(rej)
|
})
|
} else if (this.selCalendarPopup.type == "due") {
|
const oldPlanDue = _this.taskData.PlanDue
|
taskSetDate({
|
id: _this.taskId,
|
startDate: _this.taskData.PlanStart,
|
dueDate: data.fulldate
|
}).then((res) => {
|
/* 发送消息 */
|
let sender = [];
|
/* 新执行人 */
|
const takeon = _this.taskData?.Takeon || ""
|
if (takeon && takeon != _this.curUserId)
|
sender.push(takeon);
|
if (sender.length > 0) {
|
let title = "任务日期变更通知";
|
let content = "任务截至日期变更";
|
content += `\n任务:${_this.taskData.Name}`;
|
if (_this.taskData.PrjName)
|
content += `\n项目:${_this.taskData.PrjName}`;
|
content +=
|
`\n变更:【${oldPlanDue}】 -> 【${data.fulldate}】` +
|
`\n操作者:${getCurUserName()}`;
|
content += ` 日期:${TaskInit.dateUtils.toShortDateTimeString(new Date())}`;
|
_this.taskSendMsg({
|
title,
|
content,
|
sender,
|
msgtype: 4,
|
msgobjtype: "1",
|
});
|
}
|
_this.reloadDetailData()
|
}).catch((rej) => {
|
console.log("taskSetDate failed", rej)
|
this.showError(rej)
|
})
|
}
|
|
},
|
closeSelCalendar() {
|
this.$refs.refPopupCalendar.close()
|
},
|
selectedUser(data, userType) {
|
const _this = this
|
if (userType == 1) {
|
let arRel = []
|
let arOldRel = this.taskData.RelPerson || []
|
for (let i = 0; i < arOldRel.length; i++) {
|
let item = arOldRel[i]
|
arRel.push({
|
id: item.id,
|
name: item.name
|
})
|
}
|
for (let i = 0; i < data.length; i++) {
|
arRel.push({
|
id: data[i].login,
|
name: data[i].name
|
})
|
}
|
taskSetRelPerson({
|
id: this.taskId,
|
relList: arRel
|
}).then((res) => {
|
this.taskData.RelPerson = arRel
|
|
}).catch((rej) => {
|
console.log("taskSetRelPerson failed", rej)
|
this.showError(rej)
|
})
|
|
} else if (userType == 2) {
|
if (data.length > 0) {
|
const _this = this
|
setTimeout(() => {
|
_this.inputDialog = {
|
type: "转交",
|
title: `转交给"${data[0].name}(${data[0].login})"的原因`,
|
tip: "请输入转交原因",
|
data: data,
|
value: "",
|
mode: ""
|
}
|
_this.$refs.refInputDialog.open()
|
}, 150);
|
}
|
} else if (userType == 3) {
|
let arAuditor = []
|
let arOldAuditor = this.taskData.AuditorSet || []
|
for (let i = 0; i < arOldAuditor.length; i++) {
|
let item = arOldAuditor[i]
|
arAuditor.push({
|
Type: item.Type,
|
ID: item.ID,
|
Name: item.Name
|
})
|
}
|
for (let i = 0; i < data.length; i++) {
|
arAuditor.push({
|
Type: "person",
|
ID: data[i].login,
|
Name: data[i].name
|
})
|
}
|
taskSetAuditorSet({
|
id: this.taskId,
|
auditorSet: JSON.stringify(arAuditor)
|
}).then((res) => {
|
this.taskData.AuditorSet = arAuditor
|
|
}).catch((rej) => {
|
console.log("taskSetRelPerson failed", rej)
|
this.showError(rej)
|
})
|
} else if (userType == 4) {
|
if (data.length > 0) {
|
taskSetPic({
|
id: this.taskId,
|
pic: data[0].login,
|
picName: data[0].name
|
}).then((res) => {
|
console.log("taskSetPic success", res)
|
this.taskData.Pic = data[0].login
|
this.taskData.PicName = data[0].name
|
}).catch((rej) => {
|
console.log("taskSetPic failed", rej)
|
this.showError(rej)
|
})
|
}
|
} else {
|
if (data.length > 0) {
|
const oldTakeonName = this.taskData.TakeonName
|
const oldTakeon = this.taskData.Takeon
|
taskSetTakeon({
|
taskId: [_this.taskId],
|
takeon: data[0].login,
|
takeonName: data[0].name
|
}).then((res) => {
|
console.log("taskSetTakeon success", res)
|
_this.taskData.Takeon = data[0].login
|
_this.taskData.TakeonName = data[0].name
|
/* 发送消息 */
|
let sender = [];
|
/* 新执行人 */
|
const takeon = data[0].login
|
if (takeon && takeon != _this.curUserId)
|
sender.push(takeon);
|
if (sender.length > 0) {
|
let title = "任务执行人变更通知";
|
let content = "任务执行人变更";
|
content += `\n任务:${_this.taskData.Name}`;
|
if (_this.taskData.PrjName)
|
content += `\n项目:${_this.taskData.PrjName}`;
|
content +=
|
`\n变更:【${oldTakeonName}(${oldTakeon})】 -> 【${data[0].name}(${data[0].login})】` +
|
`\n操作者:${getCurUserName()}`;
|
content += ` 日期:${TaskInit.dateUtils.toShortDateTimeString(new Date())}`;
|
_this.taskSendMsg({
|
title,
|
content,
|
sender,
|
msgtype: 4,
|
msgobjtype: "1",
|
});
|
}
|
}).catch((rej) => {
|
console.log("taskSetTakeon failed", rej)
|
_this.showError(rej)
|
})
|
}
|
}
|
},
|
getBackUploadFile(files) {
|
var _this = this
|
let bIsOut = false
|
if (this.isSelOutFile)
|
bIsOut = this.isSelOutFile
|
let data = _this.pagesock;
|
if (files.length > 0) {
|
if (bIsOut) {
|
if (!data[2].pagedata) {
|
data[2].pagedata = {
|
file: []
|
}
|
}
|
} else {
|
if (!this.taskData.upfile_file)
|
this.taskData.upfile_file = []
|
}
|
for (let i = 0; i < files.length; i++) {
|
let file = files[i];
|
let isImg = false
|
let isVideo = false
|
let isAudio = false
|
|
if (TaskInit.fileUtils.isPictureType(file.DispName)) //文档
|
{
|
isImg = true
|
} else if (TaskInit.fileUtils.isVideoType(file.DispName)) //文档
|
{
|
isVideo = true
|
} else if (TaskInit.fileUtils.isAudioType(file.DispName)) //文档
|
{
|
isAudio = true
|
}
|
let color = TaskInit.fileUtils.getTypeBgColor(file.DispName)
|
let projid = _this.taskData.PrjID || ""
|
let upfile = {
|
FileServer: file.FileServer,
|
FileID: file.FileID.includes("{") ? file.FileID : `{${file.FileID}}`,
|
FileSize: file.FileSize,
|
ClsID: projid.trim() ? "0000" : "PROF",
|
ObjID: "",
|
DispName: file.DispName,
|
IsOut: bIsOut ? 1 : 0,
|
LinkType: 0
|
}
|
upfile.color = color
|
upfile.size = TaskInit.fileUtils.getFileSizeStr(upfile.FileSize)
|
upfile.isVideo = isVideo
|
upfile.isImg = isImg
|
upfile.isAudio = isAudio
|
taskAttachAdd({
|
taskID: _this.taskId,
|
attach: [{
|
fileServer: upfile.FileServer,
|
fileID: upfile.FileID,
|
fileSize: upfile.FileSize,
|
clsID: upfile.ClsID,
|
objID: upfile.ObjID,
|
dispName: upfile.DispName,
|
isOut: upfile.IsOut,
|
linkType: upfile.LinkType,
|
}]
|
}).then(async (res) => {
|
|
upfile.percent = 0
|
|
|
upfile.path = await downloadFileUrl(upfile.FileID, upfile.DispName, upfile
|
.FileServer)
|
if (bIsOut) {
|
data[2].pagedata.file.push(upfile)
|
} else {
|
this.taskData.upfile_file.push(upfile)
|
}
|
}).catch((rej) => {
|
console.log("taskAttachAdd failed", rej)
|
upfile.isTransferring = false
|
upfile.errMsg = rej
|
upfile.percent = 100
|
|
if (bIsOut) {
|
data[2].pagedata.file.push(upfile)
|
} else {
|
this.taskData.upfile_file.push(upfile)
|
}
|
})
|
}
|
_this.setData({
|
pagesock: data
|
})
|
|
}
|
},
|
clickDelAuditor(item) {
|
const auditorList = this.taskData.AuditorSet.filter((a) => {
|
return item.ID != a.ID
|
})
|
taskSetAuditorSet({
|
id: this.taskId,
|
auditorSet: JSON.stringify(auditorList)
|
}).then((res) => {
|
this.taskData.AuditorSet = auditorList
|
}).catch((rej) => {
|
console.log("taskSetRelPerson failed", rej)
|
this.showError(rej)
|
})
|
},
|
|
clickDelRelUser(item) {
|
const relUser = this.taskData.RelPerson.filter((a) => {
|
return item.id != a.id
|
})
|
taskSetRelPerson({
|
id: this.taskId,
|
relList: relUser
|
}).then((res) => {
|
this.taskData.RelPerson = relUser
|
}).catch((rej) => {
|
console.log("taskSetRelPerson failed", rej)
|
this.showError(rej)
|
})
|
},
|
clickAttachPanel() {
|
this.isOpenAttachPanel = !this.isOpenAttachPanel
|
},
|
setAttachInfo(bIsOut, url, value) {
|
var _this = this
|
|
let attachs = [];
|
let data = _this.pagesock;
|
if (bIsOut) {
|
attachs = data[2].pagedata.file;
|
} else {
|
|
attachs = this.taskData.upfile_file;
|
}
|
if (attachs.length == 0) {
|
return;
|
}
|
let curTaskIndex = attachs.findIndex((task, index, arr) => {
|
return task.url == url;
|
})
|
if (curTaskIndex == -1) {
|
return;
|
}
|
attachs[curTaskIndex] = value;
|
|
if (bIsOut) {
|
data[2].pagedata.file = attachs;
|
} else {
|
this.taskData.upfile_file = attachs;
|
}
|
_this.setData({
|
pagesock: data
|
})
|
console.log("setAttachInfo", data)
|
},
|
|
setAttachProgress(bIsOut, url, percent, transTask) {
|
var _this = this
|
let attachs = [];
|
let data = _this.pagesock;
|
if (percent < 1 || percent > 99) {
|
return;
|
}
|
if (bIsOut) {
|
attachs = data[2].pagedata.file;
|
} else {
|
attachs = this.taskData.upfile_file;
|
}
|
if (attachs.length == 0) {
|
transTask.abort();
|
return;
|
}
|
let curTaskIndex = attachs.findIndex((task, index, arr) => {
|
return task.url == url;
|
})
|
if (curTaskIndex == -1) {
|
transTask.abort();
|
return;
|
}
|
let taskItem = attachs[curTaskIndex]
|
taskItem.percent = percent
|
taskItem.isTransferring = true
|
attachs[curTaskIndex] = taskItem;
|
if (bIsOut) {
|
data[2].pagedata.file = attachs;
|
} else {
|
this.taskData.upfile_file = attachs;
|
}
|
_this.setData({
|
pagesock: data
|
})
|
},
|
|
setAttachFailed(bIsOut, url, errMsg) {
|
var _this = this
|
let attachs = [];
|
let data = _this.pagesock;
|
if (bIsOut) {
|
attachs = data[2].pagedata.file;
|
} else {
|
attachs = this.taskData.upfile_file;
|
}
|
if (attachs.length == 0) {
|
return;
|
}
|
let curTaskIndex = attachs.findIndex((task, index, arr) => {
|
return task.url == url;
|
})
|
if (curTaskIndex == -1) {
|
return;
|
}
|
let taskItem = attachs[curTaskIndex]
|
taskItem.isTransferring = false
|
taskItem.errMsg = errMsg
|
attachs[curTaskIndex] = taskItem;
|
|
if (bIsOut) {
|
data[2].pagedata.file = attachs;
|
} else {
|
this.taskData.upfile_file = attachs;
|
}
|
_this.setData({
|
pagesock: data
|
})
|
},
|
setAttachDownFinsh(bIsOut, url) {
|
var _this = this
|
let attachs = [];
|
let data = _this.pagesock;
|
if (bIsOut) {
|
attachs = data[2].pagedata.file;
|
} else {
|
attachs = this.taskData.upfile_file;
|
}
|
if (attachs.length == 0) {
|
return;
|
}
|
let curTaskIndex = attachs.findIndex((task, index, arr) => {
|
return task.url == url;
|
})
|
if (curTaskIndex == -1) {
|
return;
|
}
|
let taskItem = attachs[curTaskIndex]
|
taskItem.isTransferring = false
|
attachs[curTaskIndex] = taskItem;
|
if (bIsOut) {
|
data[2].pagedata.file = attachs;
|
} else {
|
this.taskData.upfile_file = attachs;
|
}
|
_this.setData({
|
pagesock: data
|
})
|
},
|
|
uploadAttach(bIsOut, file) {
|
var _this = this
|
console.log("uploadAttach uploadFile", file)
|
uploadFile(file, (docSuc) => {
|
let projid = _this.taskData.PrjID || ""
|
let upfile = {
|
FileServer: docSuc.filesflag,
|
FileID: docSuc.id.includes("{") ? docSuc.id : `{${docSuc.id}}`,
|
FileSize: file.size,
|
ClsID: projid.trim() ? "0000" : "PROF",
|
ObjID: "",
|
DispName: docSuc.name,
|
IsOut: bIsOut ? 1 : 0,
|
LinkType: 0,
|
isTransferring: true,
|
percent: 100,
|
url: file.url,
|
path: file.path,
|
duration: file.duration || 0,
|
}
|
upfile.size = TaskInit.fileUtils.getFileSizeStr(upfile.FileSize)
|
upfile.isVideo = false
|
upfile.isImg = false
|
upfile.isAudio = false
|
if (TaskInit.fileUtils.isPictureType(upfile.DispName)) //文档
|
{
|
upfile.isImg = true
|
} else if (TaskInit.fileUtils.isVideoType(upfile.DispName)) //文档
|
{
|
upfile.isVideo = true
|
} else if (TaskInit.fileUtils.isAudioType(upfile.DispName)) //文档
|
{
|
upfile.isAudio = true
|
} else {
|
upfile.isImg = false
|
}
|
|
upfile.color = TaskInit.fileUtils.getTypeBgColor(upfile.DispName)
|
|
console.log("uploadAttachs uploadFile", upfile.url, upfile)
|
_this.setAttachInfo(bIsOut, upfile.url, upfile);
|
taskAttachAdd({
|
taskID: _this.taskId,
|
attach: [{
|
fileServer: upfile.FileServer,
|
fileID: upfile.FileID,
|
fileSize: upfile.FileSize,
|
clsID: upfile.ClsID,
|
objID: upfile.ObjID,
|
dispName: upfile.DispName,
|
isOut: upfile.IsOut,
|
linkType: upfile.LinkType,
|
}]
|
}).then(async (res) => {
|
//res.isTransferring = false
|
upfile.percent = 0
|
upfile.path = await downloadFileUrl(upfile.FileID, upfile.DispName, upfile
|
.FileServer)
|
console.log("uploadAttachs taskAttachAdd", upfile.url, upfile)
|
|
_this.setAttachInfo(bIsOut, upfile.url, upfile);
|
}).catch((rej) => {
|
console.log("taskAttachAdd failed", rej)
|
_this.setAttachFailed(bIsOut, upfile.url, rej);
|
this.showError(rej)
|
})
|
}, (docProgress, uploadTask) => {
|
console.log("uploadAttachs uploadTaskFile progress", docProgress);
|
_this.setAttachProgress(bIsOut, docProgress.path, docProgress.progress, uploadTask);
|
},
|
(docFail) => {
|
console.log("uploadAttachs uploadFile fail", docFail);
|
_this.setAttachFailed(bIsOut, docFail.path, docFail.errMsg);
|
})
|
|
},
|
uploadAttachs(bIsOut, files) {
|
var _this = this
|
let data = _this.pagesock;
|
let fileTemps = []
|
if (files.length <= 10) {
|
fileTemps = files
|
} else {
|
for (let i = 0; i < 10; i++) {
|
fileTemps.push(files[i])
|
}
|
}
|
if (bIsOut) {
|
if (!data[2].pagedata) {
|
|
data[2].pagedata = {
|
file: []
|
}
|
}
|
for (let i = 0; i < fileTemps.length; i++) {
|
let file = fileTemps[i];
|
file.isTransferring = true
|
file.percent = 0
|
if (file.tempFilePath)
|
file.path = file.tempFilePath
|
file.url = file.path || file.filePath || ""
|
let aname = file.path || file.filePath || ""
|
if (file.name)
|
aname = file.name
|
let aaa = aname.split('/');
|
if (aaa.length > 0) {
|
file.DispName = aaa[aaa.length - 1]
|
} else
|
file.DispName = aname
|
|
if (file.size)
|
file.FileSize = file.size
|
else
|
file.FileSize = 0
|
file.name = file.DispName
|
|
file.color = '#ccc'
|
file.size = TaskInit.fileUtils.getFileSizeStr(file.FileSize)
|
file.isVideo = false
|
file.isImg = false
|
file.isAudio = false
|
|
if (TaskInit.fileUtils.isPictureType(file.DispName)) //文档
|
{
|
file.isImg = true
|
} else if (TaskInit.fileUtils.isVideoType(file.DispName)) //文档
|
{
|
file.isVideo = true
|
} else if (TaskInit.fileUtils.isAudioType(file.DispName)) //文档
|
{
|
file.isAudio = true
|
} else {
|
file.isImg = false
|
}
|
file.color = TaskInit.fileUtils.getTypeBgColor(file.DispName)
|
data[2].pagedata.file.push(file)
|
}
|
} else {
|
for (let i = 0; i < fileTemps.length; i++) {
|
let file = fileTemps[i];
|
file.isTransferring = true
|
file.percent = 0
|
if (file.tempFilePath)
|
file.path = file.tempFilePath
|
file.url = file.path || file.filePath || ""
|
let aname = file.path || file.filePath || ""
|
if (file.name)
|
aname = file.name
|
let aaa = aname.split('/');
|
if (aaa.length > 0) {
|
file.DispName = aaa[aaa.length - 1]
|
} else
|
file.DispName = aname
|
if (file.size)
|
file.FileSize = file.size
|
else
|
file.FileSize = 0
|
file.name = file.DispName
|
if (!this.taskData.upfile_file)
|
this.taskData.upfile_file = []
|
file.color = '#ccc'
|
file.size = TaskInit.fileUtils.getFileSizeStr(file.FileSize)
|
file.isVideo = false
|
file.isAudio = false
|
file.isImg = false
|
if (TaskInit.fileUtils.isPictureType(file.name)) //文档
|
{
|
file.isImg = true
|
} else if (TaskInit.fileUtils.isVideoType(file.name)) //文档
|
{
|
file.isVideo = true
|
} else if (TaskInit.fileUtils.isAudioType(file.name)) //文档
|
{
|
file.isAudio = true
|
} else {
|
file.isImg = false
|
}
|
file.color = TaskInit.fileUtils.getTypeBgColor(file.name)
|
this.taskData.upfile_file.push(file)
|
}
|
}
|
_this.setData({
|
pagesock: data
|
})
|
for (let i = 0; i < fileTemps.length; i++) {
|
let file = fileTemps[i];
|
let isImg = false
|
// #ifdef MP-WEIXIN
|
uni.getFileSystemManager().getFileInfo({
|
filePath: file.path,
|
digestAlgorithm: "md5",
|
success: (res) => {
|
file.md5 = res.digest
|
file.size = res.size
|
|
_this.uploadAttach(bIsOut, file)
|
},
|
fail: (res) => {
|
_this.setAttachFailed(bIsOut, file.path, res);
|
}
|
})
|
// #endif
|
// #ifndef MP-WEIXIN
|
uni.getFileInfo({
|
filePath: file.path,
|
digestAlgorithm: "md5",
|
success: (res) => {
|
file.md5 = res.digest
|
file.size = res.size
|
_this.uploadAttach(bIsOut, file)
|
},
|
fail: (res) => {
|
_this.setAttachFailed(bIsOut, file.path, res);
|
}
|
})
|
// #endif
|
|
}
|
},
|
voiceStart(e) {
|
if (this.currentPage == 2)
|
this.isVoiceOutRecord = true
|
else
|
this.isVoiceOutRecord = false
|
this.$refs.refAudioRecord.voiceStart(e)
|
|
},
|
// 录音中(判断是否触发上滑取消发送)
|
voiceIng(e) {
|
this.$refs.refAudioRecord.voiceIng(e)
|
},
|
// 结束录音
|
voiceEnd(e) {
|
this.$refs.refAudioRecord.voiceEnd(e)
|
},
|
// 录音被打断
|
voiceCancel() {
|
this.$refs.refAudioRecord.voiceCancel()
|
|
},
|
recordVioceEnd(param) {
|
this.uploadAttachs(this.isVoiceOutRecord, [param]);
|
|
},
|
closeFileSelPopup() {
|
this.$refs.refPopupFileSel.close()
|
},
|
clickSelLocalFile() {
|
console.log("clickSelLocalFile")
|
this.$refs.refPopupFileSel.close()
|
uni.navigateTo({
|
url: `/pages/common/fileselect?uploadType=${this.fileUploadType}`
|
})
|
},
|
clickSelFile(bIsOut) {
|
this.isSelOutFile = bIsOut
|
let isCanMessageFile = false
|
let isCanLocalFile = false
|
const app = getApp()
|
if (app.globalData.osName == "ios") {
|
isCanLocalFile = false
|
}
|
//#ifdef MP-WEIXIN
|
if (app.globalData.qyWx.isWork) {
|
if (this.isMobilePlatform) {
|
if (uni.canIUse('chooseMessageFile')) {
|
isCanMessageFile = true
|
}
|
}
|
} else {
|
if (uni.canIUse('chooseMessageFile')) {
|
isCanMessageFile = true
|
}
|
}
|
//#endif
|
if (isCanLocalFile && isCanMessageFile) {
|
this.$refs.refPopupFileSel.open("bottom")
|
} else {
|
if (isCanLocalFile) {
|
uni.navigateTo({
|
url: `/pages/common/fileselect?uploadType=${this.fileUploadType}`
|
})
|
} else if (isCanMessageFile) {
|
this.clickSelMessageFile()
|
}
|
}
|
},
|
clickSelMessageFile(bIsOut) {
|
console.log("clickSelMessageFile")
|
this.$refs.refPopupFileSel.close()
|
var _this = this
|
var bIsOut = false
|
if (this.isSelOutFile)
|
bIsOut = this.isSelOutFile
|
let app = getApp()
|
let isCanMessageFile = false
|
//#ifdef MP-WEIXIN
|
if (app.globalData.qyWx.isWork) {
|
if (this.isMobilePlatform) {
|
if (uni.canIUse('chooseMessageFile')) {
|
isCanMessageFile = true
|
}
|
}
|
} else {
|
if (uni.canIUse('chooseMessageFile')) {
|
isCanMessageFile = true
|
}
|
}
|
//#endif
|
if (isCanMessageFile) {
|
if (app.globalData.qyWx.isWork) {
|
console.log("clickSelFile wx.qy.checkSession")
|
wx.qy.checkSession({
|
success: function() {
|
console.log('clickSelFile chooseMessageFile!')
|
wx.qy.chooseMessageFile({
|
count: 10,
|
type: "file",
|
success: (res) => {
|
console.log("chooseMessageFile success", res)
|
_this.uploadAttachs(bIsOut, res.tempFiles);
|
},
|
fail: (res) => {
|
console.log("chooseMessageFile fail", res)
|
},
|
})
|
},
|
fail: function() {
|
console.log('clickSelFile checkSession fail!')
|
// session_key 已经失效,需要重新执行登录流程
|
loginWxQy().then((res) => {
|
wx.qy.chooseMessageFile({
|
count: 10,
|
type: "file",
|
success: (res) => {
|
console.log(
|
"clickSelFile chooseMessageFile success",
|
res)
|
_this.uploadAttachs(res.tempFiles);
|
},
|
fail: (res) => {
|
console.log(
|
"clickSelFile chooseMessageFile fail",
|
res)
|
},
|
})
|
}).catch((rej) => {
|
console.log('clickSelFile loginWxQy failed!', rej)
|
this.showError(rej)
|
})
|
}
|
|
})
|
} else {
|
uni.chooseMessageFile({
|
count: 10,
|
type: "all",
|
success: (res) => {
|
console.log("chooseMessageFile res", res)
|
_this.uploadAttachs(bIsOut, res.tempFiles);
|
}
|
})
|
}
|
} else {
|
this.clickChooseImage(bIsOut)
|
}
|
},
|
|
// 选择图片发送
|
clickChooseImage(bIsOut) {
|
if (uni.canIUse('chooseMedia')) {
|
this.getMedia('album', bIsOut);
|
} else {
|
var _this = this
|
let app = getApp()
|
let sizeType = ['original', 'compressed']
|
//#ifdef MP-DINGTALK
|
sizeType = ['compressed']
|
// #endif
|
uni.chooseImage({
|
count: 10,
|
sizeType: sizeType, //original 原图,compressed 压缩图,默认二者都有
|
sourceType: ['album', 'camera'], //album 从相册选图,camera 使用相机,默认二者都有。
|
success: (res) => {
|
console.log("clickCamera res", res)
|
let tempFiles = []
|
if (res.files) {
|
for (let i = 0; i < res.files.length; i++) {
|
let tmpFile = {
|
path: res.files[i].path,
|
size: 0
|
}
|
tmpFile.name = tmpFile.path.split('/').pop()
|
if (res.files[i].fileType)
|
tmpFile.name = tmpFile.path.split('/').pop() + "." + res.files[i]
|
.fileType
|
tempFiles.push(tmpFile)
|
}
|
} else if (res.tempFiles) {
|
for (let i = 0; i < res.tempFiles.length; i++) {
|
let tmpFile = {
|
path: res.tempFiles[i].path,
|
size: 0
|
}
|
tmpFile.name = tmpFile.path.split('/').pop()
|
tempFiles.push(tmpFile)
|
}
|
} else {
|
for (let i = 0; i < res.tempFilePaths.length; i++) {
|
tempFiles.push({
|
path: res.tempFilePaths[i],
|
name: res.tempFilePaths[i].split('/').pop(),
|
size: 0
|
})
|
|
}
|
}
|
|
|
_this.uploadAttachs(bIsOut, tempFiles);
|
},
|
fail: (err) => {
|
console.log('chooseImage fail', err)
|
if (_this.isMobilePlatform && err.errMsg.indexOf('cancel') < 0 && err.errMsg
|
.indexOf(
|
'取消') < 0) {
|
uni.getSetting({
|
success: (res) => {
|
let authStatus = res.authSetting['scope.album'];
|
if (!authStatus) {
|
showModal("需要从您的相册获取图片,请在设置界面打开相关权限", "授权失败").then((
|
res) => {
|
if (res) {
|
uni.openSetting()
|
}
|
})
|
|
}
|
}
|
})
|
}
|
}
|
})
|
}
|
|
},
|
//拍照发送
|
clickCamera(bIsOut) {
|
if (uni.canIUse('chooseMedia')) {
|
this.getMedia('camera', bIsOut);
|
} else {
|
const _this = this
|
console.log("chooseVideo")
|
uni.chooseVideo({
|
|
sourceType: ['album', 'camera'], //album 从相册选图,camera 使用相机,默认二者都有。
|
maxDuration: 30,
|
camera: 'back',
|
success(res) {
|
console.log("chooseVideo success", res)
|
_this.uploadAttachs(bIsOut, [res]);
|
|
},
|
fail: (err) => {
|
console.log("chooseVideofail ", err)
|
}
|
});
|
|
|
}
|
},
|
getMedia(strType, bIsOut) {
|
var _this = this
|
let app = getApp()
|
|
console.log("chooseMedia")
|
uni.chooseMedia({
|
count: 10,
|
mediaType: ['image', 'video'],
|
sourceType: [strType], //album 从相册选图,camera 使用相机,默认二者都有。
|
sizeType: ['original'], //original 原图,compressed 压缩图,默认二者都有
|
maxDuration: 30,
|
camera: 'back',
|
success(res) {
|
console.log('chooseMedia success', res)
|
_this.uploadAttachs(bIsOut, res.tempFiles);
|
},
|
fail: (err) => {
|
//_this.openDrawer();
|
if (_this.isMobilePlatform && err.errMsg.indexOf('cancel') < 0) {
|
uni.getSetting({
|
success: (res) => {
|
console.log("getSetting", res)
|
let authStatus = true
|
if (strType == "album")
|
authStatus = res.authSetting['scope.album'];
|
else if (strType == "camera")
|
authStatus = res.authSetting['scope.camera'];
|
|
if (!authStatus) {
|
showModal("需要从您的相册获取图片,请在设置界面打开相关权限", "授权失败").then((
|
res) => {
|
if (res) {
|
uni.openSetting()
|
}
|
})
|
}
|
}
|
})
|
}
|
}
|
})
|
|
|
|
},
|
playVoice(item) {
|
const _this = this
|
|
// #ifdef MP-DINGTALK
|
if (uni.canIUse("getBackgroundAudioManager")) {
|
|
const bgAudioManager = uni.getBackgroundAudioManager()
|
if (_this.playAudioPath == item.path) {
|
bgAudioManager.stop()
|
return
|
}
|
bgAudioManager.onError = (err) => {
|
console.log("播放语音失败", err)
|
_this.setData({
|
playAudioPath: ""
|
})
|
this.showError("播放语音失败," + JSON.stringify(err))
|
return
|
}
|
bgAudioManager.onStop = () => {
|
console.log("播放语音停止事件")
|
_this.setData({
|
playAudioPath: ""
|
})
|
return
|
}
|
bgAudioManager.onEnded = () => {
|
console.log("播放语音结束事件")
|
_this.setData({
|
playAudioPath: ""
|
})
|
return
|
}
|
_this.setData({
|
playAudioPath: item.path
|
})
|
bgAudioManager.title = '语音';
|
bgAudioManager.singer = '暂无';
|
bgAudioManager.src = item.path;
|
bgAudioManager.play()
|
}
|
// #endif
|
// #ifndef MP-DINGTALK
|
if (_this.playAudioPath == item.path) {
|
audioContext.stop()
|
return
|
}
|
audioContext.src = item.path;
|
_this.setData({
|
playAudioPath: item.path
|
})
|
_this.$nextTick(function() {
|
audioContext.play();
|
});
|
// #endif
|
},
|
async onReleaseNote() {
|
try {
|
let note = this.releaseNote || "";
|
if (note.trim()) note = Base64.encode(note);
|
await taskSetReleaseNote({
|
id: this.taskId,
|
releaseNote: note,
|
});
|
showToast("发布说明成功", "success")
|
} catch (ex) {
|
console.log(ex)
|
this.showError(ex)
|
}
|
},
|
async openTaskFile(bIsOut, item) {
|
try {
|
var _this = this
|
if (!item.url && !item.FileID) {
|
showToast("无法查看失败文件", "none")
|
return
|
}
|
if (!TaskInit.fileUtils.isCanPreviewType(item.DispName)) //文档
|
{
|
showToast("暂不支持此类型查看", "none")
|
return
|
}
|
if (TaskInit.fileUtils.isPictureType(item.DispName)) //文档
|
{
|
if (item.path) {
|
let arrImg = _this.getImgsUrl(bIsOut);
|
uni.previewImage({
|
current: item.path,
|
urls: arrImg,
|
})
|
return
|
}
|
_this.dldAndPreviewImg(bIsOut, item)
|
return
|
}
|
if (item.path) {
|
if (TaskInit.fileUtils.isDocumentType(item.DispName)) //文档
|
{
|
let aaa = item.DispName.toLowerCase().split('.');
|
let ftype = aaa.length > 0 ? aaa[aaa.length - 1] : aaa[0];
|
uni.openDocument({
|
filePath: item.path,
|
fileType: ftype,
|
success: function(res) {
|
|
console.log('打开文档成功');
|
},
|
fail: function(res) {
|
console.log('openDocument fail:', item.path, res.errMsg)
|
|
showToast("暂不支持此类型‘" + ftype + "’查看", "none", 5000)
|
//showModal(item.path, '打开错误',false)
|
}
|
})
|
}
|
if (TaskInit.fileUtils.isVideoType(item.DispName)) // 视频
|
{
|
uni.navigateTo({
|
url: "/pages/common/videoPage?fileId=" + item.FileID +
|
"&fileServer=" + item.FileServer + "&name=" + item
|
.DispName + "&url=" + encodeURIComponent(item.path)
|
})
|
}
|
return
|
}
|
if (TaskInit.fileUtils.isVideoType(item.DispName)) // 视频
|
{
|
item.path = await downloadFileUrl(item.FileID, item.DispName, item.FileServer)
|
uni.navigateTo({
|
url: "/pages/common/videoPage?fileId=" + item.FileID +
|
"&fileServer=" + item.FileServer + "&name=" + item
|
.DispName + "&url=" + encodeURIComponent(item.path)
|
})
|
return
|
}
|
const dldUrl = await downloadFileUrl(item.FileID, item.DispName, item.FileServer)
|
item.url = dldUrl
|
downloadFileTask(dldUrl, function(docSuccess) {
|
hideLoading()
|
console.log('下载成功', docSuccess.path);
|
item.path = docSuccess.path
|
_this.setAttachDownFinsh(bIsOut, docSuccess.url);
|
let aaa = item.DispName.toLowerCase().split('.');
|
let ftype = aaa.length > 0 ? aaa[aaa.length - 1] : aaa[0];
|
uni.openDocument({
|
filePath: docSuccess.path,
|
fileType: ftype,
|
success: function(res) {
|
console.log('打开文档成功');
|
},
|
fail: function(res) {
|
console.log('openDocument fail:', item.path, res
|
.errMsg)
|
showToast("暂不支持此类型‘" + ftype + "’查看", "none", 5000)
|
//showModal(docSuccess.path, '打开错误',false)
|
}
|
})
|
}, function(docProgress, downloadTask) {
|
_this.setAttachProgress(bIsOut, docProgress.url, docProgress
|
.progress,
|
downloadTask);
|
}, function(docFail) {
|
|
hideLoading()
|
_this.setAttachDownFinsh(bIsOut, docFail.url);
|
this.showError(docFail)
|
})
|
|
} catch (ex) {
|
|
console.log(ex)
|
this.showError(ex)
|
}
|
},
|
|
async dldAndPreviewImg(bIsOut, item) {
|
try {
|
var _this = this
|
item.path = await downloadFileUrl(item.FileID, item.DispName, item.FileServer)
|
let arrImg = _this.getImgsUrl(bIsOut);
|
uni.previewImage({
|
current: item.path,
|
urls: arrImg,
|
})
|
|
} catch (ex) {
|
console.log(ex)
|
this.showError(ex)
|
}
|
},
|
async getPreviewNodeImage(nodes) {
|
//遍历标签拼拿到你的图片的src里面的内容放在我们数组中
|
let srcImg = ""
|
for (var j = 0; j < nodes.length; j++) {
|
if (nodes[j].name == "p") {
|
if (nodes[j].children) {
|
srcImg = this.getPreviewNodeImage(nodes[j].children)
|
if (srcImg != "") {
|
break;
|
}
|
}
|
} else if (nodes[j].name == "img") {
|
srcImg = nodes[j].attrs.src;
|
if (srcImg != "") {
|
break;
|
}
|
}
|
}
|
return srcImg
|
},
|
|
async previewDescImage(e) {
|
let nodes = e.currentTarget.dataset.nodes;
|
let srcCurImg = await this.getPreviewNodeImage(nodes)
|
|
// console.log("previewDescImage",srcCurImg,nodes)
|
if (!srcCurImg) {
|
return
|
}
|
let arrImg = [];
|
//遍历标签拼拿到你的图片的src里面的内容放在我们数组中
|
if (this.taskData.Desc) {
|
let sDesc = this.taskData.Desc
|
sDesc = sDesc.replace(/ /g, "")
|
let xmlDoc = new DOMParser().parseFromString(sDesc, "text/xml");
|
let finds = xmlDoc.getElementsByTagName('img'); //获取find节点
|
for (let i = 0; i < finds.length; i++) { //循环节点
|
let finder = finds[i];
|
let src = finder.getAttribute("src")
|
arrImg.push(src)
|
|
}
|
if (arrImg.length > 0) {
|
// console.log("arrImg:", arrImg.length, arrImg)
|
uni.previewImage({
|
current: srcCurImg,
|
urls: arrImg,
|
})
|
return;
|
}
|
}
|
if (srcCurImg != "") {
|
uni.previewImage({
|
current: srcCurImg,
|
urls: [srcCurImg],
|
})
|
|
}
|
},
|
async previewImg(bIsOut, index) {
|
try {
|
let arrImg = [];
|
let files = [];
|
|
if (bIsOut) {
|
files = this.pagesock[2].pagedata.file
|
|
} else {
|
files = this.taskData.upfile_file
|
}
|
|
for (let j = 0; j < files.length; j++) {
|
if (TaskInit.fileUtils.isPictureType(files[j].DispName)) //图片
|
{
|
if (!files[j].url)
|
files[j].url = await downloadFileUrl(files[j].FileID, files[j].DispName, file[j]
|
.FileServer)
|
arrImg.push(files[j].url)
|
}
|
}
|
|
uni.previewImage({
|
current: arrImg[index],
|
urls: arrImg,
|
})
|
} catch (ex) {
|
""
|
console.log(ex)
|
this.showError(ex)
|
}
|
},
|
|
onErrInfo(errMsg) {
|
showToast(errMsg, 'none')
|
},
|
clickDelTaskFile(bIsOut, item, index) {
|
var _this = this
|
let sContent = ""
|
if (bIsOut) {
|
if (!this.canAddOutFile) {
|
return
|
}
|
sContent = "确定要删除交付物吗?"
|
} else {
|
if (!this.canResetEvent) {
|
return
|
}
|
sContent = "确定要删除附件吗?"
|
}
|
|
showModal(sContent, "提醒").then(async (res) => {
|
try {
|
if (res) {
|
if (item.FileID) {
|
await taskAttachRemove({
|
taskID: _this.taskId,
|
fileID: item.FileID || ""
|
})
|
}
|
let data = this.pagesock;
|
if (bIsOut) {
|
data[2].pagedata.file.splice(index, 1)
|
} else {
|
this.taskData.upfile_file.splice(index, 1)
|
}
|
_this.setData({
|
pagesock: data
|
})
|
}
|
} catch (ex) {
|
console.log("taskdetail taskAttachRemove failed", ex)
|
this.showError(ex)
|
}
|
|
})
|
},
|
reloadDetailData() {
|
var _this = this;
|
let data = _this.pagesock;
|
showLoading("加载中,请稍后...")
|
_this.loadTaskInfo().then((res) => {
|
// console.log("loadTaskInfo", res)
|
data[0].isload = true
|
data[2].pagedata = {}
|
data[3].pagedata = {}
|
data[2].isload = false
|
data[3].isload = false
|
_this.setData({
|
currentPage: 0,
|
pagesock: data,
|
taskData: res || {}
|
})
|
}).catch((ex) => {
|
this.showError(ex)
|
}).finally(() => {
|
hideLoading();
|
})
|
},
|
clickEditDesc() {
|
let contentText = this.taskData.Desc
|
if (contentText) {
|
let arContent = parseHtml(contentText)
|
// console.log("clickEditDesc", contentText, arContent)
|
if (arContent.length > 1) {
|
this.showError("只支持修改纯文本格式")
|
return
|
}
|
if (arContent.length == 1) {
|
if (arContent[0].type != "text") {
|
if (arContent[0].name == "p") {
|
let childrens = arContent[0].children
|
if (childrens) {
|
if (childrens.length > 1) {
|
this.showError("只支持修改纯文本格式")
|
return
|
} else if (childrens.length == 1) {
|
if (childrens[0].type != "text") {
|
this.showError("只支持修改纯文本格式")
|
return
|
} else {
|
contentText = childrens[0].text
|
}
|
}
|
}
|
}
|
} else {
|
contentText = arContent[0].text
|
}
|
|
}
|
|
}
|
this.inputDialog = {
|
type: "修改描述",
|
title: "修改描述",
|
tip: "请详细描述你的问题和意见...",
|
mode: "textarea",
|
value: contentText,
|
}
|
this.$refs.refInputDialog.open()
|
},
|
getDetailData() {
|
var _this = this;
|
let data = _this.pagesock;
|
const curPage = _this.currentPage
|
if (this.extpagesock.length > 0) {
|
if (curPage > 0) {
|
return
|
}
|
}
|
if (!_this.taskId)
|
return
|
if (!data[curPage].isload) {
|
switch (curPage) {
|
case 0:
|
showLoading("加载中,请稍后...")
|
_this.loadTaskInfo().then((res) => {
|
// console.log("loadTaskInfo", res)
|
data[curPage].isload = true
|
_this.setData({
|
pagesock: data,
|
taskData: res || {}
|
})
|
}).catch((ex) => {
|
console.log("loadTaskInfo failed", ex)
|
|
this.showError(ex)
|
}).finally(() => {
|
hideLoading();
|
})
|
break;
|
case 1:
|
break;
|
case 2:
|
let resAttach =
|
showLoading("加载中,请稍后...")
|
_this.loadAttachList(this.taskData.ID, this.taskData.Code, 1).then((res) => {
|
// console.log(res)
|
data[curPage].pagedata = {
|
file: res
|
} //输出文件
|
data[curPage].isload = true
|
_this.setData({
|
pagesock: data
|
})
|
}).catch((rej) => {
|
console.log("loadAttachList failed", rej)
|
this.showError(rej)
|
}).finally(() => {
|
hideLoading();
|
})
|
|
break;
|
case 3:
|
showLoading("加载中,请稍后...")
|
|
|
_this.loadWorkDyn().then((res) => {
|
// console.log(res)
|
data[curPage].pagedata = res || {}
|
data[curPage].isload = true
|
_this.setData({
|
pagesock: data
|
})
|
}).catch((rej) => {
|
console.log("loadWorkDyn failed", rej)
|
this.showError(rej)
|
}).finally(() => {
|
hideLoading();
|
})
|
break;
|
}
|
}
|
},
|
changeTabs(index) {
|
// console.log("changeTabs", index)
|
this.setData({
|
currentPage: index
|
})
|
// #ifdef MP-DINGTALK
|
this.getDetailData()
|
// #endif
|
},
|
changeSwiper(evt) {
|
let index = evt.target.current || evt.detail.current;
|
this.setData({
|
currentPage: index
|
})
|
this.getDetailData()
|
},
|
async updState(state, note = "") {
|
try {
|
await taskSetState({
|
id: this.taskId,
|
state,
|
note
|
})
|
this.taskData.State = state
|
this.backAndChangeData(state, false)
|
return true
|
} catch (ex) {
|
this.showError(rej)
|
return false
|
}
|
},
|
loadAttachList(taskID, taskCode, outType) {
|
return new Promise(async (resolve, reject) => {
|
try {
|
let res = await taskAttachList({
|
taskID,
|
taskCode,
|
outType,
|
})
|
const attachs = res?.AttachList || []
|
for (let i = 0; i < attachs.length; i++) {
|
let file = attachs[i];
|
file.size = TaskInit.fileUtils.getFileSizeStr(file.FileSize)
|
file.isVideo = false
|
file.isImg = false
|
file.isAudio = false
|
const isImg = TaskInit.fileUtils.isPictureType(file.DispName)
|
const isVideo = TaskInit.fileUtils.isVideoType(file.DispName)
|
const isAudio = TaskInit.fileUtils.isAudioType(file.DispName)
|
if (isImg || isVideo || isAudio) //文档
|
{
|
file.url = await downloadFileUrl(file.FileID, file.DispName, file
|
.FileServer)
|
file.path = file.url
|
file.isImg = isImg
|
file.isVideo = isVideo
|
file.isAudio = isAudio
|
} else {
|
file.isImg = false
|
}
|
file.color = TaskInit.fileUtils.getTypeBgColor(file.DispName)
|
}
|
// console.log("attachs", attachs)
|
resolve(attachs)
|
} catch (ex) {
|
console.log("loadAttachList taskAttachList failed", ex)
|
this.showError(ex)
|
reject(ex)
|
}
|
})
|
},
|
setNavigationBarTitle(title) {
|
this.navigationBarTitle = title
|
// uni.setNavigationBarTitle({
|
// title
|
// })
|
},
|
loadTaskInfo() {
|
return new Promise(async (resolve, reject) => {
|
try {
|
this.bottomText = "";
|
let res = await taskGetInfo(this.taskId)
|
res.isemptyoutfile = true;
|
this.taskMenu = []
|
const app = getApp()
|
this.setNavigationBarTitle(res.Name + '(' + res.State + ')')
|
let resAttach = await this.loadAttachList(res.ID, res.Code, 0) || []
|
res = await this.getTaskData(res, resAttach)
|
resolve(res);
|
this.setData({
|
taskMenu: _this.taskMenu
|
})
|
} catch (ex) {
|
reject(ex)
|
}
|
|
|
})
|
},
|
|
loadWorkDyn() {
|
//console.log("taskdetail loadWorkDyn")
|
var _this = this;
|
return new Promise(async (resolve, reject) => {
|
try {
|
const res = await taskLogGetDynamicList(_this.taskId) || []
|
|
let logs = []
|
for (let i = 0; i < res.length; i++) {
|
let event_log = res[i];
|
let content = "";
|
let background = "";
|
let spanfont = "";
|
let spancolor = '';
|
let operate = event_log.Operate.replace(/^\s+|\s+$/g, '');
|
if (operate == '回复') {
|
continue;
|
} else if (operate == '创建') {
|
background = "#ff0000"
|
spanfont = 'fs-plus';
|
spancolor = 'white';
|
content = operate + "任务";
|
} else if (operate == '提交') {
|
background = '#90cf53;';
|
spanfont = 'fs-TaskSubmission';
|
spancolor = 'white';
|
content = "提交了任务";
|
} else if (operate == '已读') {
|
background = '#538dd3';
|
spanfont = 'fs-mail_open';
|
spancolor = 'white';
|
content = "阅读";
|
} else if (operate == '确认') {
|
background = '#538dd3';
|
spanfont = 'fs-run_man';
|
spancolor = 'white';
|
content = "执行";
|
} else if (operate == '延期') {
|
background = '#ffc000';
|
spanfont = 'fs-time';
|
spancolor = 'white';
|
content = operate;
|
} else if (operate == '完成') {
|
background = '#00af51';
|
spanfont = 'fs-flag';
|
spancolor = 'white';
|
content = operate;
|
} else if (operate == '重置') {
|
background = '#fdfe1f';
|
spanfont = 'fs-user_remove';
|
spancolor = 'black';
|
content = operate + "执行人";
|
} else if (operate == '同意') {
|
background = '#00b0f0';
|
spanfont = 'fs-checkmart';
|
spancolor = 'white';
|
content = "同意完成";
|
} else if (operate == '不同意') {
|
background = '#e46d0a';
|
spanfont = 'fs-WindowClose';
|
spancolor = 'white';
|
content = "不同意:" + event_log.Content;
|
} else if (operate == '退回') {
|
background = '#808080';
|
spanfont = 'fs-goback';
|
spancolor = 'white';
|
content = "退回:" + event_log.Content;
|
} else if (operate == '上传文件') {
|
background = '#00B0F0';
|
spanfont = 'fs-upload_x';
|
spancolor = 'white';
|
content = "上传文件"
|
} else if (operate == '截止') {
|
background = '#ffff00';
|
spanfont = 'fs-delay';
|
spancolor = 'black';
|
content = event_log.Content
|
} else if (operate == '人员变更') {
|
background = '#00B0F0';
|
spanfont = 'fs-user_remove';
|
spancolor = 'white';
|
content = event_log.Content
|
} else if (operate == '担当变化' || operate == '转发') {
|
background = '#538ED5';
|
spanfont = 'fs-user_remove';
|
spancolor = 'white';
|
content = event_log.Content
|
} else {
|
background = '#538dd3';
|
spanfont = '';
|
spancolor = 'white';
|
content = event_log.Content
|
}
|
if (content == "") {
|
event_log.Content = operate
|
} else
|
event_log.Content = content
|
event_log.Color = spancolor
|
event_log.Font = spanfont
|
event_log.BackgroundColor = background
|
event_log.CreateDate = TaskInit.dateUtils.openinfo_formatter_ttime(event_log
|
.CreateTime, 'notime')
|
logs.push(event_log)
|
}
|
resolve(logs)
|
} catch (ex) {
|
console.log("taskdetail loadWorkDyn failed", ex)
|
reject(ex)
|
this.showError(ex)
|
}
|
|
})
|
},
|
/* 判断是否是base64 编码后的内容 */
|
isBase64(str) {
|
const base64Regex =
|
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
|
return base64Regex.test(str);
|
},
|
async getTaskData(data, attachs) {
|
//console.log(data);
|
const app = getApp()
|
const sLogin = app.globalData.userdata.user_login
|
let ret = {
|
data: null
|
};
|
ret.data = data;
|
if (!data.RelPerson) {
|
ret.data.RelPerson = []
|
}
|
if (!data.AuditorSet) {
|
ret.data.AuditorSet = []
|
}
|
let note = ret.data.ReleaseNote;
|
if (this.isBase64(note)) note = Base64.decode(note);
|
this.releaseNote = note;
|
|
// console.log(ret.data);
|
if (this.pageType != 'show') { //判断是否是只显示任务详情res.isemptyoutfile=false;
|
//登录者 是创建者
|
if (ret.data.Creator.replace(/^\s+|\s+$/g, '') == sLogin || this.taskType == "12") {
|
if (ret.data.State == '未读' || ret.data.State == '已读') {
|
//{text:'暂时不做',fontClass:'fs-pause'},
|
this.taskMenu = [{
|
text: '删除',
|
fontClass: 'fs-recycle'
|
}, {
|
text: '撤回',
|
fontClass: 'fs-return_key'
|
}, {
|
text: '设置完成',
|
fontClass: 'fs-flag'
|
}, {
|
text: '修改标题',
|
fontClass: ''
|
}, {
|
text: '修改紧急重要度',
|
fontClass: ''
|
}]
|
} else if (ret.data.State == '执行') {
|
this.taskMenu = [{
|
text: '重启',
|
fontClass: 'fs-folder_close_x'
|
}, {
|
text: '删除',
|
fontClass: 'fs-recycle'
|
}, {
|
text: '撤回',
|
fontClass: 'fs-return_key'
|
}, {
|
text: '设置完成',
|
fontClass: 'fs-flag'
|
}, {
|
text: '修改标题',
|
fontClass: ''
|
}, {
|
text: '修改紧急重要度',
|
fontClass: ''
|
}]
|
} else if (ret.data.State == '提交') {
|
this.taskMenu = [{
|
text: '设置完成',
|
fontClass: 'fs-flag'
|
}]
|
ret.data.showBottomBtn = true
|
if (this.taskType == "12") {
|
ret.data.ischecker = true;
|
}
|
} else if (ret.data.State == '完成') {
|
this.taskMenu = [{
|
text: '删除',
|
fontClass: 'fs-recycle'
|
}]
|
} else if (ret.data.State == '搁置' || ret.data.State == '终止' || ret.data
|
.State == '撤回' || ret.data.State == '退回') {
|
this.taskMenu = [{
|
text: '重启',
|
fontClass: 'fs-folder_close_x'
|
}, {
|
text: '删除',
|
fontClass: 'fs-recycle'
|
}]
|
if (this.taskType == "12") {
|
ret.data.ischecker = true;
|
|
}
|
}
|
}
|
//登录者是执行者
|
if (ret.data.Takeon) {
|
if (ret.data.Takeon.replace(/^\s+|\s+$/g, '') == sLogin) {
|
|
ret.data.isemptyoutfile = false;
|
|
if (ret.data.State == '未读') {
|
if (await this.updState('已读'))
|
ret.data.State = '已读';
|
}
|
if (ret.data.State == '已读') {
|
ret.data.isrunner = true
|
ret.data.showBottomBtn = true
|
ret.data.isemptyoutfile = true;
|
} else if (ret.data.State == '执行') {
|
ret.data.isrunner = true
|
if (ret.data.Creator.replace(/^\s+|\s+$/g, '') == app.globalData
|
.userdata.user_login) {
|
this.taskMenu = [{
|
text: '重启',
|
fontClass: 'fs-folder_close_x'
|
}, {
|
text: '删除',
|
fontClass: 'fs-recycle'
|
}, {
|
text: '撤回',
|
fontClass: 'fs-return_key'
|
}, {
|
text: '转交',
|
fontClass: 'fs-SendMsg'
|
}, {
|
text: '设置完成',
|
fontClass: 'fs-flag'
|
}, {
|
text: '退回',
|
fontClass: 'fs-goback'
|
}, {
|
text: '修改标题',
|
fontClass: ''
|
}, {
|
text: '修改紧急重要度',
|
fontClass: ''
|
}]
|
|
} else {
|
this.taskMenu = [{
|
text: '转交',
|
fontClass: 'fs-SendMsg'
|
}, {
|
text: '退回',
|
fontClass: 'fs-goback'
|
}]
|
}
|
ret.data.showBottomBtn = true
|
}
|
}
|
|
} else {
|
ret.data.Takeon = ""
|
}
|
this.taskMenu.push({
|
text: '刷新',
|
fontClass: 'fs-refresh_x'
|
})
|
}
|
|
if (ret.data.CreateTime)
|
ret.data.dateCreate = TaskInit.dateUtils.format(ret.data.CreateTime, "notime");
|
if (ret.data.PlanDue) {
|
ret.data.dateDue = TaskInit.dateUtils.format(ret.data.PlanDue, "notime");
|
}
|
if (ret.data.PlanStart) {
|
ret.data.dateStart = TaskInit.dateUtils.format(ret.data.PlanStart, "notime");
|
}
|
if (ret.data.Code && ret.data.State) {
|
let t = "";
|
if (ret.data.PrjID && ret.data.PrjID.trim())
|
t = "项目任务:";
|
}
|
|
if (ret.data.GapDay != "" && ret.data.GapDay > -4) {
|
ret.data.MinuteColor = "#ffc864"
|
if (ret.data.GapDay > -4 & ret.data.GapDay < 0)
|
ret.data.Minute = (ret.data.GapDay * -1) + "天到期";
|
else if (ret.data.GapDay == 0)
|
ret.data.Minute = "今天到期";
|
else {
|
ret.data.Minute = '超期' + ret.data.GapDay + "天";
|
ret.data.MinuteColor = "#c86464"
|
}
|
|
} else
|
ret.data.Minute = "";
|
|
if (ret.data.Desc) {
|
ret.data.Desc = Base64.decode(ret.data.Desc)
|
const imgRegex =
|
/<img[^>]+src="([^">]+)"[^>]*data-fileserver="([^">]+)"[^>]*>/g;
|
let arr = ret.data.Desc.match(imgRegex)
|
if (arr) {
|
for (let i = 0; i < arr.length; i++) {
|
const xmlImg = arr[i]
|
let xmlDoc = new DOMParser().parseFromString(xmlImg, "text/xml");
|
let finds = xmlDoc.getElementsByTagName('img'); //获取find节点
|
for (let j = 0; j < finds.length; j++) { //循环节点
|
let finder = finds[j];
|
let src = finder.getAttribute("src")
|
let fileserver = finder.getAttribute("data-fileserver")
|
let src2 = await publicFileUrl(fileserver, src)
|
ret.data.Desc = ret.data.Desc.replace(xmlImg,
|
`<img style="width:auto;height:auto;max-width:100%;display:block;" src="${src2}"/>`
|
);
|
break
|
}
|
|
}
|
}
|
}
|
ret.data.stateIcon = TaskInit.taskstate[ret.data.State];
|
ret.data.upfile_file = attachs || []
|
|
if (this.apptype == "HangChaTesting") {
|
this.setData({
|
globalAttr: undefined
|
})
|
if (ret.data.TaskBindSet) {
|
const taskBindSet = ret.data.TaskBindSet
|
const userdef_page = taskBindSet?.button_set?.userdef_page || []
|
var state = ret.data.State
|
var userdefApp = []
|
if (state != "执行" && state != "提交" && state != "完成")
|
state = ""
|
else {
|
const event = taskBindSet?.button_set?.after_click_task_event
|
if (event?.id) {
|
runCustomEvent({
|
data_obj_id: ret.data.ID,
|
event_id: event.id,
|
event_name: event.name
|
})
|
.then((res) => {
|
const resJson = JSON.parse(res)
|
|
let curIndex = (resJson.action || []).findIndex((item2, index, arr) => {
|
return item2.action_type == "set_global_attr";
|
})
|
if (curIndex >= 0) {
|
this.globalAttr = resJson.action[curIndex].value
|
|
}
|
}).catch((err) => {
|
console.log("invokeTaskEvent fail", err)
|
})
|
// 点击任务后事件
|
}
|
|
}
|
userdef_page.forEach((item) => {
|
if (item.state == state) {
|
let curIndex = (item.page || []).findIndex((item2, index, arr) => {
|
return item2.name == "原始记录";
|
})
|
if (curIndex >= 0) {
|
userdefApp.push(item.page[curIndex])
|
}
|
}
|
})
|
if (userdefApp.length > 0) {
|
const pages = [{
|
current: 0,
|
name: '',
|
icon: 'fs-TaskPad',
|
text: '属性',
|
color: 'black',
|
activecolor: 'blue',
|
show: 'true',
|
isload: false,
|
pagedata: {},
|
}]
|
userdefApp.forEach((item, index) => {
|
pages.push({
|
current: index + 1,
|
name: item.id,
|
icon: 'fs-TaskPad',
|
text: item.list_name || item.name,
|
color: 'black',
|
activecolor: 'blue',
|
show: 'true',
|
isload: false,
|
pagedata: {
|
app: item,
|
state: state
|
},
|
})
|
})
|
this.setData({
|
showUserDefPage: true,
|
extpagesock: pages,
|
currentPage: 1
|
})
|
}
|
}
|
|
}
|
this.setNavigationBarTitle(ret.data.Name + '(' + ret.data.State + ')')
|
// console.log(ret.data)
|
return ret.data;
|
},
|
async taskConfirm() {
|
|
var _this = this;
|
await this.updState('执行')
|
showToast("确认任务成功", "success")
|
_this.reloadDetailData()
|
},
|
taskReturn() {
|
|
this.inputDialog = {
|
type: "退回",
|
title: "任务退回原因",
|
tip: "请输入任务退回原因",
|
value: "",
|
mode: ""
|
}
|
this.$refs.refInputDialog.open()
|
|
},
|
taskComplete() {
|
var _this = this;
|
if (_this.taskData.State == '执行') {
|
let need_preview = true;
|
/*
|
1.登陆者 等于 创建者 = 执行者 并且设置的 审核人只有一个还是自己。 则直接完成
|
2.审核人 AUDITOR_SET 有多个人则执行选择
|
*/
|
const app = getApp()
|
const login = app.globalData.userdata.user_login
|
if (login == (_this.taskData.Creator).trim() &&
|
login == (_this.taskData.Takeon).trim()) {
|
let auditor = _this.taskData.AuditorSet || [];
|
if (auditor.length == 0) {
|
need_preview = false;
|
} else if (auditor.length == 1 && auditor[0].ID == (_this.taskData
|
.Creator)
|
.trim()) {
|
need_preview = false;
|
} else {
|
need_preview = true;
|
}
|
}
|
|
if (need_preview) {
|
let step = [];
|
|
showModal("确定已经完成,并准备提交?", "询问").then((resolve) => {
|
if (resolve) {
|
_this.upd_pre()
|
}
|
})
|
} else {
|
|
showModal("确定已经完成,并准备提交?", "询问").then((resolve) => {
|
if (resolve) {
|
_this.previewTask()
|
}
|
})
|
}
|
}
|
},
|
upd_pre() {
|
var _this = this;
|
|
let step = [];
|
let set = _this.taskData.AuditorSet || [];
|
if (set.length > 0) {
|
let review = false;
|
for (let i = 0; i < set.length; i++) {
|
if (set[i].Type != 'person') {
|
review = true;
|
break;
|
}
|
}
|
if (review) {
|
_this.setData({
|
auditors: set,
|
selAuditors: []
|
})
|
this.$refs.refPopupDialog.open()
|
} else {
|
for (let i = 0; i < set.length; i++) {
|
step.push({
|
step: set [i].Name + '审核',
|
login: set [i].ID,
|
name: set [i].Name
|
});
|
}
|
_this.previewTask(step)
|
}
|
|
} else {
|
_this.previewTask()
|
}
|
},
|
previewTask(step) {
|
const param = {
|
id: this.taskId
|
}
|
if (step)
|
param.auditorList = step
|
taskSubmit(param).then((res) => {
|
showToast("任务提交完成", "success")
|
this.backAndChangeData(res || '提交', true);
|
}).catch((rej) => {
|
console.log("previewTask failed", rej)
|
this.showError(rej)
|
})
|
},
|
agree() {
|
showModal("确定审核通过?", "询问").then((resolve) => {
|
if (resolve) {
|
taskAgree({
|
id: this.taskId,
|
processId: this.taskData.ProcessID
|
}).then((res) => {
|
this.taskAddLog('同意')
|
showToast("任务同意完成", "success")
|
this.backAndChangeData('同意', true);
|
}).catch((rej) => {
|
this.showError(rej)
|
})
|
}
|
})
|
|
},
|
disagree() {
|
|
this.inputDialog = {
|
type: "不同意",
|
title: "不同意原因",
|
tip: "请输入任务退回原因",
|
value: "",
|
mode: ""
|
}
|
this.$refs.refInputDialog.open()
|
},
|
clickMenu() {
|
|
this.$refs.refPopupMenu.open("top")
|
},
|
|
taskMenuChange(item, index) {
|
var _this = this;
|
this.$refs.refPopupMenu.close()
|
if (item.text == "设置完成") {
|
this.inputDialog = {
|
type: "设置完成",
|
title: "设置完成原因",
|
tip: "请输入设置完成原因",
|
value: "",
|
mode: ""
|
}
|
this.$refs.refInputDialog.open()
|
} else if (item.text == "重启") {
|
this.inputDialog = {
|
type: "重启",
|
title: "任务重启原因",
|
tip: "请输入重启原因",
|
value: "",
|
mode: ""
|
}
|
this.$refs.refInputDialog.open()
|
} else if (item.text == "删除") {
|
this.inputDialog = {
|
type: "删除",
|
title: "任务删除原因",
|
tip: "请输入删除原因",
|
value: "",
|
mode: ""
|
}
|
this.$refs.refInputDialog.open()
|
|
|
} else if (item.text == "退回") {
|
this.inputDialog = {
|
type: "退回",
|
title: "任务退回原因",
|
tip: "请输入任务退回原因",
|
value: "",
|
mode: ""
|
}
|
this.$refs.refInputDialog.open()
|
|
|
} else if (item.text == "撤回") {
|
this.inputDialog = {
|
type: "撤回",
|
title: "任务撤回原因",
|
tip: "请输入任务撤回原因",
|
value: "",
|
mode: ""
|
}
|
this.$refs.refInputDialog.open()
|
} else if (item.text == "转交") {
|
const _this = this
|
uni.navigateTo({
|
url: "/pages/org/selpsn?title=选择转交给",
|
events: {
|
selPsnOk: function(data) {
|
setTimeout(() => {
|
_this.selectedUser(data, 2)
|
}, 50)
|
}
|
}
|
})
|
} else if (item.text == "刷新") {
|
//_this.backAndChangeData('不同意',true);
|
_this.reloadDetailData()
|
} else if (item.text == "重设执行人") {
|
_this.changeTakeonUser()
|
} else if (item.text == "重设相关人") {
|
_this.AddRelPerson()
|
} else if (item.text == "重设截止日期") {
|
_this.changePlanDue()
|
} else if (item.text == "修改标题") {
|
this.inputDialog = {
|
type: "修改标题",
|
title: "修改标题",
|
tip: "请输入标题",
|
value: this.taskData.Name,
|
mode: ""
|
}
|
this.$refs.refInputDialog.open()
|
|
} else if (item.text == "修改紧急重要度") {
|
|
this.$refs.refPopupMenuQuadrant.open("bottom")
|
}
|
|
|
},
|
closeMenu() {
|
this.$refs.refPopupMenu.close()
|
},
|
closeDialog() {
|
|
this.$refs.refPopupDialog.close()
|
this.setData({
|
selAuditors: []
|
})
|
},
|
clickAuditorOK() {
|
this.$refs.refPopupDialog.close()
|
if (this.selAuditors.length > 0) {
|
this.previewTask(this.selAuditors)
|
} else {
|
showModal('请为所有角色都指定审核人', '提示')
|
}
|
|
},
|
checkboxUserChange(e) {
|
var _this = this;
|
let selItems = []
|
let items = _this.auditors;
|
let values = e.detail.value
|
let posFind = 0
|
for (let i = 0, lenI = items.length; i < lenI; ++i) {
|
delete items[i].checked
|
for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
|
if (items[i].ID === values[j]) {
|
items[i].checked = true
|
selItems.push({
|
step: items[i].Name + '审核',
|
login: items[i].ID,
|
name: items[i].Name
|
})
|
break
|
}
|
}
|
}
|
_this.setData({
|
selAuditors: selItems
|
})
|
|
},
|
|
backAndChangeData(changeText, isBack) {
|
let param = {
|
id: this.taskId,
|
change: changeText
|
}
|
uni.$emit('taskDataChange', param)
|
if (isBack) {
|
uni.navigateBack({
|
delta: 1
|
})
|
}
|
},
|
getImgsUrl(bIsOut) {
|
let imgs = []
|
let data = this.pagesock;
|
if (bIsOut) {
|
if (data[2].pagedata.file) {
|
data[2].pagedata.file.forEach((item, index) => {
|
if (item.isImg && item.path) {
|
imgs.push(item.path)
|
}
|
})
|
}
|
} else {
|
if (this.taskData.upfile_file) {
|
this.taskData.upfile_file.forEach((item, index) => {
|
if (item.isImg && item.path) {
|
imgs.push(item.path)
|
}
|
})
|
}
|
}
|
return imgs
|
},
|
async dialogInputConfirm(val) {
|
let contText = this.inputDialog.value
|
if (val) {
|
contText = val.trim()
|
}
|
try {
|
|
if (this.inputDialog.type == "退回") {
|
if (contText.length > 0) {
|
await this.updState('退回', contText)
|
this.taskData.state
|
showToast("任务退回成功", "success")
|
} else {
|
showToast("原因不能为空", "出错", false)
|
}
|
} else if (this.inputDialog.type == "不同意") {
|
|
if (contText.length > 0) {
|
await taskDisagree({
|
id: this.taskId,
|
processId: this.taskData.ProcessID,
|
note: contText
|
})
|
this.taskAddLog('不同意', contText)
|
showToast("任务已打回", "success")
|
this.backAndChangeData('不同意', true);
|
} else {
|
showToast("原因不能为空", "出错", false)
|
}
|
|
} else if (this.inputDialog.type == "设置完成") {
|
this.$refs.refInputDialog.open()
|
await taskClose({
|
id: this.taskId,
|
isFinish: 1,
|
cause: contText
|
})
|
showToast("设置完成成功", "success")
|
this.backAndChangeData('设置完成', true);
|
} else if (this.inputDialog.type == "转交") {
|
const data = this.inputDialog.data
|
let isSelf = false
|
if (data[0].login.replace(/^\s+|\s+$/g, '') == this.pagesock[
|
0].pagedata.Takeon) {
|
isSelf = true
|
}
|
await taskForward({
|
id: this.taskId,
|
takeon: data[0].login,
|
takeonName: data[0].name,
|
cause: contText
|
})
|
showToast('任务转发成功', 'none')
|
if (!isSelf) {
|
this.backAndChangeData('转发', true);
|
}
|
} else if (this.inputDialog.type == "撤回") {
|
|
await this.updState('撤回', contText)
|
showToast("任务撤回成功", "success")
|
} else if (this.inputDialog.type == "删除") {
|
|
await taskDelete({
|
id: this.taskId,
|
cause: contText
|
})
|
const tip = getCurUserName() + "删除任务,原因:" + contText
|
this.taskAddLog('删除', tip)
|
showToast("任务删除成功", "success")
|
this.backAndChangeData('删除', true);
|
} else if (this.inputDialog.type == "重启") {
|
await this.updState('未读', contText)
|
this.taskAddLog('启动', contText)
|
|
|
showToast("任务重启成功", "success")
|
} else if (this.inputDialog.type == "修改描述") {
|
await taskSetAttr({
|
id: this.taskId,
|
attrSet: [{
|
name: "CN_S_DESC",
|
value: Base64.encode(contText)
|
}]
|
});
|
this.taskData.Desc = contText
|
showToast("修改描述成功", "success")
|
} else if (this.inputDialog.type == "修改标题") {
|
await taskSetAttr({
|
id: this.taskId,
|
attrSet: [{
|
name: "CN_S_NAME",
|
value: contText
|
}]
|
})
|
this.taskData.Name = contText
|
this.setNavigationBarTitle(contText + '(' + this.taskData.State + ')')
|
showToast("修改标题成功", "success")
|
|
}
|
} catch (ex) {
|
this.showError(ex)
|
}
|
|
},
|
menuQuadrantChange(item, index) {
|
this.$refs.refPopupMenuQuadrant.close()
|
taskSetUrgentImportance({
|
id: this.taskId,
|
quadrant: `${index}`
|
}).then((res) => {
|
this.taskData.Quadrant = index
|
showToast("修改紧急重要度成功", "success")
|
}).catch((rej) => {
|
console.log("taskSetUrgentImportance failed", rej)
|
this.showError(rej)
|
})
|
},
|
|
closeMenuQuadrant() {
|
this.$refs.refPopupMenuQuadrant.close()
|
|
},
|
async taskAddLog(opType, content = "") {
|
try {
|
await taskLogAdd({
|
id: this.taskId,
|
opType,
|
content
|
});
|
} catch (error) {
|
this.showError(error);
|
}
|
},
|
|
/* 发送消息 */
|
async taskSendMsg({
|
title,
|
content,
|
sender,
|
msgtype,
|
msgobjtype = "1"
|
}) {
|
try {
|
if (sender.length > 0) {
|
const paramSendMsg = {
|
sendto: sender.join(";"),
|
msgobjtype: msgobjtype,
|
ownerid: this.taskId,
|
msgtype: msgtype,
|
title: title,
|
content: content,
|
contenttype: "txt",
|
};
|
await sendMsg(paramSendMsg);
|
|
}
|
} catch (error) {
|
this.showError(error);
|
}
|
},
|
|
showError(ex) {
|
|
let tip = typeof ex === 'string' ? ex : (ex.message || ex.err_msg || ex.errMsg || ex.err_info || "")
|
showModal(tip, "提示", false)
|
},
|
},
|
|
}
|
</script>
|
<style lang="scss" scoped>
|
.uni-task-detail {
|
display: flex;
|
height: 100vh;
|
width: 750rpx;
|
font-size: 16px;
|
flex-direction: column !important;
|
|
.uni-panel-tabs {
|
margin: 10px 10px 0 10px;
|
display: flex;
|
flex-direction: row;
|
|
.tab-item {
|
padding: 4px 5px;
|
margin: 0 5px;
|
}
|
|
.sel-tab {
|
border-radius: 5px;
|
background-color: #86bbd8;
|
}
|
}
|
|
.uni-panel-tab-content {
|
flex: 1;
|
}
|
|
.uni-panel-tav {
|
margin: 4px 10px;
|
width: calc(100% - 20px);
|
flex-direction: column !important;
|
}
|
|
.flex-direction-column {
|
flex-direction: column;
|
}
|
|
.flex-direction-row {
|
flex-direction: row;
|
}
|
|
.flex {
|
display: flex;
|
}
|
|
.flex-nowrap {
|
flex-wrap: nowrap;
|
}
|
|
.items-center {
|
align-items: center
|
}
|
|
.tabs-clz {
|
border-bottom-left-radius: 1px;
|
overflow: hidden;
|
flex: 1;
|
border-top-left-radius: 1px;
|
border-top-right-radius: 1px;
|
border-bottom-right-radius: 1px;
|
}
|
|
.text-clz {
|
margin-right: 10px;
|
padding: 10px 8px;
|
font-size: 16px !important;
|
}
|
|
.gungho-tabs {
|
flex: 1;
|
white-space: nowrap;
|
display: flex;
|
border-bottom: 2px solid #ddd;
|
}
|
|
.gungho-tabs .gungho-tab-item {
|
flex: 1 1 0%;
|
height: 36px;
|
display: inline-block;
|
line-height: 36px;
|
font-size: 16px;
|
margin: 0 5px;
|
padding: 0 5px;
|
color: gray;
|
position: relative;
|
}
|
|
.justify-start {
|
justify-content: flex-start;
|
}
|
|
.text-center {
|
text-align: center;
|
}
|
|
.item-center {
|
align-items: center;
|
}
|
|
.gungho-tabs .gungho-tab-item.cur {
|
border-bottom: 2px solid #007aff;
|
}
|
|
.uni-panel {
|
//height: calc(100% - 40px);
|
display: flex;
|
flex: 1;
|
}
|
|
.uni-panel-body {
|
height: 100%;
|
width: 100%;
|
}
|
|
.uni-func-data {
|
display: flex;
|
width: 100%;
|
height: calc(100% - 50px);
|
flex: 1;
|
}
|
|
.uni-panel-c {
|
display: flex;
|
width: 100%;
|
height: 100%;
|
flex-direction: column !important;
|
background-color: #e5eaee;
|
}
|
|
.uni-panel-desc {
|
padding: 4px 4px 8px;
|
}
|
|
.uni-panel-unfile_no {
|
display: flex;
|
font-size: 20px;
|
width: 100%;
|
height: 100%;
|
}
|
|
.uni-panel-cc {
|
overflow: auto;
|
height: calc(100% - 100px);
|
flex: 1;
|
width: 100%;
|
padding: 4px 0 8px;
|
background-color: transparent;
|
}
|
|
.uni-panel-w {
|
margin: 4px 10px;
|
width: calc(100% - 20px);
|
flex-direction: column !important;
|
}
|
|
|
|
.uni-panel-w2 {
|
flex-direction: column !important;
|
background-color: #fff;
|
border-radius: 8px;
|
margin-top: 8px;
|
padding: 4px 5px;
|
}
|
|
.uni-panel-h {
|
display: flex;
|
flex-direction: row !important;
|
background-color: transparent;
|
padding: 4px 2px;
|
|
}
|
|
.uni-panel-hh {
|
display: flex;
|
/* background-color: #ffffff; */
|
flex-direction: row !important;
|
align-items: center !important;
|
padding: 2px;
|
font-size: 16px;
|
}
|
|
.uni-panel-bottom {
|
display: flex;
|
flex-direction: column !important;
|
background-color: #00aaff;
|
}
|
|
.uni-panel-bottom-item {
|
display: flex;
|
width: 750rpx;
|
flex-direction: row !important;
|
height: 54px;
|
padding: 0px 10px;
|
}
|
|
.uni-panel-bottom-text {
|
line-height: 50px;
|
color: #fff;
|
}
|
|
.uni-bottom-btn {
|
font-size: 16px;
|
height: 36px;
|
line-height: 36px;
|
margin: 8px 1px;
|
padding-left: 12px;
|
padding-right: 12px;
|
float: left;
|
text-align: center;
|
}
|
|
.uni-bottom-big-btn {
|
margin: 10px 20%;
|
font-size: 16px;
|
height: 36px;
|
line-height: 36px;
|
text-align: center;
|
}
|
|
.uni-panel-c2 {
|
margin: 5px 2px;
|
flex-direction: row !important;
|
flex-wrap: wrap;
|
display: flex;
|
color: #808080;
|
font-size: 16px;
|
font-weight: normal;
|
}
|
|
.uni-panel-h2 {
|
flex: 1;
|
display: flex;
|
flex-direction: row !important;
|
background-color: transparent;
|
padding: 2px;
|
}
|
|
.uni-panel-subline {
|
width: 50%;
|
line-height: 20px;
|
margin: 4px 0;
|
}
|
|
.uni-panel-title-ico {
|
width: 25px;
|
flex-direction: column;
|
}
|
|
.uni-panel-state {
|
font-size: 16px;
|
padding: 2px;
|
text-align: center;
|
}
|
|
.uni-panel-title {
|
flex: 1;
|
/* width: calc(100% - 100px); */
|
flex-direction: row !important;
|
margin-left: 10px;
|
}
|
|
|
.uni-panel-title-text {
|
|
word-wrap: break-word;
|
color: black;
|
font-size: 16px;
|
white-space: normal;
|
font-weight: 600;
|
line-height: 30px;
|
text-align: left;
|
}
|
|
.uni-panel-subtitle {
|
flex: 1;
|
color: black;
|
padding: 5px 0px;
|
font-size: 16px;
|
font-weight: 600;
|
}
|
|
.uni-panel-attach {
|
flex-direction: column !important;
|
background-color: #fff;
|
border-radius: 8px;
|
padding: 2px 5px;
|
}
|
|
.uni-panel-tag {
|
flex: 1;
|
display: inline-block;
|
margin-left: 5px;
|
font-size: 16px;
|
height: 24px;
|
color: #fff;
|
font-weight: normal;
|
}
|
|
.uni-panel-tag-red {
|
flex: 1;
|
display: inline-block;
|
margin-left: 5px;
|
padding: 0px 2px;
|
font-size: 16px;
|
height: 24px;
|
|
background-color: red;
|
text-align: center;
|
}
|
|
.uni-panel-tag-orange {
|
flex: 1;
|
display: inline-block;
|
margin-left: 5px;
|
padding: 0px 2px;
|
height: 24px;
|
background-color: orange;
|
text-align: center;
|
}
|
|
.uni-panel-tag-blue {
|
// flex: 1;
|
display: inline-block;
|
border-radius: 0;
|
margin-left: 4px;
|
padding: 0px 2px;
|
background-color: dodgerblue;
|
text-align: center;
|
}
|
|
.uni-panel-line {
|
flex: 1;
|
margin-right: 10px;
|
font-size: 16px;
|
display: inline-block;
|
color: #808080;
|
font-weight: normal;
|
line-height: 20px;
|
}
|
|
.uni-panel-relpsn {
|
display: flex;
|
flex: 1;
|
margin: 2px 2px;
|
flex-direction: row !important;
|
color: #808080;
|
}
|
|
.uni-panel-relpsn-user {
|
display: flex;
|
flex: 1;
|
margin: 2px 4px;
|
flex-direction: row !important;
|
color: #808080;
|
font-size: 14px !important;
|
|
.item {
|
display: flex;
|
margin-right: 5px;
|
}
|
}
|
|
.uni-panel-icon {
|
font-weight: normal;
|
font-size: 16px;
|
padding: 4px;
|
}
|
|
.uni-panel-icon-btn {
|
padding: 10px;
|
font-size: 18px;
|
border: 1px solid #aaa;
|
border-radius: 8px;
|
margin-left: 5px;
|
|
:active {
|
background-color: #e5eaee;
|
color: #007aff;
|
}
|
}
|
|
.uni-panel-icon-add {
|
font-size: 24px;
|
color: #2979ff;
|
}
|
|
.uni-panel-icon-set {
|
font-size: 20px;
|
color: #2979ff;
|
margin-left: 5px;
|
}
|
|
.uni-panel-righticon {
|
font-weight: normal;
|
font-size: 16px;
|
position: relative;
|
padding: 5px;
|
float: right;
|
margin: auto;
|
}
|
|
.uni-panel-icon-on {
|
//transform: rotate(180deg);
|
}
|
|
.uni-panel-text {
|
flex: 1;
|
margin-left: 4px;
|
font-weight: normal;
|
font-size: 14px;
|
}
|
|
.uni-panel-uppic {
|
display: flex;
|
flex-wrap: wrap;
|
flex-direction: row !important;
|
padding: 12rpx 12rpx 12rpx;
|
}
|
|
.uni-panel-uppic-item {
|
display: flex;
|
padding: 2%;
|
height: 200rpx;
|
width: 200rpx;
|
|
}
|
|
.uni-panel-upfile {
|
display: flex;
|
flex-wrap: wrap;
|
flex-direction: row !important;
|
}
|
|
.uni-panel-upfile-img {
|
display: flex;
|
height: 100%;
|
width: 100%;
|
}
|
|
.uni-panel-video-playIcon {
|
display: flex;
|
flex: 1;
|
width: 50%;
|
}
|
|
.uni-panel-upfile-item {
|
display: flex;
|
position: relative;
|
margin: 2rpx;
|
height: 200rpx;
|
width: 30%;
|
flex-direction: column;
|
padding: 4px;
|
justify-content: center;
|
align-items: center;
|
}
|
|
.uni-panel-upfile-item-name {
|
display: flex;
|
flex: 1;
|
color: #fff;
|
width: 100%;
|
word-wrap: break-word;
|
word-break: break-all;
|
font-size: 14px;
|
/* overflow:hidden;
|
text-overflow: ellipsis; */
|
max-height: calc(200rpx - 20px);
|
//display: -webkit-box;
|
text-overflow: ellipsis;
|
overflow: hidden;
|
-webkit-line-clamp: 4; //表明是2行文本显示省略号,换成3则表明是3行文本显示省略号
|
-webkit-box-orient: vertical;
|
}
|
|
.uni-panel-upfile-item-size {
|
display: flex;
|
height: 18px;
|
color: #fff;
|
font-size: 14px;
|
text-align: left;
|
}
|
|
image {
|
will-change: transform;
|
}
|
|
|
.text-blue {
|
color: #007aff !important;
|
}
|
|
.uni-panel-log {
|
align-content: center;
|
margin: 20px 15px 20px;
|
display: flex;
|
flex-direction: column;
|
// position: relative;
|
}
|
|
.log-item {
|
background-color: transparent;
|
position: relative;
|
}
|
|
.log-item-end {
|
background-color: transparent;
|
position: relative;
|
}
|
|
.log-item::before {
|
content: '';
|
position: absolute;
|
top: 10px;
|
bottom: 0px;
|
width: 4px;
|
background: #a3d9e8;
|
left: 50%;
|
margin-left: -3px;
|
}
|
|
.uni-panel-log-vline {
|
content: '';
|
position: absolute;
|
top: 0;
|
bottom: 4px;
|
width: 4px;
|
background: #a3d9e8;
|
lleft: 50%;
|
margin-left: -2px;
|
}
|
|
.uni-panel-logitem1 {
|
position: relative;
|
margin-left: 60%;
|
width: 40%;
|
border: 1px solid #aaa;
|
background: white;
|
border-radius: 4px;
|
padding: 0.6em 0.6em 0.5em 0.6em;
|
word-break: break-all;
|
box-sizing: border-box;
|
min-height: 30px;
|
margin-bottom: 20px;
|
|
.uni-panel-log-date {
|
left: auto;
|
right: 148%;
|
text-align: right;
|
position: absolute;
|
width: 100%;
|
top: 6px;
|
color: #007aff;
|
font-size: 13px;
|
|
.uni-panel-log-name {
|
padding: 0 5rpx;
|
}
|
}
|
|
.uni-panel-log-Level {
|
content: '';
|
position: absolute;
|
height: 0;
|
width: 0;
|
top: 11px;
|
left: auto;
|
right: 100%;
|
border: 6px solid #ffffff;
|
// border-right: 7px solid #e6e6e6;
|
border-color: transparent;
|
border-right-color: #ffffff
|
}
|
}
|
|
.uni-panel-logitem1::before {
|
content: '';
|
position: absolute;
|
top: 10px;
|
left: auto;
|
right: 100%;
|
height: 0;
|
width: 0;
|
border: 7px solid transparent;
|
border-right: 7px solid white;
|
border-color: transparent;
|
border-right-color: #aaa;
|
}
|
|
|
|
.uni-panel-logitem2 {
|
position: relative;
|
width: 40%;
|
border: 1px solid #aaa;
|
background: white;
|
border-radius: 4px;
|
padding: 0.6em 0.6em 0.5em 0.6em;
|
word-break: break-all;
|
box-sizing: border-box;
|
margin-left: 0px;
|
min-height: 30px;
|
margin-bottom: 20px;
|
|
.uni-panel-log-date {
|
position: absolute;
|
width: 100%;
|
left: 148%;
|
top: 6px;
|
color: #007aff;
|
}
|
|
.uni-panel-log-Level {
|
content: '';
|
position: absolute;
|
right: 100%;
|
height: 0;
|
width: 0;
|
border: 6px solid #ffffff;
|
// border-right: 7px solid #e6e6e6;
|
top: 11px;
|
left: 100%;
|
border-color: transparent;
|
border-left-color: #ffffff;
|
}
|
|
}
|
|
.uni-panel-logitem2::before {
|
content: '';
|
position: absolute;
|
top: 10px;
|
right: 100%;
|
height: 0;
|
width: 0;
|
border: 7px solid transparent;
|
border-right: 7px solid white;
|
left: 100%;
|
border-color: transparent;
|
border-left-color: #aaa;
|
}
|
|
.uni-panel-log-icon {
|
position: absolute;
|
left: 50%;
|
margin-top: 4px;
|
margin-left: -15px;
|
text-decoration: none;
|
text-align: center;
|
line-height: 28px !important;
|
width: 28px;
|
height: 28px;
|
font-size: 16;
|
border-radius: 50%;
|
box-shadow: 0 0 0 4px #ffffff, inset 0 2px 0 rgb(0 0 0 / 8%), 0 3px 0 4px rgb(0 0 0 / 5%);
|
|
}
|
|
|
.gray-text {
|
color: gray !important;
|
}
|
|
.popup-content {
|
display: flex;
|
justify-content: center;
|
flex-direction: column;
|
background-color: transparent;
|
}
|
|
.popup-content-menu {
|
|
/* #ifdef MP-DINGTALK */
|
margin-top: 90px;
|
/* #endif */
|
/* #ifdef MP-WEIXIN || MP-LARK */
|
margin-top: 60px;
|
/* #endif */
|
margin-left: calc(750rpx - 155px);
|
width: 150px;
|
align-items: center;
|
justify-content: center;
|
flex-direction: column;
|
background-color: #fff;
|
border-radius: 5px;
|
border: 1px solid gray;
|
}
|
|
.popup-content-menu-item {
|
display: flex;
|
flex-wrap: nowrap;
|
flex-direction: row !important;
|
align-items: center;
|
padding: 4px 8px;
|
font-size: 16px;
|
}
|
|
.popup-content-menu-ico {
|
padding: 4px 4px;
|
font-size: 16px;
|
}
|
|
.popup-content-menu-item2 {
|
display: flex;
|
background-color: transparent;
|
justify-content: center;
|
padding: 12px;
|
font-size: 16px;
|
}
|
|
.divider-bottom {
|
border-bottom: 1px solid #e8eaec;
|
}
|
|
.uni-panel-square {
|
background-color: #5eac82;
|
height: 16px;
|
width: 16px;
|
margin-left: 5px;
|
align-items: center;
|
}
|
|
.uni-popup-dialog {
|
width: 300px;
|
border-radius: 8px;
|
background-color: #fff;
|
}
|
|
.uni-dialog-title {
|
display: flex;
|
flex-direction: row;
|
justify-content: center;
|
padding-top: 25px;
|
}
|
|
.uni-dialog-title-text {
|
font-size: 16px;
|
font-weight: 500;
|
}
|
|
.uni-dialog-content {
|
display: flex;
|
flex-direction: column;
|
padding: 20px;
|
}
|
|
.uni-dialog-content-text {
|
font-size: 16px;
|
color: #6C6C6C;
|
}
|
|
.uni-dialog-item {
|
display: flex;
|
background-color: #ffffff;
|
flex-direction: row !important;
|
align-items: center !important;
|
padding: 4px 8px;
|
font-size: 16px;
|
border-bottom: 1px solid #dddddd;
|
}
|
|
.uni-dialog-item-ico {
|
padding: 5px;
|
font-size: 24px;
|
height: 24px;
|
width: 24px;
|
color: #007aff;
|
}
|
|
.uni-dialog-button-group {
|
display: flex;
|
flex-direction: row;
|
border-top-color: #f5f5f5;
|
border-top-style: solid;
|
border-top-width: 1px;
|
}
|
|
.uni-dialog-button {
|
display: flex;
|
flex: 1;
|
flex-direction: row;
|
justify-content: center;
|
align-items: center;
|
height: 45px;
|
}
|
|
.uni-border-left {
|
border-left-color: #f0f0f0;
|
border-left-style: solid;
|
border-left-width: 1px;
|
}
|
|
.uni-dialog-button-text {
|
font-size: 16px;
|
color: #333;
|
}
|
|
.uni-button-color {
|
color: #007aff;
|
}
|
|
}
|
</style>
|
<style lang="scss">
|
.uni-task-detail {
|
.uni-navbar__header-container {
|
padding: 0 5px !important;
|
}
|
|
.uni-navbar-container-inner {
|
display: flex;
|
flex: 1;
|
flex-direction: row;
|
align-items: center;
|
font-size: 16px;
|
overflow: hidden;
|
|
/* #ifdef MP-DINGTALK */
|
font-weight: 600;
|
color: #fff;
|
/* #endif */
|
/* #ifdef MP-WEIXIN || MP-LARK */
|
justify-content: center;
|
color: #333;
|
/* #endif */
|
}
|
|
.uni-nav-bar-text {
|
overflow: hidden;
|
white-space: nowrap;
|
text-overflow: ellipsis;
|
}
|
|
.uni-navbar__header {
|
padding-left: 10px !important;
|
}
|
}
|
</style>
|