Compare commits

...

2 Commits

Author SHA1 Message Date
JIAL a6d884454b mobile 2024-06-17 10:50:34 +08:00
JIAL 2545023717 mobile 2024-06-17 10:50:02 +08:00
3 changed files with 262 additions and 80 deletions

View File

@ -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' }
}
]
},
]
// 动态路由,基于用户权限动态去加载

View File

@ -16,7 +16,7 @@
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>{{quote.quotCode}}</span>
<el-button style="float: right; padding: 3px 0" type="text" @click="handleEdit(quote.quotCode)">编辑</el-button>
<el-button style="float: right; padding: 3px 0" type="text" @click="handleEdit(quote)">编辑</el-button>
</div>
<div class="text item">
<div v-if="false">订单号Id:{{quote.quotId}}</div>
@ -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)
}
},

View File

@ -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">
<el-button size="small" type="primary" @click="uploadFile('quotXjFile')">上传文件</el-button>
</el-upload>
</div>
@ -64,7 +64,7 @@
<el-button :key="Math.random()" size="small" type="text">
<a @click="downloadFile(scope.row.fileUrl)">下载</a>
</el-button>
<el-button :key="Math.random()" size="small" type="text" v-if="form.quotApprovalStatus == '0'">
<el-button :key="Math.random()" size="small" type="text" v-if="formData.quotApprovalStatus == 0">
<a @click="deleteFile(scope.row.fileId,'quotXjFile')">删除</a>
</el-button>
</template>
@ -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'">
<el-button size="small" type="primary" @click="uploadFile('quotXjFile')">上传文件</el-button>
</el-upload>
</div>
@ -93,7 +93,7 @@
<el-button :key="Math.random()" size="small" type="text">
<a @click="downloadFile(scope.row.fileUrl)">下载</a>
</el-button>
<el-button :key="Math.random()" size="small" type="text" v-if="form.quotApprovalStatus == '0'">
<el-button :key="Math.random()" size="small" type="text" v-if="formData.quotApprovalStatus == '0'">
<a @click="deleteFile(scope.row.fileId,'quotXjFile')">删除</a>
</el-button>
</template>
@ -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'">
<el-button size="small" type="primary" @click="uploadFile('quotXjFile')">上传文件</el-button>
</el-upload>
</div>
@ -122,14 +122,13 @@
<el-button :key="Math.random()" size="small" type="text">
<a @click="downloadFile(scope.row.fileUrl)">下载</a>
</el-button>
<el-button :key="Math.random()" size="small" type="text" v-if="form.quotApprovalStatus == '0'">
<el-button :key="Math.random()" size="small" type="text" v-if="formData.quotApprovalStatus == '0'">
<a @click="deleteFile(scope.row.fileId,'quotXjFile')">删除</a>
</el-button>
</template>
</el-table-column>
</el-table>
<el-form-item style="margin-top: 15px">
<el-button @click="saveForm">保存</el-button>
<el-button style="margin: 0px 15px 0px 20px" type="primary" @click="submitForm">提交</el-button>
@ -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;
})
}
},
},
}