skyouc
2024-12-21 c635d78b479510ebe2556a420948effcd30a0731
zy-asrs-admin/src/components/order/waitTask/index.vue
@@ -1,168 +1,168 @@
<script setup>
import { getCurrentInstance, ref, watch, reactive } from 'vue';
import { useRouter } from "vue-router";
import { get, post, postForm } from '@/utils/request.js'
import { message, Modal } from 'ant-design-vue';
import { logout } from '@/config.js';
import { formatMessage } from '@/utils/localeUtils.js';
import useTableSearch from '@/utils/tableUtils.jsx';
const context = getCurrentInstance()?.appContext.config.globalProperties;
const router = useRouter();
const TABLE_KEY = 'table-locDetl';
let tableData = ref([]);
let open = ref(false);
const orderDetlId = ref(null);
const showWidth = ref("60%")
const {
    getColumnSearchProps,
} = useTableSearch();
const state = reactive({
    selectedRowKeys: [],
    loading: false,
    columns: [],
});
state.columns = [
  {
    title: formatMessage('db.man_wait_pakin.order_id', '订单ID'),
    dataIndex: 'orderId$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('orderId$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.order_no', '订单编号'),
    dataIndex: 'orderNo',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('orderNo'),
  },
  {
    title: formatMessage('db.man_wait_pakin.barcode', '托盘码'),
    dataIndex: 'barcode',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('barcode'),
  },
  {
    title: formatMessage('db.man_wait_pakin.matnr', '商品编号'),
    dataIndex: ['detl$', 'mat$', 'matnr'],
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('detl$.matnr'),
  },
  {
    title: formatMessage('db.man_wait_pakin.batch', '批号'),
    dataIndex: ['detl$', 'batch'],
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('detl$.matnr'),
  },
  {
    title: formatMessage('db.man_wait_pakin.anfme', '组托数量'),
    dataIndex: 'anfme',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('anfme'),
  },
  {
    title: formatMessage('db.man_wait_pakin.io_status', '组托状态'),
    dataIndex: 'ioStatus$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('ioStatus$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.status', '状态'),
    dataIndex: 'status$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('status$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.create_time', '添加时间'),
    dataIndex: 'createTime$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('createTime$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.create_by', '添加人员'),
    dataIndex: 'createBy$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('createBy$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.update_time', '修改时间'),
    dataIndex: 'updateTime$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('updateTime$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.update_by', '修改人员'),
    dataIndex: 'updateBy$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('updateBy$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.memo', '备注'),
    dataIndex: 'memo',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('memo'),
  },
];
const handleOk = () => {
    open.value = false;
}
const handleCancel = () => {
    open.value = false;
    orderDetlId.value = null;
}
watch(orderDetlId, (newVal, oldVal) => {
    if (newVal != null) {
        get("/api/waitPakin/orderDetlId/" + newVal, {}).then((resp) => {
            let result = resp.data;
            tableData.value = result.data;
        })
    }
})
defineExpose({
    tableData,
    orderDetlId,
    open,
    showWidth,
})
</script>
<script>
export default {
    name: 'waitTaskComponent'
}
</script>
<template>
    <div>
        <a-modal v-model:open="open" :width="showWidth" @ok="handleOk" @cancel="handleCancel">
            <a-table :data-source="tableData" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id"
                :scroll="{ y: 768 }" :columns="state.columns">
            </a-table>
        </a-modal>
    </div>
</template>
<style></style>
<script setup>
import { getCurrentInstance, ref, watch, reactive } from 'vue';
import { useRouter } from "vue-router";
import { get, post, postForm } from '@/utils/request.js'
import { message, Modal } from 'ant-design-vue';
import { logout } from '@/config.js';
import { formatMessage } from '@/utils/localeUtils.js';
import useTableSearch from '@/utils/tableUtils.jsx';
const context = getCurrentInstance()?.appContext.config.globalProperties;
const router = useRouter();
const TABLE_KEY = 'table-locDetl';
let tableData = ref([]);
let open = ref(false);
const orderDetlId = ref(null);
const showWidth = ref("60%")
const {
    getColumnSearchProps,
} = useTableSearch();
const state = reactive({
    selectedRowKeys: [],
    loading: false,
    columns: [],
});
state.columns = [
  {
    title: formatMessage('db.man_wait_pakin.order_id', '订单ID'),
    dataIndex: 'orderId$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('orderId$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.order_no', '订单编号'),
    dataIndex: 'orderNo',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('orderNo'),
  },
  {
    title: formatMessage('db.man_wait_pakin.barcode', '托盘码'),
    dataIndex: 'barcode',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('barcode'),
  },
  {
    title: formatMessage('db.man_wait_pakin.matnr', '商品编号'),
    dataIndex: ['detl$', 'mat$', 'matnr'],
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('detl$.matnr'),
  },
  {
    title: formatMessage('db.man_wait_pakin.batch', '批号'),
    dataIndex: ['detl$', 'batch'],
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('detl$.matnr'),
  },
  {
    title: formatMessage('db.man_wait_pakin.anfme', '组托数量'),
    dataIndex: 'anfme',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('anfme'),
  },
  {
    title: formatMessage('db.man_wait_pakin.io_status', '组托状态'),
    dataIndex: 'ioStatus$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('ioStatus$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.status', '状态'),
    dataIndex: 'status$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('status$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.create_time', '添加时间'),
    dataIndex: 'createTime$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('createTime$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.create_by', '添加人员'),
    dataIndex: 'createBy$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('createBy$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.update_time', '修改时间'),
    dataIndex: 'updateTime$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('updateTime$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.update_by', '修改人员'),
    dataIndex: 'updateBy$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('updateBy$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.memo', '备注'),
    dataIndex: 'memo',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('memo'),
  },
];
const handleOk = () => {
    open.value = false;
}
const handleCancel = () => {
    open.value = false;
    orderDetlId.value = null;
}
watch(orderDetlId, (newVal, oldVal) => {
    if (newVal != null) {
        get("/api/waitPakin/orderDetlId/" + newVal, {}).then((resp) => {
            let result = resp.data;
            tableData.value = result.data;
        })
    }
})
defineExpose({
    tableData,
    orderDetlId,
    open,
    showWidth,
})
</script>
<script>
export default {
    name: 'waitTaskComponent'
}
</script>
<template>
    <div>
        <a-modal v-model:open="open" :width="showWidth" @ok="handleOk" @cancel="handleCancel">
            <a-table :data-source="tableData" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id"
                :scroll="{ y: 768 }" :columns="state.columns">
            </a-table>
        </a-modal>
    </div>
</template>
<style></style>