|
|
|
@ -2,18 +2,19 @@ |
|
|
|
<div class="mode-config"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-button type="primary" @click="quotationLeadIntoDetailFlag = true">从询价单导入明细</el-button> |
|
|
|
<el-button type="primary" @click="quotationDetailFlag = true">新增报价明细</el-button> |
|
|
|
<el-button type="primary">从历史报价明细导入</el-button> |
|
|
|
<el-button type="primary" :loading="quotation.quotationHeaderId === undefined">从询价单导入明细</el-button> |
|
|
|
<el-button type="primary" :loading="quotation.quotationHeaderId === undefined" @click="quotationLeadIntoDetailFlag = true">新增报价明细</el-button> |
|
|
|
<el-button type="primary" :loading="quotation.quotationHeaderId === undefined">从历史报价明细导入</el-button> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24" style="margin-top: 10px"> |
|
|
|
<el-table :data="tableData" height="250px" stripe border :header-cell-style="{background:'rgba(23,179,163)',color:'#fff'}"> |
|
|
|
<el-table-column |
|
|
|
label="操作" |
|
|
|
fixed |
|
|
|
width="60" align="center"> |
|
|
|
width="90" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="text" style="padding: 0px 10px" size="small">下达</el-button> |
|
|
|
<el-link>下达</el-link> |
|
|
|
<el-link @click="editQuotationDetail(scope.row)">编辑</el-link> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
@ -123,7 +124,7 @@ |
|
|
|
width="80" align="center"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
label="询价单序号" prop="internalInnquiryNo" |
|
|
|
label="询价单序号" prop="internalInquiryNo" |
|
|
|
width="80" align="center"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
@ -146,34 +147,34 @@ |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<!--新增报价明细--> |
|
|
|
<el-dialog :visible.sync="quotationLeadIntoDetailFlag" title="新增报价明细" width="30%"> |
|
|
|
<el-form :model="insertQuotationDetailData" label-width="80px" label-position="top" :inline="true"> |
|
|
|
<el-dialog @open="openInsertQuotationDetail" @close="closeInsertQuotationDetail" :visible.sync="quotationLeadIntoDetailFlag" title="新增报价明细" width="30%"> |
|
|
|
<el-form :model="insertQuotationDetail" ref="insertQuotationDetailForm" :rules="quotationDetailRules" label-width="80px" label-position="top" :inline="true"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="产品编码" style="width: 47%"> |
|
|
|
<el-input /> |
|
|
|
<el-form-item label="产品编码" style="width: 47%" prop="productNo"> |
|
|
|
<el-input v-model="insertQuotationDetail.productNo" clearable/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="产品名称" style="width: 47%"> |
|
|
|
<el-input /> |
|
|
|
<el-form-item label="产品名称" style="width: 47%" prop="productDesc"> |
|
|
|
<el-input v-model="insertQuotationDetail.productDesc" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="报价数量" style="width: 47%"> |
|
|
|
<el-input /> |
|
|
|
<el-form-item label="报价数量" style="width: 47%" prop="quotationDetailQuantity"> |
|
|
|
<el-input v-model="insertQuotationDetail.quotationDetailQuantity" clearable/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="内部询价单号" style="width: 47%"> |
|
|
|
<el-input /> |
|
|
|
<el-form-item label="内部询价单号" style="width: 47%" prop="internalInquiryNo"> |
|
|
|
<el-input v-model="insertQuotationDetail.internalInquiryNo" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="状态" style="width: 47%"> |
|
|
|
<el-select style="width: 100%" clearable placeholder="请选择" value="草稿"> |
|
|
|
<el-form-item label="状态" style="width: 47%" prop="quotationDetailStatus"> |
|
|
|
<el-select v-model="insertQuotationDetail.quotationDetailStatus" style="width: 100%" clearable placeholder="请选择"> |
|
|
|
<el-option label="草稿" value="草稿"></el-option> |
|
|
|
<el-option label="下达" value="下达"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="序号" style="width: 47%"> |
|
|
|
<el-input /> |
|
|
|
<el-form-item label="序号" style="width: 47%" prop="itemNo"> |
|
|
|
<el-input v-model="insertQuotationDetail.itemNo" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
@ -182,21 +183,21 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="备注" style="display: block;height: 60px"> |
|
|
|
<el-input type="textarea" :autosize="{minRows: 1, maxRows: 3}"/> |
|
|
|
<el-form-item label="备注" style="display: block;height: 60px" prop="remark"> |
|
|
|
<el-input type="textarea" v-model="insertQuotationDetail.remark" :autosize="{minRows: 1, maxRows: 3}"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer" style="margin-top: 20px"> |
|
|
|
<el-button @click="quotationLeadIntoDetailFlag = false">关 闭</el-button> |
|
|
|
<el-button type="primary" @click="quotationLeadIntoDetailFlag = false">保 存</el-button> |
|
|
|
<el-button type="primary" @click="insertQuotationDetailBtn">保 存</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!--新增--> |
|
|
|
<el-dialog @close="closeInsertDialog" :visible.sync="quotationDetailFlag" width="60%" top="2vh"> |
|
|
|
<el-form :rules="quotationDetailRules" ref="quotationDetailForm" :model="insertQuotationDetailData" label-width="80px" label-position="top" :inline="true"> |
|
|
|
<el-dialog @open="openQuotationDetailData" @close="closeInsertDialog" :visible.sync="quotationDetailFlag" width="60%" top="2vh"> |
|
|
|
<el-form :rules="quotationDetailRules" style="margin-top: 5px" ref="quotationDetailForm" :model="quotationDetailData" label-width="80px" label-position="top" :inline="true"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="产品编码" prop="productNo"> |
|
|
|
@ -210,8 +211,8 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="内部询价单号" prop="internalInnquiryNo"> |
|
|
|
<el-input clearable v-model="quotationDetailData.internalInnquiryNo"/> |
|
|
|
<el-form-item label="内部询价单号" prop="internalInquiryNo"> |
|
|
|
<el-input clearable v-model="quotationDetailData.internalInquiryNo"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="状态" prop="quotationDetailStatus"> |
|
|
|
<el-select v-model="quotationDetailData.quotationDetailStatus" style="width: 100%" clearable placeholder="请选择" value="草稿"> |
|
|
|
@ -280,22 +281,22 @@ |
|
|
|
</el-table> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="工具"> |
|
|
|
<el-button type="primary" @click="insertQuotationToolFlag = true">新 增</el-button> |
|
|
|
<el-button type="primary" @click="saveQuotationToolFlag = true">新 增</el-button> |
|
|
|
<el-button type="primary">从其他报价单复制</el-button> |
|
|
|
<el-table style="margin-top: 5px" :data="quotationToolList" height="400"> |
|
|
|
<el-table-column label="操作" width="120" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-link style="cursor: pointer">编辑</el-link> |
|
|
|
<el-link style="cursor: pointer">删除</el-link> |
|
|
|
<el-link style="cursor: pointer" @click="clickEditToolTableBtn(scope.row)">编辑</el-link> |
|
|
|
<el-link style="cursor: pointer" @click="clickDeleteToolTableBtn(scope.row)">删除</el-link> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column type="index" width="50" align="center" label="序号"/> |
|
|
|
<el-table-column label="工具编码" align="center"/> |
|
|
|
<el-table-column label="工具描述" align="center"/> |
|
|
|
<el-table-column label="工具数量" align="center"/> |
|
|
|
<el-table-column label="单位成本" align="center"/> |
|
|
|
<el-table-column label="预计使用寿命" align="center"/> |
|
|
|
<el-table-column label="备注" align="center"/> |
|
|
|
<el-table-column width="50" align="center" label="序号" prop="itemNo"/> |
|
|
|
<el-table-column label="工具编码" align="center" prop="toolNo"/> |
|
|
|
<el-table-column label="工具描述" align="center" prop="toolDescription"/> |
|
|
|
<el-table-column label="工具数量" align="center" prop="toolQuantity"/> |
|
|
|
<el-table-column label="单位成本" align="center" prop="unitCost"/> |
|
|
|
<el-table-column label="预计使用寿命" align="center" prop="expectedServiceLife"/> |
|
|
|
<el-table-column label="备注" align="center" prop="remark"/> |
|
|
|
</el-table> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="成品属性"> |
|
|
|
@ -343,27 +344,27 @@ |
|
|
|
<el-row> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="材料成本:" prop="adjustPartCost"> |
|
|
|
<el-input v-model="quotationDetailData.adjustPartCost" clearable/> |
|
|
|
<el-input v-model="quotationDetailData.adjustPartCost" @input="inputOuterCost" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" :offset="1"> |
|
|
|
<el-form-item label="机器成本:" prop="adjustMachineCost"> |
|
|
|
<el-input v-model="quotationDetailData.adjustMachineCost" clearable/> |
|
|
|
<el-input v-model="quotationDetailData.adjustMachineCost" @input="inputOuterCost" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" :offset="1"> |
|
|
|
<el-form-item label="制造费用成本:" prop="adjustFabricateCost"> |
|
|
|
<el-input v-model="quotationDetailData.adjustFabricateCost" clearable/> |
|
|
|
<el-input v-model="quotationDetailData.adjustFabricateCost" @input="inputOuterCost" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" :offset="1"> |
|
|
|
<el-form-item label="人工成本:" prop="adjustLabourCost"> |
|
|
|
<el-input v-model="quotationDetailData.adjustLabourCost" clearable/> |
|
|
|
<el-input v-model="quotationDetailData.adjustLabourCost" @input="inputOuterCost" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" :offset="1"> |
|
|
|
<el-form-item label="工具成本:" prop="adjustToolCost"> |
|
|
|
<el-input v-model="quotationDetailData.adjustToolCost" clearable/> |
|
|
|
<el-input v-model="quotationDetailData.adjustToolCost" @input="inputOuterCost" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
@ -376,12 +377,12 @@ |
|
|
|
<el-row> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="管理成本:" prop="detailManageCost"> |
|
|
|
<el-input v-model="quotationDetailData.detailManageCost" clearable/> |
|
|
|
<el-input v-model="quotationDetailData.detailManageCost" @input="inputOuterCost" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" :offset="1"> |
|
|
|
<el-form-item label="其他成本:" prop="detailOtherCost"> |
|
|
|
<el-input v-model="quotationDetailData.detailOtherCost" clearable/> |
|
|
|
<el-input v-model="quotationDetailData.detailOtherCost" @input="inputOuterCost" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" :offset="1"> |
|
|
|
@ -399,7 +400,7 @@ |
|
|
|
<el-row> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="利润率%:" prop="detailProfitRate"> |
|
|
|
<el-input v-model="quotationDetailData.detailProfitRate" /> |
|
|
|
<el-input v-model="quotationDetailData.detailProfitRate" @input="inputProfitRate" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" :offset="1"> |
|
|
|
@ -416,25 +417,30 @@ |
|
|
|
<el-form :rules="rules" ref="priceForm4" :model="quotationDetailData" :inline="true" label-position="top" label-width="120px"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="系统计算总金额:" prop="systemComputeAmount"> |
|
|
|
<el-form-item label="未税总价:" prop="systemComputeAmount"> |
|
|
|
<el-input v-model="quotationDetailData.systemComputeAmount" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" :offset="1"> |
|
|
|
<el-form-item label="系统计算价格:" prop="systemComputePrice"> |
|
|
|
<el-form-item label="含税总价:" prop="systemComputePrice"> |
|
|
|
<el-input v-model="quotationDetailData.systemComputePrice" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" :offset="1"> |
|
|
|
<el-form-item label="最终去税价格:" prop="finalUntaxedPrice"> |
|
|
|
<el-input v-model="quotationDetailData.finalUntaxedPrice" clearable/> |
|
|
|
<el-form-item label="未税单价:" prop="finalUntaxedPrice"> |
|
|
|
<el-input v-model="quotationDetailData.finalUntaxedPrice" disabled clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" :offset="1"> |
|
|
|
<el-form-item label="最终含税价格:" prop="finalTaxedPrice"> |
|
|
|
<el-form-item label="含税单价:" prop="finalTaxedPrice"> |
|
|
|
<el-input v-model="quotationDetailData.finalTaxedPrice" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" :offset="1"> |
|
|
|
<el-form-item label="税率%:" prop="taxRate"> |
|
|
|
<el-input v-model="quotationDetailData.taxRate" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
</fieldset> |
|
|
|
@ -442,32 +448,32 @@ |
|
|
|
</el-tabs> |
|
|
|
<span slot="footer" class="dialog-footer" style="margin-top: 5px"> |
|
|
|
<el-button @click=" quotationDetailFlag= false">取 消</el-button> |
|
|
|
<el-button type="primary" @click="quotationDetailFlag = false">确 定</el-button> |
|
|
|
<el-button type="primary" @click="saveQuotationDetail">确 定</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!--quotationTool新增--> |
|
|
|
<el-dialog @close="closeQuotationToolDialog" title="新增报价工具" :visible.sync="insertQuotationToolFlag" width="40%" top="10vh"> |
|
|
|
<el-dialog @close="closeQuotationToolDialog" title="报价工具" :visible.sync="saveQuotationToolFlag" width="40%" top="10vh"> |
|
|
|
<el-form :rules="quotationToolRules" ref="quotationToolForm" :model="quotationTool" label-position="top" style="height: 260px"> |
|
|
|
<el-row> |
|
|
|
<el-col span="10"> |
|
|
|
<el-col :span="10"> |
|
|
|
<el-form-item label="工具编码" prop="toolNo"> |
|
|
|
<el-input v-model="quotationTool.toolNo" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col span="10" offset="2"> |
|
|
|
<el-col :span="10" :offset="2"> |
|
|
|
<el-form-item label="工具描述" prop="toolDescription"> |
|
|
|
<el-input v-model="quotationTool.toolDescription" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col span="10"> |
|
|
|
<el-col :span="10"> |
|
|
|
<el-form-item label="工具数量" prop="toolQuantity"> |
|
|
|
<el-input v-model="quotationTool.toolQuantity" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col span="10" offset="2"> |
|
|
|
<el-col :span="10" :offset="2"> |
|
|
|
<el-form-item label="单位成本" prop="unitCost"> |
|
|
|
<el-input v-model="quotationTool.unitCost" clearable/> |
|
|
|
</el-form-item> |
|
|
|
@ -479,7 +485,7 @@ |
|
|
|
<el-input v-model="quotationTool.expectedServiceLife" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="10" offset="2"> |
|
|
|
<el-col :span="10" :offset="2"> |
|
|
|
<el-form-item label="序号" prop="itemNo"> |
|
|
|
<el-input v-model="quotationTool.itemNo" clearable/> |
|
|
|
</el-form-item> |
|
|
|
@ -490,18 +496,20 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer" style="margin-top: 5px"> |
|
|
|
<el-button @click=" insertQuotationToolFlag= false">取 消</el-button> |
|
|
|
<el-button type="primary" @click="insertQuotationToolFlag = false">确 定</el-button> |
|
|
|
<el-button @click=" saveQuotationToolFlag= false">取 消</el-button> |
|
|
|
<el-button type="primary" @click="insertQuotationTool">确 定</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import { |
|
|
|
insertQuotationTool, |
|
|
|
saveQuotationTool, |
|
|
|
searchQuotationTool, |
|
|
|
deleteQuotationTool, |
|
|
|
searchQuotationDetailPageByHeaderId, |
|
|
|
insertQuotationDetail, |
|
|
|
updateQuotationDetail, |
|
|
|
} from '@/api/quotation/quotationHeader.js'; |
|
|
|
export default { |
|
|
|
props:['quotationHeader'], |
|
|
|
@ -518,7 +526,7 @@ export default { |
|
|
|
// 拟态框 |
|
|
|
quotationDetailFlag:false, |
|
|
|
quotationLeadIntoDetailFlag:false, |
|
|
|
insertQuotationToolFlag:false, |
|
|
|
saveQuotationToolFlag:false, |
|
|
|
//新增 报价详情数据 |
|
|
|
insertQuotationDetailData:{ |
|
|
|
flag:false, |
|
|
|
@ -526,6 +534,7 @@ export default { |
|
|
|
activeName:"index",//选择的标签页 |
|
|
|
materialDataList:[{id:1}],// 材料对象集合 |
|
|
|
quotationTool:{//报价工具对象 |
|
|
|
quotationToolId:undefined, |
|
|
|
site:this.$store.state.user.site, |
|
|
|
toolNo:"", |
|
|
|
itemNo:undefined, |
|
|
|
@ -535,12 +544,28 @@ export default { |
|
|
|
expectedServiceLife:undefined, |
|
|
|
remark:"", |
|
|
|
}, |
|
|
|
// 新增的 |
|
|
|
insertQuotationDetail:{//详情对象 |
|
|
|
quotationDetailId:undefined,//主键 |
|
|
|
quotationHeaderId: undefined,//父编号 |
|
|
|
site:this.$store.state.user.site,// 工厂编号 |
|
|
|
productNo:undefined,//产品编码 |
|
|
|
productDesc:undefined,//产品名称 |
|
|
|
quotationDetailQuantity:undefined,//报价数量 |
|
|
|
internalInquiryNo:undefined,//内部询价单号 |
|
|
|
quotationDetailStatus:"草稿",//报价状态 |
|
|
|
itemNo:undefined,//序号 |
|
|
|
taxRate:13,//税率 |
|
|
|
remark: undefined,//备注 |
|
|
|
}, |
|
|
|
quotationDetailData:{//详情对象 |
|
|
|
quotationDetailId:undefined,//主键 |
|
|
|
quotationHeaderId: undefined,//父编号 |
|
|
|
site:this.$store.state.user.site,// 工厂编号 |
|
|
|
productNo:undefined,//产品编码 |
|
|
|
productDesc:undefined,//产品名称 |
|
|
|
quotationDetailQuantity:undefined,//报价数量 |
|
|
|
internalInnquiryNo:undefined,//内部询价单号 |
|
|
|
internalInquiryNo:undefined,//内部询价单号 |
|
|
|
quotationDetailStatus:"草稿",//报价状态 |
|
|
|
itemNo:undefined,//序号 |
|
|
|
computePartCost:undefined,//计算的材料成本 |
|
|
|
@ -562,20 +587,40 @@ export default { |
|
|
|
systemComputePrice:undefined,//系统计算价格 |
|
|
|
finalUntaxedPrice:undefined,//最终去税价格 |
|
|
|
finalTaxedPrice:undefined,//最终含税价格 |
|
|
|
taxRate:13,//税率 |
|
|
|
remark: undefined,//备注 |
|
|
|
}, |
|
|
|
// 表单校验 |
|
|
|
// 报价详情表单校验 |
|
|
|
quotationDetailRules:{ |
|
|
|
productNo:[ |
|
|
|
{ required: true, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, message: ' ', trigger: 'blur' }, |
|
|
|
], |
|
|
|
productDesc:[ |
|
|
|
{ required: true, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, message: ' ', trigger: 'blur' }, |
|
|
|
], |
|
|
|
itemNo:[ |
|
|
|
{ required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'blur' }, |
|
|
|
], |
|
|
|
quotationDetailStatus:[ |
|
|
|
{ required: true, message: ' ', trigger: 'change' }, |
|
|
|
], |
|
|
|
internalInquiryNo:[ |
|
|
|
{ required: true, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, message: ' ', trigger: 'blur' }, |
|
|
|
], |
|
|
|
quotationDetailQuantity:[ |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
], |
|
|
|
}, |
|
|
|
// 报价工具表单校验 |
|
|
|
quotationToolRules:{ |
|
|
|
toolNo:[ |
|
|
|
{ required: true, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, message: ' ', trigger: 'change',label:"工具编号"}, |
|
|
|
{ required: true, message: ' ', trigger: 'blur' }, |
|
|
|
], |
|
|
|
toolDescription:[ |
|
|
|
@ -583,16 +628,16 @@ export default { |
|
|
|
{ required: true, message: ' ', trigger: 'blur' }, |
|
|
|
], |
|
|
|
toolQuantity:[ |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
], |
|
|
|
unitCost:[ |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
], |
|
|
|
expectedServiceLife:[ |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
], |
|
|
|
itemNo:[ |
|
|
|
{ required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'change' }, |
|
|
|
@ -602,42 +647,69 @@ export default { |
|
|
|
// 价格表单 |
|
|
|
rules: { |
|
|
|
detailProfitRate: [ |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
{ required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'blur' }, |
|
|
|
], |
|
|
|
adjustPartCost: [ |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
], |
|
|
|
adjustMachineCost: [ |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
], |
|
|
|
adjustFabricateCost: [ |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
], |
|
|
|
adjustLabourCost: [ |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
], |
|
|
|
adjustToolCost: [ |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
], |
|
|
|
detailManageCost: [ |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
], |
|
|
|
detailOtherCost: [ |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
], |
|
|
|
finalUntaxedPrice: [ |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' }, |
|
|
|
taxRate: [ |
|
|
|
{ required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'change' }, |
|
|
|
{ required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'blur' }, |
|
|
|
], |
|
|
|
} |
|
|
|
}, |
|
|
|
// 参数列表 |
|
|
|
quotationDetailColumns:[ |
|
|
|
{label:"productNo",value:"产品编码"}, |
|
|
|
{label:"productDesc",value:"产品名称"}, |
|
|
|
{label:"quotationDetailQuantity",value:"报价数量"}, |
|
|
|
{label:"internalInquiryNo",value:"内部询价单号"}, |
|
|
|
{label:"quotationDetailStatus",value:"报价状态"}, |
|
|
|
{label:"itemNo",value:"序号"}, |
|
|
|
{label:"adjustPartCost",value:"调整后的材料成本"}, |
|
|
|
{label:"adjustMachineCost",value:"调整后的机器成本"}, |
|
|
|
{label:"adjustFabricateCost",value:"调整后的制造费用"}, |
|
|
|
{label:"adjustLabourCost",value:"调整后人的工成本"}, |
|
|
|
{label:"adjustToolCost",value:"调整后的工具成本"}, |
|
|
|
{label:"detailManageCost",value:"管理成本"}, |
|
|
|
{label:"detailOtherCost",value:"其他成本"}, |
|
|
|
{label:"detailProfitRate",value:"利润率"}, |
|
|
|
{label:"finalUntaxedPrice",value:"最终去税价格"}, |
|
|
|
], |
|
|
|
// 工具列表 |
|
|
|
quotationToolColumns:[ |
|
|
|
{label:"toolNo", value:"工具编码",}, |
|
|
|
{label: "toolDescription", value: "工具描述",}, |
|
|
|
{label: "toolQuantity", value: "工具数量",}, |
|
|
|
{label: "unitCost", value: "单位成本",}, |
|
|
|
{label: "expectedServiceLife", value: "预计使用寿命",}, |
|
|
|
{label: "itemNo", value: "序号",} |
|
|
|
], |
|
|
|
} |
|
|
|
}, |
|
|
|
computed:{ |
|
|
|
@ -651,6 +723,44 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
// 保存 报价明细 |
|
|
|
saveQuotationDetail(){ |
|
|
|
// 校验 |
|
|
|
let flag = true; |
|
|
|
this.$refs['quotationDetailForm'].validate((validate,objects)=>{ |
|
|
|
if (!validate){ |
|
|
|
flag = false; |
|
|
|
this.rulesValidateLabel(objects,this.quotationDetailColumns); |
|
|
|
} |
|
|
|
}); |
|
|
|
if (!flag){ |
|
|
|
return |
|
|
|
} |
|
|
|
// 清空表单校验 |
|
|
|
for (let i = 1; i <= 4; i++) { |
|
|
|
this.$refs['priceForm'+i].validate((validate,objects)=>{ |
|
|
|
if (!validate){ |
|
|
|
flag = false; |
|
|
|
this.rulesValidateLabel(objects,this.quotationDetailColumns); |
|
|
|
} |
|
|
|
}); |
|
|
|
if (!flag){ |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if (flag){ |
|
|
|
// 校验通过 保存数据 |
|
|
|
updateQuotationDetail(this.quotationDetailData).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.quotationDetailFlag = false; |
|
|
|
this.initData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
initData(){ |
|
|
|
let params = { |
|
|
|
no:this.no, |
|
|
|
@ -674,9 +784,20 @@ export default { |
|
|
|
this.no = val; |
|
|
|
this.initData(); |
|
|
|
}, |
|
|
|
// 关闭 |
|
|
|
// 打开详情弹框 |
|
|
|
openQuotationDetailData(){ |
|
|
|
this.initQuotationToolData(); |
|
|
|
this.initQuotationRoutingData(); |
|
|
|
this.initQuotationPart(); |
|
|
|
}, |
|
|
|
// 关闭 详情弹框 |
|
|
|
closeInsertDialog(){ |
|
|
|
this.activeName = "index"; |
|
|
|
// 清空报价工具表格列表 |
|
|
|
this.quotationToolList = []; |
|
|
|
this.quotationDetailData = {}; |
|
|
|
this.quotationDetailData.computeToolCost = undefined; |
|
|
|
// 清空表单校验 |
|
|
|
for (let i = 1; i <= 4; i++) { |
|
|
|
this.$refs['priceForm'+i].resetFields(); |
|
|
|
} |
|
|
|
@ -685,6 +806,176 @@ export default { |
|
|
|
// 关闭 报价工具 新增弹框 |
|
|
|
closeQuotationToolDialog(){ |
|
|
|
this.$refs['quotationToolForm'].resetFields(); |
|
|
|
}, |
|
|
|
// 查询 材料 |
|
|
|
// 查询 工艺 |
|
|
|
// 查询 工具 |
|
|
|
|
|
|
|
// 新增 报价明细 |
|
|
|
insertQuotationDetailBtn(){ |
|
|
|
this.$refs['insertQuotationDetailForm'].validate((validate,objects)=>{ |
|
|
|
if (validate){ |
|
|
|
insertQuotationDetail(this.insertQuotationDetail).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.quotationLeadIntoDetailFlag = false; |
|
|
|
// 保存成功后 |
|
|
|
if (this.insertQuotationDetailData.flag){ |
|
|
|
this.quotationDetailData = data.data; |
|
|
|
this.quotationDetailFlag = true; |
|
|
|
} |
|
|
|
this.initData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}else { |
|
|
|
this.rulesValidateLabel(objects,this.quotationDetailColumns); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 关闭新增报价明细 |
|
|
|
closeInsertQuotationDetail(){ |
|
|
|
this.$refs['insertQuotationDetailForm'].resetFields(); |
|
|
|
this.insertQuotationDetailData.flag = false; |
|
|
|
}, |
|
|
|
// 打开新增报价明细 |
|
|
|
openInsertQuotationDetail(){ |
|
|
|
this.insertQuotationDetail.quotationHeaderId = this.quotation.quotationHeaderId; |
|
|
|
this.insertQuotationDetail.internalInquiryNo = this.quotation.internalInquiryNo; |
|
|
|
}, |
|
|
|
// 修改 报价详情 |
|
|
|
editQuotationDetail(row){ |
|
|
|
this.quotationDetailData = JSON.parse(JSON.stringify(row)); |
|
|
|
this.quotationDetailFlag = true; |
|
|
|
}, |
|
|
|
// 报价材料 查询 |
|
|
|
initQuotationPart(){ |
|
|
|
let total = 0; |
|
|
|
this.quotationDetailData.computePartCost = total; |
|
|
|
this.quotationDetailData.adjustPartCost = total; |
|
|
|
this.inputProfitRate(); |
|
|
|
this.inputOuterCost(); |
|
|
|
}, |
|
|
|
// 报价工艺查询 |
|
|
|
initQuotationRoutingData(){ |
|
|
|
let total = 0; |
|
|
|
this.quotationDetailData.computeMachineCost = total; |
|
|
|
this.quotationDetailData.adjustMachineCost = total; |
|
|
|
this.quotationDetailData.computeFabricateCost = total; |
|
|
|
this.quotationDetailData.adjustFabricateCost = total; |
|
|
|
this.quotationDetailData.computeLabourCost = total; |
|
|
|
this.quotationDetailData.adjustLabourCost = total; |
|
|
|
this.inputProfitRate(); |
|
|
|
this.inputOuterCost(); |
|
|
|
}, |
|
|
|
// 报价工具查询 |
|
|
|
initQuotationToolData(){ |
|
|
|
let params = { |
|
|
|
quotationDetailId:this.quotationDetailData.quotationDetailId, |
|
|
|
} |
|
|
|
searchQuotationTool(params).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.quotationToolList = data.data; |
|
|
|
let total = this.quotationToolList.reduce((total,currentValue)=>{ |
|
|
|
return total + currentValue.toolQuantity*currentValue.unitCost; |
|
|
|
},0); |
|
|
|
this.quotationDetailData.computeToolCost = total; |
|
|
|
this.quotationDetailData.adjustToolCost = total; |
|
|
|
this.inputProfitRate(); |
|
|
|
this.inputOuterCost(); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 新增 工具 i存在值新增 否则 修改 |
|
|
|
insertQuotationTool(){ |
|
|
|
this.$refs['quotationToolForm'].validate((validate,object)=>{ |
|
|
|
if (validate){ |
|
|
|
this.quotationTool.quotationDetailId = this.quotationDetailData.quotationDetailId; |
|
|
|
saveQuotationTool(this.quotationTool).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.saveQuotationToolFlag = false; |
|
|
|
this.initQuotationToolData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}else { |
|
|
|
this.rulesValidateLabel(object,this.quotationToolColumns); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 报价工具删除 |
|
|
|
clickDeleteToolTableBtn(row){ |
|
|
|
deleteQuotationTool(row).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationToolData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 报价工具修改 |
|
|
|
clickEditToolTableBtn(row){ |
|
|
|
this.quotationTool = JSON.parse(JSON.stringify(row)); |
|
|
|
this.saveQuotationToolFlag = true; |
|
|
|
}, |
|
|
|
// 利润率 输入框 修改 |
|
|
|
inputProfitRate(){ |
|
|
|
this.quotationDetailData.detailProfitAmount = 0; |
|
|
|
if (this.quotationDetailData.detailProfitRate){ |
|
|
|
let num = (this.quotationDetailData.detailTotalCost*(this.quotationDetailData.detailProfitRate/100)); |
|
|
|
Math.round(num* 100) / 100. |
|
|
|
num = num.toFixed(2); |
|
|
|
this.quotationDetailData.detailProfitAmount = num; |
|
|
|
} |
|
|
|
// 系统计算总金额 |
|
|
|
this.quotationDetailData.systemComputeAmount += (+this.quotationDetailData.detailTotalCost + +this.quotationDetailData.detailProfitAmount); |
|
|
|
}, |
|
|
|
// 其他成本输入框 修改 |
|
|
|
inputOuterCost(){ |
|
|
|
this.quotationDetailData.detailTotalCost = 0; |
|
|
|
if (this.quotationDetailData.adjustPartCost){ |
|
|
|
this.quotationDetailData.detailTotalCost += +this.quotationDetailData.adjustPartCost; |
|
|
|
} |
|
|
|
if (this.quotationDetailData.adjustLabourCost){ |
|
|
|
this.quotationDetailData.detailTotalCost += +this.quotationDetailData.adjustLabourCost; |
|
|
|
} |
|
|
|
if (this.quotationDetailData.adjustFabricateCost){ |
|
|
|
this.quotationDetailData.detailTotalCost += +this.quotationDetailData.adjustFabricateCost; |
|
|
|
} |
|
|
|
if (this.quotationDetailData.adjustToolCost){ |
|
|
|
this.quotationDetailData.detailTotalCost += +this.quotationDetailData.adjustToolCost; |
|
|
|
} |
|
|
|
if (this.quotationDetailData.adjustMachineCost){ |
|
|
|
this.quotationDetailData.detailTotalCost += +this.quotationDetailData.adjustMachineCost; |
|
|
|
} |
|
|
|
if (this.quotationDetailData.detailManageCost){ |
|
|
|
this.quotationDetailData.detailTotalCost += +this.quotationDetailData.detailManageCost; |
|
|
|
} |
|
|
|
if (this.quotationDetailData.detailOtherCost){ |
|
|
|
this.quotationDetailData.detailTotalCost += +this.quotationDetailData.detailOtherCost; |
|
|
|
} |
|
|
|
// 系统计算总金额 |
|
|
|
this.quotationDetailData.systemComputeAmount += (+this.quotationDetailData.detailTotalCost + +this.quotationDetailData.detailProfitAmount); |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 校验处理 |
|
|
|
* @param objects 校验未通过属性 |
|
|
|
* @param labels 中午字解 |
|
|
|
*/ |
|
|
|
rulesValidateLabel(objects,labels){ |
|
|
|
for (let filed in objects) { |
|
|
|
for (let i = 0; i < labels.length; i++) { |
|
|
|
let quotationToolColumn = labels[i]; |
|
|
|
if (quotationToolColumn.label === filed){ |
|
|
|
this.$message.warning("请填写:"+quotationToolColumn.value); |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
|