|
|
|
@ -2,11 +2,12 @@ |
|
|
|
<div class="mode-config"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-button type="primary" :loading="quotation.quotationHeaderId === undefined">从询价单导入明细</el-button> |
|
|
|
<el-button type="primary" :loading="quotation.quotationHeaderId === undefined" |
|
|
|
@click="quotationLeadIntoDetailFlag = true">新增报价明细 |
|
|
|
@click="quotationLeadIntoDetailFlag = true">新增 |
|
|
|
</el-button> |
|
|
|
<el-button type="primary" :loading="quotation.quotationHeaderId === undefined">从历史报价明细导入</el-button> |
|
|
|
<el-button type="primary" :loading="quotation.quotationHeaderId === undefined">从历史询价导入</el-button> |
|
|
|
|
|
|
|
<el-button type="primary" :loading="quotation.quotationHeaderId === undefined" @click="clickHistoryQuotationDetailBtn">从历史报价导入</el-button> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24" style="margin-top: 10px"> |
|
|
|
<el-table :data="tableData" height="320px" stripe border |
|
|
|
@ -14,10 +15,11 @@ |
|
|
|
<el-table-column |
|
|
|
label="操作" |
|
|
|
fixed |
|
|
|
width="90" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-link>下达</el-link> |
|
|
|
<el-link @click="editQuotationDetail(scope.row)">编辑</el-link> |
|
|
|
width="120" align="center"> |
|
|
|
<template slot-scope="{row,$index}"> |
|
|
|
<el-link style="cursor: pointer">下达</el-link> |
|
|
|
<el-link style="cursor: pointer" @click="editQuotationDetail(row)">编辑</el-link> |
|
|
|
<el-link style="cursor: pointer" @click="deleteQuotationDetailData(row)">删除</el-link> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
@ -155,7 +157,7 @@ |
|
|
|
|
|
|
|
<!--新增报价明细--> |
|
|
|
<el-dialog @open="openInsertQuotationDetail" @close="closeInsertQuotationDetail" |
|
|
|
:visible.sync="quotationLeadIntoDetailFlag" title="新增报价明细" width="30%"> |
|
|
|
:visible.sync="quotationLeadIntoDetailFlag" title="新增报价明细" width="30%" :close-on-click-modal="false"> |
|
|
|
<el-form :model="insertQuotationDetail" ref="insertQuotationDetailForm" :rules="quotationDetailRules" |
|
|
|
label-width="80px" label-position="top" :inline="true"> |
|
|
|
<el-row> |
|
|
|
@ -198,13 +200,13 @@ |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer" style="margin-top: 20px"> |
|
|
|
<el-button @click="quotationLeadIntoDetailFlag = false">关 闭</el-button> |
|
|
|
<el-button type="primary" @click="insertQuotationDetailBtn">保 存</el-button> |
|
|
|
<el-button type="primary" :loading="quotationLeadIntoDetailBtn" @click="insertQuotationDetailBtn">保 存</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!--新增--> |
|
|
|
<el-dialog @open="openQuotationDetailData" @close="closeInsertDialog" :visible.sync="quotationDetailFlag" |
|
|
|
width="60%" top="10vh"> |
|
|
|
width="60%" top="10vh" :close-on-click-modal="false"> |
|
|
|
<el-form :rules="quotationDetailRules" style="margin-top: 5px" ref="quotationDetailForm" |
|
|
|
:model="quotationDetailData" label-width="80px" label-position="top" :inline="true"> |
|
|
|
<el-row> |
|
|
|
@ -265,14 +267,14 @@ |
|
|
|
<el-table-column label="材料名称" align="center" show-overflow-tooltip prop="quotationPartDesc"> |
|
|
|
<template slot-scope="{row,$index}"> |
|
|
|
<el-form-item :prop="'quotationPartList.'+$index+'.quotationPartDesc'" :rules="quotationPartRules.quotationPartDesc"> |
|
|
|
<el-input :ref="'quotationPartDesc_'+$index" @keyup.native.enter="enterKeyUpFun('quotationPartDesc_'+($index+1))" v-model="row.quotationPartDesc" clearable/> |
|
|
|
<el-input :disabled="row.quotationPartNo.trim() !='*'" :ref="'quotationPartDesc_'+$index" @keyup.native.enter="enterKeyUpFun('quotationPartDesc_'+($index+1))" v-model="row.quotationPartDesc" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="计量单位" align="center" show-overflow-tooltip prop="umId"> |
|
|
|
<template slot-scope="{row,$index}"> |
|
|
|
<el-form-item :prop="'quotationPartList.'+$index+'.umId'" :rules="quotationPartRules.umId"> |
|
|
|
<el-select v-model="row.umId" :disabled="quotationPart.quotationPartNo === '*'" style="width: 100%" placeholder="请选择"> |
|
|
|
<el-select v-model="row.umId" :disabled="row.quotationPartNo != '*'" style="width: 100%" placeholder="请选择"> |
|
|
|
<el-option |
|
|
|
v-for="item in umInformationList" |
|
|
|
:key="item.umId" |
|
|
|
@ -346,7 +348,7 @@ |
|
|
|
<el-table-column align="center" width="120" label="工序名称" prop="quotationRoutingDesc" show-overflow-tooltip> |
|
|
|
<template slot-scope="{row,$index}"> |
|
|
|
<el-form-item :prop="'quotationRoutingList.'+$index+'.quotationRoutingDesc'" :rules="quotationRoutingRules.quotationRoutingDesc"> |
|
|
|
<el-input :disabled="row.quotationRoutingNo.trim() !=='*'" :ref="'quotationRoutingDesc_'+$index" @keyup.native.enter="enterKeyUpFun('quotationRoutingDesc_'+($index+1))" v-model="row.quotationRoutingDesc" clearable/> |
|
|
|
<el-input :disabled="row.quotationRoutingNo.trim() !='*'" :ref="'quotationRoutingDesc_'+$index" @keyup.native.enter="enterKeyUpFun('quotationRoutingDesc_'+($index+1))" v-model="row.quotationRoutingDesc" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
@ -403,7 +405,7 @@ |
|
|
|
</el-form-item> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="效率" align="center" width="120" prop="routingEfficiency" show-overflow-tooltip> |
|
|
|
<el-table-column label="效率%" align="center" width="120" prop="routingEfficiency" show-overflow-tooltip> |
|
|
|
<template slot-scope="{row,$index}"> |
|
|
|
<el-form-item :prop="'quotationRoutingList.'+$index+'.routingEfficiency'" :rules="quotationRoutingRules.routingEfficiency"> |
|
|
|
<el-input :ref="'routingEfficiency_'+$index" @keyup.native.enter="enterKeyUpFun('routingEfficiency_'+($index+1))" v-model="row.routingEfficiency" clearable/> |
|
|
|
@ -668,13 +670,13 @@ |
|
|
|
</el-tabs> |
|
|
|
<span slot="footer" class="dialog-footer" style="margin-top: 0px"> |
|
|
|
<el-button @click=" quotationDetailFlag= false">取 消</el-button> |
|
|
|
<el-button type="primary" @click="saveQuotationDetail">确 定</el-button> |
|
|
|
<el-button type="primary" :loading="updateQuotationDetailBtnFlag" @click="saveQuotationDetail">确 定</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!--quotationTool新增--> |
|
|
|
<el-dialog @close="closeQuotationToolDialog" title="报价工具" :visible.sync="saveQuotationToolFlag" width="40%" |
|
|
|
top="10vh"> |
|
|
|
top="10vh" :close-on-click-modal="false"> |
|
|
|
<el-form :rules="quotationToolRules" ref="quotationToolForm" :model="quotationTool" label-position="top" |
|
|
|
style="height: 260px"> |
|
|
|
<el-row> |
|
|
|
@ -699,13 +701,14 @@ |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer" style="margin-top: 5px"> |
|
|
|
<el-button @click=" saveQuotationToolFlag= false">取 消</el-button> |
|
|
|
<el-button type="primary" @click="saveQuotationTool">确 定</el-button> |
|
|
|
<el-button type="primary" :loading="saveQuotationToolBtn" @click="saveQuotationTool">确 定</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!--tool列表--> |
|
|
|
<el-dialog @open="openToolHeaderDialog" |
|
|
|
@close="closeToolHeaderDialog" |
|
|
|
:close-on-click-modal="false" |
|
|
|
title="工具信息" width="40%" top="15vh" |
|
|
|
:visible.sync="toolHeaderDialogFlag"> |
|
|
|
<!--搜索条件--> |
|
|
|
@ -746,7 +749,7 @@ |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!--quotationRouting新增--> |
|
|
|
<el-dialog @close="closeQuotationRoutingDialog" title="报价工艺" :visible.sync="quotationRoutingDialogFlag" width="40%" top="15vh"> |
|
|
|
<el-dialog @close="closeQuotationRoutingDialog" title="报价工艺" :visible.sync="quotationRoutingDialogFlag" width="40%" top="15vh" :close-on-click-modal="false"> |
|
|
|
<el-form :rules="quotationRoutingRules" ref="quotationRoutingForm" :model="quotationRouting" label-position="top"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="6"> |
|
|
|
@ -813,7 +816,9 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="6" > |
|
|
|
<el-form-item label="效率" prop="routingEfficiency"> |
|
|
|
<el-input v-model="quotationRouting.routingEfficiency"></el-input> |
|
|
|
<el-input v-model="quotationRouting.routingEfficiency"> |
|
|
|
<template slot="append">%</template> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6" :offset="2"> |
|
|
|
@ -848,7 +853,7 @@ |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer" style="margin-top: 5px"> |
|
|
|
<el-button @click="quotationRoutingDialogFlag= false">取 消</el-button> |
|
|
|
<el-button type="primary" @click="saveQuotationRoutingBtn">确 定</el-button> |
|
|
|
<el-button type="primary" :loading="quotationRoutingDialogBtn" @click="saveQuotationRoutingBtn">确 定</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
@ -857,12 +862,13 @@ |
|
|
|
title="报价材料" |
|
|
|
:visible.sync="quotationPartDialogFlag" |
|
|
|
@close="closeQuotationPartDialog" |
|
|
|
:close-on-click-modal="false" |
|
|
|
width="30%"> |
|
|
|
<el-form :model="quotationPart" :rules="quotationPartRules" ref="quotationPartForm" label-position="top"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="10"> |
|
|
|
<el-form-item label="材料编号" prop="quotationPartNo"> |
|
|
|
<span slot="label" @click="partDialogFlag = true" style="cursor: pointer"><a>工具编码</a></span> |
|
|
|
<span slot="label" @click="partDialogFlag = true" style="cursor: pointer"><a>材料编码</a></span> |
|
|
|
<el-input v-model="quotationPart.quotationPartNo" :disabled="quotationPart.quotationPartDesc" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
@ -918,23 +924,23 @@ |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="quotationPartDialogFlag = false">取 消</el-button> |
|
|
|
<el-button type="primary" @click="saveQuotationPartBtn">确 定</el-button> |
|
|
|
<el-button type="primary" :loading="quotationPartDialogBtn" @click="saveQuotationPartBtn">确 定</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!--材料弹框--> |
|
|
|
<el-dialog title="材料列表" @open="openPartDialog" |
|
|
|
<el-dialog title="材料列表" @open="openPartDialog" :close-on-click-modal="false" |
|
|
|
:visible.sync="partDialogFlag"> |
|
|
|
<!--搜索条件--> |
|
|
|
<el-form :model="partData" ref="partDataForm" label-position="top"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="工具编号" prop="toolNo"> |
|
|
|
<el-form-item label="材料编号" prop="toolNo"> |
|
|
|
<el-input v-model="partData.partNo" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" :offset="1"> |
|
|
|
<el-form-item label="工具描述" prop="toolDescription"> |
|
|
|
<el-form-item label="材料描述" prop="toolDescription"> |
|
|
|
<el-input v-model="partData.partDesc" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
@ -981,7 +987,8 @@ |
|
|
|
<!-- 其他报价单弹框 --> |
|
|
|
<el-dialog title="报价明细列表" |
|
|
|
@close="closeOtherQuotationDetail" |
|
|
|
:visible.sync="otherQuotationDetailDialogFlag"> |
|
|
|
:close-on-click-modal="false" |
|
|
|
:visible.sync="otherQuotationDetailDialogFlag"> |
|
|
|
<!--搜索条件--> |
|
|
|
<el-form :model="otherDetail" ref="otherDetailForm" label-position="top"> |
|
|
|
<el-row> |
|
|
|
@ -1016,7 +1023,7 @@ |
|
|
|
</el-table> |
|
|
|
<span slot="footer" class="dialog-footer" style="margin-top: 5px"> |
|
|
|
<el-button @click="otherQuotationDetailDialogFlag= false">取 消</el-button> |
|
|
|
<el-button type="primary" @click="saveOtherQuotationDetailBtn">确 定</el-button> |
|
|
|
<el-button type="primary" :loading="otherQuotationDetailBtn" @click="saveOtherQuotationDetailBtn">确 定</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
@ -1030,11 +1037,12 @@ import { |
|
|
|
batchDeleteQuotationTool, |
|
|
|
searchQuotationDetailPageByHeaderId, |
|
|
|
insertQuotationDetail, |
|
|
|
batchInsertQuotationDetail, |
|
|
|
updateQuotationDetail, |
|
|
|
deleteQuotationDetail, |
|
|
|
searchQuotationRoutingByDetailId, |
|
|
|
insertQuotationRouting, |
|
|
|
batchInsertQuotationRouting, |
|
|
|
updateQuotationRouting, |
|
|
|
deleteQuotationRouting, |
|
|
|
batchDeleteQuotationRouting, |
|
|
|
searchQuotationPart, |
|
|
|
@ -1098,6 +1106,14 @@ export default { |
|
|
|
partDialogFlag:false,// 材料信息弹框 |
|
|
|
otherQuotationDetailDialogFlag:false,// 其他报价明细 |
|
|
|
options:0,// 从其他报价明细 复制选项 |
|
|
|
|
|
|
|
// ===============================================按钮状态========================================== |
|
|
|
updateQuotationDetailBtnFlag:false, |
|
|
|
otherQuotationDetailBtn:false, |
|
|
|
quotationLeadIntoDetailBtn:false, |
|
|
|
saveQuotationToolBtn:false, |
|
|
|
quotationRoutingDialogBtn:false, |
|
|
|
quotationPartDialogBtn:true, |
|
|
|
// =============================================新增报价明细的开关========================================== |
|
|
|
//新增 报价详情数据 |
|
|
|
insertQuotationDetailData: { |
|
|
|
@ -1335,24 +1351,24 @@ export default { |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur'}, |
|
|
|
], |
|
|
|
operatorsNumber: [ |
|
|
|
{required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'change'}, |
|
|
|
{required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, 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'}, |
|
|
|
], |
|
|
|
unitMachineryCost: [ |
|
|
|
{required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'change'}, |
|
|
|
{required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, 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'}, |
|
|
|
], |
|
|
|
unitLaborCost: [ |
|
|
|
{required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'change'}, |
|
|
|
{required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, 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'}, |
|
|
|
], |
|
|
|
unitManufacturingCost: [ |
|
|
|
{required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'change'}, |
|
|
|
{required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, 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'}, |
|
|
|
], |
|
|
|
unitQuotedCost: [ |
|
|
|
{required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'change'}, |
|
|
|
{required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, 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'}, |
|
|
|
], |
|
|
|
}, |
|
|
|
//报价材料 |
|
|
|
@ -1502,12 +1518,14 @@ export default { |
|
|
|
insertQuotationDetailBtn() { |
|
|
|
this.$refs['insertQuotationDetailForm'].validate((validate, objects) => { |
|
|
|
if (validate) { |
|
|
|
this.quotationLeadIntoDetailBtn = true; |
|
|
|
insertQuotationDetail(this.insertQuotationDetail).then(({data}) => { |
|
|
|
if (data.code == 200) { |
|
|
|
this.quotationLeadIntoDetailFlag = false; |
|
|
|
// 保存成功后 |
|
|
|
if (this.insertQuotationDetailData.flag) { |
|
|
|
this.quotationDetailData = data.data; |
|
|
|
this.quotationLeadIntoDetailBtn = false; |
|
|
|
this.quotationDetailFlag = true; |
|
|
|
} |
|
|
|
this.initData(); |
|
|
|
@ -1525,6 +1543,7 @@ export default { |
|
|
|
saveQuotationTool() { |
|
|
|
this.$refs['quotationToolForm'].validate((validate, object) => { |
|
|
|
if (validate) { |
|
|
|
this.saveQuotationToolBtn= true; |
|
|
|
if (this.selectionToolHeaderList.length > 0){ |
|
|
|
// 批量修改的数据 |
|
|
|
let batchUpdateList = this.quotationToolFormTable.quotationToolList.filter((v) => this.selectionToolHeaderList.some((val) => val.toolNo == v.toolNo)); |
|
|
|
@ -1557,6 +1576,7 @@ export default { |
|
|
|
if (data.code == 200) { |
|
|
|
this.initQuotationToolData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
this.saveQuotationToolBtn = false; |
|
|
|
this.saveQuotationToolFlag = false;// 关闭弹框 |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
@ -1568,6 +1588,9 @@ export default { |
|
|
|
batchInsertQuotationTool(batchInsertQuotationToolList).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationToolData(); |
|
|
|
this.otherQuotationDetailBtn = false; |
|
|
|
this.saveQuotationToolBtn = false; |
|
|
|
this.otherQuotationDetailDialogFlag = false; |
|
|
|
this.saveQuotationToolFlag = false; |
|
|
|
} |
|
|
|
this.$message.success(data.msg); |
|
|
|
@ -1576,73 +1599,127 @@ export default { |
|
|
|
// =======================================================删除=========================================== |
|
|
|
// 报价工具删除 |
|
|
|
clickDeleteToolTableBtn(row,i) { |
|
|
|
deleteQuotationTool(row).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationToolData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
deleteQuotationTool(row).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationToolData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 报价工具 批量删除 |
|
|
|
deleteSelectionQuotationTool(){ |
|
|
|
batchDeleteQuotationTool(this.selectionQuotationToolList).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationToolData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
batchDeleteQuotationTool(this.selectionQuotationToolList).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationToolData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 报价工艺删除 |
|
|
|
deleteQuotationRoutingBtn(row,index){ |
|
|
|
deleteQuotationRouting(row).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationRoutingData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
deleteQuotationRouting(row).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationRoutingData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 报价工艺批量删除 |
|
|
|
deleteSelectionQuotationRoutingBtn(){ |
|
|
|
batchDeleteQuotationRouting(this.selectionQuotationRoutingList).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationRoutingData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
batchDeleteQuotationRouting(this.selectionQuotationRoutingList).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationRoutingData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 报价材料删除 |
|
|
|
deleteQuotationPart(row,index){ |
|
|
|
deleteQuotationPart(row).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationPart(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
deleteQuotationPart(row).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationPart(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 报价材料批量删除 |
|
|
|
deleteSelectionQuotationPart(){ |
|
|
|
batchDeleteQuotationPart(this.selectionQuotationPartList).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationPart(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
batchDeleteQuotationPart(this.selectionQuotationPartList).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationPart(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 删除 报价明细 |
|
|
|
deleteQuotationDetailData(row){ |
|
|
|
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
deleteQuotationDetail(row).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// =================================================保存=================================================== |
|
|
|
// 保存 报价明细 |
|
|
|
saveQuotationDetail() { |
|
|
|
this.updateQuotationDetailBtnFlag=true; |
|
|
|
// 校验 |
|
|
|
let flag = true; |
|
|
|
// 校验报价详情表单 |
|
|
|
@ -1694,9 +1771,11 @@ export default { |
|
|
|
params.quotationToolList = this.quotationToolFormTable.quotationToolList; |
|
|
|
params.quotationPartList = this.quotationPartFormTable.quotationPartList; |
|
|
|
params.quotationRoutingList = this.quotationRoutingFormTable.quotationRoutingList; |
|
|
|
|
|
|
|
updateQuotationDetail(this.quotationDetailData).then(({data}) => { |
|
|
|
if (data.code == 200) { |
|
|
|
this.quotationDetailFlag = false; |
|
|
|
this.updateQuotationDetailBtnFlag = false; |
|
|
|
this.initData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
} else { |
|
|
|
@ -1760,10 +1839,12 @@ export default { |
|
|
|
}, |
|
|
|
// 新增报价工艺 |
|
|
|
insertQuotationRoutingData(){ |
|
|
|
this.quotationRoutingDialogBtn = true; |
|
|
|
insertQuotationRouting(this.quotationRouting).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationRoutingData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
this.quotationRoutingDialogBtn = false; |
|
|
|
this.quotationRoutingDialogFlag = false; |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
@ -1776,6 +1857,8 @@ export default { |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationRoutingData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
this.otherQuotationDetailBtn = false; |
|
|
|
this.otherQuotationDetailDialogFlag = false; |
|
|
|
this.quotationRoutingDialogFlag = false; |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
@ -1789,6 +1872,7 @@ export default { |
|
|
|
this.rulesValidateLabel(objects,this.quotationPartColumns); |
|
|
|
}else { |
|
|
|
// 新增逻辑 |
|
|
|
this.quotationPartDialogBtn = true; |
|
|
|
if (this.selectionPartList.length > 0){ |
|
|
|
let quotationPartList = this.selectionPartList.map(item=>{ |
|
|
|
let data = this.quotationPartFormTable.quotationPartList.find(val => val.partNo == item.partNo); |
|
|
|
@ -1817,6 +1901,9 @@ export default { |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationPart(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
this.otherQuotationDetailBtn = false; |
|
|
|
this.quotationPartDialogBtn = false; |
|
|
|
this.otherQuotationDetailDialogFlag = false; |
|
|
|
this.quotationPartDialogFlag = false; |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
@ -1829,6 +1916,7 @@ export default { |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationPart(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
this.quotationPartDialogBtn = false; |
|
|
|
this.quotationPartDialogFlag = false; |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
@ -1840,6 +1928,7 @@ export default { |
|
|
|
let otherSelectionPart = [];// 选中的 材料 |
|
|
|
let otherSelectionRouting = [];// 选中的 工艺 |
|
|
|
let otherSelectionTool = [];// 选中的 工具 |
|
|
|
this.otherQuotationDetailBtn = true; |
|
|
|
// 遍历选中的其他报价信息 |
|
|
|
for (let i = 0; i < this.selectionOtherDetailList.length; i++) { |
|
|
|
if (this.selectionOtherDetailList[i].quotationPartList){ |
|
|
|
@ -1853,6 +1942,16 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
switch (this.options){ |
|
|
|
case 0: |
|
|
|
this.selectionOtherDetailList = this.selectionOtherDetailList.map(value => { |
|
|
|
value.quotationHeaderId = this.quotation.quotationHeaderId; |
|
|
|
value.quotationDetailId = undefined; |
|
|
|
value.internalInquiryNo = this.quotation.internalInquiryNo; |
|
|
|
value.quotationRoutingList = []; |
|
|
|
return value; |
|
|
|
}) |
|
|
|
this.batchInsertQuotationDetailData(this.selectionOtherDetailList); |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
otherSelectionPart = otherSelectionPart.map(item=>{ |
|
|
|
item.quotationDetailId = this.quotationDetailData.quotationDetailId; |
|
|
|
@ -1878,7 +1977,20 @@ export default { |
|
|
|
this.batchInsertQuotationToolData(otherSelectionTool); |
|
|
|
break; |
|
|
|
} |
|
|
|
this.otherQuotationDetailDialogFlag = false; |
|
|
|
|
|
|
|
}, |
|
|
|
// 批量新增报价明细信息 |
|
|
|
batchInsertQuotationDetailData(quotationDetailList){ |
|
|
|
batchInsertQuotationDetail(quotationDetailList).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initData(); |
|
|
|
this.otherQuotationDetailBtn= false; |
|
|
|
this.otherQuotationDetailDialogFlag = false; |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// =====================================================表格修改============================================ |
|
|
|
// 修改 报价详情 |
|
|
|
@ -2026,6 +2138,7 @@ export default { |
|
|
|
quotationNo:this.otherDetail.quotationNo, |
|
|
|
productNo:this.otherDetail.productNo, |
|
|
|
productDesc:this.otherDetail.productDesc, |
|
|
|
quotationHeaderId:this.quotation.quotationHeaderId, |
|
|
|
}; |
|
|
|
searchQuotationDetail(params).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
@ -2099,6 +2212,11 @@ export default { |
|
|
|
this.otherQuotationDetailDialogFlag = true; |
|
|
|
this.options = i; |
|
|
|
}, |
|
|
|
// 点击历史报价明细 |
|
|
|
clickHistoryQuotationDetailBtn(){ |
|
|
|
this.initOtherQuotationDetail(); |
|
|
|
this.otherQuotationDetailDialogFlag = true; |
|
|
|
}, |
|
|
|
// =======================================================关闭dialog事件============================================= |
|
|
|
// 关闭 详情弹框 |
|
|
|
closeInsertDialog() { |
|
|
|
@ -2155,7 +2273,12 @@ export default { |
|
|
|
// 关闭其他报价明细弹框 |
|
|
|
closeOtherQuotationDetail(){ |
|
|
|
this.options = 0; |
|
|
|
this.$refs.otherDetailForm.resetFields(); |
|
|
|
this.otherDetail = { |
|
|
|
quotationNo:undefined,// 报价单号 |
|
|
|
productNo:undefined,// 产品编码 |
|
|
|
productDesc:undefined,// 产品名称 |
|
|
|
}; |
|
|
|
this.$refs['otherDetailForm'].resetFields(); |
|
|
|
this.$refs.otherQuotationDetailTable.clearSelection(); |
|
|
|
}, |
|
|
|
// ===================================================表格多选发生改变事件============================================ |
|
|
|
@ -2189,7 +2312,7 @@ export default { |
|
|
|
this.$refs[refName].toggleRowSelection(row); |
|
|
|
}, |
|
|
|
// =============================================输入框输入事件======================================================= |
|
|
|
// 利润率 输入框 修改 |
|
|
|
// 利润率 输入框 修改 计算利润额 |
|
|
|
inputProfitRate() { |
|
|
|
this.quotationDetailData.detailProfitAmount = 0; |
|
|
|
if (this.quotationDetailData.detailProfitRate) { |
|
|
|
@ -2221,9 +2344,10 @@ export default { |
|
|
|
num = num.toFixed(4); |
|
|
|
this.quotationDetailData.finalTaxedPrice = num; |
|
|
|
}, |
|
|
|
// 其他成本输入框 修改 |
|
|
|
// 其他成本输入框 修改 计算总成本 |
|
|
|
inputOuterCost() { |
|
|
|
this.quotationDetailData.detailTotalCost = 0; |
|
|
|
// 调整的价格 |
|
|
|
if (this.quotationDetailData.adjustPartCost) { |
|
|
|
this.quotationDetailData.detailTotalCost += +this.quotationDetailData.adjustPartCost; |
|
|
|
} |
|
|
|
@ -2239,12 +2363,15 @@ export default { |
|
|
|
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.finalPrice(); |
|
|
|
}, |
|
|
|
// 计算 报价工具总成本 |
|
|
|
@ -2253,7 +2380,9 @@ export default { |
|
|
|
return total + currentValue.toolQuantity * currentValue.unitCost; |
|
|
|
}, 0); |
|
|
|
this.quotationDetailData.computeToolCost = total; |
|
|
|
this.quotationDetailData.adjustToolCost = total; |
|
|
|
if (this.quotationDetailData.adjustToolCost == 0){ |
|
|
|
this.quotationDetailData.adjustToolCost = total; |
|
|
|
} |
|
|
|
this.inputProfitRate(); |
|
|
|
this.inputOuterCost(); |
|
|
|
}, |
|
|
|
|