|
|
|
|
@ -160,21 +160,6 @@
|
|
|
|
|
:formatter="dateFormatter"
|
|
|
|
|
width="180px"
|
|
|
|
|
/>
|
|
|
|
|
<!-- <el-table-column-->
|
|
|
|
|
<!-- label="实际开始时间"-->
|
|
|
|
|
<!-- align="center"-->
|
|
|
|
|
<!-- prop="startTime"-->
|
|
|
|
|
<!-- :formatter="dateFormatter"-->
|
|
|
|
|
<!-- width="180px"-->
|
|
|
|
|
<!-- />-->
|
|
|
|
|
<!-- <el-table-column-->
|
|
|
|
|
<!-- label="实际结束时间"-->
|
|
|
|
|
<!-- align="center"-->
|
|
|
|
|
<!-- prop="endTime"-->
|
|
|
|
|
<!-- :formatter="dateFormatter"-->
|
|
|
|
|
<!-- width="180px"-->
|
|
|
|
|
<!-- />-->
|
|
|
|
|
|
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
|
|
|
|
|
|
|
|
<el-table-column label="操作" align="center" fixed="right" width="250">
|
|
|
|
|
@ -184,6 +169,7 @@
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="openForm('update', scope.row.id)"
|
|
|
|
|
v-hasPermi="['mes:plan:update']"
|
|
|
|
|
v-if="scope.row.status === 0"
|
|
|
|
|
>
|
|
|
|
|
编辑
|
|
|
|
|
</el-button>
|
|
|
|
|
@ -198,24 +184,36 @@
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="openForm('update', scope.row.id)"
|
|
|
|
|
@click="openPaiForm(scope.row.code, scope.row.id)"
|
|
|
|
|
v-hasPermi="['mes:plan:update']"
|
|
|
|
|
v-if="scope.row.status === 0"
|
|
|
|
|
>
|
|
|
|
|
派工
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="openForm('update', scope.row.id)"
|
|
|
|
|
@click="handleStatus(scope.row.code, scope.row.id, 'start',2,'开工')"
|
|
|
|
|
v-hasPermi="['mes:plan:update']"
|
|
|
|
|
v-if="scope.row.status === 1"
|
|
|
|
|
>
|
|
|
|
|
开工
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="openForm('update', scope.row.id)"
|
|
|
|
|
@click="handleStatus(scope.row.code,scope.row.id, 'pause',3,'暂停')"
|
|
|
|
|
v-hasPermi="['mes:plan:update']"
|
|
|
|
|
v-if="scope.row.status === 2"
|
|
|
|
|
>
|
|
|
|
|
暂停
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="handleStatus(scope.row.code, scope.row.id, 'end',4,'完工')"
|
|
|
|
|
v-hasPermi="['mes:plan:update']"
|
|
|
|
|
v-if="scope.row.status === 2 || scope.row.status === 3"
|
|
|
|
|
>
|
|
|
|
|
完工
|
|
|
|
|
</el-button>
|
|
|
|
|
@ -224,6 +222,7 @@
|
|
|
|
|
type="danger"
|
|
|
|
|
@click="handleDelete(scope.row.id)"
|
|
|
|
|
v-hasPermi="['mes:plan:delete']"
|
|
|
|
|
v-if="scope.row.status === 0 || scope.row.status === 3"
|
|
|
|
|
>
|
|
|
|
|
删除
|
|
|
|
|
</el-button>
|
|
|
|
|
@ -243,6 +242,9 @@
|
|
|
|
|
<PlanForm ref="formRef" @success="getList" />
|
|
|
|
|
<!-- 物料列表 -->
|
|
|
|
|
<ItemNeedIndex ref="itemFormRef" @success="getList" />
|
|
|
|
|
|
|
|
|
|
<!-- 派工弹出 -->
|
|
|
|
|
<Paigong ref="paiFormRef" @success="getList" />
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
@ -254,6 +256,7 @@ import PlanForm from './PlanForm.vue'
|
|
|
|
|
import {ProductApi, ProductVO} from "@/api/erp/product/product";
|
|
|
|
|
import {TaskApi, TaskVO} from "@/api/mes/task";
|
|
|
|
|
import ItemNeedIndex from "@/views/mes/bom/ItemNeedIndex.vue";
|
|
|
|
|
import Paigong from "./components/Paigong.vue";
|
|
|
|
|
|
|
|
|
|
const productList = ref<ProductVO[]>([]) // 产品列表
|
|
|
|
|
const taskList = ref<TaskVO[]>([]) // 列表
|
|
|
|
|
@ -365,4 +368,29 @@ const itemFormRef = ref()
|
|
|
|
|
const openItemNeed = (planCode:string, planId: number) => {
|
|
|
|
|
itemFormRef.value.open("plan","计划-"+planCode, planId)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 派工 */
|
|
|
|
|
const paiFormRef = ref()
|
|
|
|
|
const openPaiForm = (planCode: string, planId: number) => {
|
|
|
|
|
paiFormRef.value.open(planCode, planId)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 开工 */
|
|
|
|
|
const handleStatus = async (planCode:string, id: number,
|
|
|
|
|
type:string, status:number, tip:string) => {
|
|
|
|
|
try {
|
|
|
|
|
// 二次确认
|
|
|
|
|
await message.confirm("计划:"+planCode+"确定"+tip+"吗?",planCode)
|
|
|
|
|
// 发起
|
|
|
|
|
const data ={
|
|
|
|
|
id: id,
|
|
|
|
|
code: type,
|
|
|
|
|
status: status // 状态
|
|
|
|
|
}
|
|
|
|
|
await PlanApi.updatePlanStatus(data)
|
|
|
|
|
message.success(t('common.success'))
|
|
|
|
|
// 刷新列表
|
|
|
|
|
await getList()
|
|
|
|
|
} catch {}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|