This commit is contained in:
xd 2024-06-13 20:42:14 +08:00
parent 359e00003f
commit 031b95cec1
10 changed files with 115 additions and 17 deletions

View File

@ -1,5 +1,6 @@
package com.ruoyi.web.controller.redBook;
import com.alibaba.fastjson.JSONArray;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.CacheConstants;
@ -14,6 +15,7 @@ import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.utils.uuid.UUID;
import com.ruoyi.customer.domain.Customer;
import com.ruoyi.quot.domain.Quot;
import com.ruoyi.quot.domain.QuotMaterial;
import com.ruoyi.redBook.domain.*;
import com.ruoyi.redBook.service.IRedBookService;
@ -205,8 +207,9 @@ public class RedBookController extends BaseController
List<Product> list = new ArrayList<>();
String name_0 = product.getName_0();//型号
String model = product.getModel();//规格
if(!StringUtils.isEmpty(name_0) || !StringUtils.isEmpty(model) ){
if(!StringUtils.isEmpty(name_0)){
if(!StringUtils.isBlank(name_0) || !StringUtils.isBlank(model) ){
if(!StringUtils.isBlank(name_0)){
name_0 = name_0.replace(" ","");
name_0 = name_0.toUpperCase();
}
list = redBookService.handleSearchData(name_0,model);
@ -226,7 +229,9 @@ public class RedBookController extends BaseController
{
if(StringUtils.isEmpty(quot.getQuot_id())){
quot.setQuot_id(UUID.fastUUID().toString());
quot.setQuotCode(IdUtils.createNo("BJD_",0));
//quot.setQuotCode(IdUtils.createNo("BJD_",0));
String quotCode = redBookService.getCode("RB_BJD");
quot.setQuotCode(quotCode);
quot.setCreateBy(getUsername());
redBookService.insertOAQuot(quot);
}else{
@ -303,6 +308,22 @@ public class RedBookController extends BaseController
for(OAQuotProductTemplate temp:tempList){
temp.setIndex(index);
temp.setRbUid(rbUid);
String name_1 = temp.getName_1();
if(StringUtils.isNotBlank(name_1)){
name_1 = name_1.replace(" ","");
name_1 = name_1.toUpperCase();
temp.setName_1(name_1);
}
String spec = temp.getSpec();
if(StringUtils.isNotBlank(spec)){
spec = spec.replace(" ","");
temp.setSpec(spec);
}
String voltage = temp.getVoltage();
temp.setVoltage(StringUtils.isBlank(voltage)?"0.6/1kV":voltage.replace(" ",""));
index++;
}
@ -454,4 +475,13 @@ public class RedBookController extends BaseController
}
return toAjax(redBookService.deleteQuotsByQuotId(quotId));
}
@PostMapping("/exportProduct")
public void exportMaterial(HttpServletResponse response, @RequestParam("selectedResultData") String selectedResultData)
{
List<OAQuotProduct> list = JSONArray.parseArray(selectedResultData, OAQuotProduct.class);
ExcelUtil<OAQuotProduct> util = new ExcelUtil<OAQuotProduct>(OAQuotProduct.class);
util.exportExcel(response, list, "报价明细数据");
}
}

View File

@ -1,17 +1,24 @@
package com.ruoyi.redBook.domain;
import com.ruoyi.common.annotation.Excel;
import java.math.BigDecimal;
public class OAQuotProduct implements Comparable<OAQuotProduct>{
private Integer index;//序号
private String uid_0;//版本uid
private String name_0;//产品型号
@Excel(name = "型号")
private String name_1;//型号
@Excel(name = "规格")
private String spec;//规格
@Excel(name = "电压")
private String voltage;//电压
@Excel(name = "单位")
private String stu;//单位
private String price;//红本价
private BigDecimal setPrice;//单价
@Excel(name = "数量")
private BigDecimal count;//数量
private BigDecimal allPrice;//金额
private String quot_product_id;//id

View File

@ -15,6 +15,9 @@ public class OAQuotProductTemplate {
@Excel(name = "规格")
private String spec;//规格
@Excel(name = "电压")
private String voltage;//电压
@Excel(name = "数量")
private BigDecimal count;//数量
@ -42,6 +45,10 @@ public class OAQuotProductTemplate {
this.spec = spec;
}
public String getVoltage() {return voltage;}
public void setVoltage(String voltage) {this.voltage = voltage;}
public BigDecimal getCount() {
return count;
}

View File

@ -123,7 +123,7 @@ public interface OARedBookMapper
* @param rbUid
* @return
*/
OAQuotProduct getFixDatePrice2(@Param("name_1") String name_1, @Param("spec") String spec, @Param("uid_0") String rbUid);
OAQuotProduct getFixDatePrice2(@Param("name_1") String name_1, @Param("spec") String spec, @Param("voltage") String voltage, @Param("uid_0") String rbUid);
/**
* 查询已生成的报价单列表
@ -153,4 +153,10 @@ public interface OARedBookMapper
*/
String rb_price_version();
/**
* 获取单据编号
* @param type
* @return
*/
String getCode(String type);
}

View File

@ -147,4 +147,10 @@ public interface IRedBookService
*/
List<OAQuotProduct> setRedBookPrice2(List<OAQuotProductTemplate> list);
/**
* 获取单据编号
* @param type
* @return
*/
String getCode(String type);
}

View File

@ -223,7 +223,7 @@ public class RedBookServiceImpl implements IRedBookService
List<OAQuotProduct> OAQuotProducts = new ArrayList<>();
OAQuotProduct oAQuotProduct = new OAQuotProduct();
for(OAQuotProductTemplate oAQuotProductTemplate : list){
OAQuotProduct rbProduct = oaRedBookMapper.getFixDatePrice2(oAQuotProductTemplate.getName_1(),oAQuotProductTemplate.getSpec(),oAQuotProductTemplate.getRbUid());
OAQuotProduct rbProduct = oaRedBookMapper.getFixDatePrice2(oAQuotProductTemplate.getName_1(),oAQuotProductTemplate.getSpec(),oAQuotProductTemplate.getVoltage(),oAQuotProductTemplate.getRbUid());
if(rbProduct!=null){
oAQuotProduct = new OAQuotProduct();
oAQuotProduct.setIndex(oAQuotProductTemplate.getIndex());
@ -241,6 +241,16 @@ public class RedBookServiceImpl implements IRedBookService
return OAQuotProducts;
}
/**
* 获取单据编号
* @param type
* @return
*/
@Override
public String getCode(String type) {
return oaRedBookMapper.getCode(type);
}
/**
* 查询已生成的报价单列表

View File

@ -178,7 +178,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
convert(decimal,convert(float,A.红本价格)) price,convert(varchar(10),B.date_0,23) pricedate
from [rb_product_price] A
left join rb_productVersion B on A.version_uid_0=B.uid_0
where A.型号 = #{name_1} and A.规格 = #{spec}
where A.型号 = #{name_1} and A.规格 = #{spec} and A.电压等级 = #{voltage}
and B.uid_0 = #{uid_0}
and (B.sta_0=1 or sta_0=0)
</select>
@ -209,7 +209,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
order by a.update_time desc
order by a.quotCode desc
</select>
<resultMap type="OAQuot" id="QuotResult">
@ -270,4 +270,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)a order by date_0 desc
</select>
<select id="getCode" resultType="String" statementType="CALLABLE">
{call GetSerialNo(#{type,mode=IN,jdbcType=VARCHAR})}
</select>
</mapper>

View File

@ -318,8 +318,8 @@
</el-row>
<el-row :gutter="8" v-if="this.form.quotApprovalStatus != '0' && this.form.quotApprovalStatus != null">
<el-col :span="6" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])">
<el-form-item label="总数量" prop="quotQuantity">
<el-input v-model="form.quotQuantity" :disabled="form.quotApprovalStatus == '2' || form.quotApprovalStatus == '3'"/>
<el-form-item label="明细条数" prop="quotMaterialsCount">
<el-input v-model="form.quotMaterialsCount" :disabled="form.quotApprovalStatus == '2' || form.quotApprovalStatus == '3'"/>
</el-form-item>
</el-col>
<el-col :span="6" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])">
@ -347,8 +347,8 @@
</el-row>
<el-row :gutter="8">
<el-col :span="6" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])">
<el-form-item label="明细条数" prop="quotMaterialsCount">
<el-input v-model="form.quotMaterialsCount" :disabled="true"/>
<el-form-item label="总数量" prop="quotQuantity">
<el-input v-model="form.quotQuantity" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="6" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])">
@ -425,7 +425,7 @@
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteQuotMaterial" v-if="this.form.quotApprovalStatus == '0' || this.form.quotApprovalStatus == null">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport" v-if="this.form.quotApprovalStatus == '0' || this.form.quotApprovalStatus == null">导入</el-button>
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport" v-if="(this.form.quotApprovalStatus == '0' || this.form.quotApprovalStatus == null) || checkRole(['QUOT','PRICE_VERIFICATION'])">导入</el-button>
</el-col>
<el-col :span="1.5" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])">
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleExportMaterial">导出</el-button>
@ -1126,6 +1126,12 @@ export default {
quotQuotationRequire: [
{ required: true, message: "报价要求不能为空", trigger: "blur" }
],
quotMaterialsCount: [
{ required: true, message: "明细条数不能为空", trigger: "blur" }
],
quotTotalPrice: [
{ required: true, message: "总价不能为空", trigger: "blur" }
],
},
//-
@ -1454,6 +1460,13 @@ export default {
/** 报价组报价单提交反馈按钮 */
feedbackQuotForm() {
const quotTotalPrice = this.form.quotTotalPrice;
const quotMaterialsCount = this.form.quotMaterialsCount;
if(!quotTotalPrice || !quotMaterialsCount ){
this.$modal.msgError("明细条数或总价未填");
return;
}
const quotFkFileNum = this.quotFkFileList.length;
if(quotFkFileNum==0){
this.$modal.msgError("反馈附件必须上传");

View File

@ -759,7 +759,7 @@
//
const content = response;
const blob = new Blob([content]);
const fileName = "BJD_"+this.getTodayCourse()+".xls";
const fileName = "RB_BJD_"+this.getTodayCourse()+".xls";
if ("download" in document.createElement("a")) {
// IE
const elink = document.createElement("a");
@ -817,7 +817,10 @@
//
handleExport(){
this.$modal.msgWarning("功能还未开放");
const fileName = "RB_BJD_"+this.getTodayCourse();
this.download('redBook/redBook/exportProduct', {
selectedResultData: JSON.stringify(this.selectedResultData)
}, fileName +".xlsx")
},
//

View File

@ -119,8 +119,8 @@
</el-form-item>
</el-col>
</el-row>
<el-table v-loading="selectedResultLoading" width="100%;" :row-class-name="selectedResultIndex" :data="selectedResultData">
<el-button size="mini" type="info" plain icon="el-icon-upload2" @click="handleExport">导出</el-button>
<el-table v-loading="selectedResultLoading" width="100%;" :row-class-name="selectedResultIndex" :data="selectedResultData" style="margin-top: 10px">
<el-table-column fixed="left" label="" align="center" prop="index" width="50"/>
<el-table-column label="版本uid" align="center" prop="uid_0" v-if="false"/>
<el-table-column fixed="left" label="产品型号" align="center" prop="name_0" width="180"/>
@ -433,7 +433,7 @@
const content = response;
const blob = new Blob([content]);
let fileName = "BJD_"+this.getTodayCourse()+".xls";
let fileName = "RB_BJD_"+this.getTodayCourse()+".xls";
if(this.form.quotCode){
fileName = this.form.quotCode+".xls";
}
@ -454,6 +454,18 @@
}
});
},
//
handleExport(){
let fileName = "RB_BJD_"+this.getTodayCourse();
if(this.form.quotCode){
fileName = this.form.quotCode;
}
this.download('redBook/redBook/exportProduct', {
selectedResultData: JSON.stringify(this.selectedResultData)
}, fileName +".xlsx")
},
//
getTodayCourse(){
const myDate = new Date();