Browse Source

项目商机导出调整

qymljy 11 months ago
parent
commit
166158cabd

+ 5 - 1
src/HDrpManagement/projectChange/index.vue

@@ -9,7 +9,11 @@
       :apiId="{query:20221020143502,del:''}"
       :autoQuery="false"
       :specialKey="[{key:'leader',value:'name'},{key:'tag_sys',value:null}]"
-      :detailPath="{path:'/projectChangeDetail',param:{tabIndex:tabIndex,portrait:''}}">
+      :detailPath="{path:'/projectChangeDetail',param:{tabIndex:tabIndex,portrait:''}}"
+      :exportValue="['结案原因','失败原因','操作']"
+      :exportName="['endreason','defeatreason','operation']"
+      :exporAdd="true"
+      >
       <template #titleRight>
 <!--        <el-divider direction="vertical"></el-divider>
         <el-dropdown size="medium" @command="handleCommand">

+ 15 - 1
src/components/export_excel/index.vue

@@ -8,7 +8,7 @@
 
 <script>
 export default {
-  props: ["tablecols", "param", "excelTitle", "total", "specialKey"],
+  props: ["tablecols", "param", "excelTitle", "total", "specialKey","exportValue","exportName","exporAdd"],
   data() {
     return {};
   },
@@ -77,9 +77,23 @@ export default {
       let hd = table.map((e) => {
         return e.title;
       });
+
       let ft = table.map((e) => {
         return e.columnname;
       });
+      if (this.exporAdd){
+        hd = hd.slice(0, hd.length - 1)
+
+        hd = hd.concat(this.exportValue)
+
+        console.log(hd,'hd')
+        ft = ft.slice(0, ft.length - 1)
+
+        ft = ft.concat(this.exportName)
+
+        console.log(ft,'ft')
+      }
+
       this.tool.exportExcel(hd, ft, res.data, this.excelTitle);
     },
   },

+ 3 - 3
src/components/normal-basic-layout/index.vue

@@ -22,8 +22,8 @@
                 <el-button :type="selection.length === 0?'':'primary'" :disabled="selection.length === 0" size="small" @click="deleteData">{{$t('删 除')}}</el-button>
               </el-button-group> -->
               <!-- <el-button class="inline-16" size="small" type="primary" plain>{{$t('导 入')}}</el-button> -->
-              <excel class="inline-16" :tablecols="layout" :param="param" :total="total" :specialKey="specialKey" :excelTitle="routerName" v-if="exports"></excel>
-              <exportFile :columns="columns" :param="param" :fileName="fileName" v-if="isNewExport" class="inline-16"></exportFile>
+              <excel class="inline-16" :tablecols="layout" :param="param" :total="total" :specialKey="specialKey" :excelTitle="routerName" v-if="exports" :exportName="exportName" :exportValue="exportValue" :exporAdd="exporAdd"></excel>
+              <exportFile :columns="columns" :param="param" :fileName="fileName" v-if="isNewExport" class="inline-16" ></exportFile>
               <reportCenter :btnName="$t('报 表')" class="inline-16" position="detail" size="small" :data="reportCenterLsit.filter(item => item.type == 'datainfo')" v-if="reportCenterLsit.filter(item => item.type == 'datainfo').length > 0 && systemappid != 163">
                 <template v-slot:print="scope2">
                   <el-button @click="printBtn({},scope2.data)" type="text" size="mini">{{$t('打 印')}}</el-button>
@@ -98,7 +98,7 @@
 import {mapGetters} from 'vuex'
 export default {
   componentName:'normalTable',
-  props:['tableName','idName','tableData','apiId','formPath','oldFormPath','options','autoQuery','detailPath','customTitle','hidePagination','hideSearch','statusHideDetailBtn','specialKey','drawerWidth','isExport','isNewExport','columns','fileName','excelTitle'],
+  props:['tableName','idName','tableData','apiId','formPath','oldFormPath','options','autoQuery','detailPath','customTitle','hidePagination','hideSearch','statusHideDetailBtn','specialKey','drawerWidth','isExport','isNewExport','columns','fileName','excelTitle','exportValue','exportName','exporAdd'],
   components:{
     tableTemp: () => import('./modules/table.vue'),
     setColumn: () => import('./modules/setColumn.vue'),