377 lines
16 KiB
Vue
377 lines
16 KiB
Vue
<template>
|
||
<el-card class="hl-card" style="position: relative">
|
||
<template #header>
|
||
<span>编辑页</span>
|
||
</template>
|
||
<el-form ref="formRef" :model="formData" label-width="160px" v-loading="formLoading"><!-- :rules="formRules" -->
|
||
<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="6">
|
||
<el-form-item label="项目编号" prop="code">
|
||
<el-input class="!w-265px" v-model="formData.code" disabled />
|
||
</el-form-item>
|
||
|
||
</el-col>
|
||
<el-col :span="6">
|
||
<el-form-item label="项目名称" prop="projectName">
|
||
<el-input class="!w-265px" v-model="formData.projectName" disabled />
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="6">
|
||
<el-form-item label="客户名称" prop="customerName">
|
||
<el-input class="!w-265px" v-model="formData.customerName" disabled />
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="6">
|
||
<el-form-item label="子项目名称" prop="projectSubName">
|
||
<el-input class="!w-265px" v-model="formData.projectSubName" disabled />
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
<el-row>
|
||
<el-col :span="6">
|
||
<el-form-item label="标准件成本" prop="biaoZhunJianCost">
|
||
<el-input class="!w-265px" v-model="formData.biaoZhunJianCost" disabled />
|
||
</el-form-item>
|
||
|
||
|
||
|
||
</el-col>
|
||
<el-col :span="6">
|
||
<el-form-item label="其他成本" prop="yuanCaiLiaoCost">
|
||
<el-input class="!w-265px" v-model="formData.qiTaCost" disabled />
|
||
</el-form-item>
|
||
</el-col>
|
||
<!-- <el-col :span="6">-->
|
||
<!-- <el-form-item label="副资材成本" prop="code">-->
|
||
<!-- <el-input class="!w-265px" v-model="formData.fuZiCaiCost" disabled />-->
|
||
<!-- </el-form-item>-->
|
||
<!-- </el-col>-->
|
||
<!-- <el-col :span="6">-->
|
||
<!-- <el-form-item label="外协加工费用" prop="code">-->
|
||
<!-- <el-input class="!w-265px" v-model="formData.waiXieCost" disabled />-->
|
||
<!-- </el-form-item>-->
|
||
<!-- </el-col>-->
|
||
<!-- </el-row>-->
|
||
<!-- <el-row>-->
|
||
<el-col :span="6">
|
||
<el-form-item label="加工工时换算成本" prop="jiaGongShiCost">
|
||
<el-input class="!w-265px" v-model="formData.jiaGongShiCost" disabled />
|
||
</el-form-item>
|
||
</el-col>
|
||
<!-- <el-col :span="6">-->
|
||
<!-- <el-form-item label="钳工工时换算成本" prop="qianGongShiCost">-->
|
||
<!-- <el-input class="!w-265px" v-model="formData.qianGongShiCost" disabled />-->
|
||
<!-- </el-form-item>-->
|
||
<!-- </el-col>-->
|
||
<el-col :span="6">
|
||
<el-form-item label="运费成本" prop="yunFeiCost">
|
||
<el-input class="!w-265px" v-model="formData.yunFeiCost" disabled />
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
<el-row>
|
||
<el-col :span="6">
|
||
<el-form-item label="合计成本" prop="sumCost">
|
||
<el-input class="!w-265px" v-model="formData.sumCost" disabled />
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
<el-col :span="24">
|
||
<el-form-item label="备注" prop="rem">
|
||
<el-input class="!w-1825px" v-model="formData.rem" />
|
||
</el-form-item>
|
||
</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-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" border class="hl-table">
|
||
<el-table-column type="index" min-width="60" fixed label="序号" align="center" />
|
||
|
||
|
||
<el-table-column v-if="false" label="ID" align="center" prop="id" width="240px" />
|
||
<el-table-column label="物料编号" align="center" prop="materialCode" width="240px" />
|
||
<el-table-column label="物料名称" align="center" prop="materialName" width="240px"/>
|
||
<!-- <el-table-column label="物料类型" align="center" prop="materialType" width="240px"/>-->
|
||
<el-table-column label="物料类型" align="center" prop="materialType" width="150px">
|
||
<template #default="scope">
|
||
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.materialType" />
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="规格型号" align="center" prop="materialSpec" />
|
||
<el-table-column label="领料数量" align="center" prop="amount" />
|
||
<!-- <el-table-column label="系统单位" align="center" prop="unit" />-->
|
||
<el-table-column label="系统单位" align="center" prop="unit" width="100px">
|
||
<template #default="scope">
|
||
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.unit" />
|
||
</template>
|
||
</el-table-column>
|
||
<!-- <el-table-column label="平均采购价(暂估)" align="center" prop="zanGuMoney" />-->
|
||
<!-- <el-table-column label="平均采购价(实际)" align="center" >-->
|
||
<!-- <template v-slot="scope">-->
|
||
<!-- <el-input v-model="scope.row.shiJiMoney" />-->
|
||
<!-- </template>-->
|
||
<!-- </el-table-column>-->
|
||
<el-table-column label="库存价格(元)" align="center" prop="caiGouMoney" width="200px"/>
|
||
|
||
|
||
</el-table>
|
||
|
||
</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-table v-loading="loading" :data="listqt" :stripe="true" :show-overflow-tooltip="true" border class="hl-table">
|
||
<el-table-column type="index" width="100" fixed label="序号" align="center" />
|
||
|
||
|
||
<el-table-column v-if="false" label="ID" align="center" prop="id" width="240px" />
|
||
<el-table-column label="物料编号" align="center" prop="materialCode" width="200px" />
|
||
<el-table-column label="物料名称" align="center" prop="materialName" width="240px"/>
|
||
<!-- <el-table-column label="物料类型" align="center" prop="materialType" width="240px"/>-->
|
||
<el-table-column label="物料类型" align="center" prop="materialType" width="150px" >
|
||
<template #default="scope">
|
||
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.materialType" v-if="scope.row.type==0"/>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="规格型号" align="center" prop="materialSpec" width="100"/>
|
||
<el-table-column label="领料数量" align="center" prop="amount" width="100"/>
|
||
<!-- <el-table-column label="系统单位" align="center" prop="unit" />-->
|
||
<el-table-column label="系统单位" align="center" prop="unit" width="100px">
|
||
<template #default="scope">
|
||
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.unit" />
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="平均采购价(暂估)" align="center" prop="zanGuMoney" width="200"/>
|
||
<el-table-column label="平均采购价(实际)" align="center" prop="shiJiMoney" width="200"/>
|
||
<!-- <el-table-column label="平均采购价(实际)" align="center" width="100">-->
|
||
<!-- <template v-slot="scope">-->
|
||
<!-- <el-input v-model="scope.row.shiJiMoney" />-->
|
||
<!-- </template>-->
|
||
<!-- </el-table-column>-->
|
||
<el-table-column label="采购金额(实际)" align="center" prop="caiGouMoney" width="200"/>
|
||
|
||
|
||
</el-table>
|
||
|
||
</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-table v-loading="loading" :data="listFzc" :stripe="true" :show-overflow-tooltip="true" border class="hl-table">-->
|
||
<!-- <el-table-column type="index" min-width="60" fixed label="序号" align="center" />-->
|
||
|
||
|
||
<!-- <el-table-column v-if="false" label="ID" align="center" prop="id" width="240px" />-->
|
||
<!-- <el-table-column label="物料编号" align="center" prop="materialCode" width="240px" />-->
|
||
<!-- <el-table-column label="物料名称" align="center" prop="materialName" width="240px"/>-->
|
||
<!-- <el-table-column label="物料类型" align="center" prop="materialType" width="240px"/>-->
|
||
|
||
<!-- <el-table-column label="规格型号" align="center" prop="materialSpec" />-->
|
||
<!-- <el-table-column label="领料数量" align="center" prop="amount" />-->
|
||
<!-- <el-table-column label="系统单位" align="center" prop="unit" />-->
|
||
<!-- <el-table-column label="最新采购价(暂估)" align="center" prop="zanGuMoney" />-->
|
||
<!-- <el-table-column label="最新采购价(实际)" align="center" >-->
|
||
<!-- <template v-slot="scope">-->
|
||
<!-- <el-input v-model="scope.row.shiJiMoney" />-->
|
||
<!-- </template>-->
|
||
<!-- </el-table-column>-->
|
||
<!-- <el-table-column label="采购金额(实际)" align="center" prop="caiGouMoney" />-->
|
||
<!-- </el-table>-->
|
||
<!-- </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-table v-loading="loading" :data="listWx" :stripe="true" :show-overflow-tooltip="true" border class="hl-table">-->
|
||
<!-- <el-table-column type="index" min-width="60" fixed label="序号" align="center" />-->
|
||
<!-- <el-table-column v-if="false" label="ID" align="center" prop="id" width="240px" />-->
|
||
<!-- <el-table-column label="零件名称" align="center" prop="materialName" width="240px"/>-->
|
||
<!-- <el-table-column label="规格型号" align="center" prop="materialSpec" />-->
|
||
<!-- <el-table-column label="采购数量" align="center" prop="amount" />-->
|
||
<!-- <el-table-column label="系统单位" align="center" prop="unit" />-->
|
||
<!-- <el-table-column label="最新采购价(暂估)" align="center" prop="zanGuMoney" />-->
|
||
<!-- <el-table-column label="最新采购价(实际)" align="center" >-->
|
||
<!-- <template v-slot="scope">-->
|
||
<!-- <el-input v-model="scope.row.shiJiMoney" />-->
|
||
<!-- </template>-->
|
||
<!-- </el-table-column>-->
|
||
<!-- <el-table-column label="采购金额(实际)" align="center" prop="caiGouMoney" />-->
|
||
<!-- </el-table>-->
|
||
<!-- </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-table v-loading="loading" :data="listJg" :stripe="true" :show-overflow-tooltip="true" border class="hl-table">
|
||
<el-table-column type="index" min-width="60" fixed label="序号" align="center" />
|
||
<el-table-column v-if="false" label="ID" align="center" prop="id" width="240px" />
|
||
<el-table-column label="工序名称" align="center" prop="materialName" width="240px"/>
|
||
<el-table-column label="报工人" align="center" prop="ownerName" width="240px"/>
|
||
<!-- <el-table-column label="工序类型" align="center" prop="materialType" >-->
|
||
<!-- <template #default="scope">-->
|
||
<!-- <dict-tag :type="DICT_TYPE.HELI_PROCEDURE_TYPE" :value="scope.row.materialType" />-->
|
||
<!-- </template>-->
|
||
<!-- </el-table-column>-->
|
||
<el-table-column label="总加工工时" align="center" prop="amount" />
|
||
<el-table-column label="所属岗位" align="center" prop="name" />
|
||
<el-table-column label="工时单价(元)" align="center" prop="shiJiMoney"/>
|
||
<el-table-column label="加工费用(元)" align="center" prop="zanGuMoney" />
|
||
|
||
|
||
</el-table>
|
||
</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-table v-loading="loading" :data="listQg" :stripe="true" :show-overflow-tooltip="true" border class="hl-table">-->
|
||
<!-- <el-table-column type="index" min-width="60" fixed label="序号" align="center" />-->
|
||
<!-- <el-table-column v-if="false" label="ID" align="center" prop="id" width="240px" />-->
|
||
<!-- <el-table-column label="工序名称" align="center" prop="materialName" width="240px"/>-->
|
||
<!-- <el-table-column label="工序类型" align="center" prop="materialType" />-->
|
||
<!-- <el-table-column label="总加工工时" align="center" prop="amount" />-->
|
||
<!-- <el-table-column label="工时单价" align="center" >-->
|
||
<!-- <template v-slot="scope">-->
|
||
<!-- <el-input v-model="scope.row.shiJiMoney" />-->
|
||
<!-- </template>-->
|
||
<!-- </el-table-column>-->
|
||
<!-- <el-table-column label="加工费用" align="center" prop="zanGuMoney" />-->
|
||
|
||
|
||
<!-- </el-table>-->
|
||
<!-- </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-table v-loading="loading" :data="listYf" :stripe="true" :show-overflow-tooltip="true" border class="hl-table">
|
||
<el-table-column type="index" min-width="60" fixed label="序号" align="center" />
|
||
<el-table-column v-if="false" label="ID" align="center" prop="id" width="240px" />
|
||
<el-table-column label="发货时间" align="center" prop="deliverDate" width="240px" :formatter="dateFormatter2"/>
|
||
<el-table-column label="运费成本(元)" align="center" prop="yunFeiMoney" />
|
||
|
||
|
||
|
||
</el-table>
|
||
</el-card>
|
||
</el-form>
|
||
<div class="text-center hl-footer">
|
||
<el-button @click="() => router.back()" size="large">取 消</el-button>
|
||
<el-button @click="submitForm" type="success" size="large">保 存</el-button>
|
||
</div>
|
||
</el-card>
|
||
|
||
</template>
|
||
|
||
<script setup lang="ts">
|
||
import { inject } from 'vue'
|
||
|
||
import * as SaleeOrderCost from '@/api/heli/saleordercost'
|
||
import {dateFormatter2} from "@/utils/formatTime";
|
||
import {DICT_TYPE} from "@/utils/dict";
|
||
import {number} from "vue-types";
|
||
const { t } = useI18n() // 国际化
|
||
const message = useMessage() // 消息弹窗
|
||
const { query } = useRoute()
|
||
const router = useRouter()
|
||
const reload = inject('reload')
|
||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||
const list = ref([]) // 标准件数据
|
||
const listqt = ref([]) // 原材料
|
||
// const listFzc = ref([]) // 副资材
|
||
// const loading = ref(true) // 列表的加载中
|
||
|
||
// const listWx = ref([]) // 外协
|
||
const listJg = ref([]) // 加工
|
||
// const listQg = ref([]) // 钳工
|
||
const listYf = ref([]) // 运费
|
||
|
||
const formData = ref({
|
||
id:undefined,
|
||
code:undefined,
|
||
customerName:undefined,
|
||
projectSubName:undefined,
|
||
projectSubId:undefined,
|
||
projectName:undefined,
|
||
biaoZhunJianCost:undefined,
|
||
qiTaCost:undefined,
|
||
jiaGongShiCost:undefined,
|
||
yunFeiCost:undefined,
|
||
sumCost:undefined,
|
||
rem:undefined,
|
||
})
|
||
|
||
const submitForm = async () => {
|
||
|
||
}
|
||
|
||
//初始化方法
|
||
onMounted(async () => {
|
||
formData.value.id = query.id
|
||
formData.value.projectSubId = query.projectSubId
|
||
|
||
//查询子项目信息
|
||
const data = await SaleeOrderCost.getPlanCost(query.id,query.projectSubId)
|
||
formData.value = data
|
||
//查询运费成本
|
||
const listYfData = await SaleeOrderCost.getListYf(query.id,query.projectSubId)
|
||
listYf.value=listYfData
|
||
const listJgData = await SaleeOrderCost.getListJg(query.id,query.projectSubId)
|
||
listJg.value=listJgData
|
||
const listData = await SaleeOrderCost.getList(query.id,query.projectSubId)
|
||
list.value=listData
|
||
const listqtData = await SaleeOrderCost.getListqt(query.id,query.projectSubId)
|
||
listqt.value=listqtData
|
||
formData.value.yunFeiCost=0
|
||
formData.value.jiaGongShiCost=0
|
||
formData.value.biaoZhunJianCost=0
|
||
formData.value.qiTaCost=0
|
||
formData.value.yunFeiCost=0
|
||
if (listYf.value!=null){
|
||
listYf.value.map((item)=>{
|
||
formData.value.yunFeiCost+=item.yunFeiMoney
|
||
})
|
||
}
|
||
if (listJg.value!=null){
|
||
listJg.value.map((item)=>{
|
||
formData.value.jiaGongShiCost+=Number(item.zanGuMoney)
|
||
})
|
||
}
|
||
if (list.value!=null){
|
||
list.value.map((item)=>{
|
||
formData.value.biaoZhunJianCost+=Number(item.caiGouMoney)
|
||
})
|
||
}
|
||
if (listqt.value!=null){
|
||
listqt.value.map((item)=>{
|
||
formData.value.qiTaCost+=Number(item.caiGouMoney)
|
||
})
|
||
}
|
||
formData.value.sumCost= parseFloat((formData.value.yunFeiCost+formData.value.jiaGongShiCost+ formData.value.biaoZhunJianCost+ formData.value.qiTaCost).toFixed(2))
|
||
})
|
||
|
||
|
||
|
||
</script>
|
||
|
||
<style>
|
||
.hl-card .alter-class {
|
||
position: relative;
|
||
border: solid 1px orange;
|
||
outline: solid 1px orange;
|
||
}
|
||
</style>
|