♻️ refactor(mes): 移除流转卡相关的状态和时间字段,简化请求和响应对象
parent
478268f9c9
commit
4b08ee3d97
|
|
@ -12,11 +12,8 @@ export interface ProCardVO {
|
||||||
itemCode: string // 产品编码
|
itemCode: string // 产品编码
|
||||||
itemName: string // 产品名称
|
itemName: string // 产品名称
|
||||||
specification: string // 规格型号
|
specification: string // 规格型号
|
||||||
unitMeasureId: number // 单位编号
|
|
||||||
unitMeasureName: string // 单位名称
|
unitMeasureName: string // 单位名称
|
||||||
barcodeUrl: string // 条码地址
|
|
||||||
transferedQuantity: number // 流转数量
|
transferedQuantity: number // 流转数量
|
||||||
status: number // 状态
|
|
||||||
remark: string // 备注
|
remark: string // 备注
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,11 +29,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="产品" prop="itemId">
|
<el-form-item label="产品" prop="itemId">
|
||||||
<MdItemSelect
|
<MdItemSelect v-model="formData.itemId" :disabled="isDetail" />
|
||||||
v-model="formData.itemId"
|
|
||||||
:disabled="isDetail"
|
|
||||||
@change="handleItemChange"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
|
@ -57,18 +53,6 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="规格型号" prop="specification">
|
|
||||||
<el-input v-model="formData.specification" placeholder="选择产品后自动填充" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8" v-if="formType !== 'create'">
|
|
||||||
<el-form-item label="状态" prop="status">
|
|
||||||
<dict-tag :type="DICT_TYPE.MES_PRO_WORK_ORDER_STATUS" :value="formData.status" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
|
|
@ -96,9 +80,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
|
||||||
import { ProCardApi, ProCardVO } from '@/api/mes/pro/card'
|
import { ProCardApi, ProCardVO } from '@/api/mes/pro/card'
|
||||||
import { MdItemVO } from '@/api/mes/md/item'
|
|
||||||
import { generateRandomStr } from '@/utils'
|
import { generateRandomStr } from '@/utils'
|
||||||
import MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue'
|
import MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue'
|
||||||
import ProWorkOrderSelect from '@/views/mes/pro/workorder/components/ProWorkOrderSelect.vue'
|
import ProWorkOrderSelect from '@/views/mes/pro/workorder/components/ProWorkOrderSelect.vue'
|
||||||
|
|
@ -120,11 +102,7 @@ const formData = ref({
|
||||||
workOrderId: undefined,
|
workOrderId: undefined,
|
||||||
batchCode: undefined,
|
batchCode: undefined,
|
||||||
itemId: undefined,
|
itemId: undefined,
|
||||||
// TODO @AI:specification 不用展示;
|
|
||||||
specification: undefined, // 仅展示,不存储(从 item 获取)
|
|
||||||
barcodeUrl: undefined,
|
|
||||||
transferedQuantity: undefined,
|
transferedQuantity: undefined,
|
||||||
status: undefined,
|
|
||||||
remark: undefined
|
remark: undefined
|
||||||
})
|
})
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
|
|
@ -163,11 +141,6 @@ const open = async (type: string, id?: number) => {
|
||||||
|
|
||||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
/** 产品变更:自动填充规格型号(仅展示) */
|
|
||||||
const handleItemChange = (item: MdItemVO) => {
|
|
||||||
formData.value.specification = item?.specification
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 提交表单 */
|
/** 提交表单 */
|
||||||
const emit = defineEmits(['success'])
|
const emit = defineEmits(['success'])
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
|
|
@ -197,10 +170,7 @@ const resetForm = () => {
|
||||||
workOrderId: undefined,
|
workOrderId: undefined,
|
||||||
batchCode: undefined,
|
batchCode: undefined,
|
||||||
itemId: undefined,
|
itemId: undefined,
|
||||||
specification: undefined,
|
|
||||||
barcodeUrl: undefined,
|
|
||||||
transferedQuantity: undefined,
|
transferedQuantity: undefined,
|
||||||
status: undefined,
|
|
||||||
remark: undefined
|
remark: undefined
|
||||||
}
|
}
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
|
|
|
||||||
|
|
@ -11,19 +11,33 @@
|
||||||
<!-- 工序记录列表 -->
|
<!-- 工序记录列表 -->
|
||||||
<el-table v-loading="loading" :data="processList" :stripe="true" :show-overflow-tooltip="true">
|
<el-table v-loading="loading" :data="processList" :stripe="true" :show-overflow-tooltip="true">
|
||||||
<el-table-column label="序号" align="center" prop="sort" width="60" />
|
<el-table-column label="序号" align="center" prop="sort" width="60" />
|
||||||
<el-table-column label="工序编码" align="center" prop="processCode" width="120" />
|
|
||||||
<el-table-column label="工序名称" align="center" prop="processName" min-width="120" />
|
<el-table-column label="工序名称" align="center" prop="processName" min-width="120" />
|
||||||
<el-table-column label="进入工序时间" align="center" prop="inputTime" :formatter="dateFormatter" width="180" />
|
<el-table-column label="工序编码" align="center" prop="processCode" width="120" />
|
||||||
<el-table-column label="出工序时间" align="center" prop="outputTime" :formatter="dateFormatter" width="180" />
|
<el-table-column
|
||||||
|
label="进入工序时间"
|
||||||
|
align="center"
|
||||||
|
prop="inputTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="出工序时间"
|
||||||
|
align="center"
|
||||||
|
prop="outputTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180"
|
||||||
|
/>
|
||||||
<el-table-column label="投入数量" align="center" prop="inputQuantity" width="100" />
|
<el-table-column label="投入数量" align="center" prop="inputQuantity" width="100" />
|
||||||
<el-table-column label="产出数量" align="center" prop="outputQuantity" width="100" />
|
<el-table-column label="产出数量" align="center" prop="outputQuantity" width="100" />
|
||||||
<el-table-column label="不合格数量" align="center" prop="unqualifiedQuantity" width="100" />
|
<el-table-column label="不良品数量" align="center" prop="unqualifiedQuantity" width="100" />
|
||||||
<el-table-column label="工位编码" align="center" prop="workstationCode" width="120" />
|
<el-table-column label="工位编码" align="center" prop="workstationCode" width="120" />
|
||||||
<el-table-column label="工位名称" align="center" prop="workstationName" min-width="120" />
|
<el-table-column label="工位名称" align="center" prop="workstationName" min-width="120" />
|
||||||
<el-table-column label="操作人" align="center" prop="nickname" width="100" />
|
<el-table-column label="操作人" align="center" prop="nickname" width="100" />
|
||||||
<el-table-column label="操作" align="center" width="160" v-if="!disabled">
|
<el-table-column label="操作" align="center" width="160" v-if="!disabled">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" @click="openProcessForm('update', scope.row)">编辑</el-button>
|
<el-button link type="primary" @click="openProcessForm('update', scope.row)">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
<el-button link type="danger" @click="handleDelete(scope.row.id)">删除</el-button>
|
<el-button link type="danger" @click="handleDelete(scope.row.id)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -84,17 +98,32 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="投入数量" prop="inputQuantity">
|
<el-form-item label="投入数量" prop="inputQuantity">
|
||||||
<el-input-number v-model="processFormData.inputQuantity" :min="0" :precision="2" class="!w-1/1" />
|
<el-input-number
|
||||||
|
v-model="processFormData.inputQuantity"
|
||||||
|
:min="0"
|
||||||
|
:precision="2"
|
||||||
|
class="!w-1/1"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="产出数量" prop="outputQuantity">
|
<el-form-item label="产出数量" prop="outputQuantity">
|
||||||
<el-input-number v-model="processFormData.outputQuantity" :min="0" :precision="2" class="!w-1/1" />
|
<el-input-number
|
||||||
|
v-model="processFormData.outputQuantity"
|
||||||
|
:min="0"
|
||||||
|
:precision="2"
|
||||||
|
class="!w-1/1"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="不合格数量" prop="unqualifiedQuantity">
|
<el-form-item label="不合格数量" prop="unqualifiedQuantity">
|
||||||
<el-input-number v-model="processFormData.unqualifiedQuantity" :min="0" :precision="2" class="!w-1/1" />
|
<el-input-number
|
||||||
|
v-model="processFormData.unqualifiedQuantity"
|
||||||
|
:min="0"
|
||||||
|
:precision="2"
|
||||||
|
class="!w-1/1"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
@ -114,7 +143,9 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="submitProcessForm" type="primary" :disabled="processFormLoading">确 定</el-button>
|
<el-button @click="submitProcessForm" type="primary" :disabled="processFormLoading"
|
||||||
|
>确 定</el-button
|
||||||
|
>
|
||||||
<el-button @click="processDialogVisible = false">取 消</el-button>
|
<el-button @click="processDialogVisible = false">取 消</el-button>
|
||||||
</template>
|
</template>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- TODO @芋艿:批次号 -->
|
|
||||||
<el-form-item label="产品" prop="itemId">
|
<el-form-item label="产品" prop="itemId">
|
||||||
<MdItemSelect v-model="queryParams.itemId" placeholder="请选择产品" class="!w-240px" />
|
<MdItemSelect v-model="queryParams.itemId" placeholder="请选择产品" class="!w-240px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -38,27 +37,7 @@
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="status">
|
<!-- DONE @AI:前后端都去掉 status、createTime 筛选 -->
|
||||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.MES_PRO_WORK_ORDER_STATUS)"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="创建时间" prop="createTime">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="queryParams.createTime"
|
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
type="daterange"
|
|
||||||
start-placeholder="开始日期"
|
|
||||||
end-placeholder="结束日期"
|
|
||||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
|
||||||
class="!w-240px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
<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 @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||||
|
|
@ -86,7 +65,13 @@
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||||
<el-table-column label="流转卡编码" align="center" prop="code" width="140" />
|
<el-table-column label="流转卡编码" align="center" prop="code" width="140">
|
||||||
|
<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="workOrderCode" width="140" />
|
<el-table-column label="生产工单编号" align="center" prop="workOrderCode" width="140" />
|
||||||
<el-table-column label="工单名称" align="center" prop="workOrderName" min-width="150" />
|
<el-table-column label="工单名称" align="center" prop="workOrderName" min-width="150" />
|
||||||
<el-table-column label="批次号" align="center" prop="batchCode" width="120" />
|
<el-table-column label="批次号" align="center" prop="batchCode" width="120" />
|
||||||
|
|
@ -95,31 +80,9 @@
|
||||||
<el-table-column label="规格型号" align="center" prop="specification" width="120" />
|
<el-table-column label="规格型号" align="center" prop="specification" width="120" />
|
||||||
<el-table-column label="单位" align="center" prop="unitMeasureName" width="80" />
|
<el-table-column label="单位" align="center" prop="unitMeasureName" width="80" />
|
||||||
<el-table-column label="流转数量" align="center" prop="transferedQuantity" width="100" />
|
<el-table-column label="流转数量" align="center" prop="transferedQuantity" width="100" />
|
||||||
<el-table-column label="状态" align="center" prop="status" width="100">
|
<el-table-column label="操作" align="center" width="160" fixed="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :type="DICT_TYPE.MES_PRO_WORK_ORDER_STATUS" :value="scope.row.status" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="创建时间"
|
|
||||||
align="center"
|
|
||||||
prop="createTime"
|
|
||||||
:formatter="dateFormatter"
|
|
||||||
width="180"
|
|
||||||
/>
|
|
||||||
<el-table-column label="操作" align="center" width="200" fixed="right">
|
|
||||||
<template #default="scope">
|
|
||||||
<!-- TODO @AI:状态怎么流转?是不是不用 status? -->
|
|
||||||
<!-- TODO @芋艿:打印 -->
|
<!-- TODO @芋艿:打印 -->
|
||||||
<el-button
|
|
||||||
link
|
|
||||||
type="primary"
|
|
||||||
@click="openForm('detail', scope.row.id)"
|
|
||||||
v-hasPermi="['mes:pro-card:query']"
|
|
||||||
>
|
|
||||||
详情
|
|
||||||
</el-button>
|
|
||||||
<!-- TODO @芋艿:好像不用编辑、删除??? -->
|
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
|
|
@ -153,11 +116,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { dateFormatter } from '@/utils/formatTime'
|
|
||||||
import download from '@/utils/download'
|
import download from '@/utils/download'
|
||||||
import { ProCardApi, ProCardVO } from '@/api/mes/pro/card'
|
import { ProCardApi, ProCardVO } from '@/api/mes/pro/card'
|
||||||
import CardForm from './CardForm.vue'
|
import CardForm from './CardForm.vue'
|
||||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
|
||||||
import MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue'
|
import MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue'
|
||||||
import ProWorkOrderSelect from '@/views/mes/pro/workorder/components/ProWorkOrderSelect.vue'
|
import ProWorkOrderSelect from '@/views/mes/pro/workorder/components/ProWorkOrderSelect.vue'
|
||||||
|
|
||||||
|
|
@ -175,9 +136,7 @@ const queryParams = reactive({
|
||||||
code: undefined,
|
code: undefined,
|
||||||
workOrderId: undefined,
|
workOrderId: undefined,
|
||||||
itemId: undefined,
|
itemId: undefined,
|
||||||
batchCode: undefined,
|
batchCode: undefined
|
||||||
status: undefined,
|
|
||||||
createTime: undefined
|
|
||||||
})
|
})
|
||||||
const queryFormRef = ref() // 搜索的表单
|
const queryFormRef = ref() // 搜索的表单
|
||||||
const exportLoading = ref(false) // 导出的加载中
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue