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-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-form-item label="核价单号" prop="quotHjCode"> <el-row :gutter="8">
<el-input v-model="form.quotHjCode" placeholder="请输入核价单号" /> <el-col :span="12">
</el-form-item> <el-form-item label="核价单号" prop="quotHjCode">
<el-form-item label="核价日期" prop="quotHjPricingDate"> <el-input v-model="form.quotHjCode" :disabled="true"/>
<el-date-picker clearable </el-form-item>
v-model="form.quotHjPricingDate" </el-col>
type="date" <el-col :span="12">
value-format="yyyy-MM-dd" <el-form-item label="报价单号" prop="quotCode">
placeholder="请选择核价日期"> <el-input v-model="form.quotCode" :disabled="true"/>
</el-date-picker> </el-form-item>
</el-form-item> </el-col>
<el-form-item label="备注" prop="quotHjRemark"> </el-row>
<el-input v-model="form.quotHjRemark" placeholder="请输入备注" /> <el-row :gutter="8">
</el-form-item> <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> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -94,9 +177,22 @@
</el-dialog> </el-dialog>
</div> </div>
</template> </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> <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 { export default {
name: "PriceVerification", name: "PriceVerification",
@ -117,6 +213,12 @@ export default {
total: 0, total: 0,
// - // -
priceVerificationList: [], priceVerificationList: [],
// -
quotHjFileList: [],
//-
uploadUrl: process.env.VUE_APP_BASE_API + "/quot/quot/quotFile",
//-
headers: {Authorization: "Bearer " + getToken()},
// //
title: "", title: "",
// //
@ -141,6 +243,22 @@ export default {
this.getList(); this.getList();
}, },
methods: { 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() { getList() {
this.loading = true; this.loading = true;
@ -178,11 +296,14 @@ export default {
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset();
const quotHjId = row.quotHjId || this.ids const quotHjId = row.quotHjId || this.ids
getPriceVerification(quotHjId).then(response => { getPriceVerification(quotHjId).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "核价单信息"; 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();
});
} }
} }
}; };