'123'
This commit is contained in:
parent
fde4edce8e
commit
0f52340a3d
|
@ -212,11 +212,15 @@ public class RedBookController extends BaseController
|
||||||
@PostMapping("/saveQuot")
|
@PostMapping("/saveQuot")
|
||||||
public AjaxResult saveQuot(HttpServletResponse response, @RequestBody OAQuot quot)
|
public AjaxResult saveQuot(HttpServletResponse response, @RequestBody OAQuot quot)
|
||||||
{
|
{
|
||||||
quot.setQuot_id(UUID.fastUUID().toString());
|
if(StringUtils.isEmpty(quot.getQuot_id())){
|
||||||
quot.setQuotCode(IdUtils.createNo("BJD_",2));
|
quot.setQuot_id(UUID.fastUUID().toString());
|
||||||
quot.setCreateBy(getUsername());
|
quot.setQuotCode(IdUtils.createNo("BJD_",2));
|
||||||
redBookService.insertOAQuot(quot);
|
quot.setCreateBy(getUsername());
|
||||||
|
redBookService.insertOAQuot(quot);
|
||||||
|
}else{
|
||||||
|
quot.setUpdateBy(getUsername());
|
||||||
|
redBookService.updateOAQuot(quot);
|
||||||
|
}
|
||||||
return success(quot);
|
return success(quot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,12 @@ public interface OARedBookMapper
|
||||||
*/
|
*/
|
||||||
void insertOAQuot(OAQuot quot);
|
void insertOAQuot(OAQuot quot);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改报价单
|
||||||
|
* @param quot
|
||||||
|
*/
|
||||||
|
void updateOAQuot(OAQuot quot);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增报价单产品信息
|
* 新增报价单产品信息
|
||||||
* @param list
|
* @param list
|
||||||
|
@ -129,4 +135,5 @@ public interface OARedBookMapper
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String rb_price_version();
|
String rb_price_version();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,6 +82,12 @@ public interface IRedBookService
|
||||||
*/
|
*/
|
||||||
void insertOAQuot(OAQuot quot);
|
void insertOAQuot(OAQuot quot);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改报价单
|
||||||
|
* @param quot
|
||||||
|
*/
|
||||||
|
void updateOAQuot(OAQuot quot);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取调价日期
|
* 获取调价日期
|
||||||
* @return
|
* @return
|
||||||
|
@ -121,4 +127,5 @@ public interface IRedBookService
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String rb_price_version();
|
String rb_price_version();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,6 +125,18 @@ public class RedBookServiceImpl implements IRedBookService
|
||||||
insertOAQuotProduct(quot);
|
insertOAQuotProduct(quot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改报价单
|
||||||
|
* @param quot
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void updateOAQuot(OAQuot quot) {
|
||||||
|
quot.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
oaRedBookMapper.updateOAQuot(quot);
|
||||||
|
oaRedBookMapper.deleteQuotProductsByCusId(quot.getQuot_id());
|
||||||
|
insertOAQuotProduct(quot);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增报价单产品信息
|
* 新增报价单产品信息
|
||||||
* @param quot
|
* @param quot
|
||||||
|
|
|
@ -62,7 +62,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
from [rb_product_price] A
|
from [rb_product_price] A
|
||||||
left join rb_productVersion B on A.version_uid_0=B.uid_0
|
left join rb_productVersion B on A.version_uid_0=B.uid_0
|
||||||
where B.sta_0=1 and A.type_uid_0 = #{uid_0}
|
where B.sta_0=1 and A.type_uid_0 = #{uid_0}
|
||||||
and A.截面 = #{section} and A.型号 = #{name_0} order by A.order_0
|
<if test="section != null and section != ''">
|
||||||
|
and A.截面 = #{section}
|
||||||
|
</if>
|
||||||
|
and A.型号 = #{name_0} order by A.order_0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="handleSearchData" resultType="Product" parameterType="String">
|
<select id="handleSearchData" resultType="Product" parameterType="String">
|
||||||
|
@ -108,6 +111,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateOAQuot" parameterType="OAQuot">
|
||||||
|
update OAQuot
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="quotCode != null">quotCode = #{quotCode},</if>
|
||||||
|
<if test="quotCustomer != null and quotCustomer != ''">quotCustomer = #{quotCustomer},</if>
|
||||||
|
<if test="quotProject != null and quotProject != ''">quotProject = #{quotProject},</if>
|
||||||
|
<if test="quotLxr != null and quotLxr != ''">quotLxr = #{quotLxr},</if>
|
||||||
|
<if test="quotLxrdh != null and quotLxrdh != ''">quotLxrdh = #{quotLxrdh},</if>
|
||||||
|
<if test="totalPrice != null and totalPrice != ''">totalPrice = #{totalPrice},</if>
|
||||||
|
<if test="rbDateUid != null and rbDateUid != ''">rbDateUid = #{rbDateUid},</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||||
|
update_time = getdate()
|
||||||
|
</trim>
|
||||||
|
where quot_id = #{quot_id}
|
||||||
|
</update>
|
||||||
|
|
||||||
<insert id="batchOAQuotProduct">
|
<insert id="batchOAQuotProduct">
|
||||||
insert into OAQuotProduct(quot_product_id, name_0, name_1, spec, voltage,stu,price,setPrice,count,allPrice,per,per2,quot_id) values
|
insert into OAQuotProduct(quot_product_id, name_0, name_1, spec, voltage,stu,price,setPrice,count,allPrice,per,per2,quot_id) values
|
||||||
<foreach item="item" index="index" collection="list" separator=",">
|
<foreach item="item" index="index" collection="list" separator=",">
|
||||||
|
@ -157,6 +176,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<!-- 数据范围过滤 -->
|
<!-- 数据范围过滤 -->
|
||||||
${params.dataScope}
|
${params.dataScope}
|
||||||
</where>
|
</where>
|
||||||
|
order by a.update_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<resultMap type="OAQuot" id="QuotResult">
|
<resultMap type="OAQuot" id="QuotResult">
|
||||||
|
|
|
@ -18,7 +18,7 @@ const service = axios.create({
|
||||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||||
baseURL: process.env.VUE_APP_BASE_API,
|
baseURL: process.env.VUE_APP_BASE_API,
|
||||||
// 超时
|
// 超时
|
||||||
timeout: 10000
|
timeout: 60000
|
||||||
})
|
})
|
||||||
|
|
||||||
// request拦截器
|
// request拦截器
|
||||||
|
|
|
@ -84,16 +84,21 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="8">
|
<el-row :gutter="8">
|
||||||
<el-col :span="12">
|
<el-col :span="8">
|
||||||
<el-form-item label="联系人" prop="quotLxr">
|
<el-form-item label="联系人" prop="quotLxr">
|
||||||
<el-input v-model="form.quotLxr" placeholder="请输入业务联系人" />
|
<el-input v-model="form.quotLxr" placeholder="请输入联系人" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="8">
|
||||||
<el-form-item label="联系电话" prop="quotLxrdh">
|
<el-form-item label="联系电话" prop="quotLxrdh">
|
||||||
<el-input v-model="form.quotLxrdh" placeholder="请输入联系电话"/>
|
<el-input v-model="form.quotLxrdh" placeholder="请输入联系电话"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="总价">
|
||||||
|
<el-input class="totalPrice-input" v-model="sumSelectedResultData"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="8">
|
<el-row :gutter="8">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
|
@ -103,8 +108,8 @@
|
||||||
<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"></el-input>
|
<el-input style="width:65px" v-model="perc" size="small" @blur="changeData"></el-input>
|
||||||
<el-input style="width:65px;margin-left: 5px" v-model="perc2" size="small" @blur="changeData"></el-input>
|
<el-input style="width:65px;margin-left: 5px" v-model="perc2" size="small" @blur="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: 20px" :disabled="selectedResultData.length==0">
|
<el-select v-model="form.rbDateUid" style="width: 235px;float: right" :disabled="selectedResultData.length==0">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in versionList"
|
v-for="item in versionList"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
|
@ -185,6 +190,11 @@
|
||||||
-webkit-line-clamp: 2;
|
-webkit-line-clamp: 2;
|
||||||
/* 控制显示的行数 */
|
/* 控制显示的行数 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*总价输入框设置*/
|
||||||
|
.totalPrice-input .el-input__inner {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
import {toDecimal, productList,versionList,productRemarkList,productXinghList,judgeparent,productZlList,productYsxhListCheck,productYsxhList,productJmListCheck,productJmList,searchData,handleSearchData,saveQuot, 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";
|
||||||
|
@ -277,8 +287,7 @@
|
||||||
this.tableHeight = (window.innerHeight - 380) + 'px';
|
this.tableHeight = (window.innerHeight - 380) + 'px';
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//备注内容设置 展开 || 收起文本
|
||||||
// //备注内容设置 展开 || 收起文本
|
|
||||||
toggleText(id) {
|
toggleText(id) {
|
||||||
if (this.expandedIndex === id) {
|
if (this.expandedIndex === id) {
|
||||||
this.expandedIndex = -1;
|
this.expandedIndex = -1;
|
||||||
|
@ -312,7 +321,6 @@
|
||||||
this.searchResultData = [],
|
this.searchResultData = [],
|
||||||
|
|
||||||
this.selectedModelTag = item.name_0;
|
this.selectedModelTag = item.name_0;
|
||||||
console.log(this.selectedModelTag)
|
|
||||||
//显示备注信息
|
//显示备注信息
|
||||||
this.productRemarkList(item.uid_0)
|
this.productRemarkList(item.uid_0)
|
||||||
//显示型号
|
//显示型号
|
||||||
|
@ -321,7 +329,6 @@
|
||||||
//获取目录
|
//获取目录
|
||||||
productList() {
|
productList() {
|
||||||
productList().then(response => {
|
productList().then(response => {
|
||||||
console.log(response)
|
|
||||||
this.modelList = response;
|
this.modelList = response;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -359,8 +366,8 @@
|
||||||
this.searchResultPageSize = 10,
|
this.searchResultPageSize = 10,
|
||||||
this.searchResultData = [],
|
this.searchResultData = [],
|
||||||
|
|
||||||
|
this.selectedXinghUid = item.uid_0
|
||||||
this.selectedXinghTag = item.name_0;
|
this.selectedXinghTag = item.name_0;
|
||||||
console.log(this.selectedXinghTag)
|
|
||||||
//判断是否为父节点,如果有说明下面还有子类显示,如果没有则直接显示衍生型号
|
//判断是否为父节点,如果有说明下面还有子类显示,如果没有则直接显示衍生型号
|
||||||
this.judgeparent(item)
|
this.judgeparent(item)
|
||||||
},
|
},
|
||||||
|
@ -421,7 +428,6 @@
|
||||||
this.searchResultData = [],
|
this.searchResultData = [],
|
||||||
|
|
||||||
this.selectedZlTag = item.name_0;
|
this.selectedZlTag = item.name_0;
|
||||||
console.log(this.selectedZlTag)
|
|
||||||
|
|
||||||
this.productYsxhListCheck(item.uid_0, item.name_0)
|
this.productYsxhListCheck(item.uid_0, item.name_0)
|
||||||
},
|
},
|
||||||
|
@ -438,7 +444,6 @@
|
||||||
this.searchResultData = [],
|
this.searchResultData = [],
|
||||||
|
|
||||||
this.selectedYsxhTag = item.name_0;
|
this.selectedYsxhTag = item.name_0;
|
||||||
console.log(this.selectedYsxhTag)
|
|
||||||
this.productJmListCheck(item.uid_0, item.name_0)
|
this.productJmListCheck(item.uid_0, item.name_0)
|
||||||
},
|
},
|
||||||
//判断是否存在截面
|
//判断是否存在截面
|
||||||
|
@ -448,9 +453,8 @@
|
||||||
if (response) {//存在截面
|
if (response) {//存在截面
|
||||||
this.productJmList(sid, name)
|
this.productJmList(sid, name)
|
||||||
} else {
|
} else {
|
||||||
//输出结果
|
this.selectedYsxhTag = this.selectedXinghTag;
|
||||||
console.log("结果表格输出")
|
this.searchData(this.selectedXinghUid)
|
||||||
//TODO 直接输出结果表格
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -465,8 +469,6 @@
|
||||||
//截面选择
|
//截面选择
|
||||||
selJmTag(item) {
|
selJmTag(item) {
|
||||||
this.selectedJmTag = item.section;
|
this.selectedJmTag = item.section;
|
||||||
console.log(this.selectedYsxhTag)
|
|
||||||
console.log(this.selectedYsxhUid)
|
|
||||||
|
|
||||||
this.searchResultCurrentPage = 1,
|
this.searchResultCurrentPage = 1,
|
||||||
this.searchResultPageSize = 10,
|
this.searchResultPageSize = 10,
|
||||||
|
@ -480,7 +482,6 @@
|
||||||
searchData(sid, section) {
|
searchData(sid, section) {
|
||||||
this.params = {uid_0: sid, section: section, name_0: this.selectedYsxhTag}
|
this.params = {uid_0: sid, section: section, name_0: this.selectedYsxhTag}
|
||||||
searchData(this.params).then(response => {
|
searchData(this.params).then(response => {
|
||||||
console.log(response)
|
|
||||||
this.searchResultData = response;
|
this.searchResultData = response;
|
||||||
this.searchResultTotal = this.searchResultData.length;
|
this.searchResultTotal = this.searchResultData.length;
|
||||||
this.searchResultCurrentPage = 1;
|
this.searchResultCurrentPage = 1;
|
||||||
|
@ -565,11 +566,9 @@
|
||||||
this.searchResultCurrentPage = 1,
|
this.searchResultCurrentPage = 1,
|
||||||
this.searchResultPageSize = 10,
|
this.searchResultPageSize = 10,
|
||||||
this.searchResultData = [],
|
this.searchResultData = [],
|
||||||
console.log(this.queryParams)
|
|
||||||
|
|
||||||
this.searchResultLoading = true;
|
this.searchResultLoading = true;
|
||||||
handleSearchData(this.queryParams).then(response => {
|
handleSearchData(this.queryParams).then(response => {
|
||||||
console.log(response)
|
|
||||||
this.searchResultData = response;
|
this.searchResultData = response;
|
||||||
this.searchResultTotal = this.searchResultData.length;
|
this.searchResultTotal = this.searchResultData.length;
|
||||||
this.searchResultCurrentPage = 1;
|
this.searchResultCurrentPage = 1;
|
||||||
|
@ -623,7 +622,7 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 报价单保存
|
// 报价单保存修改
|
||||||
handleSaveClick() {
|
handleSaveClick() {
|
||||||
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 = allPrice.toFixed(2);
|
this.form.totalPrice = allPrice.toFixed(2);
|
||||||
|
@ -713,7 +712,7 @@
|
||||||
},
|
},
|
||||||
p(s) {
|
p(s) {
|
||||||
return s < 10 ? '0' + s : s;
|
return s < 10 ? '0' + s : s;
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
updated(){
|
updated(){
|
||||||
|
@ -724,7 +723,6 @@
|
||||||
computed: {
|
computed: {
|
||||||
// 计算出当前页的查询结果数据列表
|
// 计算出当前页的查询结果数据列表
|
||||||
searchResultPagedData() {
|
searchResultPagedData() {
|
||||||
console.log(this.searchResultData)
|
|
||||||
const startIndex = (this.searchResultCurrentPage - 1) * this.searchResultPageSize;
|
const startIndex = (this.searchResultCurrentPage - 1) * this.searchResultPageSize;
|
||||||
const endIndex = startIndex + this.searchResultPageSize;
|
const endIndex = startIndex + this.searchResultPageSize;
|
||||||
return this.searchResultData.slice(startIndex, endIndex);
|
return this.searchResultData.slice(startIndex, endIndex);
|
||||||
|
|
|
@ -34,9 +34,10 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="报价客户" width="200" align="center" prop="quotCustomer" />
|
<el-table-column label="报价客户" width="200" align="center" prop="quotCustomer" />
|
||||||
<el-table-column label="报价项目" width="200" align="center" prop="quotProject" />
|
<el-table-column label="报价项目" width="200" align="center" prop="quotProject" />
|
||||||
<el-table-column label="联系人"align="center" prop="quotLxr" />
|
<el-table-column label="总价" width="100" align="center" prop="totalPrice" />
|
||||||
<el-table-column label="联系人电话"align="center" prop="quotLxrdh" />
|
<el-table-column label="联系人" width="100" align="center" prop="quotLxr" />
|
||||||
<el-table-column label="创建日期" width="200" align="center" prop="createTime" />
|
<el-table-column label="联系人电话" width="150" align="center" prop="quotLxrdh" />
|
||||||
|
<el-table-column label="创建日期" width="180" align="center" prop="createTime" />
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- 报价详情对话框 -->
|
<!-- 报价详情对话框 -->
|
||||||
|
@ -45,46 +46,56 @@
|
||||||
<el-row :gutter="8">
|
<el-row :gutter="8">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="询价单位" prop="quotCustomer">
|
<el-form-item label="询价单位" prop="quotCustomer">
|
||||||
<el-input v-model="form.quotCustomer" :disabled="true"/>
|
<el-input v-model="form.quotCustomer"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="项目名称" prop="quotProject">
|
<el-form-item label="项目名称" prop="quotProject">
|
||||||
<el-input v-model="form.quotProject" :disabled="true"/>
|
<el-input v-model="form.quotProject"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="8">
|
<el-row :gutter="8">
|
||||||
<el-col :span="12">
|
<el-col :span="8">
|
||||||
<el-form-item label="联系人" prop="quotLxr">
|
<el-form-item label="联系人" prop="quotLxr">
|
||||||
<el-input v-model="form.quotLxr" :disabled="true"/>
|
<el-input v-model="form.quotLxr"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="8">
|
||||||
<el-form-item label="联系电话" prop="quotLxrdh">
|
<el-form-item label="联系电话" prop="quotLxrdh">
|
||||||
<el-input v-model="form.quotLxrdh" :disabled="true"/>
|
<el-input v-model="form.quotLxrdh"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="总价">
|
||||||
|
<el-input class="totalPrice-input" v-model="sumSelectedResultData"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="8">
|
<el-row :gutter="8">
|
||||||
<el-col :span="12">
|
<el-col :span="24">
|
||||||
<el-form-item>
|
<el-form-item label="总金额" prop="totalPrice" v-if="false">
|
||||||
总价:<span style="color:red;font-size: 20px">{{sumSelectedResultData}} 元</span>
|
<el-input v-model="form.totalPrice"/>
|
||||||
<el-select v-model="form.rbDateUid" style="width: 60%;float: right" :disabled="true">
|
</el-form-item>
|
||||||
|
<el-form-item label="设置折扣率" label-width="100px">
|
||||||
|
<el-input style="width:65px" v-model="perc" size="small" @blur="changeData"></el-input>
|
||||||
|
<el-input style="width:65px;margin-left: 5px" v-model="perc2" size="small" @blur="changeData"></el-input>
|
||||||
|
<!--总价:<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-option
|
<el-option
|
||||||
v-for="item in versionList"
|
v-for="item in versionList"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
@click.native="selectRbDate(item.value)"
|
@click.native="selectRbDate(item.value)"/>
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
|
<el-button style="float: right;margin-left: 5px;" size="small" type="success" icon="el-icon-document" @click="handleMadeQuotClick" :disabled="selectedResultData.length==0">生成报价单</el-button>
|
||||||
|
<el-button style="float: right;" size="small" type="warning" icon="el-icon-folder" @click="handleSaveClick" :disabled="selectedResultData.length==0">保存</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table width="100%;" :row-class-name="selectedResultIndex" :data="selectedResultData" height="400px">
|
<el-table v-loading="selectedResultLoading" width="100%;" :row-class-name="selectedResultIndex" :data="selectedResultData" height="350px">
|
||||||
<el-table-column fixed="left" label="" align="center" prop="index" width="50"/>
|
<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 label="版本uid" align="center" prop="uid_0" v-if="false"/>
|
||||||
<el-table-column fixed="left" label="产品型号" align="center" prop="name_0" width="180" />
|
<el-table-column fixed="left" label="产品型号" align="center" prop="name_0" width="180" />
|
||||||
|
@ -93,10 +104,22 @@
|
||||||
<el-table-column label="电压" align="center" prop="voltage"/>
|
<el-table-column label="电压" align="center" prop="voltage"/>
|
||||||
<el-table-column label="红本价(元)" align="center" prop="price"/>
|
<el-table-column label="红本价(元)" align="center" prop="price"/>
|
||||||
<el-table-column label="单位" align="center" prop="stu"/>
|
<el-table-column label="单位" align="center" prop="stu"/>
|
||||||
<el-table-column label="一次折扣" align="center" prop="per"/>
|
<el-table-column label="一次折扣" align="center" prop="per">
|
||||||
<el-table-column label="二次折扣" align="center" prop="per2"/>
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.per" @blur="changeRowData"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="二次折扣" align="center" prop="per2">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.per2" @blur="changeRowData"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="单价" align="center" prop="setPrice"/>
|
<el-table-column label="单价" align="center" prop="setPrice"/>
|
||||||
<el-table-column label="数量调整" align="center" prop="count"/>
|
<el-table-column label="数量调整" align="center" prop="count">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.count" @blur="changeRowData"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="总价" align="center" prop="allPrice"/>
|
<el-table-column label="总价" align="center" prop="allPrice"/>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
@ -110,9 +133,13 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<style>
|
||||||
|
.totalPrice-input .el-input__inner {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script>
|
<script>
|
||||||
import { versionList,listQuots,getQuotDetail,deleteQuots } from "@/api/redBook/redBook";
|
import {toDecimal, versionList,listQuots,getQuotDetail,deleteQuots,updateSelectedResultData,madeQuot,saveQuot } from "@/api/redBook/redBook";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "quots",
|
name: "quots",
|
||||||
|
@ -143,7 +170,12 @@
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
// 列表数据
|
// 列表数据
|
||||||
selectedResultData: []
|
selectedResultData: [],
|
||||||
|
|
||||||
|
//折扣率 初始值
|
||||||
|
perc: 0.8,
|
||||||
|
perc2: '',
|
||||||
|
selectedResultLoading: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -204,6 +236,135 @@
|
||||||
this.getList();
|
this.getList();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//一次折扣率变化时触发
|
||||||
|
changeData() {
|
||||||
|
// 校验折扣率格式
|
||||||
|
const pattern = /^\d+(\.\d+)?$/;
|
||||||
|
if(this.perc) {
|
||||||
|
if (!pattern.test(this.perc)) {
|
||||||
|
this.$message.warning("折扣率格式错误!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(this.perc2) {
|
||||||
|
if (!pattern.test(this.perc2)) {
|
||||||
|
this.$message.warning("折扣率格式错误!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 遍历表格数据进行计算
|
||||||
|
this.selectedResultData.forEach((row, index) => {
|
||||||
|
// 进行其他计算
|
||||||
|
this.$set(this.selectedResultData, index, {
|
||||||
|
...row,
|
||||||
|
per: this.perc,
|
||||||
|
per2: this.perc2,
|
||||||
|
setPrice: toDecimal(row.price * (this.perc?this.perc:1) * (this.perc2?this.perc2:1)),
|
||||||
|
allPrice: toDecimal(row.count * row.price * (this.perc?this.perc:1) * (this.perc2?this.perc2:1)),
|
||||||
|
});
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 行内数据监听
|
||||||
|
changeRowData() {
|
||||||
|
// 遍历表格数据进行计算
|
||||||
|
this.selectedResultData.forEach((row, index) => {
|
||||||
|
// 进行其他计算
|
||||||
|
this.$set(this.selectedResultData, index, {
|
||||||
|
...row,
|
||||||
|
setPrice: toDecimal(row.price * (row.per?row.per:1) * (row.per2?row.per2:1)),
|
||||||
|
allPrice: toDecimal(row.count * row.price * (row.per?row.per:1) * (row.per2?row.per2:1)),
|
||||||
|
});
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//选择调价日期
|
||||||
|
selectRbDate(uid){
|
||||||
|
this.selectedResultData.forEach((row, index) => {
|
||||||
|
this.$set(this.selectedResultData, index, {
|
||||||
|
...row,
|
||||||
|
uid_0: uid // 重新设置为所选版本uid
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.selectedResultLoading = true;
|
||||||
|
//更新已选结果数据-单价、金额
|
||||||
|
updateSelectedResultData(this.selectedResultData).then(response => {
|
||||||
|
for (let i = 0; i < this.selectedResultData.length; i++) {
|
||||||
|
for (let j = 0; j < response.data.length; j++) {
|
||||||
|
// 检查型号、规格、电压等级是否相等
|
||||||
|
if (
|
||||||
|
this.selectedResultData[i].name_0 === response.data[j].name_0 &&
|
||||||
|
this.selectedResultData[i].spec === response.data[j].spec &&
|
||||||
|
this.selectedResultData[i].voltage === response.data[j].voltage
|
||||||
|
) {
|
||||||
|
this.selectedResultData[i].price = response.data[j].setPrice;
|
||||||
|
const setPrice = toDecimal(this.selectedResultData[i].price * (this.selectedResultData[i].per?this.selectedResultData[i].per:1) * (this.selectedResultData[i].per2?this.selectedResultData[i].per2:1));
|
||||||
|
const allPrice = toDecimal(this.selectedResultData[i].count * this.selectedResultData[i].price * (this.selectedResultData[i].per?this.selectedResultData[i].per:1) * (this.selectedResultData[i].per2?this.selectedResultData[i].per2:1));
|
||||||
|
|
||||||
|
this.selectedResultData[i].setPrice = setPrice;
|
||||||
|
this.selectedResultData[i].allPrice = allPrice;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.selectedResultLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 报价单保存修改
|
||||||
|
handleSaveClick() {
|
||||||
|
const allPrice = this.selectedResultData.reduce((sum, row) => sum + parseFloat(row.allPrice), 0);
|
||||||
|
this.form.totalPrice = allPrice.toFixed(2);
|
||||||
|
this.form.selectedResultData = this.selectedResultData;
|
||||||
|
saveQuot(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改报价单成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 报价单生成
|
||||||
|
handleMadeQuotClick() {
|
||||||
|
this.form.selectedResultData = this.selectedResultData;
|
||||||
|
madeQuot(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("生成报价单成功");
|
||||||
|
// 处理返回的文件流
|
||||||
|
const content = response;
|
||||||
|
const blob = new Blob([content]);
|
||||||
|
const fileName = "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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取当前时间
|
||||||
|
getTodayCourse(){
|
||||||
|
const myDate = new Date();
|
||||||
|
//获取当前年
|
||||||
|
const year = myDate.getFullYear();
|
||||||
|
//获取当前月
|
||||||
|
const month = myDate.getMonth() + 1;
|
||||||
|
//获取当前日
|
||||||
|
const date = myDate.getDate();
|
||||||
|
const h = myDate.getHours(); //获取当前小时数(0-23)
|
||||||
|
const m = myDate.getMinutes(); //获取当前分钟数(0-59)
|
||||||
|
const s = myDate.getSeconds();
|
||||||
|
return year + '-' + this.p(month) + "-" + this.p(date) + " " + this.p(h) + ':' + this.p(m) + ":" + this.p(s)
|
||||||
|
},
|
||||||
|
p(s) {
|
||||||
|
return s < 10 ? '0' + s : s;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
// 数据汇总
|
// 数据汇总
|
||||||
|
|
Loading…
Reference in New Issue