This commit is contained in:
xd 2024-07-04 12:53:55 +08:00
parent 1dd6f52bde
commit 0369036272
4 changed files with 89 additions and 70 deletions

View File

@ -2,6 +2,7 @@ package com.ruoyi.redBook.domain;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
public class OAQuot extends BaseEntity { public class OAQuot extends BaseEntity {
@ -13,6 +14,8 @@ public class OAQuot extends BaseEntity {
private String quotLxrdh;//联系人电话 private String quotLxrdh;//联系人电话
private String totalPrice;//总金额 private String totalPrice;//总金额
private BigDecimal perc;//一次折扣
private BigDecimal perc2;//二次折扣
private String rbDateUid;//调价版本 private String rbDateUid;//调价版本
private String quotApprovalStatus;//提交状态 private String quotApprovalStatus;//提交状态
@ -64,6 +67,14 @@ public class OAQuot extends BaseEntity {
public void setTotalPrice(String totalPrice) { this.totalPrice = totalPrice; } public void setTotalPrice(String totalPrice) { this.totalPrice = totalPrice; }
public BigDecimal getPerc() {return perc; }
public void setPerc(BigDecimal perc) {this.perc = perc; }
public BigDecimal getPerc2() { return perc2; }
public void setPerc2(BigDecimal perc2) { this.perc2 = perc2; }
public String getRbDateUid() { return rbDateUid; } public String getRbDateUid() { return rbDateUid; }
public void setRbDateUid(String rbDateUid) { this.rbDateUid = rbDateUid; } public void setRbDateUid(String rbDateUid) { this.rbDateUid = rbDateUid; }

View File

@ -94,6 +94,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="quotLxr != null and quotLxr != ''">quotLxr,</if> <if test="quotLxr != null and quotLxr != ''">quotLxr,</if>
<if test="quotLxrdh != null and quotLxrdh != ''">quotLxrdh,</if> <if test="quotLxrdh != null and quotLxrdh != ''">quotLxrdh,</if>
<if test="totalPrice != null and totalPrice != ''">totalPrice,</if> <if test="totalPrice != null and totalPrice != ''">totalPrice,</if>
<if test="perc != null and perc != ''">perc,</if>
<if test="perc2 != null and perc2 != ''">perc2,</if>
<if test="rbDateUid != null and rbDateUid != ''">rbDateUid,</if> <if test="rbDateUid != null and rbDateUid != ''">rbDateUid,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
@ -108,6 +110,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="quotLxr != null and quotLxr != ''">#{quotLxr},</if> <if test="quotLxr != null and quotLxr != ''">#{quotLxr},</if>
<if test="quotLxrdh != null and quotLxrdh != ''">#{quotLxrdh},</if> <if test="quotLxrdh != null and quotLxrdh != ''">#{quotLxrdh},</if>
<if test="totalPrice != null and totalPrice != ''">#{totalPrice},</if> <if test="totalPrice != null and totalPrice != ''">#{totalPrice},</if>
<if test="perc != null and perc != ''">#{perc},</if>
<if test="perc2 != null and perc2 != ''">#{perc2},</if>
<if test="rbDateUid != null and rbDateUid != ''">#{rbDateUid},</if> <if test="rbDateUid != null and rbDateUid != ''">#{rbDateUid},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
@ -125,6 +129,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="quotLxr != null and quotLxr != ''">quotLxr = #{quotLxr},</if> <if test="quotLxr != null and quotLxr != ''">quotLxr = #{quotLxr},</if>
<if test="quotLxrdh != null and quotLxrdh != ''">quotLxrdh = #{quotLxrdh},</if> <if test="quotLxrdh != null and quotLxrdh != ''">quotLxrdh = #{quotLxrdh},</if>
<if test="totalPrice != null and totalPrice != ''">totalPrice = #{totalPrice},</if> <if test="totalPrice != null and totalPrice != ''">totalPrice = #{totalPrice},</if>
<if test="perc != null and perc != ''">perc = #{perc},</if>
<if test="perc2 != null and perc2 != ''">perc2 = #{perc2},</if>
<if test="rbDateUid != null and rbDateUid != ''">rbDateUid = #{rbDateUid},</if> <if test="rbDateUid != null and rbDateUid != ''">rbDateUid = #{rbDateUid},</if>
<if test="quotApprovalStatus != null and quotApprovalStatus != ''">quotApprovalStatus = #{quotApprovalStatus},</if> <if test="quotApprovalStatus != null and quotApprovalStatus != ''">quotApprovalStatus = #{quotApprovalStatus},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
@ -230,6 +236,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="quotLxr" column="quotLxr" /> <result property="quotLxr" column="quotLxr" />
<result property="quotLxrdh" column="quotLxrdh" /> <result property="quotLxrdh" column="quotLxrdh" />
<result property="totalPrice" column="totalPrice" /> <result property="totalPrice" column="totalPrice" />
<result property="perc" column="perc" />
<result property="perc2" column="perc2" />
<result property="rbDateUid" column="rbDateUid" /> <result property="rbDateUid" column="rbDateUid" />
<result property="quotApprovalStatus" column="quotApprovalStatus" /> <result property="quotApprovalStatus" column="quotApprovalStatus" />
</resultMap> </resultMap>
@ -256,7 +264,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectQuotByQuotId" parameterType="String" resultMap="QuotQuotMaterialResult"> <select id="selectQuotByQuotId" parameterType="String" resultMap="QuotQuotMaterialResult">
select a.quot_id, a.quotCode, a.quotCustomer, a.quotProject, a.quotLxr, select a.quot_id, a.quotCode, a.quotCustomer, a.quotProject, a.quotLxr,
a.quotLxrdh, a.totalPrice,a.rbDateUid,a.quotApprovalStatus, a.quotLxrdh, a.totalPrice,a.perc,a.perc2,a.rbDateUid,a.quotApprovalStatus,
b.uid_0,b.quot_product_id, b.name_0, b.name_1, b.uid_0,b.quot_product_id, b.name_0, b.name_1,
b.spec, b.voltage, b.stu, b.spec, b.voltage, b.stu,

View File

@ -128,8 +128,8 @@
<el-input v-model="form.totalPrice"/> <el-input v-model="form.totalPrice"/>
</el-form-item> </el-form-item>
<el-form-item label="设置折扣率" label-width="100px" style="margin-bottom: 10px;"> <el-form-item label="设置折扣率" label-width="100px" style="margin-bottom: 10px;">
<el-input style="width:65px" v-model="perc" size="small" @blur="changeData" @keyup.enter.native="changeData"></el-input> <el-input style="width:65px" v-model="form.perc" size="small" @blur="changeData" @keyup.enter.native="changeData"></el-input>
<el-input style="width:65px;margin-left: 5px" v-model="perc2" size="small" @blur="changeData" @keyup.enter.native="changeData"></el-input> <el-input style="width:65px;margin-left: 5px" v-model="form.perc2" size="small" @blur="changeData" @keyup.enter.native="changeData"></el-input>
<!--总价:<span style="color:red;font-size: 15px">{{sumSelectedResultData}} </span>--> <!--总价:<span style="color:red;font-size: 15px">{{sumSelectedResultData}} </span>-->
<el-select v-model="form.rbDateUid" style="width: 235px;margin-left: 5px" :disabled="selectedResultData.length==0"> <el-select v-model="form.rbDateUid" style="width: 235px;margin-left: 5px" :disabled="selectedResultData.length==0">
<el-option <el-option
@ -353,11 +353,11 @@
}, },
// //
perc: 0.8, /*perc: 0.8,
perc2: '', perc2: '',*/
// //
form: {totalPrice: ''}, form: {totalPrice: '',perc:0.8,perc2: ''},
// //
versionList: [], // versionList: [], //
@ -366,16 +366,17 @@
} }
}, },
created() { created() {
this.productList();
this.getVersionList();
const param = this.$route.query; const param = this.$route.query;
const that = this;
this.productList();
this.getVersionList().then(function(){
if (param.quotId !== undefined && param.quotId !== null) {
that.handleRefreshClick();
if (param.quotId !== undefined && param.quotId !== null) { const row = {'quotId':param.quotId}
const row = {'quotId':param.quotId} that.handleQuotInfo(row);
this.handleQuotInfo(row); }
} });
}, },
mounted(){ mounted(){
/*设置内容高度*/ /*设置内容高度*/
@ -391,7 +392,6 @@
getQuotDetail(quotId).then(response => { getQuotDetail(quotId).then(response => {
this.form = response.data; this.form = response.data;
this.selectedResultData = response.data.selectedResultData; this.selectedResultData = response.data.selectedResultData;
console.log(this.selectedResultData)
}) })
}, },
@ -606,8 +606,8 @@
const voltage = row.voltage; const voltage = row.voltage;
const price = row.price; const price = row.price;
const stu = row.stu; const stu = row.stu;
const per = this.perc; const per = this.form.perc;
const per2 = this.perc2; const per2 = this.form.perc2;
const count = '1'; const count = '1';
const setPrice = toDecimal(price * (per?per:1) * (per2?per2:1)); const setPrice = toDecimal(price * (per?per:1) * (per2?per2:1));
const allPrice = toDecimal(count * price * (per?per:1) * (per2?per2:1)); const allPrice = toDecimal(count * price * (per?per:1) * (per2?per2:1));
@ -703,14 +703,14 @@
changeData() { changeData() {
// //
const pattern = /^\d+(\.\d+)?$/; const pattern = /^\d+(\.\d+)?$/;
if(this.perc) { if(this.form.perc) {
if (!pattern.test(this.perc)) { if (!pattern.test(this.form.perc)) {
this.$message.warning("折扣率格式错误!"); this.$message.warning("折扣率格式错误!");
return; return;
} }
} }
if(this.perc2) { if(this.form.perc2) {
if (!pattern.test(this.perc2)) { if (!pattern.test(this.form.perc2)) {
this.$message.warning("折扣率格式错误!"); this.$message.warning("折扣率格式错误!");
return; return;
} }
@ -721,10 +721,10 @@
// //
this.$set(this.selectedResultData, index, { this.$set(this.selectedResultData, index, {
...row, ...row,
per: this.perc, per: this.form.perc,
per2: this.perc2, per2: this.form.perc2,
setPrice: toDecimal(row.price * (this.perc?this.perc:1) * (this.perc2?this.perc2:1)), setPrice: toDecimal(row.price * (this.form.perc?this.form.perc:1) * (this.form.perc2?this.form.perc2:1)),
allPrice: toDecimal(row.count * row.price * (this.perc?this.perc:1) * (this.perc2?this.perc2:1)), allPrice: toDecimal(row.count * row.price * (this.form.perc?this.form.perc:1) * (this.form.perc2?this.form.perc2:1)),
}); });
}) })
}, },
@ -747,8 +747,8 @@
this.form.quotLxr = ''; this.form.quotLxr = '';
this.form.quotLxrdh = ''; this.form.quotLxrdh = '';
this.perc = '0.8'; this.form.perc = '0.8';
this.perc2 = ''; this.form.perc2 = '';
this.form.rbDateUid = this.versionList[0].value this.form.rbDateUid = this.versionList[0].value
this.selectedResultData = []; this.selectedResultData = [];
//this.resetForm("form"); //this.resetForm("form");
@ -872,8 +872,8 @@
}, },
// //
getVersionList(){ async getVersionList(){
versionList(this.queryParams).then(response => { await versionList(this.queryParams).then(response => {
this.versionList = response.versionList; this.versionList = response.versionList;
this.form.rbDateUid = this.versionList[0].value this.form.rbDateUid = this.versionList[0].value
}); });
@ -946,10 +946,8 @@
let sl = row.count; let sl = row.count;
if(sl){ if(sl){
sl = String(sl).trim(); sl = String(sl).trim();
if(sl){ if (!reg.test(sl)) {
if (!reg.test(sl)) { this.errSlIndex.push(index+1);
this.errSlIndex.push(index+1);
}
} }
} }
@ -957,10 +955,8 @@
let perc = row.per; let perc = row.per;
if(perc){ if(perc){
perc = String(perc).trim(); perc = String(perc).trim();
if(perc){ if (!reg.test(perc)) {
if (!reg.test(perc)) { this.errPercIndex.push(index+1);
this.errPercIndex.push(index+1);
}
} }
} }
@ -968,10 +964,8 @@
let perc2 = row.per2; let perc2 = row.per2;
if(perc2){ if(perc2){
perc2 = String(perc2).trim(); perc2 = String(perc2).trim();
if(perc2){ if (!reg.test(perc2)) {
if (!reg.test(perc2)) { this.errPerc2Index.push(index+1);
this.errPerc2Index.push(index+1);
}
} }
} }
}); });
@ -1021,7 +1015,6 @@
isColumn1ValuesEqual() { isColumn1ValuesEqual() {
if(this.selectedResultData.length > 0){ if(this.selectedResultData.length > 0){
const uid_0 = this.selectedResultData[0].uid_0;//uid const uid_0 = this.selectedResultData[0].uid_0;//uid
console.log(this.selectedResultData)
return this.selectedResultData.every(row => row.uid_0 === uid_0); return this.selectedResultData.every(row => row.uid_0 === uid_0);
}else{ }else{
return false; return false;

View File

@ -89,8 +89,8 @@
<el-input v-model="form.totalPrice"/> <el-input v-model="form.totalPrice"/>
</el-form-item> </el-form-item>
<el-form-item label="设置折扣率" label-width="100px"> <el-form-item label="设置折扣率" label-width="100px">
<el-input style="width:65px" v-model="perc" size="small" @blur="changeData" @keyup.enter.native="changeData"></el-input> <el-input style="width:65px" v-model="form.perc" size="small" @blur="changeData" @keyup.enter.native="changeData"></el-input>
<el-input style="width:65px;margin-left: 5px" v-model="perc2" size="small" @blur="changeData" @keyup.enter.native="changeData"></el-input> <el-input style="width:65px;margin-left: 5px" v-model="form.perc2" size="small" @blur="changeData" @keyup.enter.native="changeData"></el-input>
<!--总价:<span style="color:red;font-size: 15px">{{sumSelectedResultData}} </span>--> <!--总价:<span style="color:red;font-size: 15px">{{sumSelectedResultData}} </span>-->
<el-select v-model="form.rbDateUid" style="margin-left: 20px;width: 235px;" :disabled="selectedResultData.length==0"> <el-select v-model="form.rbDateUid" style="margin-left: 20px;width: 235px;" :disabled="selectedResultData.length==0">
<el-option <el-option
@ -206,7 +206,7 @@
}, },
// //
form: {}, form: {totalPrice: '',perc:0.8,perc2: ''},
// //
rules: { rules: {
quotCustomer: [ quotCustomer: [
@ -229,9 +229,9 @@
// //
selectedResultData: [], selectedResultData: [],
// /*//折扣率 初始
perc: 0.8, perc: 0.8,
perc2: '', perc2: '',*/
selectedResultLoading: false, selectedResultLoading: false,
} }
}, },
@ -240,6 +240,19 @@
this.getVersionList(); this.getVersionList();
}, },
methods: { methods: {
//
handleRefreshClick() {
this.form.quotCustomer = '';
this.form.quotProject = '';
this.form.quotLxr = '';
this.form.quotLxrdh = '';
this.form.perc = '0.8';
this.form.perc2 = '';
this.form.rbDateUid = this.versionList[0].value
this.selectedResultData = [];
//this.resetForm("form");
},
/** 查询报价单列表 */ /** 查询报价单列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -250,8 +263,8 @@
}); });
}, },
// //
getVersionList(){ async getVersionList(){
versionList(this.queryParams).then(response => { await versionList(this.queryParams).then(response => {
this.versionList = response.versionList; this.versionList = response.versionList;
}); });
}, },
@ -272,11 +285,11 @@
/** 查看详情按钮操作 */ /** 查看详情按钮操作 */
handleDetail(row) { handleDetail(row) {
this.handleRefreshClick();
const quotId = row.quot_id; const quotId = row.quot_id;
getQuotDetail(quotId).then(response => { getQuotDetail(quotId).then(response => {
this.form = response.data; this.form = response.data;
this.selectedResultData = response.data.selectedResultData; this.selectedResultData = response.data.selectedResultData;
console.log(this.selectedResultData)
this.open = true; this.open = true;
this.title = "报价单信息"; this.title = "报价单信息";
}) })
@ -313,14 +326,14 @@
changeData() { changeData() {
// //
const pattern = /^\d+(\.\d+)?$/; const pattern = /^\d+(\.\d+)?$/;
if(this.perc) { if(this.form.perc) {
if (!pattern.test(this.perc)) { if (!pattern.test(this.form.perc)) {
this.$message.warning("折扣率格式错误!"); this.$message.warning("折扣率格式错误!");
return; return;
} }
} }
if(this.perc2) { if(this.form.perc2) {
if (!pattern.test(this.perc2)) { if (!pattern.test(this.form.perc2)) {
this.$message.warning("折扣率格式错误!"); this.$message.warning("折扣率格式错误!");
return; return;
} }
@ -331,10 +344,10 @@
// //
this.$set(this.selectedResultData, index, { this.$set(this.selectedResultData, index, {
...row, ...row,
per: this.perc, per: this.form.perc,
per2: this.perc2, per2: this.form.perc2,
setPrice: toDecimal(row.price * (this.perc?this.perc:1) * (this.perc2?this.perc2:1)), setPrice: toDecimal(row.price * (this.form.perc?this.form.perc:1) * (this.form.perc2?this.form.perc2:1)),
allPrice: toDecimal(row.count * row.price * (this.perc?this.perc:1) * (this.perc2?this.perc2:1)), allPrice: toDecimal(row.count * row.price * (this.form.perc?this.form.perc:1) * (this.form.perc2?this.form.perc2:1)),
}); });
}) })
}, },
@ -534,10 +547,8 @@
let sl = row.count; let sl = row.count;
if(sl){ if(sl){
sl = String(sl).trim(); sl = String(sl).trim();
if(sl){ if (!reg.test(sl)) {
if (!reg.test(sl)) { this.errSlIndex.push(index+1);
this.errSlIndex.push(index+1);
}
} }
} }
@ -545,10 +556,8 @@
let perc = row.per; let perc = row.per;
if(perc){ if(perc){
perc = String(perc).trim(); perc = String(perc).trim();
if(perc){ if (!reg.test(perc)) {
if (!reg.test(perc)) { this.errPercIndex.push(index+1);
this.errPercIndex.push(index+1);
}
} }
} }
@ -556,10 +565,8 @@
let perc2 = row.per2; let perc2 = row.per2;
if(perc2){ if(perc2){
perc2 = String(perc2).trim(); perc2 = String(perc2).trim();
if(perc2){ if (!reg.test(perc2)) {
if (!reg.test(perc2)) { this.errPerc2Index.push(index+1);
this.errPerc2Index.push(index+1);
}
} }
} }
}); });