f30786ec47014332bd5af8dd9792560c64a42d73.svn-base 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002
  1. <template>
  2. <!-- 修改弹框 -->
  3. <el-dialog
  4. width="90%"
  5. class="outerDialog modify_problem_dialog"
  6. title="修改稽察问题"
  7. @close="closeModal"
  8. :close-on-click-modal="false"
  9. :visible.sync="changeSupervisionVisible">
  10. <div class="scroll_wrapper">
  11. <div
  12. style="width:49%;overflow-y:auto;max-height:62vh;float:left;border:1px solid #d5d5ff;margin-right:5px;">
  13. <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">基本信息</p>
  14. <el-form ref="changeSupFrom" :model="changeSupervision" :rules="rules" label-width="140px">
  15. <el-form-item label="选择问题">
  16. <el-select v-model="keyword" filterable popper-class="problem_select" placeholder="请选择" disabled @change="changeSelect">
  17. <el-option
  18. v-for="item in problemList"
  19. :key="item.id"
  20. :label="item.pblmsDesc"
  21. :value="item.id">
  22. </el-option>
  23. </el-select>
  24. </el-form-item>
  25. <el-form-item label="问题描述">
  26. <el-input v-model="changeSupervision.pblmsDesc" readonly rows="5" type="textarea"></el-input>
  27. </el-form-item>
  28. <el-form-item label="法规条款">
  29. <el-input v-model="changeSupervision.relativeLaw" @input="updateView($event)" rows="5" type="textarea" autocomplete="off"></el-input>
  30. </el-form-item>
  31. <el-form-item label="法规内容">
  32. <el-input v-model="changeSupervision.lawContent" @input="updateView($event)" rows="5" type="textarea" autocomplete="off"></el-input>
  33. </el-form-item>
  34. <el-form-item label="备注">
  35. <el-input v-model="changeSupervision.note" readonly rows="1" type="textarea" autocomplete="off"></el-input>
  36. </el-form-item>
  37. <p class="item_title">
  38. <i class="el-icon-caret-right"></i>
  39. <span>责任主体</span>
  40. <span class="el-icon-circle-plus" title="添加单位" @click="addUnit"></span>
  41. <!-- <span class="hrs"></span> -->
  42. </p>
  43. <div v-for="(unit,index) in unitArray" :key="index">
  44. <el-form-item label="单位性质">
  45. <el-select v-model="unit.subId" placeholder="请选择" :disabled="disabled" @change="natureChange(val,index)">
  46. <el-option
  47. v-for="item in objSubjectList"
  48. :key="item.id"
  49. :label="item.subName"
  50. :value="item.id">
  51. </el-option>
  52. </el-select>
  53. <span class="el-icon-remove" title="删除单位" v-if="index != 0" @click="removeUnit(index)"></span>
  54. </el-form-item>
  55. <el-form-item label="单位名称">
  56. <el-select v-model="unit.unitNm" popper-class="problem_select" :disabled="disabled" @change="unitSelect" placeholder="请选择">
  57. <el-option
  58. v-for="item in unitNameList"
  59. :key="item.id"
  60. :label="item.sctnName ? `${item.sysNm}(${item.sctnName})` : item.sysNm"
  61. :value="item.sysNm">
  62. </el-option>
  63. </el-select>
  64. <!-- <el-input v-model="unit.unitNm" autocomplete="off"></el-input> -->
  65. </el-form-item>
  66. </div>
  67. <el-form-item label="">
  68. </el-form-item>
  69. <el-form-item label="排序序号" prop="sn">
  70. <el-input v-model="changeSupervision.sn" autocomplete="off"></el-input>
  71. </el-form-item>
  72. <el-form-item label="发现问题">
  73. <el-input v-model="changeSupervision.pblmNm" :disabled="disabled" autocomplete="off"></el-input>
  74. </el-form-item>
  75. <el-form-item label="问题分类">
  76. <!-- pblmQlttvCd -->
  77. <el-select v-model="changeSupervision.pblmTypeDesc" filterable popper-class="problem_select" style="width: 88%" placeholder="请选择">
  78. <el-option
  79. v-for="(item,index) in problemDxList"
  80. :key="index"
  81. :label="item"
  82. :value="item">
  83. </el-option>
  84. </el-select>
  85. </el-form-item>
  86. <el-form-item label="问题阐述">
  87. <el-input v-model="changeSupervision.pblmDesc" rows="5" type="textarea" :disabled="disabled" autocomplete="off"></el-input>
  88. </el-form-item>
  89. <el-form-item label="问题严重性">
  90. <el-select v-if="isGd || isSc || isSd" :disabled="isDisabled" v-model="changeSupervision.pblmPasi" placeholder="请选择">
  91. <el-option label="一般" value="0"></el-option>
  92. <el-option label="较重" value="1"></el-option>
  93. <el-option label="严重" value="2"></el-option>
  94. </el-select>
  95. <el-select v-if="!isGd && !isSc && !isSd" v-model="changeSupervision.pblmPasi" :disabled="disabled" placeholder="请选择" @change="changeRules">
  96. <el-option
  97. v-for="item in cateObjList"
  98. :key="item.cate"
  99. :label="item.desc"
  100. :value="item.cate">
  101. </el-option>
  102. </el-select>
  103. </el-form-item>
  104. <el-form-item label="问题是否典型">
  105. <el-radio v-model="changeSupervision.ifCasePblm" :disabled="disabled" label="1">是</el-radio>
  106. <el-radio v-model="changeSupervision.ifCasePblm" :disabled="disabled" label="0">否</el-radio>
  107. </el-form-item>
  108. <el-form-item label="主要原因分析" prop="pblmReason">
  109. <el-input v-model="changeSupervision.pblmReason" rows="5" type="textarea" :disabled="disabled" autocomplete="off"></el-input>
  110. </el-form-item>
  111. <el-form-item label="整改意见及建议" prop="pblmSggtn">
  112. <el-input v-model="changeSupervision.pblmSggtn" rows="5" type="textarea" :disabled="disabled" autocomplete="off"></el-input>
  113. </el-form-item>
  114. <el-form-item label="稽察组长复核意见">
  115. <el-input v-model="changeSupervision.spclRvwOptn" rows="5" type="textarea" autocomplete="off"></el-input>
  116. </el-form-item>
  117. </el-form>
  118. </div>
  119. <div
  120. style="width: 49%;float: left;border: 1px solid rgb(213, 213, 255);margin-right: 5px;overflow-y: auto;max-height: 62vh;">
  121. <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">多媒体信息</p>
  122. <el-tabs style="margin:0px 5px">
  123. <el-tab-pane :label="picturetabName">
  124. <el-row style="text-align:right;">
  125. <el-button
  126. :v-if="!addPicPanel?addPicPanel:addPicPanel"
  127. size="mini"
  128. type="text"
  129. :icon="!addPicPanel?'el-icon-circle-plus-outline':'el-icon-circle-close-outline'"
  130. @click="addPic"
  131. >{{!addPicPanel?"添加":"取消"}}</el-button>
  132. </el-row>
  133. <el-row v-show="addPicPanel">
  134. <span style="display: block;text-align: center;color:red;">佐证照片建议上传2至6的偶数张</span>
  135. <upload
  136. ref="uploadFile"
  137. :url="`/pdcApi/file/insert?bizId=`"
  138. @uploadOver="removeNewSupervision"
  139. ></upload>
  140. </el-row>
  141. <el-row>
  142. <div style="overflow-y:auto;overflow-x:hidden;max-height:42vh;padding:10px;">
  143. <div class="upload-container">
  144. <viewer :images="pictureArray">
  145. <draggable v-model="pictureArray" :options="{group:'image'}" @change="dragChange">
  146. <div
  147. v-if="editPicRefresh"
  148. v-for="(item, index) in pictureArray"
  149. :key="index"
  150. class="image-preview image-app-preview">
  151. <div class="image-preview-wrapper">
  152. <img :src="`${hostUrl}/${item.filePath}?d=${new Date().getTime()}`">
  153. <div class="image-preview-action">
  154. <!-- <i @click="previewFile(item.filePath)" class="el-icon-zoom-in"></i> -->
  155. <i @click="removeFile(item.id)" class="el-icon-delete"></i>
  156. <i @click="editPicEvent(item)" class="el-icon-edit-outline"></i>
  157. </div>
  158. </div>
  159. </div>
  160. </draggable>
  161. </viewer>
  162. <el-dialog :visible.sync="previewDialogVisible" class="pic_dialog" append-to-body width="60%">
  163. <div style="width: 500px;height: 460px;margin: 0 auto;position: relative;display: flex;justify-content:center;align-items:center">
  164. <img :src="dialogImageUrl" alt="" :style="rotateDeg" style="max-width: 100%;max-height:460px;">
  165. <p style="position:absolute;bottom: 0;right: 30px;"><i class="el-icon-refresh-right" title="旋转" @click="picRotate"></i></p>
  166. </div>
  167. </el-dialog>
  168. </div>
  169. </div>
  170. </el-row>
  171. </el-tab-pane>
  172. <el-tab-pane :label="audiotabName">
  173. <el-table border :data="audioArray" style="width: 100%;margin: 0 auto;">
  174. <el-table-column header-align="center" align="center" label="音频">
  175. <template slot-scope="scope">
  176. <elaudio
  177. style="margin-left:15%;width:100px;height:30px;"
  178. :theUrl="`${hostUrl}/${scope.row.filePath}`"
  179. ></elaudio>
  180. </template>
  181. </el-table-column>
  182. <el-table-column header-align="center" align="center" label="操作">
  183. <template slot-scope="scope">
  184. <el-button
  185. size="mini"
  186. @click="removeFile(scope.row.id,scope.$index)"
  187. type="danger"
  188. >删除</el-button>
  189. </template>
  190. </el-table-column>
  191. </el-table>
  192. </el-tab-pane>
  193. <el-tab-pane :label="videotabName">
  194. <el-table border :data="videoArray" style="width: 100%;margin: 0 auto;">
  195. <el-table-column header-align="center" align="center" label="视频">
  196. <template slot-scope="scope">
  197. <video-player
  198. class="vjs-custom-skin"
  199. ref="videoPlayer"
  200. :options="scope.row"
  201. :playsinline="true"
  202. ></video-player>
  203. </template>
  204. </el-table-column>
  205. <el-table-column header-align="center" align="center" label="操作">
  206. <template slot-scope="scope">
  207. <el-button
  208. size="mini"
  209. @click="removeFile(scope.row.id,scope.$index)"
  210. type="danger"
  211. >删除</el-button>
  212. </template>
  213. </el-table-column>
  214. </el-table>
  215. </el-tab-pane>
  216. <el-tab-pane :label="filetabName">
  217. <el-table border :data="fileArray" style="width: 100%;margin: 0 auto;">
  218. <el-table-column header-align="center" align="center" label="文档">
  219. <template slot-scope="scope">
  220. <p>
  221. <a :href="`${hostUrl}/${scope.row.filePath}`" target="_blank" rel="noopener noreferrer">
  222. {{scope.row.fileName}}
  223. </a>
  224. </p>
  225. </template>
  226. </el-table-column>
  227. <el-table-column header-align="center" align="center" label="操作">
  228. <template slot-scope="scope">
  229. <el-button
  230. size="mini"
  231. @click="removeFile(scope.row.id,scope.$index)"
  232. type="danger"
  233. >删除</el-button>
  234. </template>
  235. </el-table-column>
  236. </el-table>
  237. </el-tab-pane>
  238. </el-tabs>
  239. </div>
  240. </div>
  241. <span slot="footer">
  242. <el-button type="primary" @click="submitProblem">保存</el-button>
  243. <el-button @click="closeModal">取消</el-button>
  244. </span>
  245. <div v-if="editPicDialog">
  246. <EditPicOnline
  247. ref="editPicWeakupEvnent"
  248. :picUrl="picUrl"
  249. @cancelHandler="cancelHandler"
  250. @editPicData="editPicDataEvent"
  251. ></EditPicOnline>
  252. </div>
  253. </el-dialog>
  254. </template>
  255. <script>
  256. import draggable from "vuedraggable";
  257. import {updatelist,deleteFileById} from "@api/duChaAPI.js";
  258. import {showDetailsXq,getProblemNatureApi,submitProblemApi,getSelectProblemList,getUnitNameListApi,getProblemDxListApi,submitUpdateProblemApi} from "@api/InspectionReport.js";
  259. import request from "@util/gw_ajax_request.js";
  260. import elaudio from "@widget/elAudioShort.vue";
  261. import {hostUrl} from '@util/global_variable.js'
  262. export default {
  263. props: ['problemId','pertype','listType'],
  264. data(){
  265. var checkSn = (rule, value, callback) => {
  266. if (value && value<0) {
  267. return callback(new Error('序号应大于0'));
  268. }
  269. setTimeout(() => {
  270. if (value && (!(/(^[1-9]\d*$)/.test(value)) || value<0)) {
  271. callback(new Error('请输入大于0的正整数'));
  272. } else {
  273. callback();
  274. }
  275. }, 1000);
  276. };
  277. return{
  278. changeSupervisionVisible: true,
  279. changeSupervisionLoading: false,
  280. changeSupervision: {},
  281. supervision: [
  282. {
  283. value: "1",
  284. label: "是"
  285. },
  286. {
  287. value: "0",
  288. label: "否"
  289. }
  290. ],
  291. addPicPanel: false,
  292. gwComFileList: [],
  293. picturetabName: "",
  294. audiotabName: "",
  295. videotabName: "",
  296. filetabName: "",
  297. pictureArray: [],
  298. audioArray: [],
  299. videoArray: [],
  300. fileArray: [],
  301. updateIdXiuGai: "",
  302. pblmId: "",
  303. //稽察添加问题用到的参数
  304. keyword: '',
  305. problemList: [],
  306. problemInfo: {},
  307. gwComFileList: [],
  308. cateObjList:[],//严重程度列表
  309. objSubjectList: [], //单位性质列表
  310. unitNameList: [], //单位名称列表
  311. unitArray: [
  312. {
  313. unitNm:'',
  314. subId:''
  315. }
  316. ],
  317. //为稽察组长时禁用
  318. disabled: false,
  319. rules: {
  320. sn: [
  321. { validator: checkSn, trigger: 'blur' }
  322. ],
  323. pblmReason: [
  324. { required: true, message: '请输入主要原因分析', trigger: 'change' }
  325. ],
  326. pblmSggtn: [
  327. { required: true, message: '请输入意见及建议', trigger: 'change' }
  328. ]
  329. },
  330. dialogImageUrl: '',
  331. previewDialogVisible: false,
  332. rotateDeg: {'transform': 'rotate(0deg)'},
  333. editPicDialog:false,
  334. editPicRefresh:true,
  335. picUrl:"",
  336. picId:"",
  337. problemDxList: [], //问题分类列表
  338. relCode: '',
  339. isLeader:false,
  340. }
  341. },
  342. components:{
  343. elaudio: elaudio,
  344. draggable,
  345. upload: resolve => {
  346. require(["@widget/uploadFileWithPic.vue"], resolve);
  347. },
  348. EditPicOnline: resolve => {
  349. require(["@widget/EditPicOnline/EditPicOnline.vue"], resolve);
  350. },
  351. },
  352. computed:{
  353. hostUrl(){
  354. console.log(hostUrl)
  355. // 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}`
  356. return hostUrl
  357. },
  358. persId() {
  359. return localStorage.getItem("userid") ? localStorage.getItem("userid") : "1098101939614724096";
  360. },
  361. isGd(){
  362. if(localStorage.getItem('currentRlcode').substring(0,2)=="44"){
  363. return true;
  364. }else{
  365. return false;
  366. }
  367. },
  368. isSc(){
  369. if(localStorage.getItem('currentRlcode').substring(0,2)=="51"){
  370. return true;
  371. }else{
  372. return false;
  373. }
  374. },
  375. isDisabled(){
  376. if(this.isSc){
  377. if(this.isLeader){
  378. return false;
  379. }else{
  380. return true;
  381. }
  382. }else{
  383. return false;
  384. }
  385. },
  386. isSd(){
  387. if(localStorage.getItem('currentRlcode').substring(0,2)=="37"){
  388. return true;
  389. }else{
  390. return false;
  391. }
  392. },
  393. isHb(){
  394. if(localStorage.getItem('currentRlcode').substring(0,2)=="42"){
  395. return true;
  396. }else{
  397. return false;
  398. }
  399. }
  400. },
  401. mounted(){
  402. this.getProblemList();
  403. this.changeSup(this.problemId)
  404. this.getLeader(this.problemId);
  405. if(this.pertype == 20){
  406. this.disabled = true
  407. }
  408. },
  409. methods:{
  410. changeRules(){
  411. if(this.isHb){
  412. if(this.changeSupervision.pblmPasi=="0"){
  413. this.rules["pblmReason"][0].required = false;
  414. this.rules["pblmSggtn"][0].required = false;
  415. }else{
  416. this.rules["pblmReason"][0].required = true;
  417. this.rules["pblmSggtn"][0].required = true;
  418. }
  419. }
  420. },
  421. getLeader(id){
  422. request.get(`/tac/pblm/info/ifLeader/${id}`).then(res => {
  423. if(res.success){
  424. this.isLeader = res.data.key;
  425. }
  426. });
  427. },
  428. updateView(){
  429. this.$forceUpdate();
  430. },
  431. editPicEvent(item){
  432. this.picUrl = this.hostUrl + "/" + item.filePath+"?d="+new Date().getTime();
  433. this.editPicDialog = true;
  434. this.editPicRefresh = false;
  435. this.picId = item.id;
  436. },
  437. cancelHandler() {
  438. this.editPicDialog = false;
  439. this.editPicRefresh = true;
  440. },
  441. editPicDataEvent(item){
  442. request.post(`/file/updateFile?bizId=${this.changeSupervision.pblmId}&id=${this.picId}`,item,{headers:{'Content-Type': 'multipart/form-data'}}).then(res => {
  443. console.log(res);
  444. if(res.success){
  445. this.pictureArray = [];
  446. this.changeSup(this.updateIdXiuGai);
  447. this.editPicDialog = false;
  448. this.editPicRefresh = true;
  449. this.$message.success('修改成功');
  450. // showDetailsXq(this.updateIdXiuGai).then(res => {
  451. // res.data.gwComFileList.forEach(item => {
  452. // this.pictureArray.push(item);
  453. // this.editPicDialog = false;
  454. // this.editPicRefresh = true;
  455. // this.$message.success('修改成功');
  456. // });
  457. // this.picturetabName = "图片资料(" + this.pictureArray.length + ")";
  458. // });
  459. }else{
  460. this.$message.warning('修改失败');
  461. }
  462. });
  463. },
  464. // 修改弹窗显示
  465. changeSup(id) {
  466. this.pictureArray = [];
  467. this.audioArray = [];
  468. this.videoArray = [];
  469. this.fileArray = [];
  470. this.updateIdXiuGai = id;
  471. showDetailsXq(this.updateIdXiuGai).then(res => {
  472. // if(this.usersId==)
  473. this.changeSupervision = res.data;
  474. this.changeRules()
  475. this.keyword = this.changeSupervision.tacObjPblmstb ? this.changeSupervision.tacObjPblmstb.id : ''
  476. if(this.changeSupervision.pblmSubjectList){
  477. this.unitArray = this.changeSupervision.pblmSubjectList
  478. }
  479. if(this.changeSupervision.tacObjPblmstb){
  480. this.objSubjectList = this.changeSupervision.tacObjPblmstb.objSubjectList
  481. this.cateObjList = this.changeSupervision.tacObjPblmstb.cateObjList
  482. this.changeSupervision.pblmsDesc = this.changeSupervision.tacObjPblmstb.pblmsDesc
  483. // this.changeSupervision.relativeLaw = this.changeSupervision.tacObjPblmstb.relativeLaw
  484. // this.changeSupervision.lawContent = this.changeSupervision.tacObjPblmstb.lawContent
  485. this.changeSupervision.note = this.changeSupervision.tacObjPblmstb.note
  486. }
  487. this.changeSupervision.pblmQlttvCd = this.changeSupervision.pblmQlttvCd ? this.changeSupervision.pblmQlttvCd.toString() : '';
  488. // this.relCode = this.changeSupervision.lawContent.substr(0,3) by 20200420 thy 统一取class2字段
  489. this.relCode = this.changeSupervision.tacObjPblmstb.class2;
  490. if(this.unitArray.length){
  491. this.unitArray.forEach((ele,index)=>{
  492. this.getUnitNameList(index)
  493. })
  494. }
  495. res.data.gwComFileList.forEach(item => {
  496. if (
  497. item.fileExt == "mp3" ||
  498. item.fileExt == "MP3" ||
  499. item.fileExt == "m4a"
  500. ) {
  501. this.audioArray.push(item);
  502. } else if (
  503. item.fileExt == "jpg" ||
  504. item.fileExt == "JPG" ||
  505. item.fileExt == "png" ||
  506. item.fileExt == "PNG" ||
  507. item.fileExt == "JPEG" ||
  508. item.fileExt == "jpeg"
  509. ) {
  510. this.pictureArray.push(item);
  511. } else if (item.fileExt == "mp4" || item.fileExt == "MP4") {
  512. this.videoArray.push({
  513. width: "130",
  514. height: "130",
  515. autoplay: false,
  516. muted: true,
  517. language: "en",
  518. playbackRates: [0.7, 1.0, 1.5, 2.0],
  519. sources: [
  520. {
  521. type: "video/mp4",
  522. src: this.hostUrl + item.filePath
  523. }
  524. ],
  525. id: item.id
  526. });
  527. } else {
  528. this.fileArray.push(item);
  529. }
  530. });
  531. this.picturetabName = "图片资料(" + this.pictureArray.length + ")";
  532. this.audiotabName = "音频资料(" + this.audioArray.length + ")";
  533. this.videotabName = "视频资料(" + this.videoArray.length + ")";
  534. this.filetabName = "其它资料(" + this.fileArray.length + ")";
  535. // this.getProblemDxList() //不通过这个方法获取问题定性列表了,直接在上面取pblmTypeDesc和pblmTypeDesc2的值
  536. this.changeSelectForDesc(this.keyword)
  537. });
  538. },
  539. getProblemDxList(){
  540. getProblemDxListApi(this.relCode,this.listType).then(res=>{
  541. if(res.success){
  542. this.problemDxList = res.data
  543. }else{
  544. this.$message.error(res.message)
  545. }
  546. }).catch(err=>{
  547. this.$message.error(err)
  548. })
  549. },
  550. // 提交修改信息
  551. submitProblem(){
  552. this.$refs['changeSupFrom'].validate((valid) => {
  553. if(valid){
  554. let unitNames = []
  555. let subIds = [];
  556. this.unitArray = this.uniArr(this.unitArray);
  557. this.unitArray.forEach(ele=>{
  558. unitNames.push(ele.unitNm);
  559. subIds.push(ele.subId);
  560. })
  561. unitNames = unitNames.filter(function (s) {
  562. return s && s.trim();
  563. });
  564. subIds = subIds.filter(function (s) {
  565. return s && s.trim();
  566. });
  567. if((unitNames.length!=subIds.length) && unitNames.length!=0 && subIds.length!=0){
  568. this.$message.warning("对应的单位性质或单位名称其中一个不能为空");
  569. return false;
  570. }
  571. //问题严重性为一般和较重时修改问题是否典型隐藏 默认为否
  572. // if(this.changeSupervision.pblmPasi != '2' || this.changeSupervision.ifCasePblm == ''){
  573. // this.changeSupervision.ifCasePblm = '0'
  574. // }
  575. this.changeSupervision.subjectNames = unitNames.join(',')
  576. this.changeSupervision.subjectIds = subIds.join(",")
  577. this.changeSupervision.pblmSubjectList = this.unitArray
  578. this.changeSupervision.pblmstdId = this.keyword
  579. if(this.changeSupervision.sn == ''){
  580. this.changeSupervision.sn = 0
  581. }
  582. if(this.changeSupervision.pblmReason && this.changeSupervision.pblmReason.length >= 500){
  583. this.$message.warning('主要原因分析需字数小于500字!');
  584. return;
  585. }
  586. if(this.changeSupervision.pblmSggtn && this.changeSupervision.pblmSggtn.length >= 1000){
  587. this.$message.warning('整改意见及建议字数需小于1000字!');
  588. return;
  589. }
  590. if(this.changeSupervision.spclRvwOptn && this.changeSupervision.spclRvwOptn.length >= 500){
  591. this.$message.warning('稽察组长意见字数需小于500字!');
  592. return;
  593. }
  594. submitProblemApi(this.changeSupervision).then(res=>{
  595. if(res.success){
  596. this.gwComFileList = [];
  597. // var obj = {
  598. // id:this.keyword,
  599. // relativeLaw:this.changeSupervision.relativeLaw,
  600. // lawContent:this.changeSupervision.lawContent,
  601. // }
  602. // this.updateLawUpdate(obj);
  603. if (this.$refs.uploadFile.submitUpload(res.data.id,res.data.gwComFileList.length)) {}
  604. this.$message.success('修改成功')
  605. setTimeout(()=>{
  606. this.removeNewSupervision()
  607. })
  608. }else{
  609. this.$message.error(res.message)
  610. }
  611. }).catch(err=>{
  612. this.$message.error(err)
  613. })
  614. }
  615. })
  616. },
  617. updateLawUpdate(obj) {
  618. submitUpdateProblemApi(obj).then(res => {
  619. if (!res.success) {
  620. this.$message.error("更新法律法规信息失败")
  621. }
  622. }).catch(err => {
  623. this.$message.error(err)
  624. })
  625. },
  626. uniArr(tempArr) {
  627. var newTempArr = [];
  628. if(tempArr && tempArr.length>0){
  629. tempArr.forEach((item,index)=>{
  630. if(item.unitNm || item.subId){
  631. newTempArr.push(item);
  632. }
  633. })
  634. for (let i = 0; i < newTempArr.length; i++) {
  635. for (let j = i + 1; j < newTempArr.length; j++) {
  636. if ((newTempArr[i].unitNm == newTempArr[j].unitNm) && (newTempArr[i].subId == newTempArr[j].subId)) {
  637. newTempArr.splice(j, 1);
  638. j--;
  639. };
  640. };
  641. };
  642. return newTempArr;
  643. }else{
  644. return [];
  645. }
  646. },
  647. unitSelect(){
  648. let _this = this
  649. let unitIds = []
  650. this.unitArray.forEach((ele,index)=>{
  651. _this.unitNameList.forEach(element=>{
  652. if(ele.unitNm == element.sysNm){
  653. this.unitArray[index].unitId = element.id
  654. }
  655. })
  656. unitIds.push(ele.unitId)
  657. })
  658. // this.changeSupervision.subjectIds = unitIds.join(',')
  659. },
  660. getProblemList(){
  661. getSelectProblemList(this.keyword,this.listType).then(res=>{
  662. if(res.success){
  663. this.problemList = res.data.list
  664. }else{
  665. this.$message.error(res.message)
  666. }
  667. }).catch(err=>{
  668. this.$message.error(err)
  669. })
  670. },
  671. changeSelect(val){
  672. getProblemNatureApi(val).then(res=>{
  673. if(res.success){
  674. this.problemInfo = res.data
  675. this.changeSupervision.pblmsDesc = this.problemInfo.pblmsDesc
  676. this.changeSupervision.relativeLaw = this.problemInfo.relativeLaw
  677. this.changeSupervision.lawContent = this.problemInfo.lawContent
  678. this.changeSupervision.note = this.problemInfo.note
  679. this.objSubjectList = this.problemInfo.objSubjectList
  680. this.cateObjList = this.problemInfo.cateObjList
  681. this.changeSupervision.pblmPasi = this.cateObjList[0].cate
  682. this.changeSupervision.pblmNm = this.problemInfo.pblmsDesc //发现问题项的内容默认为问题描述内容 可更改
  683. this.relCode = this.problemInfo.class2 //获取问题分类列表需要的问题标准序号
  684. this.changeSupervision.pblmTypeDesc = ''
  685. this.problemDxList = []
  686. if(this.problemInfo.pblmTypeDesc){
  687. this.problemDxList.push(this.problemInfo.pblmTypeDesc)
  688. }
  689. if(this.problemInfo.pblmTypeDesc2){
  690. this.problemDxList.push(this.problemInfo.pblmTypeDesc2)
  691. }
  692. // this.getProblemDxList()
  693. }else{
  694. this.$message.error(res.message)
  695. }
  696. }).catch(err=>{
  697. this.$message.error(err)
  698. })
  699. },
  700. // 为了获取问题类别列表
  701. changeSelectForDesc(val){
  702. getProblemNatureApi(val).then(res=>{
  703. if(res.success){
  704. this.problemDxList = []
  705. if(res.data.pblmTypeDesc){
  706. this.problemDxList.push(res.data.pblmTypeDesc)
  707. }
  708. if(res.data.pblmTypeDesc2){
  709. this.problemDxList.push(res.data.pblmTypeDesc2)
  710. }
  711. }else{
  712. this.$message.error(res.message)
  713. }
  714. }).catch(err=>{
  715. this.$message.error(err)
  716. })
  717. },
  718. addUnit(){
  719. this.unitArray.push({unitNm:'',unitId: '',subId:'',subName:''})
  720. },
  721. removeUnit(index){
  722. this.unitArray.splice(index,1)
  723. },
  724. getUnitNameList(index){
  725. let subId = this.unitArray[index].subId ? this.unitArray[index].subId : ''
  726. let paramsObj = {
  727. rgstrId: this.changeSupervision.rgstrId,
  728. sysType: subId
  729. }
  730. if(subId){
  731. getUnitNameListApi(paramsObj).then(res=>{
  732. if(res.success){
  733. this.unitNameList = res.data
  734. if(!this.unitNameList.length){
  735. this.unitArray[index].unitNm = '' //单位性质切换时没有单位数据清空单位名称
  736. }
  737. }else{
  738. this.$message.error(res.message)
  739. }
  740. }).catch(err=>{
  741. this.$message.error(err)
  742. })
  743. }
  744. },
  745. natureChange(val,index){
  746. this.unitArray.forEach((ele,index)=>{
  747. this.objSubjectList.forEach(element=>{
  748. if(ele.subId == element.id){
  749. this.unitArray[index].subName = element.subName
  750. }
  751. })
  752. })
  753. let subIds = []
  754. this.unitArray.forEach((ele,index)=>{
  755. subIds.push(ele.subId)
  756. })
  757. this.changeSupervision.subjectIds = subIds.join(',')
  758. this.getUnitNameList(index)
  759. },
  760. removeNewSupervision(arg) {
  761. if (arg) {
  762. var args = this.gwComFileList.concat(arg);
  763. }
  764. this.changeSup(this.problemId)
  765. this.$emit('dialogClose')
  766. this.gwComFileList = [];
  767. },
  768. changeSupervisionVisiblefalse() {
  769. this.$emit('closeEditDialog')
  770. this.$refs.uploadFile.init();
  771. this.addPicPanel = false;
  772. },
  773. addPic() {
  774. this.addPicPanel = !this.addPicPanel;
  775. },
  776. // 删除图片文件
  777. removeFile(id, index) {
  778. // this.updateIdXiuGai = this.updateIdXiuGai;
  779. var _self = this;
  780. this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
  781. confirmButtonText: "确定",
  782. cancelButtonText: "返回",
  783. type: "warning"
  784. }).then(
  785. res => {
  786. if (res === "confirm") {
  787. deleteFileById(id, this.persId).then(res => {
  788. if (res.success) {
  789. this.changeSupervision.gwComFileList.forEach(item => {
  790. if (
  791. item.fileExt == "mp3" ||
  792. item.fileExt == "MP3" ||
  793. item.fileExt == "m4a"
  794. ) {
  795. this.audioArray.splice(index, 1);
  796. } else if (
  797. item.fileExt == "jpg" ||
  798. item.fileExt == "JPG" ||
  799. item.fileExt == "png" ||
  800. item.fileExt == "PNG" ||
  801. item.fileExt == "JPEG" ||
  802. item.fileExt == "jpeg"
  803. ) {
  804. this.pictureArray.splice(index, 1);
  805. } else if (item.fileExt == "mp4" || item.fileExt == "MP4") {
  806. this.videoArray.splice(index, 1);
  807. }
  808. });
  809. _self.changeSup(this.updateIdXiuGai);
  810. } else {
  811. this.failInfo();
  812. }
  813. });
  814. }
  815. },
  816. res => {
  817. console.log("返回");
  818. }
  819. )
  820. },
  821. // 操作成功反馈
  822. successInfo() {
  823. this.$message({
  824. type: "success",
  825. message: "操作成功!"
  826. });
  827. },
  828. // 操作失败反馈
  829. failInfo(val) {
  830. this.$message.error(val);
  831. },
  832. // 文件上传
  833. submitUpload() {
  834. this.$refs.upload.submit();
  835. },
  836. closeModal(){
  837. this.$emit('dialogClose')
  838. },
  839. dragChange(val){
  840. console.log(val)
  841. // let oldIndex = val.moved.oldIndex
  842. // let newIndex = val.moved.newIndex
  843. // let oldItem = this.changeSupervision.gwComFileList[oldIndex]
  844. // let newItem = this.changeSupervision.gwComFileList[newIndex]
  845. // this.changeSupervision.gwComFileList[oldIndex] = newItem
  846. // this.changeSupervision.gwComFileList[newIndex] = oldItem
  847. console.log(this.pictureArray)
  848. let gwComFileList = []
  849. gwComFileList = gwComFileList.concat(this.pictureArray).concat(this.audioArray).concat(this.videoArray).concat(this.fileArray)
  850. this.changeSupervision.gwComFileList = gwComFileList
  851. console.log(this.changeSupervision.gwComFileList)
  852. },
  853. previewFile(url){
  854. this.dialogImageUrl = `${this.hostUrl}/${url}`
  855. this.previewDialogVisible = true
  856. },
  857. picRotate(){
  858. if(this.rotateDeg.transform == 'rotate(0deg)'){
  859. this.rotateDeg = {'transform': 'rotate(90deg)'}
  860. }else if(this.rotateDeg.transform == 'rotate(90deg)'){
  861. this.rotateDeg = {'transform': 'rotate(180deg)'}
  862. }else if(this.rotateDeg.transform == 'rotate(180deg)'){
  863. this.rotateDeg = {'transform': 'rotate(270deg)'}
  864. }else if(this.rotateDeg.transform == 'rotate(270deg)'){
  865. this.rotateDeg = {'transform': 'rotate(360deg)'}
  866. }else if(this.rotateDeg.transform == 'rotate(360deg)'){
  867. this.rotateDeg = {'transform': 'rotate(90deg)'}
  868. }
  869. }
  870. },
  871. watch:{
  872. problemId(val){
  873. this.changeSup(val)
  874. this.getLeader(val);
  875. },
  876. pertype(val){
  877. if(val == 20){
  878. this.disabled = true
  879. }
  880. }
  881. }
  882. }
  883. </script>
  884. <style lang="scss">
  885. .scroll_wrapper{
  886. overflow: hidden;
  887. }
  888. .scroll_wrapper .el-form{
  889. padding-top: 5px;
  890. padding-right: 5px;
  891. }
  892. .upload-container {
  893. width: 100%;
  894. position: relative;
  895. .image-uploader {
  896. width: 35%;
  897. float: left;
  898. }
  899. .image-preview {
  900. width: 200px;
  901. height: 200px;
  902. position: relative;
  903. border: 1px dashed #d9d9d9;
  904. float: left;
  905. // margin-left: 50px;
  906. .image-preview-wrapper {
  907. position: relative;
  908. width: 100%;
  909. height: 100%;
  910. img {
  911. width: 100%;
  912. height: 100%;
  913. }
  914. }
  915. .image-preview-action {
  916. position: absolute;
  917. width: 100%;
  918. height: 40px;
  919. left: 0;
  920. bottom: 0;
  921. color: #fff;
  922. opacity: 0;
  923. font-size: 20px;
  924. background-color: rgba(0, 0, 0, 0.5);
  925. transition: opacity 0.3s;
  926. cursor: pointer;
  927. text-align: center;
  928. line-height: 40px;
  929. .el-icon-delete,.el-icon-zoom-in{
  930. font-size: 22px;
  931. margin: 0 5px;
  932. }
  933. }
  934. &:hover {
  935. .image-preview-action {
  936. opacity: 1;
  937. }
  938. }
  939. }
  940. .image-app-preview {
  941. margin-bottom: 10px;
  942. margin-right: 6px;
  943. width: 40vh;
  944. height: 180px;
  945. position: relative;
  946. border: 1px dashed #d9d9d9;
  947. float: left;
  948. // margin-left: 50px;
  949. .app-fake-conver {
  950. height: 44px;
  951. position: absolute;
  952. width: 100%; // background: rgba(0, 0, 0, .1);
  953. text-align: center;
  954. line-height: 64px;
  955. color: #fff;
  956. }
  957. }
  958. }
  959. .problem_select .el-select-dropdown__item{
  960. width: 500px;
  961. }
  962. .modify_problem_dialog{
  963. .el-dialog__body{
  964. font-size: 15px;
  965. }
  966. .el-form-item__label{
  967. font-size: 15px;
  968. color: #333;
  969. }
  970. .el-input--mini{
  971. font-size: 13px;
  972. }
  973. .el-button--mini{
  974. font-size: 14px;
  975. }
  976. .el-icon-circle-plus,.el-icon-remove{
  977. margin-left: 10px;
  978. color: #009fff;
  979. cursor: pointer;
  980. }
  981. .el-icon-remove{
  982. color: red;
  983. }
  984. }
  985. .el-icon-refresh-right{
  986. font-size: 36px;
  987. cursor: pointer;
  988. }
  989. .pic_dialog .el-dialog{
  990. margin-top: 10vh !important;
  991. }
  992. .viewer-container{
  993. z-index: 9999 !important;
  994. }
  995. </style>