Blame view

ant-design-vue-jeecg/src/views/system/stocktaking/subTables/CycleCountDetailChildSubTable.vue 4.49 KB
1
<template>
2
  <a-card :bordered="false">
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  <a-table
    rowKey="id"
    size="middle"
    bordered
    :loading="loading"
    :columns="columns"
    :dataSource="dataSource"
    :pagination="false"
  >

    <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>
24
    <template slot="action" slot-scope="text, record">
25
26
      <adjustment-doc-modal ref="adjustmentModal" @ok="modalFormOk"/>
      <a v-if="record.childStatus != 1" @click="createMany(record.id)"><a-icon />实盘登记</a>
27
28
    </template>
29
30
31
32
33
34
35
36
37
38
39
40
41
42
    <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>
  </a-table>
43
  </a-card>
44
45
46
47
48
</template>

<script>
  import { getAction } from '@api/manage'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
49
50
  import AdjustmentDocModal from "../modules/AdjustmentDocModal";
51
52
53
54

  export default {
    name: 'CycleCountDetailChildSubTable',
    mixins: [JeecgListMixin],
55
56
57
    components: {
      AdjustmentDocModal,
    },
58
59
60
61
62
63
64
65
66
67
68
69
70
71
    props: {
      record: {
        type: Object,
        default: null,
      }
    },
    data() {
      return {
        description: '盘点容器明细表内嵌列表',
        disableMixinCreated: true,
        loading: false,
        dataSource: [],
        columns: [
          {
李泰瑜 authored
72
            title: '盘点主单编码',
73
74
75
            align: 'center',
            dataIndex: 'cyclecountheadcode',
          },
李泰瑜 authored
76
77
78
79
80
          // {
          //   title: '盘点明细ID主id',
          //   align: 'center',
          //   dataIndex: 'cycleCountDetailid',
          // },
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
          {
            title: '库位',
            align: 'center',
            dataIndex: 'locationCode',
          },
          {
            title: '容器',
            align: 'center',
            dataIndex: 'containerCode',
          },
          {
            title: '物料编码',
            align: 'center',
            dataIndex: 'materialCode',
          },
          {
            title: '物料名称',
            align: 'center',
            dataIndex: 'materialName',
          },
          {
            title: '物料规格',
            align: 'center',
            dataIndex: 'materialSpec',
          },
          {
            title: '物料单位',
            align: 'center',
            dataIndex: 'materialUnit',
          },
          {
            title: '系统数量',
            align: 'center',
            dataIndex: 'systemQty',
          },
          {
            title: '实盘数量',
            align: 'center',
            dataIndex: 'countedQty',
          },
          {
            title: '差异数量',
            align: 'center',
            dataIndex: 'gapQty',
          },
          {
李泰瑜 authored
127
128
            title: '明细状态',
            align: 'center',
李泰瑜 authored
129
            dataIndex: 'childStatus_dictText',
李泰瑜 authored
130
131
132
          },
          {
            title: '库存明细ID',
133
134
135
            align: 'center',
            dataIndex: 'inventoryDetaiId',
          },
136
137
138
139
140
141
142
          {
            title: '操作',
            dataIndex: 'action',
            align: 'center',
            width:147,
            scopedSlots: { customRender: 'action' },
          },
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
        ],
        url: {
          listByMainId: '/cycleCountDetail/cycleCountDetail/queryCycleCountDetailChildByMainId',
        },
      }
    },
    watch: {
      record: {
        immediate: true,
        handler() {
          if (this.record != null) {
            this.loadData(this.record)
          }
        }
      }
    },
    methods: {

      loadData(record) {
        this.loading = true
        this.dataSource = []
        getAction(this.url.listByMainId, {
          id: record.id
        }).then((res) => {
          if (res.success) {
            this.dataSource = res.result.records
          }
        }).finally(() => {
          this.loading = false
        })
      },
174
175
      createMany(id) {
        this.$refs.adjustmentModal.edit(id);
176
177
        this.$refs.adjustmentModal.title = "实盘登记";
      },
178
179
180
181
182
183
184
185

    },
  }
</script>

<style scoped>

</style>