Browse Source

SAI开项申请流程:附件预览、下载

wangggziwen 2 năm trước cách đây
mục cha
commit
6f2fa38291

+ 36 - 19
ui/src/views/approve/approveDetail/sai-apply-detail.vue

@@ -100,25 +100,25 @@
               <!--<el-table-column :label="$t('上传时间')" align="center" prop="createdate" :show-overflow-tooltip="true" width="120"/>-->
               <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
                 <template slot-scope="scope">
-                  <!--<el-button-->
-                    <!--v-if="scope.row.fileName.endsWith('pdf')||scope.row.fileName.endsWith('xlsx')||scope.row.fileName.endsWith('md')-->
-                 <!--||scope.row.fileName.endsWith('docx')||scope.row.fileName.endsWith('doc')||scope.row.fileName.endsWith('txt')-->
-                 <!--||scope.row.fileName.endsWith('jpg')||scope.row.fileName.endsWith('png')||scope.row.fileName.endsWith('csv')-->
-                 <!--||scope.row.fileName.endsWith('mp4')||scope.row.fileName.endsWith('svg')||scope.row.fileName.endsWith('dwg')-->
-                 <!--||scope.row.fileName.endsWith('flv')||scope.row.fileName.endsWith('swf')||scope.row.fileName.endsWith('gif')-->
-                 <!--||scope.row.fileName.endsWith('3gp')||scope.row.fileName.endsWith('mkv')||scope.row.fileName.endsWith('tif')"-->
-                    <!--size="mini"-->
-                    <!--type="text"-->
-                    <!--icon="el-icon-view"-->
-                    <!--@click="handleSee(scope.row)"-->
-                  <!--&gt; {{ $t('预览') }}</el-button>-->
-                  <!--<el-button-->
-                    <!--v-if="scope.row.fileName.endsWith('ppt')||scope.row.fileName.endsWith('pptx') "-->
-                    <!--size="mini"-->
-                    <!--type="text"-->
-                    <!--icon="el-icon-view"-->
-                    <!--@click="handleSeePPT(scope.row)"-->
-                  <!--&gt; {{ $t('ppt预览') }}</el-button>-->
+                  <el-button
+                    v-if="scope.row.fileName.endsWith('pdf')||scope.row.fileName.endsWith('xlsx')||scope.row.fileName.endsWith('md')
+                 ||scope.row.fileName.endsWith('docx')||scope.row.fileName.endsWith('doc')||scope.row.fileName.endsWith('txt')
+                 ||scope.row.fileName.endsWith('jpg')||scope.row.fileName.endsWith('png')||scope.row.fileName.endsWith('csv')
+                 ||scope.row.fileName.endsWith('mp4')||scope.row.fileName.endsWith('svg')||scope.row.fileName.endsWith('dwg')
+                 ||scope.row.fileName.endsWith('flv')||scope.row.fileName.endsWith('swf')||scope.row.fileName.endsWith('gif')
+                 ||scope.row.fileName.endsWith('3gp')||scope.row.fileName.endsWith('mkv')||scope.row.fileName.endsWith('tif')"
+                    size="mini"
+                    type="text"
+                    icon="el-icon-view"
+                    @click="handleSee(scope.row)"
+                  > {{ $t('预览') }}</el-button>
+                  <el-button
+                    v-if="scope.row.fileName.endsWith('ppt')||scope.row.fileName.endsWith('pptx') "
+                    size="mini"
+                    type="text"
+                    icon="el-icon-view"
+                    @click="handleSeePPT(scope.row)"
+                  > {{ $t('ppt预览') }}</el-button>
                   <el-button
                     size="mini"
                     type="text"
@@ -483,6 +483,22 @@
       </span>
       <el-button @click="visible = false">{{ $t('返回') }}</el-button>
     </div>
+    <!-- 预览对话框 -->
+    <el-dialog  v-loading="loadingFlash"     element-loading-background="rgba(0,0,0,0.2)"                 v-dialogDrag :title="pdf.title" :visible.sync="pdf.open"  width="1300px" :center="true" append-to-body>
+      <div style="margin-top: -60px;float: right;margin-right: 40px;">
+        <el-button size="mini" type="text" @click="openPdf">{{$t('新页面打开PDF')}}</el-button></div>
+      <div style="margin-top: -30px" >
+        <iframe id="iFrame" class="iframe-html" :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px" v-if="ppt"></iframe>
+      </div>
+      <div style="padding: 30px; width: 100%; height: 100%;" >
+        <el-carousel class="" ref="carousel"  arrow="always"  v-if="pptView"
+                     height="700px"  trigger="click" :autoplay="false" indicator-position="outside">
+          <el-carousel-item class="lun_img" v-for="item in imgs" v-bind:key="item" >
+            <img :src="item" width="100%" height="100%" object-fit="cover" />
+          </el-carousel-item>
+        </el-carousel>
+      </div>
+    </el-dialog>
   </el-dialog>
 </template>
 
@@ -865,6 +881,7 @@ export default {
     },
     /** 获取SAI类别列表数据 */
     getCategoryList() {
+      this.saiCategoryOptions = [];
       categoryList().then(response => {
         let data = response.data;
         for (let i = 0; i < data.length; i++) {

+ 45 - 0
ui/src/views/production/apply/all/index.vue

@@ -387,6 +387,44 @@
                 </div>
               </el-upload>
             </el-form-item>
+            <el-table :data="doc.commonfileListApply" border v-if="form.saiApplyId">
+              <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
+                <template slot-scope="scope">
+                  <a  class="link-type"  @click="handleDownload(scope.row)">
+                    <span>{{ scope.row.fileName }}</span>
+                  </a>
+                </template>
+              </el-table-column>
+              <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
+                <template slot-scope="scope">
+                  <el-button
+                    v-if="scope.row.fileName.endsWith('pdf')||scope.row.fileName.endsWith('xlsx')||scope.row.fileName.endsWith('md')
+                 ||scope.row.fileName.endsWith('docx')||scope.row.fileName.endsWith('doc')||scope.row.fileName.endsWith('txt')
+                 ||scope.row.fileName.endsWith('jpg')||scope.row.fileName.endsWith('png')||scope.row.fileName.endsWith('csv')
+                 ||scope.row.fileName.endsWith('mp4')||scope.row.fileName.endsWith('svg')||scope.row.fileName.endsWith('dwg')
+                 ||scope.row.fileName.endsWith('flv')||scope.row.fileName.endsWith('swf')||scope.row.fileName.endsWith('gif')
+                 ||scope.row.fileName.endsWith('3gp')||scope.row.fileName.endsWith('mkv')||scope.row.fileName.endsWith('tif')"
+                    size="mini"
+                    type="text"
+                    icon="el-icon-view"
+                    @click="handleSee(scope.row)"
+                  > {{ $t('预览') }}</el-button>
+                  <el-button
+                    v-if="scope.row.fileName.endsWith('ppt')||scope.row.fileName.endsWith('pptx') "
+                    size="mini"
+                    type="text"
+                    icon="el-icon-view"
+                    @click="handleSeePPT(scope.row)"
+                  > {{ $t('ppt预览') }}</el-button>
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-download"
+                    @click="handleDownload(scope.row)"
+                  >{{ $t('下载') }}</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
           </el-descriptions-item>
           <el-descriptions-item label="登记时间">
             <el-form-item prop="applyDate">
@@ -607,6 +645,7 @@ import ProcessImg from '@/views/approve/processImg/index';
 import { listStaffmgrByDeptAndTeam, getLoginStaffInfo } from "@/api/plant/staffmgr";
 import { allFileList, delCommonfile } from "@/api/common/commonfile";
 import { categoryList } from "@/api/production/category";
+import { listFile } from "@/api/production/saiApproveFile";
 
 export default {
   name: "Apply",
@@ -693,6 +732,7 @@ export default {
         // 上传的地址
         url: process.env.VUE_APP_BASE_API + "/production/saiFile/uploadFile",
         commonfileList: null,
+        commonfileListApply: null,
         queryParams: {
           pId: null,
           pType: 'saiApply'
@@ -1339,6 +1379,11 @@ export default {
     handleUpdate(row) {
       this.reset();
       const saiApplyId = row.saiApplyId || this.ids
+      listFile({
+        approveId: saiApplyId
+      }).then(response => {
+        this.doc.commonfileListApply = response;
+      });
       getApply(saiApplyId).then(response => {
         this.form = response.data;
         if (this.form.unsafeStatus != null && this.form.unsafeStatus != "") {

+ 45 - 0
ui/src/views/production/apply/mine/index.vue

@@ -387,6 +387,44 @@
                 </div>
               </el-upload>
             </el-form-item>
+            <el-table :data="doc.commonfileListApply" border v-if="form.saiApplyId">
+              <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
+                <template slot-scope="scope">
+                  <a  class="link-type"  @click="handleDownload(scope.row)">
+                    <span>{{ scope.row.fileName }}</span>
+                  </a>
+                </template>
+              </el-table-column>
+              <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
+                <template slot-scope="scope">
+                  <el-button
+                    v-if="scope.row.fileName.endsWith('pdf')||scope.row.fileName.endsWith('xlsx')||scope.row.fileName.endsWith('md')
+                 ||scope.row.fileName.endsWith('docx')||scope.row.fileName.endsWith('doc')||scope.row.fileName.endsWith('txt')
+                 ||scope.row.fileName.endsWith('jpg')||scope.row.fileName.endsWith('png')||scope.row.fileName.endsWith('csv')
+                 ||scope.row.fileName.endsWith('mp4')||scope.row.fileName.endsWith('svg')||scope.row.fileName.endsWith('dwg')
+                 ||scope.row.fileName.endsWith('flv')||scope.row.fileName.endsWith('swf')||scope.row.fileName.endsWith('gif')
+                 ||scope.row.fileName.endsWith('3gp')||scope.row.fileName.endsWith('mkv')||scope.row.fileName.endsWith('tif')"
+                    size="mini"
+                    type="text"
+                    icon="el-icon-view"
+                    @click="handleSee(scope.row)"
+                  > {{ $t('预览') }}</el-button>
+                  <el-button
+                    v-if="scope.row.fileName.endsWith('ppt')||scope.row.fileName.endsWith('pptx') "
+                    size="mini"
+                    type="text"
+                    icon="el-icon-view"
+                    @click="handleSeePPT(scope.row)"
+                  > {{ $t('ppt预览') }}</el-button>
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-download"
+                    @click="handleDownload(scope.row)"
+                  >{{ $t('下载') }}</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
           </el-descriptions-item>
           <el-descriptions-item label="登记时间">
             <el-form-item prop="applyDate">
@@ -607,6 +645,7 @@
   import { listStaffmgrByDeptAndTeam, getLoginStaffInfo } from "@/api/plant/staffmgr";
   import { allFileList, delCommonfile } from "@/api/common/commonfile";
   import { categoryList } from "@/api/production/category";
+  import { listFile } from "@/api/production/saiApproveFile";
 
   export default {
     name: "Apply",
@@ -693,6 +732,7 @@
           // 上传的地址
           url: process.env.VUE_APP_BASE_API + "/production/saiFile/uploadFile",
           commonfileList: null,
+          commonfileListApply: null,
           queryParams: {
             pId: null,
             pType: 'saiApply'
@@ -1355,6 +1395,11 @@
       handleUpdate(row) {
         this.reset();
         const saiApplyId = row.saiApplyId || this.ids
+        listFile({
+          approveId: saiApplyId
+        }).then(response => {
+          this.doc.commonfileListApply = response;
+        });
         getApply(saiApplyId).then(response => {
           this.form = response.data;
           if (this.form.unsafeStatus != null && this.form.unsafeStatus != "") {

+ 45 - 0
ui/src/views/production/apply/pending/index.vue

@@ -387,6 +387,44 @@
                 </div>
               </el-upload>
             </el-form-item>
+            <el-table :data="doc.commonfileListApply" border v-if="form.saiApplyId">
+              <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
+                <template slot-scope="scope">
+                  <a  class="link-type"  @click="handleDownload(scope.row)">
+                    <span>{{ scope.row.fileName }}</span>
+                  </a>
+                </template>
+              </el-table-column>
+              <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
+                <template slot-scope="scope">
+                  <el-button
+                    v-if="scope.row.fileName.endsWith('pdf')||scope.row.fileName.endsWith('xlsx')||scope.row.fileName.endsWith('md')
+                 ||scope.row.fileName.endsWith('docx')||scope.row.fileName.endsWith('doc')||scope.row.fileName.endsWith('txt')
+                 ||scope.row.fileName.endsWith('jpg')||scope.row.fileName.endsWith('png')||scope.row.fileName.endsWith('csv')
+                 ||scope.row.fileName.endsWith('mp4')||scope.row.fileName.endsWith('svg')||scope.row.fileName.endsWith('dwg')
+                 ||scope.row.fileName.endsWith('flv')||scope.row.fileName.endsWith('swf')||scope.row.fileName.endsWith('gif')
+                 ||scope.row.fileName.endsWith('3gp')||scope.row.fileName.endsWith('mkv')||scope.row.fileName.endsWith('tif')"
+                    size="mini"
+                    type="text"
+                    icon="el-icon-view"
+                    @click="handleSee(scope.row)"
+                  > {{ $t('预览') }}</el-button>
+                  <el-button
+                    v-if="scope.row.fileName.endsWith('ppt')||scope.row.fileName.endsWith('pptx') "
+                    size="mini"
+                    type="text"
+                    icon="el-icon-view"
+                    @click="handleSeePPT(scope.row)"
+                  > {{ $t('ppt预览') }}</el-button>
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-download"
+                    @click="handleDownload(scope.row)"
+                  >{{ $t('下载') }}</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
           </el-descriptions-item>
           <el-descriptions-item label="登记时间">
             <el-form-item prop="applyDate">
@@ -607,6 +645,7 @@
   import { listStaffmgrByDeptAndTeam, getLoginStaffInfo } from "@/api/plant/staffmgr";
   import { allFileList, delCommonfile } from "@/api/common/commonfile";
   import { categoryList } from "@/api/production/category";
+  import { listFile } from "@/api/production/saiApproveFile";
 
   export default {
     name: "Apply",
@@ -693,6 +732,7 @@
           // 上传的地址
           url: process.env.VUE_APP_BASE_API + "/production/saiFile/uploadFile",
           commonfileList: null,
+          commonfileListApply: null,
           queryParams: {
             pId: null,
             pType: 'saiApply'
@@ -1352,6 +1392,11 @@
       handleUpdate(row) {
         this.reset();
         const saiApplyId = row.saiApplyId || this.ids
+        listFile({
+          approveId: saiApplyId
+        }).then(response => {
+          this.doc.commonfileListApply = response;
+        });
         getApply(saiApplyId).then(response => {
           this.form = response.data;
           if (this.form.unsafeStatus != null && this.form.unsafeStatus != "") {