✨ feat(mes): 新增盘点方案编码和任务编码常量,更新错误码提示
新增盘点方案编码和盘点任务编码常量,以支持新的盘点功能。同时,更新相关错误码提示,确保用户在操作时获得准确的信息。pull/871/MERGE
parent
03bc24d3f7
commit
abe63d39db
|
|
@ -441,6 +441,8 @@ export const MesAutoCodeRuleCode = {
|
||||||
WM_PRODUCT_SALES_CODE: 'WM_PRODUCT_SALES_CODE', // 销售出库单编码
|
WM_PRODUCT_SALES_CODE: 'WM_PRODUCT_SALES_CODE', // 销售出库单编码
|
||||||
WM_MISC_ISSUE_CODE: 'WM_MISC_ISSUE_CODE', // 杂项出库单编码
|
WM_MISC_ISSUE_CODE: 'WM_MISC_ISSUE_CODE', // 杂项出库单编码
|
||||||
WM_MISC_RECEIPT_CODE: 'WM_MISC_RECEIPT_CODE', // 杂项入库单编码
|
WM_MISC_RECEIPT_CODE: 'WM_MISC_RECEIPT_CODE', // 杂项入库单编码
|
||||||
|
WM_STOCK_TAKING_PLAN_CODE: 'WM_STOCK_TAKING_PLAN_CODE', // 盘点方案编码
|
||||||
|
WM_STOCK_TAKING_CODE: 'WM_STOCK_TAKING_CODE', // 盘点任务编码
|
||||||
TRANSFER_CODE: 'TRANSFER_CODE' // 转移调拨单编码
|
TRANSFER_CODE: 'TRANSFER_CODE' // 转移调拨单编码
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,10 +86,10 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<!-- 编辑时展示盘点参数 -->
|
<!-- 编辑或详情时展示盘点参数 -->
|
||||||
<template v-if="formType === 'update' && formData.id">
|
<template v-if="(formType === 'update' || formType === 'detail') && formData.id">
|
||||||
<el-divider content-position="center">盘点参数</el-divider>
|
<el-divider content-position="center">盘点参数</el-divider>
|
||||||
<StockTakingPlanParamList :plan-id="formData.id" />
|
<StockTakingPlanParamList :plan-id="formData.id" :disabled="formType === 'detail'" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
|
@ -102,11 +102,11 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { generateRandomStr } from '@/utils'
|
|
||||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
|
import { AutoCodeRecordApi } from '@/api/mes/md/autocode/record'
|
||||||
import { StockTakingPlanApi, type StockTakingPlanVO } from '@/api/mes/wm/stocktaking/plan/index'
|
import { StockTakingPlanApi, type StockTakingPlanVO } from '@/api/mes/wm/stocktaking/plan/index'
|
||||||
import StockTakingPlanParamList from './StockTakingPlanParamList.vue'
|
import StockTakingPlanParamList from './StockTakingPlanParamList.vue'
|
||||||
import { MesWmStockTakingTypeEnum } from '@/views/mes/utils/constants'
|
import { MesAutoCodeRuleCode, MesWmStockTakingTypeEnum } from '@/views/mes/utils/constants'
|
||||||
|
|
||||||
defineOptions({ name: 'StockTakingPlanForm' })
|
defineOptions({ name: 'StockTakingPlanForm' })
|
||||||
|
|
||||||
|
|
@ -115,6 +115,9 @@ const message = useMessage() // 消息弹窗
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const formType = ref('create') // 表单的类型:create - 新增;update - 修改;detail - 详情
|
||||||
|
const isDetail = computed(() => formType.value === 'detail') // 是否只读
|
||||||
const dialogTitle = computed(() => {
|
const dialogTitle = computed(() => {
|
||||||
const titles = {
|
const titles = {
|
||||||
create: '新增盘点方案',
|
create: '新增盘点方案',
|
||||||
|
|
@ -123,10 +126,6 @@ const dialogTitle = computed(() => {
|
||||||
}
|
}
|
||||||
return titles[formType.value] || formType.value
|
return titles[formType.value] || formType.value
|
||||||
}) // 弹窗的标题
|
}) // 弹窗的标题
|
||||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
|
||||||
const formType = ref('create') // 表单的类型:create - 新增;update - 修改;detail - 详情
|
|
||||||
const isDetail = computed(() => formType.value === 'detail') // 是否只读
|
|
||||||
const formRef = ref() // 表单 Ref
|
|
||||||
const formData = ref<StockTakingPlanVO>({
|
const formData = ref<StockTakingPlanVO>({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
code: undefined,
|
code: undefined,
|
||||||
|
|
@ -143,10 +142,13 @@ const formRules = reactive({
|
||||||
name: [{ required: true, message: '方案名称不能为空', trigger: 'blur' }],
|
name: [{ required: true, message: '方案名称不能为空', trigger: 'blur' }],
|
||||||
type: [{ required: true, message: '盘点类型不能为空', trigger: 'change' }]
|
type: [{ required: true, message: '盘点类型不能为空', trigger: 'change' }]
|
||||||
})
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
/** 生成方案编码 */
|
/** 生成方案编码 */
|
||||||
const generateCode = () => {
|
const generateCode = async () => {
|
||||||
formData.value.code = 'STP' + generateRandomStr(10)
|
formData.value.code = await AutoCodeRecordApi.generateAutoCode(
|
||||||
|
MesAutoCodeRuleCode.WM_STOCK_TAKING_PLAN_CODE
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
|
|
|
||||||
|
|
@ -116,24 +116,40 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" width="220" fixed="right">
|
<el-table-column label="操作" align="center" width="220" fixed="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-tooltip
|
||||||
v-if="scope.row.status === CommonStatusEnum.DISABLE"
|
:disabled="scope.row.status === CommonStatusEnum.DISABLE"
|
||||||
link
|
content="仅关闭状态,才可以操作"
|
||||||
type="primary"
|
placement="top"
|
||||||
@click="openForm('update', scope.row.id)"
|
|
||||||
v-hasPermi="['mes:wm-stock-taking-plan:update']"
|
|
||||||
>
|
>
|
||||||
编辑
|
<span class="inline-block cursor-not-allowed">
|
||||||
</el-button>
|
<el-button
|
||||||
<el-button
|
link
|
||||||
v-if="scope.row.status === CommonStatusEnum.DISABLE"
|
type="primary"
|
||||||
link
|
@click="openForm('update', scope.row.id)"
|
||||||
type="danger"
|
v-hasPermi="['mes:wm-stock-taking-plan:update']"
|
||||||
@click="handleDelete(scope.row.id)"
|
:disabled="scope.row.status !== CommonStatusEnum.DISABLE"
|
||||||
v-hasPermi="['mes:wm-stock-taking-plan:delete']"
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</el-tooltip>
|
||||||
|
<el-tooltip
|
||||||
|
:disabled="scope.row.status === CommonStatusEnum.DISABLE"
|
||||||
|
content="仅关闭状态,才可以操作"
|
||||||
|
placement="top"
|
||||||
>
|
>
|
||||||
删除
|
<span class="inline-block cursor-not-allowed ml-10px">
|
||||||
</el-button>
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['mes:wm-stock-taking-plan:delete']"
|
||||||
|
:disabled="scope.row.status !== CommonStatusEnum.DISABLE"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -163,8 +179,9 @@ const message = useMessage() // 消息弹窗
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
const loading = ref(true) // 列表的加载中
|
const loading = ref(true) // 列表的加载中
|
||||||
const total = ref(0) // 列表的总页数
|
|
||||||
const list = ref<StockTakingPlanVO[]>([]) // 列表的数据
|
const list = ref<StockTakingPlanVO[]>([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
|
@ -173,6 +190,7 @@ const queryParams = reactive({
|
||||||
type: undefined
|
type: undefined
|
||||||
})
|
})
|
||||||
const queryFormRef = ref() // 搜索的表单
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const formRef = ref() // 表单弹窗
|
||||||
|
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
|
|
@ -199,7 +217,6 @@ const resetQuery = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 添加/修改操作 */
|
/** 添加/修改操作 */
|
||||||
const formRef = ref()
|
|
||||||
const openForm = (type: string, id?: number) => {
|
const openForm = (type: string, id?: number) => {
|
||||||
formRef.value.open(type, id)
|
formRef.value.open(type, id)
|
||||||
}
|
}
|
||||||
|
|
@ -222,23 +239,17 @@ const handleStatusChange = async (row: StockTakingPlanVO) => {
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
const handleDelete = async (id: number) => {
|
const handleDelete = async (id: number) => {
|
||||||
try {
|
try {
|
||||||
// 删除的二次确认
|
|
||||||
await message.delConfirm()
|
await message.delConfirm()
|
||||||
// 发起删除
|
|
||||||
await StockTakingPlanApi.deleteStockTakingPlan(id)
|
await StockTakingPlanApi.deleteStockTakingPlan(id)
|
||||||
message.success(t('common.delSuccess'))
|
message.success(t('common.delSuccess'))
|
||||||
// 刷新列表
|
|
||||||
await getList()
|
await getList()
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
const exportLoading = ref(false)
|
|
||||||
const handleExport = async () => {
|
const handleExport = async () => {
|
||||||
try {
|
try {
|
||||||
// 导出的二次确认
|
|
||||||
await message.exportConfirm()
|
await message.exportConfirm()
|
||||||
// 发起导出
|
|
||||||
exportLoading.value = true
|
exportLoading.value = true
|
||||||
const data = await StockTakingPlanApi.exportStockTakingPlan(queryParams)
|
const data = await StockTakingPlanApi.exportStockTakingPlan(queryParams)
|
||||||
download.excel(data, '盘点方案.xls')
|
download.excel(data, '盘点方案.xls')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue