Browse Source

研发制度一键下载功能

ljb 8 months ago
parent
commit
00be60ce08

+ 0 - 3
src/option/RDSystemManage/list.js

@@ -30,7 +30,6 @@ export default {
       prop: 'wjlx',
       type: 'select',
       span: 24,
-      search: true,
       dicUrl: '/api/kd-system/dict/dictionary?code=system_doc_type',
       editDisabled: true,
       props: {
@@ -49,7 +48,6 @@ export default {
       label: '企业制度的文件名称',
       prop: 'zdwjdz',
       type: "upload",
-      search: false,
       multiple: true,
       span: 24,
       action: '/api/kd-resource/oss/endpoint/put-file',
@@ -95,7 +93,6 @@ export default {
       },
       dicData: dict,
       align: 'center',
-      search: true,
       width: 90,
       rules: [
         {

+ 9 - 4
src/views/RD-system-manage/list.vue

@@ -29,6 +29,7 @@
           type="primary"
           size="small"
           plain
+          @click="handleDownFileAll"
         >
           一键下载
         </el-button>
@@ -95,13 +96,12 @@
 </template>
 
 <script>
-import {exportBloByPost} from "@/api/common";
+import {exportBloByPost, exportBlob} from "@/api/common";
 import YearMonthSelect from "@/components/year-month-select";
 import moment, { isDate } from "moment";
 import {getToken} from "@/util/auth";
 import {downloadXls, downloadFileByUrl} from "@/util/util";
 import { mapGetters } from "vuex";
-import { computed } from "vue";
 
 
 export default window.$crudCommon({
@@ -184,7 +184,6 @@ export default window.$crudCommon({
      */
     printTable(isLandscape) {
       this.wideTableColumns = this.printOption.column;
-      console.log(this.$refs.crud.list)
       this.wideTableData = JSON.parse(JSON.stringify(this.$refs.crud.list)).map(item => {
         if (item.zdwjdz && item.zdwjdz instanceof Array) {
           item.zdwjdz = item.zdwjdz.map(item => item.label).join('、')
@@ -202,7 +201,13 @@ export default window.$crudCommon({
     },
     handleDownFile(file) {
       downloadFileByUrl(file.value, file.label);
-    }
+    },
+    handleDownFileAll() {
+      let downParams = { year: this.params.yearAndMonth };
+      exportBlob(`/api/kd-scientific/yfzd/download?${this.website.tokenHeader}=${getToken()}`, downParams).then(res => {
+        downloadXls(res.data, `${this.pageTitle}.zip`);
+      });
+    },
   },
 
 }, {

+ 2 - 0
src/views/yf-cost-manage/basic-data-setting/atten-info.vue

@@ -131,6 +131,7 @@ export default window.$crudCommon({
             label: 'dictValue',
             value: 'dictKey',
           },
+          dicFlag: true,
           showOverflowTooltip: true,
           disabled: true,
         },
@@ -198,6 +199,7 @@ export default window.$crudCommon({
         if (item.hide) {
           col = {
             hide: true,
+            display: false,
           };
         } else {
           col = {

+ 3 - 0
src/views/yf-cost-manage/basic-data-setting/dev-work-hours-register.vue

@@ -141,6 +141,7 @@ export default window.$crudCommon({
           width: 70,
           align: 'center',
           dicUrl: '/api/kd-system/dict/dictionary?code=zclb',
+          dicFlag: true,
           props: {
             label: 'dictValue',
             value: 'dictKey',
@@ -157,6 +158,7 @@ export default window.$crudCommon({
           align: 'center',
           search: true,
           dicUrl: '/api/kd-system/dict/dictionary?code=zcyt',
+          dicFlag: true,
           props: {
             label: 'dictValue',
             value: 'dictKey',
@@ -222,6 +224,7 @@ export default window.$crudCommon({
         if (item.hide) {
           col = {
             hide: true,
+            display: false,
           };
         } else {
           col = {

+ 4 - 1
src/views/yf-cost-manage/basic-data-setting/working-hours-records.vue

@@ -180,6 +180,7 @@ export default window.$crudCommon({
           align: 'center',
           search: true,
           disabled: true,
+          dicFlag: true,
           dicUrl: '/api/kd-system/dict/dictionary?code=renyuanleixing',
           props: {
             label: 'dictValue',
@@ -216,12 +217,14 @@ export default window.$crudCommon({
       done();
     },
     refreshTableCol(yearAndMonth) {
+      this.option.column = [];
       let yearMonth = moment(yearAndMonth).format("YYYY-MM").split("-");
       const monthDays = getMonthDatesWithMarkers(Number(yearMonth[0]), Number(yearMonth[1]));
       for (let i=monthDays.length; i<31; i++) {
         let _day = i+1
         monthDays.push({
           day: _day,
+          display: false,
           hide: true
         });
       }
@@ -231,6 +234,7 @@ export default window.$crudCommon({
         if (item.hide) {
           col = {
             hide: true,
+            display: false,
           };
         } else {
           col = {
@@ -243,7 +247,6 @@ export default window.$crudCommon({
             align: 'center',
             isWorkDay: ChineseHoliday.isWorkday(item.dateString),
             showOverflowTooltip: true,
-            hide: item.hide
           };
         }
         if (!ChineseHoliday.isWorkday(item.dateString)) {

+ 2 - 0
src/views/yf-cost-manage/yf-cost-statistics/person-cost-statistics/yf-work-hours-allocation-list.vue

@@ -133,6 +133,7 @@ export default window.$crudCommon({
             label: 'dictValue',
             value: 'dictKey',
           },
+          dicFlag: true,
           showOverflowTooltip: true,
           disabled: true,
         },
@@ -199,6 +200,7 @@ export default window.$crudCommon({
         if (item.hide) {
           col = {
             hide: true,
+            display: false,
           };
         } else {
           col = {