|
|
|
@ -120,7 +120,14 @@
|
|
|
|
<el-tab-pane :label="t('ProductionPlan.Plan.tabToStoreLabel')" name="4" />
|
|
|
|
<el-tab-pane :label="t('ProductionPlan.Plan.tabToStoreLabel')" name="4" />
|
|
|
|
<el-tab-pane :label="t('ProductionPlan.Plan.tabStoredLabel')" name="5" />
|
|
|
|
<el-tab-pane :label="t('ProductionPlan.Plan.tabStoredLabel')" name="5" />
|
|
|
|
</el-tabs>
|
|
|
|
</el-tabs>
|
|
|
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
|
|
|
<el-table
|
|
|
|
|
|
|
|
ref="tableRef"
|
|
|
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
|
|
|
:data="list"
|
|
|
|
|
|
|
|
:stripe="true"
|
|
|
|
|
|
|
|
:show-overflow-tooltip="true"
|
|
|
|
|
|
|
|
row-key="id"
|
|
|
|
|
|
|
|
>
|
|
|
|
<!-- 投料进度子表的列表 -->
|
|
|
|
<!-- 投料进度子表的列表 -->
|
|
|
|
<el-table-column type="expand">
|
|
|
|
<el-table-column type="expand">
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
@ -139,7 +146,10 @@
|
|
|
|
</el-tabs> -->
|
|
|
|
</el-tabs> -->
|
|
|
|
<el-tabs v-if="scope.row.status == 6" model-value="zj">
|
|
|
|
<el-tabs v-if="scope.row.status == 6" model-value="zj">
|
|
|
|
<el-tab-pane :label="t('ProductionPlan.Plan.detailInspectTabLabel')" name="zj">
|
|
|
|
<el-tab-pane :label="t('ProductionPlan.Plan.detailInspectTabLabel')" name="zj">
|
|
|
|
<ZjProductPreList :product-id="scope.row.productId"/>
|
|
|
|
<ZjProductPreList
|
|
|
|
|
|
|
|
:ticket="scope.row.id"
|
|
|
|
|
|
|
|
@inspectable-change="(hasPending) => setInspectable(scope.row.id, hasPending)"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</el-tab-pane>
|
|
|
|
</el-tab-pane>
|
|
|
|
</el-tabs>
|
|
|
|
</el-tabs>
|
|
|
|
<el-tabs v-if="scope.row.status >= 2 && scope.row.status != 6" model-value="itemRequisitionDetail">
|
|
|
|
<el-tabs v-if="scope.row.status >= 2 && scope.row.status != 6" model-value="itemRequisitionDetail">
|
|
|
|
@ -236,8 +246,8 @@
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
link
|
|
|
|
link
|
|
|
|
type="primary"
|
|
|
|
type="primary"
|
|
|
|
@click="openZjProductForm(scope.row.productId,'pre',6,scope.row.id,scope.row.isZj)"
|
|
|
|
@click.stop="handleInspectExpand(scope.row)"
|
|
|
|
v-if="scope.row.status === 6"
|
|
|
|
v-if="scope.row.status === 6 && inspectableMap[scope.row.id] !== false"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{{ t('ProductionPlan.Plan.actionInspectLabel') }}
|
|
|
|
{{ t('ProductionPlan.Plan.actionInspectLabel') }}
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
@ -324,8 +334,6 @@
|
|
|
|
<!-- 详情弹窗 -->
|
|
|
|
<!-- 详情弹窗 -->
|
|
|
|
<PlanDetail ref="detailRef" />
|
|
|
|
<PlanDetail ref="detailRef" />
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 产品质检弹出 -->
|
|
|
|
|
|
|
|
<ZjProductRecord ref="zjProductRecordFormRef" @success="getList" />
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
<script setup lang="ts">
|
|
|
|
@ -344,7 +352,7 @@ import Baogong from "./components/Baogong.vue";
|
|
|
|
import ItemRequisitionDetailList from "@/views/mes/itemrequisition/components/ItemRequisitionDetailList.vue";
|
|
|
|
import ItemRequisitionDetailList from "@/views/mes/itemrequisition/components/ItemRequisitionDetailList.vue";
|
|
|
|
import ZjProductPreList from "@/views/mes/zjproduct/components/ZjProductPreList.vue";
|
|
|
|
import ZjProductPreList from "@/views/mes/zjproduct/components/ZjProductPreList.vue";
|
|
|
|
import BaogongRecordList from "@/views/mes/baogongrecord/components/BaogongRecordList.vue";
|
|
|
|
import BaogongRecordList from "@/views/mes/baogongrecord/components/BaogongRecordList.vue";
|
|
|
|
import ZjProductRecord from "@/views/mes/zjproductrecord/components/ZjProductRecordForm.vue";
|
|
|
|
import { ZjTaskApi } from '@/api/mes/zjtask'
|
|
|
|
|
|
|
|
|
|
|
|
const productList = ref<ProductVO[]>([]) // 产品列表
|
|
|
|
const productList = ref<ProductVO[]>([]) // 产品列表
|
|
|
|
const taskList = ref<TaskVO[]>([]) // 列表
|
|
|
|
const taskList = ref<TaskVO[]>([]) // 列表
|
|
|
|
@ -358,6 +366,8 @@ const {query} = useRoute() // 查询参数
|
|
|
|
const loading = ref(true) // 列表的加载中
|
|
|
|
const loading = ref(true) // 列表的加载中
|
|
|
|
const list = ref<PlanVO[]>([]) // 列表的数据
|
|
|
|
const list = ref<PlanVO[]>([]) // 列表的数据
|
|
|
|
const total = ref(0) // 列表的总页数
|
|
|
|
const total = ref(0) // 列表的总页数
|
|
|
|
|
|
|
|
const tableRef = ref()
|
|
|
|
|
|
|
|
const inspectableMap = reactive<Record<number, boolean | undefined>>({})
|
|
|
|
const queryParams = reactive({
|
|
|
|
const queryParams = reactive({
|
|
|
|
pageNo: 1,
|
|
|
|
pageNo: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
pageSize: 10,
|
|
|
|
@ -395,6 +405,7 @@ const getList = async () => {
|
|
|
|
const data = await PlanApi.getPlanPage(queryParams)
|
|
|
|
const data = await PlanApi.getPlanPage(queryParams)
|
|
|
|
list.value = data.list
|
|
|
|
list.value = data.list
|
|
|
|
total.value = data.total
|
|
|
|
total.value = data.total
|
|
|
|
|
|
|
|
await refreshInspectableMap(list.value)
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
loading.value = false
|
|
|
|
loading.value = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -485,10 +496,36 @@ const openBaogongForm = (planCode: string, planId: number) => {
|
|
|
|
baogongFormRef.value.open(planCode, planId)
|
|
|
|
baogongFormRef.value.open(planCode, planId)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** 质检 */
|
|
|
|
const handleInspectExpand = (row: PlanVO) => {
|
|
|
|
const zjProductRecordFormRef = ref()
|
|
|
|
tableRef.value?.toggleRowExpansion?.(row, true)
|
|
|
|
const openZjProductForm = (productId: number,type:string, status:number,id: number, isZj: number) => {
|
|
|
|
}
|
|
|
|
zjProductRecordFormRef.value.open(productId,type,status,id,isZj)
|
|
|
|
|
|
|
|
|
|
|
|
const setInspectable = (id: number | undefined, hasPending: boolean) => {
|
|
|
|
|
|
|
|
if (!id) return
|
|
|
|
|
|
|
|
inspectableMap[id] = hasPending
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const refreshInspectableMap = async (rows: PlanVO[]) => {
|
|
|
|
|
|
|
|
const ids = rows
|
|
|
|
|
|
|
|
.filter((row) => row?.id && String(row.status) === '6')
|
|
|
|
|
|
|
|
.map((row) => row.id as number)
|
|
|
|
|
|
|
|
const idSet = new Set(ids)
|
|
|
|
|
|
|
|
for (const key of Object.keys(inspectableMap)) {
|
|
|
|
|
|
|
|
const id = Number(key)
|
|
|
|
|
|
|
|
if (!idSet.has(id)) delete inspectableMap[id]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
await Promise.all(
|
|
|
|
|
|
|
|
ids.map(async (id) => {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const data = await ZjTaskApi.getZjTaskList({ ticket: String(id) })
|
|
|
|
|
|
|
|
const arr = Array.isArray(data) ? data : data?.list ?? data?.data ?? []
|
|
|
|
|
|
|
|
const hasPending = arr.some((item: any) => String(item?.status) === '0')
|
|
|
|
|
|
|
|
inspectableMap[id] = hasPending
|
|
|
|
|
|
|
|
} catch {
|
|
|
|
|
|
|
|
inspectableMap[id] = true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|