ec2dddc1aa4cad30a5d8d36ead2a4e29a0538940.svn-base 9.6 KB

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