qinzhipeng_v@didiglobal.com 4 年之前
父节点
当前提交
915f2fca0d

+ 4 - 4
src/views/reportManagement/components/DailyReport.vue

@@ -220,7 +220,7 @@ export default {
       this.getreportTemplate()
     },
 
-    open_new_template(val) { // 点击新建模版
+    open_new_template(val, show) { // 点击新建模版
       val ? this.templateId = val.id : this.templateId = null
       this.tits = this.reportHome
       if (this.templateId === null) {
@@ -229,7 +229,7 @@ export default {
         this.showOne = false // 模版选择
         this.customList = []
       } else {
-        if (val.creator === localStorage.getItem('username')) {
+        if (val.creator === localStorage.getItem('username') || show) {
           this.reportTamplate = true // 编辑区域
           this.reportHome = '编辑测试日报模版' // 步骤条
           this.showOne = false // 模版选择
@@ -239,8 +239,8 @@ export default {
       }
     },
 
-    async settingDeleteReportModule(item) {
-      if (item.creator === localStorage.getItem('username')) {
+    async settingDeleteReportModule(item, show) {
+      if (item.creator === localStorage.getItem('username') || show) {
         const res = await settingDeleteReportModule({ id: item.id }, item.id)
         if (res.code === 200) {
           this.getreportTemplate()

+ 7 - 5
src/views/reportManagement/components/ReleaseReport.vue

@@ -29,7 +29,7 @@
       />
 
       <!-- 准出报告 -->
-      <newReleaeTemplate v-if="newDailyTemplate" ref="dailyTemplate" class="daily" :template-id="fromData.radio" :task-ids="daily_taskIds" @SaveNextStep="SaveNextStep" />
+      <newReleaeTemplate v-if="newDailyTemplate" ref="dailyTemplate" class="daily" :custom="customList" :template-id="fromData.radio" :task-ids="daily_taskIds" @SaveNextStep="SaveNextStep" />
 
       <!-- 准出预览 -->
       <releaePreview v-if="dailyPreview" ref="dailyPreview" class="daily" :daily-id="dailyId" @handleClose="handleClose" @loading="loading = false" />
@@ -119,8 +119,10 @@ export default {
     },
     init(index, newData) {
       this.dialogDaliy = true
+      console.log(newData, 'fjids')
       switch (index) {
         case 2: // 编辑
+          this.customList = newData.customFields
           this.daily_taskIds = null // 关联任务
           this.fromData.radio = newData // 选择的模块
           this.reportHome = '准出报告' // 步骤条
@@ -186,7 +188,7 @@ export default {
       this.getreportTemplate()
     },
 
-    open_new_template(val) { // 点击新建模版
+    open_new_template(val, show) { // 点击新建模版
       !val ? this.templateId = { 'name': '新建模版', from: this.customList.length === 0 ? this.temporary.from : [] } : this.templateId = { 'name': '编辑模版', 'set_up': val.id }
       this.tits = this.reportHome
       if (this.templateId.name === '新建模版') {
@@ -194,7 +196,7 @@ export default {
         this.reportHome = '创建准出报告模版' // 步骤条
         this.showOne = false // 模版选择
       } else {
-        if (val.creator === localStorage.getItem('username')) {
+        if (val.creator === localStorage.getItem('username') || show) {
           this.reportTamplate = true // 编辑区域
           this.reportHome = '编辑准出报告模版' // 步骤条
           this.showOne = false // 模版选择
@@ -204,8 +206,8 @@ export default {
       }
     },
 
-    async settingDeleteReportModule(item) {
-      if (item.creator === localStorage.getItem('username')) {
+    async settingDeleteReportModule(item, show) {
+      if (item.creator === localStorage.getItem('username') || show) {
         const res = await settingDeleteReportModule({ id: item.id }, item.id)
         if (res.code === 200) {
           this.getreportTemplate()

+ 4 - 4
src/views/reportManagement/components/TestingReport.vue

@@ -221,7 +221,7 @@ export default {
       this.getreportTemplate()
     },
 
-    open_new_template(val) { // 点击新建模版
+    open_new_template(val, show) { // 点击新建模版
       !val ? this.templateId = { 'name': '新建模版', from: this.customList.length === 0 ? this.temporary.from : [] } : this.templateId = { 'name': '编辑模版', 'repot_up': val.id }
       this.tits = this.reportHome
       if (this.templateId.name === '新建模版') {
@@ -229,7 +229,7 @@ export default {
         this.showOne = false // 模版选择
         this.customList = []
       } else {
-        if (val.creator === localStorage.getItem('username')) {
+        if (val.creator === localStorage.getItem('username') || show) {
           this.reportHome = `编辑提测报告模版` // 步骤条
           this.showOne = false // 模版选择
         } else {
@@ -238,8 +238,8 @@ export default {
       }
     },
 
-    async settingDeleteReportModule(item) {
-      if (item.creator === localStorage.getItem('username')) {
+    async settingDeleteReportModule(item, show) {
+      if (item.creator === localStorage.getItem('username') || show) {
         const res = await settingDeleteReportModule({ id: item.id }, item.id)
         if (res.code === 200) {
           this.getreportTemplate()

+ 0 - 1
src/views/reportManagement/components/template/customTemplate.vue

@@ -83,7 +83,6 @@ export default {
       return checkList.indexOf(conditions) !== -1
     },
     getFormValue(e) {
-      console.log(e)
       this.show = false
       const params = {}
       const keys = []

+ 15 - 4
src/views/reportManagement/components/template/index.vue

@@ -15,13 +15,13 @@
             <el-col :span="5" class="creatorList">
               <div class="Layout_space_between">
                 <span>{{ item.creatorObject.name }}</span>
-                <span v-if="item.creator !== 'SYSTEM' && item.creator !== '系统'" style="margin-left: 30px;">
-                  <i class="el-icon-edit-outline didi-hover" @click="$emit('createModule', item)" />
+                <span v-if="item.creator !== 'SYSTEM' && item.creator !== '系统' || show" style="margin-left: 30px;">
+                  <i class="el-icon-edit-outline didi-hover" @click="$emit('createModule', item, show)" />
                   <el-popover :ref="item.id" placement="bottom" width="300" class="popover-module" :visible-arrow="false" trigger="click">
                     <div><div class="blur-column" /> 删除模版</div>
                     <div class="deletreport">是否要删除模版{{ item.moduleName }}?</div>
                     <div style="text-align: right;">
-                      <el-button size="mini" type="danger" @click="$emit('deleModule', item)">确定</el-button>
+                      <el-button size="mini" type="danger" @click="$emit('deleModule', item, show)">确定</el-button>
                       <el-button size="mini" @click="closeDefaultPopover()">取消</el-button>
                     </div>
                     <i slot="reference" class="el-icon-delete didi-hover" style="margin-left: 10px;" />
@@ -39,6 +39,7 @@
 </template>
 
 <script>
+import { verifyIsAdmin } from '@/api/configure.js'
 export default {
   props: {
     data: { type: Array, required: true },
@@ -48,7 +49,8 @@ export default {
   data() {
     return {
       selectTemplate: this.data,
-      radio: this.fromradio
+      radio: this.fromradio,
+      show: false
     }
   },
   watch: {
@@ -59,7 +61,16 @@ export default {
       this.radio = this.fromradio
     }
   },
+  created() {
+    this.verifyIsAdmin()
+  },
   methods: {
+    async verifyIsAdmin() {
+      const res = await verifyIsAdmin()
+      if (res.code === 200) {
+        this.show = res.data
+      }
+    },
     closeDefaultPopover() { // 模拟点击
       this.$refs.refName.click()
     }