完成页面
This commit is contained in:
parent
4c986cb5ba
commit
17997282d9
|
@ -99,5 +99,18 @@ public class QuoteController extends BaseController {
|
|||
return success(quoteService.queryRedBookVer());
|
||||
}
|
||||
|
||||
/**
|
||||
* @title queryRedBookLocalVersion
|
||||
* @description 获取本地红本版本号
|
||||
* @author JIAL
|
||||
* @updateTime 2024/3/13 12:54
|
||||
* @return: com.ruoyi.common.core.domain.AjaxResult
|
||||
*/
|
||||
@DataSource(DataSourceType.QUOT)
|
||||
@PostMapping("/redBookLocalVer")
|
||||
public AjaxResult queryRedBookLocalVersion() {
|
||||
return success(quoteService.queryRedBookLocalVer());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -25,4 +25,6 @@ public interface QuoteMapper {
|
|||
List<CalculateRBParamDto> queryRedBPriceByParams(@Param("params") List<CalculateRBParamDto> params);
|
||||
|
||||
String queryRedBookVer();
|
||||
|
||||
String queryRedBookLocalVer();
|
||||
}
|
||||
|
|
|
@ -20,4 +20,6 @@ public interface QuoteService {
|
|||
List<CalculateRBParamDto> queryRedBPriceByParams(List<CalculateRBParamDto> params);
|
||||
|
||||
String queryRedBookVer();
|
||||
|
||||
String queryRedBookLocalVer();
|
||||
}
|
||||
|
|
|
@ -75,4 +75,16 @@ public class QuoteServiceImpl implements QuoteService {
|
|||
public String queryRedBookVer() {
|
||||
return quoteMapper.queryRedBookVer();
|
||||
}
|
||||
|
||||
/**
|
||||
* @title queryRedBookLocalVer
|
||||
* @description 获取本地红本版本号
|
||||
* @author JIAL
|
||||
* @updateTime 2024/3/13 12:37
|
||||
* @return: java.lang.String
|
||||
*/
|
||||
@Override
|
||||
public String queryRedBookLocalVer() {
|
||||
return quoteMapper.queryRedBookLocalVer();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,4 +109,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE [sta_0] IN ('0', '1');
|
||||
</select>
|
||||
|
||||
<select id="queryRedBookLocalVer" resultType="String">
|
||||
SELECT MAX([version_uid]) AS redBookLocalVer
|
||||
FROM [jn_quot].[dbo].[c_rb_version]
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
@ -30,3 +30,10 @@ export function queryRedBookVer () {
|
|||
method: 'post',
|
||||
})
|
||||
}
|
||||
|
||||
export function queryRedBookLocalVer () {
|
||||
return request({
|
||||
url: '/quote/redBookLocalVer',
|
||||
method: 'post',
|
||||
})
|
||||
}
|
||||
|
|
|
@ -412,11 +412,11 @@
|
|||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
width="180"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="handleviewDetails(scope.row)" style="color: dodgerblue; margin-right: 20px" type="text">查看详情</el-button>
|
||||
<el-button @click="handleDeleteClick(scope.$index)" style="color: red;" type="text">删除</el-button>
|
||||
<el-button @click="handleDeleteClick(scope.$index)" style="color: red;" type="text">查看详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -511,17 +511,55 @@
|
|||
</el-button-group>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog class="matUsageDetDialogTable" :visible.sync="dialogMatUsageDetVisible" width="725px">
|
||||
<el-table
|
||||
:data="matUsageDetDialogData"
|
||||
ref="matUsageDetDialogData"
|
||||
height="550px"
|
||||
:header-cell-style="{ background: '#eef1f6', color: '#606266', 'text-align': 'center', 'padding': '0px'}"
|
||||
:cell-style="{'text-align': 'center', 'padding': '5px 0px'}"
|
||||
|
||||
border>
|
||||
<el-table-column
|
||||
label="序号"
|
||||
type="index"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="260"
|
||||
prop="materialName"
|
||||
label="关联用料">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="120"
|
||||
prop="costClQty"
|
||||
label="用量1">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="125"
|
||||
prop="costClQty2"
|
||||
label="用量2">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="120"
|
||||
prop="materialPrice"
|
||||
label="单价">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {queryMaterialListByParam, queryRedBCostByParams, queryRedBPriceByParams, queryRedBookVer } from "@/api/quote/quote";
|
||||
import { getMaterial} from "@/api/material/material";
|
||||
import {queryMaterialListByParam, queryRedBCostByParams, queryRedBPriceByParams, queryRedBookVer, queryRedBookLocalVer } from "@/api/quote/quote";
|
||||
import {getMaterial} from "@/api/material/material";
|
||||
const commonRule = [
|
||||
{ required: true, message: '不能为空值,可填0', trigger: 'blur' },
|
||||
{ pattern: /^(([1-9]{1}\d{0,9})|(0{1}))(\.\d{1,3})?$/, message: '格式有误,只能为数字格式', trigger: 'blur' }
|
||||
];
|
||||
let redBookVer = 0; //红本版本号
|
||||
let redBookLocalVer = 0; //本地红本版本号
|
||||
|
||||
export default {
|
||||
name: "index-app",
|
||||
|
@ -605,6 +643,8 @@ export default {
|
|||
selectedMaterialItems: [], // 选中的数据
|
||||
savedSelectedMaterials: [], // 保存选中的数据
|
||||
total: 0,
|
||||
dialogMatUsageDetVisible: false,
|
||||
matUsageDetDialogData: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -625,8 +665,12 @@ export default {
|
|||
/**-------------获取红本版本号---------------**/
|
||||
getRedBookVersion() {
|
||||
queryRedBookVer().then(response => {
|
||||
console.log(response);
|
||||
redBookVer = response.msg
|
||||
console.log("redBookVer:" + redBookVer)
|
||||
});
|
||||
queryRedBookLocalVer().then(response => {
|
||||
redBookLocalVer = response.msg
|
||||
console.log("redBookLocalVer:" + redBookLocalVer)
|
||||
});
|
||||
},
|
||||
/**--------------输入值改变则底色发生变化------------**/
|
||||
|
@ -650,6 +694,7 @@ export default {
|
|||
});
|
||||
}
|
||||
}
|
||||
this.calculatedData();
|
||||
},
|
||||
/**-------物料表格的cell样式----------**/
|
||||
cellStyle({row, column, rowIndex, columnIndex}) {
|
||||
|
@ -665,17 +710,42 @@ export default {
|
|||
handleDeleteClick(index){
|
||||
this.materialData.splice(index, 1)
|
||||
},
|
||||
/**-------------------点击查看物料材料用量详情------------------------**/
|
||||
handleviewDetails(row) {
|
||||
this.dialogMatUsageDetVisible = true;
|
||||
const uid = row.uid;
|
||||
getMaterial(uid).then(response => {
|
||||
console.log(response);
|
||||
this.matUsageDetDialogData = response.data.cmaterialCostList
|
||||
});
|
||||
console.log("当前行的UID: " + row.uid);
|
||||
},
|
||||
/**--------添加物料,打开物料dialog框---------**/
|
||||
addMaterial(){
|
||||
this.dialogMaterialVisible = true;
|
||||
},
|
||||
/**--------查询物料---------**/
|
||||
searchMaterial() {
|
||||
if(this.materialQueryParams.precMaterialName === '' && this.materialQueryParams.vagueMaterialName === ''
|
||||
&& this.materialQueryParams.vagueModel === '') {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "请输入查询条件。"
|
||||
});
|
||||
|
||||
} else {
|
||||
queryMaterialListByParam(this.materialQueryParams).then(response => {
|
||||
if (response.rows.length === 0) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "查询结果为空,请检查查询条件。"
|
||||
});
|
||||
}
|
||||
this.materialDialogData = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
/**-----------选择物料触发事件----------------**/
|
||||
handleSelectionChange(selection) {
|
||||
|
@ -793,14 +863,21 @@ export default {
|
|||
},
|
||||
/**----------------计算数据--------------------**/
|
||||
calculatedData() {
|
||||
if(redBookVer !== redBookLocalVer) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "调价结果未同步,请联系管理员进行同步再进行价格计算。"
|
||||
});
|
||||
} else {
|
||||
/**-------------计算财务总成本---------------**/
|
||||
this.calculateTotal();
|
||||
/**----------------------进行盘具、数量、人工、水电三个数值的验证---------------**/
|
||||
this.validationErrors = []; // 清空之前的错误信息
|
||||
this.materialData.forEach((row, index) => {
|
||||
const quantity = parseFloat(row.number) || 0; // 如果为空,默认为0
|
||||
const var1 = /^\d*\.?\d+$/.test(row.number);
|
||||
|
||||
// 进行数量验证
|
||||
if (isNaN(quantity) || quantity < 0) {
|
||||
if (!var1) {
|
||||
this.validationErrors.push(`第 ${index + 1} 行数量不符合要求\n`);
|
||||
}
|
||||
|
||||
|
@ -819,18 +896,19 @@ export default {
|
|||
const quantity = parseFloat(row.number) || 0; // 如果为空,默认为0
|
||||
const totalFinExpenses = (parseFloat(this.totalForm.totalFinExpenses)) / 100
|
||||
const num1 = (quantity * redBookFacPrice);
|
||||
const num2 = ((materialCost + materialCost * (manuCost + wdFSurcharge + totalFinExpenses ) ) * quantity)
|
||||
const num2 = ((materialCost + materialCost * (manuCost + wdFSurcharge + totalFinExpenses)) * quantity)
|
||||
// 进行其他计算
|
||||
this.$set(this.materialData, index, {
|
||||
...row,
|
||||
varRatio: ((redBookFacPrice - materialCost) / redBookFacPrice * 100).toFixed(2) + '%',
|
||||
totalFacPrice: (quantity * redBookFacPrice).toFixed(2),
|
||||
totalCost: ((materialCost + materialCost * (manuCost + wdFSurcharge + totalFinExpenses) ) * quantity
|
||||
totalCost: ((materialCost + materialCost * (manuCost + wdFSurcharge + totalFinExpenses)) * quantity
|
||||
).toFixed(2),
|
||||
totalVariance : (((num1 - num2) / num1) * 100).toFixed(2) + '%'
|
||||
totalVariance: (((num1 - num2) / num1) * 100).toFixed(2) + '%'
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.validationErrors.push("页面未进行运算,请改正所有错误再进行运算!!!!!");
|
||||
this.$message({
|
||||
type: 'error',
|
||||
dangerouslyUseHTMLString: true,
|
||||
|
@ -848,6 +926,7 @@ export default {
|
|||
|
||||
const totalDifferenceValue = (((totalFactoryAmount - totalCost) / totalFactoryAmount) * 100)
|
||||
this.totalForm.totalDifferenceValue = totalDifferenceValue.toFixed(2)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -872,6 +951,8 @@ export default {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.form-box .el-col {
|
||||
height: 55px;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue