From 5035dde1c77b21c79a32a2e4802f0a1e85931c46 Mon Sep 17 00:00:00 2001 From: odc.xiaohui <xiaohui@Q1> Date: 星期二, 07 三月 2023 17:25:01 +0800 Subject: [PATCH] 隐藏导入 --- src/views/cause/Entry.vue | 100 ++++++++++++++++++++++++++++++++----------------- 1 files changed, 65 insertions(+), 35 deletions(-) diff --git a/src/views/cause/Entry.vue b/src/views/cause/Entry.vue index be937ec..daf7636 100644 --- a/src/views/cause/Entry.vue +++ b/src/views/cause/Entry.vue @@ -16,13 +16,13 @@ <el-button type="primary" @click="search">鏌ヨ</el-button> </el-form-item> <el-form-item> - <el-button type="primary" @click="addAduitDialogVisible = true">娣诲姞</el-button> + <el-button type="primary" @click="addAduitAnJian">娣诲姞</el-button> </el-form-item> <el-form-item> <el-upload name="multipartFile" class="upload-demo" action="/api/cause/upload " :show-file-list="false" :before-upload="beforeAvatarUpload" :on-success="respond" :limit="1"> - <el-button type="primary">瀵煎叆</el-button> +<!-- <el-button type="primary">瀵煎叆</el-button>--> </el-upload> </el-form-item> </el-form> @@ -35,7 +35,7 @@ </el-table-column> <el-table-column prop="reportNumber" label="鎶ユ浜烘暟" width="100" header-align="center" align="center"> </el-table-column> - <el-table-column prop="totalMoney" label="棰勪及鎬婚噾棰�" width="100" header-align="center" align="center"> + <el-table-column prop="totalMoney" label="棰勪及鎬婚噾棰�" width="100" header-align="center" align="center"> </el-table-column> <el-table-column prop="firstTime" label="鏈�鏃╁彂妗堟棩鏈�" width="160" header-align="center" align="center"> </el-table-column> @@ -83,9 +83,10 @@ </el-input> </el-form-item> </el-col> - <el-col :span="12"> + <el-col :span="12"> <el-form-item label="棰勪及鎬婚噾棰�" prop="totalMoney"> - <el-input v-model="causeForm.totalMoney" clearable :style="{ width: '100%' }" placeholder="杈撳叆棰勪及鎬婚噾棰�"></el-input> + <el-input v-model="causeForm.totalMoney" clearable :style="{ width: '100%' }" + placeholder="杈撳叆棰勪及鎬婚噾棰�"></el-input> </el-form-item> </el-col> <el-col :span="12"> @@ -111,7 +112,7 @@ </el-select> </el-form-item> </el-col> - + <el-col :span="24"> <el-form-item label="妗堜欢鎻忚堪" prop="description"> <el-input v-model="causeForm.description" type="textarea" placeholder="璇疯緭鍏ュ琛屾枃鏈�" @@ -143,7 +144,7 @@ </el-input> </el-form-item> </el-col> - <el-col :span="12"> + <el-col :span="12"> <el-form-item label="棰勪及鎬婚噾棰�" prop="totalMoney"> <el-input v-model="updataCauseForm.totalMoney" clearable :style="{ width: '100%' }"></el-input> </el-form-item> @@ -224,7 +225,7 @@ <el-upload name="multipartFile" class="upload-demo" action="/api/cause/reporterUpload" :show-file-list="false" :data="{ causeId: this.reportCauseId }" :before-upload="beforeAvatarUpload" :on-success="reporterRespond" :limit="1"> - <el-button type="primary">瀵煎叆</el-button> +<!-- <el-button type="primary">瀵煎叆</el-button>--> </el-upload> </el-form-item> <el-form-item> @@ -261,7 +262,8 @@ </el-table-column> <el-table-column width="100" prop="reportMaterials" label="鎶ユ鏉愭枡"> <template slot-scope="scope"> - <span>{{ scope.row.reportMaterials === null ? "鏈彁浜�" : "宸叉彁浜�" }}</span> + <span>{{ scope.row.reportMaterials === null || scope.row.reportMaterials === '' ? "鏈彁浜�" : "宸叉彁浜�" +}}</span> </template> </el-table-column> <el-table-column width="200" prop="reportTime" label="鎶ユ鏃堕棿"> @@ -289,15 +291,15 @@ :before-close="addReportVisibleClose"> <el-row :gutter="15"> <el-form ref="auditFrom" :model="auditFrom" :rules="addReportRules" 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="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%' }"> @@ -362,31 +364,42 @@ :before-close="updateReportVisibleclose"> <el-row :gutter="20"> <el-form ref="updateReportForm" :model="updateReportForm" size="medium" label-width="100px"> - <!-- <el-col :span="12"> + <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="updateReportForm.pic!=null||updateReportForm!=''" :src="updateReportForm.pic" 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 v-model="updateReportForm.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 v-model="updateReportForm.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 v-model="updateReportForm.idcard" placeholder="璇疯緭鍏ヨ韩浠借瘉鍙�" clearable :style="{ width: '100%' }"> </el-input> </el-form-item> - </el-col> --> - <el-col :span="12"> + </el-col> + + <!-- <el-col :span="12"> <el-form-item prop="reportTime" label="鎶ユ鏃堕棿"> <el-date-picker v-model="updateReportForm.reportTime" type="datetime" placeholder="閫夋嫨鏃ユ湡鏃堕棿" clearable :style="{ width: '100%' }" value-format="yyyy-MM-dd HH:mm:ss"> </el-date-picker> </el-form-item> - </el-col> + </el-col> --> <el-col :span="12"> <el-form-item label="琚獥鏃堕棿" prop="cheatTime"> <el-date-picker v-model="updateReportForm.cheatTime" type="datetime" placeholder="閫夋嫨鏃ユ湡鏃堕棿" clearable @@ -420,8 +433,7 @@ </el-upload> </el-form-item> </el-col> - <!-- - <el-col :span="24"> + <!-- <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"> @@ -591,9 +603,9 @@ </el-col> <el-col :span="12"> <el-form-item label="鐘舵��" prop="status"> - <span v-if="detailsGroupAn.status === 1">宸插彂甯�</span> - <span v-else-if="detailsGroupAn.status === 0">鏈彂甯�</span> - <span v-else="detailsGroupAn.status === 2">宸蹭笅鏋�</span> + <span v-if="detailsGroupAn.status === 1">宸插彂甯�</span> + <span v-else-if="detailsGroupAn.status === 0">鏈彂甯�</span> + <span v-else="detailsGroupAn.status === 2">宸蹭笅鏋�</span> </el-form-item> </el-col> </el-form> @@ -729,6 +741,7 @@ size: 10, }, auditFrom: { + pic: '', reporterName: '', mobile: '', idcard: '', @@ -824,7 +837,7 @@ message: '璇烽�夋嫨妗堜欢鐘舵�� ', trigger: 'blur' }], - totalMoney: [{ + totalMoney: [{ required: true, message: '璇疯緭鍏ラ浼版�婚噾棰� ', trigger: 'blur' @@ -890,6 +903,7 @@ } ], updateReportForm: { + pic: '', reporterName: '', mobile: '', idcard: '', @@ -905,6 +919,7 @@ //妗堜欢浜哄憳琛ㄦ牸鏁版嵁 updateReportPrams: { id: '', + pic:'', reporterName: '', mobile: '', idcard: '', @@ -930,6 +945,7 @@ }, updataCauseForm: { id: '', + pic:'', name: '', number: '', firstTime: '', @@ -1075,6 +1091,18 @@ }, methods: { + addAduitAnJian(){ + let date=(new Date()).valueOf();//鑾峰彇鏃堕棿鎴� + let txt = '1234567890';//鐢熸垚鐨勯殢鏈烘満鍣ㄧ爜 + let len =13;//鏈哄櫒鐮佹湁澶氬皯浣� + let pwd = '';//瀹氫箟绌哄彉閲忕敤鏉ユ帴鏀舵満鍣ㄧ爜 + for (let i = 0; i < len; i++) { + pwd += txt.charAt(Math.floor(Math.random() * txt.length));//寰幆鏈哄櫒鐮佷綅鏁伴殢鏈哄~鍏� + } + let id= date+pwd; + this.causeForm.number=id; + this.addAduitDialogVisible=true; + }, //鍏抽棴妗堜欢鐨勬浠朵汉鍛樻坊鍔� addReportVisibleClose() { @@ -1214,6 +1242,8 @@ this.updateReportPrams.groupId = this.updateReportForm.groupId this.updateReportPrams.id = this.updateReportForm.id this.updateReportPrams.reportMaterials = this.updateReportPrams.fileList.map(i => i.data).join(',') + + this.updateReportPrams.pic=this.updateReportForm.pic let form = null; form = this.updateReportPrams; const data = form; @@ -1274,7 +1304,7 @@ if (!vaild) return this.$message.error('杈撳叆鏈夎') this.auditFrom.reportMaterials = this.auditFrom.fileList.map(i => i.data).join(','); this.auditFrom.causeId = this.reportCauseId; - console.log(this.reportCauseId); + // console.log(this.reportCauseId); report(this.auditFrom).then(res => { this.$message.success('鎻愪氦鎴愬姛') this.auditFrom = {} @@ -1292,9 +1322,9 @@ }, handleAvatarSuccess(res, file) { this.auditFrom.pic = res.data - getImgUrl(res.data).then(res => { this.picShow = res + this.updateReportForm.pic = res }) }, async handleMaterialSuccess(res, file) { @@ -1364,7 +1394,7 @@ } else { this.$message({ type: "error", - message: "琛ㄥ崟涓嶈兘涓虹┖" + message: res.data.msg }) } } @@ -1589,4 +1619,4 @@ ::v-deep(.el-table thead) { color: #000000; } -</style> \ No newline at end of file +</style> -- Gitblit v1.8.0