d21e819606bbfca833f205e3c55e7dfd5e4a1f04.svn-base 9.9 KB

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