| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681 |
- <template>
- <!-- 修改弹框 -->
- <el-dialog
- width="60%"
- class="outerDialog custom_dialog"
- title="修改督查问题"
- :modal = true
- @close="closeModal"
- :append-to-body = true
- :visible.sync="changeSupervisionVisible">
- <div class="scroll_wrapper">
- <div
- style="width:49%;overflow-y:auto;max-height:58vh;float:left;border:1px solid #d5d5ff;margin-right:5px;">
- <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">基本信息</p>
- <el-form ref="changeSupFrom" :rules="rules1" :model="changeSupervision" label-width="120px">
- <el-form-item label="督查对象名称">
- <el-input v-model="changeSupervision.nm" clearable :readonly="true"></el-input>
- </el-form-item>
- <el-form-item label="问题类别" prop="inspPblmsName">
- <el-select v-model="t1" value-key="inspPblmsName" placeholder="请选择" @change="problemListChange">
- <el-option v-for="(item,index) in problemList" :key="index" :label="item.inspPblmsName" :value="item">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="检查项目" prop="checkPoint" style="text-align:left">
- <el-select v-model="t2" placeholder="请选择" value-key="checkPointName" @change="currentCheckPointListChange">
- <el-option v-for="(item,index) in currentCheckPointList" :key="index" :label="item.checkPointName" :value="item">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="详细描述" prop="inspPblmDesc">
- <el-input type="textarea" :rows="2" v-model="changeSupervision.inspPblmDesc" clearable></el-input>
- </el-form-item>
- <el-form-item label="上报人" prop="persName">
- <el-input
- resize="none"
- type="input"
- :rows="3"
- readonly
- placeholder="请输入"
- v-model.trim="changeSupervision.persName"
- ></el-input>
- </el-form-item>
- <el-form-item label="上报时间" prop="collTime">
- <el-date-picker v-model="changeSupervision.collTime" readonly type="date"></el-date-picker>
- </el-form-item>
- </el-form>
- </div>
- <div
- style="width: 49%;float: left;border: 1px solid rgb(213, 213, 255);margin-right: 5px;overflow-y: auto;max-height: 58vh;">
- <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">多媒体信息</p>
- <el-tabs style="margin:0px 5px">
- <el-tab-pane :label="picturetabName">
- <el-row style="text-align:right;">
- <el-button
- :v-if="!addPicPanel?addPicPanel:addPicPanel"
- size="mini"
- type="text"
- :icon="!addPicPanel?'el-icon-circle-plus-outline':'el-icon-circle-close-outline'"
- @click="addPic"
- >{{!addPicPanel?"添加":"取消"}}</el-button>
- </el-row>
- <!-- 该上传组件之前用v-if="addPicPanel 控制显示隐藏,发现在点击编辑问题时,如果不上传图片,之间点击确认时会报错 add by lch -->
- <el-row v-show="addPicPanel"> <!-- v-if="addPicPanel" -->
- <upload
- ref="uploadFile"
- :url="`/pdcApi/file/insert?bizId=`"
- @uploadOver="removeNewSupervision"
- ></upload>
- </el-row>
- <el-row>
- <div style="overflow-y:auto;overflow-x:hidden;max-height:30vh;padding:10px;">
- <div class="upload-container" id="imgView">
- <div
- v-for="(item, index) in pictureArray"
- :key="index"
- class="image-preview image-app-preview"
- >
- <div class="image-preview-wrapper">
- <img :src="`${hostUrl}/${item.filePath}`">
- <div class="image-preview-action">
- <i @click="removeFile(item.id)" class="el-icon-delete"></i>
- </div>
- </div>
- </div>
- </div>
- </div>
- </el-row>
- </el-tab-pane>
- <el-tab-pane :label="audiotabName">
- <el-table border :data="audioArray" style="width: 100%;margin: 0 auto;">
- <el-table-column header-align="center" align="center" label="音频">
- <template slot-scope="scope">
- <elaudio
- style="margin-left:15%;width:100px;height:30px;"
- :theUrl="`${hostUrl}/${scope.row.filePath}`"
- ></elaudio>
- </template>
- </el-table-column>
- <el-table-column header-align="center" align="center" label="操作">
- <template slot-scope="scope">
- <el-button
- size="mini"
- @click="removeFile(scope.row.id,scope.$index)"
- type="danger"
- >删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane :label="videotabName">
- <el-table border :data="videoArray" style="width: 100%;margin: 0 auto;">
- <el-table-column header-align="center" align="center" label="视频">
- <template slot-scope="scope">
- <video-player
- class="vjs-custom-skin"
- ref="videoPlayer"
- :options="scope.row"
- :playsinline="true"
- ></video-player>
- </template>
- </el-table-column>
- <el-table-column header-align="center" align="center" label="操作">
- <template slot-scope="scope">
- <el-button
- size="mini"
- @click="removeFile(scope.row.id,scope.$index)"
- type="danger"
- >删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane :label="filetabName">
- <el-table border :data="fileArray" style="width: 100%;margin: 0 auto;">
- <el-table-column header-align="center" align="center" label="文档">
- <template slot-scope="scope">
- <p>
- <a :href="`${hostUrl}/${scope.row.filePath}`" target="_blank" rel="noopener noreferrer">
- {{scope.row.fileName}}
- </a>
- </p>
- </template>
- </el-table-column>
- <el-table-column header-align="center" align="center" label="操作">
- <template slot-scope="scope">
- <el-button
- size="mini"
- @click="removeFile(scope.row.id,scope.$index)"
- type="danger"
- >删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- </el-tabs>
- </div>
- </div>
- <span slot="footer">
- <el-button type="primary" @click="changeSupervisionInfo" :loding="changeSupervisionLoading">保存</el-button>
- <el-button @click="changeSupervisionVisiblefalse">取消</el-button>
- </span>
- </el-dialog>
- </template>
- <script>
- import {showDetailsXq,updatelist,deleteFileById} from "@api/duChaAPI.js";
- import request from "@util/gw_ajax_request.js";
- import {hostUrl} from '@util/global_variable'
- import Viewer from 'viewerjs';
- import 'viewerjs/dist/viewer.css';
- export default {
- props: ['editId'],
- data(){
- return{
- changeSupervisionVisible: true,
- changeSupervisionLoading: false,
- changeSupervision: {},
- rules1: {
- inspPblmName: [
- {
- required: true,
- message: "请输入问题名称",
- trigger: "blur"
- },
- {
- min: 1,
- max: 999,
- message: "不超过100字符",
- trigger: "blur"
- }
- ],
- inspPblmDesc: [
- {
- required: true,
- message: "请输入问题描述",
- trigger: "blur"
- }
- ],
- recPers: [
- {
- required: true,
- message: "请输入记录人",
- trigger: "blur"
- },
- {
- min: 1,
- max: 999,
- message: "不超过100字符",
- trigger: "blur"
- }
- ],
- objType: [
- {
- required: true,
- message: "请选择督查对象类型",
- trigger: "change"
- }
- ],
- objId: [
- {
- required: true,
- message: "请选择督查对象类型",
- trigger: "change"
- }
- ],
- inspPblmType: [
- {
- required: true,
- message: "请选择督查问题类型",
- trigger: "change"
- }
- ],
- dataStat: [
- {
- required: true,
- message: "请选择数据状态",
- trigger: "change"
- }
- ],
- collTime: [
- {
- required: true,
- message: "请选择采集时间",
- trigger: "change"
- }
- ],
- ifCasePblm: [
- {
- required: true,
- message: "请选择是否典型",
- trigger: "change"
- }
- ],
- pblmStat: [
- {
- required: true,
- message: "请选择问题类型",
- trigger: "change"
- }
- ],
- inspPblmCate: [
- {
- required: true,
- message: "请选择问题程度",
- trigger: "change"
- },
- {
- trigger: "change"
- }
- ]
- },
- supervisionState: [
- {
- value: "0",
- label: "一般"
- },
- {
- value: "1",
- label: "较重"
- },
- {
- value: "2",
- label: "严重"
- },
- {
- value: "3",
- label: "特别严重"
- }
- ],
- supervision: [
- {
- value: "1",
- label: "是"
- },
- {
- value: "0",
- label: "否"
- }
- ],
- addPicPanel: false,
- gwComFiles: [],
- picturetabName: "",
- audiotabName: "",
- videotabName: "",
- filetabName: "",
- pictureArray: [],
- audioArray: [],
- videoArray: [],
- fileArray:[],
- updateIdXiuGai: "",
- pblmId: "",
- t1: {},
- t2: {},
- t3: {},
- problemList: [],
- currentCheckPointList: [],
- currentProblemDescList: [],
- xiangqingmiaoshu: '',
- wenTiLeiBie:"",
- jianChaXiangMu:"",
- }
- },
- components:{
- upload: resolve => {
- require(["@widget/uploadFile.vue"], resolve);
- },
- },
- computed:{
- hostUrl(){
- return hostUrl
- },
- persId() {
- return localStorage.getItem("userid") ? localStorage.getItem("userid") : "1098101939614724096";
- }
- },
- mounted(){
- this.getproblemSmallType();
- },
- methods:{
- // 修改弹窗显示
- changeSup(id) {
- this.pictureArray = [];
- this.audioArray = [];
- this.videoArray = [];
- this.fileArray = [];
- this.updateIdXiuGai = id;
- let _this = this
- showDetailsXq(this.updateIdXiuGai).then(res => {
- // if(this.usersId==)
- this.changeSupervision = res.data;
- this.t1['inspPblmsName'] = this.changeSupervision.inspPblmsName
- this.problemList.forEach(ele=>{
- if(ele.inspPblmsName == _this.t1.inspPblmsName){
- _this.problemListChange(ele)
- }
- })
- this.t2['checkPointName'] = this.changeSupervision.checkPoint
- this.currentCheckPointList.forEach(ele=>{
- if(ele.checkPointName == _this.t2.checkPointName){
- _this.currentCheckPointListChange(ele)
- }
- })
- this.t3['pblmDesc'] = this.changeSupervision.pblmDesc
- res.data.gwComFiles.forEach(item => {
- if (
- item.fileExt == "mp3" ||
- item.fileExt == "MP3" ||
- item.fileExt == "m4a"
- ) {
- this.audioArray.push(item);
- } else if (
- item.fileExt == "jpg" ||
- item.fileExt == "JPG" ||
- item.fileExt == "png" ||
- item.fileExt == "PNG" ||
- item.fileExt == "JPEG" ||
- item.fileExt == "jpeg"
- ) {
- this.pictureArray.push(item);
- } else if (item.fileExt == "mp4" || item.fileExt == "MP4") {
- this.videoArray.push({
- id: item.id,
- bizId: item.bizId,
- width: "130",
- height: "130",
- autoplay: false,
- muted: true,
- language: "en",
- playbackRates: [0.7, 1.0, 1.5, 2.0],
- sources: [
- {
- type: "video/mp4",
- src: this.hostUrl + item.filePath
- }
- ]
- });
- }else{
- this.fileArray.push(item);
- }
- });
- _this.$nextTick(function(){
- var ViewerDom = document.getElementById('imgView');
- var viewer = new Viewer(ViewerDom, {})
- });
- this.picturetabName = "图片资料(" + this.pictureArray.length + ")";
- this.audiotabName = "音频资料(" + this.audioArray.length + ")";
- this.videotabName = "视频资料(" + this.videoArray.length + ")";
- this.filetabName = "其它资料(" + this.fileArray.length + ")";
- });
- },
- // 提交修改信息
- changeSupervisionInfo() {
- console.log(this)
- var _self = this;
- this.$refs.changeSupFrom.validate(valid => {
- if (valid) {
- this.$nextTick(()=>{
- if (_self.$refs.uploadFile.submitUpload(_self.changeSupervision.pblmId)) {
- _self.removeNewSupervision();
- }
- setTimeout(()=>{
- _self.changeSupervisionLoading = true;
- _self.changeSupervision.checkPoint = _self.jianChaXiangMu
- _self.changeSupervision.inspPblmName = _self.wenTiLeiBie
- _self.changeSupervision.inspPlbmType = _self.t2.sort2;
- _self.changeSupervision.pblmsTypeId = _self.t2.guid;
- _self.changeSupervision.gwComFiles = _self.gwComFiles;
- let data = _self.changeSupervision;
- updatelist(data).then(res => {
- _self.pblmId = res.data.pblmId;
- _self.gwComFiles = res.data.gwComFiles;
- if (res.success) {
- _self.changeSupervisionLoading = false;
- _self.successInfo();
- _self.addPicPanel = false;
- } else {
- _self.failInfo();
- _self.$emit('closeEditDialog')
- }
- });
- },500)
- })
- }
- });
- },
- removeNewSupervision(arg) {
- this.gwComFiles = [];
- if (arg) {
- this.gwComFiles = arg;
- this.$refs.uploadFile.init();
- }
- // this.changeSup(this.editId)
- // this.$emit('closeEditDialog','success')
- },
- changeSupervisionVisiblefalse() {
- this.$emit('closeEditDialog')
- this.$refs.uploadFile.init();
- this.addPicPanel = false;
- },
- addPic() {
- this.addPicPanel = !this.addPicPanel;
- },
- // 删除图片文件
- removeFile(id, index) {
- // this.updateIdXiuGai = this.updateIdXiuGai;
- var _self = this;
- this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "返回",
- type: "warning"
- }).then(
- res => {
- if (res === "confirm") {
- deleteFileById(id, this.persId).then(res => {
- if (res.success) {
- this.changeSupervision.gwComFiles.forEach(item => {
- if (
- item.fileExt == "mp3" ||
- item.fileExt == "MP3" ||
- item.fileExt == "m4a"
- ) {
- this.audiotabName.splice(index, 1);
- } else if (
- item.fileExt == "jpg" ||
- item.fileExt == "JPG" ||
- item.fileExt == "png" ||
- item.fileExt == "PNG" ||
- item.fileExt == "JPEG" ||
- item.fileExt == "jpeg"
- ) {
- this.pictureArray.splice(index, 1);
- } else if (item.fileExt == "mp4" || item.fileExt == "MP4") {
- this.videoArray.splice(index, 1);
- }
- });
- _self.changeSup(this.updateIdXiuGai);
- } else {
- this.failInfo();
- }
- });
- }
- },
- res => {
- console.log("返回");
- }
- )
- },
- // 操作成功反馈
- successInfo() {
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.$emit('closeEditDialog','success');
- },
- // 操作失败反馈
- failInfo(val) {
- this.$message.error(val);
- },
- // 文件上传
- submitUpload() {
- this.$refs.upload.submit();
- },
- closeModal(){
- this.$emit('closeEditDialog')
- },
- getproblemSmallType() {
- let result = [];
- request.get('/dc/insp/pblms/getPblmType', {
- params: {
- type: 42,
- pguid: `42000000000000000000000000000000`
- }
- }).then(res => {
- if (res.success) {
- res.data.forEach((ele) => {
- let haveinspPblmsName = false;
- result.forEach((inspPblm) => {
- if (inspPblm['inspPblmsName'] == ele.inspPblmsName) {
- //
- let havechekPoint = false;
- inspPblm['checkPoints'].forEach((chekPoint) => {
- if (chekPoint['checkPointName'] == ele.checkPoint) {
- havechekPoint = true;
- }
- });
- if (!havechekPoint) {
- let newCheckPoint = {};
- newCheckPoint['checkPointName'] = ele.checkPoint;
- newCheckPoint['sort2'] = ele.sort2;
- newCheckPoint['guid'] = ele.guid
- inspPblm['checkPoints'].push(newCheckPoint);
- }
- haveinspPblmsName = true;
- }
- });
- if (!haveinspPblmsName) {
- let haveinspPblmsObj = {};
- haveinspPblmsObj['inspPblmsName'] = ele.inspPblmsName;
- haveinspPblmsObj['sort1'] = ele.sort1;
- haveinspPblmsObj['checkPoints'] = [{
- checkPointName: ele.checkPoint,
- sort2: ele.sort2,
- guid: ele.guid
- }];
- result.push(haveinspPblmsObj);
- }
- })
- this.problemList = result;
- this.changeSup(this.editId)
- }
- })
- },
- problemListChange: function (item) {
- this.t1 = item
- this.wenTiLeiBie = item.inspPblmsName;
- this.currentCheckPointList = item.checkPoints;
- },
- currentCheckPointListChange: function (item) {
- this.jianChaXiangMu = item.checkPointName;
- this.currentProblemDescList = item.pblmDescs;
- },
- currentProblemDescListChange: function (item) {
- this.xiangqingmiaoshu = item.pblmDesc;
- console.log(item);
- },
- },
- watch:{
- editId(val){
- this.changeSup(val)
- },
- 't3': {
- handler: function (val, oldVal) {
- },
- deep: true
- },
- }
- }
- </script>
- <style scoped lang="scss">
- .scroll_wrapper{
- overflow: hidden;
- }
- .scroll_wrapper .el-form{
- padding-top: 5px;
- padding-right: 5px;
- }
- .upload-container {
- width: 100%;
- position: relative;
- .image-uploader {
- width: 35%;
- float: left;
- }
- .image-preview {
- width: 200px;
- height: 200px;
- position: relative;
- border: 1px dashed #d9d9d9;
- float: left;
- // margin-left: 50px;
- .image-preview-wrapper {
- position: relative;
- width: 100%;
- height: 100%;
- img {
- width: 100%;
- height: 100%;
- }
- }
- .image-preview-action {
- position: absolute;
- width: 100%;
- height: 30px;
- left: 0;
- bottom: 0;
- color: #fff;
- opacity: 0;
- font-size: 20px;
- background-color: rgba(0, 0, 0, 0.5);
- transition: opacity 0.3s;
- cursor: pointer;
- text-align: center;
- line-height: 30px;
- .el-icon-delete {
- font-size: 25px;
- }
- }
- &:hover {
- .image-preview-action {
- opacity: 1;
- }
- }
- }
- .image-app-preview {
- margin-bottom: 10px;
- width: 40vh;
- height: 180px;
- position: relative;
- border: 1px dashed #d9d9d9;
- float: left;
- // margin-left: 50px;
- .app-fake-conver {
- height: 44px;
- position: absolute;
- width: 100%; // background: rgba(0, 0, 0, .1);
- text-align: center;
- line-height: 64px;
- color: #fff;
- }
- }
- }
- </style>
|