'123'
This commit is contained in:
parent
df2b17ebca
commit
1efe171bc0
|
@ -839,7 +839,6 @@ public class QuotController extends BaseController
|
|||
@GetMapping("/listStatisticsQuotQuot")
|
||||
public TableDataInfo listStatisticsQuotQuot(Quot quot)
|
||||
{
|
||||
startPage();
|
||||
List<Quot> list = quotService.selectStatisticsQuotList(quot);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
|
|
@ -12,11 +12,15 @@ import com.ruoyi.common.enums.BusinessType;
|
|||
import com.ruoyi.common.enums.DataSourceType;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
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.QuotFile;
|
||||
import com.ruoyi.quot.domain.QuotMaterial;
|
||||
import com.ruoyi.quot.service.IQuotFileService;
|
||||
import com.ruoyi.quot.service.IQuotService;
|
||||
import com.ruoyi.redBook.domain.*;
|
||||
import com.ruoyi.redBook.service.IRedBookService;
|
||||
import com.ruoyi.redBook.service.impl.AsyncRbTaskService;
|
||||
|
@ -55,6 +59,13 @@ public class RedBookController extends BaseController
|
|||
@Resource
|
||||
private AsyncRbTaskService asyncRbTaskService;
|
||||
|
||||
@Resource
|
||||
private IQuotService iQuotService;
|
||||
|
||||
@Autowired
|
||||
private IQuotFileService quotFileService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取目录
|
||||
* @param product
|
||||
|
@ -240,6 +251,61 @@ public class RedBookController extends BaseController
|
|||
}
|
||||
return success(quot);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成询价单
|
||||
* @param quot
|
||||
* @return
|
||||
*/
|
||||
@DataSource(DataSourceType.MASTER)
|
||||
@Log(title = "生成询价单", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/madeXjQuot")
|
||||
public void madeXjQuot(HttpServletResponse response, @RequestBody OAQuot quot)
|
||||
{
|
||||
|
||||
Quot xjquot = new Quot();
|
||||
xjquot.setQuotId(UUID.fastUUID().toString());
|
||||
String quotCode = redBookService.getCode("BJD");
|
||||
xjquot.setQuotCode(quotCode);
|
||||
xjquot.setQuotApprovalStatus("0");
|
||||
xjquot.setQuotSalesmanCode(getUsername());
|
||||
xjquot.setQuotSalesmanBm(getLoginUser().getUser().getSapUserBm());
|
||||
xjquot.setQuotSalesmanName(getLoginUser().getUser().getNickName());
|
||||
xjquot.setQuotSalesmanDeptId(getLoginUser().getUser().getDept().getDeptId()+"");
|
||||
xjquot.setQuotSalesmanDeptName(getLoginUser().getUser().getDept().getDeptName());
|
||||
xjquot.setCreateBy(getUsername());
|
||||
iQuotService.insertQuot(xjquot);
|
||||
|
||||
/** 上传清单附件 **/
|
||||
/* String relation_id = xjquot.getQuotId();
|
||||
if(!StringUtils.isEmpty(relation_id)){
|
||||
if (!file.isEmpty())
|
||||
{
|
||||
QuotFile quotFile= new QuotFile();
|
||||
quotFile.setFileId(UUID.fastUUID().toString());
|
||||
|
||||
String url = FileUploadUtils.uploadMinio(file,"quot-manage", "quot/"+relation_id);
|
||||
int index = url.lastIndexOf("/")+1;
|
||||
String fileName = url.substring(index);//获取文件名
|
||||
|
||||
int index2 = url.indexOf("/quot/");
|
||||
String fileBucketName = url.substring(index2);//获取文件对应文件服务器中地址-供后面删除功能用
|
||||
|
||||
quotFile.setFileName(fileName);
|
||||
quotFile.setFileBucketName(fileBucketName);
|
||||
quotFile.setFileUrl(url);
|
||||
quotFile.setFileSize(file.getSize());
|
||||
quotFile.setFileTime(DateUtils.getTime());
|
||||
quotFile.setFileType("quotXjFile");
|
||||
quotFile.setRelationId(relation_id);
|
||||
quotFileService.insertQuotFile(quotFile);
|
||||
}
|
||||
}else{
|
||||
return error("系统异常,询价单号为空!");
|
||||
}*/
|
||||
/** 上传清单附件 **/
|
||||
// return success(xjquot);
|
||||
}
|
||||
/**
|
||||
* 报价单提交
|
||||
* @param quot
|
||||
|
|
|
@ -514,7 +514,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="quotCustomerName != null and quotCustomerName != ''"> and quot_customer_name like concat('%', #{quotCustomerName}, '%')</if>
|
||||
<if test="quotProject != null and quotProject != ''"> and quot_project like concat('%', #{quotProject}, '%')</if>
|
||||
<if test="quotSalesmanName != null and quotSalesmanName != ''"> and quot_salesman_name like concat('%', #{quotSalesmanName}, '%')</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and datediff(d, a.quot_quotation_date, #{params.beginTime}) <![CDATA[<=]]> 0
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and datediff(d, a.quot_quotation_date, #{params.endTime}) <![CDATA[>=]]> 0
|
||||
</if>
|
||||
and a.quot_approval_status = '2'
|
||||
</where>
|
||||
order by a.quot_inquiry_date desc
|
||||
order by a.quot_quotation_date desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -108,6 +108,14 @@ export function saveQuot(data) {
|
|||
data: data
|
||||
})
|
||||
}
|
||||
//生成报价单
|
||||
export function madeXjQuot(data) {
|
||||
return request({
|
||||
url: '/redBook/redBook/madeXjQuot',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
//提交报价单
|
||||
export function commitQuot(data) {
|
||||
return request({
|
||||
|
|
|
@ -36,7 +36,7 @@ $base-sub-menu-background:#000c17;
|
|||
$base-sub-menu-hover:#001528;
|
||||
*/
|
||||
|
||||
$base-sidebar-width: 200px;
|
||||
$base-sidebar-width: 210px;
|
||||
|
||||
// the :export directive is the magic sauce for webpack
|
||||
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
|
||||
|
|
|
@ -163,6 +163,11 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="打印人" align="center" prop="quotPrintUserNickName" width="150px" v-if="$auth.hasPermi('quot:quot:changQuotPrintStatus')"/>
|
||||
<el-table-column label="OA提交状态" align="center" prop="quotJsxzApprovalStatus" width="150px" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.quot_oa_approval_status" :value="scope.row.quotOAApprovalStatus" v-if="scope.row.quotOAApprovalStatus!=0"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="业务员" align="center" prop="quotSalesmanName" width="150px"/>
|
||||
<el-table-column label="客户名称" align="center" prop="quotCustomerName" width="250px"/>
|
||||
<el-table-column label="项目名称" align="center" prop="quotProject" width="250px"/>
|
||||
|
@ -171,11 +176,6 @@
|
|||
<dict-tag :options="dict.type.quot_jsw_approval_status" :value="scope.row.quotJswApprovalStatus" v-if="scope.row.quotJswApprovalStatus!=0"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="OA提交状态" align="center" prop="quotJsxzApprovalStatus" width="150px" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.quot_oa_approval_status" :value="scope.row.quotOAApprovalStatus" v-if="scope.row.quotOAApprovalStatus!=0"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="技术协助状态" align="center" prop="quotJsxzApprovalStatus" width="150px" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.quot_jsxz_approval_status" :value="scope.row.quotJsxzApprovalStatus" v-if="scope.row.quotJsxzApprovalStatus!=0"/>
|
||||
|
@ -197,7 +197,7 @@
|
|||
<span>{{ parseTime(scope.row.quotQuotationDate) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" align="center" prop="quotQuantity" width="100"/>
|
||||
<el-table-column label="明细条数" align="center" prop="quotMaterialsCount" width="100"/>
|
||||
<el-table-column label="反馈说明" align="center" prop="quotFeedbackExplanation" width="150px"/>
|
||||
<el-table-column label="创建人" align="center" prop="createName" width="150px"/>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
|
||||
|
@ -1659,8 +1659,8 @@ export default {
|
|||
}
|
||||
});
|
||||
this.form.quotQuantity = sums[6];
|
||||
this.form.quotTotalPrice = checkRole(['QUOT_MAT_PRICE_DIFF'])? sums[12] : sums[11];
|
||||
this.form.quotMaterialsCount = data.length;
|
||||
this.form.quotTotalPrice = this.form.quotTotalPrice?this.form.quotTotalPrice:checkRole(['QUOT_MAT_PRICE_DIFF'])? sums[12] : sums[11];
|
||||
this.form.quotMaterialsCount = this.form.quotMaterialsCount?this.form.quotMaterialsCount:data.length;
|
||||
return sums;
|
||||
},
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
<el-button style="float: right;" size="mini" type="primary" icon="el-icon-search" @click="handleSearchClick">搜索</el-button>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<!--<el-button style="float: right;margin-left: 5px;" size="mini" type="primary" icon="el-icon-document" @click="handleMadeXjQuotClick" :disabled="selectedResultData.length==0 || madeQuotDis">生成询价单</el-button>-->
|
||||
<el-button style="float: right;margin-left: 5px;" size="mini" type="success" icon="el-icon-document" @click="handleMadeQuotClick" :disabled="selectedResultData.length==0 || madeQuotDis">生成报价单</el-button>
|
||||
<el-button style="float: right;margin-left: 5px;" size="mini" type="warning" icon="el-icon-folder" @click="handleSaveClick" :disabled="selectedResultData.length==0">保存</el-button>
|
||||
<el-button style="float: right;margin-left: 5px;" size="mini" icon="el-icon-refresh" @click="handleRefreshClick">清空信息</el-button>
|
||||
|
@ -269,7 +270,7 @@
|
|||
|
||||
</style>
|
||||
<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, madeXjQuot, updateSelectedResultData} from "@/api/redBook/redBook";
|
||||
import { getToken } from "@/utils/auth";
|
||||
export default {
|
||||
name: "productSelect",
|
||||
|
@ -779,6 +780,34 @@
|
|||
});
|
||||
},
|
||||
|
||||
// 生成询价单
|
||||
handleMadeXjQuotClick() {
|
||||
this.form.selectedResultData = this.selectedResultData;
|
||||
madeXjQuot(this.form).then(response => {
|
||||
//this.$modal.msgSuccess("生成询价单成功,单号:"+response.data.quotCode);
|
||||
// 处理返回的文件流
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
/** 产品数据导入按钮操作 */
|
||||
handleImport() {
|
||||
this.productUpload.title = "产品数据导入";
|
||||
|
|
|
@ -1,6 +1,18 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="报价时间">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="报价单号" prop="quotCode">
|
||||
<el-input
|
||||
v-model="queryParams.quotCode"
|
||||
|
@ -39,19 +51,21 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col :span="2">
|
||||
<el-col :span="4">
|
||||
<span>总条数:{{sumQuotMaterialsCount}}</span>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-col :span="4">
|
||||
<span>总价:{{sumQuotTotalPrice}}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="quotList" style="width: 100%;margin-top: 10px;" show-summary :summary-method="getSummaries">
|
||||
<el-table v-loading="loading" :data="quotList" style="width: 100%;margin-top: 10px;" :height="tableHeight">
|
||||
<el-table-column fixed label="报价单号" align="center" prop="quotCode" width="250px"/>
|
||||
<el-table-column fixed label="业务员" align="center" prop="quotSalesmanName" width="150px"/>
|
||||
<el-table-column fixed label="客户名称" align="center" prop="quotCustomerName" width="250px"/>
|
||||
<el-table-column fixed label="项目名称" align="center" prop="quotProject" width="250px"/>
|
||||
<el-table-column label="明细条数" align="center" prop="quotMaterialsCount" width="100"/>
|
||||
<el-table-column label="总价" align="center" prop="quotTotalPrice" width="100"/>
|
||||
<!--<el-table-column label="金思维报价单号" align="center" prop="quotJswCode" width="280px"/>-->
|
||||
<el-table-column label="询价日期" align="center" prop="quotInquiryDate" width="160">
|
||||
<template slot-scope="scope">
|
||||
|
@ -63,29 +77,26 @@
|
|||
<span>{{ parseTime(scope.row.quotQuotationDate) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="明细条数" align="center" prop="quotMaterialsCount" width="100"/>
|
||||
<el-table-column label="总价" align="center" prop="quotTotalPrice" width="100"/>
|
||||
<el-table-column label="创建人" align="center" prop="createName" width="150px"/>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核人" align="center" prop="quotCheckUserNickname" />
|
||||
<el-table-column label="审核人" align="center" prop="quotCheckUserNickname" width="160" />
|
||||
<el-table-column label="报价时间" align="center" prop="quotQuotationDate" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.quotQuotationDate) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { listStatisticsQuotQuot } from "@/api/quot/quot"; // 有效报价单统计
|
||||
import { NumberAdd } from '@/utils/number';// 数值计算
|
||||
import {toDecimal} from "@/api/redBook/redBook";
|
||||
import { getNowDate } from '@/utils/date'
|
||||
|
||||
export default {
|
||||
name: "statisticsQuot",
|
||||
data() {
|
||||
|
@ -96,16 +107,15 @@ export default {
|
|||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 时间范围
|
||||
dateRange: [getNowDate(),getNowDate()],
|
||||
// 报价表格数据
|
||||
quotList: [],
|
||||
//总条数
|
||||
sumQuotMaterialsCount: 0,
|
||||
//总价
|
||||
sumQuotTotalPrice: 0,
|
||||
// 表格高度设置
|
||||
tableHeight: window.innerHeight - 240, //表格动态高度
|
||||
screenHeight: window.innerHeight, //内容区域高度
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
quotCode: null,
|
||||
quotCustomerName: null,
|
||||
quotSalesmanName: null,
|
||||
|
@ -120,7 +130,7 @@ export default {
|
|||
/** 查询报价列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listStatisticsQuotQuot(this.queryParams).then(response => {
|
||||
listStatisticsQuotQuot(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.quotList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
|
@ -136,36 +146,34 @@ export default {
|
|||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
}
|
||||
},
|
||||
|
||||
/** 对产品数据-数量、金额进行合算 */
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计';
|
||||
return;
|
||||
}
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
|
||||
if (column.property === 'quotMaterialsCount' || column.property === 'quotTotalPrice') {
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return NumberAdd(prev,curr);
|
||||
}else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
} else {
|
||||
sums[index] = ''
|
||||
}
|
||||
}
|
||||
});
|
||||
return sums;
|
||||
computed: {
|
||||
// 总条数
|
||||
sumQuotMaterialsCount() {
|
||||
const quotMaterialsCount = this.quotList.reduce((sum, row) => sum + parseFloat(row.quotMaterialsCount==null?0:row.quotMaterialsCount), 0);
|
||||
return toDecimal(quotMaterialsCount);
|
||||
},
|
||||
// 总价
|
||||
sumQuotTotalPrice() {
|
||||
const quotTotalPrice = this.quotList.reduce((sum, row) => sum + parseFloat(row.quotTotalPrice==null?0:row.quotTotalPrice), 0);
|
||||
return toDecimal(quotTotalPrice);
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
// 监听screenHeight从而改变table的高度
|
||||
screenHeight(val) {
|
||||
this.screenHeight = val
|
||||
this.tableHeight = this.screenHeight - 260
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
window.onresize = () => {
|
||||
return (() => {
|
||||
window.screenHeight = window.innerHeight
|
||||
this.screenHeight = window.screenHeight
|
||||
})()
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue