2025-01-09 18:29:48 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<el-card class="hl-card" style="position: relative">
|
|
|
|
|
|
<template #header>
|
|
|
|
|
|
<span>审核页</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="160px" v-loading="formLoading">
|
|
|
|
|
|
<!-- 基础信息 -->
|
|
|
|
|
|
<el-card class="hl-card-info">
|
|
|
|
|
|
<template #header>
|
|
|
|
|
|
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">基础信息</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
<el-form-item label=" 采购单号" prop="purchaseNo">
|
|
|
|
|
|
<el-input class="!w-265px" placeholder="系统自动生成" v-model="formData.purchaseNo" disabled />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
<el-form-item label="采购单类型" prop="purchaseType" :rules="formRules.purchaseType">
|
|
|
|
|
|
<el-select v-model="formData.purchaseType" clearable class="!w-265px" disabled>
|
|
|
|
|
|
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PROJECT_PURCHASE_ORDER_TYPE)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
<el-form-item label="结算币种" prop="currencyType">
|
|
|
|
|
|
<el-select v-model="formData.currencyType" clearable class="!w-265px" disabled>
|
|
|
|
|
|
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_CURRENCY)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="80">
|
|
|
|
|
|
<el-form-item label="备注" prop="description">
|
|
|
|
|
|
<el-input class="!w-713px" type="textarea" v-model="formData.description" show-word-limit disabled maxlength="200" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
<el-form-item label="单据日期" prop="createTime">
|
|
|
|
|
|
<el-date-picker class="!w-265px" v-model="formData.createTime" value-format="x" placeholder="单据日期" disabled />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
<el-form-item label="物料需求计划编号" prop="materialPlanNo">
|
|
|
|
|
|
<el-input class="!w-265px" v-model="formData.materialPlanNo" disabled />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
<el-form-item label="暂估价金额(元)" prop="estimatedPrice">
|
|
|
|
|
|
<el-input class="!w-265px" v-model="formData.estimatedPrice" placeholder="暂估价金额(元)" disabled />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
<el-form-item label="单据状态" prop="status">
|
|
|
|
|
|
<el-select v-model="formData.status" placeholder="单据状态" clearable class="!w-265px" disabled>
|
|
|
|
|
|
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PURCHASE_ORDER_STATUS)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
<el-form-item label="采购物类型" prop="goodsType" :rules="formRules.goodsType">
|
|
|
|
|
|
<el-select v-model="formData.goodsType" placeholder="下拉选择" clearable class="!w-265px" disabled>
|
|
|
|
|
|
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PROJECT_PURCHASE_GOODS_TYPE)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
<el-form-item label="实际价金额(元)" prop="actualPrice">
|
|
|
|
|
|
<el-input class="!w-265px" v-model="formData.actualPrice" placeholder="实际价金额(元)" disabled />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
<el-form-item label="供应商" prop="supplierId" :rules="formRules.supplierId">
|
|
|
|
|
|
<el-select v-model="formData.supplierId" placeholder="下拉选择" clearable class="!w-265px" disabled>
|
|
|
|
|
|
<el-option v-for="dict in supplierInit" :key="dict.id" :label="dict.name" :value="dict.id" />
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
<el-form-item label="采购合同号" prop="contractNo">
|
|
|
|
|
|
<el-input class="!w-265px" v-model="formData.contractNo" placeholder="采购合同号" disabled />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
<el-form-item label="税率(%)" prop="taxRatio">
|
|
|
|
|
|
<el-input class="!w-265px" v-model="formData.taxRatio" placeholder="税率" disabled />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 物料信息-非计划 -->
|
2025-06-20 18:59:28 +08:00
|
|
|
|
<!-- <el-card class="hl-card-info" v-if="(formData.purchaseType == 2||formData.purchaseType == 3) && formData.goodsType == 1">-->
|
|
|
|
|
|
<!-- <template #header>-->
|
|
|
|
|
|
<!-- <div class="hl-card-info-icona"></div><span class="hl-card-info-text">物料信息</span>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- <el-row>-->
|
|
|
|
|
|
<!-- <el-col>-->
|
|
|
|
|
|
<!-- <el-card class="hl-incard">-->
|
|
|
|
|
|
<!-- <el-col>-->
|
|
|
|
|
|
<!-- <el-button class="hl-addbutton" type="primary" size="large" @click="onAddItem" disabled>新增</el-button>-->
|
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
|
<!-- <el-form ref="subFormRef" :model="formData.matItemDOList" :rules="subFormRules" v-loading="subFormLoading" label-width="0">-->
|
|
|
|
|
|
<!-- <el-table :data="formData.matItemDOList" class="hl-table" :stripe="true" :show-overflow-tooltip="true">-->
|
|
|
|
|
|
<!-- <el-table-column type="index" label="序号" fixed align="center" width="60" />-->
|
|
|
|
|
|
<!-- <el-table-column prop="matName" label="物料名称" min-width="200" align="center" />-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <el-table-column prop="matType" label="物料类型" min-width="120" align="center">-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.matType" v-if="scope.row.matType ? true : false" />-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="matSpec" label="规格型号" min-width="100" align="center" />、-->
|
|
|
|
|
|
<!-- <el-table-column prop="matRest" label="库存数量" min-width="100" align="center" />-->
|
|
|
|
|
|
<!-- <el-table-column prop="purchaseAmount" min-width="180" align="center">-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #header><span class="hl-table_header">*</span>采购数量</template>-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-form-item :prop="`${scope.$index}.purchaseAmount`" :rules="subFormRules.purchaseAmount" class="mb-0px!">-->
|
|
|
|
|
|
<!-- <el-input-number style="width: 100%" v-model="scope.row.purchaseAmount" placeholder="采购数量" :min="0" :precision="2" disabled />-->
|
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="estimatedPrice" min-width="200" align="center">-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #header><span class="hl-table_header">*</span>暂估单价</template>-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subFormRules.estimatedPrice" class="mb-0px!">-->
|
|
|
|
|
|
<!-- <el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估单价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />-->
|
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="actualPrice" min-width="200" align="center">-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #header>实际单价</template>-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!">-->
|
|
|
|
|
|
<!-- <el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际单价" @change="handleActualPrice" :min="0" :precision="6" disabled />-->
|
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column min-width="180" align="center">-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #header> <span class="hl-table_header">*</span>预计到货日期 </template>-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #default="{ row, $index }">-->
|
|
|
|
|
|
<!-- <el-form-item :prop="`${$index}.arriveTime`" class="mb-0px!">-->
|
|
|
|
|
|
<!-- <el-date-picker class="!w-265px" v-model="row.arriveTime" type="date" value-format="x" placeholder="预计到货日期" disabled />-->
|
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="matId" min-width="200" align="center">-->
|
|
|
|
|
|
<!-- <template #header> <span class="hl-table_header">*</span>物料编码</template>-->
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-form-item :prop="`${scope.$index}.matId`" :rules="subFormRules.matId" class="mb-0px!">-->
|
|
|
|
|
|
<!-- <MaterialSelect :key="scope.row.matId" v-model="scope.row.matId" disabled @update:new-value="handleSelectedMaterial(scope.$index, $event)" />-->
|
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="matUnit" label="系统单位" min-width="100" align="center">-->
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.matUnit" v-if="scope.row.matUnit ? true : false" />-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="description" min-width="180" label="备注" align="center">-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-input v-model="scope.row.description" disabled />-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column label="操作" fixed="right" align="center" min-width="100">-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-button link type="danger" size="small" @click.prevent="handleDelete2(scope.$index)" disabled>-->
|
|
|
|
|
|
<!-- 删除-->
|
|
|
|
|
|
<!-- </el-button>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- </el-table>-->
|
|
|
|
|
|
<!-- </el-form>-->
|
|
|
|
|
|
<!-- </el-card>-->
|
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
|
<!-- </el-row>-->
|
|
|
|
|
|
<!-- </el-card>-->
|
2025-01-09 18:29:48 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 物料信息-计划 -->
|
2025-06-20 18:59:28 +08:00
|
|
|
|
<el-card class="hl-card-info" >
|
2025-01-09 18:29:48 +08:00
|
|
|
|
<template #header>
|
|
|
|
|
|
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">物料信息</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col>
|
|
|
|
|
|
<el-card class="hl-incard">
|
|
|
|
|
|
<el-col>
|
|
|
|
|
|
<el-button class="hl-addbutton" type="primary" size="large" @click="onAddItemOpen" disabled>新增</el-button>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-form ref="subMatPlanFormRef" :model="formData.matItemDOList" :rules="subMatPlanFormRules" v-loading="subFormLoading" label-width="0">
|
|
|
|
|
|
<el-table :data="formData.matItemDOList" class="hl-table" :stripe="true" :show-overflow-tooltip="true">
|
|
|
|
|
|
<el-table-column type="index" label="序号" fixed align="center" width="60" />
|
|
|
|
|
|
<el-table-column prop="matId" fixed min-width="200" align="center">
|
|
|
|
|
|
|
|
|
|
|
|
<template #header> <span class="hl-table_header">*</span>物料编码/名称 </template>
|
|
|
|
|
|
|
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
<el-form-item :prop="`${scope.$index}.matId`" :rules="subMatPlanFormRules.matId" class="mb-0px!">
|
|
|
|
|
|
<MaterialSelect :key="scope.row.matId" v-model="scope.row.matId" disabled @update:new-value="handleSelectedMaterial(scope.$index, $event)" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column prop="matType" label="物料类型" min-width="120" align="center">
|
|
|
|
|
|
|
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.matType" v-if="scope.row.matType ? true : false" />
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column prop="matSpec" label="规格/型号" min-width="100" align="center" />
|
2025-06-20 18:59:28 +08:00
|
|
|
|
<el-table-column prop="boomAmount" label="需求数量" min-width="100" align="center" />
|
2025-01-09 18:29:48 +08:00
|
|
|
|
<el-table-column prop="matRest" label="库存数量" min-width="180" align="center" />
|
|
|
|
|
|
<el-table-column prop="purchaseAmount" min-width="180" align="center">
|
|
|
|
|
|
|
|
|
|
|
|
<template #header><span class="hl-table_header">*</span>采购数量</template>
|
|
|
|
|
|
|
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
<el-form-item :prop="`${scope.$index}.purchaseAmount`" :rules="subMatPlanFormRules.purchaseAmount" class="mb-0px!">
|
|
|
|
|
|
<el-input-number style="width: 100%" v-model="scope.row.purchaseAmount" placeholder="采购数量" :min="0" :precision="2" disabled />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column prop="estimatedPrice" min-width="200" align="center">
|
|
|
|
|
|
|
2025-02-25 13:44:40 +08:00
|
|
|
|
<template #header><span class="hl-table_header">*</span>暂估单价</template>
|
2025-01-09 18:29:48 +08:00
|
|
|
|
|
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
<el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subMatPlanFormRules.estimatedPrice" class="mb-0px!">
|
2025-02-25 13:44:40 +08:00
|
|
|
|
<el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估单价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
|
2025-01-09 18:29:48 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column prop="actualPrice" min-width="200" align="center">
|
|
|
|
|
|
|
2025-02-25 13:44:40 +08:00
|
|
|
|
<template #header>实际单价</template>
|
2025-01-09 18:29:48 +08:00
|
|
|
|
|
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
<el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!">
|
2025-02-25 13:44:40 +08:00
|
|
|
|
<el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际单价" @change="handleActualPrice" :min="0" :precision="6" disabled />
|
2025-01-09 18:29:48 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column min-width="180" align="center">
|
|
|
|
|
|
|
|
|
|
|
|
<template #header> <span class="hl-table_header">*</span>预计到货日期 </template>
|
|
|
|
|
|
|
|
|
|
|
|
<template #default="{ row, $index }">
|
|
|
|
|
|
<el-form-item :prop="`${$index}.arriveTime`" class="mb-0px!">
|
|
|
|
|
|
<el-date-picker class="!w-265px" v-model="row.arriveTime" type="date" value-format="x" placeholder="预计到货日期" disabled />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
2025-06-20 18:59:28 +08:00
|
|
|
|
<!-- <el-table-column prop="requireArriveTime" label="需求数量到货日期(最早)" min-width="220" align="center">-->
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- {{-->
|
|
|
|
|
|
<!-- formatDate(scope.row.requireArriveTime, 'YYYY-MM-DD')-->
|
|
|
|
|
|
<!-- }}-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
2025-01-09 18:29:48 +08:00
|
|
|
|
<el-table-column prop="matUnit" label="系统单位" min-width="100" align="center">
|
|
|
|
|
|
|
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.matUnit" v-if="scope.row.matUnit ? true : false" />
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column prop="description" min-width="180" label="备注" align="center">
|
|
|
|
|
|
|
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
<el-input v-model="scope.row.description" disabled />
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column label="操作" fixed="right" align="center" min-width="100">
|
|
|
|
|
|
|
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
<el-button link type="danger" size="small" @click.prevent="handleDelete2(scope.$index)" disabled>
|
|
|
|
|
|
删除
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 加工件信息-非计划 -->
|
2025-06-20 18:59:28 +08:00
|
|
|
|
<!-- <el-card class="hl-card-info" v-if="formData.purchaseType == 2 && formData.goodsType == 2">-->
|
|
|
|
|
|
<!-- <template #header>-->
|
|
|
|
|
|
<!-- <div class="hl-card-info-icona"></div><span class="hl-card-info-text">采购明细</span>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- <el-row>-->
|
|
|
|
|
|
<!-- <el-col>-->
|
|
|
|
|
|
<!-- <el-card class="hl-incard">-->
|
|
|
|
|
|
<!-- <el-col>-->
|
|
|
|
|
|
<!-- <el-button class="hl-addbutton" type="primary" size="large" @click="onBoomAddItem" disabled>新增</el-button>-->
|
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
|
<!-- <el-form ref="subBoomFormRef" :model="formData.boomItemDOList" :rules="subBoomFormRules" v-loading="subBoomFormLoading" label-width="0">-->
|
|
|
|
|
|
<!-- <el-table :data="formData.boomItemDOList" class="hl-table" :stripe="true" :show-overflow-tooltip="true">-->
|
|
|
|
|
|
<!-- <el-table-column type="index" label="序号" fixed align="center" width="60" />-->
|
|
|
|
|
|
<!-- <el-table-column prop="boomName" min-width="180" label="零件名称" align="center" :rules="subBoomFormRules.boomName">-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-input v-model="scope.row.boomName" class="!w-180px" disabled />-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="boomSpec" min-width="100" label="规格型号" align="center">-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-input v-model="scope.row.boomSpec" class="!w-180px" disabled />-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="composition" min-width="180" label="材质" align="center">-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #header><span class="hl-table_header">*</span>材质</template>-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #default="{ row, $index }">-->
|
|
|
|
|
|
<!-- <el-form-item :prop="`${$index}.composition`" :rules="subBoomFormRules.composition" class="mb-0px!">-->
|
|
|
|
|
|
<!-- <CompositionSelect v-model="row.composition" disabled @update:new-value="(val) => { row.composition = val.id; }" />-->
|
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="boomPurchaseAmount" min-width="180" align="center">-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #header><span class="hl-table_header">*</span>采购数量</template>-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-form-item :prop="`${scope.$index}.boomPurchaseAmount`" :rules="subFormRules.boomPurchaseAmount" class="mb-0px!">-->
|
|
|
|
|
|
<!-- <el-input-number style="width: 100%" v-model="scope.row.boomPurchaseAmount" placeholder="采购数量" :min="0" :precision="2" disabled />-->
|
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="boomEstimatedPrice" min-width="200" align="center">-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #header><span class="hl-table_header">*</span>暂估单价</template>-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-form-item :prop="`${scope.$index}.boomEstimatedPrice`" :rules="subFormRules.boomEstimatedPrice" class="mb-0px!">-->
|
|
|
|
|
|
<!-- <el-input-number style="width: 100%" v-model="scope.row.boomEstimatedPrice" placeholder="暂估单价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />-->
|
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="boomActualPrice" min-width="200" align="center">-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #header>实际单价</template>-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-form-item :prop="`${scope.$index}.boomActualPrice`" class="mb-0px!">-->
|
|
|
|
|
|
<!-- <el-input-number style="width: 100%" v-model="scope.row.boomActualPrice" placeholder="实际单价" @change="handleActualPrice" :min="0" :precision="6" disabled />-->
|
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column min-width="180" align="center">-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #header> <span class="hl-table_header">*</span>预计到货时间 </template>-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #default="{ row, $index }">-->
|
|
|
|
|
|
<!-- <el-form-item :prop="`${$index}.boomArriveTime`" class="mb-0px!">-->
|
|
|
|
|
|
<!-- <el-date-picker class="!w-265px" v-model="row.boomArriveTime" type="date" value-format="x" placeholder="预计到货时间" disabled />-->
|
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="boomUnit" label="系统单位" min-width="100" align="center" :rules="subBoomFormRules.boomUnit">-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!--<!– <el-select v-model="scope.row.boomUnit" placeholder="下拉选择" clearable class="!w-240px" disabled>–>-->
|
|
|
|
|
|
<!--<!– <el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_MATERIAL_UNIT)" :key="dict.value" :label="dict.label" :value="dict.value" />–>-->
|
|
|
|
|
|
<!--<!– </el-select>–>-->
|
|
|
|
|
|
<!-- <dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.boomUnit" v-if="scope.row.boomUnit ? true : false" />-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="boomDescription" min-width="180" label="备注" align="center">-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-input v-model="scope.row.boomDescription" disabled />-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column label="操作" fixed="right" align="center" min-width="100">-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-button link type="danger" size="small" @click.prevent="handleDeleteBoom(scope.$index)" disabled>-->
|
|
|
|
|
|
<!-- 删除-->
|
|
|
|
|
|
<!-- </el-button>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- </el-table>-->
|
|
|
|
|
|
<!-- </el-form>-->
|
|
|
|
|
|
<!-- </el-card>-->
|
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
|
<!-- </el-row>-->
|
|
|
|
|
|
<!-- </el-card>-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <!– 加工件信息-计划 –>-->
|
|
|
|
|
|
<!-- <el-card class="hl-card-info" v-if="formData.purchaseType == 1 && formData.goodsType == 2">-->
|
|
|
|
|
|
<!-- <template #header>-->
|
|
|
|
|
|
<!-- <div class="hl-card-info-icona"></div><span class="hl-card-info-text">采购明细</span>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- <el-row>-->
|
|
|
|
|
|
<!-- <el-col>-->
|
|
|
|
|
|
<!-- <el-card class="hl-incard">-->
|
|
|
|
|
|
<!-- <el-col>-->
|
|
|
|
|
|
<!-- <el-button class="hl-addbutton" type="primary" size="large" @click="onBoomAddItemOpen" disabled>新增</el-button>-->
|
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
|
<!-- <el-form ref="subBoomPlanFormRef" :model="formData.boomItemDOList" :rules="subBoomPlanFormRules" label-width="0">-->
|
|
|
|
|
|
<!-- <el-table :data="formData.boomItemDOList" class="hl-table">-->
|
|
|
|
|
|
<!-- <el-table-column type="index" label="序号" fixed align="center" min-width="60" />-->
|
|
|
|
|
|
<!-- <el-table-column prop="materialName" fixed label="零件名称" min-width="120" align="center" />-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <!– <el-table-column prop="boomName" fixed min-width="200" align="center">-->
|
|
|
|
|
|
<!-- <template #header> <span class="hl-table_header">*</span>零件名称 </template>-->
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-form-item :prop="`${scope.$index}.boomDetailId`" :rules="subMatPlanFormRules.boomDetailId" class="mb-0px!">-->
|
|
|
|
|
|
<!-- <MaterialSelect :key="scope.row.boomDetailId" v-model="scope.row.boomDetailId" disabled @update:new-value="handleSelectedBoomMaterial(scope.$index, $event)" />-->
|
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column> –>-->
|
|
|
|
|
|
<!-- <el-table-column prop="boomSpec" label="规格型号" min-width="120" align="center" />-->
|
|
|
|
|
|
<!-- <el-table-column prop="compositionName" min-width="180" label="材质" align="center">-->
|
|
|
|
|
|
<!-- <!– <template #header>材质</template>-->
|
|
|
|
|
|
<!-- <template #default="{ row, $index }">-->
|
|
|
|
|
|
<!-- <el-form-item :prop="`${$index}.composition`" class="mb-0px!">-->
|
|
|
|
|
|
<!-- <CompositionSelect v-model="row.composition" disabled @update:new-value="(val) => { row.composition = val.id; }" />-->
|
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<!-- </template> –>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="boomAmount" label="需求数量" min-width="100" align="center" />-->
|
|
|
|
|
|
<!-- <el-table-column prop="purchaseAmount" min-width="180" align="center">-->
|
|
|
|
|
|
<!-- <template #header><span class="hl-table_header">*</span>采购数量</template>-->
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-form-item :prop="`${scope.$index}.purchaseAmount`" :rules="subMatPlanFormRules.purchaseAmount" class="mb-0px!">-->
|
|
|
|
|
|
<!-- <el-input-number style="width: 100%" v-model="scope.row.purchaseAmount" placeholder="采购数量" @change="handleEstimatedPrice" :min="0" :precision="2" disabled />-->
|
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="estimatedPrice" min-width="200" align="center">-->
|
|
|
|
|
|
<!-- <template #header><span class="hl-table_header">*</span>暂估单价</template>-->
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subMatPlanFormRules.estimatedPrice" class="mb-0px!">-->
|
|
|
|
|
|
<!-- <el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估单价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />-->
|
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="actualPrice" min-width="200" align="center">-->
|
|
|
|
|
|
<!-- <template #header>实际单价</template>-->
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!">-->
|
|
|
|
|
|
<!-- <el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际单价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />-->
|
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="boomArriveDate" label="需求到货日期(最早)" min-width="180" align="center">-->
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- {{-->
|
|
|
|
|
|
<!-- formatDate(scope.row.boomArriveDate, 'YYYY-MM-DD')-->
|
|
|
|
|
|
<!-- }}-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column min-width="180" prop="arriveTime" align="center">-->
|
|
|
|
|
|
<!-- <template #header> <span class="hl-table_header">*</span>预计到货日期 </template>-->
|
|
|
|
|
|
<!-- <template #default="{ row, $index }">-->
|
|
|
|
|
|
<!-- <el-form-item :prop="`${$index}.arriveTime`" class="mb-0px!">-->
|
|
|
|
|
|
<!-- <el-date-picker v-model="row.arriveTime" type="date" value-format="x" placeholder="预计到货日期" disabled />-->
|
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="boomUnit" label="系统单位" min-width="100" align="center">-->
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.boomUnit" v-if="scope.row.boomUnit ? true : false" />-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="description" min-width="180" label="备注" align="center">-->
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-input v-model="scope.row.description" disabled />-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column label="操作" fixed="right" align="center" min-width="100">-->
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-button link type="danger" size="small" @click.prevent="handleDeleteBoom(scope.$index)" disabled>-->
|
|
|
|
|
|
<!-- 删除-->
|
|
|
|
|
|
<!-- </el-button>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- </el-table>-->
|
|
|
|
|
|
<!-- </el-form>-->
|
|
|
|
|
|
<!-- </el-card>-->
|
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
|
<!-- </el-row>-->
|
|
|
|
|
|
<!-- </el-card>-->
|
2025-01-09 18:29:48 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 附件信息 -->
|
|
|
|
|
|
<el-card class="hl-card-info">
|
|
|
|
|
|
|
|
|
|
|
|
<template #header>
|
|
|
|
|
|
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">附件信息</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col>
|
|
|
|
|
|
<el-card class="hl-incard">
|
|
|
|
|
|
<el-col>
|
|
|
|
|
|
<el-upload
|
|
|
|
|
|
ref="matUploadRef" :file-list="matUploadFiles" multiple :action="uploadUrl" :headers="{
|
|
|
|
|
|
Authorization: 'Bearer ' + getAccessToken(),
|
|
|
|
|
|
'tenant-id': getTenantId()
|
|
|
|
|
|
}" name="files" :show-file-list="false" :auto-upload="false" :data="matUploadData" :on-change="matUploadChange" :on-error="handleError" :on-success="handleSuccess" :before-upload="before" class="upload-file-uploader">
|
|
|
|
|
|
<el-button type="primary" disabled>
|
|
|
|
|
|
<Icon icon="ep:upload-filled" />上传
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
</el-upload>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-table :data="formData.attachments" class="hl-table" v-loading.fullscreen.lock="uploading" element-loading-text="附件上传中..." element-loading-background="rgba(122, 122, 122, 0.6)">
|
|
|
|
|
|
<el-table-column prop="name" label="文件名称" align="center">
|
|
|
|
|
|
<!-- <template #default="scope">
|
|
|
|
|
|
<a :href="scope.row.url" target="_blank" style="color: #409eff">{{ scope.row.name }} </a>
|
|
|
|
|
|
</template> -->
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
|
|
<el-table-column prop="createTime" align="center" label="上传日期" :formatter="dateFormatter" />
|
|
|
|
|
|
|
|
|
|
|
|
<el-table-column label="操作" align="center">
|
|
|
|
|
|
|
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
<el-button link type="danger" size="small" disabled @click="handleDeleteAttachment(scope.$index, scope.row.businessFileType)">
|
|
|
|
|
|
删除
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
<el-button link type="primary" size="small" disabled @click="downloadAttachment(scope.row.name, scope.row.url)">
|
|
|
|
|
|
下载
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
<!-- 系统信息 -->
|
|
|
|
|
|
<el-card class="hl-card-info">
|
|
|
|
|
|
|
|
|
|
|
|
<template #header>
|
|
|
|
|
|
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">系统信息</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<el-row justify="center">
|
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
|
<el-form-item prop="creator" label="创建人">
|
|
|
|
|
|
{{ userList.find((user) => user.id == formData.creator)?.nickname }}
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
|
<el-form-item prop="createTime" label="创建时间">
|
|
|
|
|
|
{{ formatDate(formData.createTime, 'YYYY-MM-DD HH:mm') }}
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row justify="center">
|
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
|
<el-form-item prop="submitUserId" label="送审人">
|
|
|
|
|
|
{{ userList.find((user) => user.id == formData.submitUserId)?.nickname }}
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
|
<el-form-item prop="submitTime" label="送审时间">
|
|
|
|
|
|
{{ formatDate(formData.submitTime, 'YYYY-MM-DD HH:mm') }}
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row justify="center">
|
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
|
<el-form-item prop="auditor" label="审核人">
|
|
|
|
|
|
{{ userList.find((user) => user.id == formData.auditor)?.nickname }}
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
|
<el-form-item prop="auditTime" label="审核时间">
|
|
|
|
|
|
{{ formatDate(formData.auditTime, 'YYYY-MM-DD HH:mm') }}
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
<div class="hl-footer text-center">
|
|
|
|
|
|
<!-- <el-button @click="closeForm" size="large">取 消</el-button> -->
|
|
|
|
|
|
<el-button @click="saveForm(2)" v-if="isShow" type="primary" size="large">审 核</el-button>
|
|
|
|
|
|
<el-button @click="saveForm(4)" v-if="isShow" type="danger" size="large">打 回</el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
<MaterialDialog ref="materialDialog" @success="handleSelectedMaterialPlanMat" />
|
|
|
|
|
|
<BoomDialog ref="boomDialog" @success="handleSelectedMaterialPlanBoom" />
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
|
import * as MaterialPlanApi from '@/api/heli/materialplan'
|
2025-06-20 18:59:28 +08:00
|
|
|
|
import * as PurchaseOrderNoApi from '@/api/heli/purchaseorderno'
|
|
|
|
|
|
import * as PurchaseOrderNoDetailApi from '@/api/heli/purchaseordernodetail'
|
2025-01-09 18:29:48 +08:00
|
|
|
|
import * as PurchaseOrderBoomApi from '@/api/heli/purchaseorderboom'
|
|
|
|
|
|
import * as UserApi from '@/api/system/user'
|
|
|
|
|
|
import * as MaterialApi from '@/api/heli/material'
|
|
|
|
|
|
import * as SupplierApi from '@/api/heli/supplier'
|
|
|
|
|
|
import { deleteFile, downloadFile, getFilePage } from '@/api/infra/file'
|
|
|
|
|
|
import download from '@/utils/download'
|
|
|
|
|
|
import { getAccessToken, getTenantId } from '@/utils/auth'
|
|
|
|
|
|
import { dateFormatter, formatDate } from '@/utils/formatTime'
|
|
|
|
|
|
import { useUserStore } from '@/store/modules/user'
|
|
|
|
|
|
import { useTagsViewStore } from '@/store/modules/tagsView'
|
|
|
|
|
|
import MaterialSelect from '@/views/heli/hlvuestyle/materialSelect.vue'
|
|
|
|
|
|
import CompositionSelect from '@/views/heli/hlvuestyle/compositionSelect.vue'
|
|
|
|
|
|
|
|
|
|
|
|
import MaterialDialog from '@/views/heli/purchaseorder/materialDialog.vue'
|
|
|
|
|
|
import BoomDialog from '@/views/heli/purchaseorder/boomDialog.vue'
|
|
|
|
|
|
import {UploadUserFile} from "element-plus";
|
2025-06-20 18:59:28 +08:00
|
|
|
|
import {PurchaseOrderNoDetailVO} from "@/api/heli/purchaseordernodetail";
|
2025-01-09 18:29:48 +08:00
|
|
|
|
|
|
|
|
|
|
const reload: any = inject('reload')
|
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
|
const { query } = useRoute()
|
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
|
const tagsViewStore = useTagsViewStore()
|
|
|
|
|
|
|
|
|
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
|
|
|
|
|
const formData = ref({
|
|
|
|
|
|
id: undefined,
|
|
|
|
|
|
purchaseNo: undefined,
|
|
|
|
|
|
supplierId: undefined,
|
|
|
|
|
|
contractNo: undefined,
|
|
|
|
|
|
projectMaterialPlanNo: undefined,
|
|
|
|
|
|
projectMaterialPlanId: undefined,
|
|
|
|
|
|
goodsType: undefined,
|
|
|
|
|
|
currencyType: undefined,
|
|
|
|
|
|
estimatedPrice: undefined,
|
|
|
|
|
|
actualPrice: undefined,
|
|
|
|
|
|
taxRatio: undefined,
|
|
|
|
|
|
status: undefined,
|
|
|
|
|
|
createTime: undefined,
|
|
|
|
|
|
description: undefined,
|
|
|
|
|
|
matItemDOList: [],
|
|
|
|
|
|
matItemRemoveList: [],
|
|
|
|
|
|
boomItemDOList: [],
|
|
|
|
|
|
boomItemRemoveList: [],
|
|
|
|
|
|
attachments: []
|
|
|
|
|
|
})
|
|
|
|
|
|
const formRules = reactive({
|
|
|
|
|
|
currencyType: [{ required: true, message: '结算币种不能为空', trigger: 'blur' }]
|
|
|
|
|
|
})
|
|
|
|
|
|
const subFormRules = reactive({
|
|
|
|
|
|
matId: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }],
|
2025-02-25 13:44:40 +08:00
|
|
|
|
estimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }],
|
2025-01-09 18:29:48 +08:00
|
|
|
|
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }]
|
|
|
|
|
|
})
|
|
|
|
|
|
const subBoomFormRules = reactive({
|
|
|
|
|
|
boomName: [{ required: true, message: '零件名称不能为空', trigger: 'blur' }],
|
|
|
|
|
|
boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
|
2025-02-25 13:44:40 +08:00
|
|
|
|
boomEstimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }]
|
2025-01-09 18:29:48 +08:00
|
|
|
|
})
|
|
|
|
|
|
const subMatPlanFormRules = reactive({
|
|
|
|
|
|
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
|
2025-02-25 13:44:40 +08:00
|
|
|
|
estimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }]
|
2025-01-09 18:29:48 +08:00
|
|
|
|
})
|
|
|
|
|
|
const subBoomPlanFormRules = reactive({
|
|
|
|
|
|
boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
|
2025-02-25 13:44:40 +08:00
|
|
|
|
boomEstimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }]
|
2025-01-09 18:29:48 +08:00
|
|
|
|
})
|
|
|
|
|
|
const formRef = ref() // 表单 Ref
|
|
|
|
|
|
const subFormRef = ref() // 表单 Ref
|
|
|
|
|
|
const subMatPlanFormRef = ref()
|
|
|
|
|
|
const subBoomPlanFormRef = ref()
|
|
|
|
|
|
const subBoomFormRef = ref()
|
|
|
|
|
|
|
|
|
|
|
|
const handleSelectedMaterialPlanMat = (arr) => {
|
|
|
|
|
|
arr.forEach((item) => {
|
|
|
|
|
|
if (formData.value.matItemDOList.filter((vo) => vo.matId == item.matId).length == 0) {
|
|
|
|
|
|
item.description = ''
|
|
|
|
|
|
formData.value.matItemDOList.push(item)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
const handleSelectedMaterialPlanBoom = (arr) => {
|
|
|
|
|
|
arr.forEach((item) => {
|
|
|
|
|
|
if (
|
|
|
|
|
|
formData.value.boomItemDOList.filter(
|
|
|
|
|
|
(vo) =>
|
|
|
|
|
|
vo.boomName == item.boomName &&
|
|
|
|
|
|
vo.compositionId == item.compositionId &&
|
|
|
|
|
|
item.boomSpec == vo.boomSpec &&
|
|
|
|
|
|
item.boomUnit == item.boomUnit
|
|
|
|
|
|
).length == 0
|
|
|
|
|
|
) {
|
|
|
|
|
|
item.description = ''
|
|
|
|
|
|
formData.value.boomItemDOList.push(item)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const handleEstimatedPrice = () => {
|
|
|
|
|
|
let allEstimatePrice = 0
|
|
|
|
|
|
formData.value.matItemDOList.forEach((item) => {
|
|
|
|
|
|
allEstimatePrice += item.estimatedPrice
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
formData.value.boomItemDOList.forEach((item) => {
|
|
|
|
|
|
allEstimatePrice += item.boomEstimatedPrice
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
formData.value.estimatedPrice = allEstimatePrice
|
|
|
|
|
|
}
|
|
|
|
|
|
const handleActualPrice = () => {
|
|
|
|
|
|
let allActualPrice = 0
|
|
|
|
|
|
formData.value.matItemDOList.forEach((item) => {
|
|
|
|
|
|
allActualPrice += item.actualPrice
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
formData.value.boomItemDOList.forEach((item) => {
|
|
|
|
|
|
allActualPrice += item.boomActualPrice
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
formData.value.actualPrice = allActualPrice
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ====================附件信息 开始=======================================
|
|
|
|
|
|
const uploadUrl = ref(import.meta.env.VITE_UPLOAD_BATCH_URL)
|
|
|
|
|
|
const matUploadRef = ref()
|
|
|
|
|
|
const uploading = ref(false)
|
|
|
|
|
|
|
|
|
|
|
|
const matUploadFiles = ref<UploadUserFile[]>([])
|
|
|
|
|
|
const matUploadData = ref({
|
2025-06-20 18:59:28 +08:00
|
|
|
|
businessType: 'PURCHASEORDERNO',
|
2025-01-09 18:29:48 +08:00
|
|
|
|
businessId: formData.value.id,
|
|
|
|
|
|
businessFileType: 'MATERIAL'
|
|
|
|
|
|
})
|
|
|
|
|
|
const matUploadChange = (file, files) => {
|
|
|
|
|
|
matUploadFiles.value = files
|
|
|
|
|
|
refreshAttachments(files, 'MATERIAL')
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 记录待上传、成功上传及失败上传的文件数量
|
|
|
|
|
|
const sumbefore = ref(0)
|
|
|
|
|
|
const successfulUploadsCount = ref(0)
|
|
|
|
|
|
const failedUploadsCount = ref(0)
|
|
|
|
|
|
const failedAttachments = ref<UploadUserFile[]>([])
|
|
|
|
|
|
const failedAttachmentsName = ref()
|
|
|
|
|
|
// / 处理单个文件上传成功的情况
|
|
|
|
|
|
const handleSuccess = (response: any, file: UploadUserFile) => {
|
|
|
|
|
|
successfulUploadsCount.value++
|
|
|
|
|
|
// 更新附件信息等其他逻辑...
|
|
|
|
|
|
// console.log('上传成功数量', successfulUploadsCount.value)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 处理单个文件上传失败的情况
|
|
|
|
|
|
const handleError = (error: Error, file: UploadUserFile) => {
|
|
|
|
|
|
failedUploadsCount.value++
|
|
|
|
|
|
if (failedUploadsCount.value > 0) {
|
|
|
|
|
|
// 当有上传错误时
|
|
|
|
|
|
// 将失败的附件添加到failedAttachments.value数组中
|
|
|
|
|
|
failedAttachments.value.push(file)
|
|
|
|
|
|
failedAttachmentsName.value = failedAttachments.value.map((value) => value.name)
|
|
|
|
|
|
}
|
|
|
|
|
|
// console.log('上传失败数量', failedUploadsCount.value)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 文件上传前的钩子
|
|
|
|
|
|
const before = (rawFile) => {
|
|
|
|
|
|
sumbefore.value++
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const refreshAttachments = (files, type) => {
|
|
|
|
|
|
formData.value.attachments = formData.value.attachments.filter((value) => value.id)
|
|
|
|
|
|
|
|
|
|
|
|
// 避免重复添加
|
|
|
|
|
|
const newFiles = files.filter(
|
|
|
|
|
|
(file) => !formData.value.attachments.some((att) => att.name === file.name)
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < newFiles.length; i++) {
|
|
|
|
|
|
let file = newFiles[i]
|
|
|
|
|
|
file.businessFileType = type
|
|
|
|
|
|
file.createTime = new Date()
|
|
|
|
|
|
formData.value.attachments.push(file)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 排序
|
|
|
|
|
|
formData.value.attachments.sort((v1, v2) => v1.createTime - v2.createTime)
|
|
|
|
|
|
// 文件上传一遍 上传总数等于要上传文件时 刷新页面
|
|
|
|
|
|
const sum = successfulUploadsCount.value + failedUploadsCount.value
|
|
|
|
|
|
// console.log('上传总数', sum)
|
|
|
|
|
|
// console.log('要上传文件数量', sumbefore.value)
|
|
|
|
|
|
if (sumbefore.value !== sum && sumbefore.value !== 0 && sum !== 0) {
|
|
|
|
|
|
// console.log('要上传文件数量不等于上传总数时等待',uploading.value)
|
|
|
|
|
|
uploading.value = true
|
|
|
|
|
|
} else if (sum == sumbefore.value && sumbefore.value > 0 && sum > 0) {
|
|
|
|
|
|
// console.log('要上传文件数量等于上传总数 刷新页面并给出提示')
|
|
|
|
|
|
if (failedUploadsCount.value > 0) {
|
|
|
|
|
|
ElMessageBox.alert(
|
|
|
|
|
|
// 使用错误信息作为提示内容
|
|
|
|
|
|
`文件名为:${failedAttachmentsName.value.join(' / ')}上传失败`,
|
|
|
|
|
|
`文件格式不正确或网络问题 请您稍后再试`,
|
|
|
|
|
|
{
|
|
|
|
|
|
dangerouslyUseHTMLString: false,
|
|
|
|
|
|
confirmButtonText: '知道了',
|
|
|
|
|
|
center: true
|
|
|
|
|
|
}
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|
|
|
|
|
|
reload()
|
|
|
|
|
|
uploading.value = false
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 删除附件
|
|
|
|
|
|
const handleDeleteAttachment = async (index, type) => {
|
|
|
|
|
|
const deletedAttachments = formData.value.attachments.splice(index, 1)
|
|
|
|
|
|
for (let i = 0; i < deletedAttachments.length; i++) {
|
|
|
|
|
|
const attachment = deletedAttachments[i]
|
|
|
|
|
|
if (attachment.id) {
|
|
|
|
|
|
// 清理已上传文件
|
|
|
|
|
|
await deleteFile(attachment.id)
|
|
|
|
|
|
}
|
|
|
|
|
|
// 清理待上传文件
|
|
|
|
|
|
matUploadFiles.value = matUploadFiles.value.filter((file1) => {
|
|
|
|
|
|
return file1.name != attachment.name || file1.businessFileType != type
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
// 下载文件
|
|
|
|
|
|
const downloadAttachment = async (name, url) => {
|
|
|
|
|
|
if (url) {
|
2025-05-06 16:22:31 +08:00
|
|
|
|
const baseUrl = import.meta.env.VITE_BASE_URL;
|
|
|
|
|
|
url =baseUrl+'/admin-api/'+ url.split('/admin-api/')[1]; const data = await downloadFile(url)
|
2025-01-09 18:29:48 +08:00
|
|
|
|
download.any(data, name)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
// ====================附件信息 结束=======================================
|
|
|
|
|
|
|
|
|
|
|
|
// 远程数据筛选物料
|
|
|
|
|
|
const getMatList = async (name) => {
|
|
|
|
|
|
// 获得物料列表
|
|
|
|
|
|
let matParams = {
|
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
|
status: '1'
|
|
|
|
|
|
}
|
|
|
|
|
|
if (name.length > 0) {
|
|
|
|
|
|
matParams.code = name
|
|
|
|
|
|
}
|
|
|
|
|
|
const dataMat = await MaterialApi.getMaterialPage(matParams)
|
|
|
|
|
|
matList.value = dataMat.list
|
|
|
|
|
|
}
|
|
|
|
|
|
const matList = ref<MaterialApi.MaterialVO[]>([]) // 物料列表
|
|
|
|
|
|
const matSelectLoading = ref(false)
|
|
|
|
|
|
const remoteMatNameSearch = async (name) => {
|
|
|
|
|
|
matSelectLoading.value = true
|
|
|
|
|
|
// 获得物料列表
|
|
|
|
|
|
await getMatList(name)
|
|
|
|
|
|
matSelectLoading.value = false
|
|
|
|
|
|
}
|
|
|
|
|
|
const handleMatName = async (scope, matid) => {
|
|
|
|
|
|
scope.row.matId = matList.value.find((item) => item.id === matid)?.id
|
|
|
|
|
|
scope.row.matName = matList.value.find((item) => item.id === matid)?.name
|
|
|
|
|
|
scope.row.matCode = matList.value.find((item) => item.id === matid)?.code
|
|
|
|
|
|
scope.row.matSpec = matList.value.find((item) => item.id === matid)?.spec
|
|
|
|
|
|
scope.row.matType = matList.value.find((item) => item.id === matid)?.materialType
|
|
|
|
|
|
scope.row.matUnit = matList.value.find((item) => item.id === matid)?.unit
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//新增物料信息
|
|
|
|
|
|
const onAddItem = () => {
|
|
|
|
|
|
const newData = {
|
|
|
|
|
|
// 新数据的属性
|
|
|
|
|
|
purchaseOrderId: 0,
|
|
|
|
|
|
matId: '',
|
|
|
|
|
|
matName: '',
|
|
|
|
|
|
matCode: '',
|
|
|
|
|
|
matType: '',
|
|
|
|
|
|
matSpec: '',
|
|
|
|
|
|
matUnit: '',
|
|
|
|
|
|
purchaseAmount: undefined,
|
|
|
|
|
|
estimatedPrice: undefined,
|
|
|
|
|
|
actualPrice: undefined,
|
|
|
|
|
|
arriveTime: '',
|
|
|
|
|
|
description: ''
|
|
|
|
|
|
}
|
|
|
|
|
|
formData.value.matItemDOList.push(newData)
|
|
|
|
|
|
}
|
|
|
|
|
|
const materialDialog = ref()
|
|
|
|
|
|
const onAddItemOpen = () => {
|
|
|
|
|
|
materialDialog.value.open(formData.value.projectMaterialPlanId)
|
|
|
|
|
|
}
|
|
|
|
|
|
const boomDialog = ref()
|
|
|
|
|
|
const onBoomAddItemOpen = () => {
|
|
|
|
|
|
boomDialog.value.open(formData.value.projectMaterialPlanId)
|
|
|
|
|
|
}
|
|
|
|
|
|
//删除新增物料信息
|
|
|
|
|
|
const handleDelete2 = (index: number) => {
|
|
|
|
|
|
formData.value.matItemRemoveList.push(formData.value.matItemDOList[index])
|
|
|
|
|
|
formData.value.matItemDOList.splice(index, 1)
|
|
|
|
|
|
handleActualPrice()
|
|
|
|
|
|
handleEstimatedPrice()
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 保存物料信息
|
|
|
|
|
|
const saveMaterials = async () => {
|
|
|
|
|
|
formData.value.matItemDOList.forEach(async (item) => {
|
|
|
|
|
|
var subData = item as unknown as PurchaseOrderMaterialApi.PurchaseOrderMaterialVO
|
|
|
|
|
|
subData.materialId = item.matId
|
|
|
|
|
|
subData.purchaseOrderId = formData.value.id
|
|
|
|
|
|
if (subData.id == undefined) {
|
2025-06-20 18:59:28 +08:00
|
|
|
|
subData.id = await PurchaseOrderNoDetailApi.createPurchaseOrderNoDetail(subData)
|
2025-01-09 18:29:48 +08:00
|
|
|
|
} else {
|
2025-06-20 18:59:28 +08:00
|
|
|
|
await PurchaseOrderNoDetailApi.updatePurchaseOrderNoDetail(subData)
|
2025-01-09 18:29:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
formData.value.matItemRemoveList.forEach(async (item) => {
|
|
|
|
|
|
if (item.id != undefined) {
|
2025-06-20 18:59:28 +08:00
|
|
|
|
await PurchaseOrderNoDetailApi.deletePurchaseOrderNoDetail(item.id)
|
2025-01-09 18:29:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
//新增物料信息
|
|
|
|
|
|
const onBoomAddItem = () => {
|
|
|
|
|
|
const newData = {
|
|
|
|
|
|
// 新数据的属性
|
|
|
|
|
|
purchaseOrderId: 0,
|
|
|
|
|
|
boomDetailId: undefined,
|
|
|
|
|
|
boomName: '',
|
|
|
|
|
|
boomSpec: '',
|
|
|
|
|
|
composition: '',
|
|
|
|
|
|
boomUnit: '',
|
|
|
|
|
|
boomPurchaseAmount: undefined,
|
|
|
|
|
|
boomEstimatedPrice: undefined,
|
|
|
|
|
|
boomActualPrice: undefined,
|
|
|
|
|
|
boomArriveTime: '',
|
|
|
|
|
|
boomArriveDate: '',
|
|
|
|
|
|
boomDescription: ''
|
|
|
|
|
|
}
|
|
|
|
|
|
formData.value.boomItemDOList.push(newData)
|
|
|
|
|
|
}
|
|
|
|
|
|
// 保存加工件信息
|
|
|
|
|
|
const saveBooms = async () => {
|
|
|
|
|
|
formData.value.boomItemDOList.forEach(async (item) => {
|
|
|
|
|
|
var subData = item as unknown as PurchaseOrderBoomApi.PurchaseOrderBoomVO
|
|
|
|
|
|
subData.boomName = item.materialName
|
|
|
|
|
|
subData.purchaseAmount = item.purchaseAmount
|
|
|
|
|
|
subData.estimatedPrice = item.estimatedPrice
|
|
|
|
|
|
subData.actualPrice = item.actualPrice
|
|
|
|
|
|
subData.arriveTime = item.arriveTime
|
|
|
|
|
|
subData.requireTime = item.boomArriveDate
|
|
|
|
|
|
subData.description = item.description
|
|
|
|
|
|
subData.composition = item.compositionName
|
|
|
|
|
|
subData.purchaseOrderId = formData.value.id
|
|
|
|
|
|
if (subData.id == undefined) {
|
|
|
|
|
|
subData.id = await PurchaseOrderBoomApi.createPurchaseOrderBoom(subData)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
await PurchaseOrderBoomApi.updatePurchaseOrderBoom(subData)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
formData.value.boomItemRemoveList.forEach(async (item) => {
|
|
|
|
|
|
if (item.id != undefined) {
|
|
|
|
|
|
await PurchaseOrderBoomApi.deletePurchaseOrderBoom(item.id)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
//删除新增物料信息
|
|
|
|
|
|
const handleDeleteBoom = (index: number) => {
|
|
|
|
|
|
formData.value.boomItemRemoveList.push(formData.value.boomItemDOList[index])
|
|
|
|
|
|
formData.value.boomItemDOList.splice(index, 1)
|
|
|
|
|
|
handleActualPrice()
|
|
|
|
|
|
handleEstimatedPrice()
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const closeForm = async () => {
|
|
|
|
|
|
router.push({ path: '/purchase/purchaseorder' })
|
|
|
|
|
|
tagsViewStore.delVisitedView(router.currentRoute.value)
|
|
|
|
|
|
}
|
|
|
|
|
|
const deleteForm = async () => {
|
|
|
|
|
|
// 提示用户是否保存入库信息
|
|
|
|
|
|
await message.confirm('确认删除当前采购订单?')
|
|
|
|
|
|
|
|
|
|
|
|
await PurchaseOrderApi.deletePurchaseOrder(formData.value.id)
|
|
|
|
|
|
router.push({ path: '/purchase/purchaseorder' })
|
|
|
|
|
|
tagsViewStore.delVisitedView(router.currentRoute.value)
|
|
|
|
|
|
}
|
|
|
|
|
|
const isShow = ref(true)
|
|
|
|
|
|
// 保存按钮数据提交
|
|
|
|
|
|
const saveForm = async (active) => {
|
|
|
|
|
|
const router = useRouter(); // 获取 router 实例
|
|
|
|
|
|
// 提交请求
|
|
|
|
|
|
formLoading.value = true
|
|
|
|
|
|
try {
|
2025-06-20 18:59:28 +08:00
|
|
|
|
const data = formData.value as unknown as PurchaseOrderNoApi.PurchaseOrderNoVO
|
2025-01-09 18:29:48 +08:00
|
|
|
|
if(active == 4){
|
|
|
|
|
|
data.receivingStatus = 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
data.status = active
|
|
|
|
|
|
//data.auditor = useUserStore().getUser.id
|
2025-06-20 18:59:28 +08:00
|
|
|
|
await PurchaseOrderNoApi.updatePurchaseOrderNo(data)
|
2025-01-09 18:29:48 +08:00
|
|
|
|
message.success('已' + (active == 2 ? '审核' : '打回'))
|
|
|
|
|
|
isShow.value = false
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
//reload()
|
|
|
|
|
|
formLoading.value = false
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
// 送审按钮数据提交
|
|
|
|
|
|
const submitForm = async () => {
|
|
|
|
|
|
if (formData.value.goodsType == 1 && formData.value.matItemDOList.length == 0) {
|
|
|
|
|
|
message.alertWarning('请添加物料信息!')
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
if (formData.value.goodsType == 2 && formData.value.boomItemDOList.length == 0) {
|
|
|
|
|
|
message.alertWarning('请添加加工件信息!')
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
let validateForm = formData.value.purchaseType + '' + formData.value.goodsType
|
|
|
|
|
|
// 校验子表单
|
|
|
|
|
|
try {
|
|
|
|
|
|
switch (validateForm) {
|
|
|
|
|
|
case '11':
|
|
|
|
|
|
//计划+物料
|
|
|
|
|
|
await subMatPlanFormRef.value.validate()
|
|
|
|
|
|
break
|
|
|
|
|
|
case '12':
|
|
|
|
|
|
//计划+加工件
|
|
|
|
|
|
await subBoomPlanFormRef.value.validate()
|
|
|
|
|
|
break
|
|
|
|
|
|
case '21':
|
|
|
|
|
|
//备库+物料
|
|
|
|
|
|
await subFormRef.value.validate()
|
|
|
|
|
|
break
|
|
|
|
|
|
case '22':
|
|
|
|
|
|
//备库+加工件
|
|
|
|
|
|
await subBoomFormRef.value.validate()
|
|
|
|
|
|
break
|
|
|
|
|
|
default:
|
|
|
|
|
|
break
|
|
|
|
|
|
}
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
// 计划状态为已送审
|
|
|
|
|
|
formData.value.status = 2
|
|
|
|
|
|
formData.value.submitUserId = useUserStore().getUser.id
|
|
|
|
|
|
await saveForm()
|
|
|
|
|
|
}
|
|
|
|
|
|
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
|
|
|
|
|
|
const supplierInit = ref()
|
|
|
|
|
|
// const matSimpList = ref([]) // 物料基本信息列表
|
|
|
|
|
|
|
|
|
|
|
|
const queryParams = reactive({
|
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
|
pageSize: 99,
|
|
|
|
|
|
purchaseOrderId: query.id
|
|
|
|
|
|
})
|
|
|
|
|
|
// 页面数据加载初始化
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
|
// 获取采购订单信息
|
2025-06-20 18:59:28 +08:00
|
|
|
|
formData.value = await PurchaseOrderNoApi.getPurchaseOrderNo(query.id)
|
2025-01-09 18:29:48 +08:00
|
|
|
|
|
|
|
|
|
|
// 获取物料需求计划编号
|
|
|
|
|
|
if (
|
|
|
|
|
|
formData.value.projectMaterialPlanId != undefined &&
|
|
|
|
|
|
formData.value.projectMaterialPlanId != ''
|
|
|
|
|
|
) {
|
|
|
|
|
|
const matPlanDo = await MaterialPlanApi.getMaterialPlan(formData.value.projectMaterialPlanId)
|
|
|
|
|
|
formData.value.materialPlanNo = matPlanDo.projectMaterialPlanNo
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// // 获取原始物料信息
|
|
|
|
|
|
// matSimpList.value = await MaterialApi.getSimpList()
|
|
|
|
|
|
|
|
|
|
|
|
// 获取物料需求计划的物料列表
|
|
|
|
|
|
formData.value.matItemDOList = (
|
2025-06-20 18:59:28 +08:00
|
|
|
|
await PurchaseOrderNoDetailApi.getPurchaseOrderNoDetailPage(queryParams)
|
2025-01-09 18:29:48 +08:00
|
|
|
|
).list
|
|
|
|
|
|
formData.value.matItemDOList.forEach((item) => {
|
|
|
|
|
|
matList.value.push({ id: item.materialId, code: item.matCode })
|
|
|
|
|
|
})
|
|
|
|
|
|
formData.value.matItemRemoveList = []
|
|
|
|
|
|
formData.value.boomItemRemoveList = []
|
|
|
|
|
|
|
|
|
|
|
|
// 获取采购订单数据
|
|
|
|
|
|
formData.value.boomItemDOList = (
|
|
|
|
|
|
await PurchaseOrderBoomApi.getPurchaseOrderBoomPage(queryParams)
|
|
|
|
|
|
).list;
|
|
|
|
|
|
|
|
|
|
|
|
// 遍历每个 item,进行属性赋值
|
|
|
|
|
|
formData.value.boomItemDOList.forEach((item) => {
|
|
|
|
|
|
if (item) { // 确保 item 存在
|
|
|
|
|
|
item.boomPurchaseAmount = item.purchaseAmount;
|
|
|
|
|
|
item.boomEstimatedPrice = item.estimatedPrice;
|
|
|
|
|
|
item.boomActualPrice = item.actualPrice;
|
|
|
|
|
|
item.boomArriveTime = item.arriveTime;
|
|
|
|
|
|
item.boomArriveDate = item.requireTime;
|
|
|
|
|
|
item.boomDescription = item.description;
|
|
|
|
|
|
item.materialName = item.boomName;
|
|
|
|
|
|
item.compositionName = item.composition;
|
2025-02-25 13:44:40 +08:00
|
|
|
|
|
2025-01-09 18:29:48 +08:00
|
|
|
|
// 确保 composition 是一个有效的数组
|
|
|
|
|
|
if (Array.isArray(item.composition) && item.composition.length > 0) {
|
|
|
|
|
|
item.composition = Number(item.composition);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
// // 获取加工件列表
|
|
|
|
|
|
// formData.value.boomItemDOList = (
|
|
|
|
|
|
// await PurchaseOrderBoomApi.getPurchaseOrderBoomPage(queryParams)
|
|
|
|
|
|
// ).list
|
|
|
|
|
|
// formData.value.boomItemDOList.forEach((item) => {
|
|
|
|
|
|
// item.boomPurchaseAmount = item.purchaseAmount
|
|
|
|
|
|
// item.boomEstimatedPrice = item.estimatedPrice
|
|
|
|
|
|
// item.boomActualPrice = item.actualPrice
|
|
|
|
|
|
// item.boomArriveTime = item.arriveTime
|
|
|
|
|
|
// item.boomArriveDate = item.requireTime
|
|
|
|
|
|
// item.boomDescription = item.description
|
|
|
|
|
|
// if (item.composition.length > 0) item.composition = Number(item.composition)
|
|
|
|
|
|
// })
|
|
|
|
|
|
// formData.value.boomItemRemoveList = []
|
|
|
|
|
|
|
|
|
|
|
|
// 附件信息
|
|
|
|
|
|
let attParams = {
|
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
|
pageSize: 99,
|
|
|
|
|
|
businessId: query.id,
|
2025-06-20 18:59:28 +08:00
|
|
|
|
businessType: 'PURCHASEORDERNO'
|
2025-01-09 18:29:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
formData.value.attachments = (await getFilePage(attParams)).list
|
|
|
|
|
|
|
|
|
|
|
|
if (formData.value.status == 3 || formData.value.status == 4) {
|
|
|
|
|
|
isShow.value = false
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//用户信息,用于底部数据展示
|
|
|
|
|
|
userList.value = await UserApi.getSimpleUserList()
|
|
|
|
|
|
|
|
|
|
|
|
supplierInit.value = await SupplierApi.getSimpList()
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
//接收物料传递的数据
|
|
|
|
|
|
const handleSelectedMaterial = (currentIndex: number, newValue: any) => {
|
|
|
|
|
|
// console.log(currentIndex,'接收物料对应的数据:', newValue)
|
|
|
|
|
|
formData.value.matItemDOList[currentIndex].matId = newValue?.id
|
|
|
|
|
|
formData.value.matItemDOList[currentIndex].matName = newValue?.name
|
|
|
|
|
|
formData.value.matItemDOList[currentIndex].matCode = newValue?.code
|
|
|
|
|
|
formData.value.matItemDOList[currentIndex].matSpec = newValue?.spec
|
|
|
|
|
|
formData.value.matItemDOList[currentIndex].matType = newValue?.materialType
|
|
|
|
|
|
formData.value.matItemDOList[currentIndex].matUnit = newValue?.unit
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|