99875d2f2cec84bf691030cc512c320661d96acb.svn-base 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <template>
  2. <div>
  3. <el-form ref="problemForm" :rules="rules" :model="problemForm" label-width="100px">
  4. <el-form-item>
  5. <el-button type="text" @click="selectPblm" style="float: left;">选择问题</el-button>
  6. </el-form-item>
  7. <el-form-item label="问题类别" style="text-align:left">
  8. <el-select v-model="t1" value-key="inspPblmsName" placeholder="请选择" disabled>
  9. <el-option v-for="(item,index) in problemList" :key="index" :label="item.inspPblmsName" :value="item">
  10. </el-option>
  11. </el-select>
  12. </el-form-item>
  13. <el-form-item label="检查项目" style="text-align:left">
  14. <el-select v-model="t2" placeholder="请选择" value-key="checkPointName" disabled>
  15. <el-option v-for="(item,index) in currentCheckPointList" :key="index" :label="item.checkPointName" :value="item">
  16. </el-option>
  17. </el-select>
  18. </el-form-item>
  19. <el-form-item label="问题描述" style="text-align:left">
  20. <el-input v-model="t3" type="textarea" :rows="4" placeholder="" disabled></el-input>
  21. </el-form-item>
  22. <el-form-item label="详情" style="text-align:left">
  23. <span>{{t3}}</span>
  24. </el-form-item>
  25. <el-form-item label="严重程度:" style="text-align:left" prop="inspPblmCate" v-if="rowData.type=='613'">
  26. <el-select v-model="inspPblmCate">
  27. <el-option label="一般" value="0"></el-option>
  28. <el-option label="较重" value="1"></el-option>
  29. <el-option label="严重" value="2"></el-option>
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item label="责任单位:" style="text-align: left;" v-if="rowData.type=='608' || rowData.type=='609' || rowData.type=='610' || rowData.type=='611'">
  33. <el-select v-model="unitList" placeholder="责任单位" style="width:300px;" multiple collapse-tags clearable>
  34. <el-option v-for="(item,index) in sectList" :key="item.sectType+'-'+item.sectName" :label="item.sectType+'-'+item.sectName" :value="item.sectType+'-'+item.sectName"></el-option>
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item label="详细描述">
  38. <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="problemForm.inspPblmDesc" required>
  39. </el-input>
  40. </el-form-item>
  41. <el-form-item label="备注">
  42. <el-input
  43. type="textarea"
  44. :rows="2"
  45. placeholder="请输入内容"
  46. v-model="problemForm.note">
  47. </el-input>
  48. </el-form-item>
  49. <!-- <el-form-item label="严重程度:" style="text-align:left" prop="inspPblmCate">-->
  50. <!-- <p v-if="inspPblmCate == 0" >一般</p>-->
  51. <!-- <p v-if="inspPblmCate == 1" >较重</p>-->
  52. <!-- <p v-if="inspPblmCate == 2" >严重</p>-->
  53. <!-- <p v-if="inspPblmCate == 3" >特别严重</p>-->
  54. <!-- </el-form-item>-->
  55. <!-- <el-form-item label="典型问题" label-width="80px" style=" text-align:left">-->
  56. <!-- <el-radio v-model="problemForm.ifCasePblm" label="1">是</el-radio>-->
  57. <!-- <el-radio v-model="problemForm.ifCasePblm" label="0">否</el-radio>-->
  58. <!-- </el-form-item>-->
  59. <el-form-item label="上传照片">
  60. <upload ref="uploadFile" :url="`/pdcApi/file/insert?bizId=`" @uploadOver="removeNewSupervision"></upload>
  61. </el-form-item>
  62. <el-form-item style="margin-top: 50px">
  63. <el-button type="primary" @click="onSubmit('problemForm')" style="width: 100px;float:right">保存</el-button>
  64. </el-form-item>
  65. </el-form>
  66. <el-dialog
  67. class="pblmEascader"
  68. title="选择问题"
  69. width="60%"
  70. append-to-body
  71. :visible.sync="pblmEascaderVisible">
  72. <pblmEascader :objType="rowData.type" @modelData="modelData" :vmodelData="newPblmValue" :t3="t3" v-if="pblmEascaderVisible"></pblmEascader>
  73. <span slot="footer">
  74. <el-button @click="pblmEascaderVisible=false">返 回</el-button>
  75. <el-button type="primary" @click="submitEascader">确 定</el-button>
  76. </span>
  77. </el-dialog>
  78. </div>
  79. </template>
  80. <script>
  81. import request from '../../../utils/gw_ajax_request.js'
  82. import pblmEascader from '../../duChaTianBao/project/pblmEascaderCommon'
  83. import {
  84. submitUpload
  85. } from "../../../api/duChaAPI.js";
  86. export default {
  87. props: ['objId', 'objName', 'villType', 'objType', 'problemMiddleType', 'problemSmallType', 'engId', 'currentObjectRgstrId','newModelData','rowData'],
  88. data() {
  89. return {
  90. problemForm: {
  91. t1: '',
  92. t2: '',
  93. t3: '',
  94. villType: '',
  95. objId: "",
  96. regid: '',
  97. objType: "",
  98. inspPblmCate: "",
  99. inspPblmDesc: "",
  100. ifCasePblm: '0',
  101. pblmStat: "",
  102. dataStat: "",
  103. nm: "",
  104. recPers: "",
  105. note: "",
  106. gwComFiles: [{
  107. id: "",
  108. filePath: "",
  109. bizId: ""
  110. }]
  111. },
  112. inspPblmCate:"",
  113. inspPlamCatelist: ['一般', '较重', '严重'],
  114. imgList: [],
  115. videoList: [],
  116. audioList: [],
  117. pblmStat: '',
  118. gwComFiles: [],
  119. problemList: [],
  120. currentCheckPointList: [],
  121. currentProblemDescList: [],
  122. t1: '',
  123. t2: '',
  124. t3: '',
  125. xiangqingmiaoshu: '',
  126. wenTiLeiBie:"",
  127. jianChaXiangMu:"",
  128. rules: {
  129. inspPblmDesc: [{
  130. required: true,
  131. message: '请输入描述',
  132. trigger: 'blur'
  133. },
  134. ],
  135. },
  136. pblmEascaderVisible: false,
  137. newPblmValue: [],
  138. sectList:[],
  139. unitList:[]
  140. }
  141. },
  142. components: {
  143. upload: resolve => {
  144. require(["../../../widgets/uploadFile.vue"], resolve);
  145. },
  146. pblmEascader
  147. },
  148. computed: {
  149. recPers() {
  150. return localStorage.getItem('userid') ? localStorage.getItem('userid') : '';
  151. }
  152. },
  153. created(){
  154. this.getSectList();
  155. },
  156. mounted() {
  157. this.newPblmValue = this.newModelData;
  158. if(this.newPblmValue){
  159. this.t1 = this.newPblmValue.model[0];
  160. this.t2 = this.newPblmValue.model[1];
  161. this.t3 = this.newPblmValue.label;
  162. this.getYanZhongChengDu();
  163. }
  164. },
  165. methods:{
  166. getSectList(){
  167. request.get(`/att/gnrl/sect/base/getBy/${this.rowData.rgstrId}`).then(res => {
  168. if (res.success) {
  169. this.sectList = res.data;
  170. }
  171. })
  172. },
  173. addPlus(){
  174. this.unitList.push({dutyName:"",dutyType:""});
  175. },
  176. remove(index){
  177. this.unitList.splice(index, 1);
  178. },
  179. getYanZhongChengDu(){
  180. request.post('/dc/insp/pblms/getByPblms', {
  181. inspPblmsName:this.t1,
  182. checkPoint:this.t2,
  183. pblmDesc:this.t3,
  184. type: this.rowData.type
  185. }).then(res => {
  186. if (res.success) {
  187. console.log("验证"+res);
  188. this.inspPblmCate=res.data.inspPblmCate;
  189. }
  190. })
  191. },
  192. onSubmit(problemForm) {
  193. this.$refs[problemForm].validate((valid) => {
  194. if (valid) {
  195. this.problemForm.villType = '0';
  196. this.problemForm.recPers = this.recPers
  197. this.problemForm.objId = this.objId;
  198. this.problemForm.regid = this.currentObjectRgstrId;
  199. this.problemForm.nm = this.objName
  200. this.problemForm.objType = this.objType;
  201. this.problemForm.pblmStat = "0";
  202. this.problemForm.cwsCode = this.rowData.type;
  203. this.problemForm['inspPblmName'] = this.t1;
  204. this.problemForm['inspPblmDesc'] = this.problemForm.inspPblmDesc;
  205. this.problemForm['inspPlbmType'] = this.t2;
  206. // this.problemForm['inspPblmName'] = this.t3.pblmDesc;
  207. this.problemForm['inspPblmCode'] = this.t3;
  208. this.problemForm['pblmsTypeId'] = this.newPblmValue.model[2];
  209. this.problemForm.inspPblmCate = this.inspPblmCate;
  210. var list = [];
  211. this.unitList.forEach((item,index)=>{
  212. list.push({dutyName:item.split("-")[1],dutyType:item.split("-")[0]});
  213. })
  214. this.problemForm.bisInspPblmDuties = list;
  215. if (!this.problemForm.inspPblmName) {
  216. this.$message.info('问题类别不能为空')
  217. return
  218. }
  219. if (!this.problemForm.inspPlbmType) {
  220. this.$message.info('检查项目不能为空')
  221. return
  222. }
  223. if (!this.problemForm.inspPblmCode) {
  224. this.$message.info('问题描述不能为空')
  225. return
  226. }
  227. request.post('/dc/insp/pblm', this.problemForm).then(res => {
  228. if (res.success) {
  229. this.pblmId = res.data.pblmId;
  230. this.gwComFiles = [];
  231. this.pblmStat = res.data.pblmStat;
  232. if (this.$refs.uploadFile.submitUpload(res.data.pblmId)) {
  233. this.removeNewSupervision();
  234. }
  235. }
  236. })
  237. } else {
  238. console.log('error submit!!');
  239. return false;
  240. }
  241. });
  242. },
  243. // 文件上传
  244. submitUpload() {
  245. this.$refs.upload.submit();
  246. },
  247. updatefilelist(arg) {
  248. request.post('/dc/insp/pblm/update', {
  249. pblmId: this.pblmId,
  250. gwComFiles: arg,
  251. pblmStat: this.pblmStat
  252. }).then(res => {
  253. this.removeNewSupervision()
  254. });
  255. },
  256. removeNewSupervision(arg) {
  257. if (arg) {
  258. console.log(arg);
  259. var args = this.gwComFiles.concat(arg);
  260. this.updatefilelist(args);
  261. }
  262. this.$message.success('保存成功')
  263. this.$emit('closeDialog')
  264. this.gwComFiles = [];
  265. this.$refs.uploadFile.init();
  266. },
  267. problemListChange: function (item) {
  268. this.currentCheckPointList = item.checkPoints;
  269. },
  270. currentCheckPointListChange: function (item) {
  271. this.currentProblemDescList = item.pblmDescs;
  272. },
  273. // currentProblemDescListChange: function (item) {
  274. // console.log(item);
  275. // },
  276. modelData(val){
  277. this.newPblmValue = val;
  278. this.t1 = this.newPblmValue.model[0];
  279. this.t2 = this.newPblmValue.model[1];
  280. this.t3 = this.newPblmValue.label;
  281. this.getYanZhongChengDu();
  282. },
  283. selectPblm(){
  284. this.pblmEascaderVisible = true;
  285. },
  286. submitEascader(){
  287. if(!this.newPblmValue.model.length){
  288. this.$message.warning('问题不能为空');
  289. return;
  290. }
  291. this.pblmEascaderVisible = false;
  292. }
  293. },
  294. watch: {
  295. },
  296. }
  297. </script>
  298. <style>
  299. .media_item {
  300. float: left;
  301. width: 60px;
  302. font-size: 32px;
  303. }
  304. /*.el-select--mini {*/
  305. /*width: 100%;*/
  306. /*}*/
  307. .pblmEascader .el-dialog__body {
  308. height: 15vh;
  309. overflow: auto;
  310. }
  311. </style>