#
Junjie
2024-11-29 0b7eb382e86890ad3709f92f9463cb3f0d1b8af2
zy-asrs-admin/src/views/base/mat/index.vue
@@ -7,6 +7,7 @@
import EditView from './edit.vue'
import {formatMessage} from '@/utils/localeUtils.js';
import useTableSearch from '@/utils/tableUtils.jsx';
import MatPrint from '@/components/print/matPrint/index.vue';
import {
  DownOutlined,
  UploadOutlined,
@@ -28,6 +29,7 @@
  model: null,
})
const editChild = ref(null)
const printChild = ref(null);
const state = reactive({
  selectedRowKeys: [],
@@ -487,6 +489,23 @@
  }
};
const handlePrint = () => {
    if (state.selectedRowKeys.length == 0) {
        message.warning(formatMessage('common.select', '请选择'));
        return;
    }
    let data = tableData.value.records;
    let tmp = [];
    data.forEach((item) => {
        if (state.selectedRowKeys.indexOf(item.id) != -1) {
            tmp.push(item);
        }
    })
    printChild.value.printData = tmp;
    printChild.value.open = true;
}
</script>
<script>
@@ -539,6 +558,9 @@
            <DownOutlined/>
          </a-button>
        </a-dropdown>
        <a-button @click="handlePrint()" type="primary">
          {{ formatMessage('db.man_zpallet_barcode.batchPrint', '批量打印') }}
        </a-button>
        <a-button @click="handleEdit(null)" type="primary">{{ formatMessage('page.add', '添加') }}</a-button>
        <a-button @click="handleExport">{{ formatMessage('page.export', '导出') }}</a-button>
      </div>
@@ -564,6 +586,8 @@
      </template>
    </a-table>
  </div>
  <MatPrint ref="printChild" />
</template>
<style></style>