|
|
|
|
@ -117,53 +117,58 @@
|
|
|
|
|
<el-tab-pane label="试产" name="6" />
|
|
|
|
|
<el-tab-pane label="量产" name="2" />
|
|
|
|
|
<el-tab-pane label="暂停" name="3" />
|
|
|
|
|
<el-tab-pane label="完工" name="4" />
|
|
|
|
|
<el-tab-pane label="待入库" name="7" />
|
|
|
|
|
<el-tab-pane label="待入库" name="4" />
|
|
|
|
|
<el-tab-pane label="已入库" name="5" />
|
|
|
|
|
</el-tabs>
|
|
|
|
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
|
|
|
|
<!-- 投料进度子表的列表 -->
|
|
|
|
|
<el-table-column type="expand">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-tabs v-if="scope.row.status > 0" model-value="itemRequisitionDetail">
|
|
|
|
|
<el-tabs v-if="scope.row.status > 0 && scope.row.status != 6" model-value="itemRequisitionDetail">
|
|
|
|
|
<el-tab-pane label="投料明细" name="itemRequisitionDetail" >
|
|
|
|
|
<ItemRequisitionDetailList :item-requisition-id="scope.row.requisitionId" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="派工记录" name="paigongRecord">
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<!-- <el-tab-pane label="派工记录" name="paigongRecord">
|
|
|
|
|
<PaigongRecordList :plan-id="scope.row.id"/>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
</el-tab-pane> -->
|
|
|
|
|
</el-tabs>
|
|
|
|
|
<el-tabs v-if="scope.row.status == 0" model-value="paigongRecord">
|
|
|
|
|
<!-- <el-tabs v-if="scope.row.status == 0" model-value="paigongRecord">
|
|
|
|
|
<el-tab-pane label="派工记录" name="paigongRecord">
|
|
|
|
|
<PaigongRecordList :plan-id="scope.row.id"/>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
</el-tabs> -->
|
|
|
|
|
<el-tabs v-if="scope.row.status == 6" model-value="zj">
|
|
|
|
|
<el-tab-pane label="检验明细" name="zj">
|
|
|
|
|
<ZjProductPreList :product-id="scope.row.productId"/>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
</el-tabs>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="计划编码" align="center" prop="code" min-width="150px" />
|
|
|
|
|
<el-table-column label="产品" align="center" prop="productName" min-width="200px" sortable/>
|
|
|
|
|
<el-table-column label="计划编码" align="center" prop="code" min-width="180px" />
|
|
|
|
|
<el-table-column label="产品" align="center" prop="productName" min-width="200px" sortable/>
|
|
|
|
|
<!-- <el-table-column label="任务单" align="center" prop="taskCode" min-width="150px" />-->
|
|
|
|
|
<el-table-column label="班别" align="center" prop="groupType" sortable>
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.MES_GROUP_TYPE" :value="scope.row.groupType" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="成型数量" align="center" prop="planNumber" />
|
|
|
|
|
<el-table-column label="热压数量" align="center" prop="reyaNumber" />
|
|
|
|
|
<el-table-column label="生产线" align="center" prop="feedingPipelineName"/>
|
|
|
|
|
<el-table-column label="数量" align="center" prop="planNumber" />
|
|
|
|
|
<!-- <el-table-column label="热压数量" align="center" prop="reyaNumber" /> -->
|
|
|
|
|
<el-table-column label="状态" align="center" prop="status" sortable>
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.MES_PLAN_STATUS" :value="scope.row.status" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="计划开始时间" align="center" sortable prop="planStartTime" :formatter="dateFormatter2" width="150px"/>
|
|
|
|
|
<el-table-column label="计划结束时间" align="center" sortable prop="planEndTime" :formatter="dateFormatter2" width="150px"/>
|
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
|
|
|
<el-table-column label="领料人" align="center" prop="productionManagerName" />
|
|
|
|
|
<el-table-column label="生产线" align="center" prop="feedingPipeline">
|
|
|
|
|
<el-table-column label="班别" align="center" prop="groupType" sortable>
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.MES_FEEDING_PIPELINE" :value="scope.row.feedingPipeline" />
|
|
|
|
|
<dict-tag :type="DICT_TYPE.MES_GROUP_TYPE" :value="scope.row.groupType" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="领料人" align="center" prop="productionManagerName" />
|
|
|
|
|
<el-table-column label="计划开始时间" align="center" sortable prop="planStartTime" :formatter="dateFormatter2" width="150px"/>
|
|
|
|
|
<el-table-column label="计划结束时间" align="center" sortable prop="planEndTime" :formatter="dateFormatter2" width="150px"/>
|
|
|
|
|
<el-table-column label="是否检验" align="center" prop="isZj" v-if="activeName === '6'">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.MES_ZJ_PRODUCT" :value="scope.row.isZj" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
|
|
|
<el-table-column label="操作" align="center" fixed="right" width="350">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
@ -204,16 +209,43 @@
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="handleStatus(scope.row.code, scope.row.id, 'start',2,'开工')"
|
|
|
|
|
@click="handleStatus(scope.row.code, scope.row.id, 'pre',6,'试产', scope.row.isZj)"
|
|
|
|
|
v-hasPermi="['mes:plan:update']"
|
|
|
|
|
v-if="scope.row.status === 1 && scope.row.isPreProduction === 1"
|
|
|
|
|
>
|
|
|
|
|
试产
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="primary"
|
|
|
|
|
v-hasPermi="['mes:plan:update']"
|
|
|
|
|
@click="handleZjStatus(scope.row.code, scope.row.id)"
|
|
|
|
|
v-if="scope.row.status === 6"
|
|
|
|
|
>
|
|
|
|
|
检验
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="handleStatus(scope.row.code, scope.row.id, 'start',2,'量产', scope.row.isZj)"
|
|
|
|
|
v-hasPermi="['mes:plan:update']"
|
|
|
|
|
v-if="(scope.row.status === 1 && scope.row.isPreProduction === 0) || scope.row.status === 6"
|
|
|
|
|
>
|
|
|
|
|
量产
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="primary"
|
|
|
|
|
v-hasPermi="['mes:plan:update']"
|
|
|
|
|
v-if="scope.row.status === 1 || scope.row.status ===3 || scope.row.status ===4"
|
|
|
|
|
@click="openBaogongForm(scope.row.code, scope.row.id)"
|
|
|
|
|
v-if="scope.row.status === 2"
|
|
|
|
|
>
|
|
|
|
|
开工
|
|
|
|
|
报工
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="handleStatus(scope.row.code,scope.row.id, 'pause',3,'暂停')"
|
|
|
|
|
@click="handleStatus(scope.row.code,scope.row.id, 'pause',3,'暂停', scope.row.isZj)"
|
|
|
|
|
v-hasPermi="['mes:plan:update']"
|
|
|
|
|
v-if="scope.row.status === 2"
|
|
|
|
|
>
|
|
|
|
|
@ -222,18 +254,27 @@
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="handleStatus(scope.row.code, scope.row.id, 'end',4,'完工')"
|
|
|
|
|
@click="handleStatus(scope.row.code, scope.row.id, 'end',4,'完工', scope.row.isZj)"
|
|
|
|
|
v-hasPermi="['mes:plan:update']"
|
|
|
|
|
v-if="scope.row.status === 2 || scope.row.status === 3"
|
|
|
|
|
>
|
|
|
|
|
完工
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="handleStatus(scope.row.code, scope.row.id, 'store',5,'入库', scope.row.isZj)"
|
|
|
|
|
v-hasPermi="['mes:plan:update']"
|
|
|
|
|
v-if="scope.row.status === 4"
|
|
|
|
|
>
|
|
|
|
|
入库
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="danger"
|
|
|
|
|
@click="handleDelete(scope.row.id)"
|
|
|
|
|
v-hasPermi="['mes:plan:delete']"
|
|
|
|
|
v-if="scope.row.status === 0 || scope.row.status === 3"
|
|
|
|
|
v-if="scope.row.status === 0"
|
|
|
|
|
>
|
|
|
|
|
删除
|
|
|
|
|
</el-button>
|
|
|
|
|
@ -259,10 +300,13 @@
|
|
|
|
|
|
|
|
|
|
<!-- 工序派工弹出 -->
|
|
|
|
|
<TypePaigong ref="typePaiFormRef" @success="getList" />
|
|
|
|
|
|
|
|
|
|
<!-- 报工弹出 -->
|
|
|
|
|
<Baogong ref="baogongFormRef" @success="getList" />
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { getIntDictOptions, getBoolDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
import { DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
import {dateFormatter2} from '@/utils/formatTime'
|
|
|
|
|
import download from '@/utils/download'
|
|
|
|
|
import { PlanApi, PlanVO } from '@/api/mes/plan'
|
|
|
|
|
@ -273,13 +317,14 @@ import ItemNeedIndex from "@/views/mes/bom/ItemNeedIndex.vue";
|
|
|
|
|
import Paigong from "./components/Paigong.vue";
|
|
|
|
|
import TypePaigong from "./components/TypePaigong.vue";
|
|
|
|
|
import ItemRequisitionDetailList from "@/views/mes/itemrequisition/components/ItemRequisitionDetailList.vue";
|
|
|
|
|
import PaigongRecordList from "@/views/mes/paigongrecord/components/PaigongRecordList.vue";
|
|
|
|
|
import ZjProductPreList from "@/views/mes/zjproduct/components/ZjProductPreList.vue";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const productList = ref<ProductVO[]>([]) // 产品列表
|
|
|
|
|
const taskList = ref<TaskVO[]>([]) // 列表
|
|
|
|
|
/** 生产计划 列表 */
|
|
|
|
|
defineOptions({ name: 'Plan' })
|
|
|
|
|
const activeName = ref('1') // 列表 tab
|
|
|
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
@ -381,10 +426,9 @@ onMounted(async () => {
|
|
|
|
|
productList.value = await ProductApi.getMesProductSimpleList()
|
|
|
|
|
taskList.value = await TaskApi.getTaskList()
|
|
|
|
|
if(!query.taskId || !query.productId) {
|
|
|
|
|
queryParams.status = '0'
|
|
|
|
|
queryParams.status = '1'
|
|
|
|
|
}
|
|
|
|
|
await getList()
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
/** 物料需求 */
|
|
|
|
|
const itemFormRef = ref()
|
|
|
|
|
@ -403,10 +447,21 @@ const openTypePaiForm = (planCode: string, planId: number) => {
|
|
|
|
|
typePaiFormRef.value.open(planCode, planId)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 工序派工 */
|
|
|
|
|
const baogongFormRef = ref()
|
|
|
|
|
const openBaogongForm = (planCode: string, planId: number) => {
|
|
|
|
|
baogongFormRef.value.open(planCode, planId)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 开工 */
|
|
|
|
|
const handleStatus = async (planCode:string, id: number,
|
|
|
|
|
type:string, status:number, tip:string) => {
|
|
|
|
|
type:string, status:number, tip:string, isZj: number) => {
|
|
|
|
|
try {
|
|
|
|
|
// if((isZj === 0 || isZj === null) && tip === "量产") {
|
|
|
|
|
// // message.alertError("请先完成检验")
|
|
|
|
|
// // 二次确认
|
|
|
|
|
// await message.confirm("计划:"+planCode+"确定"+tip+"吗?",planCode)
|
|
|
|
|
// }
|
|
|
|
|
// 二次确认
|
|
|
|
|
await message.confirm("计划:"+planCode+"确定"+tip+"吗?",planCode)
|
|
|
|
|
// 发起
|
|
|
|
|
@ -422,8 +477,23 @@ const handleStatus = async (planCode:string, id: number,
|
|
|
|
|
} catch {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 更新质检 */
|
|
|
|
|
const handleZjStatus = async (planCode:string, id: number) => {
|
|
|
|
|
try {
|
|
|
|
|
// 二次确认
|
|
|
|
|
await message.confirm("计划:"+planCode+"确定质检吗?",planCode)
|
|
|
|
|
// 发起
|
|
|
|
|
const data ={
|
|
|
|
|
id: id
|
|
|
|
|
}
|
|
|
|
|
await PlanApi.updatePlanZjStatus(data)
|
|
|
|
|
message.success(t('common.success'))
|
|
|
|
|
// 刷新列表
|
|
|
|
|
await getList()
|
|
|
|
|
} catch {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** tab 切换 */
|
|
|
|
|
let activeName = '1'
|
|
|
|
|
const handleTabClick = (tab: TabsPaneContext) => {
|
|
|
|
|
queryParams.status = tab.paneName
|
|
|
|
|
handleQuery()
|
|
|
|
|
|