From b621a2d8fec7fc5c83df8b68829077e7a23eca7e Mon Sep 17 00:00:00 2001
From: JIAL <2287346125@qq.com>
Date: Mon, 24 Jun 2024 11:14:06 +0800
Subject: [PATCH] 1
---
.../mobile/quoteMobile/operation/add.vue | 58 +++++++++++++++++--
1 file changed, 53 insertions(+), 5 deletions(-)
diff --git a/ruoyi-ui/src/views/mobile/quoteMobile/operation/add.vue b/ruoyi-ui/src/views/mobile/quoteMobile/operation/add.vue
index 190eac6..d20b470 100644
--- a/ruoyi-ui/src/views/mobile/quoteMobile/operation/add.vue
+++ b/ruoyi-ui/src/views/mobile/quoteMobile/operation/add.vue
@@ -126,7 +126,7 @@
- 下载
+ 下载
删除
@@ -191,11 +191,13 @@
+
生成报价单
保 存
提 交
+
@@ -229,9 +231,8 @@
import { checkPermi,checkRole} from '@/utils/permission';// 权限判断函数
import CustomerSelect from "@/views/components/Tools/Mobile/CustomerSelect/index.vue";
import { NumberAdd } from '@/utils/number';// 数值计算
-import { changQuotPrintStatus,listQuot, getQuot, getReturnUpdateQuot, delQuot, addQuot, updateQuot, quotFileList, quotFileDelete, commitQuot, commitJsQuot, commitHjQuot, commitJswQuot, commitOAQuot, feedbackQuot, madeQuot, rejectQuot } from "@/api/quot/quot";
+import { changQuotPrintStatus,listQuot, getQuot, getReturnUpdateQuot, delQuot, addQuot, updateQuot, quotFileList, quotFileDelete, commitQuot, commitJsQuot, commitHjQuot, commitJswQuot, commitOAQuot, feedbackQuot, madeQuot, rejectQuot, setHandle } from "@/api/quot/quot";
import { getToken } from "@/utils/auth";
-
import { getDicts } from "@/api/system/dict/data";
/** 导入技术确认单详情组件*/
@@ -377,6 +378,18 @@ export default {
this.productUpload.title = "产品数据导入";
this.productUpload.open = true;
},
+ //下载反馈附件
+ downloadFkFile(fileUrl){
+ const roles = this.$store.state.user.roles;
+ if(roles && roles.indexOf('SALES_MAN') !== -1){//业务员下载附件更新处理状态为1-已处理
+ // 更新报价单状态为已处理
+ setHandle(this.form.quotId).then(response => {
+ window.open(fileUrl, "_blank");
+ })
+ }else{
+ window.open(fileUrl, "_blank");
+ }
+ },
/** 产品数据导出按钮操作 */
handleExportMaterial() {
const quot = {"quotId":this.formData.quotId};
@@ -442,7 +455,42 @@ export default {
this.isVIf = true
}
},
-
+ /** 报价组生成报价单按钮 */
+ madeQuot(){
+ const roles = this.$store.state.user.roles;
+ if(roles && roles.indexOf('SALES_MAN') !== -1){//业务员下载附件更新处理状态为1-已处理
+ // 更新报价单状态为已处理
+ setHandle(this.form.quotId).then(response => {
+ this.madeQuotFile();
+ })
+ }else{
+ this.madeQuotFile();
+ }
+ },
+ madeQuotFile(){
+ this.formData.quotMaterialList = this.quotMaterialList;
+ madeQuot(this.formData).then(response => {
+ this.$modal.msgSuccess("生成报价单成功");
+ // 处理返回的文件流
+ const content = response;
+ const blob = new Blob([content]);
+ const fileName = this.formData.quotCode +".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);
+ }
+ });
+ },
/** 保存按钮 */
saveForm() {
this.$refs["elForm"].validate(valid => {
@@ -467,7 +515,7 @@ export default {
this.$refs["elForm"].validate(valid => {
if (valid) {
if(this.quotXjFileList == 0){
- this.$message.warning("无报价产品 或 未提交询价附件!");
+ this.$message.warning("未提交询价附件!");
return;
}
commitQuot(this.formData).then(response => {