codeMan пре 2 година
родитељ
комит
143d486362

+ 2 - 1
src/HDrpManagement/remitvoucher/index.vue

@@ -15,7 +15,8 @@
       <template v-slot:tbList="scope">
         <div v-if="scope.data.column.columnname == 'status'">
           <span style="color:#333333" v-if="scope.data.column.data[[scope.data.column.columnname]] == '新建'">{{scope.data.column.data[[scope.data.column.columnname]]}}</span>
-          <span style="color:#3874f6" v-else-if="scope.data.column.data[[scope.data.column.columnname]] == '审核'">{{scope.data.column.data[[scope.data.column.columnname]]}}</span>
+          <span style="color:#333333" v-else-if="scope.data.column.data[[scope.data.column.columnname]] == '审核'">{{scope.data.column.data[[scope.data.column.columnname]]}}</span>
+          <span style="color:#3874f6" v-else-if="scope.data.column.data[[scope.data.column.columnname]] == '提交'">{{scope.data.column.data[[scope.data.column.columnname]]}}</span>
         </div>
         <div v-else>
           {{scope.data.column.data[[scope.data.column.columnname]]}}

+ 37 - 2
src/components/normal-basic-layout/details/index.vue

@@ -8,6 +8,13 @@
         </div>
         <div class="flex-align-center" style="flex: 1 0 auto;  justify-content: flex-end;">
           <cpEdit v-if="tool.checkAuth($route.name,'update')" :formPath="formPath" :oldFormPath="oldFormPath" :data="editData" btnType="default" @onAddSuccess="onSuccess"></cpEdit>
+          <!-- 打印 -->
+          <reportCenter position="detail" class="inline-16" :data="reportCenterLsit" v-if="reportCenterLsit.length > 0 && systemappid != 163">
+            <template v-slot:print="scope2">
+              <el-button @click="printBtn($route.query.id,scope2.data)" type="text" size="mini">打 印</el-button>
+            </template>
+          </reportCenter>
+
           <div>
             <slot name="customOperation"></slot>
           </div>
@@ -67,6 +74,7 @@ import tagTemp from './modules/tags/tag.vue'
 import tabTemp from './modules/tabs/tab.vue'
 import group from './modules/group/group.vue'
 import taskTemp from './modules/task/index.vue'
+import reportCenter from '../reportCenter/index'
 import {mapGetters} from 'vuex'
 export default {
   props:['titleText','mainAreaData','turnPageId','delApiId','idname','ownertable','formPath','oldFormPath','editData','tags','tabs','statusCheck','pageChange'],
@@ -88,7 +96,9 @@ export default {
         }
       },
       collapse:true,
-      refreshPage:true
+      refreshPage:true,
+      reportCenterLsit:[],
+      systemappid:JSON.parse(sessionStorage.getItem('activeApp')).systemappid,
     }
   },
   computed:{
@@ -102,7 +112,8 @@ export default {
     group,
     tagTemp,
     tabTemp,
-    taskTemp
+    taskTemp,
+    reportCenter
   },
   methods:{
     async queryData (pageNumber) {
@@ -117,6 +128,29 @@ export default {
       this.$refs['tag']?this.$refs['tag'].queryTag():''
       this.refresh()
     },
+    /* 获取是否有报表数据 */
+    async getSystemAppid () {
+      let res = await this.$api.requested({
+        "id":20221213094401,
+        "content": {
+          "systemappid":this.systemappid,
+        }
+      })
+      this.reportCenterLsit = res.data
+      console.log(res,'报表数据');
+    },
+    async printBtn (data,data2) {
+      let res = await this.$api.requested({
+        "id":20221213094501,
+        "content": {
+          sys_reportid:data2.sys_reportid,
+          dataid:data[this.idName]
+        }
+      })
+      this.tool.showMessage(res,() => {
+        window.open(this.$baseUrl + res.data)  
+      })
+    },
     next () {
       this.rowindex += 1
       this.queryData(this.rowindex)
@@ -197,6 +231,7 @@ export default {
     this.$emit('detailCreate',this.param)
     this.routerName = this.$route.meta.title
     this.rowindex = Number(this.$route.query.rowindex)
+    this.getSystemAppid()
   },
   watch:{
     mainAreaData () {

+ 2 - 2
src/components/normal-basic-layout/reportCenter/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-button type="text" size="mini" @click="drawer=true">报 表</el-button>
+    <el-button :type="position == 'detail' ? 'primary' : 'text'" size="mini" @click="drawer=true">报 表</el-button>
     <el-drawer
     :visible.sync="drawer"
     :with-header="false"
@@ -34,7 +34,7 @@
 
 <script>
 export default {
-  props:['data'],
+  props:['data','position'],
   name: '',
   data() {
     return {