终检过程检验记录查询界面

This commit is contained in:
think 2025-01-16 09:01:44 +08:00
parent 2066722358
commit 132af47510
2 changed files with 469 additions and 0 deletions

View File

@ -0,0 +1,170 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="子项目id" prop="projectSubId">
<el-input v-model="formData.projectSubId" placeholder="请输入子项目id" />
</el-form-item>
<el-form-item label="子项目名称" prop="projectSubName">
<el-input v-model="formData.projectSubName" placeholder="请输入子项目名称" />
</el-form-item>
<el-form-item label="子项目编号" prop="projectSubNumber">
<el-input v-model="formData.projectSubNumber" placeholder="请输入子项目编号" />
</el-form-item>
<el-form-item label="材质id" prop="compositionId">
<el-input v-model="formData.compositionId" placeholder="请输入材质id" />
</el-form-item>
<el-form-item label="单位" prop="unit">
<el-input v-model="formData.unit" placeholder="请输入单位" />
</el-form-item>
<el-form-item label="数量" prop="amount">
<el-input v-model="formData.amount" placeholder="请输入数量" />
</el-form-item>
<el-form-item label="检验人" prop="detilUser">
<el-input v-model="formData.detilUser" placeholder="请输入检验人" />
</el-form-item>
<el-form-item label="开始日期" prop="startTime">
<el-date-picker
v-model="formData.startTime"
type="date"
value-format="x"
placeholder="选择开始日期"
/>
</el-form-item>
<el-form-item label="结束日期" prop="entTime">
<el-date-picker
v-model="formData.entTime"
type="date"
value-format="x"
placeholder="选择结束日期"
/>
</el-form-item>
<el-form-item label="预计工时" prop="gongShi">
<el-input v-model="formData.gongShi" placeholder="请输入预计工时" />
</el-form-item>
<el-form-item label="质量派工id" prop="zlPgId">
<el-input v-model="formData.zlPgId" placeholder="请输入质量派工id" />
</el-form-item>
<el-form-item label="是否完成 0未完成 1已完成" prop="pgType">
<el-select v-model="formData.pgType" placeholder="请选择是否完成 0未完成 1已完成">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="材质名称" prop="compositionName">
<el-input v-model="formData.compositionName" placeholder="请输入材质名称" />
</el-form-item>
<el-form-item label="模具id" prop="mouldId">
<el-input v-model="formData.mouldId" placeholder="请输入模具id" />
</el-form-item>
<el-form-item label="模具名称" prop="mouldName">
<el-input v-model="formData.mouldName" placeholder="请输入模具名称" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import * as ZjPgMasterApi from '@/api/heli/zjpgmaster'
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
projectSubId: undefined,
projectSubName: undefined,
projectSubNumber: undefined,
compositionId: undefined,
unit: undefined,
amount: undefined,
detilUser: undefined,
startTime: undefined,
entTime: undefined,
gongShi: undefined,
zlPgId: undefined,
pgType: undefined,
compositionName: undefined,
mouldId: undefined,
mouldName: undefined,
})
const formRules = reactive({
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await ZjPgMasterApi.getZjPgMasterLine(id)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
formLoading.value = true
try {
const data = formData.value as unknown as ZjPgMasterApi.ZjPgMasterLineVO
if (formType.value === 'create') {
await ZjPgMasterApi.createZjPgMasterLine(data)
message.success(t('common.createSuccess'))
} else {
await ZjPgMasterApi.updateZjPgMasterLine(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
projectSubId: undefined,
projectSubName: undefined,
projectSubNumber: undefined,
compositionId: undefined,
unit: undefined,
amount: undefined,
detilUser: undefined,
startTime: undefined,
entTime: undefined,
gongShi: undefined,
zlPgId: undefined,
pgType: undefined,
compositionName: undefined,
mouldId: undefined,
mouldName: undefined,
}
formRef.value?.resetFields()
}
</script>

View File

@ -0,0 +1,299 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="160px"
>
<el-form-item label="生产计划单号" prop="taskNo">
<el-input
v-model="queryParams.taskNo"
placeholder="请输入生产计划单号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="项目名称" prop="projectName">
<el-input
v-model="queryParams.projectName"
placeholder="请输入项目名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="子项目名称" prop="projectSubName">
<el-input
v-model="queryParams.projectSubName"
placeholder="请输入子项目名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="派工单号" prop="pgNumber">
<el-input
v-model="queryParams.pgNumber"
placeholder="请输入派工单号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="检验人" prop="detilUser">
<UserSelect v-model="queryParams.detilUser" @update:newValue="handleSelectedUser1" class="!w-265px"/>
</el-form-item>
<!-- <el-form-item label="检验人" prop="detilUser">
<el-input
v-model="queryParams.detilUser"
placeholder="请输入检验人"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item> -->
<el-form-item label="单据状态" prop="pgType">
<el-select
v-model="queryParams.pgType"
placeholder="请选择是否完成 0未完成 1已完成"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PGTYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</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="['heli:zj-pg-master-line:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['heli:zj-pg-master-line: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" class="hl-table" :show-overflow-tooltip="true">
<el-table-column label="主键" align="center" prop="id" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="子项目id" align="center" prop="projectSubId" />
<el-table-column label="子项目名称" align="center" prop="projectSubName" />
<el-table-column label="子项目编号" align="center" prop="projectSubNumber" />
<el-table-column label="材质id" align="center" prop="compositionId" />
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="数量" align="center" prop="amount" />
<el-table-column label="检验人" align="center" prop="detilUser" />
<el-table-column
label="开始日期"
align="center"
prop="startTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column
label="结束日期"
align="center"
prop="entTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="预计工时" align="center" prop="gongShi" />
<el-table-column label="质量派工id" align="center" prop="zlPgId" />
<el-table-column label="是否完成 0未完成 1已完成" align="center" prop="pgType" />
<el-table-column label="材质名称" align="center" prop="compositionName" />
<el-table-column label="模具id" align="center" prop="mouldId" />
<el-table-column label="模具名称" align="center" prop="mouldName" />
<el-table-column label="派工单号" align="center" prop="pgNumber" />
<el-table-column label="生产计划单号" align="center" prop="taskNo" />
<el-table-column label="生产计划id" align="center" prop="taskId" />
<el-table-column label="项目id" align="center" prop="projectId" />
<el-table-column label="项目名称" align="center" prop="projectName" />
<el-table-column label="派工状态 已保存|已提交|已终止 1|2|3" align="center" prop="dispatchStatus" />
<el-table-column label="当前报工状态" align="center" prop="active" />
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['heli:zj-pg-master-line:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['heli:zj-pg-master-line:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<ZjPgMasterLineForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as ZjPgMasterApi from '@/api/heli/zjpgmaster'
import ZjPgMasterLineForm from './ZjPgMasterLineForm.vue'
import { getIntDictOptions, getStrDictOptions, DICT_TYPE, getDictLabel } from '@/utils/dict'
import UserSelect from '@/views/heli/hlvuestyle/userSelect.vue'
defineOptions({ name: 'ZjPgMasterLine' })
const handleSelectedUser1 = (newValue: any) => {
queryParams.detilUser = newValue?.id
}
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
createTime: [],
projectSubId: undefined,
projectSubName: undefined,
projectSubNumber: undefined,
compositionId: undefined,
unit: undefined,
amount: undefined,
detilUser: undefined,
startTime: [],
entTime: [],
gongShi: undefined,
zlPgId: undefined,
pgType: undefined,
compositionName: undefined,
mouldId: undefined,
mouldName: undefined,
pgNumber: undefined,
taskNo: undefined,
taskId: undefined,
projectId: undefined,
projectName: undefined,
dispatchStatus: undefined,
active: undefined,
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await ZjPgMasterLineApi.getZjPgMasterLinePage(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 formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ZjPgMasterLineApi.deleteZjPgMasterLine(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await ZjPgMasterLineApi.exportZjPgMasterLine(queryParams)
download.excel(data, '质量派工单终检行.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
})
</script>