Browse Source

项目下拉组件增加use字段

ljb 5 months ago
parent
commit
9ffd1bfb75

+ 1 - 1
src/components/project-select/index.vue

@@ -86,7 +86,7 @@ export default {
       })
     },
     getProjectList(succCallback) {
-      getAllProjectList(1, 99999, this.params).then(({ data }) => {
+      getAllProjectList(1, 99999, { ...this.params, use : 1 }).then(({ data }) => {
         if (data.success) {
           this.projectList = data.data.records;
           succCallback && succCallback(this.projectList);

+ 12 - 1
src/views/yf-cost-manage/yf-cost-statistics/person-cost-statistics/project-allocation-list.vue

@@ -68,6 +68,7 @@ export default window.$crudCommon({
       params: {
         yearAndMonth: "",
       },
+      isSelAnnual: false,
 
       wideTableColumns: [],
       wideTableData: [],
@@ -75,6 +76,12 @@ export default window.$crudCommon({
   },
   watch: {
     'params.yearAndMonth'(newVal) {
+      if (newVal.length > 4) {
+        // 是否勾选未全年
+        this.isSelAnnual = false;
+      } else {
+        this.isSelAnnual = true;
+      }
       this.page.currentPage = 1;
       this.getList(this.page);
     }
@@ -82,7 +89,11 @@ export default window.$crudCommon({
   computed: {
     ...mapGetters(['tag']),
     pageTitle() {
-      let yearAndMonthCN = this.params.yearAndMonth ? moment(this.params.yearAndMonth).format("yyyy年MM月") : '';
+      let yearAndMonthCN = '';
+      if (this.params.yearAndMonth) {
+        let formatTemp = this.isSelAnnual ? "yyyy年" : "yyyy年MM月";
+        yearAndMonthCN = moment(this.params.yearAndMonth).format(formatTemp);
+      }
       return `${yearAndMonthCN}${this.tag.label}`.replace(/每月/g, '');
     }
   },