d2e2aed848341f60c7b7f04cfa70ab44766dd15a.svn-base 10 KB

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