2f88c8d57f7ea694ff54155d16efa7fac8f30c8c.svn-base 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <el-form ref="form" :model="problemForm" label-width="80px" class="ysh_dialog">
  3. <el-form-item label="问题类别" style=" text-align:left">
  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'],
  43. data(){
  44. return{
  45. problemForm:{
  46. objId: "",
  47. objType: "",
  48. villType: "",
  49. villCode: "",
  50. inspPblmName: "",
  51. inspPblmsName: "",
  52. pblmsTypeId: "",
  53. inspPblmCate: "",
  54. inspPblmDesc: "",
  55. pblmStat: "",
  56. dataStat: "",
  57. nm: "",
  58. recPers: "",
  59. note: "",
  60. ifCasePblm:"0",
  61. gwComFiles: [{
  62. id: "",
  63. filePath: "",
  64. bizId: ""
  65. }]
  66. },
  67. pblmsTypeId: '',
  68. smallTypeList: [{
  69. guid:'1',
  70. inspPblmsName:'三项制度问题',
  71. }],
  72. pblmId: '',
  73. imgList: [],
  74. videoList:[],
  75. audioList: [],
  76. pblmStat: '',
  77. gwComFiles: []
  78. }
  79. },
  80. computed:{
  81. recPers(){
  82. return localStorage.getItem('userid') ? localStorage.getItem('userid') : '';
  83. }
  84. },
  85. components: {
  86. upload: resolve => {
  87. require(["../../../widgets/uploadFile.vue"], resolve);
  88. },
  89. },
  90. mounted(){
  91. // this.getType()
  92. this.problemForm.inspPblmsName = this.problemSmallType
  93. this.problemForm.inspPblmName = this.problemMiddleType
  94. },
  95. methods:{
  96. getType(){
  97. request.get('/dc/insp/pblms/getPblmType',{params:{type:2}}).then(res=>{
  98. if(res.success){
  99. let _this = this
  100. res.data.forEach((ele)=>{
  101. if(ele.inspPblmsName == '行政村'){
  102. let pguid = ele.guid
  103. request.get('/dc/insp/pblms/getPblmType',{params:{'type':2,'pguid':pguid}}).then(res=>{
  104. if(res.success){
  105. this.smallTypeList = res.data
  106. this.smallTypeList.forEach(ele=>{
  107. if(ele.inspPblmsName.indexOf(_this.problemSmallType) > -1){
  108. _this.pblmsTypeId = ele.guid
  109. }
  110. })
  111. }
  112. })
  113. }
  114. })
  115. }
  116. })
  117. },
  118. onSubmit(){
  119. this.problemForm.recPers = this.recPers
  120. this.problemForm.objId = this.objId
  121. this.problemForm.nm = this.objName
  122. this.problemForm.objType = this.objType
  123. this.problemForm.villType = this.villType
  124. this.problemForm.villCode = this.villCode
  125. this.problemForm.pblmsTypeId = this.pblmsTypeId
  126. this.problemForm.pblmStat = "0";
  127. request.post('/dc/insp/pblm',this.problemForm).then(res=>{
  128. if (res.success) {
  129. this.pblmId = res.data.pblmId;
  130. this.gwComFiles = [];
  131. this.pblmStat = res.data.pblmStat;
  132. if (this.$refs.uploadFile.submitUpload(res.data.pblmId)) {
  133. this.removeNewSupervision();
  134. }
  135. }
  136. })
  137. },
  138. // 文件上传
  139. submitUpload() {
  140. this.$refs.upload.submit();
  141. },
  142. updatefilelist(arg) {
  143. request.post('/dc/insp/pblm/update',{
  144. pblmId: this.pblmId,
  145. gwComFiles: arg,
  146. pblmStat: this.pblmStat
  147. }).then(res => {
  148. this.removeNewSupervision()
  149. });
  150. },
  151. removeNewSupervision(arg){
  152. if (arg) {
  153. console.log(arg);
  154. var args = this.gwComFiles.concat(arg);
  155. this.updatefilelist(args);
  156. }
  157. this.$message.success('保存成功')
  158. this.$emit('closeDialog')
  159. this.gwComFiles = [];
  160. this.$refs.uploadFile.init();
  161. }
  162. },
  163. watch:{
  164. pblmsTypeId(newVal,oldVal){
  165. this.smallTypeList.forEach(ele=>{
  166. if(this.pblmsTypeId == ele.guid){
  167. this.problemForm.inspPblmsName = ele.inspPblmsName
  168. }
  169. })
  170. }
  171. }
  172. }
  173. </script>
  174. <style>
  175. .media_item{
  176. float: left;
  177. width: 60px;
  178. font-size: 32px;
  179. }
  180. </style>