|
|
|
|
@ -34,15 +34,15 @@
|
|
|
|
|
:end-placeholder="t('ProductionPlan.Plan.searchPlanEndEndPlaceholder')"
|
|
|
|
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" class="!w-240px" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item v-if="filterCount > 3">
|
|
|
|
|
|
|
|
|
|
<el-form-item v-if="filterCount > 3">
|
|
|
|
|
<el-button type="text" class="text-primary" @click="toggleFilters">
|
|
|
|
|
<Icon :icon="showAllFilters ? 'ep:arrow-up' : 'ep:arrow-down'" class="mr-5px" />
|
|
|
|
|
{{ showAllFilters ? t('FactoryModeling.FactoryStructure.collapseText') :
|
|
|
|
|
t('FactoryModeling.FactoryStructure.expandText') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button @click="handleQuery">
|
|
|
|
|
<Icon icon="ep:search" class="mr-5px" /> {{ t('ProductionPlan.Plan.buttonSearchText') }}
|
|
|
|
|
@ -68,17 +68,10 @@
|
|
|
|
|
<!-- 列表 -->
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<el-tabs v-model="activeName" @tab-click="handleTabClick">
|
|
|
|
|
<el-tab-pane label="所有" name="" />
|
|
|
|
|
<!-- <el-tab-pane label="派工" name="0" /> -->
|
|
|
|
|
<el-tab-pane :label="t('ProductionPlan.Plan.tabPlannedLabel')" name="1" />
|
|
|
|
|
<el-tab-pane :label="t('ProductionPlan.Plan.tabStartLabel')" name="8" />
|
|
|
|
|
<!-- <el-tab-pane :label="t('ProductionPlan.Plan.tabTrialLabel')" name="6" /> -->
|
|
|
|
|
<!-- <el-tab-pane :label="t('ProductionPlan.Plan.tabMassLabel')" name="2" /> -->
|
|
|
|
|
<el-tab-pane :label="t('ProductionPlan.Plan.tabPausedLabel')" name="3" />
|
|
|
|
|
<el-tab-pane :label="t('ProductionPlan.Plan.tabToStoreLabel')" name="4" />
|
|
|
|
|
<el-tab-pane :label="t('ProductionPlan.Plan.tabStoredLabel')" name="5" />
|
|
|
|
|
<el-tab-pane v-for="item in planStatusTabs" :key="item.value" :label="item.label" :name="item.value" />
|
|
|
|
|
</el-tabs>
|
|
|
|
|
<el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" :max-height="planTableMaxHeight" row-key="id">
|
|
|
|
|
<el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"
|
|
|
|
|
:max-height="planTableMaxHeight" row-key="id">
|
|
|
|
|
<!-- 投料进度子表的列表 -->
|
|
|
|
|
<el-table-column type="expand">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
@ -87,17 +80,10 @@
|
|
|
|
|
<PaigongRecordList :plan-id="scope.row.id"/>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
</el-tabs> -->
|
|
|
|
|
<el-tabs model-value="itemRequisitionDetail">
|
|
|
|
|
<el-tab-pane :label="t('ProductionPlan.Plan.detailItemRequisitionTabLabel')" name="itemRequisitionDetail">
|
|
|
|
|
<ItemRequisitionDetailList :item-requisition-id="scope.row.requisitionId" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tabs model-value="baogongRecord">
|
|
|
|
|
<el-tab-pane :label="t('ProductionPlan.Plan.detailBaogongRecordTabLabel')" name="baogongRecord">
|
|
|
|
|
<BaogongRecordList :key="`${scope.row.id}-${baogongRecordRefreshKey}`" :plan-id="scope.row.id" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane :label="t('ProductionPlan.Plan.detailInspectTabLabel')" name="zj" >
|
|
|
|
|
<ZjProductPreList :key="`${scope.row.id}-zj-${zjProductPreListRefreshKey}`" :ticket="scope.row.id"
|
|
|
|
|
@inspectable-change="(hasPending) => setInspectable(scope.row.id, hasPending)" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
</el-tabs>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
@ -108,22 +94,17 @@
|
|
|
|
|
<el-table-column :label="t('ProductionPlan.Plan.tableProductColumn')" align="center" prop="productName"
|
|
|
|
|
min-width="200px" sortable />
|
|
|
|
|
<el-table-column :label="t('ProductionPlan.Plan.tableDeviceNameColumn')" align="center" prop="deviceName"
|
|
|
|
|
sortable />
|
|
|
|
|
sortable min-width="100px"/>
|
|
|
|
|
<el-table-column :label="t('ProductionPlan.Plan.tablePlanNumberColumn')" align="center" prop="planNumber"
|
|
|
|
|
sortable />
|
|
|
|
|
sortable min-width="100px"/>
|
|
|
|
|
<el-table-column :label="t('ProductionPlan.Plan.tableFinishNumberColumn')" align="center" prop="passNumber"
|
|
|
|
|
sortable />
|
|
|
|
|
<el-table-column :label="t('ProductionPlan.Plan.tablePassRateColumn')" align="center" min-width="60px" sortable="custom">
|
|
|
|
|
sortable min-width="100px"/>
|
|
|
|
|
<el-table-column :label="t('ProductionPlan.Plan.tablePassRateColumn')" align="center" min-width="110px"
|
|
|
|
|
sortable="custom">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<div class="pass-rate-cell">
|
|
|
|
|
<el-progress
|
|
|
|
|
type="circle"
|
|
|
|
|
:percentage="Number(scope.row.passRate ?? 0)"
|
|
|
|
|
:width="40"
|
|
|
|
|
:stroke-width="4"
|
|
|
|
|
:show-text="false"
|
|
|
|
|
:color="Number(scope.row.passRate ?? 0) === 100 ? '#67c23a' : undefined"
|
|
|
|
|
/>
|
|
|
|
|
<el-progress type="circle" :percentage="Number(scope.row.passRate ?? 0)" :width="40" :stroke-width="4"
|
|
|
|
|
:show-text="false" :color="Number(scope.row.passRate ?? 0) === 100 ? '#67c23a' : undefined" />
|
|
|
|
|
<span class="pass-rate-text">{{ Number(scope.row.passRate ?? 0) }}%</span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
@ -212,8 +193,7 @@
|
|
|
|
|
v-if="scope.row.status === 2 || scope.row.status === 3 || scope.row.status === 8">
|
|
|
|
|
{{ t('ProductionPlan.Plan.actionFinishLabel') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button link type="primary"
|
|
|
|
|
@click="openStoreDialog(scope.row.code, scope.row.id, scope.row.isZj)"
|
|
|
|
|
<el-button link type="primary" @click="openStoreDialog(scope.row.code, scope.row.id, scope.row.isZj)"
|
|
|
|
|
v-hasPermi="['mes:plan:update']" v-if="scope.row.status === 4">
|
|
|
|
|
{{ t('ProductionPlan.Plan.actionStoreLabel') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
@ -251,12 +231,7 @@
|
|
|
|
|
<el-form label-width="80px">
|
|
|
|
|
<el-form-item label="选择仓库">
|
|
|
|
|
<el-select v-model="storeWarehouseId" placeholder="请选择仓库" filterable style="width: 100%">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in warehouseList"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.name"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
/>
|
|
|
|
|
<el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
@ -272,7 +247,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
|
|
|
|
import { dateFormatter2 } from '@/utils/formatTime'
|
|
|
|
|
import download from '@/utils/download'
|
|
|
|
|
import { PlanApi, PlanVO } from '@/api/mes/plan'
|
|
|
|
|
@ -284,8 +259,6 @@ import Paigong from "./components/Paigong.vue";
|
|
|
|
|
import TypePaigong from "./components/TypePaigong.vue";
|
|
|
|
|
import PlanDetail from "./components/PlanDetail.vue";
|
|
|
|
|
import Baogong from "./components/Baogong.vue";
|
|
|
|
|
import ItemRequisitionDetailList from "@/views/mes/itemrequisition/components/ItemRequisitionDetailList.vue";
|
|
|
|
|
import ZjProductPreList from "@/views/mes/zjproduct/components/ZjProductPreList.vue";
|
|
|
|
|
import ZjTaskForm from "@/views/mes/zjTask/ZjTaskForm.vue";
|
|
|
|
|
import BaogongRecordList from "@/views/mes/baogongrecord/components/BaogongRecordList.vue";
|
|
|
|
|
import { ZjTaskApi } from '@/api/mes/zjtask'
|
|
|
|
|
@ -296,7 +269,13 @@ const taskList = ref<TaskVO[]>([]) // 列表
|
|
|
|
|
/** 生产计划 列表 */
|
|
|
|
|
defineOptions({ name: 'Plan' })
|
|
|
|
|
const activeName = ref('') // 列表 tab
|
|
|
|
|
|
|
|
|
|
const planStatusTabs = computed(() => [
|
|
|
|
|
{ label: '所有', value: '' },
|
|
|
|
|
...getStrDictOptions(DICT_TYPE.MES_PLAN_STATUS).map((item) => ({
|
|
|
|
|
label: item.label,
|
|
|
|
|
value: item.value
|
|
|
|
|
}))
|
|
|
|
|
])
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
const { query } = useRoute() // 查询参数
|
|
|
|
|
@ -317,7 +296,6 @@ const updatePlanTableMaxHeight = async () => {
|
|
|
|
|
}
|
|
|
|
|
const inspectableMap = reactive<Record<number, boolean | undefined>>({})
|
|
|
|
|
const baogongRecordRefreshKey = ref(0)
|
|
|
|
|
const zjProductPreListRefreshKey = ref(0)
|
|
|
|
|
const queryParams = reactive({
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
@ -432,9 +410,7 @@ onMounted(async () => {
|
|
|
|
|
// 加载产品、任务单
|
|
|
|
|
productList.value = await ProductApi.getMesProductSimpleList()
|
|
|
|
|
taskList.value = await TaskApi.getTaskList()
|
|
|
|
|
if (!query.taskId || !query.productId) {
|
|
|
|
|
queryParams.status = '1'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await getList()
|
|
|
|
|
updatePlanTableMaxHeight()
|
|
|
|
|
window.addEventListener('resize', updatePlanTableMaxHeight)
|
|
|
|
|
@ -470,12 +446,7 @@ const handleBaogongSuccess = async () => {
|
|
|
|
|
await getList()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleInspectExpand = (row: PlanVO) => {
|
|
|
|
|
tableRef.value?.toggleRowExpansion?.(row, true)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleZjTaskSuccess = async () => {
|
|
|
|
|
zjProductPreListRefreshKey.value += 1
|
|
|
|
|
await getList()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -484,11 +455,6 @@ const openZjTaskForm = (row: PlanVO) => {
|
|
|
|
|
zjTaskFormRef.value.open('create', undefined, { ticketType: 1, ticket: row.id, ticketName: row.code, productId: row.productId })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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')
|
|
|
|
|
@ -589,7 +555,7 @@ const handleZjStatus = async (planCode: string, id: number) => {
|
|
|
|
|
|
|
|
|
|
/** tab 切换 */
|
|
|
|
|
const handleTabClick = (tab: TabsPaneContext) => {
|
|
|
|
|
queryParams.status = tab.paneName
|
|
|
|
|
queryParams.status = tab.paneName === '' || tab.paneName === undefined ? undefined : String(tab.paneName)
|
|
|
|
|
handleQuery()
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|