| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481 |
- <template>
- <el-dialog
- :title="titleType + '必查清单'"
- @close="closeDialog"
- :visible.sync="dialogFormVisible"
- append-to-body
- class="add_problem_dialog"
- width="90%"
- height="90%"
- >
- <div class="scroll_wrapper">
- <div
- style="
- width: 49%;
- overflow-y: auto;
- max-height: 70vh;
- float: left;
- border: 1px solid #d5d5ff;
- margin-right: 5px;
- "
- >
- <p style="font-weight: bolder; background-color: #d5d5ff; padding: 3px">
- 基本信息
- </p>
- <el-form :model="form" :rules="rules" ref="form" label-width="130px">
- <el-form-item label="具体检查项目" prop="chkItem">
- <el-input
- v-model="form.chkItem"
- autocomplete="off"
- :readonly="true"
- :autosize="{ minRows: 5 }"
- disabled
- ></el-input>
- </el-form-item>
- <el-form-item label="检查资料或部位" prop="chkFrp">
- <el-input
- v-model="form.chkFrp"
- autocomplete="off"
- :readonly="true"
- :autosize="{ minRows: 5 }"
- disabled
- ></el-input>
- </el-form-item>
- <el-form-item label="问题掌握标准" prop="pblmMasteryLevel">
- <el-input
- v-model="form.pblmMasteryLevel"
- autocomplete="off"
- :readonly="true"
- :autosize="{ minRows: 4 }"
- type="textarea"
- :rows="5"
- disabled
- ></el-input>
- </el-form-item>
- <el-form-item label="检查依据(法规及规范相应条款)" prop="chkGist">
- <el-input
- v-model="form.chkGist"
- autocomplete="off"
- :readonly="true"
- :autosize="{ minRows: 4 }"
- type="textarea"
- :rows="5"
- disabled
- ></el-input>
- </el-form-item>
- <p class="item_title">
- <i class="el-icon-caret-right"></i>
- <span>检查结果</span>
- </p>
- <el-form-item label="检查结果" prop="isPblm">
- <el-select v-model="form.isPblm" placeholder="请选择检查结果" clearable style="width: 100%;">
- <el-option
- v-for="(item, index) in ynList"
- :key="index"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="选择问题" prop="pblmstdId"
- v-if="form.isPblm === '1'">
- <el-select
- v-model="form.pblmstdId"
- filterable
- popper-class="problem_select"
- placeholder="请选择"
- @change="changeSelect"
- style="width: 85%"
- >
- <el-option
- v-for="item in problemList"
- :key="item.id"
- :label="item.pblmsDesc"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <span class="add_new_problem" @click="addNewProblem" v-if="!isFujian">添加其它问题</span>
- </el-form-item>
- <el-form-item
- label="问题描述"
- prop="pblmsDesc"
- v-if="form.isPblm === '1'"
- >
- <el-input
- v-model="form.pblmsDesc"
- autocomplete="off"
- type="textarea"
- :rows="5"
- ></el-input>
- </el-form-item>
- <el-form-item label="责任单位" v-if="form.isPblm === '1'" prop="subjectId">
- <span
- class="el-icon-circle-plus"
- title="添加单位"
- @click="addUnit"
- ></span>
- <div v-for="(unit, index) in unitArray" :key="index">
- <el-form-item label="单位性质" style="display: inline-block">
- <el-select
- v-model="unit.subId"
- placeholder="请选择"
- @change="natureChange(val, index)"
- clearable
- >
- <el-option
- v-for="item in objSubjectList"
- :key="item.id"
- :label="item.subName"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <span
- class="el-icon-remove"
- title="删除单位"
- v-if="index != 0"
- @click="removeUnit(index)"
- ></span>
- </el-form-item>
- <el-form-item label="单位名称" style="display: inline-block">
- <el-select
- v-model="unit.unitNm"
- popper-class="problem_select"
- @change="unitSelect"
- placeholder="请选择"
- clearable
- >
- <el-option
- v-for="item in unitNameList"
- :key="item.id"
- :label="
- item.sctnName
- ? `${item.sysNm}(${item.sctnName})`
- : item.sysNm
- "
- :value="item.sysNm"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </div>
- </el-form-item>
- <el-form-item
- label="问题定性"
- prop="pblmPasi"
- v-if="form.isPblm === '1'"
- >
- <el-select v-if="selectShow && !isGd && !isSc && !isSd" v-model="form.pblmPasi" placeholder="请选择" style="width: 100%;">
- <el-option v-for="item in cateObjList" :key="item.cate" :label="item.desc"
- :value="item.cate">
- </el-option>
- </el-select>
- <el-select v-if="isGd || isSc || isSd" v-model="form.pblmPasi" placeholder="请选择问题定性">
- <el-option label="一般" value="0"></el-option>
- <el-option label="较重" value="1"></el-option>
- <el-option label="严重" value="2"></el-option>
- </el-select>
- <span v-if="inputShow && !isGd && !isSc && !isSd">{{inputText}}</span>
- </el-form-item>
- <el-form-item
- label="有关情况说明"
- prop="nt"
- v-if="
- pageName === 'inspectionView' ||
- (pageName === 'inspectionIndex' && form.isPblm === '1')
- "
- >
- <el-input
- v-model="form.nt"
- autocomplete="off"
- type="textarea"
- :rows="5"
- ></el-input>
- </el-form-item>
- </el-form>
- </div>
- <div
- style="
- width: 49%;
- float: right;
- border: 1px solid rgb(213, 213, 255);
- margin-right: 5px;
- overflow-y: auto;
- max-height: 70vh;
- "
- >
- <p style="font-weight: bolder; background-color: #d5d5ff; padding: 3px">
- 多媒体信息
- </p>
- <div
- style="
- width: 99%;
- float: left;
- border: 1px solid rgb(213, 213, 255);
- margin-right: 5px;
- overflow-y: auto;
- max-height: 30vh;
- "
- >
- <el-row style="text-align: right">
- <el-col :span="24">
- <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-col>
- </el-row>
- <el-row v-show="addPicPanel">
- <span style="display: block; text-align: center; color: red"
- >佐证照片建议上传2至6的偶数张</span
- >
- <upload
- ref="uploadFile"
- :type="'1'"
- :url="`/pdcApi/file/insert?bizId=`"
- @uploadOver="removeNewSupervision"
- ></upload>
- </el-row>
- <el-row style="text-align: right">
- <el-col :span="24">
- <el-button
- :v-if="!addPicPanel1 ? addPicPanel1 : addPicPanel1"
- size="mini"
- type="text"
- :icon="
- !addPicPanel1
- ? 'el-icon-circle-plus-outline'
- : 'el-icon-circle-close-outline'
- "
- @click="addPic('1')"
- >{{ !addPicPanel1 ? "佐证资料添加" : "佐证资料取消" }}
- </el-button>
- </el-col>
- </el-row>
- <el-row v-show="addPicPanel1">
- <span style="display: block; text-align: center; color: red"
- >佐证照片建议上传2至6的偶数张</span
- >
- <upload
- ref="uploadFile1"
- :type="'2'"
- :url="`/pdcApi/file/insert?bizId=`"
- @uploadOver="removeNewSupervision"
- ></upload>
- </el-row>
- </div>
- <p class="item_title">
- <i class="el-icon-caret-right"></i>
- <span>参考范本</span>
- </p>
- <div
- style="
- width: 99%;
- float: left;
- border: 1px solid rgb(213, 213, 255);
- margin-right: 5px;
- overflow-y: auto;
- max-height: 30vh;
- "
- >
- <el-tabs style="margin: 0px 5px">
- <el-tab-pane :label="picturetabName">
- <el-row>
- <div
- style="
- overflow-y: auto;
- overflow-x: hidden;
- max-height: 42vh;
- padding: 10px;
- "
- >
- <div class="upload-container">
- <viewer :images="pictureArray">
- <draggable
- v-model="pictureArray"
- :options="{ group: 'image' }"
- @change="dragChange"
- >
- <div
- v-if="editPicRefresh"
- v-for="(item, index) in pictureArray"
- :key="index"
- class="image-preview image-app-preview"
- >
- <div class="image-preview-wrapper">
- <img
- :src="`${hostUrl}/${
- item.filePath
- }?d=${new Date().getTime()}`"
- />
- <div class="image-preview-action">
- <i
- @click="removeFile(item.id)"
- class="el-icon-delete"
- ></i>
- <i
- @click="editPicEvent(item)"
- class="el-icon-edit-outline"
- ></i>
- </div>
- </div>
- </div>
- </draggable>
- </viewer>
- </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>
- <p class="item_title">
- <i class="el-icon-caret-right"></i>
- <span>佐证资料</span>
- </p>
- <div
- style="
- width: 99%;
- float: left;
- border: 1px solid rgb(213, 213, 255);
- margin-right: 5px;
- overflow-y: auto;
- max-height: 30vh;
- "
- >
- <el-tabs style="margin: 0px 5px">
- <el-tab-pane :label="picturetabName2">
- <el-row>
- <div
- style="
- overflow-y: auto;
- overflow-x: hidden;
- max-height: 42vh;
- padding: 10px;
- "
- >
- <div class="upload-container">
- <viewer :images="pictureArray2">
- <draggable
- v-model="pictureArray2"
- :options="{ group: 'image' }"
- @change="dragChange"
- >
- <div
- v-if="editPicRefresh"
- v-for="(item, index) in pictureArray2"
- :key="index"
- class="image-preview image-app-preview"
- >
- <div class="image-preview-wrapper">
- <img
- :src="`${hostUrl}/${
- item.filePath
- }?d=${new Date().getTime()}`"
- />
- <div class="image-preview-action">
- <!-- <i @click="previewFile(item.filePath)" class="el-icon-zoom-in"></i> -->
- <i
- @click="removeFile(item.id)"
- class="el-icon-delete"
- ></i>
- <i
- @click="editPicEvent(item)"
- class="el-icon-edit-outline"
- ></i>
- </div>
- </div>
- </div>
- </draggable>
- </viewer>
- </div>
- </div>
- </el-row>
- </el-tab-pane>
- <el-tab-pane :label="audiotabName2">
- <el-table
- border
- :data="audioArray2"
- 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="videotabName2">
- <el-table
- border
- :data="videoArray2"
- 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="filetabName2">
- <el-table
- border
- :data="fileArray2"
- 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>
- </div>
- <div slot="footer">
- <el-button @click="closeDialog">取 消</el-button>
- <el-button type="primary" @click="submitProblem">保 存</el-button>
- </div>
- <add-new-problem-com
- v-if="innerVisible"
- :titleType="'添加'"
- :listType="listType"
- @dialogClose="closeInnerDialog"
- ></add-new-problem-com>
- </el-dialog>
- </template>
- <script>
- // import request from '@util/gw_ajax_request.js'
- // import {formatDateTime2} from '@util/gw_date.js'
- // import {} from '@api/InspectionReport.js'
- import {
- getSelectProblemList,
- getProblemNatureApi,
- getUnitNameListApi,
- TacObiPblmHbUpdate,
- // submitInsetMustProblemApi,
- TacObiPblmHbShow,
- submitProblemApi,
- } from "@api/InspectionReport.js";
- import { updatelist, deleteFileById } from "@api/duChaAPI.js";
- import addNewProblemCom from "./addInspectionProblem.vue";
- import upload from "@widget/uploadFileWithType";
- import { hostUrl } from "@util/global_variable.js";
- export default {
- props: ["titleType", "rowData", "listType", "pageName", "objId","currentNodeId"],
- components: {
- addNewProblemCom,
- upload,
- },
- data() {
- var subjectIdValidator = (rule, value, callback) => {
- let unitNames = [];
- let subIds = [];
- this.uniArr(this.unitArray).forEach((ele) => {
- unitNames.push(ele.unitNm);
- subIds.push(ele.subId);
- });
- unitNames = unitNames.filter(function (s) {
- return s && s.trim();
- });
- subIds = subIds.filter(function (s) {
- return s && s.trim();
- });
- if ( unitNames.length === 0 && subIds.length === 0 ) {
- callback(new Error('对应的单位性质或单位名称其中一个不能为空'));
- }else{
- callback();
- }
- };
- return {
- form: {
- chkItem: "",
- chkFrp: "",
- pblmMasteryLevel: "",
- chkGist: "",
- isPblm: "", // 是否有问题 1
- pblmstdId: "", // 问题Id
- pblmsDesc: "", // 问题描述1
- subjectNames: [], // 责任单位1 单位名称集合
- subjectId:'', // 责任单位1 用来判断非空的
- subjectIds: [], // 责任单位1 单位性质集合
- pblmPasi: "", // 问题定性1
- nt: "", // 说明1
- objType: "8", // !!
- objId: '',
- listType: '', //六个专业的类型123456
- },
- dialogFormVisible: true,
- rules: {
- isPblm:[{ required: true, message: "请选择检查结果", trigger: "change" }],
- pblmstdId: [{ required: true, message: "请选择问题", trigger: "change" }],
- pblmsDesc: [{ required: true, message: "请输入问题描述", trigger: "change" }],
- subjectId: [{ required: true, validator: subjectIdValidator, trigger: "change" }],
- pblmPasi: [{ required: true, message: "请选择问题定性", trigger: "change" },],
- nt: [{ required: true, message: "请输入有关情况说明", trigger: "change" },],
- },
- professionList: [
- { label: "前期与设计", value: "1" },
- { label: "建设管理", value: "2" },
- { label: "计划下达与执行", value: "3" },
- { label: "资金使用与管理", value: "4" },
- { label: "质量行为", value: "5" },
- { label: "质量实体", value: "6" },
- { label: "工程安全", value: "7" },
- ],
- ynList: [
- { label: "有问题", value: "1" },
- { label: "无问题", value: "0" },
- ],
- preUrl: "",
- // listType: "", //六个专业的类型123456
- picturetabName: "",
- audiotabName: "",
- videotabName: "",
- filetabName: "",
- pictureArray: [],
- audioArray: [],
- videoArray: [],
- fileArray: [],
- picturetabName2: "",
- audiotabName2: "",
- videotabName2: "",
- filetabName2: "",
- pictureArray2: [],
- audioArray2: [],
- videoArray2: [],
- fileArray2: [],
- editPicRefresh: true,
- picUrl: "",
- picId: "",
- pblmId: "", // 数据id
- addPicPanel: false,
- addPicPanel1: false,
- unitArray: [
- {
- unitNm: "",
- subId: "",
- },
- ],
- bizType: "1", // 文件上传序号
- // problemDxList: "", // 问题分类列表
- gwComFileList: [],
- problemList: [], // 问题列表
- objSubjectList: [], //单位性质列表
- unitNameList: [], //单位名称列表
- innerVisible: false, // 添加问题弹框
- cateObjList: [],//严重程度列表
- selectShow: true,
- inputShow: false,
- inputText: '',
- problemInfo: {},
- changeSupervision:{},// 回显查询结果
- };
- },
- computed: {
- hostUrl() {
- // return window.location.href.indexOf('localhost') > -1 || window.location.href.indexOf("10.1.102.64") > -1 ? 'http://10.1.102.240:8200' : `${window.location.protocol}//${window.location.hostname}`
- return hostUrl;
- },
- isFujian() {
- if (localStorage.getItem("currentRlcode").substring(0, 2) == "35") {
- return true;
- } else {
- return false;
- }
- },
- persId() {
- return localStorage.getItem("userid") ? localStorage.getItem("userid") : "1098101939614724096";
- },
- isGd(){
- if(localStorage.getItem('currentRlcode').substring(0,2)=="44"){
- return true;
- }else{
- return false;
- }
- },
- isSc(){
- if(localStorage.getItem('currentRlcode').substring(0,2)=="51"){
- return true;
- }else{
- return false;
- }
- },
- isSd(){
- if(localStorage.getItem('currentRlcode').substring(0,2)=="37"){
- return true;
- }else{
- return false;
- }
- },
- isHb(){
- if(localStorage.getItem('currentRlcode').substring(0,2)=="42"){
- return true;
- }else{
- return false;
- }
- }
- },
- mounted() {
- this.getProblemList();
- if (this.titleType == "编辑") {
- this.pblmId = this.rowData.id;
- this.changeSup();
- }
- this.$nextTick(()=>{
- this.$refs["form"].clearValidate()
- })
- },
- methods: {
- changeSup() {
- this.pictureArray = [];
- this.audioArray = [];
- this.videoArray = [];
- this.fileArray = [];
- this.pictureArray2 = [];
- this.audioArray2 = [];
- this.videoArray2 = [];
- this.fileArray2 = [];
- TacObiPblmHbShow(this.pblmId)
- .then((res) => {
- if (res.success) {
- this.form = res.data;
- this.changeSupervision = res.data;
- if(this.changeSupervision.tacObjPblmstb){
- this.form.pblmstdId = this.changeSupervision.tacObjPblmstb.id
- }
- if(this.changeSupervision.pblmSubjectList){
- this.unitArray = this.changeSupervision.pblmSubjectList
- }
- if(this.changeSupervision.tacObjPblmstb){
- this.objSubjectList = this.changeSupervision.tacObjPblmstb.objSubjectList
- this.cateObjList = this.changeSupervision.tacObjPblmstb.cateObjList
- this.form.pblmsDesc = this.changeSupervision.tacObjPblmstb.pblmsDesc
- }
- if(this.unitArray.length){
- this.unitArray.forEach((ele,index)=>{
- this.getUnitNameList(index)
- })
- }
- res.data.fileList.forEach((item) => {
- if (item.bizType === "1") {
- 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({
- 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,
- },
- ],
- id: item.id,
- });
- } else {
- this.fileArray.push(item);
- }
- } else if (item.bizType === "2") {
- if (
- item.fileExt == "mp3" ||
- item.fileExt == "MP3" ||
- item.fileExt == "m4a"
- ) {
- this.audioArray2.push(item);
- } else if (
- item.fileExt == "jpg" ||
- item.fileExt == "JPG" ||
- item.fileExt == "png" ||
- item.fileExt == "PNG" ||
- item.fileExt == "JPEG" ||
- item.fileExt == "jpeg"
- ) {
- this.pictureArray2.push(item);
- } else if (item.fileExt == "mp4" || item.fileExt == "MP4") {
- this.videoArray2.push({
- 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,
- },
- ],
- id: item.id,
- });
- } else {
- this.fileArray2.push(item);
- }
- }
- });
- this.picturetabName = "图片资料(" + this.pictureArray.length + ")";
- this.audiotabName = "音频资料(" + this.audioArray.length + ")";
- this.videotabName = "视频资料(" + this.videoArray.length + ")";
- this.filetabName = "其它资料(" + this.fileArray.length + ")";
- this.picturetabName2 = "图片资料(" + this.pictureArray2.length + ")";
- this.audiotabName2 = "音频资料(" + this.audioArray2.length + ")";
- this.videotabName2 = "视频资料(" + this.videoArray2.length + ")";
- this.filetabName2 = "其它资料(" + this.fileArray2.length + ")";
- } else {
- this.$message.error(res.message);
- }
- this.loading = false;
- })
- .catch((err) => {
- this.$message.error(err);
- });
- },
- // 获取问题
- getProblemList() {
- getSelectProblemList(this.form.pblmstdId, this.listType)
- .then((res) => {
- if (res.success) {
- this.problemList = res.data.list;
- } else {
- this.$message.error(res.message);
- }
- this.loading = false;
- })
- .catch((err) => {
- this.$message.error(err);
- });
- },
- // 问题改变
- changeSelect(val) {
- getProblemNatureApi(val)
- .then((res) => {
- if (res.success) {
- this.problemInfo = res.data
- this.form.pblmsDesc = this.problemInfo.pblmsDesc
- this.objSubjectList = this.problemInfo.objSubjectList
- this.cateObjList = this.problemInfo.cateObjList // 严重程度
- if (this.cateObjList.length == 1) {
- this.inputShow = true;
- this.selectShow = false;
- this.form.pblmPasi = this.cateObjList[0].cate;
- this.inputText = this.cateObjList[0].desc;
- // 切换问题标准时问题严重性赋值问题
- this.cateObjList.forEach(ele => {
- if (this.form.pblmPasi && this.form.pblmPasi != ele.cate) {
- this.form.pblmPasi = ''
- }
- })
- } else {
- this.inputShow = false;
- this.selectShow = true;
- }
- } else {
- this.$message.error(res.message);
- }
- })
- .catch((err) => {
- this.$message.error(err);
- });
- },
- // 单位性质改变
- natureChange(val, index) {
- this.getUnitNameList(index);
- let _this = this;
- this.unitArray.forEach((ele, index) => {
- _this.objSubjectList.forEach((element) => {
- if (ele.subId == element.id) {
- this.unitArray[index].subName = element.subName;
- }
- });
- });
- },
- // 单位名称改变
- unitSelect() {
- let _this = this;
- this.unitArray.forEach((ele, index) => {
- _this.unitNameList.forEach((element) => {
- if (ele.unitNm == element.sysNm) {
- this.unitArray[index].unitId = element.id;
- }
- });
- });
- },
- // 获取单位名称
- getUnitNameList(index) {
- let paramsObj = {
- rgstrId: this.currentNodeId,
- sysType: this.unitArray[index].subId,
- };
- this.unitArray[index].unitNm = ""; //单位性质切换的时候清空单位名称
- getUnitNameListApi(paramsObj).then(res => {
- if (res.success) {
- this.unitNameList = res.data
- } else {
- this.$message.error(res.message)
- }
- }).catch(err => {
- this.$message.error(err)
- })
- },
- addUnit() {
- this.unitArray.push({ unitNm: "", unitId: "", subId: "", subName: "" });
- },
- removeUnit(index) {
- this.unitArray.splice(index, 1);
- },
- uniArr(tempArr) {
- var newTempArr = [];
- if (tempArr && tempArr.length > 0) {
- tempArr.forEach((item, index) => {
- if (item.unitNm || item.subId) {
- newTempArr.push(item);
- }
- });
- for (let i = 0; i < newTempArr.length; i++) {
- for (let j = i + 1; j < newTempArr.length; j++) {
- if (
- newTempArr[i].unitNm == newTempArr[j].unitNm &&
- newTempArr[i].subId == newTempArr[j].subId
- ) {
- newTempArr.splice(j, 1);
- j--;
- }
- }
- }
- return newTempArr;
- } else {
- return [];
- }
- },
- // 添加问题
- addNewProblem() {
- this.innerVisible = true;
- },
- //监听内容dialog关闭时执行
- closeInnerDialog() {
- this.innerVisible = false;
- this.getProblemList();
- },
- submitProblem() {
- this.$refs["form"].validate((valid) => {
- if (valid) {
- let unitNames = [];
- let subIds = [];
- this.unitArray = this.uniArr(this.unitArray);
- this.unitArray.forEach((ele) => {
- unitNames.push(ele.unitNm);
- subIds.push(ele.subId);
- });
- unitNames = unitNames.filter(function (s) {
- return s && s.trim();
- });
- subIds = subIds.filter(function (s) {
- return s && s.trim();
- });
- this.form.subjectNames = unitNames.join(",");
- this.form.subjectIds = subIds.join(",");
- this.form.pblmSubjectList = this.unitArray
- this.form.objId = this.objId
- this.form.listType = this.listType
- this.form.rgstrId = this.currentNodeId
- this.form.persId = this.persId
- if (this.titleType == "编辑") {
- if (this.form.isPblm === "1") {
- let form1 = {
- chkFrp:this.form.chkFrp,
- pblmMasteryLevel:this.form.pblmMasteryLevel,
- chkGist:this.form.chkGist,
- chkItem:this.form.chkItem,
- dataStat:this.form.dataStat,
- fileList:this.form.fileList,
- focPblm:this.form.focPblm,
- genus:this.form.genus,
- groupId:this.form.groupId,
- intm:this.form.intm,
- isPblm:this.form.isPblm,
- listType:this.form.listType,
- nt:this.form.nt,
- objId:this.form.objId,
- orgId:this.form.orgId,
- pblmId:this.form.pblmId,
- pblmNt:this.form.pblmNt,
- pblmPasi:this.form.pblmPasi,
- pblmSubjectList:this.form.pblmSubjectList,
- pblmsDesc:this.form.pblmsDesc,
- pblmstbHbId:this.form.pblmstbHbId,
- pblmstdId:this.form.pblmstdId,
- persId:this.form.persId,
- province:this.form.province,
- rgstrId:this.form.rgstrId,
- sn:this.form.sn,
- spfsnlType:this.form.spfsnlType,
- state:this.form.state,
- subjectIds:this.form.subjectIds,
- subjectNames:this.form.subjectNames,
- uptm:this.form.uptm,
- }
- submitProblemApi(form1)
- .then((res) => {
- if (res.success) {
- this.form.pblmId = res.data.id
- TacObiPblmHbUpdate(this.form)
- .then((res) => {
- if (res.success) {
- this.$refs.uploadFile.submitUpload(this.pblmId);
- this.$refs.uploadFile1.submitUpload(this.pblmId);
- this.$message.success("修改成功");
- this.$nextTick(() => {
- this.$emit("dialogClose");
- });
- } else {
- this.$message.error(res.message);
- }
- })
- .catch((err) => {
- this.$message.error(err);
- });
- } else {
- this.$message.error(res.message);
- }
- })
- .catch((err) => {
- this.$message.error(err);
- });
- }else{
- TacObiPblmHbUpdate(this.form)
- .then((res) => {
- if (res.success) {
- this.$refs.uploadFile.submitUpload(this.pblmId);
- this.$refs.uploadFile1.submitUpload(this.pblmId);
- this.$message.success("修改成功");
- this.$nextTick(() => {
- this.$emit("dialogClose");
- });
- } else {
- this.$message.error(res.message);
- }
- })
- .catch((err) => {
- this.$message.error(err);
- });
- }
- }
- } else {
- return false;
- }
- });
- },
- closeDialog() {
- this.$emit("dialogClose");
- },
- removeNewSupervision(arg) {
- if (arg) {
- var args = this.gwComFileList.concat(arg);
- }
- this.changeSup();
- this.$emit("dialogClose");
- this.gwComFileList = [];
- },
- addPic(val) {
- if(val === '1'){
- this.addPicPanel1 = !this.addPicPanel1;
- }else{
- this.addPicPanel = !this.addPicPanel;
- }
- },
- // 删除图片文件
- removeFile(id, index) {
- var _self = this;
- this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "返回",
- type: "warning",
- }).then(
- (res) => {
- if (res === "confirm") {
- deleteFileById(id, this.persId).then((res) => {
- if (res.success) {
- _self.changeSup();
- } else {
- this.failInfo(res.message);
- }
- });
- }
- },
- (res) => {
- console.log("返回");
- }
- );
- },
- editPicEvent(item) {
- this.picUrl =
- this.hostUrl + "/" + item.filePath + "?d=" + new Date().getTime();
- this.editPicDialog = true;
- this.editPicRefresh = false;
- this.picId = item.id;
- },
- cancelHandler() {
- this.editPicDialog = false;
- this.editPicRefresh = true;
- },
- editPicDataEvent(item) {
- request
- .post(`/file/updateFile?bizId=${this.pblmId}&id=${this.picId}`, item, {
- headers: { "Content-Type": "multipart/form-data" },
- })
- .then((res) => {
- if (res.success) {
- this.pictureArray = [];
- this.pictureArray2 = [];
- this.changeSup();
- this.editPicDialog = false;
- this.editPicRefresh = true;
- this.$message.success("修改成功");
- } else {
- this.$message.warning("修改失败");
- }
- });
- },
- // 操作成功反馈
- successInfo() {
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- },
- // 操作失败反馈
- failInfo(val) {
- this.$message.error(val);
- },
- closeModal() {
- this.$emit("dialogClose");
- },
- dragChange(val) {
- console.log(val);
- console.log(this.pictureArray);
- let gwComFileList = [];
- gwComFileList = gwComFileList
- .concat(this.pictureArray)
- .concat(this.audioArray)
- .concat(this.videoArray)
- .concat(this.fileArray);
- this.form.gwComFileList = gwComFileList;
- console.log(this.form.gwComFileList);
- },
- },
- watch: {},
- };
- </script>
- <style lang="scss" scoped>
- .add_problem_dialog {
- .el-dialog {
- margin-top: 6vh !important;
- margin-bottom: 20px;
- }
- .el-dialog__body {
- font-size: 16px;
- color: #333;
- }
- .problem_form {
- display: flex;
- // flex-direction: row;
- width: 98%;
- margin: 0 auto;
- padding: 16px;
- height: calc(100vh - 270px);
- overflow: auto;
- .item_title {
- margin-top: 10px;
- margin-bottom: 20px;
- span:nth-of-type(1) {
- width: 120px;
- padding-left: 5px;
- }
- }
- .hrs {
- display: inline-block;
- width: calc(100% - 40px);
- margin-left: 10px;
- height: 1px;
- vertical-align: middle;
- background-color: #ddd;
- }
- .el-icon-circle-plus,
- .el-icon-remove {
- margin-left: 10px;
- color: #009fff;
- cursor: pointer;
- }
- .el-icon-remove {
- color: red;
- }
- .box-card {
- margin-bottom: 6px;
- }
- .el-form-item__label {
- font-size: 16px;
- color: #333;
- }
- }
- .el-button--mini {
- font-size: 14px;
- }
- .el-input--mini {
- font-size: 14px;
- }
- .el-textarea.is-disabled .el-textarea__inner {
- color: #666;
- }
- }
- .problem_select .el-select-dropdown__item {
- width: 800px;
- }
- .add_new_problem {
- color: #009fff;
- cursor: pointer;
- }
- .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: 40px;
- 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: 40px;
- .el-icon-delete,
- .el-icon-zoom-in {
- font-size: 22px;
- margin: 0 5px;
- }
- }
- &:hover {
- .image-preview-action {
- opacity: 1;
- }
- }
- }
- .image-app-preview {
- margin-bottom: 10px;
- margin-right: 6px;
- 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;
- }
- }
- }
- .problem_select .el-select-dropdown__item {
- width: 500px;
- }
- .modify_problem_dialog {
- .el-dialog__body {
- font-size: 15px;
- }
- .el-form-item__label {
- font-size: 15px;
- color: #333;
- }
- .el-input--mini {
- font-size: 13px;
- }
- .el-button--mini {
- font-size: 14px;
- }
- .el-icon-circle-plus,
- .el-icon-remove {
- margin-left: 10px;
- color: #009fff;
- cursor: pointer;
- }
- .el-icon-remove {
- color: red;
- }
- }
- .el-icon-refresh-right {
- font-size: 36px;
- cursor: pointer;
- }
- .pic_dialog .el-dialog {
- margin-top: 10vh !important;
- }
- .viewer-container {
- z-index: 9999 !important;
- }
- </style>
|