| | |
| | | @clear="searchFilter" |
| | | clearable |
| | | prefix-icon="Search" /> |
| | | <span style="margin-left: 12px"> |
| | | <ImportExcel @uploadSuccess="handleImportSuccess" /> |
| | | </span> |
| | | <el-button v-if="false" |
| | | type="primary" |
| | | @click="openProDia('addOne')" |
| | |
| | | @click="openModelDia('add')"> |
| | | 新增规格型号 |
| | | </el-button> |
| | | <ImportExcel :product-id="currentId" |
| | | @uploadSuccess="getModelList" /> |
| | | <el-button type="danger" |
| | | @click="handleDelete" |
| | | style="margin-left: 10px" |
| | | plain> |
| | | 删除 |
| | | </el-button> |
| | | <el-button @click="handleExportModels" |
| | | style="margin-left: 10px"> |
| | | 导出 |
| | | </el-button> |
| | | </div> |
| | | <PIMTable rowKey="id" |
| | |
| | | tableLoading.value = false; |
| | | }); |
| | | }; |
| | | // 导入完成后刷新产品树与右侧规格列表 |
| | | const handleImportSuccess = () => { |
| | | getProductTreeList(); |
| | | if (currentId.value) { |
| | | getModelList(); |
| | | } |
| | | }; |
| | | // 删除规格型号 |
| | | const handleDelete = () => { |
| | | let ids = []; |
| | |
| | | proxy.$modal.msg("已取消"); |
| | | }); |
| | | }; |
| | | // 导出当前产品的规格型号 |
| | | const handleExportModels = () => { |
| | | if (!currentId.value) { |
| | | proxy.$modal.msgWarning("请先选择产品"); |
| | | return; |
| | | } |
| | | proxy.download( |
| | | "/basic/product/exportModel", |
| | | { id: currentId.value }, |
| | | "产品规格型号.xlsx" |
| | | ); |
| | | }; |
| | | |
| | | const debounce = (fn, delay = 300) => { |
| | | let timer; |
| | | return (...args) => { |