index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. <template>
  2. <div>
  3. <div class="addbox">
  4. <!-- 步骤条 -->
  5. <div class="steps">
  6. <div class="step" :class="{'finish':active>idx+1,'act':active==idx+1}" v-for="(ite,idx) in step" :key="idx" >
  7. <div class="tit flexc"><span>{{idx+1}}</span>{{ite.tit}}
  8. <div class="line"></div>
  9. </div>
  10. <div class="list" v-for="(aite,aidx) in ite.desc" :key="aidx">
  11. <span class="cir"></span>{{aite.tit}}
  12. </div>
  13. </div>
  14. </div>
  15. <!-- 标签页 -->
  16. <div class="tabs">
  17. <!-- <div class="flex1" style="overflow: hidden;"> -->
  18. <el-tabs v-model="activeName" @tab-click="handleClick">
  19. <el-tab-pane name="first">
  20. <div slot="label" class="tab flexc">
  21. <img class="tabimg" v-if="activeName=='first'" src="@/assets/images/project/taba_.png"/>
  22. <img class="tabimg" v-else src="@/assets/images/project/taba.png"/>
  23. <span>签约环节
  24. </span>
  25. </div>
  26. <first-info-form @getTreeData='testData' ref="firstInfo" :info="infoqy" :cylbOptions="cylbOptions" :qybjOptions="qybjOptions"></first-info-form>
  27. </el-tab-pane>
  28. <el-tab-pane name="second">
  29. <div slot="label" class="tab flexc">
  30. <img class="tabimg" v-if="activeName=='second'" src="@/assets/images/project/tabb_.png"/>
  31. <img class="tabimg" v-else src="@/assets/images/project/tabb.png"/>
  32. <span>开工环节
  33. </span>
  34. </div>
  35. <second-info-form @getTreeData='testData' ref="secondInfo" :info="infokg"></second-info-form>
  36. </el-tab-pane>
  37. <el-tab-pane name="third">
  38. <div slot="label" class="tab flexc">
  39. <img class="tabcimg" v-if="activeName=='third'" src="@/assets/images/project/tabc_.png"/>
  40. <img class="tabcimg" v-else src="@/assets/images/project/tabc.png"/>
  41. <span>建设环节
  42. </span>
  43. </div>
  44. <third-info-form @getTreeData='testData' ref="thirdInfo" :info="infojs" :jdqkData="jdqkData"></third-info-form>
  45. </el-tab-pane>
  46. <el-tab-pane name="fourth">
  47. <div slot="label" class="tab flexc">
  48. <img class="tabdimg" v-if="activeName=='fourth'" src="@/assets/images/project/tabd_.png"/>
  49. <img class="tabdimg" v-else src="@/assets/images/project/tabd.png"/>
  50. <span>投产环节
  51. </span>
  52. </div>
  53. <fourth-info-form @getTreeData='testData' ref="fourthInfo" :info="infotc" :jsxmjzData="jsxmjzData"></fourth-info-form>
  54. </el-tab-pane>
  55. </el-tabs>
  56. <!-- </div> -->
  57. </div>
  58. </div>
  59. </div>
  60. </template>
  61. <script>
  62. import firstInfoForm from "./firstInfoForm"
  63. import secondInfoForm from "./secondInfoForm"
  64. import thirdInfoForm from "./thirdInfoForm"
  65. import fourthInfoForm from "./fourthInfoForm"
  66. import { getXmbh,addQyxx, updateQyxx, delQyxx, getQyxx,listQyxx } from "@/api/zhaoshang/qyxx"
  67. import {addKgxx, updateKgxx, delKgxx, getKgxx,getKgxxNum,listKgxx } from "@/api/zhaoshang/kgxx"
  68. import {addJsxx, updateJsxx, delJsxx, getJsxx,getJsxxNum,listJsxx } from "@/api/zhaoshang/jsxx"
  69. import {addTcxx, updateTcxx, delTcxx, getTcxx,getTcxxNum,listTcxx } from "@/api/zhaoshang/tcxx"
  70. import {listMonth} from "@/api/zhaoshang/month"
  71. import {listJdqk} from "@/api/zhaoshang/jdqk"
  72. const defaultSettings = require("@/settings.js");
  73. export default{
  74. components:{
  75. firstInfoForm,secondInfoForm,thirdInfoForm,fourthInfoForm
  76. },
  77. data() {
  78. return{
  79. active:2,
  80. step:[
  81. {tit:'立项',desc:[{tit:'新建'},]},
  82. {tit:'签约',desc:[{tit:'签约双方信息'},{tit:'签约项目信息'},{tit:'附件上传'}]},
  83. {tit:'开工',desc:[{tit:'开工前相关手续办理'},{tit:'开工信息'},{tit:'附件上传'}]},
  84. {tit:'建设',desc:[{tit:'建设信息'},{tit:'附件上传'}]},
  85. {tit:'投产',desc:[{tit:'投产信息'},{tit:'附件上传'}]},
  86. {tit:'完成',desc:[{tit:'提交'},]},
  87. ],
  88. activeName:'first',
  89. // 表详细信息
  90. info: {},
  91. infoqy:{},
  92. infokg: {},
  93. infojs: {},
  94. infotc: {},
  95. id:null,
  96. xmbh:null,
  97. cylbOptions:[],
  98. qybjOptions:[],
  99. jsxmjzData:[],
  100. jdqkData:[],//建工进度情况
  101. defaultSettings:defaultSettings,
  102. }
  103. },
  104. created() {
  105. this.id = this.$route.query.id
  106. this.xmbh = this.$route.query.bh;
  107. this.getQyxxDetail()
  108. this.getDicts("industry_type").then(response => {
  109. this.cylbOptions = response.data;
  110. });
  111. this.getDicts("enterprise_background").then(response => {
  112. this.qybjOptions = response.data;
  113. });
  114. },
  115. methods:{
  116. getQyxxDetail(){
  117. getQyxx(this.id).then(res=>{
  118. if(res.code==200){
  119. this.infoqy=res.data;
  120. // this.xmbh=res.data.xmbh;
  121. // this.isdisabled=false;
  122. // this.progress=Number(res.data.progress)
  123. }
  124. })
  125. },
  126. handleClick(){
  127. console.log(this.activeName)
  128. if(this.activeName == 'first'){
  129. // 签约
  130. getQyxx(this.id).then(response => {
  131. this.infoqy = response.data||{}
  132. })
  133. }else if(this.activeName == 'second'){
  134. // 开工
  135. getKgxxNum(this.$route.query.bh).then(response => {
  136. this.infokg = response.data||{}
  137. })
  138. }else if(this.activeName == 'third'){
  139. // 建设
  140. getJsxxNum(this.$route.query.bh).then(response => {
  141. this.infojs = response.data||{}
  142. })
  143. this.listJdqk()
  144. }else if(this.activeName == 'fourth'){
  145. // 投产
  146. getTcxxNum(this.$route.query.bh).then(response => {
  147. this.infotc = response.data||{}
  148. })
  149. var params={
  150. xmbh:this.$route.query.bh
  151. }
  152. listMonth(params).then(res=>{
  153. this.jsxmjzData=res.rows
  154. })
  155. }
  156. },
  157. listJdqk(){
  158. var params={
  159. xmbh:this.$route.query.bh
  160. }
  161. listJdqk(params).then(response => {
  162. this.jdqkData = response.rows;
  163. this.jdqkData.filter(rou=>{
  164. if(rou.tdcrzje == null || rou.tdcrzje ==''){
  165. rou.tdcrzjes = 0
  166. }else{
  167. rou.tdcrzjes = rou.tdcrzje
  168. }
  169. if(rou.cftrje == null || rou.cftrje ==''){
  170. rou.cftrjes = 0
  171. }else{
  172. rou.cftrjes = rou.cftrje
  173. }
  174. if(rou.sbqd == null || rou.sbqd ==''){
  175. rou.sbqds = 0
  176. }else{
  177. rou.sbqds = rou.sbqd
  178. }
  179. if(rou.fpje == null || rou.fpje ==''){
  180. rou.fpjes = 0
  181. }else{
  182. rou.fpjes = rou.fpje
  183. }
  184. if(rou.htje == null || rou.htje ==''){
  185. rou.htjes = 0
  186. }else{
  187. rou.htjes = rou.htje
  188. }
  189. rou.shiji = (rou.tdcrzjes - 0) + (rou.cftrjes - 0) +(rou.sbqds - 0)+(rou.fpjes - 0)+(rou.htjes - 0)
  190. })
  191. })
  192. },
  193. testData(url){
  194. let type = this.matchType(url)
  195. if(process.env.VUE_APP_BASE_API == '/dev-api'){
  196. url = this.defaultSettings.urls + url
  197. }else{
  198. url = this.defaultSettings.urls+process.env.VUE_APP_BASE_API + url
  199. }
  200. if( type == "image"){
  201. window.open(url )
  202. }
  203. if( type == "word"){
  204. window.open('https://view.officeapps.live.com/op/view.aspx?src=' + url )
  205. }
  206. if( type == "pdf" || type == 'other' ){
  207. window.open(url )
  208. }
  209. if( type == "excel"){
  210. window.open('https://view.officeapps.live.com/op/view.aspx?src=' + url )
  211. }
  212. },
  213. matchType(fileName) {
  214. // 后缀获取
  215. var suffix = '';
  216. // 获取类型结果
  217. var result = '';
  218. try {
  219. var flieArr = fileName.split('.');
  220. suffix = flieArr[flieArr.length - 1];
  221. } catch (err) {
  222. suffix = '';
  223. }
  224. // fileName无后缀返回 false
  225. if (!suffix) {
  226. result = false;
  227. return result;
  228. }
  229. // 图片格式
  230. var imglist = ['png', 'jpg', 'jpeg', 'bmp', 'gif'];
  231. // 进行图片匹配
  232. result = imglist.some(function(item) {
  233. return item == suffix;
  234. });
  235. if (result) {
  236. result = 'image';
  237. return result;
  238. };
  239. // 匹配txt
  240. var txtlist = ['txt'];
  241. result = txtlist.some(function(item) {
  242. return item == suffix;
  243. });
  244. if (result) {
  245. result = 'txt';
  246. return result;
  247. };
  248. // 匹配 excel
  249. var excelist = ['xls', 'xlsx'];
  250. result = excelist.some(function(item) {
  251. return item == suffix;
  252. });
  253. if (result) {
  254. result = 'excel';
  255. return result;
  256. };
  257. // 匹配 word
  258. var wordlist = ['doc', 'docx','word'];
  259. result = wordlist.some(function(item) {
  260. return item == suffix;
  261. });
  262. if (result) {
  263. result = 'word';
  264. return result;
  265. };
  266. // 匹配 pdf
  267. var pdflist = ['pdf'];
  268. result = pdflist.some(function(item) {
  269. return item == suffix;
  270. });
  271. if (result) {
  272. result = 'pdf';
  273. return result;
  274. };
  275. // 匹配 ppt
  276. var pptlist = ['ppt'];
  277. result = pptlist.some(function(item) {
  278. return item == suffix;
  279. });
  280. if (result) {
  281. result = 'ppt';
  282. return result;
  283. };
  284. // 匹配 视频
  285. var videolist = ['mp4', 'm2v', 'mkv'];
  286. result = videolist.some(function(item) {
  287. return item == suffix;
  288. });
  289. if (result) {
  290. result = 'video';
  291. return result;
  292. };
  293. // 匹配 音频
  294. var radiolist = ['mp3', 'wav', 'wmv'];
  295. result = radiolist.some(function(item) {
  296. return item == suffix;
  297. });
  298. if (result) {
  299. result = 'radio';
  300. return result;
  301. }
  302. // 其他 文件类型
  303. result = 'other';
  304. return result;
  305. },
  306. }
  307. }
  308. </script>
  309. <style lang="scss" scoped>
  310. ::v-deep {
  311. .el-button{padding: 8px 14px;font-size: 14px;}
  312. .tabs{width: 100%;
  313. .el-button--small{background-color: #00A854;}
  314. .el-tabs__item{padding-right: 0;color: #666666;line-height: 45px;height: 45px;padding-left: 0;}
  315. .el-tabs__active-bar{background: #2777D0;}
  316. .is-active{color: #2777D0;font-weight: bold;}
  317. }
  318. }
  319. .flex{display: flex;}
  320. .flexc{display: flex;align-items: center;}
  321. .flex1{flex: 1;}
  322. .addbox{padding: 14px 12px 25px;
  323. .steps{background: #FFFFFF;border-radius: 4px;padding: 30px 60px 24px 85px;display: flex;
  324. .step{flex-basis: 50%;position: relative;
  325. &.finish,&.act{
  326. .tit{color: #3D455B;
  327. span{background: #1890FF;color: #FFFFFF;border: none;}
  328. }
  329. }
  330. &.finish{
  331. .line{background-color: #1890FF !important;}
  332. .list{
  333. .cir{background: #00A854;}
  334. }
  335. }
  336. &:last-child{
  337. .line{display: none !important;}
  338. }
  339. .tit{font-weight: bold;font-size: 16px;color: #666666;margin-bottom: 10px;
  340. span{width: 24px;height: 24px;background: #FFFFFF;border-radius: 50%;border: 1px solid #DADADA;font-weight: bold;display: flex;align-items: center;justify-content: center;flex: 0 0 auto;
  341. font-size: 14px;color: #AAAAAA;margin-right: 12px;}
  342. .line{height: 2px;margin-left: 18px;margin-right: 18px;flex: 1;
  343. background: #E6E6E6;}
  344. }
  345. }
  346. .list{font-weight: 500;font-size: 12px;color: #9B9B9B;line-height: 24px;padding-left: 8px;
  347. .cir{width: 8px;height: 8px;background: #BFBFBF;border-radius: 50%;display: inline-block;margin-right: 8px;}
  348. }
  349. }
  350. }
  351. .tabs{position: relative;
  352. .tab{padding: 0 21px;}
  353. .tabimg{width: 14px;height: 14px;margin-right: 8px;}
  354. .tabcimg{width: 13px;height: 13px;margin-right: 9px;}
  355. .tabdimg{width: 14px;height: 15px;margin-right: 8px;}
  356. .btns{height: 45px;border-bottom: 2px solid #dfe4ed;box-sizing: border-box;position: absolute;right: 0;top: 0;
  357. }
  358. }
  359. </style>