4bf6b6799ad846984f125eb7dda2596aafb2df2a.svn-base 12 KB

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