8ea05450374858a78f4b2cea950042eb66f3671d.svn-base 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <el-form ref="form" :model="problemForm" label-width="80px">
  3. <el-form-item label="问题类别">
  4. <el-input v-model="problemForm.inspPblmName" :disabled="true"></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"
  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, getRygcPlm } from "../../../api/duChaAPI.js";
  41. export default {
  42. props: [
  43. "objId",
  44. "objName",
  45. "objType",
  46. "villType",
  47. "problemMiddleType",
  48. "problemSmallType",
  49. "cwsCode"
  50. ],
  51. data() {
  52. return {
  53. problemForm: {
  54. objId: "",
  55. objType: "",
  56. villType: "",
  57. villCode: "",
  58. inspPblmName: "",
  59. inspPblmsName: "",
  60. pblmsTypeId: "",
  61. inspPblmCate: "",
  62. inspPblmDesc: "",
  63. pblmStat: "",
  64. dataStat: "",
  65. nm: "",
  66. recPers: "",
  67. note: "",
  68. gwComFiles: [
  69. {
  70. id: "",
  71. filePath: "",
  72. bizId: ""
  73. }
  74. ]
  75. },
  76. pblmsTypeId: "",
  77. smallTypeList: [
  78. // "间断供水问题",
  79. // "净化设施设备问题",
  80. // // "消毒设备",
  81. // "水质报告存在问题",
  82. // "千顿万人水厂水质化验室问题",
  83. // "取水许可证问题",
  84. // "卫生许可证问题",
  85. // "自动化控制系统问题",
  86. // "视频安防视频问题",
  87. // "水费水价问题"
  88. ],
  89. pblmId: "",
  90. imgList: [],
  91. videoList: [],
  92. audioList: [],
  93. pblmStat: "",
  94. gwComFiles: [],
  95. arr1: []
  96. };
  97. },
  98. computed: {
  99. recPers() {
  100. return localStorage.getItem("userid")
  101. ? localStorage.getItem("userid")
  102. : "";
  103. }
  104. },
  105. components: {
  106. upload: resolve => {
  107. require(["../../../widgets/uploadFile.vue"], resolve);
  108. }
  109. },
  110. watch: {
  111. pblmsTypeId(n, o) {
  112. this.smallTypeList.forEach(ele => {
  113. if (this.pblmsTypeId == ele.guid) {
  114. this.problemForm.inspPblmsName = ele.inspPblmsName;
  115. }
  116. });
  117. }
  118. },
  119. mounted() {
  120. this.getType();
  121. this.problemForm.inspPblmsName = this.problemSmallType
  122. ? this.problemSmallType
  123. : this.smallTypeList[0].inspPblmsName;
  124. this.problemForm.inspPblmName = this.problemMiddleType;
  125. },
  126. methods: {
  127. getType() {
  128. request
  129. .get("/dc/insp/pblms/getPblmType", { params: { type: 2 } })
  130. .then(res => {
  131. if (res.success) {
  132. let _this = this
  133. res.data.forEach(ele => {
  134. if (ele.inspPblmsName == "人饮工程" || ele.inspPblmsName == '供水工程' || ele.inspPblmsName == '农饮工程' || ele.inspPblmsName == '饮水工程') {
  135. let pguid = ele.guid;
  136. request
  137. .get("/dc/insp/pblms/getPblmType", {
  138. params: { type: 2, pguid: pguid }
  139. })
  140. .then(res => {
  141. if (res.success) {
  142. this.smallTypeList = res.data;
  143. this.smallTypeList.forEach(ele=>{
  144. if(ele.inspPblmsName.indexOf(_this.problemSmallType) > -1){
  145. _this.pblmsTypeId = ele.guid
  146. }
  147. })
  148. }
  149. });
  150. }
  151. });
  152. }
  153. });
  154. // request
  155. // .get("/dc/insp/pblms/getPblmType", { params: { type: 2,pguid:"10000000000000000000000000000133"} })
  156. // .then(res => {
  157. // if (res.success) {
  158. // this.smallTypeList = res.data;
  159. // }
  160. // });
  161. },
  162. onSubmit() {
  163. this.problemForm.recPers = this.recPers;
  164. this.problemForm.objId = this.objId;
  165. this.problemForm.nm = this.objName;
  166. this.problemForm.objType = this.objType;
  167. this.problemForm.villType = this.villType;
  168. this.problemForm.cwsCode = this.cwsCode;
  169. this.problemForm.pblmsTypeId = this.pblmsTypeId;
  170. this.problemForm.pblmStat = "0";
  171. request.post("/dc/insp/pblm", this.problemForm).then(res => {
  172. if (res.success) {
  173. this.pblmId = res.data.pblmId;
  174. this.gwComFiles = [];
  175. this.pblmStat = res.data.pblmStat;
  176. if (this.$refs.uploadFile.submitUpload(res.data.pblmId)) {
  177. this.removeNewSupervision();
  178. }
  179. }
  180. });
  181. },
  182. // 文件上传
  183. submitUpload() {
  184. this.$refs.upload.submit();
  185. },
  186. updatefilelist(arg) {
  187. request
  188. .post("/dc/insp/pblm/update", {
  189. pblmId: this.pblmId,
  190. gwComFiles: arg,
  191. pblmStat: this.pblmStat
  192. })
  193. .then(res => {
  194. this.removeNewSupervision();
  195. });
  196. },
  197. removeNewSupervision(arg) {
  198. if (arg) {
  199. console.log(arg);
  200. var args = this.gwComFiles.concat(arg);
  201. this.updatefilelist(args);
  202. }
  203. this.$message.success("保存成功");
  204. this.$emit("closeDialog");
  205. this.gwComFiles = [];
  206. this.$refs.uploadFile.init();
  207. }
  208. }
  209. };
  210. </script>
  211. <style>
  212. .media_item {
  213. float: left;
  214. width: 60px;
  215. font-size: 32px;
  216. }
  217. </style>