2025-01-09 18:29:48 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<el-card class="hl-card" style="position: relative">
|
|
|
|
|
|
<template #header>
|
2025-03-06 14:28:45 +08:00
|
|
|
|
<span>编辑页</span>
|
2025-01-09 18:29:48 +08:00
|
|
|
|
</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">
|
2025-03-06 14:28:45 +08:00
|
|
|
|
<el-input class="!w-713px" type="textarea" v-model="formData.description" show-word-limit :disabled="formData.status == 2 || formData.status == 3" maxlength="200" />
|
2025-01-09 18:29:48 +08:00
|
|
|
|
</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> -->
|
|
|
|
|
|
<SupplierSelect v-model="formData.supplierId" disabled @update:new-value="handleSelectedSupplier" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
<el-form-item label="采购合同号" prop="contractNo">
|
2025-03-06 14:28:45 +08:00
|
|
|
|
<el-input class="!w-265px" v-model="formData.contractNo" placeholder="采购合同号" disabled/>
|
2025-01-09 18:29:48 +08:00
|
|
|
|
</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">-->
|
|
|
|
|
|
<!-- <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="subFormRules.matId" class="mb-0px!">-->
|
|
|
|
|
|
<!-- <MaterialSelect :key="scope.row.matId" v-model="scope.row.matId" v-bind:disabled="formData.status == 2 || formData.status == 3" @update:newValue="handleSelectedMaterial(scope.$index, $event)" />-->
|
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column> –>-->
|
|
|
|
|
|
<!-- <!– <el-table-column prop="matName" label="物料名称" min-width="120" align="center" /> –>-->
|
|
|
|
|
|
<!-- <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="120" 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="采购数量" @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="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="handleEstimatedPrice" :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 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="220" 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 v-model="scope.row.matId"-->
|
|
|
|
|
|
<!-- @update:newValue="handleSelectedMaterial(scope.$index, $event)"-->
|
|
|
|
|
|
<!-- v-bind:disabled="ctrView || ctrSave" /> –>-->
|
|
|
|
|
|
<!-- <el-input class="!w-265px" placeholder="物料编码" disabled v-model="scope.row.matCode" readonly>-->
|
|
|
|
|
|
<!-- <!– <template #append ><el-button @click="onAddItem" > <Icon icon="ep:search" class="mr-5px" /> </el-button></template> –>-->
|
|
|
|
|
|
<!-- </el-input>-->
|
|
|
|
|
|
<!-- </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">
|
|
|
|
|
|
<el-table-column type="index" label="序号" fixed align="center" min-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">
|
|
|
|
|
|
|
2025-03-06 14:28:45 +08:00
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.matType" v-if="typeof scope.row.matUnit === 'number'"/>
|
|
|
|
|
|
</template>
|
2025-01-09 18:29:48 +08:00
|
|
|
|
</el-table-column>
|
2025-03-06 14:28:45 +08:00
|
|
|
|
<el-table-column prop="matSpec" label="规格/型号" min-width="120" 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="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>
|
2025-03-06 14:28:45 +08:00
|
|
|
|
|
2025-01-09 18:29:48 +08:00
|
|
|
|
<el-table-column prop="estimatedPrice" min-width="200" align="center">
|
|
|
|
|
|
|
2025-07-03 14:14:24 +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-07-03 14:14:24 +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-07-03 14:14:24 +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-07-03 14:14:24 +08:00
|
|
|
|
<el-input-number style="width: 100%" v-model="scope.row.actualPrice" 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 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 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="200" 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">
|
2025-03-06 14:28:45 +08:00
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.matUnit" v-if="typeof scope.row.matUnit === 'number'"/>
|
|
|
|
|
|
</template>
|
2025-01-09 18:29:48 +08:00
|
|
|
|
</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">-->
|
|
|
|
|
|
<!-- <el-table-column type="index" label="序号" fixed align="center" min-width="60" />-->
|
|
|
|
|
|
<!-- <el-table-column prop="boomName" min-width="180" label="零件名称" align="center">-->
|
|
|
|
|
|
<!-- <template #header><span class="hl-table_header">*</span>零件名称</template>-->
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-form-item :prop="`${scope.$index}.boomName`" class="mb-0px!" :rules="subBoomFormRules.boomName">-->
|
|
|
|
|
|
<!-- <el-input v-model="scope.row.boomName" disabled />-->
|
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column prop="boomSpec" min-width="120" label="规格型号" align="center">-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-input v-model="scope.row.boomSpec" 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="scope">-->
|
|
|
|
|
|
<!-- <el-form-item :prop="`${scope.$index}.composition`" :rules="subBoomFormRules.composition" class="mb-0px!">-->
|
|
|
|
|
|
<!-- <CompositionSelect v-model="scope.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="subBoomFormRules.boomPurchaseAmount" class="mb-0px!">-->
|
|
|
|
|
|
<!-- <el-input-number style="width: 100%" v-model="scope.row.boomPurchaseAmount" placeholder="采购数量" @change="handleEstimatedPrice" :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="subBoomFormRules.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="handleEstimatedPrice" :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="scope">-->
|
|
|
|
|
|
<!-- <el-form-item :prop="`${scope.$index}.boomArriveTime`" :rules="subBoomFormRules.boomArriveTime" class="mb-0px!" >-->
|
|
|
|
|
|
<!-- <el-date-picker v-model="scope.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">-->
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <el-select v-model="scope.row.boomUnit" placeholder="下拉选择" clearable disabled>-->
|
|
|
|
|
|
<!-- <el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_MATERIAL_UNIT)" :key="dict.value" :label="dict.label" :value="dict.value" />-->
|
|
|
|
|
|
<!-- </el-select>-->
|
|
|
|
|
|
<!-- </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 min-width="200" 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="boomArriveDate" label="需求到货日期(最早)" min-width="200" align="center">-->
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- {{-->
|
|
|
|
|
|
<!-- formatDate(scope.row.boomArriveDate, 'YYYY-MM-DD')-->
|
|
|
|
|
|
<!-- }}-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <el-table-column prop="boomUnit" label="系统单位" min-width="100" align="center">-->
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <!– <el-select v-model="scope.row.boomUnit" placeholder="下拉选择" clearable :disabled="formData.status == 2 || formData.status == 3">–>-->
|
|
|
|
|
|
<!-- <!– <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="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
|
2025-03-06 14:28:45 +08:00
|
|
|
|
ref="matUploadRef" :file-list="matUploadFiles" multiple :action="uploadUrl" :headers="{
|
2025-01-09 18:29:48 +08:00
|
|
|
|
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">
|
2025-03-06 14:28:45 +08:00
|
|
|
|
<el-button @click="closeForm" size="large">取 消</el-button>
|
|
|
|
|
|
|
2025-01-09 18:29:48 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</el-card>
|
2025-03-06 14:28:45 +08:00
|
|
|
|
|
2025-01-09 18:29:48 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
|
import * as MaterialPlanApi from '@/api/heli/materialplan'
|
|
|
|
|
|
import * as PurchaseOrderApi from '@/api/heli/purchaseorder'
|
|
|
|
|
|
import * as PurchaseOrderMaterialApi from '@/api/heli/purchaseordermaterial'
|
|
|
|
|
|
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'
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-06 16:53:25 +08:00
|
|
|
|
import SupplierSelect from '@/views/heli/hlvuestyle/supplierSelect.vue'
|
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
|
|
|
|
const reload: any = inject('reload')
|
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
|
const { query } = useRoute()
|
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
|
const tagsViewStore = useTagsViewStore()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
|
|
|
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,
|
|
|
|
|
|
receivingStatus: undefined,
|
|
|
|
|
|
status: undefined,
|
|
|
|
|
|
createTime: undefined,
|
|
|
|
|
|
description: undefined,
|
|
|
|
|
|
matItemDOList: [],
|
|
|
|
|
|
matItemRemoveList: [],
|
|
|
|
|
|
boomItemDOList: [],
|
|
|
|
|
|
boomItemRemoveList: [],
|
2025-03-06 14:28:45 +08:00
|
|
|
|
attachments: [],
|
|
|
|
|
|
creator:undefined,
|
|
|
|
|
|
submitUserId:undefined,
|
|
|
|
|
|
submitTime:undefined,
|
|
|
|
|
|
auditor:undefined,
|
|
|
|
|
|
auditTime:undefined,
|
2025-01-09 18:29:48 +08:00
|
|
|
|
})
|
|
|
|
|
|
const formRules = reactive({
|
|
|
|
|
|
currencyType: [{ required: true, message: '结算币种不能为空', trigger: 'blur' }]
|
|
|
|
|
|
})
|
|
|
|
|
|
const subFormRules = reactive({
|
|
|
|
|
|
matId: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }],
|
2025-07-03 14:14:24 +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' }],
|
|
|
|
|
|
composition: [{ required: true, message: '材质不能为空', trigger: 'blur' }],
|
|
|
|
|
|
boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
|
2025-07-03 14:14:24 +08:00
|
|
|
|
boomEstimatedPrice: [{ required: true, message: '暂估总价不能为空', trigger: 'blur' }],
|
2025-01-09 18:29:48 +08:00
|
|
|
|
boomArriveTime: [{ required: true, message: '预计到货时间不能为空', trigger: 'blur' }],
|
|
|
|
|
|
})
|
|
|
|
|
|
const subMatPlanFormRules = reactive({
|
|
|
|
|
|
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
|
2025-07-03 14:14:24 +08:00
|
|
|
|
estimatedPrice: [{ required: true, message: '暂估总价不能为空', trigger: 'blur' }]
|
2025-01-09 18:29:48 +08:00
|
|
|
|
})
|
|
|
|
|
|
const subBoomPlanFormRules = reactive({
|
|
|
|
|
|
boomName: [{ required: true, message: '零件名称不能为空', trigger: 'blur' }],
|
|
|
|
|
|
boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
|
2025-07-03 14:14:24 +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 subBoomFormLoading = ref(false)
|
|
|
|
|
|
const matOpenFormRef = 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 handleSelectedMaterialPlanMat = (arr) => {
|
|
|
|
|
|
// 创建一个 Set 来存储现有的 matId
|
|
|
|
|
|
debugger
|
|
|
|
|
|
const existingMatIds = new Set(formData.value.matItemDOList.map(vo => vo.matId));
|
|
|
|
|
|
arr.forEach((item) => {
|
|
|
|
|
|
if (!existingMatIds.has(item.matId)) {
|
|
|
|
|
|
item.description = '';
|
2025-03-06 14:28:45 +08:00
|
|
|
|
item.matType=Number(item.matType)
|
|
|
|
|
|
item.matUnit=Number(item.matUnit)
|
2025-01-09 18:29:48 +08:00
|
|
|
|
formData.value.matItemDOList.push(item);
|
|
|
|
|
|
existingMatIds.add(item.matId); // 将新添加的 matId 加入 Set
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
|
|
|
|
|
const handleSelectedMaterialPlanBoom =async (arrBoom) => {
|
2025-02-25 13:44:40 +08:00
|
|
|
|
//debugger
|
2025-01-09 18:29:48 +08:00
|
|
|
|
const existingBoomDetailIds = new Set(formData.value.boomItemDOList.map(boom => boom.boomDetailId));
|
|
|
|
|
|
|
|
|
|
|
|
arrBoom.forEach((item) => {
|
|
|
|
|
|
if (!existingBoomDetailIds.has(item.boomDetailId)) {
|
2025-02-25 13:44:40 +08:00
|
|
|
|
item.description = '';
|
2025-01-09 18:29:48 +08:00
|
|
|
|
// formData.value.boomItemDOList.requireTime = item.boomArriveDate
|
|
|
|
|
|
// formData.value.boomItemDOList.composition = item.compositionName
|
|
|
|
|
|
// formData.value.boomItemDOList.boomName = item.materialName
|
|
|
|
|
|
formData.value.boomItemDOList.push(item);
|
|
|
|
|
|
existingBoomDetailIds.add(item.boomDetailId); // 将新添加的 boomDetailId 加入 Set
|
|
|
|
|
|
}
|
2025-03-06 14:28:45 +08:00
|
|
|
|
});
|
2025-01-09 18:29:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
// const getBoomList = async (arrBoom) => {
|
|
|
|
|
|
// //formData.value.boomItemDOList = arrBoom
|
|
|
|
|
|
// arrBoom.forEach((item) => {
|
|
|
|
|
|
// if (
|
|
|
|
|
|
// formData.value.boomItemDOList.filter(
|
|
|
|
|
|
// (boom) =>
|
|
|
|
|
|
// item.materialName == boom.materialName && item.projectSubCode == boom.projectSubCode
|
|
|
|
|
|
// ).length == 0
|
|
|
|
|
|
// ) {
|
|
|
|
|
|
// formData.value.boomItemDOList.push(item)
|
|
|
|
|
|
// }
|
|
|
|
|
|
// })
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleEstimatedPrice = () => {
|
|
|
|
|
|
let allEstimatePrice = 0
|
|
|
|
|
|
formData.value.matItemDOList.forEach((item) => {
|
|
|
|
|
|
allEstimatePrice += ((item.purchaseAmount==null || item.purchaseAmount==undefined)?0:item.purchaseAmount)*((item.estimatedPrice==null || item.estimatedPrice==undefined)?0:item.estimatedPrice)
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
formData.value.boomItemDOList.forEach((item) => {
|
2025-03-06 14:28:45 +08:00
|
|
|
|
allEstimatePrice += ((item.purchaseAmount==null || item.purchaseAmount==undefined)?0:item.purchaseAmount)*((item.estimatedPrice==null || item.estimatedPrice==undefined)?0:item.estimatedPrice)
|
2025-01-09 18:29:48 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
formData.value.estimatedPrice = allEstimatePrice
|
|
|
|
|
|
|
|
|
|
|
|
let allActualPrice = 0
|
|
|
|
|
|
formData.value.matItemDOList.forEach((item) => {
|
|
|
|
|
|
allActualPrice += ((item.purchaseAmount==null || item.purchaseAmount==undefined)?0:item.purchaseAmount)*((item.actualPrice==null || item.actualPrice==undefined)?0:item.actualPrice)
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
formData.value.boomItemDOList.forEach((item) => {
|
2025-03-06 14:28:45 +08:00
|
|
|
|
allActualPrice += ((item.purchaseAmount==null || item.purchaseAmount==undefined)?0:item.purchaseAmount)*((item.actualPrice==null || item.actualPrice==undefined)?0:item.actualPrice)
|
2025-01-09 18:29:48 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
formData.value.actualPrice = allActualPrice
|
|
|
|
|
|
}
|
|
|
|
|
|
const handleActualPrice = () => {
|
2025-02-25 13:44:40 +08:00
|
|
|
|
|
2025-01-09 18:29:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ====================附件信息 开始=======================================
|
|
|
|
|
|
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 = () => {
|
|
|
|
|
|
matOpenFormRef.value.open(0,'group')
|
|
|
|
|
|
// const newData = {
|
|
|
|
|
|
// // 新数据的属性
|
|
|
|
|
|
// purchaseOrderId: 0,
|
|
|
|
|
|
// matId: '',
|
|
|
|
|
|
// matName: '',
|
|
|
|
|
|
// matCode: '',
|
|
|
|
|
|
// matType: '',
|
|
|
|
|
|
// matSpec: '',
|
|
|
|
|
|
// matUnit: '',
|
|
|
|
|
|
// purchaseAmount: undefined,
|
|
|
|
|
|
// estimatedPrice: undefined,
|
|
|
|
|
|
// actualPrice: undefined,
|
|
|
|
|
|
// arriveTime: '',
|
|
|
|
|
|
// description: ''
|
|
|
|
|
|
// }
|
|
|
|
|
|
// formData.value.matItemDOList.push(newData)
|
|
|
|
|
|
}
|
|
|
|
|
|
const getList = async (arrMat) => {
|
|
|
|
|
|
arrMat.forEach((row) => {
|
2025-02-25 13:44:40 +08:00
|
|
|
|
if ( formData.value.matItemDOList.filter((item) => item.matId == row.matId).length == 0)
|
2025-01-09 18:29:48 +08:00
|
|
|
|
{
|
|
|
|
|
|
row.id = undefined
|
|
|
|
|
|
formData.value.matItemDOList.push(row)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
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) {
|
|
|
|
|
|
subData.id = await PurchaseOrderMaterialApi.createPurchaseOrderMaterial(subData)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
await PurchaseOrderMaterialApi.updatePurchaseOrderMaterial(subData)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
formData.value.matItemRemoveList.forEach(async (item) => {
|
|
|
|
|
|
if (item.id != undefined) {
|
|
|
|
|
|
await PurchaseOrderMaterialApi.deletePurchaseOrderMaterial(item.id)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
//新增物料信息
|
|
|
|
|
|
const onBoomAddItem = () => {
|
|
|
|
|
|
const newData = {
|
|
|
|
|
|
// 新数据的属性
|
|
|
|
|
|
purchaseOrderId: 0,
|
|
|
|
|
|
boomDetailId: undefined,
|
|
|
|
|
|
boomName: '',
|
|
|
|
|
|
boomSpec: '',
|
|
|
|
|
|
composition: '',
|
|
|
|
|
|
boomUnit: '',
|
|
|
|
|
|
boomAmount: undefined,
|
|
|
|
|
|
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 saveForm = async () => {
|
|
|
|
|
|
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
|
|
|
|
|
|
}
|
2025-03-06 14:28:45 +08:00
|
|
|
|
let flag=false
|
|
|
|
|
|
if (formData.value.purchaseType==1&&formData.value.goodsType==1){
|
|
|
|
|
|
for (var i=0;i<formData.value.matItemDOList.length;i++){
|
|
|
|
|
|
const requireAmount = formData.value.matItemDOList[i].requireAmount;
|
|
|
|
|
|
const purchaseAmount = formData.value.matItemDOList[i].purchaseAmount;
|
|
|
|
|
|
if (requireAmount!=purchaseAmount){
|
|
|
|
|
|
flag=true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (formData.value.purchaseType==1&&formData.value.goodsType==2){
|
|
|
|
|
|
for (var i=0;i<formData.value.boomItemDOList.length;i++){
|
|
|
|
|
|
const requireAmount = formData.value.boomItemDOList[i].boomAmount;
|
|
|
|
|
|
const purchaseAmount = formData.value.boomItemDOList[i].purchaseAmount;
|
|
|
|
|
|
if (requireAmount!=purchaseAmount){
|
|
|
|
|
|
flag=true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (flag){
|
|
|
|
|
|
await message.confirm('需求数量和采购数量不一致,是否继续?')
|
|
|
|
|
|
}
|
2025-01-09 18:29:48 +08:00
|
|
|
|
// 提交请求
|
|
|
|
|
|
formLoading.value = true
|
|
|
|
|
|
try {
|
|
|
|
|
|
const data = formData.value as unknown as PurchaseOrderApi.PurchaseOrderVO
|
|
|
|
|
|
var purchaseOrderId = await PurchaseOrderApi.updatePurchaseOrder(data)
|
|
|
|
|
|
// 保存物料信息
|
|
|
|
|
|
await saveMaterials()
|
|
|
|
|
|
// 保存加工件信息
|
|
|
|
|
|
await saveBooms()
|
|
|
|
|
|
//formData.value.matItemDOList
|
|
|
|
|
|
|
|
|
|
|
|
if (formData.value.attachments != undefined && formData.value.attachments.length > 0) {
|
|
|
|
|
|
//附件信息保存
|
|
|
|
|
|
matUploadData.value.businessId = formData.value.id
|
|
|
|
|
|
await matUploadRef.value!.submit()
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message.success(t('common.updateSuccess'))
|
|
|
|
|
|
dialogVisible.value = false
|
|
|
|
|
|
|
|
|
|
|
|
// 发送操作成功的事件
|
|
|
|
|
|
emit('success')
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
if (sumbefore.value == 0) {
|
|
|
|
|
|
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
|
|
|
|
|
|
}
|
2025-02-25 13:44:40 +08:00
|
|
|
|
// 计划状态为已送审
|
2025-01-09 18:29:48 +08:00
|
|
|
|
formData.value.receivingStatus = 2
|
|
|
|
|
|
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
|
|
|
|
|
|
})
|
|
|
|
|
|
const matSimpList = ref([]) // 物料基本信息列表
|
|
|
|
|
|
// 页面数据加载初始化
|
|
|
|
|
|
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
|
|
|
|
|
|
var matTypes = getIntDictOptions(DICT_TYPE.HELI_MATERIAL_TYPE)
|
|
|
|
|
|
var matUnits = getIntDictOptions(DICT_TYPE.HELI_MATERIAL_UNIT)
|
|
|
|
|
|
formData.value.matItemDOList.forEach((item) => {
|
|
|
|
|
|
matList.value.push({ id: item.materialId, code: item.matCode })
|
2025-06-20 18:59:28 +08:00
|
|
|
|
// item.matType = matTypes.find( op => op.value == matSimpList.value.find((record) => record.id === item.materialId)?.material_type)?.label
|
|
|
|
|
|
// item.matUnit = matUnits.find( op => op.value == matSimpList.value.find((record) => record.id === item.materialId)?.unit)?.label
|
2025-01-09 18:29:48 +08:00
|
|
|
|
})
|
|
|
|
|
|
formData.value.matItemRemoveList = []
|
|
|
|
|
|
formData.value.boomItemRemoveList = []
|
2025-02-25 13:44:40 +08:00
|
|
|
|
|
2025-01-09 18:29:48 +08:00
|
|
|
|
|
|
|
|
|
|
// 获取采购订单数据
|
2025-03-06 14:28:45 +08:00
|
|
|
|
formData.value.boomItemDOList = (
|
|
|
|
|
|
await PurchaseOrderBoomApi.getPurchaseOrderBoomPage(queryParams)
|
|
|
|
|
|
).list;
|
2025-01-09 18:29:48 +08:00
|
|
|
|
|
|
|
|
|
|
// 遍历每个 item,进行属性赋值
|
2025-03-06 14:28:45 +08:00
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
// 确保 composition 是一个有效的数组
|
|
|
|
|
|
if (Array.isArray(item.composition) && item.composition.length > 0) {
|
|
|
|
|
|
item.composition = Number(item.composition);
|
|
|
|
|
|
}
|
2025-01-09 18:29:48 +08:00
|
|
|
|
}
|
2025-03-06 14:28:45 +08:00
|
|
|
|
});
|
2025-01-09 18:29:48 +08:00
|
|
|
|
// 获取加工件列表
|
|
|
|
|
|
// 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)
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
// 附件信息
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
//用户信息,用于底部数据展示
|
|
|
|
|
|
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
|
|
|
|
|
|
}
|
|
|
|
|
|
//接收加工件物料传递的数据
|
|
|
|
|
|
const handleSelectedBoomMaterial = (currentIndex: number, newValue: any) => {
|
|
|
|
|
|
// console.log(currentIndex,'接收物料对应的数据:', newValue)
|
|
|
|
|
|
formData.value.boomItemDOList[currentIndex].boomDetailId = newValue?.id
|
|
|
|
|
|
formData.value.boomItemDOList[currentIndex].materialName = newValue?.name
|
|
|
|
|
|
// formData.value.boomItemDOList[currentIndex].matCode = newValue?.code
|
|
|
|
|
|
// formData.value.boomItemDOList[currentIndex].matSpec = newValue?.spec
|
|
|
|
|
|
// formData.value.boomItemDOList[currentIndex].matType = newValue?.materialType
|
|
|
|
|
|
// formData.value.boomItemDOList[currentIndex].matUnit = newValue?.unit
|
|
|
|
|
|
}
|
|
|
|
|
|
//接收供应商传递的数据
|
|
|
|
|
|
const handleSelectedSupplier = (newValue: any) => {
|
|
|
|
|
|
formData.value.supplierId = newValue?.id
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|