scorpio преди 2 години
родител
ревизия
14d45ae32a
променени са 3 файла, в които са добавени 237 реда и са изтрити 106 реда
  1. 1 4
      src/views/home/component/dash.vue
  2. 203 77
      src/views/home/component/params/params4.vue
  3. 33 25
      src/views/home/component/params/params5.vue

+ 1 - 4
src/views/home/component/dash.vue

@@ -91,10 +91,7 @@
       <template #menu="{ row }">
         <el-button
           v-if="
-            user.info.viewStage !== 1 &&
-            dataType === 'asset' &&
-            row.project_stage !== 7 &&
-            row.can_update
+            dataType === 'asset' && row.project_stage !== 7 && row.can_update
           "
           icon="Upload"
           type="primary"

+ 203 - 77
src/views/home/component/params/params4.vue

@@ -1,42 +1,68 @@
 <template>
-  <div class='flex flex-justify-start flex-align-center flex-col'>
-    <div class='flex flex-center full-width flex-justify-between mt-10 mb-10'>
-      <span class='full-width text-left bold'>{{ info.dictValue }}</span>
+  <div class="flex flex-justify-start flex-align-center flex-col">
+    <div class="flex flex-center full-width flex-justify-between mt-10 mb-10">
+      <span class="full-width text-left bold">{{ info.dictValue }}</span>
     </div>
-    <div class='mt-10' style='width: 80%;'>
+    <div class="mt-10" style="width: 80%">
       <avue-crud
-          :option="option"
-          :data="data"
-          ref="crud"
-          v-model="form"
-          :before-open="beforeOpen"
-          @row-del="rowDel"
-          @row-save="rowSave"
-          @row-update="rowUpdate">
-        <template #menu='{row}'>
-          <el-button v-if='detail.canUpdate' text type='primary' icon='el-icon-edit' @click='edit(row)'>编辑</el-button>
+        :option="option"
+        :data="data"
+        ref="crud"
+        v-model="form"
+        :before-open="beforeOpen"
+        @row-del="rowDel"
+        @row-save="rowSave"
+        @row-update="rowUpdate"
+      >
+        <template #menu-right>
+          <div class="full-width">
+            <el-button
+              icon="el-icon-refresh"
+              circle
+              @click="proInfo"
+            ></el-button>
+          </div>
+        </template>
+        <template #menu="{ row }">
+          <el-button
+            text
+            type="primary"
+            icon="el-icon-folder-checked"
+            @click="openFolder(row)"
+            >打开文件夹
+          </el-button>
+          <el-button text type="primary" icon="el-icon-view" @click="edit(row)"
+            >文号提取
+          </el-button>
+        </template>
+        <template #file="{ row }">
+          <div v-if="row.file">
+            {{ row.file.originalFileName }}
+          </div>
         </template>
-        <template #doc='{row}'>
-          <div class='flex flex-center' @click='edit = true'>
-            <div v-if='row.edit === false'>{{ detail[row.prop] ? detail[row.prop] : '暂无' }}</div>
-            <el-input v-else v-model='newDetail[row.prop]' :placeholder='detail[row.prop]'></el-input>
-            <el-button circle @click='changeEdit(row)' icon='el-icon-edit' class='ml-10 pointer'>
-            </el-button>
+        <template #doc="{ row }">
+          <div v-if="row.file">
+            {{ row.file.copyNumber }}
           </div>
         </template>
       </avue-crud>
     </div>
-    <el-dialog v-model='show'>
+    <el-dialog v-model="show">
       <div>
-        {{ currentRow }}
-        <uploads max='1' :auto='true' :data='{type:1,toStutus:2}'/>
+        <uploads max="1" :auto="true" :data="{ type: 1, toStutus: 2 }" />
       </div>
     </el-dialog>
+    <el-image-viewer
+      v-if="showImage"
+      :url-list="preList"
+      @close="showImage = false"
+    />
   </div>
 </template>
 
 <script>
 import uploads from '@/components/uploads.vue'
+import api from '@/api/index.js'
 
 export default {
   name: 'params4',
@@ -55,15 +81,20 @@ export default {
   },
   watch: {
     detail: {
-      handler (val) {
+      handler(val) {
         this.newDetail = val
         delete this.newDetail._id
+        if (Object.hasOwn(val, 'fileList')) {
+          this.initFileList(this.newDetail.fileList)
+        }
       },
       immediate: true
     }
   },
-  data () {
+  data() {
     return {
+      showImage: false,
+      preList: [],
       newDetail: null,
       canEdit: false,
       docNo: '',
@@ -78,6 +109,7 @@ export default {
           deptName: '',
           docNo: '凤环函〔2018147]号',
           edit: false,
+          dispatchType: 1,
           prop: 'approval_no-land_use_pre_audit'
         },
         {
@@ -85,6 +117,7 @@ export default {
           deptName: '',
           docNo: '选字第201900011号',
           edit: false,
+          dispatchType: 2,
           prop: 'approval_no-site_select_opinions'
         },
         {
@@ -92,6 +125,7 @@ export default {
           deptName: '生态环境局',
           edit: false,
           docNo: '',
+          dispatchType: 3,
           prop: 'approval_no-eia'
         },
         {
@@ -99,6 +133,7 @@ export default {
           deptName: '',
           docNo: '',
           edit: false,
+          dispatchType: 4,
           prop: 'approval_no-advice_ratify'
         },
         {
@@ -106,6 +141,7 @@ export default {
           deptName: '发改局',
           edit: false,
           docNo: '',
+          dispatchType: 5,
           prop: 'approval_no-feasibility_study'
         },
         {
@@ -113,6 +149,7 @@ export default {
           deptName: '',
           docNo: '',
           edit: false,
+          dispatchType: 6,
           prop: 'approval_no-design'
         },
         {
@@ -120,6 +157,7 @@ export default {
           deptName: '住建局',
           docNo: '',
           edit: false,
+          dispatchType: 7,
           prop: 'approval_no-land_user'
         },
         {
@@ -127,6 +165,7 @@ export default {
           deptName: '住建局',
           docNo: '',
           edit: false,
+          dispatchType: 8,
           prop: 'approval_no-permit_no'
         },
         {
@@ -134,6 +173,7 @@ export default {
           deptName: '住建局',
           docNo: '',
           edit: false,
+          dispatchType: 9,
           prop: 'approval_no-construction_permit'
         },
         {
@@ -141,6 +181,7 @@ export default {
           deptName: '住建局',
           docNo: '',
           edit: false,
+          dispatchType: 10,
           prop: 'approval_no-construction_plan_permit'
         }
       ],
@@ -149,102 +190,185 @@ export default {
         menuAlign: 'center',
         menuWidth: 380,
         size: 'mini',
-        menu: false,
         addBtn: false,
-        delBtn: false,
-        editBtn: false,
         viewBtn: true,
+        delBtn: false,
+        editBtnText: '上传',
+        viewBtnText: '预览',
         refreshBtn: false,
         columnBtn: false,
         labelWidth: 140,
         border: true,
         column: [
           {
-            label: '审批事项(要件)',
+            label: '审批事项(要件)类型',
             prop: 'name',
             display: false
           },
           {
-            label: '文件',
+            label: '文件名称',
             prop: 'file',
-            hide: true,
-            type: 'upload'
+            type: 'input',
+            slot: true
           },
           {
             label: '文号',
-            prop: 'doc'
+            prop: 'doc',
+            slot: true
           }
         ]
       }
     }
   },
   methods: {
-    edit (row) {
+    proInfo() {
+      this.$api.project.projectMapInfo(this.detail.id).then(res => {
+        if (res.code === 200) {
+          this.newDetail = res.data
+          this.initFileList(this.newDetail.fileList)
+        }
+      })
+    },
+    edit(row) {
       this.show = true
       this.currentRow = row
     },
-    beforeOpen (done, type) {
-      if (['view', 'edit'].includes(type)) {
-        console.log(type)
+    beforeOpen(done, type) {
+      if (type === 'view') {
+        this.previewFile(this.form)
+      } else if (type === 'edit') {
+        this.openFile(this.form)
+      } else {
+        done()
+      }
+    },
+    /**
+     * 打开文件夹
+     * @param item
+     */
+    openFolder(item) {
+      console.log(item)
+      this.$router.push({
+        path: '/home/files',
+        query: {
+          id: item,
+          projectId: this.newDetail.projectId
+        }
+      })
+    },
+    /**
+     * 文件预览
+     * @param item
+     */
+    previewFile(item) {
+      console.log(item)
+      if (!Object.hasOwn(this.form, 'file')) {
+        this.$message.error('暂无文件')
+        return
+      }
+      if (api.offices.includes(item.file.suffix)) {
+        const routeData = this.$router.resolve({
+          path: '/home/file_detail',
+          query: { id: item.fileId }
+        })
+        window.open(routeData.href, '_blank')
+      } else {
+        this.preList.length = 0
+        this.preList.push(item.file.filePath)
+        this.showImage = true
+      }
+    },
+    /**
+     * 打开上传文件夹
+     * @param row
+     */
+    openFile(row) {
+      const routeUrl = this.$router.resolve({
+        path: '/home/details',
+        query: {
+          id: this.newDetail.id,
+          dispatchType: row.dispatchType,
+          type: 3
+        }
+      })
+      window.open(routeUrl.href, '_blank')
+    },
+    initFileList(list) {
+      if (list && list.length === 0) {
+        return
       }
-      done()
+      this.data = this.data.map(sub => {
+        const tmp = list.filter(ele => ele.type === sub.dispatchType)
+        if (tmp && tmp.length > 0) {
+          sub = Object.assign(sub, tmp[0])
+        }
+        return sub
+      })
     },
-    refreshChange () {
+    refreshChange() {
       this.onLoad()
     },
-    rowSave (row, done, loading) {
+    rowSave(row, done, loading) {
       const data = {
         projectInfoId: this.info.id
       }
-      this.$api.projects.meeting.save(Object.assign(row, data)).then((res) => {
-        if (res.code === 200) {
-          this.$message.success(res.msg)
-        } else {
-          this.$message.error(res.msg)
+      this.$api.projects.meeting.save(Object.assign(row, data)).then(
+        res => {
+          if (res.code === 200) {
+            this.$message.success(res.msg)
+          } else {
+            this.$message.error(res.msg)
+          }
+          done(row)
+          this.onLoad()
+        },
+        error => {
+          window.console.log(error)
+          loading()
         }
-        done(row)
-        this.onLoad()
-      }, error => {
-        window.console.log(error)
-        loading()
-      })
+      )
     },
-    rowUpdate (row, index, done, loading) {
+    rowUpdate(row, index, done, loading) {
       const data = {
         projectInfoId: this.info.id
       }
-      this.$api.projects.meeting.update(Object.assign(row, data)).then((res) => {
-        if (res.code === 200) {
-          this.$message.success(res.msg)
-        } else {
-          this.$message.error(res.msg)
+      this.$api.projects.meeting.update(Object.assign(row, data)).then(
+        res => {
+          if (res.code === 200) {
+            this.$message.success(res.msg)
+          } else {
+            this.$message.error(res.msg)
+          }
+          done(row)
+          this.onLoad()
+        },
+        error => {
+          window.console.log(error)
+          loading()
         }
-        done(row)
-        this.onLoad()
-      }, error => {
-        window.console.log(error)
-        loading()
-      })
+      )
     },
-    rowDel (row, index, done) {
+    rowDel(row, index, done) {
       this.$confirm('确定将选择数据删除?', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
-      }).then(() => {
-        return this.$api.projects.meeting.removeList({ ids: row.id })
-      }).then(() => {
-        this.$message({
-          type: 'success',
-          message: '操作成功!'
-        })
-        // 数据回调进行刷新
-        done(row)
-        this.onLoad()
-      }).catch(() => {
       })
+        .then(() => {
+          return this.$api.projects.meeting.removeList({ ids: row.id })
+        })
+        .then(() => {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          // 数据回调进行刷新
+          done(row)
+          this.onLoad()
+        })
+        .catch(() => {})
     },
-    changeEdit (res) {
+    changeEdit(res) {
       res.edit = !res.edit
       if (res.edit === false) {
         this.$api.project.proUpdate(this.newDetail).then(res => {
@@ -260,13 +384,15 @@ export default {
 }
 </script>
 
-<style lang='scss' scoped>
+<style lang="scss" scoped>
 .form-content {
   border: 1px solid #eeeeee;
   padding: 20px;
+
   :deep(.el-input.is-disabled .el-input__inner) {
     color: #343434;
   }
+
   :deep(.el-textarea.is-disabled .el-textarea__inner) {
     color: #343434;
   }

+ 33 - 25
src/views/home/component/params/params5.vue

@@ -1,32 +1,40 @@
 <template>
-  <div class='flex flex-justify-start flex-align-center flex-col'>
-    <div class='flex flex-center full-width flex-justify-between mt-10 mb-10'>
-      <span class='full-width text-left bold'>{{ info.dictValue }}</span>
-      <el-button v-if='detail.can_update' type='primary' @click='disabled = !disabled'>{{
-          disabled ? '编 辑' : '保 存'
-        }}
+  <div class="flex flex-justify-start flex-align-center flex-col">
+    <div class="flex flex-center full-width flex-justify-between mt-10 mb-10">
+      <span class="full-width text-left bold">{{ info.dictValue }}</span>
+      <el-button
+        v-if="detail.can_update"
+        type="primary"
+        @click="disabled = !disabled"
+        >{{ disabled ? '编 辑' : '保 存' }}
       </el-button>
     </div>
-    <div class='mt-10' style='width: 90%;'>
+    <div class="mt-10" style="width: 90%">
       <el-form
-          :model="form"
-          label-width='140px'
-          :disabled='disabled'
-          class='form-content flex flex-col'
+        :model="form"
+        label-width="140px"
+        :disabled="disabled"
+        class="form-content flex flex-col"
       >
-        <div class='flex flex-justify-start '>
-          <el-form-item label="年产值" style='flex:1'>
-            <el-input v-model="form.benefit_annual_output" placeholder='年产值'/>
+        <div class="flex flex-justify-start">
+          <el-form-item label="年产值" style="flex: 1">
+            <el-input
+              v-model="form.benefit_annual_output"
+              placeholder="年产值"
+            />
           </el-form-item>
-          <el-form-item label="年税收" style='flex:1' class='ml-20'>
-            <el-input v-model="form.benefit_annual_tax" placeholder='年税收'/>
+          <el-form-item label="年税收" style="flex: 1" class="ml-20">
+            <el-input v-model="form.benefit_annual_tax" placeholder="年税收" />
           </el-form-item>
         </div>
-        <div class='full-width  flex'>
-          <el-form-item label="新增就业人数" style='flex:1'>
-            <el-input v-model="form.benefit_new_employment" placeholder='新增就业人数'/>
+        <div class="full-width flex">
+          <el-form-item label="新增就业人数" style="flex: 1">
+            <el-input
+              v-model="form.benefit_new_employment"
+              placeholder="新增就业人数"
+            />
           </el-form-item>
-          <div style='flex:1' class='ml-20'></div>
+          <div style="flex: 1" class="ml-20"></div>
         </div>
       </el-form>
     </div>
@@ -48,13 +56,13 @@ export default {
   },
   watch: {
     detail: {
-      handler (val) {
+      handler(val) {
         this.form = val
       },
       immediate: true
     },
     disabled: {
-      handler (val) {
+      handler(val) {
         if (val) {
           this.updata()
         }
@@ -62,7 +70,7 @@ export default {
       immediate: false
     }
   },
-  data () {
+  data() {
     return {
       disabled: true,
       form: {
@@ -73,7 +81,7 @@ export default {
     }
   },
   methods: {
-    updata () {
+    updata() {
       this.detail.projectId = this.detail.id
       delete this.detail._id
       this.$api.project.proUpdate(this.detail).then(res => {
@@ -88,7 +96,7 @@ export default {
 }
 </script>
 
-<style lang='scss' scoped>
+<style lang="scss" scoped>
 .form-content {
   border: 1px solid #eeeeee;
   padding: 20px;