9bec9e0d8516ab98e6197faa3d231d8ce7a0a784.svn-base 6.6 KB

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