0b8946846322b2da99d01d8a8e0bb8c589e9904e.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <template>
  2. <el-form ref="problemForm" :rules="rules" :model="problemForm" label-width="80px">
  3. <el-form-item label="问题类别" style="text-align:left">
  4. <el-select v-model="t1" value-key="items" placeholder="请选择" @change="problemListChange">
  5. <el-option v-for="(item,index) in problemList" :key="index" :label="item.name" :value="item">
  6. </el-option>
  7. </el-select>
  8. </el-form-item>
  9. <el-form-item label="检查项目" style=" text-align:left">
  10. <el-select v-model="t2" placeholder="请选择" value-key="items" @change="currentCheckPointListChange">
  11. <el-option v-for="(item,index) in currentCheckPointList" :key="index" :label="item.name" :value="item">
  12. </el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item label="问题描述" style=" text-align:left">
  16. <el-select v-model="t3" placeholder="请选择" value-key="pblmDesc" @change="currentProblemDescListChange" style="max-width: 500px">
  17. <el-option v-for="(item,index) in currentProblemDescList" :key="index" :label="item.pblmDesc" :value="item" :title="item.pblmDesc" style="max-width: 500px">
  18. </el-option>
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item label="详细描述" required="true">
  22. <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="problemForm.inspPblmDesc" required>
  23. </el-input>
  24. </el-form-item>
  25. <el-form-item label="备注">
  26. <el-input
  27. type="textarea"
  28. :rows="2"
  29. placeholder="请输入内容"
  30. v-model="problemForm.note">
  31. </el-input>
  32. </el-form-item>
  33. <!-- <el-form-item label="详情" style=" text-align:left">-->
  34. <!-- <el-input disabled type="textarea" :rows="2" placeholder="" v-model="xiangqingmiaoshu">-->
  35. <!-- </el-input>-->
  36. <!-- </el-form-item>-->
  37. <!-- <el-form-item label="严重程度:" style="text-align:left" prop="inspPblmCate">-->
  38. <!-- <p v-if="inspPblmCate == 0" >一般</p>-->
  39. <!-- <p v-if="inspPblmCate == 1" >较重</p>-->
  40. <!-- <p v-if="inspPblmCate == 2" >严重</p>-->
  41. <!-- <p v-if="inspPblmCate == 3" >特别严重</p>-->
  42. <!-- </el-form-item>-->
  43. <!-- <el-form-item label="典型问题" label-width="80px" style="text-align:left">-->
  44. <!-- <el-radio v-model="problemForm.ifCasePblm" label="1">是</el-radio>-->
  45. <!-- <el-radio v-model="problemForm.ifCasePblm" label="0">否</el-radio>-->
  46. <!-- </el-form-item>-->
  47. <el-form-item label="上传照片">
  48. <upload ref="uploadFile" :url="`/pdcApi/file/insert?bizId=`" @uploadOver="removeNewSupervision"></upload>
  49. </el-form-item>
  50. <el-form-item style="margin-top: 50px">
  51. <el-button type="primary" @click="onSubmit('problemForm')" style="width: 100px;float:right">保存</el-button>
  52. </el-form-item>
  53. </el-form>
  54. </template>
  55. <script>
  56. import request from '../../../utils/gw_ajax_request.js'
  57. import {
  58. submitUpload,getAqscssjygkProblemList
  59. } from "../../../api/duChaAPI.js";
  60. export default {
  61. props: ['flag','currentUnitId','currentUnitName','objId', 'objName', 'villType', 'objType', 'problemMiddleType', 'problemSmallType', 'engId', 'currentObjectRgstrId','problData','currentGroupId','newModelData'],
  62. data() {
  63. return {
  64. problemForm: {
  65. t1: '',
  66. t2: '',
  67. t3: '',
  68. villType: '',
  69. objId: "",
  70. regid: '',
  71. objType: "",
  72. // inspPblmName: "",
  73. inspPblmCate: "",
  74. inspPblmDesc: "",
  75. ifCasePblm: '0',
  76. pblmStat: "",
  77. dataStat: "",
  78. nm: "",
  79. recPers: "",
  80. note: "",
  81. gwComFiles: [{
  82. id: "",
  83. filePath: "",
  84. bizId: ""
  85. }]
  86. },
  87. inspPblmCate:"",
  88. inspPlamCatelist: ['一般', '较重', '严重','特别严重'],
  89. imgList: [],
  90. videoList: [],
  91. audioList: [],
  92. pblmStat: '',
  93. gwComFiles: [],
  94. problemList: [],
  95. currentCheckPointList: [],
  96. currentProblemDescList: [],
  97. t1: '',
  98. t2: '',
  99. t3: '',
  100. xiangqingmiaoshu: '',
  101. wenTiLeiBie:"",
  102. jianChaXiangMu:"",
  103. rules: {
  104. inspPblmDesc: [{
  105. required: true,
  106. message: '请输入描述',
  107. trigger: 'blur'
  108. },
  109. ],
  110. }
  111. }
  112. },
  113. components: {
  114. upload: resolve => {
  115. require(["../../../widgets/uploadFile.vue"], resolve);
  116. },
  117. },
  118. computed: {
  119. recPers() {
  120. return localStorage.getItem('userid') ? localStorage.getItem('userid') : '';
  121. }
  122. },
  123. created() {
  124. this.getproblemSmallType();
  125. },
  126. methods:{
  127. problemMiddleTypeChange() {
  128. this.middleTypeList.forEach((ele) => {
  129. // if(ele.)
  130. });
  131. },
  132. getproblemSmallType() {
  133. var _self = this;
  134. let result = [];
  135. request.get(`/dc/insp/pblms/getPblmsByQuesNum/${this.problData}/${this.objType}`).then(res=>{
  136. if (res.success) {
  137. this.problemList = res.data;
  138. this.problemList = res.data;
  139. this.t1 = this.problemList[0]
  140. this.currentCheckPointList = this.problemList[0].items
  141. this.t2 = this.currentCheckPointList[0]
  142. this.currentProblemDescList = this.problemList[0].items[0].items
  143. this.t3 = this.currentProblemDescList[0]
  144. // this.problemForm['pblmsTypeId'] = this.currentProblemDescList[0].guid;
  145. }
  146. })
  147. },
  148. getproblemMiddleType() {
  149. this.middleTypeList = [];
  150. request.get('/dc/insp/pblms/getPblmType', {
  151. params: {
  152. type: 79
  153. }
  154. }).then(res => {
  155. if (res.success) {
  156. console.log(res.data);
  157. res.data.forEach((ele) => {
  158. this.middleTypeList.push(ele);
  159. })
  160. }
  161. })
  162. },
  163. getYanZhongChengDu(){
  164. this.inspPblmCate = this.t3.inspPblmCate;
  165. },
  166. onSubmit(problemForm) {
  167. this.$refs[problemForm].validate((valid) => {
  168. if (valid) {
  169. this.problemForm.villType = this.objType;
  170. this.problemForm.recPers = this.recPers
  171. this.problemForm.objId = this.objId;
  172. if(this.flag==0){
  173. this.problemForm.villageCode = this.currentUnitId?this.currentUnitId:this.currentObjectRgstrId;
  174. }
  175. if(this.flag==1){
  176. this.problemForm.cwsCode = this.currentUnitId?this.currentUnitId:this.currentObjectRgstrId;
  177. }
  178. this.problemForm.regid = this.currentUnitId?this.currentUnitId:this.currentObjectRgstrId;
  179. this.problemForm.newVillName = this.currentUnitName?this.currentUnitName:this.objName;
  180. this.problemForm.objType = this.objType;
  181. this.problemForm.pblmStat = "0";
  182. this.problemForm['inspPblmName'] = this.t1.name;//问题类别
  183. this.problemForm['inspPblmsName'] = this.t2.name;//检查项目
  184. this.problemForm['inspPlbmType'] = this.t2.sort;
  185. // this.problemForm['inspPblmName'] = this.t3.pblmDesc;
  186. this.problemForm['inspPblmCode'] = this.t3.sn;
  187. this.problemForm['pblmsTypeId'] = this.t3.guid;
  188. this.problemForm['inspGroupId'] = this.currentGroupId;
  189. this.problemForm.inspPblmCate = this.inspPblmCate;
  190. if (!this.problemForm.inspPblmName) {
  191. this.$message.info('请选择问题类别')
  192. return
  193. }
  194. if (!this.problemForm.inspPblmsName) {
  195. this.$message.info('请选择检查项目')
  196. return
  197. }
  198. if (!this.problemForm.inspPblmName) {
  199. this.$message.info('请选择发现问题')
  200. return
  201. }
  202. if (!this.problemForm.inspPblmDesc) {
  203. this.$message.info('请填写详细描述')
  204. return
  205. }
  206. request.post('/dc/insp/pblm', this.problemForm).then(res => {
  207. if (res.success) {
  208. this.pblmId = res.data.pblmId;
  209. this.gwComFiles = [];
  210. this.pblmStat = res.data.pblmStat;
  211. if (this.$refs.uploadFile.submitUpload(res.data.pblmId)) {
  212. this.removeNewSupervision();
  213. }
  214. }
  215. })
  216. } else {
  217. console.log('error submit!!');
  218. return false;
  219. }
  220. });
  221. },
  222. // onSubmit() {
  223. // this.problemForm.villType = '0';
  224. // this.problemForm.recPers = this.recPers
  225. // this.problemForm.objId = this.objId;
  226. // this.problemForm.regid = this.currentObjectRgstrId;
  227. // this.problemForm.nm = this.objName
  228. // this.problemForm.objType = '1';
  229. // this.problemForm.pblmStat = "0";
  230. // this.problemForm['inspPblmsName'] = this.t1.inspPblmsName;
  231. // this.problemForm['inspPblmName'] = this.t2.checkPointName;
  232. // this.problemForm['inspPlbmType'] = this.t2.sort2;
  233. // this.problemForm['inspPblmName'] = this.t3.pblmDesc;
  234. // this.problemForm['inspPblmCode'] = this.t3.sn;
  235. // this.problemForm['pblmsTypeId'] = this.t3.guid;
  236. // if (!this.problemForm.inspPblmsName) {
  237. // this.$message.info('请选择问题类别')
  238. // return
  239. // }
  240. // if (!this.problemForm.inspPlbmType) {
  241. // this.$message.info('请选择检查项目')
  242. // return
  243. // }
  244. // if (!this.problemForm.inspPblmName) {
  245. // this.$message.info('请选择发现问题')
  246. // return
  247. // }
  248. // request.post('/dc/insp/pblm', this.problemForm).then(res => {
  249. // if (res.success) {
  250. // this.pblmId = res.data.pblmId;
  251. // this.gwComFiles = [];
  252. // this.pblmStat = res.data.pblmStat;
  253. // if (this.$refs.uploadFile.submitUpload(res.data.pblmId)) {
  254. // this.removeNewSupervision();
  255. // }
  256. // }
  257. // })
  258. // },
  259. // 文件上传
  260. submitUpload() {
  261. this.$refs.upload.submit();
  262. },
  263. updatefilelist(arg) {
  264. request.post('/dc/insp/pblm/update', {
  265. pblmId: this.pblmId,
  266. gwComFiles: arg,
  267. pblmStat: this.pblmStat
  268. }).then(res => {
  269. this.removeNewSupervision()
  270. });
  271. },
  272. removeNewSupervision(arg) {
  273. if (arg) {
  274. console.log(arg);
  275. var args = this.gwComFiles.concat(arg);
  276. this.updatefilelist(args);
  277. }
  278. this.$message.success('保存成功')
  279. this.$emit('closeDialog')
  280. this.gwComFiles = [];
  281. this.$refs.uploadFile.init();
  282. },
  283. problemListChange: function (item) {
  284. this.currentCheckPointList = item.items;
  285. },
  286. currentCheckPointListChange: function (item) {
  287. this.currentProblemDescList = item.items;
  288. },
  289. currentProblemDescListChange: function (item) {
  290. console.log(item);
  291. },
  292. },
  293. watch: {
  294. 't1': {
  295. handler: function (val, oldVal) {
  296. // console.log("详情"+val.pblmDesc)
  297. this.wenTiLeiBie = val.name;
  298. this.getYanZhongChengDu()
  299. },
  300. deep: true
  301. },
  302. 't2': {
  303. handler: function (val, oldVal) {
  304. this.jianChaXiangMu = val.name;
  305. this.getYanZhongChengDu()
  306. },
  307. deep: true
  308. },
  309. 't3': {
  310. handler: function (val, oldVal) {
  311. this.xiangqingmiaoshu = val.pblmDesc;
  312. this.getYanZhongChengDu()
  313. },
  314. deep: true
  315. },
  316. },
  317. }
  318. </script>
  319. <style>
  320. .media_item {
  321. float: left;
  322. width: 60px;
  323. font-size: 32px;
  324. }
  325. /*.el-select--mini {*/
  326. /*width: 100%;*/
  327. /*}*/
  328. </style>