Browse Source

项目下拉组件增加月份查询条件

ljb 10 months ago
parent
commit
3d770de54b

+ 41 - 0
src/api/yfCostManage/yfCostStatistics/otherCostSummaryList.js

@@ -0,0 +1,41 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/api/kd-scientific/lease/page',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/api/kd-scientific/lease/submit',
+    method: 'post',
+    data: row
+  })
+}
+
+
+export const update = (row) => {
+  return request({
+    url: '/api/kd-scientific/lease/submit',
+    method: 'post',
+    data: row
+  })
+}
+
+
+export const remove = (ids) => {
+  return request({
+    url: '/api/kd-scientific/lease/remove',
+    method: 'post',
+    params: {
+      ids
+    }
+  })
+}

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

@@ -64,7 +64,7 @@ export default {
       })
     },
     getProjectList() {
-      getAllProjectList(1, 99999).then(({ data }) => {
+      getAllProjectList(1, 99999, this.params).then(({ data }) => {
         if (data.success) {
           this.projectList = data.data.records;
           this.xmId = this.value;

+ 14 - 0
src/option/yfCostManage/basicDataSetting/leaseRecords.js

@@ -137,6 +137,13 @@ export default {
       min: 0,
       precision: 0,
       showOverflowTooltip: true,
+      rules: [
+        {
+          required: true,
+          message: '请输入使用天数或使用量',
+          trigger: 'blur',
+        },
+      ],
     },
     {
       label: '单价(元)',
@@ -148,6 +155,13 @@ export default {
       min: 0,
       precision: 2,
       showOverflowTooltip: true,
+      rules: [
+        {
+          required: true,
+          message: '请输入单价',
+          trigger: 'blur',
+        },
+      ],
     },
     {
       label: '总价(不含税)',

+ 7 - 7
src/option/yfCostManage/basicDataSetting/pickingDetail.js

@@ -110,13 +110,13 @@ export default {
       width: 100,
       align: 'center',
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: '请输入物资编号',
-          trigger: 'blur',
-        },
-      ],
+      // rules: [
+      //   {
+      //     required: true,
+      //     message: '请输入物资编号',
+      //     trigger: 'blur',
+      //   },
+      // ],
     },
     {
       label: '物资名称',

+ 8 - 1
src/option/yfCostManage/basicDataSetting/projectZjtrCost.js

@@ -95,7 +95,7 @@ export default {
       ],
     },
     {
-      label: '单价(元)',
+      label: '金额',
       prop: 'amount',
       type: 'number',
       span: 24,
@@ -104,6 +104,13 @@ export default {
       min: 0,
       precision: 2,
       showOverflowTooltip: true,
+      rules: [
+        {
+          required: true,
+          message: '请输入金额',
+          trigger: 'blur',
+        },
+      ],
     },
   ],
 };

+ 102 - 0
src/option/yfCostManage/yfCostStatistics/otherCostSummaryList.js

@@ -0,0 +1,102 @@
+export default {
+  height: 'auto',
+  calcHeight: 30,
+  tip: false,
+  searchShow: true,
+  searchMenuSpan: 6,
+  border: true,
+  index: true,
+  selection: true,
+  addBtn: false,
+  searchLabelWidth: 140,
+  labelWidth: 130,
+  menuWidth: 140,
+  dialogClickModal: false,
+  dialogWidth: 500,
+  dialogType: "drawer",
+  showSummary: true,
+  sumColumnList: [
+    {
+      name: 'price',
+      type: 'sum',
+    },
+  ],
+  column: [
+    {
+      label: '月份',
+      prop: 'yearAndMonth',
+      width: 80,
+      align: 'center',
+      showOverflowTooltip: true,
+    },
+    {
+      label: '研发项目编号',
+      prop: 'xmbh',
+      type: 'input',
+      span: 24,
+      width: 100,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
+      label: '研发项目名称',
+      prop: 'xmmc',
+      type: 'input',
+      span: 24,
+      minWidth: 160,
+      search: true,
+      showOverflowTooltip: true,
+      display: false
+    },
+    {
+      label: '费用类型',
+      prop: 'type',
+      type: 'select',
+      span: 24,
+      minWidth: 120,
+      align: 'center',
+      dicUrl: '/api/kd-system/dict-biz/dictionary?code=zulinzichan_lx',
+      props: {
+        label: 'dictValue',
+        value: 'dictKey',
+      },
+      showOverflowTooltip: true,
+    },
+    {
+      label: '费用内容',
+      prop: 'type',
+      type: 'select',
+      span: 24,
+      minWidth: 180,
+      search: true,
+      dicUrl: '/api/kd-system/dict-biz/dictionary?code=zulinzichan_lx',
+      props: {
+        label: 'dictValue',
+        value: 'dictKey',
+      },
+      showOverflowTooltip: true,
+    },
+    {
+      label: '日期',
+      prop: 'rq',
+      type: 'date',
+      valueFormat: 'yyyy-MM-dd',
+      span: 24,
+      minWidth: 180,
+      search: true,
+      hide: true,
+    },
+    {
+      label: '金额',
+      prop: 'price',
+      type: 'number',
+      span: 24,
+      width: 100,
+      align: 'center',
+      min: 0,
+      precision: 2,
+      showOverflowTooltip: true,
+    },
+  ],
+};

+ 1 - 1
src/views/tech-person/month-cjcyry.vue

@@ -44,7 +44,7 @@
       </template> -->
 
       <template slot="xmmcForm">
-        <project-select placeholder="请选择项目名称" v-model="form.xmId" @change="handleProjectChange"></project-select>
+        <project-select placeholder="请选择项目名称" v-model="form.xmId" :params="{ yearAndMonth: params.yearAndMonth }" @change="handleProjectChange"></project-select>
       </template>
 
       <template slot="nameForm">

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

@@ -142,6 +142,7 @@ export default window.$crudCommon({
         width: 70,
         align: 'center',
         showOverflowTooltip: true,
+        display: false,
       }, {
         prop: "monthlyDays",
         label: "本月出勤/天",
@@ -151,6 +152,7 @@ export default window.$crudCommon({
         width: 70,
         align: 'center',
         showOverflowTooltip: true,
+        display: false,
       });
 
       this.option.column = newColumns;

+ 1 - 1
src/views/yf-cost-manage/basic-data-setting/lease-records.vue

@@ -42,7 +42,7 @@
       </template>
 
       <template slot="xmIdForm">
-        <project-select placeholder="请选择项目名称" v-model="form.xmId" @change="handleProjectChange"></project-select>
+        <project-select placeholder="请选择项目名称" v-model="form.xmId" :params="{ yearAndMonth: params.yearAndMonth }" @change="handleProjectChange"></project-select>
       </template>
       
     </avue-crud>

+ 1 - 1
src/views/yf-cost-manage/basic-data-setting/month-salary-list.vue

@@ -73,7 +73,7 @@
 </template>
 
 <script>
-import { getLastMonthData } from "@/api/basicResource/technicianMonthAvgSales";
+import { getLastMonthData } from "@/api/yfCostManage/basicDataSetting/monthSalaryList";
 import {exportBloByPost} from "@/api/common";
 import YearMonthSelect from "@/components/year-month-select";
 import UpdatedText from "@/components/updated-text";

+ 2 - 2
src/views/yf-cost-manage/basic-data-setting/picking-detail.vue

@@ -42,7 +42,7 @@
       </template>
 
       <template slot="xmIdForm">
-        <project-select placeholder="请选择项目名称" v-model="form.xmId"></project-select>
+        <project-select placeholder="请选择项目名称" :params="{ yearAndMonth: params.yearAndMonth }" v-model="form.xmId"></project-select>
       </template>
       
     </avue-crud>
@@ -97,7 +97,7 @@ export default window.$crudCommon({
   },
   methods: {
     validCustom() {
-      if (!isAlphanumericCombination(this.form.code)) {
+      if (this.form.code && !isAlphanumericCombination(this.form.code)) {
         this.$message.warning("物质编号必须是英文字母加数字组合!");
         return false;
       }

+ 1 - 1
src/views/yf-cost-manage/basic-data-setting/project-zjtl-cost.vue

@@ -42,7 +42,7 @@
       </template>
 
       <template slot="xmIdForm">
-        <project-select placeholder="请选择项目名称" v-model="form.xmId" @change="handleProjectChange"></project-select>
+        <project-select placeholder="请选择项目名称" v-model="form.xmId" :params="{ yearAndMonth: params.yearAndMonth }" @change="handleProjectChange"></project-select>
       </template>
       
     </avue-crud>

+ 1 - 1
src/views/yf-cost-manage/basic-data-setting/sjzbsy-cost-ledger.vue

@@ -58,7 +58,7 @@
       </template>
 
       <template slot="xmIdForm">
-        <project-select placeholder="请选择项目名称" v-model="form.xmId" @change="handleProjectChange"></project-select>
+        <project-select placeholder="请选择项目名称" v-model="form.xmId" :params="{ yearAndMonth: params.yearAndMonth }" @change="handleProjectChange"></project-select>
       </template>
       
     </avue-crud>

+ 109 - 0
src/views/yf-cost-manage/yf-cost-statistics/wxzc-cost-statistics/other-cost-summary-list.vue

@@ -0,0 +1,109 @@
+<template>
+  <basic-container>
+    <avue-crud
+      v-bind="bindVal"
+      v-on="onEvent"
+      v-model="form"
+      :page.sync="page"
+    >
+      <template slot="menuLeft">
+        <el-button
+          type="warning"
+          size="small"
+          plain
+          icon="el-icon-download"
+          @click="handleExport"
+        >
+          导出
+        </el-button>
+        <print-table-btn @click="printTable" />
+        
+        <div style="display: flex; align-items: center;">
+          <year-month-select v-model="params.yearAndMonth"></year-month-select>
+        </div>
+      </template>
+
+      <template slot="rqSearch">
+        <el-date-picker
+          v-model="params.rq"
+          type="daterange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          value-format="yyyy-MM-dd"
+          style="width: 220px !important;"
+        >
+        </el-date-picker>
+      </template>
+      
+    </avue-crud>
+
+    <upload-excel-dialog ref="uploadExcelDialog" :uploadAfter="uploadAfter"/>
+
+    <WideTablePrinter
+      ref="printWideTable"
+      :columns="wideTableColumns"
+      :data="data"
+      :print-title="printTitle"
+      :rows-per-page="30"
+      :default-landscape="true"
+    />
+  </basic-container>
+</template>
+
+<script>
+import YearMonthSelect from "@/components/year-month-select";
+import {exportBlob} from "@/api/common";
+import {getToken} from "@/util/auth";
+import {downloadXls} from "@/util/util";
+import moment from "moment";
+import Decimal from "decimal.js";
+
+
+export default window.$crudCommon({
+  components: {
+    YearMonthSelect,
+  },
+  data() {
+    return {
+      params: {
+        yearAndMonth: moment(new Date()).format('YYYYMM'),
+      },
+      defaultColumns: [],
+
+      wideTableColumns: [],
+      printTitle: "",
+    };
+  },
+  watch: {
+    'params.yearAndMonth'(newVal) {
+      this.page.currentPage = 1;
+      this.getList(this.page);
+    }
+  },
+  methods: {
+    handleExport() {
+      exportBlob(`/api/kd-scientific/lease/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
+        downloadXls(res.data, `其他费用汇总表${this.params.yearAndMonth}.xlsx`);
+      });
+    },
+    /**
+     * 打印表格
+     * @param isLandscape 是否横向打印
+     */
+    printTable(isLandscape) {
+      this.wideTableColumns = this.$refs.crud.columnOption;
+      this.printTitle = `其他费用汇总表${this.params.yearAndMonth}`;
+      this.$nextTick(() => {
+        this.$refs.printWideTable.printTable(isLandscape);
+      })
+    },
+  },
+}, {
+  // 模块路径
+  name: 'yfCostManage/yfCostStatistics/otherCostSummaryList',
+  res: ({ data }) => {
+    return data;
+  },
+});
+</script>