Browse Source

项目预算模块优化

ljb 8 months ago
parent
commit
04c2efaaeb

+ 7 - 6
src/views/basic-resource/basic-database/comp-subject-setting.vue

@@ -42,7 +42,7 @@
       </template>
       
       <template slot="body">
-        <h3 class="page-title">{{ tag.label }}</h3>
+        <h3 class="page-title">{{ pageTitle }}</h3>
       </template>
     </avue-crud>
 
@@ -52,7 +52,7 @@
       ref="printWideTable"
       :columns="wideTableColumns"
       :data="data"
-      :print-title="printTitle"
+      :print-title="pageTitle"
       :rows-per-page="30"
       :default-landscape="true"
       :zoom="80"
@@ -78,14 +78,16 @@ export default window.$crudCommon({
       treeData: [],
 
       wideTableColumns: [],
-      printTitle: "",
     };
   },
   mounted() {
     this.getMenuData();
   },
   computed: {
-    ...mapGetters(['tag'])
+    ...mapGetters(['tag']),
+    pageTitle() {
+      return this.tag.label;
+    }
   },
   methods: {
     loopData(data, level) {
@@ -122,7 +124,7 @@ export default window.$crudCommon({
     },
     handleExport() {
       exportBlob(`/api/kd-scientific/subject/enterprise/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
-        downloadXls(res.data, `企业会计科目.xlsx`);
+        downloadXls(res.data, `${this.pageTitle}.xlsx`);
       });
     },
     /**
@@ -131,7 +133,6 @@ export default window.$crudCommon({
      */
     printTable(isLandscape) {
       this.wideTableColumns = this.printOption.column;
-      this.printTitle = `企业会计科目列表`;
       this.$nextTick(() => {
         this.$refs.printWideTable.printTable(isLandscape);
       })

+ 3 - 0
src/views/project-manage/components/all-budget-table.vue

@@ -114,6 +114,9 @@ export default {
     },
   },
   watch: {
+    projectId(newVal) {
+      this.currProjectId = newVal;
+    },
     currProjectId(newVal) {
       if (!!newVal) {
         this.getAllBudgetData(newVal);

+ 4 - 0
src/views/project-manage/components/design-cost.vue

@@ -82,6 +82,9 @@ export default window.$crudCommon({
     };
   },
   watch: {
+    projectId(newVal) {
+      this.params.xmId = newVal;
+    },
     "params.xmId"() {
       this.page.currentPage = 1;
       this.getList(this.page);
@@ -116,6 +119,7 @@ export default window.$crudCommon({
     },
     handleProjectChange(data) {
       this.selProject = data;
+      this.$emit("change", data);
     },
     handleImport() {
       if (!this.params.xmId) {

+ 4 - 0
src/views/project-manage/components/other-cost.vue

@@ -84,6 +84,9 @@ export default window.$crudCommon({
     };
   },
   watch: {
+    projectId(newVal) {
+      this.params.xmId = newVal;
+    },
     "params.xmId"() {
       this.page.currentPage = 1;
       this.getList(this.page);
@@ -126,6 +129,7 @@ export default window.$crudCommon({
     },
     handleProjectChange(data) {
       this.selProject = data;
+      this.$emit("change", data);
     },
     uploadAfter() {
       this.page.currentPage = 1;

+ 4 - 0
src/views/project-manage/components/outsourcing-cost.vue

@@ -84,6 +84,9 @@ export default window.$crudCommon({
     };
   },
   watch: {
+    projectId(newVal) {
+      this.params.xmId = newVal;
+    },
     "params.xmId"() {
       this.page.currentPage = 1;
       this.getList(this.page);
@@ -118,6 +121,7 @@ export default window.$crudCommon({
     },
     handleProjectChange(data) {
       this.selProject = data;
+      this.$emit("change", data);
     },
     handleImport() {
       if (!this.params.xmId) {

+ 4 - 1
src/views/project-manage/components/person-cost.vue

@@ -97,6 +97,9 @@ export default window.$crudCommon({
     this.option.height = window.innerHeight - 340;
   },
   watch: {
+    projectId(newVal) {
+      this.params.xmId = newVal;
+    },
     "params.xmId"() {
       this.page.currentPage = 1;
       this.getList(this.page);
@@ -127,8 +130,8 @@ export default window.$crudCommon({
     },
     handleProjectChange(data) {
       this.selProject = data;
-
       this.projectStartMonth = moment(data.xmkssj).format("yyyyMM");
+      this.$emit("change", data);
     },
     handleImport() {
       if (!this.params.xmId) {

+ 10 - 10
src/views/project-manage/components/project-budget.vue

@@ -2,31 +2,31 @@
   <div>
     <el-tabs tab-position="left">
       <el-tab-pane label="研发项目费用预算表格" lazy>
-        <all-budget-table :projectId="currProjectId" @change="handleBudgetChange"></all-budget-table>
+        <all-budget-table :projectId="currProjectId" @change="handleProjectChange"></all-budget-table>
       </el-tab-pane>
       <el-tab-pane label="一、人员人工费用" lazy>
-        <person-cost :projectId="currProjectId" @printClick="handlePrintClick" />
+        <person-cost :projectId="currProjectId" @change="handleProjectChange" @printClick="handlePrintClick" />
       </el-tab-pane>
       <el-tab-pane label="二、直接投入费用" lazy>
-        <zztl-cost :projectId="currProjectId" @printClick="handlePrintClick"></zztl-cost>
+        <zztl-cost :projectId="currProjectId" @change="handleProjectChange" @printClick="handlePrintClick"></zztl-cost>
       </el-tab-pane>
       <el-tab-pane label="三、折旧费用与长期待摊费用" lazy>
-        <zjfyycqdtfy-cost :projectId="currProjectId" @printClick="handlePrintClick"></zjfyycqdtfy-cost>
+        <zjfyycqdtfy-cost :projectId="currProjectId" @change="handleProjectChange" @printClick="handlePrintClick"></zjfyycqdtfy-cost>
       </el-tab-pane>
       <el-tab-pane label="四、无形资产摊销费用" lazy>
-        <wxzctx-cost :projectId="currProjectId" @printClick="handlePrintClick"></wxzctx-cost>
+        <wxzctx-cost :projectId="currProjectId" @change="handleProjectChange" @printClick="handlePrintClick"></wxzctx-cost>
       </el-tab-pane>
       <el-tab-pane label="五、设计费用" lazy>
-        <design-cost :projectId="currProjectId" @printClick="handlePrintClick"></design-cost>
+        <design-cost :projectId="currProjectId" @change="handleProjectChange" @printClick="handlePrintClick"></design-cost>
       </el-tab-pane>
       <el-tab-pane label="六、装备调试费用与实验费用" lazy>
-        <zb-cost :projectId="currProjectId" @printClick="handlePrintClick"></zb-cost>
+        <zb-cost :projectId="currProjectId" @change="handleProjectChange" @printClick="handlePrintClick"></zb-cost>
       </el-tab-pane>
       <el-tab-pane label="七、委托外部研究开发费" lazy>
-        <outsourcing-cost :projectId="currProjectId" @printClick="handlePrintClick"></outsourcing-cost>
+        <outsourcing-cost :projectId="currProjectId" @change="handleProjectChange" @printClick="handlePrintClick"></outsourcing-cost>
       </el-tab-pane>
       <el-tab-pane label="八、其他费用" lazy>
-        <other-cost :projectId="currProjectId" @printClick="handlePrintClick"></other-cost>
+        <other-cost :projectId="currProjectId" @change="handleProjectChange" @printClick="handlePrintClick"></other-cost>
       </el-tab-pane>
     </el-tabs>
     <WideTablePrinter
@@ -80,7 +80,7 @@ export default {
     this.currProjectId = this.projectId;
   },
   methods: {
-    handleBudgetChange(data) {
+    handleProjectChange(data) {
       this.currProjectId = data.id;
     },
     handlePrintClick(data) {

+ 4 - 0
src/views/project-manage/components/wxzctx-cost.vue

@@ -107,6 +107,9 @@ export default window.$crudCommon({
     this.option = { ...newOption };
   },
   watch: {
+    projectId(newVal) {
+      this.params.xmId = newVal;
+    },
     "params.xmId"() {
       this.page.currentPage = 1;
       this.getList(this.page);
@@ -176,6 +179,7 @@ export default window.$crudCommon({
     },
     handleProjectChange(data) {
       this.selProject = data;
+      this.$emit("change", data);
     },
     handleImport() {
       if (!this.params.xmId) {

+ 4 - 0
src/views/project-manage/components/zb-cost.vue

@@ -84,6 +84,9 @@ export default window.$crudCommon({
     };
   },
   watch: {
+    projectId(newVal) {
+      this.params.xmId = newVal;
+    },
     "params.xmId"() {
       this.page.currentPage = 1;
       this.getList(this.page);
@@ -118,6 +121,7 @@ export default window.$crudCommon({
     },
     handleProjectChange(data) {
       this.selProject = data;
+      this.$emit("change", data);
     },
     handleImport() {
       if (!this.params.xmId) {

+ 4 - 0
src/views/project-manage/components/zjfyycqdtfy-cost.vue

@@ -90,6 +90,9 @@ export default window.$crudCommon({
     };
   },
   watch: {
+    projectId(newVal) {
+      this.params.xmId = newVal;
+    },
     "params.xmId"() {
       this.page.currentPage = 1;
       this.getList(this.page);
@@ -176,6 +179,7 @@ export default window.$crudCommon({
     },
     handleProjectChange(data) {
       this.selProject = data;
+      this.$emit("change", data);
     },
     handleImport() {
       if (!this.params.xmId) {

+ 4 - 0
src/views/project-manage/components/zztl-cost.vue

@@ -83,6 +83,9 @@ export default window.$crudCommon({
     };
   },
   watch: {
+    projectId(newVal) {
+      this.params.xmId = newVal;
+    },
     "params.xmId"() {
       this.page.currentPage = 1;
       this.getList(this.page);
@@ -117,6 +120,7 @@ export default window.$crudCommon({
     },
     handleProjectChange(data) {
       this.selProject = data;
+      this.$emit("change", data);
     },
     handleImport() {
       if (!this.params.xmId) {