This commit is contained in:
xd 2024-06-18 17:13:48 +08:00
parent df2b17ebca
commit 1efe171bc0
8 changed files with 180 additions and 63 deletions

View File

@ -839,7 +839,6 @@ public class QuotController extends BaseController
@GetMapping("/listStatisticsQuotQuot") @GetMapping("/listStatisticsQuotQuot")
public TableDataInfo listStatisticsQuotQuot(Quot quot) public TableDataInfo listStatisticsQuotQuot(Quot quot)
{ {
startPage();
List<Quot> list = quotService.selectStatisticsQuotList(quot); List<Quot> list = quotService.selectStatisticsQuotList(quot);
return getDataTable(list); return getDataTable(list);
} }

View File

@ -12,11 +12,15 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.enums.DataSourceType; import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils; 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.poi.ExcelUtil;
import com.ruoyi.common.utils.uuid.UUID; import com.ruoyi.common.utils.uuid.UUID;
import com.ruoyi.customer.domain.Customer; import com.ruoyi.customer.domain.Customer;
import com.ruoyi.quot.domain.Quot; import com.ruoyi.quot.domain.Quot;
import com.ruoyi.quot.domain.QuotFile;
import com.ruoyi.quot.domain.QuotMaterial; 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.domain.*;
import com.ruoyi.redBook.service.IRedBookService; import com.ruoyi.redBook.service.IRedBookService;
import com.ruoyi.redBook.service.impl.AsyncRbTaskService; import com.ruoyi.redBook.service.impl.AsyncRbTaskService;
@ -55,6 +59,13 @@ public class RedBookController extends BaseController
@Resource @Resource
private AsyncRbTaskService asyncRbTaskService; private AsyncRbTaskService asyncRbTaskService;
@Resource
private IQuotService iQuotService;
@Autowired
private IQuotFileService quotFileService;
/** /**
* 获取目录 * 获取目录
* @param product * @param product
@ -240,6 +251,61 @@ public class RedBookController extends BaseController
} }
return success(quot); 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 * @param quot

View File

@ -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="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="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="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> </where>
order by a.quot_inquiry_date desc order by a.quot_quotation_date desc
</select> </select>
</mapper> </mapper>

View File

@ -108,6 +108,14 @@ export function saveQuot(data) {
data: data data: data
}) })
} }
//生成报价单
export function madeXjQuot(data) {
return request({
url: '/redBook/redBook/madeXjQuot',
method: 'post',
data: data
})
}
//提交报价单 //提交报价单
export function commitQuot(data) { export function commitQuot(data) {
return request({ return request({

View File

@ -36,7 +36,7 @@ $base-sub-menu-background:#000c17;
$base-sub-menu-hover:#001528; $base-sub-menu-hover:#001528;
*/ */
$base-sidebar-width: 200px; $base-sidebar-width: 210px;
// the :export directive is the magic sauce for webpack // the :export directive is the magic sauce for webpack
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass // https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass

View File

@ -163,6 +163,11 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="打印人" align="center" prop="quotPrintUserNickName" width="150px" v-if="$auth.hasPermi('quot:quot:changQuotPrintStatus')"/> <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="quotSalesmanName" width="150px"/>
<el-table-column label="客户名称" align="center" prop="quotCustomerName" width="250px"/> <el-table-column label="客户名称" align="center" prop="quotCustomerName" width="250px"/>
<el-table-column label="项目名称" align="center" prop="quotProject" 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"/> <dict-tag :options="dict.type.quot_jsw_approval_status" :value="scope.row.quotJswApprovalStatus" v-if="scope.row.quotJswApprovalStatus!=0"/>
</template> </template>
</el-table-column> </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'])"> <el-table-column label="技术协助状态" align="center" prop="quotJsxzApprovalStatus" width="150px" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.quot_jsxz_approval_status" :value="scope.row.quotJsxzApprovalStatus" v-if="scope.row.quotJsxzApprovalStatus!=0"/> <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> <span>{{ parseTime(scope.row.quotQuotationDate) }}</span>
</template> </template>
</el-table-column> </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="quotFeedbackExplanation" width="150px"/>
<el-table-column label="创建人" align="center" prop="createName" width="150px"/> <el-table-column label="创建人" align="center" prop="createName" width="150px"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="160"> <el-table-column label="创建时间" align="center" prop="createTime" width="160">
@ -1659,8 +1659,8 @@ export default {
} }
}); });
this.form.quotQuantity = sums[6]; this.form.quotQuantity = sums[6];
this.form.quotTotalPrice = checkRole(['QUOT_MAT_PRICE_DIFF'])? sums[12] : sums[11]; this.form.quotTotalPrice = this.form.quotTotalPrice?this.form.quotTotalPrice:checkRole(['QUOT_MAT_PRICE_DIFF'])? sums[12] : sums[11];
this.form.quotMaterialsCount = data.length; this.form.quotMaterialsCount = this.form.quotMaterialsCount?this.form.quotMaterialsCount:data.length;
return sums; return sums;
}, },

View File

@ -8,6 +8,7 @@
<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="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="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" 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> <el-button style="float: right;margin-left: 5px;" size="mini" icon="el-icon-refresh" @click="handleRefreshClick">清空信息</el-button>
@ -269,7 +270,7 @@
</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, madeXjQuot, updateSelectedResultData} from "@/api/redBook/redBook";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
export default { export default {
name: "productSelect", 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() { handleImport() {
this.productUpload.title = "产品数据导入"; this.productUpload.title = "产品数据导入";

View File

@ -1,6 +1,18 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <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-form-item label="报价单号" prop="quotCode">
<el-input <el-input
v-model="queryParams.quotCode" v-model="queryParams.quotCode"
@ -39,19 +51,21 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row> <el-row>
<el-col :span="2"> <el-col :span="4">
<span>总条数:{{sumQuotMaterialsCount}}</span> <span>总条数:{{sumQuotMaterialsCount}}</span>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="4">
<span>总价:{{sumQuotTotalPrice}}</span> <span>总价:{{sumQuotTotalPrice}}</span>
</el-col> </el-col>
</el-row> </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="quotCode" width="250px"/>
<el-table-column fixed label="业务员" align="center" prop="quotSalesmanName" width="150px"/> <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="quotCustomerName" width="250px"/>
<el-table-column fixed label="项目名称" align="center" prop="quotProject" 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="quotJswCode" width="280px"/>-->
<el-table-column label="询价日期" align="center" prop="quotInquiryDate" width="160"> <el-table-column label="询价日期" align="center" prop="quotInquiryDate" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
@ -63,29 +77,26 @@
<span>{{ parseTime(scope.row.quotQuotationDate) }}</span> <span>{{ parseTime(scope.row.quotQuotationDate) }}</span>
</template> </template>
</el-table-column> </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="createName" width="150px"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="160"> <el-table-column label="创建时间" align="center" prop="createTime" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </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> </el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div> </div>
</template> </template>
<script> <script>
import { listStatisticsQuotQuot } from "@/api/quot/quot"; // import { listStatisticsQuotQuot } from "@/api/quot/quot"; //
import { NumberAdd } from '@/utils/number';// import {toDecimal} from "@/api/redBook/redBook";
import { getNowDate } from '@/utils/date'
export default { export default {
name: "statisticsQuot", name: "statisticsQuot",
data() { data() {
@ -96,16 +107,15 @@ export default {
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
//
dateRange: [getNowDate(),getNowDate()],
// //
quotList: [], quotList: [],
// //
sumQuotMaterialsCount: 0, tableHeight: window.innerHeight - 240, //
// screenHeight: window.innerHeight, //
sumQuotTotalPrice: 0,
// //
queryParams: { queryParams: {
pageNum: 1,
pageSize: 10,
quotCode: null, quotCode: null,
quotCustomerName: null, quotCustomerName: null,
quotSalesmanName: null, quotSalesmanName: null,
@ -120,7 +130,7 @@ export default {
/** 查询报价列表 */ /** 查询报价列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listStatisticsQuotQuot(this.queryParams).then(response => { listStatisticsQuotQuot(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.quotList = response.rows; this.quotList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
@ -136,36 +146,34 @@ export default {
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}
},
computed: {
//
sumQuotMaterialsCount() {
const quotMaterialsCount = this.quotList.reduce((sum, row) => sum + parseFloat(row.quotMaterialsCount==null?0:row.quotMaterialsCount), 0);
return toDecimal(quotMaterialsCount);
}, },
//
/** 对产品数据-数量、金额进行合算 */ sumQuotTotalPrice() {
getSummaries(param) { const quotTotalPrice = this.quotList.reduce((sum, row) => sum + parseFloat(row.quotTotalPrice==null?0:row.quotTotalPrice), 0);
const { columns, data } = param; return toDecimal(quotTotalPrice);
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;
}, },
} },
watch: {
// screenHeighttable
screenHeight(val) {
this.screenHeight = val
this.tableHeight = this.screenHeight - 260
}
},
mounted: function() {
window.onresize = () => {
return (() => {
window.screenHeight = window.innerHeight
this.screenHeight = window.screenHeight
})()
}
},
}; };
</script> </script>