From 0aec6c3a08d63252cdf83129be26c924689ecb62 Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期二, 28 五月 2024 16:47:28 +0800 Subject: [PATCH] 更改头部 --- admin/src/components/business/OperaHiddenDangerWindow.vue | 281 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 228 insertions(+), 53 deletions(-) diff --git a/admin/src/components/business/OperaHiddenDangerWindow.vue b/admin/src/components/business/OperaHiddenDangerWindow.vue index 78dc481..f004feb 100644 --- a/admin/src/components/business/OperaHiddenDangerWindow.vue +++ b/admin/src/components/business/OperaHiddenDangerWindow.vue @@ -144,33 +144,16 @@ </div> <!-- --> <template v-slot:footer> - <el-button @click="dealDo" type="primary" v-if="model.status==0&& model.checkUserId == userInfo.memberId" class="status-red">澶勭悊</el-button> + <el-button @click="isShowProblem = true" type="primary" v-if="model.status==0&& model.checkUserId == userInfo.memberId" class="status-red">澶勭悊</el-button> <el-button type="primary" plain v-if="model.status==0 && model.checkUserId == userInfo.memberId" @click="handleTransfer">杞氦</el-button> <el-button @click="backDo" v-if="model.status==0&& model.checkUserId == userInfo.memberId" type="danger" >閫�鍥�</el-button> <el-button @click="visible=false">杩斿洖</el-button> </template> - <!-- 鍚屾剰/鎷掔粷 --> - <el-dialog - append-to-body - :title="apprTitle" - :visible.sync="isShowAppr" - width="480px" - > - <el-input - type="textarea" - :placeholder="apprTitle + '璇存槑锛岄潪蹇呭~'" - :rows="4" - v-model="param.explain" - /> - <span slot="footer" class="dialog-footer"> - <el-button @click="isShowAppr = false">鍙栨秷</el-button> - <el-button type="primary" @click="isShowAppr = false">纭畾</el-button> - </span> - </el-dialog> + <el-dialog append-to-body title="杞氦" - style="text-align: center" + class="dialogCl" :visible.sync="isShowTransfer" width="480px" > @@ -188,42 +171,71 @@ </el-form> <span slot="footer" class="dialog-footer"> <el-button @click="isShowTransfer = false">鍙栨秷</el-button> - <el-button type="primary" @click="transferSubmit">纭畾</el-button> + <el-button type="primary" :loading="transfering" @click="transferSubmit">纭畾</el-button> </span> </el-dialog> <!-- 闅愭偅 --> <el-dialog append-to-body - title="闅愭偅" + title="闅愭偅澶勭悊" + class="dialogCl" :visible.sync="isShowProblem" - width="480px" + width="600px" > - <el-form :model="param" :rules="rules" ref="ruleForm" label-width="100px"> - <el-form-item label="閫�鍥炴椂闂�"> + <el-form :model="dealForm" :rules="rulesDeal" ref="dealForm" label-width="100px"> + <el-form-item label="鏁存敼鏃堕棿" prop="checkDate"> <el-date-picker class="w300" - value-format="yyyy-MM-dd" type="date" placeholder="閫夋嫨鏃ユ湡" - v-model="param.date" + v-model="dealForm.checkDate" /> </el-form-item> - <el-form-item label="鏁存敼鍓�"> + <el-form-item label="鏁存敼鍓�" prop="dealBeforeFileList"> <div class="df_ac"> - <img src="@/assets/avatar/man.png" /> - <el-upload - class="avatar-uploader" - action="https://jsonplaceholder.typicode.com/posts/" - :show-file-list="false" - :on-success="handleAvatarSuccess" - :before-upload="beforeAvatarUpload" - > - <img v-if="param.url" :src="param.url" class="avatar" /> - <div v-else class="upload_box"> - <el-icon class="el-icon-plus icon" /> - <div class="text">鍥剧墖/瑙嗛</div> - </div> - </el-upload> + <upload width="80px" height="80px" :list="dealForm.dealBeforeFileList" :tips="'鍥剧墖/瑙嗛'" accept=".png,.jpg,.jpeg,.mp4" folder="hiddendanger" @loading="uploading = true" @dele="dele($event,0)" @success="uploadFileList($event, 0)" /> + </div> + </el-form-item> + <el-form-item label="鏁存敼鍚�" prop="dealAfterFileList"> + <div class="df_ac"> + <upload width="80px" height="80px" :list="dealForm.dealAfterFileList" :tips="'鍥剧墖/瑙嗛'" accept=".png,.jpg,.jpeg,.mp4" folder="hiddendanger" @loading="uploading = true" @dele="dele($event,1)" @success="uploadFileList($event, 1)" /> + </div> + </el-form-item> + <el-form-item label="澶勭悊璇存槑"> + <el-input + type="textarea" + placeholder="璇峰~鍐欒鏄�" + :rows="4" + v-model="dealForm.checkInfo" + /> + </el-form-item> + </el-form> + <span slot="footer" class="dialog-footer"> + <el-button @click="isShowProblem = false">鍙栨秷</el-button> + <el-button type="primary" :loading="dealing" @click="dealDo" + >纭畾</el-button + > + </span> + </el-dialog> + <el-dialog + append-to-body + title="闅愭偅閫�鍥�" + class="dialogCl" + :visible.sync="isBackProblem" + width="480px" + > + <el-form :model="backForm" :rules="rulesBack" ref="backForm" label-width="100px"> + <el-form-item label="閫�鍥炴椂闂�" prop="checkDate"> + <el-date-picker + class="w300" + type="date" + placeholder="閫夋嫨鏃ユ湡" + v-model="backForm.checkDate" + /> + </el-form-item> + <el-form-item label="鏁存敼鍓�" prop="dealBeforeFileList"> + <div class="df_ac"> + <upload width="80px" height="80px" :list="backForm.dealBeforeFileList" :tips="'鍥剧墖/瑙嗛'" accept=".png,.jpg,.jpeg,.mp4" folder="hiddendanger" @loading="uploading = true" @dele="dele($event,2)" @success="uploadFileList($event, 2)" /> </div> </el-form-item> <el-form-item label="閫�鍥炶鏄�"> @@ -231,13 +243,13 @@ type="textarea" placeholder="璇峰~鍐欒鏄�" :rows="4" - v-model="param.explain" + v-model="backForm.checkInfo" /> </el-form-item> </el-form> <span slot="footer" class="dialog-footer"> - <el-button @click="isShowProblem = false">鍙栨秷</el-button> - <el-button type="primary" :loading="transfering" @click="isShowProblem = false" + <el-button @click="isBackProblem= false">鍙栨秷</el-button> + <el-button type="primary" :loading="transfering" @click="backDo" >纭畾</el-button > </span> @@ -248,10 +260,12 @@ <script> import BaseOpera from '@/components/base/BaseOpera' import GlobalWindow from '@/components/common/GlobalWindow' +import upload from '@/components/common/upload' import { memberList } from '@/api/business/hiddenDangerParam' -import {mapMutations} from "vuex"; +import { mapState } from 'vuex' +import { dealHiddenDanger } from '@/api/business/hiddenDanger' export default { - components: { GlobalWindow }, + components: { GlobalWindow, upload }, extends: BaseOpera, data () { return { @@ -264,7 +278,10 @@ isShowAppr: false, apprTitle: '鍚屾剰', param: {}, + uploading: false, + dealing: false, isShowProblem: false, + isBackProblem: false, isShowTransfer: false, rules: {}, rulesTrans: { @@ -272,11 +289,44 @@ { required: true, message: '璇烽�夋嫨' } ] }, + rulesDeal: { + checkDate: [ + { required: true, message: '璇烽�夋嫨鏁存敼鏃堕棿' } + ], + dealBeforeFileList: [ + { required: true, message: '璇蜂笂浼犳暣鏀瑰墠鎯呭喌' } + ], + dealAfterFileList: [ + { required: true, message: '璇蜂笂浼犳暣鏀瑰悗鎯呭喌' } + ] + }, + rulesBack: { + checkDate: [ + { required: true, message: '璇烽�夋嫨閫�鍥炴椂闂�' } + ], + dealBeforeFileList: [ + { required: true, message: '璇蜂笂浼犳暣鏀瑰墠鎯呭喌' } + ] + }, memberList: [], transForm: { memberId: null + }, + dealForm: { + checkDate: null, + checkInfo: null, + dealBeforeFileList: [], + dealAfterFileList: [] + }, + backForm: { + checkDate: null, + checkInfo: null, + dealBeforeFileList: [] } } + }, + computed: { + ...mapState(['userInfo']) }, created () { this.config({ @@ -285,16 +335,141 @@ }) }, methods: { - ...mapMutations(['userInfo']), - dealDo () { this.isShowProblem = true }, - backDo () { this.isShowProblem = true }, + dele (index, type) { + if (type == 0) { + if (this.dealForm.dealBeforeFileList != null && this.dealForm.dealBeforeFileList.length > index) { + this.dealForm.dealBeforeFileList.splice(index, 1) + } + } else if (type == 1) { + if (this.dealForm.dealAfterFileList != null && this.dealForm.dealAfterFileList.length > index) { + this.dealForm.dealAfterFileList.splice(index, 1) + } + } else if (type == 2) { + if (this.backForm.dealAfterFileList != null && this.backForm.dealAfterFileList.length > index) { + this.backForm.dealAfterFileList.splice(index, 1) + } + } + }, + uploadFileList (e, objType) { + if (objType === 0) { + if (this.dealForm.dealBeforeFileList == null) { + this.dealForm.dealBeforeFileList = [] + } + this.dealForm.dealBeforeFileList.push({ + id: this.model.id, + url: e.url, + fileUrl: e.imgaddr, + fileName: e.originname, + fileType: e.type + }) + } else if (objType === 1) { + if (this.dealForm.dealAfterFileList == null) { + this.dealForm.dealAfterFileList = [] + } + this.dealForm.dealAfterFileList.push({ + id: this.model.id, + fileUrl: e.imgaddr, + url: e.url, + fileName: e.originname, + fileType: e.type + }) + } else if (objType === 2) { + if (this.backForm.dealAfterFileList == null) { + this.backForm.dealAfterFileList = [] + } + this.backForm.dealAfterFileList.push({ + id: this.model.id, + fileUrl: e.imgaddr, + url: e.url, + fileName: e.originname, + fileType: e.type + }) + } + }, + dealDo () { + this.$refs.dealForm.validate((valid) => { + // debugger + if (!valid) { + return + } + this.$dialog.actionConfirm('鎿嶄綔纭', '鎮ㄧ‘璁ゆ彁浜よ闅愭偅澶勭悊鎯呭喌鍚楋紵') + .then(() => { + this.transfering = true + this.api.dealHiddenDanger({ + id: this.dataId, + status: 1, + checkDate: this.dealForm.checkDate, + checkInfo: this.dealForm.checkInfo, + dealBeforeFileList: this.dealForm.dealBeforeFileList, + dealAfterFileList: this.dealForm.dealBeforeFileList + }) + .then(res => { + this.$tip.apiSuccess('杞氦鎴愬姛') + this.getDetail() + this.getLogList() + this.isShowTransfer = false + }) + .catch(e => { + }) + .finally(() => { + this.dealing = false + }) + }) + }) + }, + backDo () { + this.$refs.backForm.validate((valid) => { + if (!valid) { + return + } + this.$dialog.actionConfirm('鎿嶄綔纭', '鎮ㄧ‘璁ら��鍥炶闅愭偅澶勭悊鎯呭喌鍚楋紵') + .then(() => { + this.transfering = true + this.api.dealHiddenDanger({ + id: this.dataId, + status: 0, + checkDate: this.backForm.checkDate, + checkInfo: this.backForm.checkInfo, + dealBeforeFileList: this.backForm.dealBeforeFileList + }) + .then(res => { + this.$tip.apiSuccess('杞氦鎴愬姛') + this.getDetail() + this.getLogList() + this.isShowTransfer = false + }) + .catch(e => { + }) + .finally(() => { + this.dealing = false + }) + }) + }) + }, open (title, target) { this.title = title this.visible = true this.model = {} this.dataId = target.id - this.getDetail() - this.getLogList() + this.$nextTick(() => { + this.memberList = [] + this.transForm = { + memberId: null + }, + this.dealForm = { + checkDate: null, + checkInfo: null, + dealBeforeFileList: [], + dealAfterFileList: [] + }, + this.backForm = { + checkDate: null, + checkInfo: null, + dealBeforeFileList: [] + } + this.getDetail() + this.getLogList() + }) }, transferSubmit () { this.$refs.transForm.validate((valid) => { @@ -313,6 +488,7 @@ this.$tip.apiSuccess('杞氦鎴愬姛') this.getDetail() this.getLogList() + this.isShowTransfer = false }) .catch(e => { }) @@ -320,7 +496,6 @@ this.transfering = false }) }) - .catch(() => {}) }) }, getLogList () { -- Gitblit v1.9.3