e9bb3faf9d87e1c26a602cb4263de893d8c3a373.svn-base 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. <template>
  2. <el-container class="base_info">
  3. <el-main style="padding:0 10px;">
  4. <!-- 类型:{{type}}
  5. 工程ID:{{currentNodeId}} -->
  6. <!-- <h3 class="project_title">前期与设计专业稽察工作底稿</h3> -->
  7. <div class="content_wrapper">
  8. <!-- <h4>基本情况</h4> -->
  9. <el-form ref="form" :model="baseInfo" label-position="top">
  10. <!-- <el-form-item label="项目名称:">
  11. <span>{{projectName}}</span>
  12. </el-form-item> -->
  13. <el-form-item label="基本情况:" >
  14. <Editor id="condition" v-model="baseInfo.itmeDesc" :init="editorInit" :disabled="disabled" v-if="showThisEd"></Editor>
  15. </el-form-item>
  16. <el-form-item label="评价:">
  17. <Editor id="comment" v-model="baseInfo.itmeEval" :init="commentInit" :disabled="disabled" v-if="showThisEd"></Editor>
  18. </el-form-item>
  19. <el-form-item label="稽察组长复核意见:">
  20. <Editor id="suggest" v-model="baseInfo.revOpin" :init="suggestInit" v-if="showThisEd"></Editor>
  21. </el-form-item>
  22. <el-form-item v-if="ownPriv('manage')">
  23. <el-button style="font-size:large;" type="primary" @click="onSubmit">保存</el-button>
  24. <el-button style="font-size:large;">取消</el-button>
  25. </el-form-item>
  26. <el-form-item label="查阅的资料目录:">
  27. <p class="add_file_btn" @click="toAddFile" v-if="ownPriv('manage')">+ 添加资料</p>
  28. <p class="add_file_btn" @click="showPlDialog" v-if="ownPriv('manage')">+ 批量添加</p>
  29. <ZiLiaoTianBaoPl v-if="showTianBaoPl"
  30. :listId="baseInfo.id"
  31. @closePlDialog="closePlDialog"
  32. >
  33. </ZiLiaoTianBaoPl>
  34. <el-table class="insTale"
  35. :data="tableData"
  36. border
  37. style="width: 100%">
  38. <el-table-column
  39. prop="catalogName"
  40. label="资料名称"
  41. >
  42. </el-table-column>
  43. <el-table-column
  44. prop="estUnit"
  45. label="编制单位"
  46. >
  47. </el-table-column>
  48. <el-table-column
  49. prop="estTm"
  50. label="编制时间"
  51. width="200">
  52. </el-table-column>
  53. <el-table-column
  54. fixed="right"
  55. label="操作"
  56. width="130"
  57. v-if="ownPriv('manage')"
  58. >
  59. <template slot-scope="scope">
  60. <el-button @click="toEditFile(scope.row)" type="text" size="small">编辑</el-button>
  61. <el-button @click="deleteFile(scope.row)" type="text" size="small">删除</el-button>
  62. </template>
  63. </el-table-column>
  64. </el-table>
  65. <el-pagination :pager-count="5" :current-page="pageIndex" background
  66. :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"
  67. :page-sizes="[10, 20, 50, 100]"
  68. @current-change="pageIndexChange" @size-change="handleSizeChange"
  69. ></el-pagination>
  70. </el-form-item>
  71. </el-form>
  72. </div>
  73. <add-file-com v-if="addFileVisiual" :listId="baseInfo.id" @dialogClose="dialogClose"></add-file-com>
  74. <file-modify-com v-if="modifyFileVisiual" :fileId="fileId" @dialogClose="dialogClose"></file-modify-com>
  75. </el-main>
  76. </el-container>
  77. </template>
  78. <script>
  79. import request from '@util/gw_ajax_request.js'
  80. import {getBaseInfoApi,submitBaseInfoApi,getFileListApi,deleteFileApi} from '@api/InspectionReport.js'
  81. import addFileCom from './dialogCom/addFileCom.vue'
  82. import fileModifyCom from './dialogCom/fileModifyCom.vue'
  83. import tinymce from 'tinymce/tinymce'
  84. import 'tinymce/themes/silver/theme'
  85. import Editor from '@tinymce/tinymce-vue'
  86. import 'tinymce/plugins/image'
  87. import 'tinymce/plugins/link'
  88. import 'tinymce/plugins/code'
  89. import 'tinymce/plugins/table'
  90. import 'tinymce/plugins/lists'
  91. import 'tinymce/plugins/contextmenu'
  92. import 'tinymce/plugins/wordcount'
  93. import 'tinymce/plugins/colorpicker'
  94. import 'tinymce/plugins/textcolor'
  95. import ZiLiaoTianBaoPl from '../duChaDuiXiang/reportTb/ziliao_tianbao_piliang.vue'
  96. export default {
  97. props:['currentNodeId','type','projectName','pertype','backStatus'],
  98. data() {
  99. return {
  100. baseInfo:{
  101. itmeDesc:'',
  102. itmeEval: '',
  103. revOpin: '',
  104. persId: '',
  105. type: '',
  106. rgstrId: ''
  107. },
  108. editType: '', //是添加还是修改
  109. tableData: [],
  110. editorInit: {
  111. selector: 'condition',
  112. language_url: '/static/tinymce/zh_CN.js',
  113. language: 'zh_CN',
  114. skin_url: '/static/tinymce/skins/ui/oxide',
  115. plugins: 'wordcount',
  116. height: window.innerHeight - 250,
  117. toolbar:
  118. 'bold italic underline strikethrough fontselect fontsizeselect forecolor backcolor | removeformat',
  119. branding: false
  120. },
  121. commentInit: {
  122. selector: 'comment',
  123. language_url: '/static/tinymce/zh_CN.js',
  124. language: 'zh_CN',
  125. skin_url: '/static/tinymce/skins/ui/oxide',
  126. plugins: 'wordcount',
  127. height: window.innerHeight - 250,
  128. toolbar:
  129. 'bold italic underline strikethrough fontselect fontsizeselect forecolor backcolor | removeformat',
  130. branding: false
  131. },
  132. suggestInit: {
  133. selector: 'suggest',
  134. language_url: '/static/tinymce/zh_CN.js',
  135. language: 'zh_CN',
  136. skin_url: '/static/tinymce/skins/ui/oxide',
  137. plugins: 'wordcount',
  138. height: 300,
  139. toolbar:
  140. 'bold italic underline strikethrough fontselect fontsizeselect forecolor backcolor | removeformat',
  141. branding: false
  142. },
  143. disabled: false,
  144. showThisEd: true,
  145. fileId: '', //资料id
  146. addFileVisiual: false,
  147. modifyFileVisiual: false,
  148. pageIndex: 1,
  149. pageSize: 10,
  150. total: 0,
  151. showTianBaoPl: false,
  152. }
  153. },
  154. computed: {
  155. persId() {
  156. return localStorage.getItem("userid") ? localStorage.getItem("userid") : "1098101939614724096";
  157. },
  158. },
  159. components:{
  160. addFileCom,
  161. fileModifyCom,
  162. Editor,
  163. ZiLiaoTianBaoPl
  164. },
  165. mounted(){
  166. this.getBaseInfo()
  167. //富文本初始化
  168. tinymce.init({})
  169. if(this.pertype == 20){
  170. this.disabled = true
  171. }
  172. },
  173. activated(){
  174. tinymce.init({})
  175. this.showThisEd = true
  176. },
  177. deactivated(){
  178. this.showThisEd = false
  179. },
  180. methods:{
  181. //获取单表基本信息
  182. getBaseInfo(){
  183. getBaseInfoApi(this.type,this.currentNodeId).then(res=>{
  184. if(res.data && Object.keys(res.data).length){
  185. this.editType = '修改'
  186. this.baseInfo = res.data
  187. this.getFileList()
  188. }else{
  189. this.editType = '添加'
  190. this.baseInfo.persId = this.persId
  191. this.baseInfo.type = this.type
  192. this.baseInfo.rgstrId = this.currentNodeId
  193. this.baseInfo.itmeDesc = ''
  194. this.baseInfo.itmeEval = ''
  195. this.baseInfo.revOpin = ''
  196. if(this.baseInfo.id) delete this.baseInfo.id
  197. this.getFileList();
  198. }
  199. }).catch(err=>{
  200. this.$message.error(err)
  201. })
  202. },
  203. //保存填写的基本信息
  204. onSubmit(){
  205. if(this.baseInfo.revOpin && this.baseInfo.revOpin.length>500){
  206. this.$message.error('稽察组长复核意见过长');
  207. return ;
  208. }
  209. submitBaseInfoApi(this.baseInfo).then(res=>{
  210. if(res.success){
  211. this.$message.success(`${this.editType}成功`)
  212. this.getBaseInfo()
  213. }
  214. }).catch(err=>{
  215. this.$message.error(err)
  216. })
  217. },
  218. //展示添加资料弹窗
  219. toAddFile(){
  220. if(!this.baseInfo.id){
  221. this.$message.warning('请先填写基本情况并保存')
  222. return
  223. }
  224. this.addFileVisiual = true
  225. },
  226. //展示修改资料弹窗
  227. toEditFile(row){
  228. this.fileId = row.id
  229. this.modifyFileVisiual = true
  230. },
  231. //获取查阅的资料目录
  232. getFileList(){
  233. if(!this.baseInfo.id){
  234. this.tableData = []
  235. return
  236. }
  237. let paramsObj = {
  238. listId: this.baseInfo.id,
  239. persId: this.persId,
  240. pageNum: this.pageIndex,
  241. pageSize: this.pageSize
  242. }
  243. getFileListApi(paramsObj).then(res=>{
  244. if(res.success){
  245. this.tableData = res.data.list
  246. this.total = res.data.total
  247. }
  248. }).catch(err=>{
  249. this.$message.error(err)
  250. })
  251. },
  252. deleteFile(row){
  253. this.$confirm('确认删除该问题吗?', '提示', {
  254. confirmButtonText: '确定',
  255. cancelButtonText: '取消',
  256. type: 'warning'
  257. }).then(() => {
  258. deleteFileApi(row.id).then(res=>{
  259. if(res.success){
  260. this.$message({
  261. type: 'success',
  262. message: '删除成功!'
  263. });
  264. this.getFileList()
  265. }else{
  266. this.$message({
  267. type: 'error',
  268. message: res.message
  269. });
  270. }
  271. })
  272. })
  273. },
  274. dialogClose(){
  275. this.getFileList()
  276. this.addFileVisiual = false
  277. this.modifyFileVisiual = false
  278. },
  279. pageIndexChange(val) {
  280. this.pageIndex = val;
  281. this.getFileList();
  282. },
  283. handleSizeChange(val) {
  284. this.pageSize = val;
  285. this.getFileList();
  286. },
  287. showPlDialog() {
  288. if(!this.baseInfo.id){
  289. this.$message.warning('请先填写基本情况并保存')
  290. return
  291. }
  292. this.showTianBaoPl = true;
  293. },
  294. closePlDialog(val) {
  295. this.getFileList();
  296. this.showTianBaoPl = false;
  297. }
  298. },
  299. watch:{
  300. currentNodeId(){
  301. this.getBaseInfo()
  302. },
  303. type(){
  304. this.getBaseInfo()
  305. },
  306. pertype(val){
  307. if(val == 20){
  308. this.disabled = true
  309. }
  310. },
  311. backStatus(val){
  312. if(val){
  313. this.getBaseInfo()
  314. }
  315. }
  316. }
  317. }
  318. </script>
  319. <style lang="scss">
  320. .base_info{
  321. .project_title{
  322. line-height: 50px;
  323. text-align: center;
  324. color: #333;
  325. border-bottom: solid 1px #eee;
  326. }
  327. .content_wrapper{
  328. height: calc(100vh - 190px;);
  329. overflow-y: auto;
  330. }
  331. h4{
  332. line-height: 50px;
  333. color: #444;
  334. }
  335. .add_file_btn{
  336. line-height: 30px;
  337. text-align: center;
  338. color: #666;
  339. border: dashed 1px #ddd;
  340. border-radius: 5px;
  341. margin-bottom: 10px;
  342. cursor: pointer;
  343. font-size: large;
  344. }
  345. .el-form-item__label{
  346. font-size: large;
  347. }
  348. .insTale{
  349. .el-table th.gutter{
  350. display: table-cell!important;
  351. }
  352. /*滚动条样式*/
  353. ::-webkit-scrollbar {
  354. width: 8px;
  355. height: 8px;
  356. }
  357. /*正常情况下滑块的样式*/
  358. ::-webkit-scrollbar-thumb {
  359. background-color: #cdcdcd;
  360. border-radius: 10px;
  361. -webkit-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, .1);
  362. }
  363. /*鼠标悬浮在滑块上时滑块的样式*/
  364. ::-webkit-scrollbar-thumb:hover {
  365. background-color: rgba(0, 0, 0, .4);
  366. -webkit-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, .1);
  367. }
  368. /*正常时候的主干部分*/
  369. ::-webkit-scrollbar-track {
  370. border-radius: 10px;
  371. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
  372. background-color: white;
  373. }
  374. /*鼠标悬浮在滚动条上的主干部分*/
  375. ::-webkit-scrollbar-track:hover {
  376. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .4);
  377. background-color: rgba(0, 0, 0, .01);
  378. }
  379. /*el-table thead默认样式更改*/
  380. .el-table__header th,.el-table__header tr{
  381. background: rgba(235,243,251,1)!important;
  382. box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1), -1px 0 0 0 rgba(0, 0, 0, 0.1), 0 1px 0 0 rgba(0, 0, 0, 0.1) !important;
  383. font-size: large !important;
  384. font-family: MicrosoftYaHei;
  385. font-weight: 400 !important;
  386. color: rgba(51,51,51,1);
  387. }
  388. tr.el-table__row {
  389. font-size:large;
  390. font-family:MicrosoftYaHei;
  391. font-weight:400;
  392. color:rgba(51,51,51,1);
  393. }
  394. }
  395. }
  396. </style>