Browse Source

HL-5416上架策略增加导出导入功能

hella_online_20240823
wangyufei 3 months ago
parent
commit
708283fa7b
  1. 61
      src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/index.vue

61
src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/index.vue

@ -45,6 +45,16 @@
<Pagination v-model:limit="queryParams.pageSize" v-model:page="queryParams.pageNo" :total="total" <Pagination v-model:limit="queryParams.pageSize" v-model:page="queryParams.pageNo" :total="total"
@pagination="getList" /> @pagination="getList" />
</ContentWrap> </ContentWrap>
<!-- 导入 -->
<ImportForm
ref="importFormRef"
url="/wms/supplierdeliver-request-main/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
:updateIsDisable="true"
:coverIsDisable="true"
:mode="2"
/>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<AddForm ref="formRef" @success="getList" /> <AddForm ref="formRef" @success="getList" />
</template> </template>
@ -54,6 +64,8 @@ import { DICT_TYPE } from '@/utils/dict'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as RuleApi from '@/api/wms/rule' import * as RuleApi from '@/api/wms/rule'
import AddForm from './AddForm.vue' import AddForm from './AddForm.vue'
import download from '@/utils/download'
import { formatDate } from '@/utils/formatTime'
defineOptions({ name: 'SupplieDeliveryStrategy' }) defineOptions({ name: 'SupplieDeliveryStrategy' })
const queryFormRef = ref() // const queryFormRef = ref() //
@ -111,11 +123,7 @@ const handleDelete = async (id: number) => {
getList() getList()
} catch { } } catch { }
} }
// const route = useRoute() //
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
]
// //
@ -143,6 +151,49 @@ const isShowMainButton = (row,val) => {
} }
} }
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
console.log('queryParams',queryParams)
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const excelTitle = ref(route.meta.title)
const data = await SupplierdeliverRequestMainApi.exportSupplierdeliverRequestMain(
queryParams
)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn({ hasPermi: 'wms:supplierdeliver-request-main:import' }), //
// defaultButtons.defaultExportBtn({ hasPermi: 'wms:supplierdeliver-request-main:export' }), //
]
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: `${route.meta.title}】导入模版.xlsx`
})
//
const importSuccess = () => {
getList()
}
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [

Loading…
Cancel
Save