石广澎
2023-11-29 20913c80c3f5fc8e533cb92b90e6f20bcd68e032
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<template>
  <div class="app-container">
    <el-card class="box-card" shadow="never">
      <div class="filter-container" style="margin-bottom: 10px">
        <my-search ref="searchBar" :items="items" @search="filterForm"></my-search>
      </div>
      <div class="title">物品统计表</div>
      <el-table
        v-loading="loading"
        :data="tableData"
        border
        style="width: 100%">
        <el-table-column
          align="center"
          prop="orgName"
          label="机构"
          min-width="150">
        </el-table-column>
        <el-table-column
          align="center"
          prop="warehouseName"
          label="仓库/部门"
          min-width="150">
        </el-table-column>
        <el-table-column
          align="center"
          prop="goodsCode"
          label="物品编码"
          width="150">
        </el-table-column>
        <el-table-column
          align="center"
          prop="goodsTemplateName"
          label="物品名称"
          min-width="150">
        </el-table-column>
        <el-table-column
          align="center"
          prop="baseGoodsModelsName"
          label="规格型号"
          min-width="150">
        </el-table-column>
        <el-table-column
          align="center"
          prop="zaiKuNum"
          label="在库/在用数量"
          width="150">
        </el-table-column>
 
        <el-table-column
          align="center"
          prop="baoFeiNum"
          label="报废数"
          width="150">
        </el-table-column>
        <el-table-column
          align="center"
          prop="diaoBoNum"
          label="调拨数"
          width="150">
        </el-table-column>
        <el-table-column
          align="center"
          prop="totalNum"
          label="总数量"
          width="150">
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>
 
<script>
import {getGoodsStatistics} from '@/api/dashboard/goodsStatis.js'
import {formatDate} from "@/utils/DateFormatter";
import SettingIplatform from '@/utils/settingIplatform';
 
export default {
    data() {
      return {
        items: [
          {
            type: 'cascader',
            dataIndex: 'agencyId',
            label: '机构',
            placeholder: '请选择',
            defaultValue: '',
            options: [],
            cascader: [{key:'warehouseId',queryKey: 'agencyId'},{key:'goodsTemplateId',queryKey: 'agencyId'}],
            optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null },
          },
          {
            type: 'select',
            dataIndex: 'baseWarehouseId',
            label: '仓库',
            placeholder: '请选择',
            defaultValue: '',
            options: [],
            optionsConfig: {
              label: 'warehouseName',
              value: 'id',
              url: SettingIplatform.apiBaseURL + '/pc/base/warehouse/select/tenant_warehouse'
            },
          },
          {
            type: 'select',
            dataIndex: 'goodsTemplateId',
            label: '物品名称',
            placeholder: '请输入',
            defaultValue: '',
            options: [],
            cascader: [{key:'categoryId',queryKey: 'goodsTemplatesId'}],
            optionsConfig: {
              label: 'goodsName',
              value: 'id',
              url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/query/goodsTemplate',
            },
          },
          {
            type: 'select',
            dataIndex: 'baseGoodsModelsId',
            label: '规格型号',
            placeholder: '请选择',
            defaultValue: '',
            options: [],
            optionsConfig: {
              label: 'modelName',
              value: 'id',
              url: SettingIplatform.apiBaseURL + '/pc/base/goods/models/query/goodsModel'
            },
          },
          {
            type: 'select',
            dataIndex: 'costType',
            label: '类别',
            placeholder: '请选择',
            defaultValue: '',
            options: [{
              label: 'A',
              value: '1'},{
              label: 'B',
              value: '2'},{
              label: 'C',
              value: '3'}],
 
          },
        ],
        tableData: [],
        loading: true,
        params:{examYear: formatDate(new Date(),'yyyyMMdd')}
      }
    },
    mounted() {
      this.getTableData({})
    },
    methods: {
      filterForm(e) {
        this.params = e
        this.getTableData(e)
      },
      getTableData(e) {
        this.loading = true
        getGoodsStatistics(e).then(res => {
          this.tableData = res
          this.loading = false
        }).catch(() => {
          this.loading = false
        })
      }
    }
  }
</script>
 
<style scoped class="">
  .title{
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
  }
</style>