Blame view

src/views/resource/allocationStorehouseDetailedList.vue 16.9 KB
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
1
  <template>
c8004a7b   wuxw   采购中的转增记录 使用记录处理完成
2
    <div class="animated fadeInRight ecommerce padding">
fc7cb950   wuxw   开发完成采购功能
3
      <el-row :gutter="20">
c8004a7b   wuxw   采购中的转增记录 使用记录处理完成
4
5
6
7
8
        <el-col :span="4">
  
          <div class="list-group-border-radius">
            <div class=" treeview">
              <ul class="list-group text-center ">
fc7cb950   wuxw   开发完成采购功能
9
                <li v-for="(item, index) in allocationStorehousesInfo.applyTypes" :key="index"
c8004a7b   wuxw   采购中的转增记录 使用记录处理完成
10
                  @click="swatchApplyType(item)"
fc7cb950   wuxw   开发完成采购功能
11
                  :class="{ 'vc-node-selected': allocationStorehousesInfo.conditions.applyType == item.statusCd }"
c8004a7b   wuxw   采购中的转增记录 使用记录处理完成
12
                  class="list-group-item node-orgTree">
fc7cb950   wuxw   开发完成采购功能
13
14
15
16
                  {{ item.name }}
                </li>
              </ul>
            </div>
c8004a7b   wuxw   采购中的转增记录 使用记录处理完成
17
  
fc7cb950   wuxw   开发完成采购功能
18
19
20
21
22
23
          </div>
        </el-col>
        <el-col :span="20">
          <el-card class="box-card">
            <div slot="header" class="flex justify-between">
              <span>{{ $t('allocationStorehouseDetailed.queryCondition') }}</span>
c8004a7b   wuxw   采购中的转增记录 使用记录处理完成
24
              <div class="ibox-tools">
fc7cb950   wuxw   开发完成采购功能
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
                <el-button type="text" style="margin-right:10px;" @click="_moreCondition()">
                  {{ allocationStorehousesInfo.moreCondition == true ? $t('allocationStorehouseDetailed.hide') :
                    $t('allocationStorehouseDetailed.more') }}
                </el-button>
              </div>
            </div>
            <el-row :gutter="20">
              <el-col :span="4">
                <el-input v-model.trim="allocationStorehousesInfo.conditions.resId"
                  :placeholder="$t('allocationStorehouseDetailed.resIdPlaceholder')" clearable />
              </el-col>
              <el-col :span="4">
                <el-input v-model.trim="allocationStorehousesInfo.conditions.resName"
                  :placeholder="$t('allocationStorehouseDetailed.resNamePlaceholder')" clearable />
              </el-col>
              <el-col :span="4">
                <el-select v-model="allocationStorehousesInfo.conditions.parentRstId"
                  :placeholder="$t('allocationStorehouseDetailed.resTypePlaceholder')" style="width:100%"
                  @change="_listResourceStoreSonTypes">
                  <el-option v-for="(item, index) in allocationStorehousesInfo.resourceStoreTypes" :key="index"
                    :label="item.name" :value="item.rstId" />
                </el-select>
              </el-col>
              <el-col :span="4">
                <el-select v-model="allocationStorehousesInfo.conditions.rstId"
                  :placeholder="$t('allocationStorehouseDetailed.secondTypePlaceholder')" style="width:100%"
                  @change="_listResourceStoreSpecifications">
                  <el-option v-for="(item, index) in allocationStorehousesInfo.resourceStoreSonTypes" :key="index"
                    :label="item.name" :value="item.rstId" />
                </el-select>
              </el-col>
              <el-col :span="4">
                <el-select v-model="allocationStorehousesInfo.conditions.rssId"
                  :placeholder="$t('allocationStorehouseDetailed.specPlaceholder')" style="width:100%">
                  <el-option v-for="(item, index) in allocationStorehousesInfo.resourceStoreSpecifications" :key="index"
                    :label="item.specName" :value="item.rssId" />
                </el-select>
              </el-col>
              <el-col :span="4">
                <el-button type="primary" @click="_queryAllocationStorehouseMethod()">
                  <i class="el-icon-search"></i>
                  {{ $t('allocationStorehouseDetailed.query') }}
                </el-button>
                <el-button type="primary" @click="_resetAllocationStorehouseMethod()">
                  <i class="el-icon-refresh"></i>
                  {{ $t('allocationStorehouseDetailed.reset') }}
                </el-button>
              </el-col>
            </el-row>
  
10d41618   wuxw   v1.9 测试采购功能,部分页面功能优化
75
            <el-row v-show="allocationStorehousesInfo.moreCondition == true" :gutter="20" class="margin-top margin-bottom">
fc7cb950   wuxw   开发完成采购功能
76
77
78
79
80
81
82
              <el-col :span="4">
                <el-input v-model.trim="allocationStorehousesInfo.conditions.applyId"
                  :placeholder="$t('allocationStorehouseDetailed.applyIdPlaceholder')" clearable />
              </el-col>
              <el-col :span="4">
                <el-select v-model="allocationStorehousesInfo.conditions.shIda"
                  :placeholder="$t('allocationStorehouseDetailed.sourceStorePlaceholder')" style="width:100%">
c8004a7b   wuxw   采购中的转增记录 使用记录处理完成
83
84
                  <el-option v-for="(item, index) in allocationStorehousesInfo.storehouses" :key="index"
                    :label="item.shName" :value="item.shId" />
fc7cb950   wuxw   开发完成采购功能
85
86
87
88
89
                </el-select>
              </el-col>
              <el-col :span="4">
                <el-select v-model="allocationStorehousesInfo.conditions.shIdz"
                  :placeholder="$t('allocationStorehouseDetailed.targetStorePlaceholder')" style="width:100%">
c8004a7b   wuxw   采购中的转增记录 使用记录处理完成
90
91
                  <el-option v-for="(item, index) in allocationStorehousesInfo.storehouses" :key="index"
                    :label="item.shName" :value="item.shId" />
fc7cb950   wuxw   开发完成采购功能
92
93
94
                </el-select>
              </el-col>
              <el-col :span="4">
b25b036d   wuxw   v1.9 优化日期
95
                <el-date-picker v-model="allocationStorehousesInfo.conditions.startTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"                :placeholder="$t('allocationStorehouseDetailed.startTimePlaceholder')" style="width:100%"  />
fc7cb950   wuxw   开发完成采购功能
96
97
              </el-col>
              <el-col :span="4">
b25b036d   wuxw   v1.9 优化日期
98
                <el-date-picker v-model="allocationStorehousesInfo.conditions.endTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"                :placeholder="$t('allocationStorehouseDetailed.endTimePlaceholder')" style="width:100%"  />
fc7cb950   wuxw   开发完成采购功能
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
              </el-col>
            </el-row>
  
            <el-row v-show="allocationStorehousesInfo.moreCondition == true" :gutter="20">
              <el-col :span="4">
                <el-select v-model="allocationStorehousesInfo.conditions.state"
                  :placeholder="$t('allocationStorehouseDetailed.statePlaceholder')" style="width:100%">
                  <el-option v-for="(item, index) in allocationStorehousesInfo.states" :key="index" :label="item.name"
                    :value="item.statusCd" />
                </el-select>
              </el-col>
            </el-row>
          </el-card>
  
          <el-card class="box-card" style="margin-top:20px;">
            <div slot="header" class="flex justify-between">
              <span>{{ $t('allocationStorehouseDetailed.allocationDetail') }}</span>
c8004a7b   wuxw   采购中的转增记录 使用记录处理完成
116
              <div class="ibox-tools">
fc7cb950   wuxw   开发完成采购功能
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
                <el-button type="primary" size="small" @click="_exportExcel()">
                  <i class="el-icon-download"></i>
                  {{ $t('allocationStorehouseDetailed.export') }}
                </el-button>
              </div>
            </div>
            <el-table :data="allocationStorehousesInfo.resourceStores" border style="width: 100%">
              <el-table-column prop="applyId" :label="$t('allocationStorehouseDetailed.table.applyId')" align="center" />
              <el-table-column prop="resId" :label="$t('allocationStorehouseDetailed.table.resId')" align="center" />
              <el-table-column :label="$t('allocationStorehouseDetailed.table.resType')" align="center">
                <template slot-scope="scope">
                  {{ scope.row.parentRstName }} > {{ scope.row.rstName }}
                </template>
              </el-table-column>
              <el-table-column prop="resName" :label="$t('allocationStorehouseDetailed.table.resName')" align="center" />
              <el-table-column :label="$t('allocationStorehouseDetailed.table.specName')" align="center">
                <template slot-scope="scope">
                  {{ scope.row.specName ? scope.row.specName : '-' }}
                </template>
              </el-table-column>
              <el-table-column prop="isFixedName" :label="$t('allocationStorehouseDetailed.table.isFixedName')"
                align="center" />
              <el-table-column :label="$t('allocationStorehouseDetailed.table.originalStock')" align="center">
                <template slot-scope="scope">
                  {{ scope.row.originalStock }}{{ scope.row.unitCodeName }}
                </template>
              </el-table-column>
              <el-table-column :label="$t('allocationStorehouseDetailed.table.stock')" align="center">
                <template slot-scope="scope">
c8004a7b   wuxw   采购中的转增记录 使用记录处理完成
146
147
                  {{ scope.row.stock }}{{ scope.row.applyType == 20000 ? scope.row.miniUnitCodeName :
                    scope.row.unitCodeName }}
fc7cb950   wuxw   开发完成采购功能
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
                </template>
              </el-table-column>
              <el-table-column :label="$t('allocationStorehouseDetailed.table.shaName')" align="center">
                <template slot-scope="scope">
                  {{ scope.row.applyType == '20000' ? scope.row.startUserName : scope.row.shaName }}
                </template>
              </el-table-column>
              <el-table-column prop="shzName" :label="$t('allocationStorehouseDetailed.table.shzName')" align="center" />
              <el-table-column prop="startUserName" :label="$t('allocationStorehouseDetailed.table.startUserName')"
                align="center" />
              <el-table-column prop="remark" :label="$t('allocationStorehouseDetailed.table.remark')" align="center" />
              <el-table-column :label="$t('allocationStorehouseDetailed.table.state')" align="center">
                <template slot-scope="scope">
                  {{ scope.row.stateName }}({{ scope.row.applyTypeName }})
                </template>
              </el-table-column>
              <el-table-column prop="createTime" :label="$t('allocationStorehouseDetailed.table.createTime')"
                align="center" />
            </el-table>
            <el-pagination :current-page.sync="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size"
              :total="page.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
              @current-change="handleCurrentChange" />
          </el-card>
        </el-col>
      </el-row>
    </div>
  </template>
  
  <script>
  import { listAllocationStorehouses, listStorehouses, listResourceStoreTypes, listResourceStoreSpecifications, exportData } from '@/api/resource/allocationStorehouseDetailedApi'
  import { getDict } from '@/api/community/communityApi'
  import { getCommunityId } from '@/api/community/communityApi'
c8004a7b   wuxw   采购中的转增记录 使用记录处理完成
180
  import { getUserId } from '@/api/user/userApi'
fc7cb950   wuxw   开发完成采购功能
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
  
  export default {
    name: 'AllocationStorehouseDetailedList',
    data() {
      return {
        allocationStorehousesInfo: {
          resourceStores: [],
          storehouses: [],
          total: 0,
          records: 1,
          moreCondition: false,
          states: [],
          applyTypes: [],
          conditions: {
            asId: '',
            applyId: '',
            resId: '',
            resName: '',
            resCode: '',
            rssId: '',
            parentRstId: '',
            rstId: '',
            shIda: '',
            shIdz: '',
            stock: '',
            startUserId: '',
            state: '',
            applyType: '',
            startTime: '',
            endTime: '',
            userId: '',
            communityId: ''
          },
          resourceStoreTypes: [],
          resourceStoreSonTypes: [],
          resourceStoreSpecifications: []
        },
        page: {
          current: 1,
          size: 10,
          total: 0
        }
      }
    },
    created() {
      this.communityId = getCommunityId()
      this._initMethod()
    },
    methods: {
      async _initMethod() {
        try {
          // 获取字典数据
          const stateData = await getDict('allocation_storehouse_apply', 'state')
          const applyTypeData = await getDict('allocation_storehouse_apply', 'apply_type')
  
          this.allocationStorehousesInfo.states = stateData
          this.allocationStorehousesInfo.applyTypes = [{
            statusCd: '',
            name: this.$t('allocationStorehouseDetailed.all')
          }].concat(applyTypeData)
  
          this._initAllocationStorehouseDetailedInfo()
          this._listAllocationStores(this.page.current, this.page.size)
          this._listStorehouses()
          this._listResourceStoreTypes()
          this._listResourceStoreSpecifications()
        } catch (error) {
          console.error('初始化失败:', error)
        }
      },
      _initAllocationStorehouseDetailedInfo() {
        this.allocationStorehousesInfo.conditions.userId = getUserId()
        this.allocationStorehousesInfo.conditions.communityId = this.communityId
      },
      async _listAllocationStores(_page, _rows) {
        try {
          this.allocationStorehousesInfo.conditions.page = _page
          this.allocationStorehousesInfo.conditions.row = _rows
          const params = {
            ...this.allocationStorehousesInfo.conditions,
            resId: this.allocationStorehousesInfo.conditions.resId.trim(),
            resName: this.allocationStorehousesInfo.conditions.resName.trim(),
            applyId: this.allocationStorehousesInfo.conditions.applyId.trim(),
            startUserId: this.allocationStorehousesInfo.conditions.startUserId.trim()
          }
  
          const { data, total } = await listAllocationStorehouses(params)
          this.allocationStorehousesInfo.resourceStores = data
          this.allocationStorehousesInfo.total = total
          this.page.total = total
        } catch (error) {
          console.error('获取调拨明细失败:', error)
        }
      },
      async _listStorehouses() {
        try {
          const params = {
            page: 1,
            row: 100,
            communityId: this.communityId
          }
          const { data } = await listStorehouses(params)
          this.allocationStorehousesInfo.storehouses = data
        } catch (error) {
          console.error('获取仓库列表失败:', error)
        }
      },
      async _listResourceStoreTypes() {
        try {
          const params = {
            page: 1,
            row: 100,
            communityId: this.communityId,
            parentId: '0'
          }
          const { data } = await listResourceStoreTypes(params)
          this.allocationStorehousesInfo.resourceStoreTypes = data
        } catch (error) {
          console.error('获取物品类型失败:', error)
        }
      },
      async _listResourceStoreSonTypes() {
        try {
          this.allocationStorehousesInfo.conditions.rstId = ''
          this.allocationStorehousesInfo.resourceStoreSonTypes = []
  
          if (!this.allocationStorehousesInfo.conditions.parentRstId) return
  
          const params = {
            page: 1,
            row: 100,
            communityId: this.communityId,
            parentId: this.allocationStorehousesInfo.conditions.parentRstId
          }
          const { data } = await listResourceStoreTypes(params)
          this.allocationStorehousesInfo.resourceStoreSonTypes = data
        } catch (error) {
          console.error('获取二级分类失败:', error)
        }
      },
      async _listResourceStoreSpecifications() {
        try {
          this.allocationStorehousesInfo.resourceStoreSpecifications = []
          this.allocationStorehousesInfo.conditions.rssId = ''
  
          if (!this.allocationStorehousesInfo.conditions.rstId) return
  
          const params = {
            page: 1,
            row: 100,
            communityId: this.communityId,
            rstId: this.allocationStorehousesInfo.conditions.rstId
          }
          const { data } = await listResourceStoreSpecifications(params)
          this.allocationStorehousesInfo.resourceStoreSpecifications = data
        } catch (error) {
          console.error('获取物品规格失败:', error)
        }
      },
      _queryAllocationStorehouseMethod() {
        this.page.current = 1
        this._listAllocationStores(this.page.current, this.page.size)
      },
      _resetAllocationStorehouseMethod() {
        this.allocationStorehousesInfo.conditions = {
          ...this.allocationStorehousesInfo.conditions,
          applyId: "",
          shIda: "",
          shIdz: "",
          startUserId: "",
          resId: "",
          resName: "",
          parentRstId: "",
          rstId: "",
          rssId: "",
          state: "",
          applyType: "",
          startTime: "",
          endTime: ""
        }
        this.allocationStorehousesInfo.resourceStoreSonTypes = []
        this.allocationStorehousesInfo.resourceStoreSpecifications = []
        this.page.current = 1
        this._listAllocationStores(this.page.current, this.page.size)
      },
      _moreCondition() {
        this.allocationStorehousesInfo.moreCondition = !this.allocationStorehousesInfo.moreCondition
      },
      async _exportExcel() {
        try {
          const params = {
            ...this.allocationStorehousesInfo.conditions,
            pagePath: 'allocationStorehouseDetailed'
          }
          await exportData(params)
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
376
          this.$message.success(this.$t('common.operationSuccess'))
fc7cb950   wuxw   开发完成采购功能
377
          // 这里可以添加跳转到下载页面的逻辑
c8004a7b   wuxw   采购中的转增记录 使用记录处理完成
378
          this.$router.push('/pages/property/downloadTempFile?tab=下载中心')
fc7cb950   wuxw   开发完成采购功能
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
        } catch (error) {
          this.$message.error(this.$t('allocationStorehouseDetailed.exportError'))
        }
      },
      swatchApplyType(item) {
        this.allocationStorehousesInfo.conditions.applyType = item.statusCd
        this._listAllocationStores(this.page.current, this.page.size)
      },
      handleSizeChange(val) {
        this.page.size = val
        this._listAllocationStores(this.page.current, this.page.size)
      },
      handleCurrentChange(val) {
        this.page.current = val
        this._listAllocationStores(this.page.current, this.page.size)
      }
    }
  }
  </script>
  
  <style scoped>
  .padding-r-0 {
    padding-right: 0 !important;
  }
  
  .border-radius {
    border-radius: 4px;
  }
  
  .margin-xs-r {
    margin-right: 5px;
  }
  
fc7cb950   wuxw   开发完成采购功能
412
  </style>