|
|
|
|
@ -204,7 +204,7 @@
|
|
|
|
|
{{ t('ProductionPlan.Plan.actionFinishLabel') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button link type="primary"
|
|
|
|
|
@click="handleStatus(scope.row.code, scope.row.id, 'store', 5, t('ProductionPlan.Plan.actionStoreLabel'), scope.row.isZj)"
|
|
|
|
|
@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>
|
|
|
|
|
@ -237,6 +237,26 @@
|
|
|
|
|
<!-- 详情弹窗 -->
|
|
|
|
|
<PlanDetail ref="detailRef" />
|
|
|
|
|
|
|
|
|
|
<!-- 入库仓库选择弹窗 -->
|
|
|
|
|
<Dialog v-model="storeDialogVisible" title="入库" width="400px">
|
|
|
|
|
<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-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<el-button @click="storeDialogVisible = false">取消</el-button>
|
|
|
|
|
<el-button type="primary" @click="confirmStore" :disabled="!storeWarehouseId">确定</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</Dialog>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
@ -256,6 +276,7 @@ import ItemRequisitionDetailList from "@/views/mes/itemrequisition/components/It
|
|
|
|
|
import ZjProductPreList from "@/views/mes/zjproduct/components/ZjProductPreList.vue";
|
|
|
|
|
import BaogongRecordList from "@/views/mes/baogongrecord/components/BaogongRecordList.vue";
|
|
|
|
|
import { ZjTaskApi } from '@/api/mes/zjtask'
|
|
|
|
|
import { WarehouseApi, WarehouseVO } from '@/api/erp/stock/warehouse'
|
|
|
|
|
|
|
|
|
|
const productList = ref<ProductVO[]>([]) // 产品列表
|
|
|
|
|
const taskList = ref<TaskVO[]>([]) // 列表
|
|
|
|
|
@ -295,6 +316,10 @@ const queryParams = reactive({
|
|
|
|
|
})
|
|
|
|
|
const queryFormRef = ref() // 搜索的表单
|
|
|
|
|
const exportLoading = ref(false) // 导出的加载中
|
|
|
|
|
const warehouseList = ref<WarehouseVO[]>([]) // 仓库列表
|
|
|
|
|
const storeDialogVisible = ref(false) // 入库仓库选择弹窗
|
|
|
|
|
const storeWarehouseId = ref<number>() // 选中的仓库ID
|
|
|
|
|
const storePlanInfo = ref<{ planCode: string; id: number; isZj: number }>() // 入库计划信息
|
|
|
|
|
|
|
|
|
|
/** 详情操作 */
|
|
|
|
|
const detailRef = ref()
|
|
|
|
|
@ -437,9 +462,34 @@ const refreshInspectableMap = async (rows: PlanVO[]) => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 入库 - 打开仓库选择弹窗 */
|
|
|
|
|
const openStoreDialog = async (planCode: string, id: number, isZj: number) => {
|
|
|
|
|
storePlanInfo.value = { planCode, id, isZj }
|
|
|
|
|
storeWarehouseId.value = undefined
|
|
|
|
|
if (!warehouseList.value.length) {
|
|
|
|
|
warehouseList.value = await WarehouseApi.getWarehouseSimpleList()
|
|
|
|
|
}
|
|
|
|
|
storeDialogVisible.value = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 入库 - 确认入库 */
|
|
|
|
|
const confirmStore = async () => {
|
|
|
|
|
if (!storePlanInfo.value || !storeWarehouseId.value) return
|
|
|
|
|
storeDialogVisible.value = false
|
|
|
|
|
await handleStatus(
|
|
|
|
|
storePlanInfo.value.planCode,
|
|
|
|
|
storePlanInfo.value.id,
|
|
|
|
|
'store',
|
|
|
|
|
5,
|
|
|
|
|
t('ProductionPlan.Plan.actionStoreLabel'),
|
|
|
|
|
storePlanInfo.value.isZj,
|
|
|
|
|
storeWarehouseId.value
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 开工 */
|
|
|
|
|
const handleStatus = async (planCode: string, id: number,
|
|
|
|
|
type: string, status: number, tip: string, isZj: number) => {
|
|
|
|
|
type: string, status: number, tip: string, isZj: number, warehouseId?: number) => {
|
|
|
|
|
try {
|
|
|
|
|
// if((isZj === 0 || isZj === null) && tip === "量产") {
|
|
|
|
|
// // message.alertError("请先完成检验")
|
|
|
|
|
@ -452,10 +502,13 @@ const handleStatus = async (planCode: string, id: number,
|
|
|
|
|
t('ProductionPlan.Plan.statusConfirmTitle')
|
|
|
|
|
)
|
|
|
|
|
// 发起
|
|
|
|
|
const data = {
|
|
|
|
|
const data: any = {
|
|
|
|
|
id: id,
|
|
|
|
|
code: type,
|
|
|
|
|
status: status // 状态
|
|
|
|
|
status: status
|
|
|
|
|
}
|
|
|
|
|
if (warehouseId) {
|
|
|
|
|
data.warehouseId = warehouseId
|
|
|
|
|
}
|
|
|
|
|
await PlanApi.updatePlanStatus(data)
|
|
|
|
|
message.success(t('common.success'))
|
|
|
|
|
|