199860eb85e7bb0ec0c57faefe166e263ccfd2ab.svn-base 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <template>
  2. <el-container>
  3. <el-main style="position: relative">
  4. <el-tabs v-model="activeName" @tab-click="handleClick" class="tabs_wrapper">
  5. <el-tab-pane v-for="(item,index) in tabList" :key="index" :label="item.label" :name="item.type" :lazy="true">
  6. <el-form :inline="true" size="mini" label-width="84px" class="demo-form-inline report_filter_select">
  7. <el-form-item label="选择年度">
  8. <el-select v-model="addForm.year" @change="changeYear" style="width: 120px;">
  9. <el-option :label="item.pnm" :value="item.pnm" :key="index" v-for="(item,index) in yearList"></el-option>
  10. </el-select>
  11. </el-form-item>
  12. <el-form-item label="选择批次">
  13. <el-select v-model="addForm.batch" @change="changeBatch" style="width: 120px;">
  14. <el-option :label="item.pnm" :value="item.pnm" :key="index" v-for="(item,index) in pcList"></el-option>
  15. </el-select>
  16. </el-form-item>
  17. <el-form-item label="督查组">
  18. <el-select v-model="addForm.group" @change="changeGroup" style="width: 120px;">
  19. <el-option :label="item.pnm" :value="item.id" :key="index" v-for="(item,index) in groupList"></el-option>
  20. </el-select>
  21. </el-form-item>
  22. <el-form-item label="区/县">
  23. <el-select v-model="addForm.area" @change="changeArea" clearable style="width: 120px;">
  24. <el-option :label="item.pnm" :value="item.adCode" :key="index" v-for="(item,index) in areaList"></el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item label="项目名称">
  28. <el-select v-model="addForm.rgstrId" @change="changeProject" clearable placeholder="请选择" style="width: 120px;">
  29. <el-option
  30. v-for="item in projectList"
  31. :key="item.id"
  32. :label="item.pnm"
  33. :value="item.id">
  34. </el-option>
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item label="专业">
  38. <el-select v-model="addForm.pblmChType" placeholder="请选择" clearable style="width: 120px;">
  39. <el-option
  40. v-for="item in professionList"
  41. :key="item.value"
  42. :label="item.label"
  43. :value="item.value">
  44. </el-option>
  45. </el-select>
  46. </el-form-item>
  47. </el-form>
  48. <component :is="item.value" :currentNodeId="addForm.rgstrId" :objId="objId" :type="addForm.pblmChType" :groupId="addForm.group" :areaId="addForm.area" :flag="flag" :backStatus="backStatus" :isEdit="editable" @sendSubmitStatus="sendSubmitStatus"></component>
  49. </el-tab-pane>
  50. </el-tabs>
  51. <div class="report_btn_group">
  52. <!-- <el-button type="success">生成阶段稿</el-button> -->
  53. <el-button v-if="flag == '4' && editable" type="warning" @click="backProfession">驳回</el-button>
  54. <el-button v-if="flag != '7' && editable" type="success" @click="stageSubmit">{{curStage}}</el-button>
  55. <el-button v-if="flag == '4'" type="primary" @click="showDailyRecord">日志</el-button>
  56. </div>
  57. <el-dialog
  58. title="操作日志"
  59. :visible.sync="dailyRecordVisible"
  60. width="80%">
  61. <daily-record :rgstrId="addForm.rgstrId" :professionType="addForm.pblmChType"></daily-record>
  62. </el-dialog>
  63. </el-main>
  64. </el-container>
  65. </template>
  66. <script>
  67. import changeAdvice from './resultDiscuss'
  68. import resultDiscuss from './resultDiscuss'
  69. import centerModify from './resultDiscuss'
  70. import bureauModify from './resultDiscuss'
  71. import dailyRecord from '../dialogCom/dailyRecord';
  72. import request from "@util/gw_ajax_request"
  73. import {backProfessionApi} from "@api/InspectionReport.js";
  74. export default {
  75. data(){
  76. return{
  77. activeName: '4',
  78. tabList:[
  79. {label: '交换意见阶段',value: 'changeAdvice',type: '4'},
  80. {label: '成果讨论阶段',value: 'resultDiscuss',type: '5'},
  81. {label: '中心修改阶段',value: 'centerModify',type: '6'},
  82. {label: '司局修改阶段',value: 'bureauModify',type: '7'}
  83. ],
  84. curStage: '提交到成果讨论阶段',
  85. addForm:{
  86. year: '',
  87. batch: '',
  88. group: '',
  89. area: '',
  90. rgstrId: '',
  91. pblmChType: "",
  92. persId : localStorage.getItem("userid")
  93. },
  94. yearList:[],
  95. pcList: [],
  96. groupList: [],
  97. areaList: [],
  98. projectList: [],
  99. professionList:[
  100. {label: '前期与设计',value: '1'},
  101. {label: '建设管理',value: '2'},
  102. {label: '计划下达与执行',value: '3'},
  103. {label: '资金使用与管理',value: '4'},
  104. {label: '工程质量',value: '5'},
  105. {label: '工程安全',value: '6'}
  106. ],
  107. flag: '4',
  108. objId: '',
  109. editable: true,
  110. backStatus: false, //回退状态
  111. dailyRecordVisible: false, //操作日志弹窗
  112. }
  113. },
  114. components:{
  115. changeAdvice,
  116. resultDiscuss,
  117. centerModify,
  118. bureauModify,
  119. dailyRecord
  120. },
  121. //监听属性 类似于data概念
  122. computed: {
  123. persId() {
  124. return localStorage.getItem("userid")
  125. ? localStorage.getItem("userid")
  126. : "1098101939614724096";
  127. },
  128. hasPriv(){
  129. return this.ownPriv('manage')
  130. }
  131. },
  132. mounted(){
  133. this.$nextTick(()=>{
  134. this.getTreeData();
  135. })
  136. },
  137. methods:{
  138. async getYearPc(){
  139. await request.post(`/tac/insp/year/list`,{}).then(res =>{
  140. if(res.success){
  141. this.$nextTick(() =>{
  142. this.yearList = res.data;
  143. })
  144. }
  145. })
  146. request.post(`/tac/insp/batch/list`,{}).then(res =>{
  147. if(res.success){
  148. this.pcList = res.data;
  149. }
  150. })
  151. },
  152. //获取左侧树数据
  153. getTreeData(){
  154. let _self = this;
  155. request.post(`/tac/insp/year/batch/obj/getObjTreeListV2`,{
  156. "persId": _self.persId
  157. }).then(res =>{
  158. let treeDataLists
  159. treeDataLists = res.data.children;
  160. this.yearList = treeDataLists;
  161. this.pcList = this.yearList[0].children;
  162. this.groupList = this.pcList[0].children;
  163. this.areaList = this.groupList[0].children;
  164. this.projectList = this.areaList[0].children;
  165. // 赋予默认值
  166. this.addForm.year = this.yearList[0].pnm
  167. this.addForm.batch = this.pcList[0].pnm
  168. this.addForm.group = this.groupList[0].id
  169. this.addForm.area = this.areaList[0].adCode
  170. this.addForm.rgstrId = this.projectList[0].id
  171. this.objId = this.projectList[0].objId
  172. })
  173. },
  174. changeYear(val){
  175. this.addForm.batch = ''
  176. this.addForm.rgstrId = ''
  177. this.addForm.group = ''
  178. this.addForm.area = ''
  179. this.yearList.forEach(ele=>{
  180. if(val == ele.pnm){
  181. this.pcList = ele.children
  182. }
  183. })
  184. },
  185. changeBatch(val){
  186. this.addForm.rgstrId = ''
  187. this.addForm.group = ''
  188. this.addForm.area = ''
  189. this.pcList.forEach(ele=>{
  190. if(val == ele.pnm){
  191. this.groupList = ele.children
  192. this.addForm.group = this.groupList[0].id
  193. this.areaList = this.groupList[0].children
  194. this.addForm.area = this.areaList[0].adCode
  195. this.projectList = this.areaList[0].children
  196. this.addForm.rgstrId = this.projectList[0].id
  197. }
  198. })
  199. },
  200. changeGroup(val){
  201. this.addForm.area = ''
  202. this.addForm.rgstrId = ''
  203. this.groupList.forEach(ele=>{
  204. if(val == ele.id){
  205. this.areaList = ele.children
  206. }
  207. })
  208. },
  209. changeArea(val){
  210. this.addForm.rgstrId = ''
  211. this.areaList.forEach(ele=>{
  212. if(val == ele.adCode){
  213. this.projectList = ele.children
  214. }
  215. })
  216. },
  217. changeProject(val){
  218. this.projectList.forEach(ele=>{
  219. if(val == ele.id){
  220. this.objId = ele.objId
  221. }
  222. })
  223. },
  224. handleClick(data){
  225. console.log(data)
  226. this.flag = data.name
  227. if(this.flag == '4'){
  228. this.curStage = 'n'
  229. }else if(this.flag == '5'){
  230. this.curStage = '提交到中心修改阶段'
  231. }else if(this.flag == '6'){
  232. this.curStage = '提交到司局修改阶段'
  233. }else if(this.flag == '7'){
  234. this.curStage = '提交'
  235. }
  236. },
  237. stageSubmit(){
  238. if(this.addForm.rgstrId){
  239. let url
  240. if(this.flag == '7'){
  241. url = `/tac/pawp/rgstr/siju/${this.addForm.rgstrId}/8`
  242. }else{
  243. url = `/tac/pawp/rgstr/chengguo/submit/${this.addForm.rgstrId}/${Number(this.flag) + 1}`
  244. }
  245. this.$confirm(`注意:提交后将不能更改!确定内容已修改完成,并将成果“${this.curStage}”吗?`, '提示', {
  246. confirmButtonText: '确定',
  247. cancelButtonText: '取消',
  248. type: 'warning'
  249. }).then(() => {
  250. request.get(url).then(res=>{
  251. if(res.success){
  252. this.editable = false
  253. this.$message.success('提交成功')
  254. }else{
  255. this.$message.error(res.message)
  256. }
  257. })
  258. }).catch(() => {
  259. });
  260. }else{
  261. this.$message.warning("项目名称不能为空");
  262. }
  263. },
  264. // 助理退回工作底稿
  265. backProfession(){
  266. if(!this.addForm.pblmChType){
  267. this.$message.warning('请选择专业')
  268. return
  269. }
  270. if(this.addForm.pblmChType && this.addForm.rgstrId){
  271. backProfessionApi(this.addForm.rgstrId,this.addForm.pblmChType).then(res=>{
  272. if(res.success){
  273. this.backStatus = true
  274. this.$message.success('回退成功')
  275. }else{
  276. this.$message.warning(res.message)
  277. }
  278. }).catch(err=>{
  279. this.$message.success(err)
  280. })
  281. }else{
  282. this.$message.warning("项目名称和专业不能为空");
  283. }
  284. },
  285. sendSubmitStatus(val){
  286. this.editable = val
  287. },
  288. // 展示操作日志
  289. showDailyRecord(){
  290. if(!this.addForm.pblmChType){
  291. this.$message.warning('请选择专业')
  292. return
  293. }
  294. this.dailyRecordVisible = true
  295. },
  296. }
  297. }
  298. </script>
  299. <style lang="scss">
  300. .tabs_wrapper .el-tabs__item,.report_filter_select .el-form-item__label{
  301. font-size: 16px;
  302. color: #333;
  303. }
  304. .report_btn_group{
  305. position: absolute;
  306. top: 20px;
  307. right: 10px;
  308. }
  309. </style>