8147f089ab4e6130b6a4f5f19e23656604ccc653.svn-base 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <el-form ref="form" :model="problemForm" label-width="150px" class="ysh_dialog">
  3. <el-form-item label="问题类别">
  4. <el-input v-model="problemForm.inspPblmName" readonly style="width:80%;"></el-input>
  5. </el-form-item>
  6. <el-form-item label="检查项目">
  7. <el-input v-model="problemForm.inspPblmsName" readonly style="width:80%;"></el-input>
  8. </el-form-item>
  9. <el-form-item label="问题描述">
  10. <el-input type="textarea" v-model="problemForm.inspPblmDesc" style="width:80%;"></el-input>
  11. </el-form-item>
  12. <el-form-item label="整改意见">
  13. <el-input type="textarea" v-model="problemForm.note" style="width:80%;"></el-input>
  14. </el-form-item>
  15. <el-form-item label="列为典型问题">
  16. <el-checkbox style="display: -webkit-box;margin-left: 10%;" v-model="checked"></el-checkbox>
  17. </el-form-item>
  18. <!-- <el-form-item label="严重程度" style="text-align:left">
  19. <el-radio v-model="problemForm.inspPblmCate" label="0" style="margin-left: 10%;">一般</el-radio>
  20. <el-radio v-model="problemForm.inspPblmCate" label="1">较重</el-radio>
  21. <el-radio v-model="problemForm.inspPblmCate" label="2">严重</el-radio>
  22. </el-form-item> -->
  23. <!-- <el-form-item label="经度">
  24. <el-input v-model="problemForm.longitude" autocomplete="off" style="width:80%;"></el-input>
  25. </el-form-item>
  26. <el-form-item label="纬度">
  27. <el-input v-model="problemForm.latitude" autocomplete="off" style="width:80%;"></el-input>
  28. </el-form-item> -->
  29. <el-form-item label="相关文件">
  30. <upload ref="uploadFile" :url="`/pdcApi/file/insert?bizId=`" @uploadOver="removeNewSupervision"></upload>
  31. </el-form-item>
  32. <el-form-item style="margin-top: 50px">
  33. <el-button type="primary" @click="onSubmit" style="width: 100px;float:right">保存</el-button>
  34. </el-form-item>
  35. </el-form>
  36. </template>
  37. <script>
  38. import request from '../../../../utils/gw_ajax_request.js'
  39. import { submitUpload } from "../../../../api/duChaAPI.js";
  40. export default {
  41. props: ['objId','objName','objType','villType','grwCode','problemMiddleType','problemSmallType','stationType','regId'],
  42. data(){
  43. return{
  44. checked:false,
  45. problemForm:{
  46. objId: "",
  47. objType: "",
  48. villType: "",
  49. inspPblmName: "",
  50. inspPblmsName: "",
  51. ifCasePblm: "",
  52. pblmsTypeId: "",
  53. inspPblmCate: "",
  54. inspPblmDesc: "",
  55. pblmStat: "",
  56. dataStat: "",
  57. nm: "",
  58. recPers: "",
  59. note: "",
  60. gwComFiles: [{
  61. id: "",
  62. filePath: "",
  63. bizId: ""
  64. }]
  65. },
  66. pblmsTypeId: '',
  67. smallTypeList: [],
  68. pblmId: '',
  69. imgList: [],
  70. videoList:[],
  71. audioList: [],
  72. pblmStat: '',
  73. gwComFiles: []
  74. }
  75. },
  76. computed:{
  77. recPers(){
  78. return localStorage.getItem('userid') ? localStorage.getItem('userid') : '';
  79. }
  80. },
  81. components: {
  82. upload: resolve => {
  83. require(["../../../../widgets/uploadFile.vue"], resolve);
  84. },
  85. },
  86. mounted(){
  87. this.getType()
  88. },
  89. methods:{
  90. getType(){
  91. let pguid
  92. if(this.stationType == 'autoStation'){
  93. pguid = '00000000000000000000000000000000'
  94. }else{
  95. pguid = '50000000000000000000000000000000'
  96. }
  97. request.get('/dc/insp/pblms/getPblmType',{params:{'type':5,'pguid':pguid}}).then(res=>{
  98. if(res.success){
  99. let _this = this
  100. res.data.forEach((ele)=>{
  101. if(ele.inspPblmsName.indexOf(_this.problemMiddleType) > -1){
  102. let guid = ele.guid
  103. this.problemForm.inspPblmName = ele.inspPblmsName
  104. request.get('/dc/insp/pblms/getPblmType',{params:{'type':5,'pguid':guid}}).then(res=>{
  105. if(res.success){
  106. this.smallTypeList = res.data
  107. this.smallTypeList.forEach(ele=>{
  108. if(ele.inspPblmsName.indexOf(_this.problemSmallType) > -1){
  109. _this.pblmsTypeId = ele.guid
  110. this.problemForm.inspPblmsName = ele.inspPblmsName
  111. }
  112. })
  113. }
  114. })
  115. }
  116. })
  117. }
  118. })
  119. },
  120. onSubmit(){
  121. this.problemForm.regid = this.regId
  122. this.problemForm.recPers = this.recPers
  123. this.problemForm.objId = this.objId
  124. this.problemForm.nm = this.objName
  125. this.problemForm.objType = this.objType
  126. this.problemForm.villType = this.villType
  127. this.problemForm.pblmsTypeId = this.pblmsTypeId
  128. this.problemForm.pblmStat = "0";
  129. this.problemForm.ifCasePblm = this.checked ? '1' : '0'
  130. if(!this.problemForm.inspPblmDesc){
  131. this.$message.warning('请填写问题描述')
  132. return
  133. }
  134. if(!this.problemForm.note){
  135. this.$message.warning('请填写整改意见')
  136. return
  137. }
  138. request.post('/dc/insp/pblm',this.problemForm).then(res=>{
  139. if (res.success) {
  140. this.pblmId = res.data.pblmId;
  141. this.gwComFiles = [];
  142. this.pblmStat = res.data.pblmStat;
  143. if (this.$refs.uploadFile.submitUpload(res.data.pblmId)) {
  144. this.removeNewSupervision();
  145. }
  146. }
  147. })
  148. },
  149. // 文件上传
  150. submitUpload() {
  151. this.$refs.upload.submit();
  152. },
  153. updatefilelist(arg) {
  154. request.post('/dc/insp/pblm/update',{
  155. pblmId: this.pblmId,
  156. gwComFiles: arg,
  157. pblmStat: this.pblmStat
  158. }).then(res => {
  159. this.removeNewSupervision()
  160. });
  161. },
  162. removeNewSupervision(arg){
  163. if (arg) {
  164. console.log(arg);
  165. var args = this.gwComFiles.concat(arg);
  166. this.updatefilelist(args);
  167. }
  168. this.$message.success('保存成功')
  169. this.$emit('closeDialog')
  170. this.gwComFiles = [];
  171. this.$refs.uploadFile.init();
  172. }
  173. },
  174. watch:{
  175. pblmsTypeId(newVal,oldVal){
  176. this.smallTypeList.forEach(ele=>{
  177. if(this.pblmsTypeId == ele.guid){
  178. this.problemForm.inspPblmsName = ele.inspPblmsName
  179. }
  180. })
  181. }
  182. }
  183. }
  184. </script>
  185. <style>
  186. .media_item{
  187. float: left;
  188. width: 60px;
  189. font-size: 32px;
  190. }
  191. </style>