baa936768d378e400106e1e54b926d9db1f88805.svn-base 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <template>
  2. <div>
  3. <el-form ref="problemForm" :rules="rules" :model="problemForm" label-width="80px">
  4. <el-form-item>
  5. <el-button type="text" @click="selectPblm" style="float: left;">选择问题</el-button>
  6. </el-form-item>
  7. <el-form-item label="问题类别" style="text-align:left">
  8. <el-select v-model="t1" value-key="inspPblmsName" placeholder="请选择" disabled>
  9. <el-option v-for="(item,index) in problemList" :key="index" :label="item.inspPblmsName" :value="item">
  10. </el-option>
  11. </el-select>
  12. </el-form-item>
  13. <el-form-item label="检查项目" style="text-align:left">
  14. <el-select v-model="t2" placeholder="请选择" value-key="checkPointName" disabled>
  15. <el-option v-for="(item,index) in currentCheckPointList" :key="index" :label="item.checkPointName" :value="item">
  16. </el-option>
  17. </el-select>
  18. </el-form-item>
  19. <el-form-item label="问题描述" style="text-align:left">
  20. <el-input v-model="t3" type="textarea" :rows="4" placeholder="" disabled></el-input>
  21. </el-form-item>
  22. <el-form-item label="详情" style="text-align:left">
  23. <span>{{t3}}</span>
  24. </el-form-item>
  25. <el-form-item label="详细描述">
  26. <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="problemForm.inspPblmDesc" required>
  27. </el-input>
  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. <el-dialog
  45. class="pblmEascader"
  46. title="选择问题"
  47. width="60%"
  48. append-to-body
  49. :visible.sync="pblmEascaderVisible">
  50. <pblmEascader :objType="objType" @modelData="modelData" :vmodelData="newPblmValue" :t3="t3" v-if="pblmEascaderVisible"></pblmEascader>
  51. <span slot="footer">
  52. <el-button @click="pblmEascaderVisible=false">返 回</el-button>
  53. <el-button type="primary" @click="submitEascader">确 定</el-button>
  54. </span>
  55. </el-dialog>
  56. </div>
  57. </template>
  58. <script>
  59. import request from '../../../utils/gw_ajax_request.js'
  60. import pblmEascader from '../../duChaTianBao/project/pblmEascader'
  61. import {
  62. submitUpload
  63. } from "../../../api/duChaAPI.js";
  64. export default {
  65. props: ['objId', 'objName', 'villType', 'objType', 'problemMiddleType', 'problemSmallType', 'engId', 'currentObjectRgstrId','newModelData'],
  66. data() {
  67. return {
  68. problemForm: {
  69. t1: '',
  70. t2: '',
  71. t3: '',
  72. villType: '',
  73. objId: "",
  74. regid: '',
  75. objType: "",
  76. inspPblmCate: "",
  77. inspPblmDesc: "",
  78. ifCasePblm: '0',
  79. pblmStat: "",
  80. dataStat: "",
  81. nm: "",
  82. recPers: "",
  83. note: "",
  84. gwComFiles: [{
  85. id: "",
  86. filePath: "",
  87. bizId: ""
  88. }]
  89. },
  90. inspPblmCate:"",
  91. inspPlamCatelist: ['一般', '较重', '严重'],
  92. imgList: [],
  93. videoList: [],
  94. audioList: [],
  95. pblmStat: '',
  96. gwComFiles: [],
  97. problemList: [],
  98. currentCheckPointList: [],
  99. currentProblemDescList: [],
  100. t1: '',
  101. t2: '',
  102. t3: '',
  103. xiangqingmiaoshu: '',
  104. wenTiLeiBie:"",
  105. jianChaXiangMu:"",
  106. rules: {
  107. inspPblmDesc: [{
  108. required: true,
  109. message: '请输入描述',
  110. trigger: 'blur'
  111. },
  112. ],
  113. },
  114. pblmEascaderVisible: false,
  115. newPblmValue: []
  116. }
  117. },
  118. components: {
  119. upload: resolve => {
  120. require(["../../../widgets/uploadFile.vue"], resolve);
  121. },
  122. pblmEascader
  123. },
  124. computed: {
  125. recPers() {
  126. return localStorage.getItem('userid') ? localStorage.getItem('userid') : '';
  127. }
  128. },
  129. mounted() {
  130. this.newPblmValue = this.newModelData;
  131. if(this.newPblmValue){
  132. this.t1 = this.newPblmValue.model[0];
  133. this.t2 = this.newPblmValue.model[1];
  134. this.t3 = this.newPblmValue.label;
  135. this.getYanZhongChengDu();
  136. }
  137. },
  138. methods:{
  139. getYanZhongChengDu(){
  140. request.post('/dc/insp/pblms/getByPblms', {
  141. inspPblmsName:this.t1,
  142. checkPoint:this.t2,
  143. pblmDesc:this.t3,
  144. type: this.objType
  145. }).then(res => {
  146. if (res.success) {
  147. console.log("验证"+res);
  148. this.inspPblmCate=res.data.inspPblmCate;
  149. }
  150. })
  151. },
  152. onSubmit(problemForm) {
  153. this.$refs[problemForm].validate((valid) => {
  154. if (valid) {
  155. this.problemForm.villType = '0';
  156. this.problemForm.recPers = this.recPers
  157. this.problemForm.objId = this.objId;
  158. this.problemForm.regid = this.currentObjectRgstrId;
  159. this.problemForm.nm = this.objName
  160. this.problemForm.objType = this.objType;
  161. this.problemForm.pblmStat = "0";
  162. this.problemForm['inspPblmName'] = this.t1;
  163. this.problemForm['inspPblmDesc'] = this.problemForm.inspPblmDesc;
  164. this.problemForm['inspPlbmType'] = this.t2;
  165. // this.problemForm['inspPblmName'] = this.t3.pblmDesc;
  166. this.problemForm['inspPblmCode'] = this.t3;
  167. this.problemForm['pblmsTypeId'] = this.newPblmValue.model[2];
  168. this.problemForm.inspPblmCate = this.inspPblmCate;
  169. if (!this.problemForm.inspPblmName) {
  170. this.$message.info('问题类别不能为空')
  171. return
  172. }
  173. if (!this.problemForm.inspPlbmType) {
  174. this.$message.info('检查项目不能为空')
  175. return
  176. }
  177. if (!this.problemForm.inspPblmCode) {
  178. this.$message.info('问题描述不能为空')
  179. return
  180. }
  181. request.post('/dc/insp/pblm', this.problemForm).then(res => {
  182. if (res.success) {
  183. this.pblmId = res.data.pblmId;
  184. this.gwComFiles = [];
  185. this.pblmStat = res.data.pblmStat;
  186. if (this.$refs.uploadFile.getFileLength()) {
  187. this.$refs.uploadFile.submitUpload(res.data.pblmId)
  188. }else{
  189. setTimeout(()=>{
  190. this.$message.success('保存成功')
  191. this.$emit('closeDialog')
  192. },1000)
  193. }
  194. }
  195. })
  196. } else {
  197. console.log('error submit!!');
  198. return false;
  199. }
  200. });
  201. },
  202. // 文件上传
  203. submitUpload() {
  204. this.$refs.upload.submit();
  205. },
  206. updatefilelist(arg) {
  207. request.post('/dc/insp/pblm/update', {
  208. pblmId: this.pblmId,
  209. gwComFiles: arg,
  210. pblmStat: this.pblmStat
  211. }).then(res => {
  212. this.removeNewSupervision()
  213. });
  214. },
  215. removeNewSupervision(arg) {
  216. if (arg) {
  217. console.log(arg);
  218. var args = this.gwComFiles.concat(arg);
  219. this.updatefilelist(args);
  220. }
  221. this.gwComFiles = [];
  222. this.$refs.uploadFile.init();
  223. this.$message.success('保存成功')
  224. this.$emit('closeDialog')
  225. },
  226. problemListChange: function (item) {
  227. this.currentCheckPointList = item.checkPoints;
  228. },
  229. currentCheckPointListChange: function (item) {
  230. this.currentProblemDescList = item.pblmDescs;
  231. },
  232. // currentProblemDescListChange: function (item) {
  233. // console.log(item);
  234. // },
  235. modelData(val){
  236. this.newPblmValue = val;
  237. this.t1 = this.newPblmValue.model[0];
  238. this.t2 = this.newPblmValue.model[1];
  239. this.t3 = this.newPblmValue.label;
  240. this.getYanZhongChengDu();
  241. },
  242. selectPblm(){
  243. this.pblmEascaderVisible = true;
  244. },
  245. submitEascader(){
  246. if(!this.newPblmValue.model.length){
  247. this.$message.warning('问题不能为空');
  248. return;
  249. }
  250. this.pblmEascaderVisible = false;
  251. }
  252. },
  253. watch: {
  254. },
  255. }
  256. </script>
  257. <style>
  258. .media_item {
  259. float: left;
  260. width: 60px;
  261. font-size: 32px;
  262. }
  263. /*.el-select--mini {*/
  264. /*width: 100%;*/
  265. /*}*/
  266. .pblmEascader .el-dialog__body {
  267. height: 15vh;
  268. overflow: auto;
  269. }
  270. </style>