cxmo 1 年之前
父節點
當前提交
96680a04f1
共有 2 個文件被更改,包括 145 次插入72 次删除
  1. 26 8
      src/views/smartReport/editReport.vue
  2. 119 64
      src/views/smartReport/reportList.vue

+ 26 - 8
src/views/smartReport/editReport.vue

@@ -20,14 +20,23 @@
                     <img src="~@/assets/img/smartReport/icon01.png" alt="">
                     <span>存草稿</span>
                 </li>
-                <li class="action-item" @click="handlePublishOpt('dsfb')">
-                    <img src="~@/assets/img/smartReport/icon01.png" alt="">
-                    <span>定时发布</span>
-                </li>
-                <li class="action-item" @click="handlePublishOpt('fb')">
-                    <img src="~@/assets/img/smartReport/icon01.png" alt="">
-                    <span>发布</span>
-                </li>
+                <template v-if="!isApprove">
+                    <li class="action-item" @click="handlePublishOpt('dsfb')">
+                        <img src="~@/assets/img/smartReport/icon01.png" alt="">
+                        <span>定时发布</span>
+                    </li>
+                    <li class="action-item" @click="handlePublishOpt('fb')">
+                        <img src="~@/assets/img/smartReport/icon01.png" alt="">
+                        <span>发布</span>
+                    </li>
+                </template>
+                <template v-if="isApprove">
+                    <li class="action-item">
+                        <img src="~@/assets/img/smartReport/icon01.png" alt="">
+                        <span>提交</span>
+                    </li>
+                </template>
+                
             </ul>
         </div>
         <div class="main-wrap">
@@ -254,6 +263,15 @@ export default {
             deep:true
         }
     },
+    computed:{
+        //是否开启审批流,若开启,发布相关按钮,筛选项改变
+        isApprove(){
+            const type = this.$setting.dynamicOutLinks.ApprovalFlow ||
+                        this.$store.state.dynamicOutLinks.ApprovalFlow ||
+                        JSON.parse(localStorage.getItem('dynamicOutLinks')).ApprovalFlow||''
+            return ['2','3'].includes(type)
+        }
+    },
     data() {
         return {
             reportInfo:null,

+ 119 - 64
src/views/smartReport/reportList.vue

@@ -19,7 +19,7 @@
                     style="width:110px"
                     @change="search"
                     >
-                    <el-option label="发布时间" value="publish_time"></el-option>
+                    <el-option :label="isApprove?'审批时间':'发布时间'" value="publish_time"></el-option>
                     <el-option label="更新时间" value="modify_time"></el-option>
                     </el-select>
                 </el-form-item>
@@ -66,7 +66,7 @@
                         size="medium"
                     />
                 </el-form-item>
-                <el-form-item label="">
+                <el-form-item label="" v-if="!isApprove">
                     <el-select
                         v-model.number="searchform.publishState"
                         placeholder="发布筛选"
@@ -79,6 +79,21 @@
                         <el-option label="未发布" :value="1"></el-option>
                     </el-select>
                 </el-form-item>
+                <el-form-item label="" v-if="isApprove">
+                    <el-select
+                        v-model.number="searchform.publishState"
+                        placeholder="状态筛选"
+                        size="medium"
+                        clearable
+                        style="width: 140px"
+                        @change="search"
+                    >
+                        <el-option label="未提交" :value="1"></el-option>
+                        <el-option label="待审批" :value="2"></el-option>
+                        <el-option label="已审批" :value="4"></el-option>
+                        <el-option label="已驳回" :value="3"></el-option>
+                    </el-select>
+                </el-form-item>
                 <!-- <el-form-item label="">
                     <el-select
                         v-permission="permissionBtn.smartReportManageBtn.reportManage_reportList_sendTime"
@@ -172,7 +187,7 @@
                     align="center"
                     min-width="100"
                 ></el-table-column>
-                <el-table-column label="发布状态" align="center">
+                <el-table-column label="发布状态" align="center" v-if="!isApprove">
                     <template slot-scope="scope">
                     <span v-if="scope.row.State == '2'" style="color: #46c371"
                         >已发布</span
@@ -180,7 +195,15 @@
                     <span v-if="scope.row.State == '1'">未发布</span>
                     </template>
                 </el-table-column>
-                <el-table-column
+                <el-table-column label="状态" align="center" v-if="isApprove">
+                    <template slot-scope="scope">
+                        <span v-if="scope.row.State == '1'">未提交</span>
+                        <span v-if="scope.row.State == '2'">待审批</span>
+                        <span v-if="scope.row.State == '4'">已审批</span>
+                        <span v-if="scope.row.State == '3'">已驳回</span>
+                    </template>
+                </el-table-column>
+                <el-table-column v-if="!isApprove"
                     prop="PublishTime"
                     label="发布时间"
                     min-width="124"
@@ -194,6 +217,18 @@
                     </svg>
                     </template>
                 </el-table-column>
+                <el-table-column
+                    v-if="isApprove"
+                    prop="PublishTime"
+                    label="审批时间"
+                    min-width="124"
+                    align="center"
+                    :formatter="formatterColumn"
+                >
+                    <template slot-scope="scope">
+                        <span>{{scope.row.PrePublishTime?scope.row.PrePublishTime:scope.row.PublishTime|formatTime}}</span>
+                    </template>
+                </el-table-column>
                 <!-- <el-table-column v-if="permissionBtn.checkPermissionBtn(permissionBtn.smartReportManageBtn.reportManage_reportList_sendTime)"
                     prop="MsgSendTime"
                     label="报告推送时间"
@@ -230,44 +265,28 @@
                 <el-table-column label="操作" align="center" min-width="130">
                     <template slot-scope="scope">
                     <div class="opt-btns">
-                        <template
-                        v-if="scope.row.State == 1"
-                        >
-                        <span
-                            v-permission="permissionBtn.smartReportManageBtn.reportManage_publish"
-                            class="editsty"
-                            @click="handlePublishReportOpt(scope.row)"
-                            v-if="scope.row.CanEdit"
-                            >发布</span
-                        >
-                        <span
-                            v-permission="permissionBtn.smartReportManageBtn.reportManage_reportEdit"
-                            class="editsty"
-                            @click="editreport(scope.row, 'edit')"
-                            v-if="scope.row.CanEdit"
-                            >编辑</span
-                        >
-                        <span
-                            v-permission="permissionBtn.smartReportManageBtn.reportManage_reportEdit"
-                            class="editsty"
-                            @click="editreport(scope.row, 'editing')"
-                            v-else
-                            >{{ scope.row.Editor || "" }}编辑中...</span
-                        >
-                        <span
-                            v-permission="permissionBtn.smartReportManageBtn.reportManage_reportDel"
-                            class="deletesty"
-                            @click="handleDelReport(scope.row)"
-                            v-if="scope.row.CanEdit"
-                            >删除</span
-                        >
-                        </template>
-                        <template v-if="scope.row.State == 2">
-                        <span v-if="permissionBtn.checkPermissionBtn(permissionBtn.smartReportManageBtn.reportManage_cancelPublish)"
-                            @click="handleReportPublishCancel(scope.row)"
-                            style="color: red; cursor: pointer"
-                            >取消发布</span>
-                        <!-- <span
+                        <!-- 不走审批流的按钮 -->
+                        <template v-if="!isApprove">
+                            <template v-if="scope.row.State == 1">
+                                <span v-permission="permissionBtn.smartReportManageBtn.reportManage_publish"
+                                    class="editsty" @click="handlePublishReportOpt(scope.row)"
+                                    v-if="scope.row.CanEdit">发布</span>
+                                <span v-permission="permissionBtn.smartReportManageBtn.reportManage_reportEdit"
+                                    class="editsty" @click="editreport(scope.row, 'edit')"
+                                    v-if="scope.row.CanEdit">编辑</span>
+                                <span v-permission="permissionBtn.smartReportManageBtn.reportManage_reportEdit"
+                                    class="editsty" @click="editreport(scope.row, 'editing')"
+                                    v-else>{{ scope.row.Editor || "" }}编辑中...</span>
+                                <span v-permission="permissionBtn.smartReportManageBtn.reportManage_reportDel"
+                                    class="deletesty" @click="handleDelReport(scope.row)"
+                                    v-if="scope.row.CanEdit">删除</span>
+                            </template>
+                            <template v-if="scope.row.State == 2">
+                                <span
+                                    v-if="permissionBtn.checkPermissionBtn(permissionBtn.smartReportManageBtn.reportManage_cancelPublish)"
+                                    @click="handleReportPublishCancel(scope.row)"
+                                    style="color: red; cursor: pointer">取消发布</span>
+                                <!-- <span
                             v-if="scope.row.MsgIsSend == 0 && permissionBtn.checkPermissionBtn(permissionBtn.smartReportManageBtn.reportManage_sendMsg)"
                             style="color: #4099ef; cursor: pointer"
                             @click="handleSendMsg(scope.row)"
@@ -275,29 +294,65 @@
                         >
                         <span v-else-if="scope.row.MsgIsSend != 0&&permissionBtn.checkPermissionBtn(permissionBtn.smartReportManageBtn.reportManage_sendMsg)"
                             style="color: red">已推送消息</span> -->
+                            </template>
+                            <span style="color: #46c371; cursor: pointer;display:inline-block"
+                                v-if="permissionBtn.checkPermissionBtn(permissionBtn.smartReportManageBtn.reportManage_audioUpload)"
+                                @click="openupload(scope.row.SmartReportId)">音频上传</span>
+                            <span style="cursor: pointer; color: #4099ef;display:inline-block"
+                                v-permission="permissionBtn.smartReportManageBtn.reportManage_audioDownload"
+                                v-if="scope.row.VideoUrl" @click="handleDownloadVoice(scope.row)">
+                                音频下载
+                            </span>
+                            <!-- <a
+                                v-permission="permissionBtn.smartReportManageBtn.reportManage_audioDownload"
+                                :href="scope.row.VideoUrl"
+                                v-if="scope.row.VideoUrl"
+                                :download="scope.row.VideoName"
+                                style="cursor: pointer; color: #4099ef"
+                                >音频下载</a
+                                > -->
+                        </template>
+                        <!-- 走审批流的按钮 -->
+                        <template v-if="isApprove">
+                            <!-- 未提交 -->
+                            <template v-if="scope.row.State == 1">
+                                <span v-permission="permissionBtn.smartReportManageBtn.reportManage_publish"
+                                    class="editsty"
+                                    v-if="scope.row.CanEdit">提交</span>
+                                <span v-permission="permissionBtn.smartReportManageBtn.reportManage_reportEdit"
+                                    class="editsty" @click="editreport(scope.row, 'edit')"
+                                    v-if="scope.row.CanEdit">编辑</span>
+                                <span v-permission="permissionBtn.smartReportManageBtn.reportManage_reportEdit"
+                                    class="editsty" @click="editreport(scope.row, 'editing')"
+                                    v-else>{{ scope.row.Editor || "" }}编辑中...</span>
+                                <span v-permission="permissionBtn.smartReportManageBtn.reportManage_reportDel"
+                                    class="deletesty" @click="handleDelReport(scope.row)"
+                                    v-if="scope.row.CanEdit">删除</span>
+                            </template>
+                            <!--已提交(待审批,已审批)-->
+                            <template v-if="[2,4].includes(scope.row.State)">
+                                <span
+                                    v-if="permissionBtn.checkPermissionBtn(permissionBtn.smartReportManageBtn.reportManage_cancelPublish)"
+                                    style="color: red; cursor: pointer">撤销
+                                </span>
+                            </template>
+                             <!--已驳回则只显示撤销按钮-->
+                            <template v-if="scope.row.State===3">
+                                <span v-permission="permissionBtn.smartReportManageBtn.reportManage_publish"
+                                    class="editsty">撤销</span>
+                            </template>
+                            <!--音频上传/下载 按原先逻辑-->
+                            <template v-if="scope.row.State!==3">
+                                <span style="color: #46c371; cursor: pointer;display:inline-block"
+                                    v-if="permissionBtn.checkPermissionBtn(permissionBtn.smartReportManageBtn.reportManage_audioUpload)"
+                                    @click="openupload(scope.row.SmartReportId)">音频上传</span>
+                                <span style="cursor: pointer; color: #4099ef;display:inline-block"
+                                    v-permission="permissionBtn.smartReportManageBtn.reportManage_audioDownload"
+                                    v-if="scope.row.VideoUrl" @click="handleDownloadVoice(scope.row)">
+                                    音频下载
+                                </span>
+                            </template>
                         </template>
-                        <span
-                        style="color: #46c371; cursor: pointer;display:inline-block"
-                        v-if="permissionBtn.checkPermissionBtn(permissionBtn.smartReportManageBtn.reportManage_audioUpload)"
-                        @click="openupload(scope.row.SmartReportId)"
-                        >音频上传</span
-                        >
-                        <span 
-                            style="cursor: pointer; color: #4099ef;display:inline-block" 
-                            v-permission="permissionBtn.smartReportManageBtn.reportManage_audioDownload"
-                            v-if="scope.row.VideoUrl"
-                            @click="handleDownloadVoice(scope.row)"
-                        >
-                            音频下载
-                        </span>
-                        <!-- <a
-                        v-permission="permissionBtn.smartReportManageBtn.reportManage_audioDownload"
-                        :href="scope.row.VideoUrl"
-                        v-if="scope.row.VideoUrl"
-                        :download="scope.row.VideoName"
-                        style="cursor: pointer; color: #4099ef"
-                        >音频下载</a
-                        > -->
                     </div>
                     </template>
                 </el-table-column>