✨ feat(mes): 添加盘点方案参数相关功能和数据结构
新增盘点方案参数的 CRUD 接口及相关枚举,支持在管理后台进行参数的创建、更新和删除操作。同时,更新了前端组件以支持参数的动态选择和展示,提升用户体验。pull/871/MERGE
parent
2cde22dcd7
commit
43dd2425ed
|
|
@ -0,0 +1,72 @@
|
||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// TODO @AI:原则是 plan、task 两个目录;然后每个目录里,index.ts 都只能;param/index.ts 这样;
|
||||||
|
export interface StockTakingPlanParamVO {
|
||||||
|
id?: number
|
||||||
|
planId?: number
|
||||||
|
type?: number
|
||||||
|
valueId?: number | string
|
||||||
|
valueCode?: string
|
||||||
|
valueName?: string
|
||||||
|
remark?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StockTakingPlanVO {
|
||||||
|
id?: number
|
||||||
|
code?: string
|
||||||
|
name?: string
|
||||||
|
type?: number
|
||||||
|
startTime?: string
|
||||||
|
endTime?: string
|
||||||
|
blindFlag?: boolean
|
||||||
|
frozenFlag?: boolean
|
||||||
|
enableFlag?: boolean
|
||||||
|
status?: number
|
||||||
|
remark?: string
|
||||||
|
params?: StockTakingPlanParamVO[]
|
||||||
|
createTime?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StockTakingPlanGenerateReqVO {
|
||||||
|
planId: number
|
||||||
|
code: string
|
||||||
|
name: string
|
||||||
|
takingDate?: string
|
||||||
|
userId: number
|
||||||
|
remark?: string
|
||||||
|
params?: StockTakingPlanParamVO[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export const StockTakingPlanApi = {
|
||||||
|
getStockTakingPlanPage: async (params: any) => {
|
||||||
|
return await request.get({ url: '/mes/wm/stocktaking-plan/page', params })
|
||||||
|
},
|
||||||
|
|
||||||
|
getStockTakingPlan: async (id: number) => {
|
||||||
|
return await request.get({ url: '/mes/wm/stocktaking-plan/get?id=' + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
createStockTakingPlan: async (data: StockTakingPlanVO) => {
|
||||||
|
return await request.post({ url: '/mes/wm/stocktaking-plan/create', data })
|
||||||
|
},
|
||||||
|
|
||||||
|
updateStockTakingPlan: async (data: StockTakingPlanVO) => {
|
||||||
|
return await request.put({ url: '/mes/wm/stocktaking-plan/update', data })
|
||||||
|
},
|
||||||
|
|
||||||
|
deleteStockTakingPlan: async (id: number) => {
|
||||||
|
return await request.delete({ url: '/mes/wm/stocktaking-plan/delete?id=' + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
confirmStockTakingPlan: async (id: number) => {
|
||||||
|
return await request.put({ url: '/mes/wm/stocktaking-plan/confirm?id=' + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
generateStockTakingTask: async (data: StockTakingPlanGenerateReqVO) => {
|
||||||
|
return await request.post({ url: '/mes/wm/stocktaking-plan/generate-task', data })
|
||||||
|
},
|
||||||
|
|
||||||
|
exportStockTakingPlan: async (params: any) => {
|
||||||
|
return await request.download({ url: '/mes/wm/stocktaking-plan/export-excel', params })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// TODO @AI:原则是 plan、task 两个目录;然后每个目录里,index.ts 都只能;param/index.ts 这样;
|
||||||
|
export interface StockTakingResultVO {
|
||||||
|
id?: number
|
||||||
|
taskId?: number
|
||||||
|
lineId?: number
|
||||||
|
materialStockId?: number
|
||||||
|
itemId?: number
|
||||||
|
itemCode?: string
|
||||||
|
itemName?: string
|
||||||
|
specification?: string
|
||||||
|
unitMeasureName?: string
|
||||||
|
batchId?: number
|
||||||
|
batchCode?: string
|
||||||
|
warehouseId?: number
|
||||||
|
warehouseName?: string
|
||||||
|
locationId?: number
|
||||||
|
locationName?: string
|
||||||
|
areaId?: number
|
||||||
|
areaName?: string
|
||||||
|
quantity?: number
|
||||||
|
remark?: string
|
||||||
|
createTime?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const StockTakingResultApi = {
|
||||||
|
getStockTakingResultPage: async (params: any) => {
|
||||||
|
return await request.get({ url: '/mes/wm/stocktaking-task-result/page', params })
|
||||||
|
},
|
||||||
|
|
||||||
|
getStockTakingResultList: async (taskId: number) => {
|
||||||
|
return await request.get({ url: '/mes/wm/stocktaking-task-result/list?taskId=' + taskId })
|
||||||
|
},
|
||||||
|
|
||||||
|
exportStockTakingResult: async (params: any) => {
|
||||||
|
return await request.download({ url: '/mes/wm/stocktaking-task-result/export-excel', params })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,103 @@
|
||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// TODO @AI:原则是 plan、task 两个目录;然后每个目录里,index.ts 都只能;param/index.ts 这样;
|
||||||
|
export interface StockTakingTaskVO {
|
||||||
|
id?: number
|
||||||
|
code?: string
|
||||||
|
name?: string
|
||||||
|
takingDate?: string
|
||||||
|
type?: number
|
||||||
|
userId?: number
|
||||||
|
userNickname?: string
|
||||||
|
planId?: number
|
||||||
|
planCode?: string
|
||||||
|
planName?: string
|
||||||
|
blindFlag?: boolean
|
||||||
|
frozenFlag?: boolean
|
||||||
|
snapshotTime?: string
|
||||||
|
startTime?: string
|
||||||
|
endTime?: string
|
||||||
|
status?: number
|
||||||
|
adjustedFlag?: boolean
|
||||||
|
remark?: string
|
||||||
|
createTime?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StockTakingTaskLineVO {
|
||||||
|
id: number
|
||||||
|
taskId: number
|
||||||
|
materialStockId?: number
|
||||||
|
itemId?: number
|
||||||
|
itemCode?: string
|
||||||
|
itemName?: string
|
||||||
|
specification?: string
|
||||||
|
unitMeasureName?: string
|
||||||
|
batchId?: number
|
||||||
|
batchCode?: string
|
||||||
|
quantity?: number
|
||||||
|
takingQuantity?: number
|
||||||
|
differenceQuantity?: number
|
||||||
|
warehouseId?: number
|
||||||
|
warehouseName?: string
|
||||||
|
locationId?: number
|
||||||
|
locationName?: string
|
||||||
|
areaId?: number
|
||||||
|
areaName?: string
|
||||||
|
status?: number
|
||||||
|
remark?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StockTakingTaskLineBatchUpdateReqVO {
|
||||||
|
taskId: number
|
||||||
|
items: Array<{
|
||||||
|
id: number
|
||||||
|
takingQuantity: number
|
||||||
|
remark?: string
|
||||||
|
}>
|
||||||
|
}
|
||||||
|
|
||||||
|
export const StockTakingApi = {
|
||||||
|
getStockTakingPage: async (params: any) => {
|
||||||
|
return await request.get({ url: '/mes/wm/stocktaking-task/page', params })
|
||||||
|
},
|
||||||
|
|
||||||
|
getStockTaking: async (id: number) => {
|
||||||
|
return await request.get({ url: '/mes/wm/stocktaking-task/get?id=' + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
createStockTaking: async (data: StockTakingTaskVO) => {
|
||||||
|
return await request.post({ url: '/mes/wm/stocktaking-task/create', data })
|
||||||
|
},
|
||||||
|
|
||||||
|
updateStockTaking: async (data: StockTakingTaskVO) => {
|
||||||
|
return await request.put({ url: '/mes/wm/stocktaking-task/update', data })
|
||||||
|
},
|
||||||
|
|
||||||
|
deleteStockTaking: async (id: number) => {
|
||||||
|
return await request.delete({ url: '/mes/wm/stocktaking-task/delete?id=' + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
startStockTaking: async (id: number) => {
|
||||||
|
return await request.put({ url: '/mes/wm/stocktaking-task/start?id=' + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
finishStockTaking: async (id: number) => {
|
||||||
|
return await request.put({ url: '/mes/wm/stocktaking-task/finish?id=' + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
cancelStockTaking: async (id: number) => {
|
||||||
|
return await request.put({ url: '/mes/wm/stocktaking-task/cancel?id=' + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
getStockTakingLineList: async (taskId: number) => {
|
||||||
|
return await request.get({ url: '/mes/wm/stocktaking-task/line-list?taskId=' + taskId })
|
||||||
|
},
|
||||||
|
|
||||||
|
batchUpdateStockTakingLines: async (data: StockTakingTaskLineBatchUpdateReqVO) => {
|
||||||
|
return await request.put({ url: '/mes/wm/stocktaking-task/line-batch-update', data })
|
||||||
|
},
|
||||||
|
|
||||||
|
exportStockTaking: async (params: any) => {
|
||||||
|
return await request.download({ url: '/mes/wm/stocktaking-task/export-excel', params })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -296,6 +296,11 @@ export enum DICT_TYPE {
|
||||||
MES_WM_ITEM_RECEIPT_STATUS = 'mes_wm_item_receipt_status', // MES 物料接收单状态
|
MES_WM_ITEM_RECEIPT_STATUS = 'mes_wm_item_receipt_status', // MES 物料接收单状态
|
||||||
MES_WM_TRANSFER_STATUS = 'mes_wm_transfer_status', // MES 转移单状态
|
MES_WM_TRANSFER_STATUS = 'mes_wm_transfer_status', // MES 转移单状态
|
||||||
MES_WM_TRANSFER_TYPE = 'mes_wm_transfer_type', // MES 转移单类型
|
MES_WM_TRANSFER_TYPE = 'mes_wm_transfer_type', // MES 转移单类型
|
||||||
|
MES_WM_STOCK_TAKING_TYPE = 'mes_wm_stock_taking_type', // MES 盘点类型
|
||||||
|
MES_WM_STOCK_TAKING_PLAN_STATUS = 'mes_wm_stock_taking_plan_status', // MES 盘点方案状态
|
||||||
|
MES_WM_STOCK_TAKING_TASK_STATUS = 'mes_wm_stock_taking_task_status', // MES 盘点任务状态
|
||||||
|
MES_WM_STOCK_TAKING_LINE_STATUS = 'mes_wm_stock_taking_task_line_status', // MES 盘点任务行状态
|
||||||
|
MES_WM_STOCK_TAKING_PARAM_TYPE = 'mes_wm_stock_taking_param_type', // MES 盘点方案参数类型
|
||||||
MES_WM_OUTSOURCE_RECPT_STATUS = 'mes_wm_outsource_recpt_status', // MES 外协入库单状态
|
MES_WM_OUTSOURCE_RECPT_STATUS = 'mes_wm_outsource_recpt_status', // MES 外协入库单状态
|
||||||
MES_WM_PRODUCTION_ISSUE_STATUS = 'mes_wm_production_issue_status', // MES 领料出库单状态
|
MES_WM_PRODUCTION_ISSUE_STATUS = 'mes_wm_production_issue_status', // MES 领料出库单状态
|
||||||
MES_PRODUCT_PRODUCE_STATUS = 'mes_product_produce_status', // MES 生产入库单状态
|
MES_PRODUCT_PRODUCE_STATUS = 'mes_product_produce_status', // MES 生产入库单状态
|
||||||
|
|
|
||||||
|
|
@ -228,6 +228,44 @@ export const MesWmOutsourceReceiptStatusEnum = {
|
||||||
CANCELED: MesOrderStatusConstants.CANCELLED
|
CANCELED: MesOrderStatusConstants.CANCELLED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** MES 盘点类型枚举 */
|
||||||
|
export const MesWmStockTakingTypeEnum = {
|
||||||
|
OPEN: 1,
|
||||||
|
CYCLE: 2,
|
||||||
|
DYNAMIC: 3
|
||||||
|
}
|
||||||
|
|
||||||
|
/** MES 盘点方案状态枚举 */
|
||||||
|
export const MesWmStockTakingPlanStatusEnum = {
|
||||||
|
PREPARE: MesOrderStatusConstants.DRAFT,
|
||||||
|
CONFIRMED: MesOrderStatusConstants.CONFIRMED
|
||||||
|
}
|
||||||
|
|
||||||
|
/** MES 盘点任务状态枚举 */
|
||||||
|
export const MesWmStockTakingTaskStatusEnum = {
|
||||||
|
PREPARE: MesOrderStatusConstants.DRAFT,
|
||||||
|
IN_PROGRESS: MesOrderStatusConstants.CONFIRMED,
|
||||||
|
FINISHED: MesOrderStatusConstants.FINISHED,
|
||||||
|
CANCELED: MesOrderStatusConstants.CANCELLED
|
||||||
|
}
|
||||||
|
|
||||||
|
/** MES 盘点任务行状态枚举 */
|
||||||
|
export const MesWmStockTakingTaskLineStatusEnum = {
|
||||||
|
UNCOUNTED: 0,
|
||||||
|
NORMAL: 1,
|
||||||
|
GAIN: 2,
|
||||||
|
LOSS: 3
|
||||||
|
}
|
||||||
|
|
||||||
|
/** MES 盘点方案参数类型枚举 */
|
||||||
|
export const MesWmStockTakingParamTypeEnum = {
|
||||||
|
WAREHOUSE: 1,
|
||||||
|
LOCATION: 2,
|
||||||
|
AREA: 3,
|
||||||
|
ITEM: 4,
|
||||||
|
BATCH: 5
|
||||||
|
}
|
||||||
|
|
||||||
/** MES 外协入库单状态枚举 */
|
/** MES 外协入库单状态枚举 */
|
||||||
export const MesWmOutsourceRecptStatusEnum = {
|
export const MesWmOutsourceRecptStatusEnum = {
|
||||||
PREPARE: MesOrderStatusConstants.DRAFT,
|
PREPARE: MesOrderStatusConstants.DRAFT,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,220 @@
|
||||||
|
<!-- TODO @AI:一行 3 个; -->
|
||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible" width="1100px">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="110px"
|
||||||
|
v-loading="formLoading"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="方案编码" prop="code">
|
||||||
|
<el-input v-model="formData.code" placeholder="请输入方案编码" :disabled="isReadonly">
|
||||||
|
<template #append>
|
||||||
|
<el-button @click="generateCode" :disabled="formType !== 'create'">生成</el-button>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="方案名称" prop="name">
|
||||||
|
<el-input v-model="formData.name" placeholder="请输入方案名称" :disabled="isReadonly" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="盘点类型" prop="type">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.type"
|
||||||
|
placeholder="请选择盘点类型"
|
||||||
|
class="!w-full"
|
||||||
|
:disabled="isReadonly"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.MES_WM_STOCK_TAKING_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="开始时间" prop="startTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.startTime"
|
||||||
|
type="datetime"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
placeholder="请选择开始时间"
|
||||||
|
class="!w-full"
|
||||||
|
:disabled="isReadonly"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="结束时间" prop="endTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.endTime"
|
||||||
|
type="datetime"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
placeholder="请选择结束时间"
|
||||||
|
class="!w-full"
|
||||||
|
:disabled="isReadonly"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="是否盲盘" prop="blindFlag">
|
||||||
|
<el-switch v-model="formData.blindFlag" :disabled="isReadonly" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="冻结库存" prop="frozenFlag">
|
||||||
|
<el-switch v-model="formData.frozenFlag" :disabled="isReadonly" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="启用" prop="enableFlag">
|
||||||
|
<el-switch v-model="formData.enableFlag" :disabled="isReadonly" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input
|
||||||
|
v-model="formData.remark"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
:disabled="isReadonly"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-divider content-position="center">盘点参数</el-divider>
|
||||||
|
<!-- TODO @AI:类似别的模块,不用放在 components 里;类似 /Users/yunai/Java/yudao-all-in-one/yudao-ui-admin-vue3/src/views/mes/wm/salesnotice/SalesNoticeForm.vue -->
|
||||||
|
<StockTakingParamTable v-model="formData.params" :disabled="isReadonly" />
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<el-button v-if="!isReadonly" @click="submitForm" type="primary" :disabled="formLoading">
|
||||||
|
确 定
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { generateRandomStr } from '@/utils'
|
||||||
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
|
import { StockTakingPlanApi, type StockTakingPlanVO } from '@/api/mes/wm/stocktaking/plan'
|
||||||
|
import StockTakingParamTable from './components/StockTakingParamTable.vue'
|
||||||
|
|
||||||
|
// TODO @AI:注释风格,参考:/Users/yunai/Java/yudao-all-in-one/yudao-ui-admin-vue3/src/views/mes/wm/salesnotice/SalesNoticeForm.vue
|
||||||
|
|
||||||
|
defineOptions({ name: 'StockTakingPlanForm' })
|
||||||
|
|
||||||
|
const emit = defineEmits(['success'])
|
||||||
|
const message = useMessage()
|
||||||
|
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const formLoading = ref(false)
|
||||||
|
const formType = ref('create')
|
||||||
|
const formRef = ref()
|
||||||
|
const formData = ref<StockTakingPlanVO>({
|
||||||
|
id: undefined,
|
||||||
|
code: undefined,
|
||||||
|
name: undefined,
|
||||||
|
type: undefined,
|
||||||
|
startTime: undefined,
|
||||||
|
endTime: undefined,
|
||||||
|
blindFlag: false,
|
||||||
|
frozenFlag: false,
|
||||||
|
enableFlag: true,
|
||||||
|
remark: undefined,
|
||||||
|
params: []
|
||||||
|
})
|
||||||
|
|
||||||
|
const formRules = reactive({
|
||||||
|
code: [{ required: true, message: '方案编码不能为空', trigger: 'blur' }],
|
||||||
|
name: [{ required: true, message: '方案名称不能为空', trigger: 'blur' }],
|
||||||
|
type: [{ required: true, message: '盘点类型不能为空', trigger: 'change' }]
|
||||||
|
})
|
||||||
|
|
||||||
|
const isReadonly = computed(() => formType.value === 'detail')
|
||||||
|
const dialogTitle = computed(() => {
|
||||||
|
const titles = {
|
||||||
|
create: '新增盘点方案',
|
||||||
|
update: '编辑盘点方案',
|
||||||
|
detail: '盘点方案详情'
|
||||||
|
}
|
||||||
|
return titles[formType.value] || formType.value
|
||||||
|
})
|
||||||
|
|
||||||
|
const generateCode = () => {
|
||||||
|
formData.value.code = 'STP' + generateRandomStr(10)
|
||||||
|
}
|
||||||
|
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
code: undefined,
|
||||||
|
name: undefined,
|
||||||
|
type: undefined,
|
||||||
|
startTime: undefined,
|
||||||
|
endTime: undefined,
|
||||||
|
blindFlag: false,
|
||||||
|
frozenFlag: false,
|
||||||
|
enableFlag: true,
|
||||||
|
remark: undefined,
|
||||||
|
params: []
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
|
||||||
|
const open = async (type: string, id?: number) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
formType.value = type
|
||||||
|
resetForm()
|
||||||
|
if (id) {
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
const data = await StockTakingPlanApi.getStockTakingPlan(id)
|
||||||
|
formData.value = {
|
||||||
|
...data,
|
||||||
|
params: data.params || []
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
defineExpose({ open })
|
||||||
|
|
||||||
|
const submitForm = async () => {
|
||||||
|
await formRef.value.validate()
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
// TODO @AI:这里看着过于复杂,看看怎么简化下;
|
||||||
|
const data = {
|
||||||
|
...formData.value,
|
||||||
|
params: (formData.value.params || []).filter(
|
||||||
|
(item) => item.type && item.valueId !== undefined && item.valueId !== ''
|
||||||
|
)
|
||||||
|
} as StockTakingPlanVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
const id = await StockTakingPlanApi.createStockTakingPlan(data)
|
||||||
|
message.success('新增成功')
|
||||||
|
formData.value.id = id
|
||||||
|
formType.value = 'update'
|
||||||
|
} else {
|
||||||
|
await StockTakingPlanApi.updateStockTakingPlan(data)
|
||||||
|
message.success('修改成功')
|
||||||
|
}
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,182 @@
|
||||||
|
<!-- TODO @芋艿:这里需要在 review 下; -->
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="mb-12px flex items-center justify-between">
|
||||||
|
<span class="text-14px font-500">盘点范围参数</span>
|
||||||
|
<el-button type="primary" plain @click="handleAdd" :disabled="disabled">
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 添加参数
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table :data="rows" border :show-overflow-tooltip="true" empty-text="暂无参数">
|
||||||
|
<el-table-column label="参数类型" min-width="160">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-select
|
||||||
|
v-model="scope.row.type"
|
||||||
|
placeholder="请选择参数类型"
|
||||||
|
class="!w-full"
|
||||||
|
:disabled="disabled"
|
||||||
|
@change="handleTypeChange(scope.row)"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.MES_WM_STOCK_TAKING_PARAM_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="参数值" min-width="280">
|
||||||
|
<template #default="scope">
|
||||||
|
<template v-if="scope.row.type === MesWmStockTakingParamTypeEnum.WAREHOUSE">
|
||||||
|
<WmWarehouseSelect
|
||||||
|
v-model="scope.row.valueId"
|
||||||
|
:disabled="disabled"
|
||||||
|
@change="(item) => handleSelectorChange(scope.row, item)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.type === MesWmStockTakingParamTypeEnum.LOCATION">
|
||||||
|
<WmWarehouseLocationSelect
|
||||||
|
v-model="scope.row.valueId"
|
||||||
|
:disabled="disabled"
|
||||||
|
@change="(item) => handleSelectorChange(scope.row, item)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.type === MesWmStockTakingParamTypeEnum.AREA">
|
||||||
|
<WmWarehouseAreaSelect
|
||||||
|
v-model="scope.row.valueId"
|
||||||
|
:disabled="disabled"
|
||||||
|
@change="(item) => handleSelectorChange(scope.row, item)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="scope.row.type === MesWmStockTakingParamTypeEnum.ITEM">
|
||||||
|
<MdItemSelect
|
||||||
|
v-model="scope.row.valueId"
|
||||||
|
:disabled="disabled"
|
||||||
|
@change="(item) => handleSelectorChange(scope.row, item)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-row :gutter="8">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-input
|
||||||
|
v-model="scope.row.valueId"
|
||||||
|
placeholder="值ID"
|
||||||
|
:disabled="disabled"
|
||||||
|
@change="handleManualChange(scope.row)"
|
||||||
|
/>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-input
|
||||||
|
v-model="scope.row.valueCode"
|
||||||
|
placeholder="值编码"
|
||||||
|
:disabled="disabled"
|
||||||
|
@change="handleManualChange(scope.row)"
|
||||||
|
/>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-input
|
||||||
|
v-model="scope.row.valueName"
|
||||||
|
placeholder="值名称"
|
||||||
|
:disabled="disabled"
|
||||||
|
@change="handleManualChange(scope.row)"
|
||||||
|
/>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="备注" min-width="180">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-input v-model="scope.row.remark" placeholder="请输入备注" :disabled="disabled" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" width="100" fixed="right">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button link type="danger" :disabled="disabled" @click="handleDelete(scope.$index)">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
|
import { MesWmStockTakingParamTypeEnum } from '@/views/mes/utils/constants'
|
||||||
|
import type { StockTakingPlanParamVO } from '@/api/mes/wm/stocktaking/plan'
|
||||||
|
import WmWarehouseSelect from '@/views/mes/wm/warehouse/components/WmWarehouseSelect.vue'
|
||||||
|
import WmWarehouseLocationSelect from '@/views/mes/wm/warehouse/components/WmWarehouseLocationSelect.vue'
|
||||||
|
import WmWarehouseAreaSelect from '@/views/mes/wm/warehouse/components/WmWarehouseAreaSelect.vue'
|
||||||
|
import MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue'
|
||||||
|
|
||||||
|
interface ParamRow extends StockTakingPlanParamVO {
|
||||||
|
valueId?: number | string
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
modelValue?: ParamRow[]
|
||||||
|
disabled?: boolean
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
modelValue: () => [],
|
||||||
|
disabled: false
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
'update:modelValue': [value: ParamRow[]]
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const rows = computed({
|
||||||
|
get: () => props.modelValue || [],
|
||||||
|
set: (value) => emit('update:modelValue', value)
|
||||||
|
})
|
||||||
|
|
||||||
|
const handleUpdate = () => {
|
||||||
|
rows.value = [...rows.value]
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleAdd = () => {
|
||||||
|
rows.value = [
|
||||||
|
...rows.value,
|
||||||
|
{
|
||||||
|
type: MesWmStockTakingParamTypeEnum.WAREHOUSE,
|
||||||
|
valueId: undefined,
|
||||||
|
valueCode: '',
|
||||||
|
valueName: '',
|
||||||
|
remark: ''
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleDelete = (index: number) => {
|
||||||
|
const list = [...rows.value]
|
||||||
|
list.splice(index, 1)
|
||||||
|
rows.value = list
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleTypeChange = (row: ParamRow) => {
|
||||||
|
row.valueId = undefined
|
||||||
|
row.valueCode = ''
|
||||||
|
row.valueName = ''
|
||||||
|
handleUpdate()
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSelectorChange = (row: ParamRow, item?: any) => {
|
||||||
|
row.valueId = item?.id
|
||||||
|
row.valueCode = item?.code || ''
|
||||||
|
row.valueName = item?.name || item?.nickname || ''
|
||||||
|
handleUpdate()
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleManualChange = (row: ParamRow) => {
|
||||||
|
if (row.valueId !== undefined && row.valueId !== null && row.valueId !== '') {
|
||||||
|
const num = Number(row.valueId)
|
||||||
|
row.valueId = Number.isNaN(num) ? row.valueId : num
|
||||||
|
}
|
||||||
|
handleUpdate()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,309 @@
|
||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<el-form
|
||||||
|
ref="queryFormRef"
|
||||||
|
:model="queryParams"
|
||||||
|
:inline="true"
|
||||||
|
label-width="100px"
|
||||||
|
class="-mb-15px"
|
||||||
|
>
|
||||||
|
<el-form-item label="方案编码" prop="code">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.code"
|
||||||
|
placeholder="请输入方案编码"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="方案名称" prop="name">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.name"
|
||||||
|
placeholder="请输入方案名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="盘点类型" prop="type">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.type"
|
||||||
|
placeholder="请选择盘点类型"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.MES_WM_STOCK_TAKING_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- TODO @AI:前后端都去掉 status 筛选; -->
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.MES_WM_STOCK_TAKING_PLAN_STATUS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- TODO @AI:前后端都去掉 enableFlag 筛选; -->
|
||||||
|
<el-form-item label="启用状态" prop="enableFlag">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.enableFlag"
|
||||||
|
placeholder="请选择启用状态"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="启用" :value="true" />
|
||||||
|
<el-option label="停用" :value="false" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||||
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
@click="openForm('create')"
|
||||||
|
v-hasPermi="['mes:wm-stocktaking-plan:create']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
@click="handleExport"
|
||||||
|
:loading="exportLoading"
|
||||||
|
v-hasPermi="['mes:wm-stocktaking-plan:export']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<ContentWrap>
|
||||||
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||||
|
<el-table-column label="方案编码" align="center" prop="code" min-width="160">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button link type="primary" @click="openForm('detail', scope.row.id)">
|
||||||
|
{{ scope.row.code }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="方案名称" align="center" prop="name" min-width="160" />
|
||||||
|
<el-table-column label="盘点类型" align="center" prop="type" min-width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.MES_WM_STOCK_TAKING_TYPE" :value="scope.row.type" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="开始时间" align="center" prop="startTime" min-width="180" />
|
||||||
|
<el-table-column label="结束时间" align="center" prop="endTime" min-width="180" />
|
||||||
|
<el-table-column label="是否盲盘" align="center" prop="blindFlag" width="100">
|
||||||
|
<!-- TODO @AI: booleanstring 数据字典 -->
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tag :type="scope.row.blindFlag ? 'warning' : 'success'">
|
||||||
|
{{ scope.row.blindFlag ? '是' : '否' }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="是否冻结库存" align="center" prop="frozenFlag" width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<!-- TODO @AI: booleanstring 数据字典 -->
|
||||||
|
<el-tag :type="scope.row.frozenFlag ? 'warning' : 'info'">
|
||||||
|
{{ scope.row.frozenFlag ? '是' : '否' }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- TODO @AI:enableFlag 和 status 融合了 -->
|
||||||
|
<el-table-column label="启用" align="center" prop="enableFlag" width="90">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tag :type="scope.row.enableFlag ? 'success' : 'info'">
|
||||||
|
{{ scope.row.enableFlag ? '启用' : '停用' }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="状态" align="center" prop="status" min-width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.MES_WM_STOCK_TAKING_PLAN_STATUS" :value="scope.row.status" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" width="340" fixed="right">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
v-if="scope.row.status === MesWmStockTakingPlanStatusEnum.PREPARE"
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['mes:wm-stocktaking-plan:update']"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<!-- TODO @AI:去掉“确认”操作了; -->
|
||||||
|
<el-button
|
||||||
|
v-if="scope.row.status === MesWmStockTakingPlanStatusEnum.PREPARE"
|
||||||
|
link
|
||||||
|
type="warning"
|
||||||
|
@click="handleConfirm(scope.row.id)"
|
||||||
|
v-hasPermi="['mes:wm-stocktaking-plan:update']"
|
||||||
|
>
|
||||||
|
确认
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="scope.row.status === MesWmStockTakingPlanStatusEnum.PREPARE"
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['mes:wm-stocktaking-plan:delete']"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
<!-- TODO @AI:前后端都去嗲哦这个操作;不需要; -->
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="success"
|
||||||
|
@click="handleGenerate(scope.row)"
|
||||||
|
v-hasPermi="['mes:wm-stocktaking-task:create']"
|
||||||
|
>
|
||||||
|
生成任务
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<StockTakingPlanForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ElMessageBox } from 'element-plus'
|
||||||
|
import { useUserStore } from '@/store/modules/user'
|
||||||
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import {
|
||||||
|
StockTakingPlanApi,
|
||||||
|
type StockTakingPlanGenerateReqVO,
|
||||||
|
type StockTakingPlanVO
|
||||||
|
} from '@/api/mes/wm/stocktaking/plan'
|
||||||
|
import { MesWmStockTakingPlanStatusEnum } from '@/views/mes/utils/constants'
|
||||||
|
import StockTakingPlanForm from './StockTakingPlanForm.vue'
|
||||||
|
|
||||||
|
// TODO @AI:注释参考 /Users/yunai/Java/yudao-all-in-one/yudao-ui-admin-vue3/src/views/system/user/index.vue
|
||||||
|
|
||||||
|
defineOptions({ name: 'MesWmStockTakingPlan' })
|
||||||
|
|
||||||
|
const message = useMessage()
|
||||||
|
const { t } = useI18n()
|
||||||
|
const userStore = useUserStore()
|
||||||
|
|
||||||
|
const loading = ref(true)
|
||||||
|
const list = ref<StockTakingPlanVO[]>([])
|
||||||
|
const total = ref(0)
|
||||||
|
const exportLoading = ref(false)
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
code: undefined,
|
||||||
|
name: undefined,
|
||||||
|
type: undefined,
|
||||||
|
status: undefined,
|
||||||
|
enableFlag: undefined
|
||||||
|
})
|
||||||
|
const queryFormRef = ref()
|
||||||
|
const formRef = ref()
|
||||||
|
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await StockTakingPlanApi.getStockTakingPlanPage(queryParams)
|
||||||
|
list.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.pageNo = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value.resetFields()
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
|
||||||
|
const openForm = (type: string, id?: number) => {
|
||||||
|
formRef.value.open(type, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleConfirm = async (id: number) => {
|
||||||
|
try {
|
||||||
|
await message.confirm('确认该盘点方案后将不可再修改关键内容,是否继续?')
|
||||||
|
await StockTakingPlanApi.confirmStockTakingPlan(id)
|
||||||
|
message.success('确认成功')
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
await message.delConfirm()
|
||||||
|
await StockTakingPlanApi.deleteStockTakingPlan(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleGenerate = async (row: StockTakingPlanVO) => {
|
||||||
|
try {
|
||||||
|
const plan = await StockTakingPlanApi.getStockTakingPlan(row.id!)
|
||||||
|
const codeResult = await ElMessageBox.prompt('请输入任务编码', '生成盘点任务', {
|
||||||
|
inputValue: `ST${Date.now()}`,
|
||||||
|
inputValidator: (value) => !!value || '任务编码不能为空'
|
||||||
|
})
|
||||||
|
const nameResult = await ElMessageBox.prompt('请输入任务名称', '生成盘点任务', {
|
||||||
|
inputValue: `${row.name || row.code}-任务`,
|
||||||
|
inputValidator: (value) => !!value || '任务名称不能为空'
|
||||||
|
})
|
||||||
|
const reqVO: StockTakingPlanGenerateReqVO = {
|
||||||
|
planId: row.id!,
|
||||||
|
code: codeResult.value,
|
||||||
|
name: nameResult.value,
|
||||||
|
takingDate: row.startTime,
|
||||||
|
userId: userStore.getUser.id,
|
||||||
|
remark: row.remark,
|
||||||
|
params: plan.params
|
||||||
|
}
|
||||||
|
await StockTakingPlanApi.generateStockTakingTask(reqVO)
|
||||||
|
message.success('生成任务成功')
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
await message.exportConfirm()
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await StockTakingPlanApi.exportStockTakingPlan(queryParams)
|
||||||
|
download.excel(data, '盘点方案.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue