296 lines
9.0 KiB
Vue
296 lines
9.0 KiB
Vue
<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:new-value="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-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 v-if = "false" label="主键" align="center" prop="id" />
|
|
<el-table-column
|
|
v-if = "false"
|
|
label="创建时间"
|
|
align="center"
|
|
prop="createTime"
|
|
:formatter="dateFormatter"
|
|
width="180px"
|
|
/>
|
|
<el-table-column label="生产计划单号" fixed="left" align="center" prop="taskNo" width="200"/>
|
|
<el-table-column label="项目名称" align="center" prop="projectName" width="200"/>
|
|
<el-table-column label="子项目名称" align="center" prop="projectSubName" width="200"/>
|
|
<el-table-column label="模具名称" align="center" prop="mouldName" min-width="105" />
|
|
<el-table-column label="材质" align="center" prop="compositionName" />
|
|
|
|
<el-table-column label="单位" align="center" prop="unit" >
|
|
<template #default="scope">
|
|
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.unit" />
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="数量" align="center" prop="amount" />
|
|
<el-table-column label="检验人" align="center" prop="nickName" />
|
|
|
|
|
|
<el-table-column label="材质名称" align="center" prop="compositionName" min-width="100" />
|
|
|
|
<el-table-column label="派工单号" align="center" prop="pgNumber" width="220"/>
|
|
|
|
<el-table-column
|
|
label="开始日期"
|
|
align="center"
|
|
prop="startTime"
|
|
:formatter="dateFormatter"
|
|
width="240"
|
|
/>
|
|
<el-table-column
|
|
label="结束日期"
|
|
align="center"
|
|
prop="entTime"
|
|
:formatter="dateFormatter"
|
|
width="240"
|
|
/>
|
|
<el-table-column label="派工状态" min-width="105">
|
|
<template #default="scope">
|
|
<dict-tag :type="DICT_TYPE.HELI_DISPATCH_STATUS" :value="scope.row.dispatchStatus" />
|
|
</template>
|
|
|
|
</el-table-column>
|
|
<el-table-column label="单据状态" min-width="105" fixed="right" style="text-align: center;">
|
|
<template #default="scope">
|
|
<dict-tag :type="DICT_TYPE.HELI_PGTYPE" :value="scope.row.pgType" />
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="操作" fixed="right" align="center" width="140">
|
|
<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 ZjPgMasterApi.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.confirm("是否要作废该派工单","")
|
|
// 发起删除
|
|
await ZjPgMasterApi.zfZjPgMaster(id)
|
|
message.success("作废成功")
|
|
// 刷新列表
|
|
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> |