This commit is contained in:
parent
1c7ba447b1
commit
b621a2d8fe
|
@ -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 => {
|
||||
|
|
Loading…
Reference in New Issue