'123'
This commit is contained in:
parent
2a43b84a47
commit
fde4edce8e
|
@ -255,6 +255,14 @@ public class RedBookController extends BaseController
|
||||||
if(CollectionUtils.isEmpty(resCache)){
|
if(CollectionUtils.isEmpty(resCache)){
|
||||||
resCache = redBookService.versionList();
|
resCache = redBookService.versionList();
|
||||||
redisCache.setCacheObject(getCacheKey("versionList"),resCache);
|
redisCache.setCacheObject(getCacheKey("versionList"),resCache);
|
||||||
|
}else{
|
||||||
|
// 判断是否有最新调价
|
||||||
|
String maxUid = resCache.get(0).getValue();//获取缓存里最新调价版本
|
||||||
|
String rb_price_version = redBookService.rb_price_version();//获取电子红本最新的调价版本
|
||||||
|
if(!rb_price_version.equals(maxUid)){
|
||||||
|
resCache = redBookService.versionList();
|
||||||
|
redisCache.setCacheObject(getCacheKey("versionList"),resCache);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ajax.put("versionList", resCache);
|
ajax.put("versionList", resCache);
|
||||||
return ajax;
|
return ajax;
|
||||||
|
@ -296,4 +304,23 @@ public class RedBookController extends BaseController
|
||||||
List<Customer> list = redBookService.listQuots(oaQuot);
|
List<Customer> list = redBookService.listQuots(oaQuot);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取报价详细信息
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/{quotId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("quotId") String quotId)
|
||||||
|
{
|
||||||
|
return success(redBookService.selectQuotByQuotId(quotId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除报价单
|
||||||
|
*/
|
||||||
|
@Log(title = "OA报价单删除", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/deleteQuots/{quotId}")
|
||||||
|
public AjaxResult remove(@PathVariable String quotId)
|
||||||
|
{
|
||||||
|
return toAjax(redBookService.deleteQuotsByQuotId(quotId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,8 @@ public class OAQuot extends BaseEntity {
|
||||||
private String quotLxrdh;//联系人电话
|
private String quotLxrdh;//联系人电话
|
||||||
private String totalPrice;//总金额
|
private String totalPrice;//总金额
|
||||||
|
|
||||||
|
private String rbDateUid;//调价版本
|
||||||
|
|
||||||
private List<OAQuotProduct> selectedResultData;
|
private List<OAQuotProduct> selectedResultData;
|
||||||
|
|
||||||
public String getQuot_id() { return quot_id; }
|
public String getQuot_id() { return quot_id; }
|
||||||
|
@ -59,6 +61,10 @@ public class OAQuot extends BaseEntity {
|
||||||
|
|
||||||
public void setTotalPrice(String totalPrice) { this.totalPrice = totalPrice; }
|
public void setTotalPrice(String totalPrice) { this.totalPrice = totalPrice; }
|
||||||
|
|
||||||
|
public String getRbDateUid() { return rbDateUid; }
|
||||||
|
|
||||||
|
public void setRbDateUid(String rbDateUid) { this.rbDateUid = rbDateUid; }
|
||||||
|
|
||||||
public List<OAQuotProduct> getSelectedResultData() {
|
public List<OAQuotProduct> getSelectedResultData() {
|
||||||
return selectedResultData;
|
return selectedResultData;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ public class OAQuotProduct {
|
||||||
private String spec;//规格
|
private String spec;//规格
|
||||||
private String voltage;//电压
|
private String voltage;//电压
|
||||||
private String stu;//单位
|
private String stu;//单位
|
||||||
|
private String price;//红本价
|
||||||
private BigDecimal setPrice;//单价
|
private BigDecimal setPrice;//单价
|
||||||
private BigDecimal count;//数量
|
private BigDecimal count;//数量
|
||||||
private BigDecimal allPrice;//金额
|
private BigDecimal allPrice;//金额
|
||||||
|
@ -58,6 +59,10 @@ public class OAQuotProduct {
|
||||||
this.stu = stu;
|
this.stu = stu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPrice() { return price; }
|
||||||
|
|
||||||
|
public void setPrice(String price) { this.price = price; }
|
||||||
|
|
||||||
public BigDecimal getSetPrice() { return setPrice; }
|
public BigDecimal getSetPrice() { return setPrice; }
|
||||||
|
|
||||||
public void setSetPrice(BigDecimal setPrice) { this.setPrice = setPrice; }
|
public void setSetPrice(BigDecimal setPrice) { this.setPrice = setPrice; }
|
||||||
|
|
|
@ -108,4 +108,25 @@ public interface OARedBookMapper
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<Customer> listQuots(OAQuot oaQuot);
|
List<Customer> listQuots(OAQuot oaQuot);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取报价详细信息
|
||||||
|
* @param quotId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
OAQuot selectQuotByQuotId(String quotId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除报价单
|
||||||
|
* @param quotId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int deleteQuotsByQuotId(String quotId);
|
||||||
|
void deleteQuotProductsByCusId(String quotId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取本地记录的调价版本
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String rb_price_version();
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,4 +101,24 @@ public interface IRedBookService
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<Customer> listQuots(OAQuot oaQuot);
|
List<Customer> listQuots(OAQuot oaQuot);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取报价详细信息
|
||||||
|
* @param quotId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
OAQuot selectQuotByQuotId(String quotId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除报价单
|
||||||
|
* @param quotId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int deleteQuotsByQuotId(String quotId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取本地记录的调价版本
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String rb_price_version();
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,4 +178,34 @@ public class RedBookServiceImpl implements IRedBookService
|
||||||
public List<Customer> listQuots(OAQuot oaQuot) {
|
public List<Customer> listQuots(OAQuot oaQuot) {
|
||||||
return oaRedBookMapper.listQuots(oaQuot);
|
return oaRedBookMapper.listQuots(oaQuot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取报价详细信息
|
||||||
|
* @param quotId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public OAQuot selectQuotByQuotId(String quotId) {
|
||||||
|
return oaRedBookMapper.selectQuotByQuotId(quotId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除报价单
|
||||||
|
* @param quotId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteQuotsByQuotId(String quotId) {
|
||||||
|
oaRedBookMapper.deleteQuotProductsByCusId(quotId);
|
||||||
|
return oaRedBookMapper.deleteQuotsByQuotId(quotId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取本地记录的调价版本
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String rb_price_version() {
|
||||||
|
return oaRedBookMapper.rb_price_version();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,6 +90,7 @@ 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="rbDateUid != null and rbDateUid != ''">rbDateUid,</if>
|
||||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
create_time
|
create_time
|
||||||
</trim>
|
</trim>
|
||||||
|
@ -101,15 +102,16 @@ 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="rbDateUid != null and rbDateUid != ''">#{rbDateUid},</if>
|
||||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
getdate()
|
getdate()
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="batchOAQuotProduct">
|
<insert id="batchOAQuotProduct">
|
||||||
insert into OAQuotProduct(quot_product_id, name_0, name_1, spec, voltage,stu,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=",">
|
||||||
( #{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})
|
( #{item.quot_product_id}, #{item.name_0}, #{item.name_1}, #{item.spec}, #{item.voltage}, #{item.stu},cast(#{item.price,jdbcType=DECIMAL} as decimal(18,2)),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>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
@ -146,9 +148,72 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
from OAQuot a
|
from OAQuot a
|
||||||
<include refid="quotsJoins"/>
|
<include refid="quotsJoins"/>
|
||||||
<where>
|
<where>
|
||||||
|
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||||
|
and datediff(d, a.create_time, #{params.beginTime}) <![CDATA[<=]]> 0
|
||||||
|
</if>
|
||||||
|
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||||
|
and datediff(d, a.create_time, #{params.endTime}) <![CDATA[>=]]> 0
|
||||||
|
</if>
|
||||||
<!-- 数据范围过滤 -->
|
<!-- 数据范围过滤 -->
|
||||||
${params.dataScope}
|
${params.dataScope}
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<resultMap type="OAQuot" id="QuotResult">
|
||||||
|
<result property="quot_id" column="quot_id" />
|
||||||
|
<result property="quotCode" column="quotCode" />
|
||||||
|
<result property="quotCustomer" column="quotCustomer" />
|
||||||
|
<result property="quotProject" column="quotProject" />
|
||||||
|
<result property="quotLxr" column="quotLxr" />
|
||||||
|
<result property="quotLxrdh" column="quotLxrdh" />
|
||||||
|
<result property="totalPrice" column="totalPrice" />
|
||||||
|
<result property="rbDateUid" column="rbDateUid" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="QuotQuotMaterialResult" type="OAQuot" extends="QuotResult">
|
||||||
|
<collection property="selectedResultData" notNullColumn="quot_product_id" javaType="java.util.List" resultMap="QuotMaterialResult" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="OAQuotProduct" id="QuotMaterialResult">
|
||||||
|
<result property="quot_product_id" column="quot_product_id" />
|
||||||
|
<result property="name_0" column="name_0" />
|
||||||
|
<result property="name_1" column="name_1" />
|
||||||
|
<result property="spec" column="spec" />
|
||||||
|
<result property="voltage" column="voltage" />
|
||||||
|
<result property="stu" column="stu" />
|
||||||
|
<result property="per" column="per" />
|
||||||
|
<result property="per2" column="per2" />
|
||||||
|
<result property="price" column="price" />
|
||||||
|
<result property="setPrice" column="setPrice" />
|
||||||
|
<result property="count" column="count" />
|
||||||
|
<result property="allPrice" column="allPrice" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectQuotByQuotId" parameterType="String" resultMap="QuotQuotMaterialResult">
|
||||||
|
select a.quot_id, a.quotCode, a.quotCustomer, a.quotProject, a.quotLxr,
|
||||||
|
a.quotLxrdh, a.totalPrice,a.rbDateUid,
|
||||||
|
|
||||||
|
b.quot_product_id, b.name_0, b.name_1,
|
||||||
|
b.spec, b.voltage, b.stu,
|
||||||
|
b.per,b.per2,b.price,b.setPrice,b.count,b.allPrice,b.quot_id
|
||||||
|
from OAQuot a
|
||||||
|
left join OAQuotProduct b on b.quot_id = a.quot_id
|
||||||
|
where a.quot_id = #{quotId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<delete id="deleteQuotsByQuotId" parameterType="java.lang.String">
|
||||||
|
delete from OAQuot where quot_id = #{quotId}
|
||||||
|
</delete>
|
||||||
|
<delete id="deleteQuotProductsByCusId" parameterType="java.lang.String">
|
||||||
|
delete from OAQuotProduct where quot_id = #{quotId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="rb_price_version" resultType="String">
|
||||||
|
select top 1 muid from
|
||||||
|
(
|
||||||
|
select max(uid_0) muid,date_0 from rb_productVersion
|
||||||
|
where sta_0=1 or sta_0=0 group by date_0
|
||||||
|
)a order by date_0 desc
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -146,7 +146,20 @@ export function listQuots(query) {
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 查询报价单详细
|
||||||
|
export function getQuotDetail(quotId) {
|
||||||
|
return request({
|
||||||
|
url: '/redBook/redBook/' + quotId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 删除报价单
|
||||||
|
export function deleteQuots(quotId) {
|
||||||
|
return request({
|
||||||
|
url: '/redBook/redBook/deleteQuots/' + quotId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ module.exports = {
|
||||||
/**
|
/**
|
||||||
* 是否显示顶部导航
|
* 是否显示顶部导航
|
||||||
*/
|
*/
|
||||||
topNav: false,
|
topNav: true,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否显示 tagsView
|
* 是否显示 tagsView
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
<el-button style="float: right;" size="mini" type="primary" icon="el-icon-search" @click="handleSearchClick">搜索</el-button>
|
<el-button style="float: right;" size="mini" type="primary" icon="el-icon-search" @click="handleSearchClick">搜索</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="14">
|
<el-col :span="14">
|
||||||
<el-button style="float: right;margin-left: 5px;" size="mini" type="success" icon="el-icon-document" @click="handleMadeQuotClick">生成报价单</el-button>
|
<el-button style="float: right;margin-left: 5px;" size="mini" type="success" icon="el-icon-document" @click="handleMadeQuotClick" :disabled="selectedResultData.length==0">生成报价单</el-button>
|
||||||
<el-button style="float: right;" size="mini" type="warning" icon="el-icon-folder" @click="handleSaveClick">保存</el-button>
|
<el-button style="float: right;" size="mini" type="warning" icon="el-icon-folder" @click="handleSaveClick" :disabled="selectedResultData.length==0">保存</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="5" class="mt5">
|
<el-row :gutter="5" class="mt5">
|
||||||
|
@ -65,7 +65,7 @@
|
||||||
:limit.sync="searchResultPageSize"
|
:limit.sync="searchResultPageSize"
|
||||||
@size-change="handleSearchResultSizeChange"
|
@size-change="handleSearchResultSizeChange"
|
||||||
@current-change="handleSearchResultCurrentChange"
|
@current-change="handleSearchResultCurrentChange"
|
||||||
:layout="'total, sizes, prev, pager, next'"
|
:layout="'total, prev, pager, next'"
|
||||||
/>
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -100,18 +100,17 @@
|
||||||
<el-form-item label="总金额" prop="totalPrice" v-if="false">
|
<el-form-item label="总金额" prop="totalPrice" v-if="false">
|
||||||
<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:10%" 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:10%;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">{{sumSelectedResultData}} 元</span>
|
总价:<span style="color:red;font-size: 15px">{{sumSelectedResultData}} 元</span>
|
||||||
<el-select v-model="form.rbDate" style="width: 50%;float: right" >
|
<el-select v-model="form.rbDateUid" style="width: 235px;margin-left: 20px" :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-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -128,8 +127,8 @@
|
||||||
<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" />
|
||||||
<el-table-column label="型号" align="center" prop="name_1" width="180" v-if="false"/>
|
<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="spec" width="180" v-if="false"/>
|
||||||
<el-table-column label="电压" align="center" prop="voltage" width="80"/>
|
<el-table-column label="电压" align="center" prop="voltage" width="100"/>
|
||||||
<el-table-column label="红本价(元)" align="center" prop="price" width="100"/>
|
<el-table-column label="红本价(元)" align="center" prop="price" width="120"/>
|
||||||
<el-table-column label="单位" align="center" prop="stu" width="50"/>
|
<el-table-column label="单位" align="center" prop="stu" width="50"/>
|
||||||
<el-table-column label="一次折扣" align="center" prop="per" width="80">
|
<el-table-column label="一次折扣" align="center" prop="per" width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
@ -141,13 +140,13 @@
|
||||||
<el-input v-model="scope.row.per2" @blur="changeRowData"/>
|
<el-input v-model="scope.row.per2" @blur="changeRowData"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="单价" align="center" prop="setPrice" width="80"/>
|
<el-table-column label="单价" align="center" prop="setPrice" width="120"/>
|
||||||
<el-table-column label="数量调整" align="center" prop="count" width="80">
|
<el-table-column label="数量调整" align="center" prop="count" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input v-model="scope.row.count" @blur="changeRowData"/>
|
<el-input v-model="scope.row.count" @blur="changeRowData"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="总价" align="center" prop="allPrice" width="80"/>
|
<el-table-column label="总价" align="center" prop="allPrice" width="120"/>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!--<pagination
|
<!--<pagination
|
||||||
v-show="selectedResultTotal>0"
|
v-show="selectedResultTotal>0"
|
||||||
|
@ -263,8 +262,8 @@
|
||||||
//表单
|
//表单
|
||||||
form: {totalPrice: ''},
|
form: {totalPrice: ''},
|
||||||
|
|
||||||
//调价日期选择
|
//调价日期
|
||||||
versionList: [], // 国家数据列表
|
versionList: [], // 调价版本数据列表
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -497,10 +496,10 @@
|
||||||
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 = '0.8';
|
const per = this.perc;
|
||||||
const per2 = '';
|
const per2 = this.perc2;
|
||||||
const count = '1';
|
const count = '1';
|
||||||
const setPrice = toDecimal(price * per);
|
const setPrice = toDecimal(price * (per?per:1) * (per2?per2:1));
|
||||||
const allPrice = toDecimal(count * setPrice);
|
const allPrice = toDecimal(count * setPrice);
|
||||||
|
|
||||||
const rowDate = {
|
const rowDate = {
|
||||||
|
@ -635,11 +634,6 @@
|
||||||
},
|
},
|
||||||
// 报价单生成
|
// 报价单生成
|
||||||
handleMadeQuotClick() {
|
handleMadeQuotClick() {
|
||||||
if(this.selectedResultData.length==0){
|
|
||||||
this.$modal.msgWarning("未选择报价产品信息");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.form.selectedResultData = this.selectedResultData;
|
this.form.selectedResultData = this.selectedResultData;
|
||||||
madeQuot(this.form).then(response => {
|
madeQuot(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("生成报价单成功");
|
this.$modal.msgSuccess("生成报价单成功");
|
||||||
|
@ -668,16 +662,11 @@
|
||||||
getVersionList(){
|
getVersionList(){
|
||||||
versionList(this.queryParams).then(response => {
|
versionList(this.queryParams).then(response => {
|
||||||
this.versionList = response.versionList;
|
this.versionList = response.versionList;
|
||||||
this.form.rbDate = this.versionList[0].value
|
this.form.rbDateUid = this.versionList[0].value
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//选择调价日期
|
//选择调价日期
|
||||||
selectRbDate(uid){
|
selectRbDate(uid){
|
||||||
if(this.selectedResultData.length==0){
|
|
||||||
this.$modal.msgWarning("未选择报价产品信息");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.selectedResultData.forEach((row, index) => {
|
this.selectedResultData.forEach((row, index) => {
|
||||||
this.$set(this.selectedResultData, index, {
|
this.$set(this.selectedResultData, index, {
|
||||||
...row,
|
...row,
|
||||||
|
|
|
@ -20,9 +20,18 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-table width="100%" v-loading="loading" :data="quotsList" :row-class-name="rowQuotsIndex">
|
<el-table width="100%" v-loading="loading" :data="quotsList" :row-class-name="rowQuotsIndex">
|
||||||
<el-table-column label="序号" align="center" prop="index" width="80"/>
|
<el-table-column fixed="left" label="序号" align="center" prop="index" width="50"/>
|
||||||
|
<el-table-column fixed="left" label="操作" align="center" width="60" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" @click="handleDeleteClick(scope.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="quot_id" align="center" prop="quot_id" v-if="false"/>
|
<el-table-column label="quot_id" align="center" prop="quot_id" v-if="false"/>
|
||||||
<el-table-column label="报价单号" width="260" align="center" prop="quotCode" />
|
<el-table-column label="报价单号" width="260" align="center" prop="quotCode">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link :underline="false" type="primary" @click="handleDetail(scope.row)">{{scope.row.quotCode}}</el-link>
|
||||||
|
</template>
|
||||||
|
</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="联系人"align="center" prop="quotLxr" />
|
||||||
|
@ -30,6 +39,68 @@
|
||||||
<el-table-column label="创建日期" width="200" align="center" prop="createTime" />
|
<el-table-column label="创建日期" width="200" align="center" prop="createTime" />
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
|
<!-- 报价详情对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="1050px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" label-width="100px">
|
||||||
|
<el-row :gutter="8">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="询价单位" prop="quotCustomer">
|
||||||
|
<el-input v-model="form.quotCustomer" :disabled="true"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="项目名称" prop="quotProject">
|
||||||
|
<el-input v-model="form.quotProject" :disabled="true"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="8">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="联系人" prop="quotLxr">
|
||||||
|
<el-input v-model="form.quotLxr" :disabled="true"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="联系电话" prop="quotLxrdh">
|
||||||
|
<el-input v-model="form.quotLxrdh" :disabled="true"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="8">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item>
|
||||||
|
总价:<span style="color:red;font-size: 20px">{{sumSelectedResultData}} 元</span>
|
||||||
|
<el-select v-model="form.rbDateUid" style="width: 60%;float: right" :disabled="true">
|
||||||
|
<el-option
|
||||||
|
v-for="item in versionList"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
@click.native="selectRbDate(item.value)"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table width="100%;" :row-class-name="selectedResultIndex" :data="selectedResultData" height="400px">
|
||||||
|
<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" />
|
||||||
|
<el-table-column label="型号" align="center" prop="name_1" v-if="false"/>
|
||||||
|
<el-table-column label="规格" align="center" prop="spec" v-if="false"/>
|
||||||
|
<el-table-column label="电压" align="center" prop="voltage"/>
|
||||||
|
<el-table-column label="红本价(元)" align="center" prop="price"/>
|
||||||
|
<el-table-column label="单位" align="center" prop="stu"/>
|
||||||
|
<el-table-column label="一次折扣" align="center" prop="per"/>
|
||||||
|
<el-table-column label="二次折扣" align="center" prop="per2"/>
|
||||||
|
<el-table-column label="单价" align="center" prop="setPrice"/>
|
||||||
|
<el-table-column label="数量调整" align="center" prop="count"/>
|
||||||
|
<el-table-column label="总价" align="center" prop="allPrice"/>
|
||||||
|
</el-table>
|
||||||
|
</el-form>
|
||||||
|
</el-dialog>
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
|
@ -41,7 +112,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listQuots } from "@/api/redBook/redBook";
|
import { versionList,listQuots,getQuotDetail,deleteQuots } from "@/api/redBook/redBook";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "quots",
|
name: "quots",
|
||||||
|
@ -55,27 +126,46 @@
|
||||||
total: 0,
|
total: 0,
|
||||||
//报价单数据
|
//报价单数据
|
||||||
quotsList: [],
|
quotsList: [],
|
||||||
|
// 时间范围
|
||||||
|
dateRange: [],
|
||||||
|
//调价日期
|
||||||
|
versionList: [], // 调价版本数据列表
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10
|
pageSize: 10
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//表单
|
||||||
|
form: {},
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 列表数据
|
||||||
|
selectedResultData: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
this.getVersionList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询报价单列表 */
|
/** 查询报价单列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listQuots(this.queryParams).then(response => {
|
listQuots(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
this.quotsList = response.rows;
|
this.quotsList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
//获取调价日期
|
||||||
|
getVersionList(){
|
||||||
|
versionList(this.queryParams).then(response => {
|
||||||
|
this.versionList = response.versionList;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
rowQuotsIndex({ row, rowIndex }) {
|
rowQuotsIndex({ row, rowIndex }) {
|
||||||
row.index = rowIndex + 1;
|
row.index = rowIndex + 1;
|
||||||
|
@ -90,7 +180,38 @@
|
||||||
this.resetForm("queryForm");
|
this.resetForm("queryForm");
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
}
|
|
||||||
|
/** 查看详情按钮操作 */
|
||||||
|
handleDetail(row) {
|
||||||
|
const quotId = row.quot_id;
|
||||||
|
getQuotDetail(quotId).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.selectedResultData = response.data.selectedResultData;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "报价单信息";
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 数据序号 */
|
||||||
|
selectedResultIndex({ row, rowIndex }) {
|
||||||
|
row.index = rowIndex + 1;
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 删除报价单 */
|
||||||
|
handleDeleteClick(row) {
|
||||||
|
const quotId = row.quot_id;
|
||||||
|
deleteQuots(quotId).then(response => {
|
||||||
|
this.$message.success("删除成功");
|
||||||
|
this.getList();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
// 数据汇总
|
||||||
|
sumSelectedResultData() {
|
||||||
|
const allPrice = this.selectedResultData.reduce((sum, row) => sum + parseFloat(row.allPrice), 0);
|
||||||
|
return allPrice.toFixed(2);
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue