ad5c185e0f53a42fed3b006e4c163037e3bc3d63.svn-base 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <el-form ref="form" :model="problemForm" label-width="80px" class="ysh_dialog">
  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. :value="item.guid"
  22. :title="item.inspPblmsName"
  23. style="max-width: 500px">
  24. </el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item label="问题描述">
  28. <el-input type="textarea" v-model="problemForm.inspPblmDesc"></el-input>
  29. </el-form-item>
  30. <el-form-item label="相关文件">
  31. <upload ref="uploadFile" :url="`/pdcApi/file/insert?bizId=`" @uploadOver="removeNewSupervision"></upload>
  32. </el-form-item>
  33. <el-form-item style="margin-top: 50px">
  34. <el-button type="primary" @click="onSubmit" style="width: 100px;float:right">保存</el-button>
  35. </el-form-item>
  36. </el-form>
  37. </template>
  38. <script>
  39. import request from '../../../utils/gw_ajax_request.js'
  40. import { submitUpload } from "../../../api/duChaAPI.js";
  41. export default {
  42. props: ['objId','objName','objType','villType','villCode','problemMiddleType','problemSmallType','prsnWaterId'],
  43. data(){
  44. return{
  45. problemForm:{
  46. objId: "",
  47. objType: "",
  48. villType: "",
  49. villageCode: "",
  50. inspPblmName: "",
  51. inspPblmsName: "",
  52. ifCasePblm:"",
  53. pblmsTypeId: "",
  54. inspPblmCate: "",
  55. inspPblmDesc: "",
  56. pblmStat: "",
  57. dataStat: "",
  58. nm: "",
  59. recPers: "",
  60. note: "",
  61. waterUserId: "",
  62. gwComFiles: [{
  63. id: "",
  64. filePath: "",
  65. bizId: ""
  66. }]
  67. },
  68. pblmsTypeId: '',
  69. smallTypeList: [],
  70. pblmId: '',
  71. imgList: [],
  72. videoList:[],
  73. audioList: [],
  74. pblmStat: '',
  75. gwComFiles: []
  76. }
  77. },
  78. computed:{
  79. recPers(){
  80. return localStorage.getItem('userid') ? localStorage.getItem('userid') : '';
  81. }
  82. },
  83. components: {
  84. upload: resolve => {
  85. require(["../../../widgets/uploadFile.vue"], resolve);
  86. },
  87. },
  88. mounted(){
  89. this.getType()
  90. this.problemForm.inspPblmsName = this.problemSmallType ? this.problemSmallType : this.smallTypeList[0].inspPblmsName
  91. this.problemForm.inspPblmName = this.problemMiddleType
  92. },
  93. methods:{
  94. getType(){
  95. request.get('/dc/insp/pblms/getPblmType',{params:{type:2}}).then(res=>{
  96. if(res.success){
  97. let _this = this
  98. res.data.forEach((ele)=>{
  99. if(ele.inspPblmsName == '行政村'){
  100. let pguid = ele.guid
  101. request.get('/dc/insp/pblms/getPblmType',{params:{'type':2,'pguid':pguid}}).then(res=>{
  102. if(res.success){
  103. this.smallTypeList = res.data
  104. this.smallTypeList.forEach(ele=>{
  105. if(ele.inspPblmsName.indexOf(_this.problemSmallType) > -1){
  106. _this.pblmsTypeId = ele.guid
  107. }
  108. })
  109. }
  110. })
  111. }
  112. })
  113. }
  114. })
  115. },
  116. onSubmit(){
  117. this.problemForm.recPers = this.recPers
  118. this.problemForm.objId = this.objId
  119. this.problemForm.nm = this.objName
  120. this.problemForm.objType = this.objType
  121. this.problemForm.villType = this.villType
  122. this.problemForm.villageCode = this.villCode
  123. this.problemForm.pblmsTypeId = this.pblmsTypeId
  124. this.problemForm.pblmStat = "0";
  125. this.problemForm.waterUserId = this.prsnWaterId
  126. request.post('/dc/insp/pblm',this.problemForm).then(res=>{
  127. if (res.success) {
  128. this.pblmId = res.data.pblmId;
  129. this.gwComFiles = [];
  130. this.pblmStat = res.data.pblmStat;
  131. if (this.$refs.uploadFile.submitUpload(res.data.pblmId)) {
  132. this.removeNewSupervision();
  133. }
  134. }
  135. })
  136. },
  137. // 文件上传
  138. submitUpload() {
  139. this.$refs.upload.submit();
  140. },
  141. updatefilelist(arg) {
  142. request.post('/dc/insp/pblm/update',{
  143. pblmId: this.pblmId,
  144. gwComFiles: arg,
  145. pblmStat: this.pblmStat
  146. }).then(res => {
  147. this.removeNewSupervision()
  148. });
  149. },
  150. removeNewSupervision(arg){
  151. if (arg) {
  152. console.log(arg);
  153. var args = this.gwComFiles.concat(arg);
  154. this.updatefilelist(args);
  155. }
  156. this.$message.success('保存成功')
  157. this.$emit('closeDialog')
  158. this.gwComFiles = [];
  159. this.$refs.uploadFile.init();
  160. }
  161. },
  162. watch:{
  163. pblmsTypeId(newVal,oldVal){
  164. this.smallTypeList.forEach(ele=>{
  165. if(this.pblmsTypeId == ele.guid){
  166. this.problemForm.inspPblmsName = ele.inspPblmsName
  167. }
  168. })
  169. }
  170. }
  171. }
  172. </script>
  173. <style>
  174. .media_item{
  175. float: left;
  176. width: 60px;
  177. font-size: 32px;
  178. }
  179. </style>