'123'
This commit is contained in:
parent
acbf9e7876
commit
061906589b
|
@ -663,7 +663,11 @@ public class RedBookController extends BaseController
|
||||||
return toAjax(redBookService.deleteQuotsByQuotId(quotId));
|
return toAjax(redBookService.deleteQuotsByQuotId(quotId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出所选的红本产品明细数据
|
||||||
|
* @param response
|
||||||
|
* @param selectedResultData
|
||||||
|
*/
|
||||||
@PostMapping("/exportProduct")
|
@PostMapping("/exportProduct")
|
||||||
public void exportMaterial(HttpServletResponse response, @RequestParam("selectedResultData") String selectedResultData)
|
public void exportMaterial(HttpServletResponse response, @RequestParam("selectedResultData") String selectedResultData)
|
||||||
{
|
{
|
||||||
|
|
|
@ -263,11 +263,6 @@
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 表格行颜色CSS样式 */
|
|
||||||
.row-background-color {
|
|
||||||
background-color: red; /* 你想要的颜色 */
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
import {toDecimal, productList,versionList,productRemarkList,productXinghList,judgeparent,productZlList,productYsxhListCheck,productYsxhList,productJmListCheck,productJmList,searchData,handleSearchData,saveQuot, madeQuot, madeXjQuot, updateSelectedResultData} from "@/api/redBook/redBook";
|
import {toDecimal, productList,versionList,productRemarkList,productXinghList,judgeparent,productZlList,productYsxhListCheck,productYsxhList,productJmListCheck,productJmList,searchData,handleSearchData,saveQuot, madeQuot, madeXjQuot, updateSelectedResultData} from "@/api/redBook/redBook";
|
||||||
|
@ -329,6 +324,7 @@
|
||||||
searchResultCurrentPage: 1,
|
searchResultCurrentPage: 1,
|
||||||
searchResultPageSize: 10,
|
searchResultPageSize: 10,
|
||||||
searchResultData: [],
|
searchResultData: [],
|
||||||
|
errIndex: [],//保存/导出时校验数量格式,错误索引
|
||||||
|
|
||||||
/**==============已选择结果========================= */
|
/**==============已选择结果========================= */
|
||||||
selectedResultLoading: false,
|
selectedResultLoading: false,
|
||||||
|
@ -736,58 +732,66 @@
|
||||||
},
|
},
|
||||||
// 报价单保存修改
|
// 报价单保存修改
|
||||||
handleSaveClick() {
|
handleSaveClick() {
|
||||||
if(!this.isColumn1ValuesEqual){
|
let flag = this.checkSl();
|
||||||
this.$modal.msgError("存在与当前调价版本不一致的产品,请选择调价日期批量刷新");
|
if(flag){
|
||||||
return;
|
if(!this.isColumn1ValuesEqual){
|
||||||
}
|
this.$modal.msgError("存在与当前调价版本不一致的产品,请选择调价日期批量刷新");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const allPrice = this.selectedResultData.reduce((sum, row) => sum + parseFloat(row.allPrice), 0);
|
const allPrice = this.selectedResultData.reduce((sum, row) => sum + parseFloat(row.allPrice), 0);
|
||||||
this.form.totalPrice = toDecimal(allPrice);
|
this.form.totalPrice = toDecimal(allPrice);
|
||||||
this.form.selectedResultData = this.selectedResultData;
|
this.form.selectedResultData = this.selectedResultData;
|
||||||
saveQuot(this.form).then(response => {
|
saveQuot(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("保存报价单成功,单号:"+response.data.quotCode);
|
this.$modal.msgSuccess("保存报价单成功,单号:"+response.data.quotCode);
|
||||||
})
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 报价单生成
|
// 报价单生成
|
||||||
handleMadeQuotClick() {
|
handleMadeQuotClick() {
|
||||||
|
let flag = this.checkSl();
|
||||||
if(!this.isColumn1ValuesEqual){
|
if(flag){
|
||||||
this.$modal.msgError("存在与当前调价版本不一致的产品,请选择调价日期批量刷新");
|
if(!this.isColumn1ValuesEqual){
|
||||||
return;
|
this.$modal.msgError("存在与当前调价版本不一致的产品,请选择调价日期批量刷新");
|
||||||
}
|
return;
|
||||||
|
|
||||||
this.form.selectedResultData = this.selectedResultData;
|
|
||||||
madeQuot(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("生成报价单成功");
|
|
||||||
// 处理返回的文件流
|
|
||||||
const content = response;
|
|
||||||
const blob = new Blob([content]);
|
|
||||||
const fileName = "RB_BJD_"+this.getTodayCourse()+".xls";
|
|
||||||
if ("download" in document.createElement("a")) {
|
|
||||||
// 非IE下载
|
|
||||||
const elink = document.createElement("a");
|
|
||||||
elink.download = fileName;
|
|
||||||
elink.style.display = "none";
|
|
||||||
elink.href = URL.createObjectURL(blob);
|
|
||||||
document.body.appendChild(elink);
|
|
||||||
elink.click();
|
|
||||||
URL.revokeObjectURL(elink.href); // 释放URL 对象
|
|
||||||
document.body.removeChild(elink);
|
|
||||||
}else {
|
|
||||||
// IE10+下载
|
|
||||||
navigator.msSaveBlob(blob, fileName);
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
this.form.selectedResultData = this.selectedResultData;
|
||||||
|
madeQuot(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("生成报价单成功");
|
||||||
|
// 处理返回的文件流
|
||||||
|
const content = response;
|
||||||
|
const blob = new Blob([content]);
|
||||||
|
const fileName = "RB_BJD_"+this.getTodayCourse()+".xls";
|
||||||
|
if ("download" in document.createElement("a")) {
|
||||||
|
// 非IE下载
|
||||||
|
const elink = document.createElement("a");
|
||||||
|
elink.download = fileName;
|
||||||
|
elink.style.display = "none";
|
||||||
|
elink.href = URL.createObjectURL(blob);
|
||||||
|
document.body.appendChild(elink);
|
||||||
|
elink.click();
|
||||||
|
URL.revokeObjectURL(elink.href); // 释放URL 对象
|
||||||
|
document.body.removeChild(elink);
|
||||||
|
}else {
|
||||||
|
// IE10+下载
|
||||||
|
navigator.msSaveBlob(blob, fileName);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 生成询价单
|
// 生成询价单
|
||||||
handleMadeXjQuotClick() {
|
handleMadeXjQuotClick() {
|
||||||
this.madeQuotDis = true;
|
let flag = this.checkSl();
|
||||||
this.form.selectedResultData = this.selectedResultData;
|
if(flag){
|
||||||
madeXjQuot(this.form).then(response => {
|
this.madeQuotDis = true;
|
||||||
this.$modal.msgSuccess("生成询价单成功,单号:"+response.data.quotCode);
|
this.form.selectedResultData = this.selectedResultData;
|
||||||
this.madeQuotDis = false;
|
madeXjQuot(this.form).then(response => {
|
||||||
});
|
this.$modal.msgSuccess("生成询价单成功,单号:"+response.data.quotCode);
|
||||||
|
this.madeQuotDis = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 产品数据导入按钮操作 */
|
/** 产品数据导入按钮操作 */
|
||||||
|
@ -830,10 +834,13 @@
|
||||||
|
|
||||||
// 导出明细
|
// 导出明细
|
||||||
handleExport(){
|
handleExport(){
|
||||||
const fileName = "RB_BJD_"+this.getTodayCourse();
|
let flag = this.checkSl();
|
||||||
this.download('redBook/redBook/exportProduct', {
|
if(flag){
|
||||||
selectedResultData: JSON.stringify(this.selectedResultData)
|
const fileName = "RB_BJD_"+this.getTodayCourse();
|
||||||
}, fileName +".xlsx")
|
this.download('redBook/redBook/exportProduct', {
|
||||||
|
selectedResultData: JSON.stringify(this.selectedResultData)
|
||||||
|
}, fileName +".xlsx")
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//获取调价日期
|
//获取调价日期
|
||||||
|
@ -895,6 +902,30 @@
|
||||||
},
|
},
|
||||||
p(s) {
|
p(s) {
|
||||||
return s < 10 ? '0' + s : s;
|
return s < 10 ? '0' + s : s;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 校验明细行中-数量格式
|
||||||
|
checkSl(){
|
||||||
|
let flag = true;
|
||||||
|
this.errIndex = [];
|
||||||
|
const label = /^(\+)?\d+(\.\d+)?$/;
|
||||||
|
this.selectedResultData.forEach((row, index) => {
|
||||||
|
let sl = row.count;
|
||||||
|
sl = sl.trim();
|
||||||
|
let reg = new RegExp(label);
|
||||||
|
if(sl){
|
||||||
|
if (!reg.test(sl)) {
|
||||||
|
this.errIndex.push(index+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if(this.errIndex.length!=0){
|
||||||
|
flag = false;
|
||||||
|
this.$modal.msgError("第"+this.errIndex.join(",")+"行报价产品明细【数量调整】格式错误");
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue