Browse Source

研发领料单页面接口联调

ljb 9 months ago
parent
commit
553cd42995

+ 9 - 0
src/api/yfCostManage/yfCostStatistics/clCost.js

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

+ 1 - 0
src/components/year-month-select/index.vue

@@ -8,6 +8,7 @@
         placeholder="选择年"
         size="small"
         value-format="yyyy"
+        style="width: 100% !important;"
       >
       </el-date-picker>
     </div>

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

@@ -24,7 +24,7 @@
         </div>
       </template>
 
-      <template slot="gslb" slot-scope="{ row }">
+      <template slot="gslb">
         <div class="custom-cell">
           <div class="custom-cell-line">研发工时</div>
           <div class="custom-cell-line">非研发工时</div>

+ 113 - 0
src/views/yf-cost-manage/yf-cost-statistics/zjtl-cost-statistics/cl-cost/components/common-list.vue

@@ -0,0 +1,113 @@
+<template>
+  <avue-crud class="cl-crud" :option="options" :data="data">
+    <template slot="menuLeft">
+      <div style="display: flex; align-items: center;">
+        <div style="margin-right: 50px;">研发项目编号:{{ data[0].xmbh }}</div>
+        <div>项目项目名称:{{ data[0].xmmc }}</div>
+      </div>
+    </template>
+  </avue-crud>
+</template>
+
+<script>
+export default {
+  props: {
+    data: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data() {
+    return {
+      options: {
+        tip: false,
+        searchShow: false,
+        border: true,
+        index: true,
+        showSummary: true,
+        menu: false,
+        addBtn: false,
+        refreshBtn: false,
+        columnBtn: false,
+        gridBtn: false,
+        sumColumnList: [
+          {
+            name: "useQuantity",
+            type: "sum",
+          },
+          {
+            name: "amount",
+            type: "sum",
+          },
+        ],
+        column: [
+          {
+            label: "日期",
+            prop: "useDate",
+            width: 100,
+            align: "center",
+            showOverflowTooltip: true,
+          },
+          {
+            label: "材料编号",
+            prop: "code",
+            width: 120,
+            align: "center",
+            showOverflowTooltip: true,
+          },
+          {
+            label: "材料名称",
+            prop: "name",
+            minWidth: 140,
+            showOverflowTooltip: true,
+          },
+          {
+            label: "型号规格",
+            prop: "model",
+            width: 120,
+            align: "center",
+            showOverflowTooltip: true,
+          },
+          {
+            label: "单位",
+            prop: "unit",
+            width: 120,
+            align: "center",
+            showOverflowTooltip: true,
+          },
+          {
+            label: "单价",
+            prop: "unitPrice",
+            width: 120,
+            align: "center",
+            showOverflowTooltip: true,
+          },
+          {
+            label: "领用数量",
+            prop: "useQuantity",
+            width: 120,
+            align: "center",
+            showOverflowTooltip: true,
+          },
+          {
+            label: "金额(元)",
+            prop: "amount",
+            width: 120,
+            align: "center",
+            showOverflowTooltip: true,
+          },
+        ],
+      },
+    };
+  },
+  methods: {},
+};
+</script>
+
+<style lang="scss">
+.cl-crud {
+  .avue-crud__header {
+    min-height: 26px;
+  }
+}
+</style>

+ 133 - 0
src/views/yf-cost-manage/yf-cost-statistics/zjtl-cost-statistics/cl-cost/yf-picking-list.vue

@@ -0,0 +1,133 @@
+<template>
+  <basic-container v-loading="loading">
+    <avue-form ref="searchForm" v-model="params" :option="searchOption" class="cl-search-form">
+      <template slot="useDate">
+        <span>日期:</span>
+        <el-date-picker
+          v-model="params.useDateRange"
+          type="daterange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          value-format="yyyy-MM-dd"
+          style="width: 220px !important;"
+        >
+        </el-date-picker>
+      </template>
+      <template slot-scope="{size}" slot="menuForm">
+        <el-button type="primary" :size="size" icon="el-icon-search" @click="handleSearchBtn">查询</el-button>
+        <el-button :size="size" icon="el-icon-delete" @click="handleResetBtn">清空</el-button>
+      </template>
+    </avue-form>
+    <div style="display: flex; align-items: center;">
+      <year-month-select v-model="yearAndMonth" :showAllYear="false" style="margin: 6px 0 20px;"></year-month-select>
+    </div>
+    <common-list v-for="(item, index) of listData" :data="item" :key="index" style="margin-bottom: 25px;"></common-list>
+  </basic-container>
+</template>
+
+<script>
+import YearMonthSelect from "@/components/year-month-select";
+import commonList from "./components/common-list.vue";
+import { getList } from "@/api/yfCostManage/yfCostStatistics/clCost"
+
+export default {
+  components: {
+    YearMonthSelect,
+    commonList
+  },
+  data() {
+    return {
+      loading: false,
+      searchOption: {
+        submitBtn:false,
+        emptyBtn:false,
+        column: [{
+          label: '项目名称',
+          prop: 'xmmc',
+          type: 'input',
+        }, {
+          label: '材料名称',
+          prop: 'name',
+        }, {
+          label: '型号规格',
+          prop: 'model',
+        }, {
+          label: '日期',
+          prop: 'useDate',
+          type: 'date',
+        }]
+      },
+      listData: [],
+
+      yearAndMonth: '202507',
+      type: '材料',
+      params: {},
+    }
+  },
+  watch: {
+    yearAndMonth() {
+      this.loadData();
+    }
+  },
+  mounted() {
+    this.loadData();
+  },
+  methods: {
+    loadData() {
+      let params = { ...this.params };
+      if (params.useDateRange && params.useDateRange.length) {
+        params.dateMin = params.useDateRange[0];
+        params.dateMax = params.useDateRange[1];
+      }
+      delete params.useDateRange;
+      this.loading = true;
+      getList({
+        ...params,
+        yearAndMonth: this.yearAndMonth,
+        type: this.type,
+      }).then(({ data }) => {
+        this.loading = false;
+        if (data.code == 200) {
+          let allList = [];
+          data.data.map(item => {
+            Object.keys(item).map(key => {
+              allList.push(item[key]);
+            });
+          });
+
+          this.listData = allList;
+        }
+      }).catch(() => {
+        this.loading = false;
+      });
+    },
+    handleSearchBtn() {
+      this.loadData();
+    },
+    handleResetBtn() {
+      this.params = {};
+      this.$refs.searchForm.resetForm();
+      this.loadData();
+    },
+  },
+}
+</script>
+
+<style lang="scss">
+.cl-search-form {
+  .el-form-item--small .el-form-item__label {
+    display: none;
+  }
+  .el-form-item--small .el-form-item__content {
+    margin-left: 8px !important;
+  }
+  .el-form-item--mini.el-form-item, .el-form-item--small.el-form-item  {
+    margin-bottom: 6px;
+  }
+  .avue-form__group .el-col {
+    width: auto !important;
+    padding-top: 0 !important;
+  }
+}
+</style>