✨ feat(mes): 移除单位编号字段,优化工单请求参数
parent
fb8b459182
commit
1e5f56b54b
|
|
@ -12,7 +12,6 @@ export interface ProWorkOrderVO {
|
|||
productName: string // 产品名称
|
||||
productCode: string // 产品编码
|
||||
productSpec: string // 规格型号
|
||||
unitMeasureId: number // 单位编号
|
||||
unitMeasureName: string // 单位名称
|
||||
quantity: number // 生产数量
|
||||
quantityProduced: number // 已生产数量
|
||||
|
|
|
|||
|
|
@ -87,8 +87,7 @@ const props = defineProps<{
|
|||
disabled?: boolean
|
||||
}>()
|
||||
|
||||
// generate-work-order:通知 WorkOrderForm 用 BOM 行的物料作为产品,新建子工单
|
||||
const emit = defineEmits(['generate-work-order'])
|
||||
const emit = defineEmits(['generate-work-order']) // generate-work-order:通知 WorkOrderForm 用 BOM 行的物料作为产品,新建子工单
|
||||
|
||||
const message = useMessage()
|
||||
const { t } = useI18n()
|
||||
|
|
@ -179,7 +178,7 @@ const submitForm = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
// ==================== 初始化 ====================
|
||||
/** 初始化 **/
|
||||
onMounted(async () => {
|
||||
await getBomList()
|
||||
})
|
||||
|
|
|
|||
|
|
@ -77,7 +77,6 @@
|
|||
<MdItemSelect
|
||||
v-model="formData.productId"
|
||||
:disabled="isDetail"
|
||||
@change="handleProductChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
@ -175,7 +174,6 @@
|
|||
<script setup lang="ts">
|
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { ProWorkOrderApi, ProWorkOrderVO } from '@/api/mes/pro/workorder'
|
||||
import { MdItemVO } from '@/api/mes/md/item'
|
||||
import { generateRandomStr } from '@/utils'
|
||||
import MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue'
|
||||
import MdClientSelect from '@/views/mes/md/client/components/MdClientSelect.vue'
|
||||
|
|
@ -203,7 +201,6 @@ const formData = ref({
|
|||
orderSourceType: undefined,
|
||||
orderSourceCode: undefined,
|
||||
productId: undefined,
|
||||
unitMeasureId: undefined,
|
||||
quantity: undefined,
|
||||
clientId: undefined,
|
||||
vendorId: undefined,
|
||||
|
|
@ -234,7 +231,11 @@ const generateCode = () => {
|
|||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number, parentRow?: any) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = parentRow ? '新增子工单' : type === 'detail' ? '工单详情' : t('action.' + type)
|
||||
dialogTitle.value = parentRow
|
||||
? '新增子工单'
|
||||
: type === 'detail'
|
||||
? '工单详情'
|
||||
: t('action.' + type)
|
||||
formType.value = type
|
||||
activeTab.value = 'bom'
|
||||
resetForm()
|
||||
|
|
@ -277,19 +278,11 @@ const handleGenerateWorkOrder = (bomRow: any) => {
|
|||
formData.value.vendorId = currentWorkOrder.vendorId
|
||||
formData.value.requestDate = currentWorkOrder.requestDate
|
||||
formData.value.productId = bomRow.itemId
|
||||
formData.value.unitMeasureId = bomRow.unitMeasureId
|
||||
formData.value.quantity = bomRow.quantity
|
||||
}
|
||||
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 产品变更:自动填充单位 */
|
||||
const handleProductChange = (product: MdItemVO) => {
|
||||
if (product?.unitMeasureId) {
|
||||
formData.value.unitMeasureId = product.unitMeasureId
|
||||
}
|
||||
}
|
||||
|
||||
/** 工单来源变更:非客户订单时清空来源单据编号 */
|
||||
watch(
|
||||
() => formData.value.orderSourceType,
|
||||
|
|
@ -342,7 +335,6 @@ const resetForm = () => {
|
|||
orderSourceType: undefined,
|
||||
orderSourceCode: undefined,
|
||||
productId: undefined,
|
||||
unitMeasureId: undefined,
|
||||
quantity: undefined,
|
||||
clientId: undefined,
|
||||
vendorId: undefined,
|
||||
|
|
|
|||
|
|
@ -95,7 +95,13 @@
|
|||
default-expand-all
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
>
|
||||
<el-table-column label="工单编码" align="center" prop="code" width="140" />
|
||||
<el-table-column label="工单编码" prop="code" width="220" fixed="left">
|
||||
<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="150" />
|
||||
<el-table-column label="工单类型" align="center" prop="type" width="100">
|
||||
<template #default="scope">
|
||||
|
|
@ -140,7 +146,7 @@
|
|||
:formatter="dateFormatter"
|
||||
width="180"
|
||||
/>
|
||||
<el-table-column label="操作" align="center" width="240" fixed="right">
|
||||
<el-table-column label="操作" align="center" width="200" fixed="right">
|
||||
<template #default="scope">
|
||||
<!-- 草稿状态:编辑、确认、删除 -->
|
||||
<template v-if="scope.row.status === MesProWorkOrderStatusEnum.PREPARE">
|
||||
|
|
@ -201,15 +207,6 @@
|
|||
取消
|
||||
</el-button>
|
||||
</template>
|
||||
<!-- 所有状态:详情 -->
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('detail', scope.row.id)"
|
||||
v-hasPermi="['mes:pro-work-order:query']"
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
<!-- 工单条码 -->
|
||||
<!-- TODO @芋艿:这里应该是打印;后面在跟进把; -->
|
||||
<el-button
|
||||
|
|
|
|||
Loading…
Reference in New Issue