Blame view

ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountDetailList.vue 10.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<template>
  <a-card class="j-inner-table-wrapper" :bordered="false">

    <!-- 查询区域 begin -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline">
        <a-row :gutter="24">
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域 end -->

    <!-- 操作按钮区域 begin -->
    <div class="table-operator">
肖超群 authored
15
      <a-button v-has="'cycleCountHeader:export'" type="primary" icon="download" @click="handleExportXls('盘点明细表')">导出</a-button>
16
      <!-- 高级查询区域 -->
李泰瑜 authored
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
    </div>
    <!-- 操作按钮区域 end -->

    <!-- table区域 begin -->
    <div>

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        class="j-table-force-nowrap"
        :loading="loading"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :expandedRowKeys="expandedRowKeys"
        :rowSelection="{selectedRowKeys, onChange: onSelectChange}"
        @expand="handleExpand"
        @change="handleTableChange"
      >

        <!-- 内嵌table区域 begin -->
        <template slot="expandedRowRender" slot-scope="record">
          <a-tabs tabPosition="top">
李泰瑜 authored
43
            <a-tab-pane tab="物料详情表" key="cycleCountDetailChild" forceRender>
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
              <cycle-count-detail-child-sub-table :record="record"/>
            </a-tab-pane>
          </a-tabs>
        </template>
        <!-- 内嵌table区域 end -->

        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>

        <template slot="imgSlot" slot-scope="text">
          <div style="font-size: 12px;font-style: italic;">
            <span v-if="!text">无图片</span>
            <img v-else :src="getImgView(text)" alt="" style="max-width:80px;height:25px;"/>
          </div>
        </template>


        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            ghost
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)"
          >
            <span>下载</span>
          </a-button>
        </template>
        <template slot="action" slot-scope="text, record">
76
77
78
          <cycle-count-detail-chi-id-modal ref="adjustmentModal" @ok="modalFormOk" :id="record.id"/>
          <a @click="createMany()"><a-icon/>新增</a>
          <a-divider type="vertical"/>
曾湘平 authored
79
80
          <a v-if="record.enableStatus == '1'"  @click="selectPort(record)">生成盘点任务</a>
          <a-divider v-if="record.enableStatus == '1'"  type="vertical"/>
81
          <a @click="loadDatas(record.cycleCountHeadId)"><a-icon type="sync"/>刷新</a>
82
83
84
85
86
87
88
        </template>

      </a-table>
    </div>
    <!-- table区域 end -->

    <!-- 表单区域 -->
89
90

    <cycle-count-select-modal ref="modalForm2"></cycle-count-select-modal>
91
92
93
94
95
96
97
98
    <cycle-count-detail-modal ref="modalForm" @ok="modalFormOk"/>

  </a-card>
</template>

<script>

  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
99
  import { getAction } from '@api/manage'
100
  import CycleCountDetailModal from './modules/CycleCountDetailModal'
101
  import CycleCountSelectModal from './modules/CycleCountSelectModal'
102
103
  import CycleCountDetailChildSubTable from './subTables/CycleCountDetailChildSubTable'
  import '@/assets/less/TableExpand.less'
104
  import {createCycleCoutTaskByDetailId, stockTakeTask} from "@/api/api";
105
  import Utils from "../../../components/jeecgbiz/JButtonBizComponent/util.js"
106
  import CycleCountDetailChiIdModal from "./modules/CycleCountDetailChiIdModal";
107
108
109

  export default {
    name: 'CycleCountDetailList',
110
    cycleCountDetailId:'',
111
112
113
114
    mixins: [JeecgListMixin],
    components: {
      CycleCountDetailModal,
      CycleCountDetailChildSubTable,
115
      CycleCountSelectModal,
116
      CycleCountDetailChiIdModal,
117
    },
118
    props: {
119
120
121
122
      record: {
        type: Object,
        default: null,
      },
123
124
125
126
127
      isLoad: {
        type: Boolean,
        default: false,
      }
    },
128
129
    data() {
      return {
130
131
132
133
        description: '盘点明细表列表管理页面',
        // 表头
        columns: [
134
135
136
137
138
139
140
          // {
          //   title: 'ID',
          //   key: 'rowIndex',
          //   width: 60,
          //   align: 'center',
          //   customRender: (t, r, index) => parseInt(index) + 1
          // },
李泰瑜 authored
141
142
143
144
145
          // {
          //   title: '盘点主单id',
          //   align: 'center',
          //   dataIndex: 'cycleCountHeadId',
          // },
146
          {
李泰瑜 authored
147
            title: '盘点主单编码',
148
149
150
            align: 'center',
            dataIndex: 'cycleCountHeadCode',
          },
李泰瑜 authored
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
          // {
          //   title: '任务表头',
          //   align: 'center',
          //   dataIndex: 'taskHeaderId',
          // },
          // {
          //   title: '任务明细头',
          //   align: 'center',
          //   dataIndex: 'taskDetailId',
          // },
          // {
          //   title: '仓库',
          //   align: 'center',
          //   dataIndex: 'warehouseCode',
          // },
          // {
          //   title: '货主',
          //   align: 'center',
          //   dataIndex: 'companyCode',
          // },
          // {
          //   title: '库存明细头',
          //   align: 'center',
          //   dataIndex: 'inventoryDetailId',
          // },
176
177
178
179
180
181
182
183
184
185
186
187
188
          {
            title: '库位',
            align: 'center',
            dataIndex: 'locationCode',
          },
          {
            title: '容器',
            align: 'center',
            dataIndex: 'containerCode',
          },
          {
            title: '库存状态',
            align: 'center',
李泰瑜 authored
189
            dataIndex: 'inventorySts_dictText',
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
          },
          {
            title: '系统数量',
            align: 'center',
            dataIndex: 'systemQty',
          },
          {
            title: '实盘数量',
            align: 'center',
            dataIndex: 'countedQty',
          },
          {
            title: '差异数量',
            align: 'center',
            dataIndex: 'gapQty',
          },
          {
            title: '失败原因',
            align: 'center',
            dataIndex: 'rejectionNote',
          },
          {
            title: '完成用户',
            align: 'center',
            dataIndex: 'completedBy',
          },
          {
            title: '完成时间',
            align: 'center',
            dataIndex: 'completedAt',
          },
          {
李泰瑜 authored
222
            title: '状态',
223
            align: 'center',
李泰瑜 authored
224
            dataIndex: 'enableStatus_dictText',
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
          },
          {
            title: '操作',
            dataIndex: 'action',
            align: 'center',
            width:147,
            scopedSlots: { customRender: 'action' },
          },
        ],
        // 字典选项
        dictOptions: {},
        // 展开的行test
        expandedRowKeys: [],
        url: {
          list: '/cycleCountDetail/cycleCountDetail/list',
          delete: '/cycleCountDetail/cycleCountDetail/delete',
          deleteBatch: '/cycleCountDetail/cycleCountDetail/deleteBatch',
          exportXlsUrl: '/cycleCountDetail/cycleCountDetail/exportXls',
          importExcelUrl: '/cycleCountDetail/cycleCountDetail/importExcel',
        },
        superFieldList:[],
246
247
248
249
250
251
      }
    },
    created() {
      this.getSuperFieldList();
    },
252
253
254
255
256
257
    mounted() {
      let _this = this;
      Utils.$on('methodB',(data)=> {
        _this.methodB(data);
      })
    },
258
259
260
261
262
    computed: {
      importExcelUrl() {
        return window._CONFIG['domianURL'] + this.url.importExcelUrl
      }
    },
263
264
265
266
267
268
269
270
271
272
273

    watch: {
      record: {
        immediate: true,
        handler() {
          if (this.record != null) {
            this.loadData(this.record)
          }
        }
      }
    },
274
    methods: {
275
276
277
278
279
280
281
282
283
284
285
286
287
      loadData(record) {
        this.loading = true
        this.dataSource = []
        getAction(this.url.list, {
          cycleCountHeadId: record.id
        }).then((res) => {
          if (res.success) {
            this.dataSource = res.result.records
          }
        }).finally(() => {
          this.loading = false
        })
288
289
290
291
292
      },
      selectPort(record) {
        this.$refs.modalForm2.edit(record);
        this.$refs.modalForm2.title = "选择出库口";
      },
293
294
295
296
297
298
299
300
301
302
303
304
305
306
      loadDatas(record) {
        this.loading = true
        this.dataSource = []
        getAction(this.url.list, {
          cycleCountHeadId: record
        }).then((res) => {
          if (res.success) {
            this.dataSource = res.result.records
          }
        }).finally(() => {
          this.loading = false
        })
      },
307
308
      methodB(data) {
          var _this = this;
309
          _this.loadDatas(data);
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
      initDictConfig() {
      },

      handleExpand(expanded, record) {
        this.expandedRowKeys = []
        if (expanded === true) {
          this.expandedRowKeys.push(record.id)
        }
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'cycleCountHeadId',text:'盘点主单id',dictCode:''})
        fieldList.push({type:'string',value:'cycleCountHeadCode',text:'盘点主单code',dictCode:''})
        fieldList.push({type:'string',value:'taskHeaderId',text:'任务表头',dictCode:''})
        fieldList.push({type:'string',value:'taskDetailId',text:'任务明细头',dictCode:''})
        fieldList.push({type:'string',value:'warehouseCode',text:'仓库',dictCode:''})
        fieldList.push({type:'string',value:'companyCode',text:'货主',dictCode:''})
        fieldList.push({type:'string',value:'inventoryDetailId',text:'库存明细头',dictCode:''})
        fieldList.push({type:'string',value:'locationCode',text:'库位',dictCode:''})
        fieldList.push({type:'string',value:'containerCode',text:'容器',dictCode:''})
        fieldList.push({type:'string',value:'inventorySts',text:'库存状态',dictCode:''})
        fieldList.push({type:'string',value:'systemQty',text:'系统数量',dictCode:''})
        fieldList.push({type:'string',value:'countedQty',text:'实盘数量',dictCode:''})
        fieldList.push({type:'string',value:'gapQty',text:'差异数量',dictCode:''})
        fieldList.push({type:'string',value:'rejectionNote',text:'失败原因',dictCode:''})
        fieldList.push({type:'string',value:'completedBy',text:'完成用户',dictCode:''})
        fieldList.push({type:'string',value:'completedAt',text:'完成时间',dictCode:''})
        fieldList.push({type:'string',value:'enableStatus',text:'盘点明细状态',dictCode:''})
        this.superFieldList = fieldList
340
341
342
343
344
345
      },

      createMany() {
        this.$refs.adjustmentModal.edit();
        this.$refs.adjustmentModal.title = "实盘登记";
      },
346
347
348
349
350
351
    }
  }
</script>
<style lang="less" scoped>
  @import '~@assets/less/common.less';
</style>