This commit is contained in:
xd 2024-04-17 11:26:49 +08:00
parent 0b80976496
commit 7521b1b76a
1 changed files with 172 additions and 18 deletions

View File

@ -70,22 +70,105 @@
/>
<!-- 添加或修改报价单-核价单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="核价单号" prop="quotHjCode">
<el-input v-model="form.quotHjCode" placeholder="请输入核价单号" />
</el-form-item>
<el-form-item label="核价日期" prop="quotHjPricingDate">
<el-date-picker clearable
v-model="form.quotHjPricingDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择核价日期">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="quotHjRemark">
<el-input v-model="form.quotHjRemark" placeholder="请输入备注" />
</el-form-item>
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-row :gutter="8">
<el-col :span="12">
<el-form-item label="核价单号" prop="quotHjCode">
<el-input v-model="form.quotHjCode" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报价单号" prop="quotCode">
<el-input v-model="form.quotCode" :disabled="true"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="8">
<el-form-item label="核价日期" prop="quotHjPricingDate">
<el-input v-model="form.quotHjPricingDate" placeholder="系统自动生成" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="核价类型" prop="quotHjPricingType">
<el-select v-model="form.quotHjPricingType" style="width: 100%;" :disabled="true">
<el-option
v-for="dict in dict.type.quot_pricing_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="业务员" prop="quotSalesmanName">
<el-input v-model="form.quotSalesmanName" :disabled="true"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="16">
<el-form-item label="客户" prop="quotCustomerName">
<el-input v-model="form.quotCustomerName" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="16">
<el-form-item label="项目名称" prop="quotProject">
<el-input type="textarea" autosize v-model="form.quotProject" :disabled="true"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="24">
<el-form-item label="备注" prop="quotHjRemark">
<el-input type="textarea" autosize v-model="form.quotHjRemark" placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="24">
<el-form-item label="核价附件">
<el-upload class="upload-demo"
ref="upload"
name="quotFile"
:action="uploadUrl"
:headers="headers"
:data="{ relation_id: this.form.quotHjId,file_type: 'quotHjFile' }"
:on-success="handleAvatarSuccess"
:show-file-list="false"
:limit="1"
v-if="this.form.quotHjApprovalStatus == '1'">
<el-button size="small" type="primary">上传文件</el-button>
</el-upload>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="24">
<el-table class="down" :data="quotHjFileList" border stripe style="width: 100%;" height="150px">
<el-table-column prop="fileName" label="文件名称" width="450px"></el-table-column>
<el-table-column prop="fileSize" label="文件大小" width="100px">
<template slot-scope="scope">
<span v-if="scope.row.fileSize / 1024 / 1024 < 1">{{(scope.row.fileSize / 1024).toFixed(2) + 'KB'}}</span>
<span v-else>{{(scope.row.fileSize / 1024 / 1024).toFixed(2) + 'MB'}}</span>
</template>
</el-table-column>
<el-table-column prop="fileTime" label="上传时间"></el-table-column>
<el-table-column width="150px" label="操作">
<template slot-scope="scope">
<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.quotHjApprovalStatus == '1'">
<a @click="deleteFile(scope.row.fileId)">删除</a>
</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -94,9 +177,22 @@
</el-dialog>
</div>
</template>
<style>
/*弹窗设置*/
.el-dialog__body {
padding: 10px 10px;
color: #606266;
font-size: 14px;
word-break: break-all;
overflow-y: auto; /* 自动显示垂直滚动条 */
height: 550px;
max-height: 580px; /* 设置最大高度,根据需要调整 */
}
</style>
<script>
import { listPriceVerification, getPriceVerification, delPriceVerification, addPriceVerification, updatePriceVerification } from "@/api/priceVerification/priceVerification";
import { listPriceVerification, getPriceVerification, updatePriceVerification } from "@/api/priceVerification/priceVerification";
import { getToken } from "@/utils/auth";
import { quotFileList, quotFileDelete} from "@/api/quot/quot";
export default {
name: "PriceVerification",
@ -117,6 +213,12 @@ export default {
total: 0,
// -
priceVerificationList: [],
// -
quotHjFileList: [],
//-
uploadUrl: process.env.VUE_APP_BASE_API + "/quot/quot/quotFile",
//-
headers: {Authorization: "Bearer " + getToken()},
//
title: "",
//
@ -141,6 +243,22 @@ export default {
this.getList();
},
methods: {
/** 清空表单 */
reset(){
this.form = {
quotHjCode: null,
quotCode: null,
quotHjPricingDate: null,
quotHjPricingType: null,
quotSalesmanName: null,
quotCustomerName: null,
quotProject: null,
quotHjRemark: null
};
this.quotHjFileList = [];
this.resetForm("form");
},
/** 查询报价单-核价单列表 */
getList() {
this.loading = true;
@ -178,11 +296,14 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const quotHjId = row.quotHjId || this.ids
getPriceVerification(quotHjId).then(response => {
this.form = response.data;
this.open = true;
this.title = "核价单信息";
this.getQuotHjFileList();
});
},
/** 提交按钮 */
@ -204,6 +325,39 @@ export default {
}
}
});
},
//-
getQuotHjFileList(){
const param = {relationId:this.form.quotHjId,fileType:'quotHjFile'}
quotFileList(param).then(response => {
this.quotHjFileList = response.rows;
});
},
//
handleAvatarSuccess(res) {
//
if (res.code == 200) {
this.$modal.msgSuccess(res.msg);
this.getQuotHjFileList();
} else {
this.$modal.msgError(res.msg);
}
this.$refs.upload.clearFiles(); //****
},
//
downloadFile(fileUrl){
window.open(fileUrl, "_blank");
},
//
deleteFile(fileId){
let activeName = this.activeName;
quotFileDelete(fileId).then(response => {
this.getQuotHjFileList();
});
}
}
};