This commit is contained in:
JIAL 2024-06-24 11:14:06 +08:00
parent 1c7ba447b1
commit b621a2d8fe
1 changed files with 53 additions and 5 deletions

View File

@ -126,7 +126,7 @@
<el-table-column width="150px" label="操作">
<template slot-scope="scope">
<el-button size="small" type="text">
<a @click="downloadFile(scope.row.fileUrl)">下载</a>
<a @click="downloadFkFile(scope.row.fileUrl)">下载</a>
</el-button>
<el-button size="small" type="text" @click="deleteFile(scope.row.fileId,'quotFkFile')" v-if="formData.quotApprovalStatus == '1'">删除</el-button>
</template>
@ -191,11 +191,13 @@
</template>
</el-table-column>
</el-table>
<div style="margin-top: 5px" v-hasPermi="['quot:quot:madeQuot']"><el-button type="warning" plain @click="madeQuot" v-if="this.formData.quotApprovalStatus == '2'||!checkRole(['SALES_MAN'])">生成报价单</el-button></div>
<el-form-item style="margin-top: 15px">
<span v-hasPermi="['quot:quot:save']"><el-button @click="saveForm" v-if="this.formData.quotApprovalStatus == '0' || this.formData.quotApprovalStatus == null"> </el-button></span>
<span style="margin-left: 10px" v-hasPermi="['quot:quot:commit']"><el-button type="primary" plain @click="commitForm" v-if="this.formData.quotApprovalStatus == '0' || this.formData.quotApprovalStatus == null"> </el-button></span>
</el-form-item>
</el-form>
<CustomerSelect :width="100 + '%'" ref="customerSelect" :open="customerOpen" @submit="submitCustomer" @cancel="customerOpen=false"></CustomerSelect>
<!-- 产品导入对话框 -->
<el-dialog :title="productUpload.title" :visible.sync="productUpload.open" width="400px" append-to-body>
@ -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 => {