Forráskód Böngészése

纸质运行记录上传新增修改功能

luoaoxuan 1 éve
szülő
commit
8411aba71a
1 módosított fájl, 44 hozzáadás és 3 törlés
  1. 44 3
      src/views/infosManage/fileIE.vue

+ 44 - 3
src/views/infosManage/fileIE.vue

@@ -90,6 +90,12 @@
                                 <span style="cursor: pointer"> 更新</span>
                             </div>
                         </template>
+                        <template
+                            slot="customButton"
+                            slot-scope="{row}"
+                        >
+                            <el-button type="text" icon="el-icon-edit-outline" @click="goEdit(row)">修改</el-button>
+                        </template>
                     </ibps-crud>
                 </template>
             </ibps-container>
@@ -138,6 +144,15 @@
             :son-data="sonData"
             @getcolse="getcolse"
         />
+        <data-template-formrender-dialog
+            :visible="editDialogVisible"
+            form-key="ywyxjlb"
+            :pk-value="editPkValue"
+            :toolbars="editToolbars"
+            :readonly="false"
+            :add-data-cont="addDataCont"
+            @close="editClose"
+        />
     </div>
 </template>
 <script>
@@ -152,6 +167,7 @@ import openFilePng from '@/assets/images/icons/openFile.png'
 import wordPng from '@/assets/images/icons/word.png'
 import fileTraining from '@/views/component/fileTraining'
 import UpdateFile from './updateFile'
+import DataTemplateFormrenderDialog from '@/business/platform/data/templaterender/form/dialog.vue'
 
 export default {
     components: {
@@ -159,16 +175,18 @@ export default {
         BpmnFormrender,
         UpdateFile,
         'ibps-attachment': IbpsAttachment,
-        'file-lookup': fileTraining
+        'file-lookup': fileTraining,
+        DataTemplateFormrenderDialog
     },
     mixins: [FixHeight],
     data () {
-        const { isSuper, deptList = [] } = this.$store.getters || {}
+        const { isSuper, deptList = [], role } = this.$store.getters || {}
         const hasRole = localStorage.getItem('hasHighRole') === '1'
         const depArrs = deptList.map(
             (i) => `wj.bian_zhi_bu_men_ like '${i.positionId}'`
         )
         return {
+            role,
             isSuper,
             hasRole,
             depArrs,
@@ -241,7 +259,19 @@ export default {
             dialogVisible: false,
             fileInfos: {},
             // 本人修改
-            fileArray: []
+            fileArray: [],
+            editDialogVisible: false,
+            editPkValue: '',
+            editToolbars: [{
+                button_type: 'close',
+                label: '关闭',
+                key: 'close'
+            },
+            {
+                button_type: 'save',
+                label: '保存',
+                key: 'save'
+            }]
         }
     },
     watch: {
@@ -335,9 +365,20 @@ export default {
                 { prop: 'bian_zhi_shi_jian', label: '上传时间', width: 140 },
                 { prop: 'ry_name', label: '上传人', width: 90 }
             ]
+            const roleList = ['xtgljs', 'wjglzzc', 'wjgly'] // 系统管理员 文件管理组组长 文件管理员可修改
+            const hasRole = this.role.some(r => roleList.includes(r.alias))
+            if (hasRole) this.listConfig.columns.push({ prop: '', label: '操作', width: 100, slotName: 'customButton' })
         }
     },
     methods: {
+        editClose (visible) {
+            this.editDialogVisible = visible
+            this.refreshData()
+        },
+        goEdit (row) {
+            this.editPkValue = row.id_
+            this.editDialogVisible = true
+        },
         unitConversions (str) {
             // 使用正则表达式匹配括号内的数字
             const match = str.match(/((\d+))/)