|
|
|
|
@ -4,6 +4,15 @@
|
|
|
|
|
<el-button type="primary" plain @click="openForm('create')" v-hasPermi="['erp:mold-brand:create']">
|
|
|
|
|
<Icon icon="ep:plus" class="mr-5px" /> {{ t('action.add') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
type="success"
|
|
|
|
|
plain
|
|
|
|
|
@click="handleExport"
|
|
|
|
|
:loading="exportLoading"
|
|
|
|
|
v-hasPermi="['erp:mold-brand:export']"
|
|
|
|
|
>
|
|
|
|
|
<Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
|
|
|
|
<el-table-column :label="t('MoldManagement.Mold.code')" align="center" prop="code" />
|
|
|
|
|
<el-table-column :label="t('MoldManagement.Mold.name')" align="left" prop="name" />
|
|
|
|
|
@ -70,6 +79,7 @@
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
import { dateFormatter, formatDate } from '@/utils/formatTime'
|
|
|
|
|
import download from '@/utils/download'
|
|
|
|
|
import { MoldBrandApi, type MoldVO } from '@/api/erp/mold'
|
|
|
|
|
import MoldForm from './MoldForm.vue'
|
|
|
|
|
import MoldRecordForm from "@/views/erp/mold/components/MoldRecordForm.vue";
|
|
|
|
|
@ -83,6 +93,7 @@ const props = defineProps<{
|
|
|
|
|
const loading = ref(false) // 列表的加载中
|
|
|
|
|
const list = ref([]) // 列表的数据
|
|
|
|
|
const total = ref(0) // 列表的总页数
|
|
|
|
|
const exportLoading = ref(false) // 导出的加载中
|
|
|
|
|
const queryParams = reactive({
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
@ -143,6 +154,26 @@ const handleDelete = async (id: number) => {
|
|
|
|
|
} catch { }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
const handleExport = async () => {
|
|
|
|
|
if (!props.brandId) {
|
|
|
|
|
message.error('请选择一个模具型号')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
await message.exportConfirm()
|
|
|
|
|
exportLoading.value = true
|
|
|
|
|
const data = await MoldBrandApi.exportMold({
|
|
|
|
|
...queryParams,
|
|
|
|
|
brandId: props.brandId
|
|
|
|
|
})
|
|
|
|
|
download.excel(data, '模具.xls')
|
|
|
|
|
} catch {
|
|
|
|
|
} finally {
|
|
|
|
|
exportLoading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 添加/修改操作 */
|
|
|
|
|
const recordFormRef = ref()
|
|
|
|
|
const openRecordForm = (type: string, id?: number, brandId?: number) => {
|
|
|
|
|
|