diff --git a/src/api/quotation/quotationHeader.js b/src/api/quotation/quotationHeader.js index c8df213..5f5bc28 100644 --- a/src/api/quotation/quotationHeader.js +++ b/src/api/quotation/quotationHeader.js @@ -5,7 +5,7 @@ import { createAPI } from "@/utils/httpRequest.js"; * @param data * @returns {*} */ -export const getQuotationHeaderByPage = (data) => createAPI(`/plm/quotationHeader/getQuotationHeaderByPage`,'get',data); +export const getQuotationHeaderByPage = (data,ids) => createAPI(`/plm/quotationHeader/getQuotationHeaderByPage`+ids,'get',data); /** * 新增报价信息 QuotationHeader diff --git a/src/views/modules/quotation/sellForQuotation.vue b/src/views/modules/quotation/sellForQuotation.vue index 157bafb..42ad806 100644 --- a/src/views/modules/quotation/sellForQuotation.vue +++ b/src/views/modules/quotation/sellForQuotation.vue @@ -1,28 +1,40 @@ - + @@ -331,7 +330,7 @@ 新 增 从其他报价单复制 - 批 量 删 除 + 删 除 @@ -363,7 +362,7 @@ - 计 算 + 计 算
系统自动计算结果(料工费/工具) @@ -371,27 +370,37 @@ - +
+ +
- +
+ +
- +
+ +
- +
+ +
- +
+ +
@@ -405,32 +414,37 @@ - 材料成本: - +
+ +
- 机器成本: - +
+ +
- 制造费用成本: - +
+ +
- 人工成本: - +
+ +
- 工具成本: - +
+ +
@@ -444,17 +458,23 @@ - +
+ +
- +
+ +
- +
+ +
@@ -468,12 +488,16 @@ - +
+ +
- +
+ +
@@ -487,27 +511,37 @@ - +
+ +
- +
+ +
- +
+ +
- +
+ +
- +
+ +
@@ -535,26 +569,32 @@ - + - +
+ +
- +
+ +
- +
+ +
@@ -605,7 +645,7 @@ - + @@ -617,7 +657,7 @@ 工序名称 - + @@ -645,22 +685,26 @@ - + - + - +
+ +
- +
+ +
@@ -677,35 +721,45 @@ - - - - + +
+ +
- +
+ +
- +
+ +
- +
+ +
- +
+ +
- +
+ +
@@ -739,12 +793,12 @@ - + - + - +
+ +
- - - - + +
+ +
- +
+ +
- +
+ +
@@ -1216,10 +1276,10 @@ export default { outputUnit:'单位/小时',//单位编码 routingEfficiency:100,//效率 operatorsNumber:1,//操作工人数 - unitMachineryCost:undefined,//单位机器成本 - unitLaborCost:undefined,//单位人工成本 - unitManufacturingCost:undefined,//单位制造费用 - unitQuotedCost:undefined,//单位报价成本 + unitMachineryCost:0,//单位机器成本 + unitLaborCost:0,//单位人工成本 + unitManufacturingCost:0,//单位制造费用 + unitQuotedCost:0,//单位报价成本 remark:undefined,//备注 }, //报价工具对象 @@ -2318,8 +2378,9 @@ export default { /** * 工序列表 */ - queryOperationList () { + queryOperationList() { // 查询所有工序 + this.operationList = []; queryOperationList(this.operationData).then(({data}) => { if (data && data.code === 0) { this.operationList = data.rows @@ -2386,6 +2447,10 @@ export default { this.$refs.quotationToolForm.resetFields(); } }, + // 打开报价工序新增 + openQuotationRoutingDialog(){ + // this.queryOperationList(); + }, // 打开 材料信息弹框 openPartDialog(){ if (this.selectionPartList.length > 0) { @@ -2485,10 +2550,10 @@ export default { outputUnit:'单位/小时',//单位编码 routingEfficiency:100,//效率 operatorsNumber:1,//操作工人数 - unitMachineryCost:undefined,//单位机器成本 - unitLaborCost:undefined,//单位人工成本 - unitManufacturingCost:undefined,//单位制造费用 - unitQuotedCost:undefined,//单位报价成本 + unitMachineryCost:0,//单位机器成本 + unitLaborCost:0,//单位人工成本 + unitManufacturingCost:0,//单位制造费用 + unitQuotedCost:0,//单位报价成本 remark:undefined,//备注 }; }, @@ -2616,7 +2681,7 @@ export default { row = JSON.parse(JSON.stringify(row)); this.quotationTool.toolNo = row.toolNo; this.quotationTool.toolDescription = row.toolDescription; - this.quotationTool.unitCost = row.unitCost ? row.unitCost : 1; + this.quotationTool.unitCost = row.unitCost ? row.unitCost : 0; this.toolHeaderDialogFlag= false; }, getComponentRowData (row) { @@ -2644,6 +2709,15 @@ export default { }, 0); }, // 计算按钮 + adjustCost(){ + this.quotationDetailData.adjustPartCost = new Decimal(this.quotationDetailData.computePartCost).toSignificantDigits().toNumber(); + this.quotationDetailData.adjustToolCost = new Decimal(this.quotationDetailData.computeToolCost).toSignificantDigits().toNumber(); + this.quotationDetailData.adjustLabourCost = new Decimal(this.quotationDetailData.computeLabourCost).toSignificantDigits().toNumber(); + this.quotationDetailData.adjustMachineCost = new Decimal(this.quotationDetailData.computeMachineCost).toSignificantDigits().toNumber(); + this.quotationDetailData.adjustFabricateCost = new Decimal(this.quotationDetailData.computeFabricateCost).toSignificantDigits().toNumber(); + this.computeCost(); + }, + // 计算按钮 computeCost(){ // 计算总金额 this.computeAmount(); @@ -2668,7 +2742,7 @@ export default { this.quotationDetailData.detailProfitAmount = new Decimal(this.quotationDetailData.detailTotalCost).mul(new Decimal(this.quotationDetailData.detailProfitRate).div(new Decimal(100))).toSignificantDigits().toNumber(); this.quotationDetailData.detailProfitAmount = new Decimal(new Decimal(this.quotationDetailData.detailProfitAmount).toFixed(4,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber(); }, - // 总金额 + // 计算总金额 computeAmount(){ this.quotationDetailData.detailTotalCost = new Decimal(0); this.quotationDetailData.detailTotalCost = this.quotationDetailData.detailTotalCost.add(new Decimal(this.quotationDetailData.adjustPartCost)); @@ -2682,13 +2756,26 @@ export default { // ====================================================输入框 事件============================================= changeWorkCenterSelect(val,obj){ let value = this.workCenterList.find((item)=>item.workCenterNo == val); - obj.machiningCenterDesc = value?value.workCenterDesc:""; - obj.machiningCenterType = value?value.workCenterType:""; - obj.unitLaborCost = value?value.laborCost:0; // 人工成本 - obj.unitMachineryCost = value?value.unitCost:0; // 机器成本 - obj.unitManufacturingCost = value?value.overheadCost:0;// 制造费用 + if (value){ + obj.machiningCenterDesc = value.workCenterDesc; + obj.machiningCenterType = value.workCenterType; + obj.unitLaborCost = value.laborCost; // 人工成本 + obj.unitMachineryCost = value.unitCost; // 机器成本 + obj.unitManufacturingCost = value.overheadCost;// 制造费用 + // 计算费用 + // 获得效率 + let efficiency = new Decimal(obj.routingEfficiency).div(new Decimal(100)).toNumber(); + if (obj.outputUnit === '小时'){ + // obj.unitManufacturingCost = obj. + }else if (obj.outputUnit === '小时/单位'){ + + }else if (obj.outputUnit === '单位/小时'){ - this.changeRoutingCost();// 工艺 计算单位成本 + }else { + this.$message.warning("产出单位有误") + } + this.changeRoutingCost();// 工艺 计算单位成本 + } }, machiningCenterNoSelect(e,row){ let value = e.target.value; // 输入框值 @@ -2749,6 +2836,35 @@ export default { let value = this.umInformationList.find(item=>item.umId == id) return value?value.umName:id; }, + // 输入规则 + inputRule(value,type){ + if (value === undefined || value === null || value === ''){ + this.setInputValue(value,type); + return + } + if (!isNaN(value)){ + value = new Decimal(value).toNumber(); + if (value < 0){ + this.setInputValue(0,type); + }else if (value > 100){ + this.setInputValue(100,type); + }else { + let testValue = new Decimal(value).toFixed(2,Decimal.ROUND_FLOOR); + testValue = new Decimal(testValue).toSignificantDigits().toNumber(); + this.setInputValue(testValue,type); + } + } + }, + setInputValue(value,type){ + switch (type){ + case 1: + this.quotationPart.attritionRate = value; + break + case 2: + this.quotationRouting.routingEfficiency = value; + break + } + }, }, created() { // 创建时 父组件值绑定zi @@ -2779,4 +2895,7 @@ export default { /deep/ .el-form-item--medium .el-form-item__content{ line-height: 28px; } +.right /deep/ .el-input__inner{ + text-align: right; +} diff --git a/src/views/modules/quotation/toBeQuoted.vue b/src/views/modules/quotation/toBeQuoted.vue index 2dc067e..c87586a 100644 --- a/src/views/modules/quotation/toBeQuoted.vue +++ b/src/views/modules/quotation/toBeQuoted.vue @@ -1,7 +1,7 @@