'123'
This commit is contained in:
parent
53898cfc71
commit
5e89e079b9
|
@ -205,18 +205,35 @@ public class RedBookController extends BaseController
|
|||
* @return
|
||||
*/
|
||||
@DataSource(DataSourceType.MASTER)
|
||||
@Log(title = "报价单生成", businessType = BusinessType.OTHER)
|
||||
@PostMapping("/madeQuot")
|
||||
public void madeQuot(HttpServletResponse response, @RequestBody OAQuot quot)
|
||||
@Log(title = "保存报价单", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/saveQuot")
|
||||
public AjaxResult saveQuot(HttpServletResponse response, @RequestBody OAQuot quot)
|
||||
{
|
||||
quot.setQuot_id(UUID.fastUUID().toString());
|
||||
quot.setQuotCode(IdUtils.createNo("BJD_",2));
|
||||
quot.setCreateBy(getUsername());
|
||||
redBookService.insertOAQuot(quot);
|
||||
|
||||
List<OAQuotProduct> list = quot.getSelectedResultData();
|
||||
return success(quot);
|
||||
}
|
||||
|
||||
excelUtil.exportExcel(response, list);
|
||||
/**
|
||||
* 报价单生成
|
||||
* @param quot
|
||||
* @return
|
||||
*/
|
||||
@DataSource(DataSourceType.MASTER)
|
||||
@Log(title = "报价单生成", businessType = BusinessType.OTHER)
|
||||
@PostMapping("/madeQuot")
|
||||
public void madeQuot(HttpServletResponse response, @RequestBody OAQuot quot)
|
||||
{
|
||||
/*quot.setQuot_id(UUID.fastUUID().toString());
|
||||
quot.setQuotCode(IdUtils.createNo("BJD_",2));
|
||||
quot.setCreateBy(getUsername());
|
||||
redBookService.insertOAQuot(quot);*/
|
||||
|
||||
List<OAQuotProduct> list = quot.getSelectedResultData();
|
||||
excelUtil.exportExcel(response,quot,list);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.web.controller.redBook;
|
||||
|
||||
import com.ruoyi.redBook.domain.OAQuot;
|
||||
import com.ruoyi.redBook.domain.OAQuotProduct;
|
||||
import jxl.HeaderFooter;
|
||||
import jxl.Workbook;
|
||||
|
@ -16,25 +17,15 @@ import java.io.IOException;
|
|||
import java.io.OutputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URL;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class excelUtil {
|
||||
|
||||
public static void exportExcel(HttpServletResponse response, List<OAQuotProduct> list){
|
||||
public static void exportExcel(HttpServletResponse response, OAQuot quot, List<OAQuotProduct> list){
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
BigDecimal totalmoney = BigDecimal.ZERO;
|
||||
try {
|
||||
/*Date now = new Date();
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMddss");//
|
||||
String sNow = dateFormat.format(now);
|
||||
String fileName = "BJD_" + sNow;
|
||||
|
||||
// 生成文件名
|
||||
response.addHeader("Content-Disposition",
|
||||
"attachment; filename=\"" + fileName + ".xls" + "\"");*/
|
||||
OutputStream os = response.getOutputStream();
|
||||
WritableWorkbook wwb = Workbook.createWorkbook(os);
|
||||
|
||||
|
@ -89,8 +80,9 @@ public class excelUtil {
|
|||
wff_merge = new WritableCellFormat(wf_merge);
|
||||
wff_merge.setAlignment(Alignment.LEFT);
|
||||
wsheet.setRowView(i,380);
|
||||
String[] bjs = {"询价单位:","业务联系人:","项目名称:","联 系 电 话:","询价日期:","编 制:","报价日期:","审 核:"};
|
||||
String[] bjs = {"询价单位:"+quot.getQuotCustomer(),"业务联系人:"+quot.getQuotLxr(),"项目名称:"+quot.getQuotProject(),"联 系 电 话:"+quot.getQuotLxrdh(),"询价日期:","编 制:","报价日期:","审 核:"};
|
||||
int k=0;
|
||||
String labelValue = "";
|
||||
while(k<bjs.length){
|
||||
wsheet.mergeCells(0,i,3,i);
|
||||
label = new Label(0, i, bjs[k],wff_merge);
|
||||
|
@ -101,7 +93,6 @@ public class excelUtil {
|
|||
label = new Label(4, i, bjs[k],wff_merge);
|
||||
k++;
|
||||
wsheet.addCell(label);
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
|
|
|
@ -105,9 +105,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</insert>
|
||||
|
||||
<insert id="batchOAQuotProduct">
|
||||
insert into OAQuotProduct(quot_product_id, name_0, spec, voltage,stu,setPrice,count,allPrice,per,per2,quot_id) values
|
||||
insert into OAQuotProduct(quot_product_id, name_0, name_1, spec, voltage,stu,setPrice,count,allPrice,per,per2,quot_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.quot_product_id}, #{item.name_0}, #{item.spec}, #{item.voltage}, #{item.stu},cast(#{item.setPrice,jdbcType=DECIMAL} as decimal(18,2)), cast(#{item.count,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.allPrice,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.per,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.per2,jdbcType=DECIMAL} as decimal(18,2)), #{item.quot_id})
|
||||
( #{item.quot_product_id}, #{item.name_0}, #{item.name_1}, #{item.spec}, #{item.voltage}, #{item.stu},cast(#{item.setPrice,jdbcType=DECIMAL} as decimal(18,2)), cast(#{item.count,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.allPrice,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.per,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.per2,jdbcType=DECIMAL} as decimal(18,2)), #{item.quot_id})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
|
|
@ -100,7 +100,14 @@ export function handleSearchData(query) {
|
|||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
//保存报价单
|
||||
export function saveQuot(data) {
|
||||
return request({
|
||||
url: '/redBook/redBook/saveQuot',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
//生成报价单
|
||||
export function madeQuot(data) {
|
||||
return request({
|
||||
|
|
|
@ -99,8 +99,8 @@
|
|||
<el-form-item label="批量调折扣率" label-width="100px">
|
||||
<el-input style="width:10%" v-model="perc" size="small" @blur="changeData"></el-input>
|
||||
<el-input style="width:10%;margin-left: 5px" v-model="perc2" size="small" @blur="changeData"></el-input>
|
||||
总价:<span style="color:red">{{sumSelectedResultData}}</span>
|
||||
<el-select v-model="form.rbDate" style="width: 40%;float: right" >
|
||||
总价:<span style="color:red">{{sumSelectedResultData}} 元</span>
|
||||
<el-select v-model="form.rbDate" style="width: 50%;float: right" >
|
||||
<el-option
|
||||
v-for="item in versionList"
|
||||
:key="item.value"
|
||||
|
@ -121,7 +121,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="版本uid" align="center" prop="uid_0" v-if="false"/>
|
||||
<el-table-column fixed="left" label="产品型号" align="center" prop="name_0"/>
|
||||
<el-table-column fixed="left" label="产品型号" align="center" prop="name_0" width="180" />
|
||||
<el-table-column label="型号" align="center" prop="name_1" width="180" v-if="false"/>
|
||||
<el-table-column label="规格" align="center" prop="spec" width="180" v-if="false"/>
|
||||
<el-table-column label="电压" align="center" prop="voltage" width="80"/>
|
||||
|
@ -184,7 +184,7 @@
|
|||
}
|
||||
</style>
|
||||
<script>
|
||||
import {toDecimal, productList,versionList,productRemarkList,productXinghList,judgeparent,productZlList,productYsxhListCheck,productYsxhList,productJmListCheck,productJmList,searchData,handleSearchData, madeQuot,updateSelectedResultData} from "@/api/redBook/redBook";
|
||||
import {toDecimal, productList,versionList,productRemarkList,productXinghList,judgeparent,productZlList,productYsxhListCheck,productYsxhList,productJmListCheck,productJmList,searchData,handleSearchData,saveQuot, madeQuot,updateSelectedResultData} from "@/api/redBook/redBook";
|
||||
|
||||
export default {
|
||||
name: "productSelect",
|
||||
|
@ -622,7 +622,10 @@
|
|||
|
||||
// 报价单保存
|
||||
handleSaveClick() {
|
||||
|
||||
this.form.selectedResultData = this.selectedResultData;
|
||||
saveQuot(this.form).then(response => {
|
||||
this.$modal.msgSuccess("保存报价单成功,单号:"+response.data.quotCode);
|
||||
})
|
||||
},
|
||||
// 报价单生成
|
||||
handleMadeQuotClick() {
|
||||
|
|
Loading…
Reference in New Issue