d58efebea35247159ffc0fb79a7f05f3e4cd8ff9.svn-base 10 KB

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