feat:待入库-入库按钮添加仓库选择

pull/1/head
黄伟杰 1 month ago
parent 1966a2c10e
commit ad0a1ee6c4

@ -204,7 +204,7 @@
{{ t('ProductionPlan.Plan.actionFinishLabel') }} {{ t('ProductionPlan.Plan.actionFinishLabel') }}
</el-button> </el-button>
<el-button link type="primary" <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"> v-hasPermi="['mes:plan:update']" v-if="scope.row.status === 4">
{{ t('ProductionPlan.Plan.actionStoreLabel') }} {{ t('ProductionPlan.Plan.actionStoreLabel') }}
</el-button> </el-button>
@ -237,6 +237,26 @@
<!-- 详情弹窗 --> <!-- 详情弹窗 -->
<PlanDetail ref="detailRef" /> <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> </template>
<script setup lang="ts"> <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 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 { ZjTaskApi } from '@/api/mes/zjtask' import { ZjTaskApi } from '@/api/mes/zjtask'
import { WarehouseApi, WarehouseVO } from '@/api/erp/stock/warehouse'
const productList = ref<ProductVO[]>([]) // const productList = ref<ProductVO[]>([]) //
const taskList = ref<TaskVO[]>([]) // const taskList = ref<TaskVO[]>([]) //
@ -295,6 +316,10 @@ const queryParams = reactive({
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
const exportLoading = ref(false) // 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() 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, 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 { try {
// if((isZj === 0 || isZj === null) && tip === "") { // if((isZj === 0 || isZj === null) && tip === "") {
// // message.alertError("") // // message.alertError("")
@ -452,10 +502,13 @@ const handleStatus = async (planCode: string, id: number,
t('ProductionPlan.Plan.statusConfirmTitle') t('ProductionPlan.Plan.statusConfirmTitle')
) )
// //
const data = { const data: any = {
id: id, id: id,
code: type, code: type,
status: status // status: status
}
if (warehouseId) {
data.warehouseId = warehouseId
} }
await PlanApi.updatePlanStatus(data) await PlanApi.updatePlanStatus(data)
message.success(t('common.success')) message.success(t('common.success'))

Loading…
Cancel
Save