206 lines
7.5 KiB
Vue
206 lines
7.5 KiB
Vue
<template>
|
|
<el-card class="hl-card">
|
|
<template #header>
|
|
<span>BOM清单审核</span>
|
|
</template>
|
|
<ContentWrap class="borderxx">
|
|
<!-- 搜索工作栏 -->
|
|
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="120px">
|
|
<el-form-item label="BOM编号" prop="code">
|
|
<el-input v-model="queryParams.code" placeholder="请输入BOM编号" clearable @keyup.enter="handleQuery" class="!w-240px" />
|
|
</el-form-item>
|
|
<el-form-item label="计划单号" prop="planCode">
|
|
<el-input v-model="queryParams.planCode" placeholder="请输入计划单号" clearable @keyup.enter="handleQuery" class="!w-240px" />
|
|
</el-form-item>
|
|
<el-form-item label="项目编号" prop="projectCode">
|
|
<el-input v-model="queryParams.projectCode" placeholder="请输入项目编号" clearable @keyup.enter="handleQuery" class="!w-240px" />
|
|
</el-form-item>
|
|
<el-form-item label="客户名称" prop="customerName">
|
|
<el-input v-model="queryParams.customerName" 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="bomStatus">
|
|
<el-select v-model="queryParams.bomStatus" placeholder="请选择单据状态" clearable class="!w-240px">
|
|
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_BOM_STATUS)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item style="margin-left:30px">
|
|
<el-button @click="handleQuery" type="primary">
|
|
<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" :show-overflow-tooltip="true" class="hl-table">
|
|
|
|
|
|
<el-table-column fixed label="序号" align="center" type="index" width="60" />
|
|
<el-table-column fixed label="BOM编号" align="center" prop="bomCode" min-width="430">
|
|
<template #default="scope">
|
|
<el-button type="primary" plain link @click="openDetail('detail', scope.row.id)">{{ scope.row.bomCode }}</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column fixed label="计划单号" align="center" prop="planCode" min-width="180" />
|
|
<el-table-column fixed label="项目编号" align="center" prop="projectCode" min-width="220" />
|
|
<el-table-column label="客户名称" align="center" prop="customerName" min-width="240" />
|
|
<el-table-column label="项目名称" align="center" prop="projectName" min-width="180" />
|
|
<el-table-column label="子项目名称" align="center" prop="projectSubName" min-width="180" />
|
|
<el-table-column label="创建时间" align="center" prop="createTime" :formatter="dateFormatter" min-width="220" />
|
|
<el-table-column fixed="right" label="BOM版本号" align="center" prop="version" min-width="140" />
|
|
<el-table-column fixed="right" label="单据状态" align="center" prop="bomStatus" min-width="140">
|
|
<template #default="scope">
|
|
<dict-tag :type="DICT_TYPE.HELI_BOM_STATUS" :value="scope.row.bomStatus" />
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column fixed="right" label="操作" align="center" min-width="160">
|
|
<template #default="scope">
|
|
<el-button v-if="scope.row.bomStatus != 7" link type="primary" @click="openDetail('shenhe', scope.row.id)">
|
|
去审核
|
|
</el-button>
|
|
<el-button link type="primary" @click="openDetail('detail', scope.row.id)">
|
|
查看详情
|
|
</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<!-- 分页 -->
|
|
<Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
</ContentWrap>
|
|
</el-card>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
import download from '@/utils/download'
|
|
import * as ProcessBomApi from '@/api/heli/processbom'
|
|
import { useCommonStateWithOut } from '@/store/modules/common'
|
|
import { useUserStore } from '@/store/modules/user'
|
|
defineOptions({ name: 'ProcessBom' })
|
|
|
|
const commonStore = useCommonStateWithOut()
|
|
const message = useMessage() // 消息弹窗
|
|
const { t } = useI18n() // 国际化
|
|
const router = useRouter()
|
|
const userStore = useUserStore()
|
|
const username = userStore.getUser.id//nickname
|
|
const loading = ref(true) // 列表的加载中
|
|
const list = ref([]) // 列表的数据
|
|
const total = ref(0) // 列表的总页数
|
|
const queryParams = reactive({
|
|
pageNo: 1,
|
|
pageSize: 10,
|
|
code: undefined,
|
|
planCode: undefined,
|
|
projectCode: undefined,
|
|
customerName: undefined,
|
|
projectName: undefined,
|
|
projectSubName: undefined,
|
|
version: undefined,
|
|
bomStatus: undefined,
|
|
remark: undefined,
|
|
status: undefined,
|
|
createTime: [],
|
|
userId:username
|
|
})
|
|
const queryFormRef = ref() // 搜索的表单
|
|
const exportLoading = ref(false) // 导出的加载中
|
|
|
|
/** 查询列表 */
|
|
const getList = async () => {
|
|
loading.value = true
|
|
try {
|
|
// const route = useRoute();
|
|
// if(route){
|
|
// const idid = route.query.idid;
|
|
// queryParams.code=idid
|
|
// }
|
|
const id = history.state.idid;
|
|
if(id){
|
|
queryParams.code=id
|
|
}
|
|
|
|
const data = await ProcessBomApi.getProcessBomPages(queryParams)
|
|
history.state.idid=undefined
|
|
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 ProcessBomApi.deleteProcessBom(id)
|
|
message.success(t('common.delSuccess'))
|
|
// 刷新列表
|
|
await getList()
|
|
} catch {}
|
|
}
|
|
|
|
/** 导出按钮操作 */
|
|
const handleExport = async () => {
|
|
try {
|
|
// 导出的二次确认
|
|
await message.exportConfirm()
|
|
// 发起导出
|
|
exportLoading.value = true
|
|
const data = await ProcessBomApi.exportProcessBom(queryParams)
|
|
download.excel(data, '工艺bom.xls')
|
|
} catch {
|
|
} finally {
|
|
exportLoading.value = false
|
|
}
|
|
}
|
|
|
|
/** 添加/修改操作 */
|
|
const openDetail = (type: string, id?: number) => {
|
|
commonStore.setStore('active', type)
|
|
commonStore.setStore('id', id)
|
|
router.push({
|
|
name: 'ProcessBomDetail',
|
|
query: {
|
|
operateId: Math.random()
|
|
}
|
|
})
|
|
}
|
|
|
|
/** 初始化 **/
|
|
onMounted(() => {
|
|
getList()
|
|
})
|
|
</script>
|