| | |
| | |
|
| | | let openGenerate = ref(false);
|
| | | let generateBarcodeValue = ref("80000001");
|
| | | let pakinType = ref(1);
|
| | | let generateNum = ref(100);
|
| | |
|
| | | const state = reactive({
|
| | |
| | |
|
| | | const onSearch = () => {
|
| | | // console.log('search');
|
| | | currentPage = 1;
|
| | | getPage()
|
| | | }
|
| | |
|
| | |
| | | post('/api/zpalletBarcode/generate', {
|
| | | barcode: generateBarcodeValue.value,
|
| | | num: generateNum.value,
|
| | | type: pakinType.value
|
| | | }).then((resp) => {
|
| | | let result = resp.data;
|
| | | if (result.code == 200) {
|
| | |
| | | })
|
| | | }
|
| | |
|
| | | 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);
|
| | | }
|
| | | })
|
| | | const handleDelete = () => {
|
| | | if (state.selectedRowKeys.length == 0) {
|
| | | message.warning(formatMessage('common.select', '请选择'));
|
| | | return;
|
| | | }
|
| | |
|
| | | printChild.value.printData = tmp;
|
| | | printChild.value.open = true;
|
| | | Modal.confirm({
|
| | | title: formatMessage('page.delete', '删除'),
|
| | | content: formatMessage('page.delete.confirm', '确定删除该项吗?'),
|
| | | maskClosable: true,
|
| | | onOk: async () => {
|
| | | const hide = message.loading(formatMessage('common.loading', '请求中'));
|
| | | try {
|
| | | post('/api/zpalletBarcode/remove/' + state.selectedRowKeys).then(resp => {
|
| | | let result = resp.data;
|
| | | if (result.code === 200) {
|
| | | message.success(result.msg);
|
| | | } else {
|
| | | message.error(result.msg);
|
| | | }
|
| | | getPage()
|
| | | hide()
|
| | | })
|
| | | } catch (error) {
|
| | | message.error(formatMessage('common.fail', '请求失败'));
|
| | | }
|
| | | },
|
| | | });
|
| | |
|
| | | console.log(state.selectedRowKeys);
|
| | |
|
| | | }
|
| | |
|
| | | 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>
|
| | |
| | | <div class="table-header">
|
| | | <div>
|
| | | <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '请输入')"
|
| | | style="width: 200px;" @search="onSearch" />
|
| | | style="width: 200px; margin: 0 10px;" @search="onSearch" />
|
| | | <a-button @click="handlePrint()" type="primary">
|
| | | {{ formatMessage('db.man_zpallet_barcode.batchPrint', '批量打印') }}
|
| | | </a-button>
|
| | | <a-button @click="handleDelete()" danger style="margin: 0 10px;">
|
| | | {{ formatMessage('db.man_zpallet_barcode.batchPrint', '批量删除') }}
|
| | | </a-button>
|
| | | </div>
|
| | | <div class="table-header-right">
|
| | |
| | | <a-table :row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }"
|
| | | :data-source="tableData.records" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id"
|
| | | :pagination="{ total: tableData.total, onChange: onPageChange }"
|
| | | :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns" @resizeColumn="handleResizeColumn" :loading="state.loading">
|
| | | :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns" @resizeColumn="handleResizeColumn"
|
| | | :loading="state.loading">
|
| | | <template #bodyCell="{ column, text, record }">
|
| | | <template v-if="column.dataIndex === 'oper'">
|
| | | <div style="display: flex;justify-content: space-evenly;">
|
| | | <a-button type="link" primary @click="handleEdit(record)">{{ formatMessage('page.edit', '编辑') }}</a-button>
|
| | | <a-button type="link" danger @click="handleDel([record])">{{ formatMessage('page.delete', '删除')
|
| | | }}</a-button>
|
| | | }}</a-button>
|
| | | </div>
|
| | | </template>
|
| | | </template>
|
| | |
| | | <a-form-item :label="formatMessage('db.man_zpallet_barcode.generateNum', '生成数量')">
|
| | | <a-input v-model:value="generateNum" />
|
| | | </a-form-item>
|
| | | <a-form-item :label="formatMessage('db.man_container.type', '托盘类型')" name="type">
|
| | | <a-select v-model:value="pakinType" :options="[
|
| | | { label: '平库托盘', value: 1 },
|
| | | { label: '立库托盘', value: 2 },
|
| | | ]">
|
| | | </a-select>
|
| | | </a-form-item>
|
| | | </a-form>
|
| | | </a-modal>
|
| | |
|