|
|
|
@ -242,7 +242,7 @@ |
|
|
|
<el-tabs v-model="activeName" style="height: 480px" border stripe> |
|
|
|
<el-tab-pane name="index" label="材料"> |
|
|
|
<el-button type="primary" @click="quotationPartDialogFlag = true">新 增</el-button> |
|
|
|
<el-button type="primary">从其他报价单复制</el-button> |
|
|
|
<el-button type="primary" @click="clickOtherQuotationDetailsBtn(1)">从其他报价单复制</el-button> |
|
|
|
<el-button type="primary" @click="deleteSelectionQuotationPart">批 量 删 除</el-button> |
|
|
|
<el-form :model="quotationPartFormTable" :rules="quotationPartRules" ref="quotationPartTableForm"> |
|
|
|
<el-table style="margin-top: 5px" v-loading="partTableFlag" |
|
|
|
@ -257,7 +257,7 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" width="120" align="center"> |
|
|
|
<template slot-scope="{row,$index}"> |
|
|
|
<el-link style="cursor: pointer" @click="deleteQuotationPart($index)">删除</el-link> |
|
|
|
<el-link style="cursor: pointer" @click="deleteQuotationPart(row,$index)">删除</el-link> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column type="index" width="50" align="center" label="序号"/> |
|
|
|
@ -327,7 +327,7 @@ |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="工艺"> |
|
|
|
<el-button type="primary" @click="quotationRoutingDialogFlag = true">新 增</el-button> |
|
|
|
<el-button type="primary">从其他报价单复制</el-button> |
|
|
|
<el-button type="primary" @click="clickOtherQuotationDetailsBtn(2)">从其他报价单复制</el-button> |
|
|
|
<el-button type="primary" @click="deleteSelectionQuotationRoutingBtn">批 量 删 除</el-button> |
|
|
|
<el-form ref="quotationRoutingTableForm" :model="quotationRoutingFormTable" :rules="quotationRoutingRules"> |
|
|
|
<el-table style="margin-top: 5px" :data="quotationRoutingFormTable.quotationRoutingList" height="400" @selection-change="handleSelectionChangeQuotationRoutingTable"> |
|
|
|
@ -338,7 +338,7 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" width="80" align="center"> |
|
|
|
<template slot-scope="{row,$index}"> |
|
|
|
<el-link style="cursor: pointer" @click="deleteQuotationRoutingBtn($index)">删除</el-link> |
|
|
|
<el-link style="cursor: pointer" @click="deleteQuotationRoutingBtn(row,$index)">删除</el-link> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column width="50" align="center" label="序号" type="index" show-overflow-tooltip/> |
|
|
|
@ -457,7 +457,7 @@ |
|
|
|
<!--======================工具========================--> |
|
|
|
<el-tab-pane label="工具"> |
|
|
|
<el-button type="primary" @click="saveQuotationToolFlag = true">新 增</el-button> |
|
|
|
<el-button type="primary">从其他报价单复制</el-button> |
|
|
|
<el-button type="primary" @click="clickOtherQuotationDetailsBtn(3)">从其他报价单复制</el-button> |
|
|
|
<el-button type="primary" @click="deleteSelectionQuotationTool">批 量 删 除</el-button> |
|
|
|
|
|
|
|
<!--将表格嵌套置form表单中--> |
|
|
|
@ -730,7 +730,8 @@ |
|
|
|
</el-form> |
|
|
|
<!--筛选的数据--> |
|
|
|
<el-table :data="computedToolHeaderTable" ref="toolHeaderTable" :style="{marginTop:'10px'}" |
|
|
|
height="300px" stripe border @selection-change="handleSelectionChangeToolHeaderTable"> |
|
|
|
height="300px" stripe border @selection-change="handleSelectionChangeToolHeaderTable" |
|
|
|
@row-click="(row)=>toggleRowSelectionTable(row,'toolHeaderTable')"> |
|
|
|
<el-table-column |
|
|
|
type="selection" |
|
|
|
width="55" align="center"> |
|
|
|
@ -945,8 +946,9 @@ |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<!--筛选的数据--> |
|
|
|
<el-table :data="computedPartTable" ref="toolHeaderTable" :style="{marginTop:'10px'}" |
|
|
|
height="300px" stripe border width="30%" @selection-change="handleSelectionChangePartTable"> |
|
|
|
<el-table :data="computedPartTable" ref="partDataTable" :style="{marginTop:'10px'}" |
|
|
|
height="300px" stripe border width="30%" @selection-change="handleSelectionChangePartTable" |
|
|
|
@row-click="(row)=>toggleRowSelectionTable(row,'partDataTable')"> |
|
|
|
<el-table-column |
|
|
|
type="selection" |
|
|
|
width="55" align="center"> |
|
|
|
@ -975,21 +977,72 @@ |
|
|
|
<el-button type="primary" @click="savePartBtn">确 定</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 其他报价单弹框 --> |
|
|
|
<el-dialog title="报价明细列表" |
|
|
|
@close="closeOtherQuotationDetail" |
|
|
|
:visible.sync="otherQuotationDetailDialogFlag"> |
|
|
|
<!--搜索条件--> |
|
|
|
<el-form :model="otherDetail" ref="otherDetailForm" label-position="top"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="报价单号"> |
|
|
|
<el-input v-model="otherDetail.quotationNo" @change="initOtherQuotationDetail" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" :offset="1"> |
|
|
|
<el-form-item label="产品编码"> |
|
|
|
<el-input v-model="otherDetail.productNo" @change="initOtherQuotationDetail" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" :offset="1"> |
|
|
|
<el-form-item label="产品名称"> |
|
|
|
<el-input v-model="otherDetail.productDesc" @change="initOtherQuotationDetail" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<!--筛选的数据--> |
|
|
|
<el-table :data="otherQuotationDetailList" ref="otherQuotationDetailTable" :style="{marginTop:'10px'}" |
|
|
|
height="300px" stripe border width="30%" @selection-change="handleSelectionChangeOtherDetail" |
|
|
|
@row-click="(row)=>toggleRowSelectionTable(row,'otherQuotationDetailTable')"> |
|
|
|
<el-table-column |
|
|
|
type="selection" |
|
|
|
width="55" align="center"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="报价单号" prop="quotationNo"/> |
|
|
|
<el-table-column label="产品编码" prop="productNo"/> |
|
|
|
<el-table-column label="产品名称" prop="productDesc"/> |
|
|
|
</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> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import { |
|
|
|
saveQuotationTool, |
|
|
|
batchInsertQuotationTool, |
|
|
|
searchQuotationTool, |
|
|
|
deleteQuotationTool, |
|
|
|
batchDeleteQuotationTool, |
|
|
|
searchQuotationDetailPageByHeaderId, |
|
|
|
insertQuotationDetail, |
|
|
|
updateQuotationDetail, |
|
|
|
searchQuotationRoutingByDetailId, |
|
|
|
insertQuotationRouting, |
|
|
|
batchInsertQuotationRouting, |
|
|
|
updateQuotationRouting, |
|
|
|
deleteQuotationRouting, |
|
|
|
batchDeleteQuotationRouting, |
|
|
|
searchQuotationPart, |
|
|
|
insertQuotationPart, |
|
|
|
batchInsertQuotationPart, |
|
|
|
deleteQuotationPart, |
|
|
|
batchDeleteQuotationPart, |
|
|
|
searchQuotationDetail, |
|
|
|
} from '@/api/quotation/quotationHeader.js'; |
|
|
|
import { |
|
|
|
searchUmInformationList, // 单位信息列表查询 |
|
|
|
@ -1029,6 +1082,8 @@ export default { |
|
|
|
}, |
|
|
|
selectionQuotationPartList:[],//选中的报价材料集合 |
|
|
|
selectionPartList:[],//选中的材料集合 |
|
|
|
otherQuotationDetailList:[],//其他报价集合 |
|
|
|
selectionOtherDetailList:[],//选中的其他报价集合 |
|
|
|
// ===================================================分页参数====================================== |
|
|
|
no: 1,//当前页 |
|
|
|
size: 20,//每页条数 |
|
|
|
@ -1041,6 +1096,8 @@ export default { |
|
|
|
quotationRoutingDialogFlag: false,// 工艺新增弹框 |
|
|
|
quotationPartDialogFlag:false,// 报价材料新增弹框 |
|
|
|
partDialogFlag:false,// 材料信息弹框 |
|
|
|
otherQuotationDetailDialogFlag:false,// 其他报价明细 |
|
|
|
options:0,// 从其他报价明细 复制选项 |
|
|
|
// =============================================新增报价明细的开关========================================== |
|
|
|
//新增 报价详情数据 |
|
|
|
insertQuotationDetailData: { |
|
|
|
@ -1156,6 +1213,12 @@ export default { |
|
|
|
partNo:undefined,// 编号 |
|
|
|
partDesc:undefined, |
|
|
|
}, |
|
|
|
// 其他报价明细搜索条件 |
|
|
|
otherDetail:{ |
|
|
|
quotationNo:undefined,// 报价单号 |
|
|
|
productNo:undefined,// 产品编码 |
|
|
|
productDesc:undefined,// 产品名称 |
|
|
|
}, |
|
|
|
// ================================================表单校验规则====================================== |
|
|
|
// 报价详情表单校验 |
|
|
|
quotationDetailRules: { |
|
|
|
@ -1463,14 +1526,16 @@ export default { |
|
|
|
this.$refs['quotationToolForm'].validate((validate, object) => { |
|
|
|
if (validate) { |
|
|
|
if (this.selectionToolHeaderList.length > 0){ |
|
|
|
for (let i = 0; i < this.selectionToolHeaderList.length; i++) { |
|
|
|
let data = this.quotationToolFormTable.quotationToolList.find(item => item.toolNo == this.selectionToolHeaderList[i].toolNo); |
|
|
|
if (data){ |
|
|
|
data.toolQuantity = +data.toolQuantity + this.selectionToolHeaderList[i].toolQuantity; |
|
|
|
}else { |
|
|
|
this.quotationToolFormTable.quotationToolList.push(JSON.parse(JSON.stringify(this.selectionToolHeaderList[i])));//添加集合 |
|
|
|
} |
|
|
|
} |
|
|
|
// 批量修改的数据 |
|
|
|
let batchUpdateList = this.quotationToolFormTable.quotationToolList.filter((v) => this.selectionToolHeaderList.some((val) => val.toolNo == v.toolNo)); |
|
|
|
batchUpdateList.map(item => { |
|
|
|
item.toolQuantity = +item.toolQuantity + 1; |
|
|
|
return item; |
|
|
|
}); |
|
|
|
// 批量新增的数据 |
|
|
|
let batchInsertList = this.selectionToolHeaderList.filter((v) => this.quotationToolFormTable.quotationToolList.every((val) => val.toolNo != v.toolNo)); |
|
|
|
let batchInsertQuotationToolList = batchUpdateList.concat(batchInsertList); |
|
|
|
this.batchInsertQuotationToolData(batchInsertQuotationToolList); |
|
|
|
}else { |
|
|
|
this.quotationTool.quotationDetailId = this.quotationDetailData.quotationDetailId; |
|
|
|
// 添加到集合 |
|
|
|
@ -1479,60 +1544,101 @@ export default { |
|
|
|
this.quotationTool.unitCost = 0; |
|
|
|
this.quotationTool.expectedServiceLife = 0; |
|
|
|
} |
|
|
|
this.quotationToolFormTable.quotationToolList.push(JSON.parse(JSON.stringify(this.quotationTool)));//添加集合 |
|
|
|
this.insertQuotationToolData(); |
|
|
|
} |
|
|
|
this.$message.success("新增成功!");//弹出消息 |
|
|
|
this.computeQuotationToolCost();//计算价格 |
|
|
|
this.saveQuotationToolFlag = false;// 关闭弹框 |
|
|
|
} else { |
|
|
|
this.rulesValidateLabel(object, this.quotationToolColumns);// 校验提示 |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 新增报价工具信息 |
|
|
|
insertQuotationToolData(){ |
|
|
|
saveQuotationTool(this.quotationTool).then(({data}) => { |
|
|
|
if (data.code == 200) { |
|
|
|
this.initQuotationToolData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
this.saveQuotationToolFlag = false;// 关闭弹框 |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 批量新增报价工具信息 |
|
|
|
batchInsertQuotationToolData(batchInsertQuotationToolList){ |
|
|
|
batchInsertQuotationTool(batchInsertQuotationToolList).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationToolData(); |
|
|
|
this.saveQuotationToolFlag = false; |
|
|
|
} |
|
|
|
this.$message.success(data.msg); |
|
|
|
}) |
|
|
|
}, |
|
|
|
// =======================================================删除=========================================== |
|
|
|
// 报价工具删除 |
|
|
|
clickDeleteToolTableBtn(row,i) { |
|
|
|
this.quotationToolFormTable.quotationToolList.splice(i,1); |
|
|
|
this.computeQuotationToolCost(); |
|
|
|
this.$message.success("删除成功!"); |
|
|
|
deleteQuotationTool(row).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationToolData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 报价工具 批量删除 |
|
|
|
deleteSelectionQuotationTool(){ |
|
|
|
console.log(this.selectionQuotationToolList.length) |
|
|
|
this.selectionQuotationToolList.reverse().forEach(item => { |
|
|
|
this.quotationToolFormTable.quotationToolList.splice(item.index,1); |
|
|
|
}); |
|
|
|
this.computeQuotationToolCost(); |
|
|
|
this.$message.success("删除成功!"); |
|
|
|
batchDeleteQuotationTool(this.selectionQuotationToolList).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationToolData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 报价工艺删除 |
|
|
|
deleteQuotationRoutingBtn(index){ |
|
|
|
this.quotationRoutingFormTable.quotationRoutingList.splice(index,1); |
|
|
|
// 计算价格 |
|
|
|
|
|
|
|
this.$message.success("删除成功!"); |
|
|
|
deleteQuotationRoutingBtn(row,index){ |
|
|
|
deleteQuotationRouting(row).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationRoutingData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 报价工艺批量删除 |
|
|
|
deleteSelectionQuotationRoutingBtn(){ |
|
|
|
this.selectionQuotationRoutingList.reverse().forEach(item => { |
|
|
|
this.quotationRoutingFormTable.quotationRoutingList.splice(item.index,1); |
|
|
|
}); |
|
|
|
// 计算价格 |
|
|
|
|
|
|
|
this.$message.success("删除成功!"); |
|
|
|
batchDeleteQuotationRouting(this.selectionQuotationRoutingList).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationRoutingData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 报价材料删除 |
|
|
|
deleteQuotationPart(index){ |
|
|
|
this.quotationPartFormTable.quotationPartList.splice(index,1) |
|
|
|
this.$message.success("删除成功!") |
|
|
|
deleteQuotationPart(row,index){ |
|
|
|
deleteQuotationPart(row).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationPart(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 报价材料批量删除 |
|
|
|
deleteSelectionQuotationPart(){ |
|
|
|
this.selectionQuotationPartList.reverse().forEach(item => { |
|
|
|
this.quotationPartFormTable.quotationPartList.splice(item.index,1); |
|
|
|
}); |
|
|
|
// 计算价格 |
|
|
|
this.$message.success("删除成功!"); |
|
|
|
batchDeleteQuotationPart(this.selectionQuotationPartList).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationPart(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// =================================================保存=================================================== |
|
|
|
// 保存 报价明细 |
|
|
|
@ -1623,15 +1729,21 @@ export default { |
|
|
|
savePartBtn(){ |
|
|
|
let quotationPartNo = ""; |
|
|
|
let quotationPartDesc = ""; |
|
|
|
let quotationPartUmId = ""; |
|
|
|
this.selectionPartList = this.selectionPartList.map(item=>{ |
|
|
|
item.quotationDetailId = this.quotationDetailData.quotationDetailId; |
|
|
|
item.site = this.$store.state.user.site; |
|
|
|
item.quotationPartNo = item.partNo; |
|
|
|
item.quotationPartDesc = item.partDesc; |
|
|
|
quotationPartNo += item.partNo + ";"; |
|
|
|
quotationPartDesc += item.partDesc + ";"; |
|
|
|
quotationPartUmId += item.umId + ";"; |
|
|
|
return item; |
|
|
|
}); |
|
|
|
this.quotationPart.quotationPartNo = quotationPartNo.substring(0, quotationPartNo.length - 1); |
|
|
|
this.quotationPart.quotationPartDesc = quotationPartDesc.substring(0, quotationPartDesc.length - 1); |
|
|
|
this.quotationPart.umIdList = quotationPartUmId.substring(0, quotationPartUmId.length - 1); |
|
|
|
this.quotationPart.umId = quotationPartUmId.substring(0, quotationPartUmId.length - 1); |
|
|
|
this.partDialogFlag = false; |
|
|
|
}, |
|
|
|
// 保存 报价工艺 |
|
|
|
@ -1640,17 +1752,33 @@ export default { |
|
|
|
if (!validate){ |
|
|
|
this.rulesValidateLabel(objects,this.quotationRoutingColumns); |
|
|
|
}else { |
|
|
|
//TODO 表格导入逻辑 |
|
|
|
console.log(this.selectionPartList) |
|
|
|
if (this.selectionPartList.length > 0){ |
|
|
|
|
|
|
|
}else { |
|
|
|
// 新增逻辑 |
|
|
|
this.quotationRouting.quotationDetailId = this.quotationDetailData.quotationDetailId; |
|
|
|
this.quotationRoutingFormTable.quotationRoutingList.push(JSON.parse(JSON.stringify(this.quotationRouting))); |
|
|
|
} |
|
|
|
this.$message.success("新增成功!"); |
|
|
|
// 新增逻辑 |
|
|
|
this.quotationRouting.quotationDetailId = this.quotationDetailData.quotationDetailId; |
|
|
|
this.insertQuotationRoutingData(); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 新增报价工艺 |
|
|
|
insertQuotationRoutingData(){ |
|
|
|
insertQuotationRouting(this.quotationRouting).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationRoutingData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
this.quotationRoutingDialogFlag = false; |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 批量新增报价工艺 |
|
|
|
batchInsertQuotationRoutingData(quotationRoutingList){ |
|
|
|
batchInsertQuotationRouting(quotationRoutingList).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationRoutingData(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
this.quotationRoutingDialogFlag = false; |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
@ -1661,12 +1789,97 @@ export default { |
|
|
|
this.rulesValidateLabel(objects,this.quotationPartColumns); |
|
|
|
}else { |
|
|
|
// 新增逻辑 |
|
|
|
this.quotationPart.quotationDetailId = this.quotationDetailData.quotationDetailId; |
|
|
|
this.quotationPartFormTable.quotationPartList.push(JSON.parse(JSON.stringify(this.quotationPart))); |
|
|
|
if (this.selectionPartList.length > 0){ |
|
|
|
let quotationPartList = this.selectionPartList.map(item=>{ |
|
|
|
let data = this.quotationPartFormTable.quotationPartList.find(val => val.partNo == item.partNo); |
|
|
|
if (!data){ |
|
|
|
item.unitDosage = this.quotationPart.unitDosage; |
|
|
|
item.attritionRate = this.quotationPart.attritionRate; |
|
|
|
item.transferAmount = this.quotationPart.transferAmount; |
|
|
|
item.unitCost = this.quotationPart.unitCost; |
|
|
|
item.remark = this.quotationPart.remark; |
|
|
|
}else { |
|
|
|
item = data; |
|
|
|
} |
|
|
|
return item; |
|
|
|
}) |
|
|
|
this.batchInsertQuotationPartData(quotationPartList); |
|
|
|
}else { |
|
|
|
this.quotationPart.quotationDetailId = this.quotationDetailData.quotationDetailId; |
|
|
|
this.insertQuotationPartData(); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 批量新增报价材料 |
|
|
|
batchInsertQuotationPartData(quotationPrtList){ |
|
|
|
batchInsertQuotationPart(quotationPrtList).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationPart(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
this.quotationPartDialogFlag = false; |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
//新增报价材料信息 |
|
|
|
insertQuotationPartData(){ |
|
|
|
insertQuotationPart(this.quotationPart).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.initQuotationPart(); |
|
|
|
this.$message.success(data.msg); |
|
|
|
this.quotationPartDialogFlag = false; |
|
|
|
}else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 保存勾选的其他报价信息 |
|
|
|
saveOtherQuotationDetailBtn(){ |
|
|
|
let otherSelectionPart = [];// 选中的 材料 |
|
|
|
let otherSelectionRouting = [];// 选中的 工艺 |
|
|
|
let otherSelectionTool = [];// 选中的 工具 |
|
|
|
// 遍历选中的其他报价信息 |
|
|
|
for (let i = 0; i < this.selectionOtherDetailList.length; i++) { |
|
|
|
if (this.selectionOtherDetailList[i].quotationPartList){ |
|
|
|
otherSelectionPart = otherSelectionPart.concat(this.selectionOtherDetailList[i].quotationPartList); |
|
|
|
} |
|
|
|
if (this.selectionOtherDetailList[i].quotationRoutingVoList){ |
|
|
|
otherSelectionRouting = otherSelectionRouting.concat(this.selectionOtherDetailList[i].quotationRoutingVoList); |
|
|
|
} |
|
|
|
if (this.selectionOtherDetailList[i].quotationToolList){ |
|
|
|
otherSelectionTool = otherSelectionTool.concat(this.selectionOtherDetailList[i].quotationToolList); |
|
|
|
} |
|
|
|
} |
|
|
|
switch (this.options){ |
|
|
|
case 1: |
|
|
|
otherSelectionPart = otherSelectionPart.map(item=>{ |
|
|
|
item.quotationDetailId = this.quotationDetailData.quotationDetailId; |
|
|
|
item.quotationPartId = undefined; |
|
|
|
return item; |
|
|
|
}) |
|
|
|
this.batchInsertQuotationPartData(otherSelectionPart); |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
otherSelectionRouting = otherSelectionRouting.map(item=>{ |
|
|
|
item.quotationDetailId = this.quotationDetailData.quotationDetailId; |
|
|
|
item.quotationRoutingId = undefined; |
|
|
|
return item; |
|
|
|
}) |
|
|
|
this.batchInsertQuotationRoutingData(otherSelectionRouting); |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
otherSelectionTool = otherSelectionTool.map(item=>{ |
|
|
|
item.quotationDetailId = this.quotationDetailData.quotationDetailId; |
|
|
|
item.quotationToolId = undefined; |
|
|
|
return item; |
|
|
|
}); |
|
|
|
this.batchInsertQuotationToolData(otherSelectionTool); |
|
|
|
break; |
|
|
|
} |
|
|
|
this.otherQuotationDetailDialogFlag = false; |
|
|
|
}, |
|
|
|
// =====================================================表格修改============================================ |
|
|
|
// 修改 报价详情 |
|
|
|
editQuotationDetail(row) { |
|
|
|
@ -1794,6 +2007,8 @@ export default { |
|
|
|
}, |
|
|
|
// 查询 材料信息 |
|
|
|
initPartList(){ |
|
|
|
this.partData.partNo = undefined; |
|
|
|
this.partData.partDesc = undefined; |
|
|
|
let params = { |
|
|
|
site:this.$store.state.user.site |
|
|
|
}; |
|
|
|
@ -1803,6 +2018,21 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 查询 导入其他报价信息 |
|
|
|
initOtherQuotationDetail(){ |
|
|
|
let params = { |
|
|
|
site:this.$store.state.user.site, |
|
|
|
quotationDetailId:this.quotationDetailData.quotationDetailId, |
|
|
|
quotationNo:this.otherDetail.quotationNo, |
|
|
|
productNo:this.otherDetail.productNo, |
|
|
|
productDesc:this.otherDetail.productDesc, |
|
|
|
}; |
|
|
|
searchQuotationDetail(params).then(({data})=>{ |
|
|
|
if (data.code == 200){ |
|
|
|
this.otherQuotationDetailList = data.data; |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// ===============================================页码变动================================================== |
|
|
|
// 报价详情size 改变 |
|
|
|
detailSizeChange(val) { |
|
|
|
@ -1845,6 +2075,7 @@ export default { |
|
|
|
this.initQuotationToolData(); |
|
|
|
this.initQuotationRoutingData(); |
|
|
|
this.initQuotationPart(); |
|
|
|
this.initOtherQuotationDetail(); |
|
|
|
}, |
|
|
|
// 打开新增报价明细 |
|
|
|
openInsertQuotationDetail() { |
|
|
|
@ -1863,6 +2094,11 @@ export default { |
|
|
|
this.$refs.quotationPartForm.resetFields(); |
|
|
|
} |
|
|
|
}, |
|
|
|
// 点击其他报价明细 按钮 |
|
|
|
clickOtherQuotationDetailsBtn(i){ |
|
|
|
this.otherQuotationDetailDialogFlag = true; |
|
|
|
this.options = i; |
|
|
|
}, |
|
|
|
// =======================================================关闭dialog事件============================================= |
|
|
|
// 关闭 详情弹框 |
|
|
|
closeInsertDialog() { |
|
|
|
@ -1908,6 +2144,19 @@ export default { |
|
|
|
// 关闭 材料信息 弹框 |
|
|
|
closeQuotationPartDialog(){ |
|
|
|
this.$refs['quotationPartForm'].resetFields(); |
|
|
|
if (this.selectionPartList.length > 0){ |
|
|
|
this.$refs.partDataForm.resetFields(); |
|
|
|
} |
|
|
|
this.selectionPartList = []; |
|
|
|
if (this.$refs.partDataTable) { |
|
|
|
this.$refs.partDataTable.clearSelection(); |
|
|
|
} |
|
|
|
}, |
|
|
|
// 关闭其他报价明细弹框 |
|
|
|
closeOtherQuotationDetail(){ |
|
|
|
this.options = 0; |
|
|
|
this.$refs.otherDetailForm.resetFields(); |
|
|
|
this.$refs.otherQuotationDetailTable.clearSelection(); |
|
|
|
}, |
|
|
|
// ===================================================表格多选发生改变事件============================================ |
|
|
|
// 报价工具表格 |
|
|
|
@ -1930,6 +2179,15 @@ export default { |
|
|
|
handleSelectionChangePartTable(selection){ |
|
|
|
this.selectionPartList = selection; |
|
|
|
}, |
|
|
|
// 其他报价 |
|
|
|
handleSelectionChangeOtherDetail(selection){ |
|
|
|
this.selectionOtherDetailList = selection; |
|
|
|
}, |
|
|
|
// ===================================================表格点击事件============================================ |
|
|
|
// 点击导入其他报价明细表格行 |
|
|
|
toggleRowSelectionTable(row,refName){ |
|
|
|
this.$refs[refName].toggleRowSelection(row); |
|
|
|
}, |
|
|
|
// =============================================输入框输入事件======================================================= |
|
|
|
// 利润率 输入框 修改 |
|
|
|
inputProfitRate() { |
|
|
|
|