From 561b46d42e9a1b633f0428911045898b8270dfa2 Mon Sep 17 00:00:00 2001
From: 安瑾然 <107107765@qq.com>
Date: 星期四, 21 七月 2022 17:34:55 +0800
Subject: [PATCH] login
---
src/views/common/Audit.vue | 291 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 276 insertions(+), 15 deletions(-)
diff --git a/src/views/common/Audit.vue b/src/views/common/Audit.vue
index b246b88..9a6b812 100644
--- a/src/views/common/Audit.vue
+++ b/src/views/common/Audit.vue
@@ -36,7 +36,7 @@
<el-table-column prop="id" label="搴忓彿" width="60"></el-table-column>
<el-table-column width="80" prop="pic" label="澶村儚">
<template slot-scope="scope">
- <img :src="scope.row.pic | fileNameToPath" style="width: 40px;height: 40px; border-radius: 50%;">
+ <img :src="scope.row.pic" style="width: 40px;height: 40px; border-radius: 50%;">
</template>
</el-table-column>
<el-table-column width="80" prop="reporterName" label="鎶ユ浜�"></el-table-column>
@@ -76,22 +76,161 @@
:total="total"></el-pagination>
</el-card>
<!--娣诲姞浜哄憳寮圭獥-->
- <el-dialog
- title="鎻愮ず"
- :visible.sync="addAduitDialogVisible"
- width="30%"
- :before-close="addAduitClose">
- <span>杩欐槸涓�娈典俊鎭�</span>
+ <el-dialog title="娣诲姞浜哄憳" :visible.sync="addAduitDialogVisible" width="50%" :before-close="addAduitClose">
+ <el-row :gutter="15">
+ <el-form ref="addAduitForm" :model="auditFrom" :rules="rules" size="medium" label-width="100px">
+ <el-col :span="12">
+ <el-form-item label="澶村儚" prop="pic" required>
+ <el-upload ref="pic" action="/api/minio/upload" :show-file-list="false" :on-success="handleAvatarSuccess"
+ list-type="picture-card" accept="image/*">
+ <img v-if="picShow" :src="picShow" style="width: 145px;height: 145px">
+ <i v-else class="el-icon-plus"></i>
+ </el-upload>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鎶ユ浜� " prop="reporterName">
+ <el-input v-model="auditFrom.reporterName" placeholder="璇疯緭鍏ユ姤妗堜汉 " clearable
+ :style="{width: '100%'}"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鎵嬫満鍙风爜" prop="mobile">
+ <el-input v-model="auditFrom.mobile" placeholder="璇疯緭鍏ユ墜鏈哄彿鐮�" clearable :style="{width: '100%'}">
+ </el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="韬唤璇佸彿" prop="idcard">
+ <el-input v-model="auditFrom.idcard" placeholder="璇疯緭鍏ヨ韩浠借瘉鍙�" clearable :style="{width: '100%'}">
+ </el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="琚獥鏃堕棿" prop="cheatTime">
+ <el-date-picker v-model="auditFrom.tmpTime" type="datetime" placeholder="閫夋嫨鏃ユ湡鏃堕棿"
+ :style="{width: '100%'}" format="yyyy-MM-dd HH:mm:ss"
+ :value-format="auditFrom.cheatTime"></el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="娑夋閲戦" prop="amountInvolved">
+ <el-input v-model="auditFrom.amountInvolved" placeholder="璇疯緭鍏ユ秹妗堥噾棰�" clearable
+ :style="{width: '100%'}"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="妗堜欢鎻忚堪" prop="reportDescription">
+ <el-input v-model="auditFrom.reportDescription" placeholder="璇疯緭鍏ユ浠舵弿杩�" clearable
+ :style="{width: '100%'}"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="琛ュ厖淇℃伅" prop="information">
+ <el-input v-model="auditFrom.information" type="textarea" placeholder="璇疯緭鍏ヨˉ鍏呬俊鎭�"
+ :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="涓婁紶" prop="fileList" required>
+ <el-upload ref="reportMaterials" :file-list="auditFrom.fileList"
+ action="/api/minio/upload" list-type="picture" :on-success="handleMaterialSuccess">
+ <el-button size="small" type="primary" icon="el-icon-upload">鐐瑰嚮涓婁紶</el-button>
+ </el-upload>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="鍏宠仈妗堜欢" prop="causeId">
+ <el-select v-model="auditFrom.causeId" placeholder="璇烽�夋嫨涓嬫媺閫夋嫨" clearable :style="{width: '50%'}">
+ <el-option v-for="item in causeOptions" :key="item.id" :label="item.name"
+ :value="item.id"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-form>
+ </el-row>
<span slot="footer" class="dialog-footer">
- <el-button @click="addAduitDialogVisible = false">鍙� 娑�</el-button>
- <el-button type="primary" @click="addAduitDialogVisible = false">纭� 瀹�</el-button>
- </span>
+ <el-button @click="addAduitDialogVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="addAduit">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ <!--鏌ョ湅璇︽儏寮圭獥-->
+ <el-dialog title="妗堜欢璇︽儏" :visible.sync="infoAduitDialogVisible" width="50%" :before-close="infoAduitClose">
+ <el-row :gutter="15">
+ <el-form ref="infoAduitForm" :model="auditInfo" size="medium" label-width="100px">
+ <el-col :span="12">
+ <el-form-item label="澶村儚" prop="pic" required>
+ <el-upload ref="pic" action="/api/minio/upload" :show-file-list="false" :on-success="handleAvatarSuccess"
+ list-type="picture-card" accept="image/*" disabled>
+ <el-image style="width: 145px; height: 145px" :src="picShow"
+ :preview-src-list="new Array(picShow)"></el-image>
+ </el-upload>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鎶ユ浜� ">
+ <el-input v-model="auditInfo.reporterName" disabled
+ :style="{width: '100%'}"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鎵嬫満鍙风爜">
+ <el-input v-model="auditInfo.mobile" disabled :style="{width: '100%'}">
+ </el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="韬唤璇佸彿">
+ <el-input v-model="auditInfo.idcard" disabled :style="{width: '100%'}">
+ </el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="琚獥鏃堕棿">
+ <el-date-picker v-model="auditInfo.tmpTime" type="datetime" placeholder="閫夋嫨鏃ユ湡鏃堕棿"
+ :style="{width: '100%'}" format="yyyy-MM-dd HH:mm:ss"
+ :value-format="auditFrom.cheatTime" disabled></el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="娑夋閲戦">
+ <el-input v-model="auditInfo.amountInvolved" placeholder="璇疯緭鍏ユ秹妗堥噾棰�"
+ :style="{width: '100%'}" disabled></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="妗堜欢鎻忚堪">
+ <el-input v-model="auditInfo.reportDescription" placeholder="璇疯緭鍏ユ浠舵弿杩�"
+ :style="{width: '100%'}" disabled></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="琛ュ厖淇℃伅">
+ <el-input v-model="auditInfo.information" type="textarea" placeholder="璇疯緭鍏ヨˉ鍏呬俊鎭�"
+ :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}" disabled></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="鏉愭枡">
+ <div class="metalL"></div>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="鍏宠仈妗堜欢" prop="causeId">
+ <el-select v-model="auditFrom.causeId" placeholder="璇烽�夋嫨涓嬫媺閫夋嫨" clearable :style="{width: '50%'}" disabled>
+ <el-option v-for="item in causeOptions" :key="item.id" :label="item.name"
+ :value="item.id"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-form>
+ </el-row>
</el-dialog>
</div>
</template>
<script>
-import {getAuditList} from '@/api/common'
+import {getAuditList, getImgUrl, getReportById, report} from '@/api/common'
export default {
name: "Audit",
@@ -103,8 +242,24 @@
isInGroup: '5',
current: 1,
HavaMaterial: '5',
- size: 10
+ size: 10,
},
+ auditFrom: {
+ pic: '',
+ reporterName: '',
+ mobile: '',
+ idcard: '',
+ cheatTime: '',
+ amountInvolved: '',
+ reportDescription: '',
+ information: '',
+ reportMaterials: "",
+ causeId: '',
+ fileList: [],
+ tmpTime: '',
+ },
+ auditInfo: {},
+ picShow: "",
optionsGroup: [
{
value: '5',
@@ -136,14 +291,96 @@
total: 0,
list: [],
addAduitDialogVisible: false,
+ infoAduitDialogVisible: false,
+ causeOptions: [],
+ rules: {
+ reporterName: [{
+ required: true,
+ message: '璇疯緭鍏ユ姤妗堜汉 ',
+ trigger: 'blur'
+ }],
+ mobile: [{
+ required: true,
+ message: '璇疯緭鍏ユ墜鏈哄彿鐮�',
+ trigger: 'blur'
+ }],
+ idcard: [{
+ required: true,
+ message: '璇疯緭鍏ヨ韩浠借瘉鍙�',
+ trigger: 'blur'
+ }],
+ tmpTime: [{
+ required: true,
+ message: '璇疯緭鍏ヨ楠楁椂闂�',
+ trigger: 'blur'
+ }],
+ amountInvolved: [{
+ required: true,
+ message: '璇疯緭鍏ユ秹妗堥噾棰�',
+ trigger: 'blur'
+ }],
+ reportDescription: [{
+ required: true,
+ message: '璇疯緭鍏ユ浠舵弿杩�',
+ trigger: 'blur'
+ }],
+ information: [{
+ required: true,
+ message: '璇疯緭鍏ヨˉ鍏呬俊鎭�',
+ trigger: 'blur'
+ }],
+ causeId: [{
+ required: true,
+ message: '璇烽�夋嫨涓嬫媺閫夋嫨',
+ trigger: 'change'
+ }],
+ },
}
},
created() {
this.getList()
+ this.getCauseOptions()
},
methods: {
+ infoAduitClose() {
+ this.infoAduitDialogVisible = false
+ this.$refs.infoAduitForm.resetFields()
+ },
+ addAduit() {
+ this.$refs.addAduitForm.validate(async (vaild) => {
+ if (!vaild) return this.$message.error('杈撳叆鏈夎')
+ this.auditFrom.reportMaterials = this.auditFrom.fileList.map(i => i.data).join(',')
+ report(this.auditFrom).then(res => {
+ this.$message.success('鎻愪氦鎴愬姛')
+ this.addAduitDialogVisible = false
+ this.getList()
+ }).catch(err => {
+ this.addAduitClose()
+ })
+ })
+ },
+ async getCauseOptions() {
+ const {data: data} = await this.$http.get('/api/cause/getCauseIdAndName');
+ this.causeOptions = data.data;
+ },
+ handleAvatarSuccess(res, file) {
+ this.auditFrom.pic = res.data
+ console.log(res.data)
+ getImgUrl(res.data).then(res => {
+ this.picShow = res
+ })
+ },
+ async handleMaterialSuccess(res, file) {
+ this.auditFrom.fileList.push({
+ name: file.name,
+ url: await getImgUrl(res.data),
+ data: res.data
+ })
+ },
addAduitClose() {
this.addAduitDialogVisible = false
+ this.$refs.addAduitForm.resetFields()
+ this.picShow = ""
},
getList() {
let param = {}
@@ -156,6 +393,15 @@
getAuditList(param).then(res => {
this.total = res.total
this.list = res.records
+ this.list.forEach(x => {
+ if (x.pic === '' || x.pic === null) {
+ x.pic = './logo.png';
+ } else {
+ getImgUrl(x.pic).then(res => {
+ x.pic = res
+ })
+ }
+ })
})
},
search() {
@@ -171,11 +417,21 @@
this.getList();
},
details(id) {
- console.log(id)
+ getReportById(id).then(res => {
+ this.auditInfo = res
+ if (res.pic === '' || res.pic === null) {
+ this.picShow = './logo.png';
+ } else {
+ getImgUrl(res.pic).then(res => {
+ this.picShow = res
+ })
+ }
+ this.infoAduitDialogVisible = true
+ })
},
audit(id) {
console.log(id)
- }
+ },
}
}
</script>
@@ -188,4 +444,9 @@
.demo-form-inline .el-select {
width: 100px;
}
-</style>
\ No newline at end of file
+
+.el-form-item {
+ margin-top: 20px;
+}
+
+</style>
--
Gitblit v1.8.0