Browse Source

科目设置列表接口联调

ljb 10 months ago
parent
commit
adfd492e45

+ 9 - 0
src/api/basicResource/subjectSetting.js

@@ -0,0 +1,9 @@
+import request from '@/router/axios';
+
+export const getList = (params) => {
+  return request({
+    url: '/api/kd-scientific/subject/lazy-list',
+    method: 'get',
+    params
+  })
+}

+ 41 - 0
src/api/yfCostManage/basicDataSetting/otherCostLedger.js

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

+ 41 - 0
src/api/yfCostManage/basicDataSetting/wwCostLedger.js

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

+ 53 - 0
src/option/basicResource/subjectSetting.js

@@ -0,0 +1,53 @@
+export default {
+  height: 'auto',
+  calcHeight: 30,
+  tip: false,
+  searchShow: true,
+  searchMenuSpan: 6,
+  border: true,
+  searchLabelWidth: 140,
+  labelWidth: 140,
+  menuWidth: 290,
+  dialogClickModal: false,
+  dialogWidth: 500,
+  dialogType: "drawer",
+  rowKey: 'id',
+  rowParentKey: 'parentId',
+  defaultExpandAll: true,
+  tree: true,
+  column: [
+    {
+      label: '科目代码',
+      prop: 'code',
+      type: 'input',
+      span: 24,
+      search: true,
+      width: 300,
+      align: 'center',
+      showOverflowTooltip: true,
+      rules: [
+        {
+          required: true,
+          message: '请输入科目代码',
+          trigger: 'blur',
+        },
+      ],
+    },
+    {
+      label: '科目名称',
+      prop: 'name',
+      type: 'input',
+      span: 24,
+      minWidth: 160,
+      search: true,
+      showOverflowTooltip: true,
+      rules: [
+        {
+          required: true,
+          message: '请输入科目名称',
+          trigger: 'blur',
+        },
+      ],
+    },
+  ],
+};

+ 114 - 0
src/option/yfCostManage/basicDataSetting/otherCostLedger.js

@@ -0,0 +1,114 @@
+export default {
+  height: 'auto',
+  calcHeight: 30,
+  tip: false,
+  searchShow: true,
+  searchMenuSpan: 6,
+  border: true,
+  index: true,
+  selection: true,
+  searchLabelWidth: 140,
+  labelWidth: 130,
+  menuWidth: 140,
+  dialogClickModal: false,
+  dialogWidth: 500,
+  dialogType: "drawer",
+  showSummary: true,
+  sumColumnList: [
+    {
+      name: 'amount',
+      type: 'sum',
+    },
+  ],
+  column: [
+    {
+      label: '研发项目编号',
+      prop: 'xmbh',
+      type: 'input',
+      span: 24,
+      width: 100,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
+      label: '研发项目名称',
+      prop: 'xmmc',
+      span: 24,
+      minWidth: 160,
+      search: true,
+      showOverflowTooltip: true,
+      display: false
+    },
+    {
+      label: '研发项目名称',
+      prop: 'xmId',
+      type: 'select',
+      span: 24,
+      showOverflowTooltip: true,
+      rules: [
+        {
+          required: true,
+          message: '请选择研发项目名称',
+          trigger: 'blur',
+        },
+      ],
+      hide: true,
+    },
+    {
+      label: '费用类型',
+      prop: 'type',
+      type: 'select',
+      span: 24,
+      width: 120,
+      align: 'center',
+      display: false,
+    },
+    {
+      label: '日期',
+      prop: 'rq',
+      type: 'date',
+      valueFormat: 'yyyy-MM-dd',
+      span: 24,
+      width: 100,
+      align: 'center',
+      search: true,
+      showOverflowTooltip: true,
+      rules: [{
+        required: true,
+        message: '请选择日期',
+        trigger: 'blur'
+      }]
+    },
+    {
+      label: '费用内容',
+      prop: 'fynr',
+      type: 'select',
+      span: 24,
+      minWidth: 160,
+      showOverflowTooltip: true,
+      search: true,
+      rules: [{
+        required: true,
+        message: '请选择费用内容',
+        trigger: 'blur'
+      }]
+    },
+    {
+      label: '单价(元)',
+      prop: 'amount',
+      type: 'number',
+      span: 24,
+      width: 100,
+      align: 'center',
+      min: 0,
+      precision: 2,
+      showOverflowTooltip: true,
+      rules: [{
+        required: true,
+        message: '请输入单价',
+        trigger: 'blur'
+      }]
+    },
+  ],
+};

+ 3 - 3
src/option/yfCostManage/basicDataSetting/sjzbsyCostLedger.js

@@ -26,7 +26,6 @@ export default {
       prop: 'xmbh',
       type: 'input',
       span: 24,
-      search: true,
       width: 100,
       align: 'center',
       showOverflowTooltip: true,
@@ -63,7 +62,7 @@ export default {
       span: 24,
       minWidth: 260,
       search: true,
-      dicUrl: '/api/kd-system/dict-biz/dictionary?code=zhitoufeiyong_lx',
+      dicUrl: '/api/kd-system/dict-biz/dictionary?code',
       props: {
         label: 'dictValue',
         value: 'dictKey',
@@ -90,7 +89,7 @@ export default {
     },
     {
       label: '合同名称',
-      prop: 'rq',
+      prop: 'htmc',
       span: 24,
       minWidth: 160,
       showOverflowTooltip: true,
@@ -105,6 +104,7 @@ export default {
       min: 0,
       precision: 2,
       showOverflowTooltip: true,
+      search: true,
     },
   ],
 };

+ 110 - 0
src/option/yfCostManage/basicDataSetting/wwCostLedger.js

@@ -0,0 +1,110 @@
+export default {
+  height: 'auto',
+  calcHeight: 30,
+  tip: false,
+  searchShow: true,
+  searchMenuSpan: 6,
+  border: true,
+  index: true,
+  selection: true,
+  searchLabelWidth: 140,
+  labelWidth: 130,
+  menuWidth: 140,
+  dialogClickModal: false,
+  dialogWidth: 500,
+  dialogType: "drawer",
+  showSummary: true,
+  sumColumnList: [
+    {
+      name: 'amount',
+      type: 'sum',
+    },
+  ],
+  column: [
+    {
+      label: '研发项目编号',
+      prop: 'xmbh',
+      type: 'input',
+      span: 24,
+      search: true,
+      width: 100,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
+      label: '研发项目名称',
+      prop: 'xmmc',
+      span: 24,
+      minWidth: 160,
+      search: true,
+      showOverflowTooltip: true,
+      display: false
+    },
+    {
+      label: '研发项目名称',
+      prop: 'xmId',
+      type: 'select',
+      span: 24,
+      showOverflowTooltip: true,
+      rules: [
+        {
+          required: true,
+          message: '请选择研发项目名称',
+          trigger: 'blur',
+        },
+      ],
+      hide: true,
+    },
+    {
+      label: '费用类型',
+      prop: 'type',
+      type: 'select',
+      span: 24,
+      minWidth: 260,
+      search: true,
+      dicUrl: '/api/kd-system/dict-biz/dictionary?code=zhitoufeiyong_lx',
+      props: {
+        label: 'dictValue',
+        value: 'dictKey',
+      },
+      showOverflowTooltip: true,
+      rules: [
+        {
+          required: true,
+          message: '请选择费用类型',
+          trigger: 'blur',
+        },
+      ],
+    },
+    {
+      label: '日期',
+      prop: 'rq',
+      type: 'date',
+      valueFormat: 'yyyy-MM-dd',
+      span: 24,
+      width: 100,
+      align: 'center',
+      search: true,
+      showOverflowTooltip: true,
+    },
+    {
+      label: '受托方全称',
+      prop: 'stfqc',
+      span: 24,
+      width: 120,
+      showOverflowTooltip: true,
+    },
+    {
+      label: '单价(元)',
+      prop: 'amount',
+      type: 'number',
+      span: 24,
+      width: 100,
+      align: 'center',
+      min: 0,
+      precision: 2,
+      showOverflowTooltip: true,
+    },
+  ],
+};

+ 159 - 0
src/views/basic-resource/basic-database/subject-setting.vue

@@ -0,0 +1,159 @@
+<template>
+  <basic-container>
+    <avue-crud
+      v-model="form"
+      :option="option"
+      :data="data"
+      ref="crud"
+      @row-save="rowSave"
+      @row-update="rowUpdate"
+      @row-del="rowDel"
+    >
+      <template slot="icon" slot-scope="scope">
+        <i :class="scope.row.icon" style="font-size: 24px"></i>
+      </template>
+      <template slot="menu" slot-scope="{ row, size, type }">
+        <el-button :size="size" :type="type" @click="handleAdd(row)">
+          新增子级
+        </el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+<script>
+import { getList } from "@/api/basicResource/subjectSetting";
+
+export default {
+  data() {
+    return {
+      parentId: undefined,
+      form: {},
+      data: [],
+      option: {
+        height: "auto",
+        calcHeight: 30,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 6,
+        border: true,
+        searchLabelWidth: 140,
+        labelWidth: 140,
+        menuWidth: 290,
+        dialogClickModal: false,
+        dialogWidth: 500,
+        dialogType: "drawer",
+        rowKey: "id",
+        rowParentKey: "parentId",
+        defaultExpandAll: true,
+        tree: true,
+        column: [
+          {
+            label: "科目代码",
+            prop: "code",
+            type: "input",
+            span: 24,
+            search: true,
+            width: 200,
+            showOverflowTooltip: true,
+            rules: [
+              {
+                required: true,
+                message: "请输入科目代码",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "科目名称",
+            prop: "name",
+            type: "input",
+            span: 24,
+            minWidth: 160,
+            search: true,
+            showOverflowTooltip: true,
+            rules: [
+              {
+                required: true,
+                message: "请输入科目名称",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "会计科目",
+            prop: "accSubject",
+            type: "input",
+            span: 24,
+            minWidth: 160,
+            search: true,
+            showOverflowTooltip: true,
+          },
+          {
+            label: "高新研发费用科目",
+            prop: "rdSubject",
+            type: "input",
+            span: 24,
+            minWidth: 160,
+            search: true,
+            showOverflowTooltip: true,
+          },
+          {
+            label: "加计扣除研发费用科目",
+            prop: "adSubject",
+            type: "input",
+            span: 24,
+            minWidth: 160,
+            search: true,
+            showOverflowTooltip: true,
+          },
+        ],
+      },
+    };
+  },
+  mounted() {
+    this.loadData();
+  },
+  methods: {
+    loadData() {
+      getList().then(res => {
+        console.log(res)
+        if (res.data.code == 200) {
+          const loopData = data => {
+            return data.map(item => {
+              item.hasChildren = item.children && item.children.length ? false : true;
+              if (item.children && item.children.length) {
+                loopData(item.children);
+              }
+              return item;
+            });
+          }
+          this.data = loopData(res.data.data);
+          console.log(this.data)
+          // this.data = res.data.data.map(item => {
+          //   item.children = item.children || [];
+          //   delete item.hasChildren;
+          //   return item;
+          // });
+          // console.log(this.data)
+        }
+      })
+    },
+    rowDel(row, index, done) {
+      done(row);
+    },
+    rowSave(row, done) {
+      row.parentId = this.parentId;
+      row.id = new Date().getTime();
+      this.parentId = undefined;
+      done(row);
+    },
+    rowUpdate(row, index, done) {
+      done(row);
+    },
+    handleAdd(row) {
+      this.parentId = row.id;
+      this.$refs.crud.rowAdd();
+    },
+  },
+};
+</script>

+ 6 - 1
src/views/yf-cost-manage/basic-data-setting/atten-info.vue

@@ -216,7 +216,12 @@ export default window.$crudCommon({
   res: ({ data }) => {
     let newList = [];
     data.records.forEach((item) => {
-      let objData = { ...item };
+      let objData = {
+        ...item,
+        id: item.unicode,
+        monthlyHours: (item.monthlyHours || 0).toFixed(1),
+        monthlyDays: (item.monthlyDays || 0).toFixed(1)
+      };
       item.dailyAttendances.forEach(hourItem => {
         objData[hourItem.workDate] = (hourItem.workHours || 0).toFixed(1);
       });

+ 164 - 0
src/views/yf-cost-manage/basic-data-setting/other-cost-ledger.vue

@@ -0,0 +1,164 @@
+<template>
+  <basic-container>
+    <avue-crud
+      v-bind="bindVal"
+      v-on="onEvent"
+      v-model="form"
+      :page.sync="page"
+      :permission="permissionList"
+    >
+      <template slot="menuLeft">
+        <el-button
+          v-if="!isSelAnnual"
+          type="danger"
+          size="small"
+          icon="el-icon-delete"
+          plain
+          @click="handleDelete"
+        >
+          删 除
+        </el-button>
+        <el-button
+          v-if="!isSelAnnual"
+          type="success"
+          size="small"
+          plain
+          icon="el-icon-upload2"
+          @click="handleImport"
+        >
+          导入
+        </el-button>
+        <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>
+
+      <template slot="xmIdForm">
+        <project-select placeholder="请选择项目名称" v-model="form.xmId" :params="{ yearAndMonth: params.yearAndMonth }" @change="handleProjectChange"></project-select>
+      </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 UploadExcelDialog from "@/components/upload-excel-dialog";
+import projectSelect from "@/components/project-select";
+import {exportBlob} from "@/api/common";
+import {getToken} from "@/util/auth";
+import {downloadXls} from "@/util/util";
+import moment from "moment";
+
+
+export default window.$crudCommon({
+  components: {
+    YearMonthSelect,
+    projectSelect,
+    UploadExcelDialog,
+  },
+  data() {
+    return {
+      params: {
+        yearAndMonth: moment(new Date()).format('YYYYMM'),
+      },
+      isSelAnnual: false,
+
+      wideTableColumns: [],
+      printTitle: "",
+    };
+  },
+  watch: {
+    'params.yearAndMonth'(newVal) {
+      if (newVal.length > 4) {
+        // 是否勾选未全年
+        this.isSelAnnual = false;
+      } else {
+        this.isSelAnnual = true;
+      }
+      this.page.currentPage = 1;
+      this.getList(this.page);
+    }
+  },
+  computed: {
+    permissionList() {
+      return {
+        addBtn: !this.isSelAnnual,
+        editBtn: !this.isSelAnnual,
+        delBtn: !this.isSelAnnual,
+      };
+    },
+  },
+  methods: {
+    loadData() {},
+    getFormData() {
+      return { ...this.form, yearAndMonth: this.params.yearAndMonth };
+    },
+    handleImport() {
+      let excelParams = { yearAndMonth: this.params.yearAndMonth };
+      this.$refs.uploadExcelDialog.open('/api/kd-scientific/other-cost/import', excelParams);
+    },
+    uploadAfter() {
+      this.page.currentPage = 1;
+      this.getList(this.page);
+    },
+    handleExport() {
+      exportBlob(`/api/kd-scientific/other-cost/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/basicDataSetting/otherCostLedger',
+  res: ({ data }) => {
+    return data;
+  },
+});
+</script>

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

@@ -57,6 +57,15 @@
         </el-date-picker>
       </template>
 
+      <template slot="amountSearch">
+        <div style="display: flex; align-items: center;">
+          <span>金额区间(元):</span>
+          <avue-input-number v-model="params.amountStart" :min="0" style="width: 120px !important;"></avue-input-number>
+          <span style="width: 20px; text-align: center;">至</span>
+          <avue-input-number v-model="params.amountEnd" :min="0" style="width: 120px !important;"></avue-input-number>
+        </div>
+      </template>
+
       <template slot="xmIdForm">
         <project-select placeholder="请选择项目名称" v-model="form.xmId" :params="{ yearAndMonth: params.yearAndMonth }" @change="handleProjectChange"></project-select>
       </template>
@@ -125,6 +134,7 @@ export default window.$crudCommon({
     },
   },
   methods: {
+    loadData() {},
     getFormData() {
       return { ...this.form, yearAndMonth: this.params.yearAndMonth };
     },

+ 164 - 0
src/views/yf-cost-manage/basic-data-setting/ww-cost-ledger.vue

@@ -0,0 +1,164 @@
+<template>
+  <basic-container>
+    <avue-crud
+      v-bind="bindVal"
+      v-on="onEvent"
+      v-model="form"
+      :page.sync="page"
+      :permission="permissionList"
+    >
+      <template slot="menuLeft">
+        <el-button
+          v-if="!isSelAnnual"
+          type="danger"
+          size="small"
+          icon="el-icon-delete"
+          plain
+          @click="handleDelete"
+        >
+          删 除
+        </el-button>
+        <el-button
+          v-if="!isSelAnnual"
+          type="success"
+          size="small"
+          plain
+          icon="el-icon-upload2"
+          @click="handleImport"
+        >
+          导入
+        </el-button>
+        <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>
+
+      <template slot="xmIdForm">
+        <project-select placeholder="请选择项目名称" v-model="form.xmId" :params="{ yearAndMonth: params.yearAndMonth }" @change="handleProjectChange"></project-select>
+      </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 UploadExcelDialog from "@/components/upload-excel-dialog";
+import projectSelect from "@/components/project-select";
+import {exportBlob} from "@/api/common";
+import {getToken} from "@/util/auth";
+import {downloadXls} from "@/util/util";
+import moment from "moment";
+
+
+export default window.$crudCommon({
+  components: {
+    YearMonthSelect,
+    projectSelect,
+    UploadExcelDialog,
+  },
+  data() {
+    return {
+      params: {
+        yearAndMonth: moment(new Date()).format('YYYYMM'),
+      },
+      isSelAnnual: false,
+
+      wideTableColumns: [],
+      printTitle: "",
+    };
+  },
+  watch: {
+    'params.yearAndMonth'(newVal) {
+      if (newVal.length > 4) {
+        // 是否勾选未全年
+        this.isSelAnnual = false;
+      } else {
+        this.isSelAnnual = true;
+      }
+      this.page.currentPage = 1;
+      this.getList(this.page);
+    }
+  },
+  computed: {
+    permissionList() {
+      return {
+        addBtn: !this.isSelAnnual,
+        editBtn: !this.isSelAnnual,
+        delBtn: !this.isSelAnnual,
+      };
+    },
+  },
+  methods: {
+    loadData() {},
+    getFormData() {
+      return { ...this.form, yearAndMonth: this.params.yearAndMonth };
+    },
+    handleImport() {
+      let excelParams = { yearAndMonth: this.params.yearAndMonth };
+      this.$refs.uploadExcelDialog.open('/api/kd-scientific/direct-cost/import', excelParams);
+    },
+    uploadAfter() {
+      this.page.currentPage = 1;
+      this.getList(this.page);
+    },
+    handleExport() {
+      exportBlob(`/api/kd-scientific/direct-cost/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/basicDataSetting/wwCostLedger',
+  res: ({ data }) => {
+    return data;
+  },
+});
+</script>