ba61eeeb871433a78a5c7e13b63541b17378bef4.svn-base 11 KB

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