|
@@ -0,0 +1,121 @@
|
|
|
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
|
|
|
+ <div>
|
|
|
+ <el-dialog
|
|
|
+ :title="title"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ draggable
|
|
|
+ width="1000px"
|
|
|
+ height="500px"
|
|
|
+ @close="close"
|
|
|
+ append-to-body
|
|
|
+ v-model="visible">
|
|
|
+
|
|
|
+ <el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="status === 'audit' || status === 'taskFormDetail'"
|
|
|
+ label-width="135px" @submit.native.prevent>
|
|
|
+ <el-row :gutter="0">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="年份" prop="year"
|
|
|
+ :rules="[{required: true, message:'请输入年份', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-input v-model="inputForm.year" @input="validateNumber" placeholder="请填写年份" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="0">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="附件">
|
|
|
+ <el-upload
|
|
|
+ action=""
|
|
|
+ :auto-upload="false"
|
|
|
+ :on-change="beforeUploadDetail"
|
|
|
+ :show-file-list="true">
|
|
|
+ <el-button type="primary">导入全部</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+
|
|
|
+ <template #footer>
|
|
|
+ <span class="dialog-footer">
|
|
|
+ <el-button @click="close()" icon="el-icon-circle-close">关闭</el-button>
|
|
|
+ <el-button v-if="method !== 'view'" type="primary" icon="el-icon-circle-check" @click="doSubmit()">确定</el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import projectReportService from '@/api/cw/reportManagement/ProjectReportService'
|
|
|
+ export default {
|
|
|
+ data(){
|
|
|
+ return {
|
|
|
+ visible: false,
|
|
|
+ title: '',
|
|
|
+ inputForm:{
|
|
|
+ year:"",
|
|
|
+ file:[]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init(){
|
|
|
+ this.visible = true
|
|
|
+ this.title = '报告号替换'
|
|
|
+ this.inputForm={
|
|
|
+ year:'',
|
|
|
+ file:[]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ validateNumber() {
|
|
|
+ // 只允许输入数字
|
|
|
+ this.inputForm.year = this.inputForm.year.replace(/\D/g, '');
|
|
|
+ },
|
|
|
+ beforeUploadDetail(file){
|
|
|
+ this.inputForm.file.push(file)
|
|
|
+ },
|
|
|
+ doSubmit(){
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.year)) {
|
|
|
+ this.$message.warning('年份不可以为空,请输入年份')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const formBody = new FormData()
|
|
|
+ formBody.append('file', this.inputForm.file[0].raw)
|
|
|
+ formBody.append('year', this.inputForm.year)
|
|
|
+ let filename = this.inputForm.file[0].raw.name
|
|
|
+ projectReportService.numberReplace(formBody).then((data) =>{
|
|
|
+ if (data){
|
|
|
+ this.$utils.downloadExcel(data, filename)
|
|
|
+ this.$message.success('报告号替换成功')
|
|
|
+ this.visible = false
|
|
|
+ this.$emit("refreshList");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ close(){
|
|
|
+ this.visible = false
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ this.inputForm = {
|
|
|
+ file:[]
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+ /deep/ .el-input-number .el-input__inner {
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+ .el-row {
|
|
|
+ display: flex;
|
|
|
+ align-items: center; /* 垂直居中 */
|
|
|
+ }
|
|
|
+</style>
|