diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index f63ffa7..817a21b 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -129,11 +129,24 @@ export const constantRoutes = [ { path: '', component: () => import('@/views/mobile/quoteMobile/operation/add'), - name: 'quoteMobile', + name: 'quoteMobileAdd', meta: { title: '新建报价单', activeMenu: '/mobile/quoteMobile/operation' } } ] }, + { + path: '/quoteMobile/edit', + component: Layout, + hidden: true, + children: [ + { + path: 'edit/:quotId', + component: () => import('@/views/mobile/quoteMobile/operation/add'), + name: 'quoteMobileEdit', + meta: { title: '编辑报价单', activeMenu: '/mobile/quoteMobile/operation' } + } + ] + }, ] // 动态路由,基于用户权限动态去加载 diff --git a/ruoyi-ui/src/views/mobile/quoteMobile/index.vue b/ruoyi-ui/src/views/mobile/quoteMobile/index.vue index 24a459e..d22c213 100644 --- a/ruoyi-ui/src/views/mobile/quoteMobile/index.vue +++ b/ruoyi-ui/src/views/mobile/quoteMobile/index.vue @@ -16,7 +16,7 @@
{{quote.quotCode}} - 编辑 + 编辑
订单号Id:{{quote.quotId}}
@@ -70,8 +70,10 @@ export default { handleAdd() { this.$router.push('/quoteMobile/add'); }, - handleEdit(quotCode) { - console.log(quotCode) + handleEdit(quote) { + const quotId = quote.quotId + this.$router.push("/quoteMobile/edit/edit/" + quotId); + console.log(quote) } }, diff --git a/ruoyi-ui/src/views/mobile/quoteMobile/operation/add.vue b/ruoyi-ui/src/views/mobile/quoteMobile/operation/add.vue index ac7d409..c988029 100644 --- a/ruoyi-ui/src/views/mobile/quoteMobile/operation/add.vue +++ b/ruoyi-ui/src/views/mobile/quoteMobile/operation/add.vue @@ -53,7 +53,7 @@ :on-success="handleAvatarSuccess" :show-file-list="false" :limit="1" - v-if="this.form.quotApprovalStatus == '0'"> + v-if="this.formData.quotApprovalStatus == 0"> 上传文件
@@ -64,7 +64,7 @@ 下载 - + 删除 @@ -82,7 +82,7 @@ :on-success="handleAvatarSuccess" :show-file-list="false" :limit="1" - v-if="this.form.quotApprovalStatus == '0'"> + v-if="this.formData.quotApprovalStatus === '0'"> 上传文件 @@ -93,7 +93,7 @@ 下载 - + 删除 @@ -111,7 +111,7 @@ :on-success="handleAvatarSuccess" :show-file-list="false" :limit="1" - v-if="this.form.quotApprovalStatus == '0'"> + v-if="this.formData.quotApprovalStatus == '0'"> 上传文件 @@ -122,14 +122,13 @@ 下载 - + 删除 - 保存 提交 @@ -145,6 +144,18 @@ 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 { getToken } from "@/utils/auth"; import { checkPermi,checkRole } from '@/utils/permission';// 权限判断函数 +import { getDicts } from "@/api/system/dict/data"; + +/** 导入技术确认单详情组件*/ +import jsqrDialog from '@/views/technicalConfirm/technicalConfirm/jsxzInfo.vue'; +/** 导入核价单详情组件*/ +import hjDialog from '@/views/priceVerification/priceVerification/hjInfo.vue'; +/** 导入选人组件 */ +import PeopleSelect from "@/views/components/Tools/PeopleSelect/index.vue"; + +/** 弹窗放大、拖拽 */ +import elDragDialog from "@/directive/dialog/dragDialog"; + export default { components: { // 注册组件 @@ -156,15 +167,24 @@ export default { // 表单参数 form: {}, // 报价单-询价附件列表数据 + quotXjFileLoading: false, quotXjFileList: [], // 报价单-反馈附件列表数据 + quotFkFileLoading: false, quotFkFileList: [], // 报价单-技术规范附件列表数据 + quotJsgfFileLoading: false, quotJsgfFileList: [], //报价单-询价附件上传地址 uploadUrl: process.env.VUE_APP_BASE_API + "/quot/quot/quotFile", //报价单-询价附件请求头 headers: {Authorization: "Bearer " + getToken()}, + // 技术协助附件表格数据 + quotJsqrFileList: [], + quotJsqrTlFileNum: 0, + quotJsqrDyFileNum: 0, + quotJsqrZyFileNum: 0, + quotJsqrQtFileNum: 0, //是否打开客户选择组件,默认不打开 customerOpen:false, formData: { @@ -212,53 +232,22 @@ export default { field115fileList: [], field116Action: 'https://jsonplaceholder.typicode.com/posts/', field116fileList: [], + } }, computed: {}, watch: {}, - created() {}, + created() { + const quotId = this.$route.params && this.$route.params.quotId; + if (quotId !== undefined && quotId !== null) { + const row = {'quotId':quotId} + this.handleUpdate(row); + } + + console.log(quotId); + }, mounted() {}, methods: { - //下载附件 - downloadFile(fileUrl){ - window.open(fileUrl, "_blank"); - }, - - //删除附件 - deleteFile(fileId,activeName){ - //let activeName = this.activeName; - quotFileDelete(fileId).then(response => { - if(activeName=='quotXjFile'){ - this.getQuotXjFileList(); - }else if(activeName=='quotJsInfo'){ - this.getQuotJsgfFileList(); - }else if(activeName=='quotFkFile'){ - this.getQuotFkFileList(); - } - }); - }, - //点击上传附件按钮触发事件 - uploadFile(activeName){ - this.activeName = activeName - }, - //成功回调 - handleAvatarSuccess(res) { - let activeName = this.activeName; - // 如果上传成功 - if (res.code == 200) { - this.$modal.msgSuccess(res.msg); - if(activeName=='quotXjFile'){ - this.getQuotXjFileList(); - }else if(activeName=='quotJsInfo'){ - this.getQuotJsgfFileList(); - }else if(activeName=='quotFkFile'){ - this.getQuotFkFileList(); - } - } else { - this.$modal.msgError(res.msg); - } - this.$refs.upload.clearFiles(); //上传成功之后清除历史记录**加粗样式** - }, submitForm() { this.$refs['elForm'].validate(valid => { if (!valid) return @@ -302,34 +291,33 @@ export default { setInfo(response){ console.log(response) this.formData = response.data; - // this.$set(this.form, "quotJsxzGroup", (this.form.quotJsxzGroupValues==''||this.form.quotJsxzGroupValues==null)?[]:this.form.quotJsxzGroupValues.split(',')); - // this.quotMaterialList = response.data.quotMaterialList; - // this.open = true; - // this.activeName = "quotInfo"; - // - // const quotJsxzGroup = this.form.quotJsxzGroupValues; - // if(quotJsxzGroup){ - // if(quotJsxzGroup.indexOf("TL")!==-1){ - // this.showTl = true; - // this.getQuotJsqrFileList('quotJsqrTlFkFile'); - // } - // if(quotJsxzGroup.indexOf("DY")!==-1){ - // this.showDy = true; - // this.getQuotJsqrFileList('quotJsqrDyFkFile'); - // } - // if(quotJsxzGroup.indexOf("ZY")!==-1){ - // this.showZy = true; - // this.getQuotJsqrFileList('quotJsqrZyFkFile'); - // } - // if(quotJsxzGroup.indexOf("QT")!==-1){ - // this.showQt = true; - // this.getQuotJsqrFileList('quotJsqrQtFkFile'); - // } - // } - // this.getQuotXjFileList(); - // this.getQuotJsgfFileList(); - // this.getQuotHjFileList(); - // this.getQuotFkFileList(); + this.$set(this.formData, "quotJsxzGroup", (this.formData.quotJsxzGroupValues==''||this.formData.quotJsxzGroupValues==null)?[]:this.formData.quotJsxzGroupValues.split(',')); + this.open = true; + this.activeName = "quotInfo"; + + const quotJsxzGroup = this.form.quotJsxzGroupValues; + if(quotJsxzGroup){ + if(quotJsxzGroup.indexOf("TL")!==-1){ + this.showTl = true; + this.getQuotJsqrFileList('quotJsqrTlFkFile'); + } + if(quotJsxzGroup.indexOf("DY")!==-1){ + this.showDy = true; + this.getQuotJsqrFileList('quotJsqrDyFkFile'); + } + if(quotJsxzGroup.indexOf("ZY")!==-1){ + this.showZy = true; + this.getQuotJsqrFileList('quotJsqrZyFkFile'); + } + if(quotJsxzGroup.indexOf("QT")!==-1){ + this.showQt = true; + this.getQuotJsqrFileList('quotJsqrQtFkFile'); + } + } + this.getQuotXjFileList(); + this.getQuotJsgfFileList(); + this.getQuotHjFileList(); + this.getQuotFkFileList(); }, /** 保存按钮 */ @@ -351,6 +339,185 @@ export default { } }); }, + + /*********************************附件列表数据展示、上传*****************************************/ + //获取报价单-询价附件列表 + getQuotXjFileList(){ + const param = {relationId:this.form.quotId,fileType:'quotXjFile'} + quotFileList(param).then(response => { + this.quotXjFileList = response.rows; + }); + }, + //获取报价单-反馈附件列表 + getQuotFkFileList(){ + const param = {relationId:this.form.quotId,fileType:'quotFkFile'} + + //协助中状态不显示反馈附件 + if(this.form.quotApprovalStatus!='1' && checkRole(['SALES_MAN'])){ + quotFileList(param).then(response => { + this.quotFkFileList = response.rows; + }); + }else if(checkRole(['QUOT'])){ + quotFileList(param).then(response => { + this.quotFkFileList = response.rows; + }); + } + }, + //获取报价单-技术规范附件列表 + getQuotJsgfFileList(){ + console.log(this.form.quotId) + const param = {relationId:this.form.quotId,fileType:'quotJsgfFile'} + quotFileList(param).then(response => { + this.quotJsgfFileList = response.rows; + }); + }, + //获取报价单-技术确认-反馈附件上传 + getQuotJsqrFileList(fileType){ + const param = {relationId:this.form.quotJsxzConfirmId,fileType:fileType} + quotFileList(param).then(response => { + this.quotJsqrFileList = response.rows; + if('quotJsqrTlFkFile' == fileType){ + this.quotJsqrTlFileNum = response.rows.length; + }else if('quotJsqrDyFkFile' == fileType){ + this.quotJsqrDyFileNum = response.rows.length; + }else if('quotJsqrZyFkFile' == fileType){ + this.quotJsqrZyFileNum = response.rows.length; + }else if('quotJsqrQtFkFile' == fileType){ + this.quotJsqrQtFileNum = response.rows.length; + } + }); + }, + //获取报价单-核价附件列表 + getQuotHjFileList(){ + const param = {relationId:this.form.quotHjId,fileType:'quotHjFile'} + quotFileList(param).then(response => { + this.quotHjFileList = response.rows; + }); + }, + //特缆、低压、中压、其他 反馈附件显示窗口 + handleAddFile(group){ + this.addFileOpen = true; + this.quotJsqrFileList = []; + if("quotJsqrTl"==group){ + this.addFileTitle = '特缆反馈附件' + this.fileType = 'quotJsqrTlFkFile'; + this.uploadDis = (this.form.quotJsqrTlOperateState == 0 ? true : false); + }else if('quotJsqrDy'==group){ + this.addFileTitle = '低压反馈附件' + this.fileType = 'quotJsqrDyFkFile'; + this.uploadDis = (this.form.quotJsqrDyOperateState == 0 ? true : false); + }else if('quotJsqrZy'==group){ + this.addFileTitle = '中压反馈附件' + this.fileType = 'quotJsqrZyFkFile'; + this.uploadDis = (this.form.quotJsqrZyOperateState == 0 ? true : false); + }else if('quotJsqrQt'==group){ + this.addFileTitle = '其他反馈附件' + this.fileType = 'quotJsqrQtFkFile'; + this.uploadDis = (this.form.quotJsqrQtOperateState == 0 ? true : false); + } + // 获取反馈附件 + this.getQuotJsqrFileList(this.fileType); + }, + + //点击上传附件按钮触发事件 + uploadFile(activeName){ + this.activeName = activeName + }, + //上传前校验-反馈附件 + beforeAvatarUploadQuotFkFile(file) { + this.quotFkFileLoading = true; + }, + //上传前校验-清单附件 + beforeAvatarUploadQuotXjFile(file) { + this.quotXjFileLoading = true; + let activeName = this.activeName; + if(activeName=='quotXjFile'){ + if(file.name.split('.')[1].toLowerCase() != 'xls' && file.name.split('.')[1].toLowerCase() != 'xlsx'){ + this.$modal.msgError("清单附件必须是Excel格式"); + this.quotXjFileLoading = false; + return false; + } + } + }, + //上传前校验-清单附件 + beforeAvatarUploadQuotJsgfFile(file){ + this.quotJsgfFileLoading = true; + const maxSize = 100 * 1024 * 1024; // 100MB,根据你的需求设置最大文件大小 + if (file.size > maxSize) { + this.$modal.msgError("文件大小超过了"+maxSize / (1024 * 1024)+"MB的限制"); + this.quotJsgfFileLoading = false; + return false; + } + }, + //成功回调 + handleAvatarSuccess(res) { + let activeName = this.activeName; + // 如果上传成功 + if (res.code == 200) { + this.$modal.msgSuccess(res.msg); + if(activeName=='quotXjFile'){ + this.getQuotXjFileList(); + this.quotXjFileLoading = false; + this.$refs.quotXjFileUpload.clearFiles(); //上传成功之后清除历史记录**加粗样式** + }else if(activeName=='quotJsgfFile'){ + this.getQuotJsgfFileList(); + this.quotJsgfFileLoading = false; + this.$refs.quotJsgfFileUpload.clearFiles(); //上传成功之后清除历史记录**加粗样式** + }else if(activeName=='quotFkFile'){ + this.getQuotFkFileList(); + this.quotFkFileLoading = false; + this.$refs.quotFkFileUpload.clearFiles(); //上传成功之后清除历史记录**加粗样式** + } + } else { + this.$modal.msgError(res.msg); + if(activeName=='quotXjFile'){ + this.quotXjFileLoading = false; + this.$refs.quotXjFileUpload.clearFiles(); //上传成功之后清除历史记录**加粗样式** + }else if(activeName=='quotJsgfFile'){ + this.quotJsgfFileLoading = false; + this.$refs.quotJsgfFileUpload.clearFiles(); //上传成功之后清除历史记录**加粗样式** + }else if(activeName=='quotFkFile'){ + this.quotFkFileLoading = false; + this.$refs.quotFkFileUpload.clearFiles(); //上传成功之后清除历史记录**加粗样式** + } + } + }, + + /** 产品数据文件上传成功处理 */ + handleFileSuccess(response, file, fileList) { + this.productUpload.open = false; + this.productUpload.isUploading = false; + this.$refs.productUpload.clearFiles(); + this.$message.success("产品数据导入成功!"); + this.quotMaterialList = this.quotMaterialList.concat(response.data) + }, + //下载附件 + downloadFile(fileUrl){ + window.open(fileUrl, "_blank"); + }, + + //删除附件 + deleteFile(fileId,activeName){ + if(activeName=='quotXjFile'){ + this.quotXjFileLoading = true; + quotFileDelete(fileId).then(response => { + this.getQuotXjFileList(); + this.quotXjFileLoading = false; + }) + }else if(activeName=='quotJsgfFile'){ + this.quotJsgfFileLoading = true; + quotFileDelete(fileId).then(response => { + this.getQuotJsgfFileList(); + this.quotJsgfFileLoading = false; + }) + }else if(activeName=='quotFkFile'){ + this.quotFkFileLoading = true; + quotFileDelete(fileId).then(response => { + this.getQuotFkFileList(); + this.quotFkFileLoading = false; + }) + } + }, }, }