a5862489a4bf51bdb63d1b19a6c2bf4cdd9af85f.svn-base 11 KB

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