02af9e38d40e7a2e40af15c569dfd9895e368143.svn-base 12 KB

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