b0498f79945f19a59dac5109a3ef34ea4dbe78af.svn-base 11 KB

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