3d2ad4815b10bd5326645afdb28c7a3c18eab16f.svn-base 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <el-form ref="form" :model="problemForm" label-width="80px" class="syd_diglog">
  3. <el-form-item label="问题类别">
  4. <el-input v-model="problemForm.inspPblmName" disabled></el-input>
  5. </el-form-item>
  6. <!-- <el-form-item label="严重程度" style=" text-align:left">
  7. <el-radio v-model="problemForm.inspPblmCate" label="0">一般</el-radio>
  8. <el-radio v-model="problemForm.inspPblmCate" label="1">较重</el-radio>
  9. <el-radio v-model="problemForm.inspPblmCate" label="2">严重</el-radio>
  10. </el-form-item> -->
  11. <el-form-item label="典型问题" label-width="80px" style=" text-align:left">
  12. <el-radio v-model="problemForm.ifCasePblm" label="1">是</el-radio>
  13. <el-radio v-model="problemForm.ifCasePblm" label="0">否</el-radio>
  14. </el-form-item>
  15. <el-form-item label="发现问题" style=" text-align:left">
  16. <el-select v-model="pblmsTypeId" placeholder="请选择" disabled style="max-width: 500px">
  17. <el-option
  18. v-for="item in smallTypeList"
  19. :key="item.guid"
  20. :label="item.inspPblmsName"
  21. :title="item.inspPblmsName"
  22. :value="item.guid" style="max-width: 500px">
  23. </el-option>
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item label="问题描述">
  27. <el-input type="textarea" v-model="problemForm.inspPblmDesc"></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','problemMiddleType','problemSmallType'],
  42. data(){
  43. return{
  44. problemForm:{
  45. objId: "",
  46. objType: "",
  47. villType: "",
  48. inspPblmName: "",
  49. inspPblmsName: "",
  50. pblmsTypeId: "",
  51. inspPblmCate: "",
  52. ifCasePblm:"",
  53. inspPblmDesc: "",
  54. pblmStat: "",
  55. dataStat: "",
  56. nm: "",
  57. recPers: "",
  58. note: "",
  59. gwComFiles: [{
  60. id: "",
  61. filePath: "",
  62. bizId: ""
  63. }]
  64. },
  65. pblmsTypeId: "",
  66. smallTypeList: [],
  67. pblmId: '',
  68. imgList: [],
  69. videoList:[],
  70. audioList: [],
  71. pblmStat: '',
  72. gwComFiles: []
  73. }
  74. },
  75. computed:{
  76. recPers(){
  77. return localStorage.getItem('userid') ? localStorage.getItem('userid') : '';
  78. }
  79. },
  80. components: {
  81. upload: resolve => {
  82. require(["../../../widgets/uploadFile.vue"], resolve);
  83. },
  84. },
  85. mounted(){
  86. this.getType()
  87. this.problemForm.inspPblmsName = this.problemSmallType ? this.problemSmallType : this.smallTypeList[0].inspPblmsName
  88. this.problemForm.inspPblmName = this.problemMiddleType
  89. },
  90. methods:{
  91. getType(){
  92. request.get('/dc/insp/pblms/getPblmType',{params:{type:2}}).then(res=>{
  93. if(res.success){
  94. let _this = this
  95. res.data.forEach((ele)=>{
  96. if(ele.inspPblmsName == '水源地'){
  97. let pguid = ele.guid
  98. request.get('/dc/insp/pblms/getPblmType',{params:{'type':2,'pguid':pguid}}).then(res=>{
  99. if(res.success){
  100. this.smallTypeList = res.data
  101. this.smallTypeList.forEach(ele=>{
  102. if(ele.inspPblmsName.indexOf(_this.problemSmallType) > -1){
  103. _this.pblmsTypeId = ele.guid
  104. }
  105. })
  106. }
  107. })
  108. }
  109. })
  110. }
  111. })
  112. },
  113. onSubmit(){
  114. this.problemForm.recPers = this.recPers
  115. this.problemForm.objId = this.objId
  116. this.problemForm.nm = this.objName
  117. this.problemForm.objType = this.objType
  118. this.problemForm.villType = this.villType
  119. this.problemForm.pblmsTypeId = this.pblmsTypeId
  120. this.problemForm.pblmStat = "0";
  121. request.post('/dc/insp/pblm',this.problemForm).then(res=>{
  122. if (res.success) {
  123. this.pblmId = res.data.pblmId;
  124. this.gwComFiles = [];
  125. this.pblmStat = res.data.pblmStat;
  126. if (this.$refs.uploadFile.submitUpload(res.data.pblmId)) {
  127. this.removeNewSupervision();
  128. }
  129. }
  130. })
  131. },
  132. // 文件上传
  133. submitUpload() {
  134. this.$refs.upload.submit();
  135. },
  136. updatefilelist(arg) {
  137. request.post('/dc/insp/pblm/update',{
  138. pblmId: this.pblmId,
  139. gwComFiles: arg,
  140. pblmStat: this.pblmStat
  141. }).then(res => {
  142. this.removeNewSupervision()
  143. });
  144. },
  145. removeNewSupervision(arg){
  146. if (arg) {
  147. console.log(arg);
  148. var args = this.gwComFiles.concat(arg);
  149. this.updatefilelist(args);
  150. }
  151. this.$message.success('保存成功')
  152. this.$emit('closeDialog')
  153. this.gwComFiles = [];
  154. this.$refs.uploadFile.init();
  155. }
  156. },
  157. watch:{
  158. pblmsTypeId(newVal,oldVal){
  159. this.smallTypeList.forEach(ele=>{
  160. if(this.pblmsTypeId == ele.guid){
  161. this.problemForm.inspPblmsName = ele.inspPblmsName
  162. }
  163. })
  164. }
  165. }
  166. }
  167. </script>
  168. <style>
  169. .media_item{
  170. float: left;
  171. width: 60px;
  172. font-size: 32px;
  173. }
  174. .el-select-dropdown__wrap.el-scrollbar__wrap {
  175. max-width: 500px !important;
  176. }
  177. </style>