proinfo.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. <template>
  2. <div class="flex flex-col">
  3. <div class="flex flex-center flex-justify-between margin">
  4. <span class="grey font-18 bold">项目详情</span>
  5. <div class="flex flex-center">
  6. <base-button v-if="option.detail === false" :width="60" icon="Close" title="取消编辑" @click="cancel"/>
  7. <base-button :title="btnTips" :width="60" icon="EditPen" @click="edit"/>
  8. </div>
  9. </div>
  10. <basic-form :data="data" :option="option" class="mt-10" />
  11. <div class="flex flex-col mt-20">
  12. <div class="flex flex-center flex-justify-between margin">
  13. <span class="grey font-18 bold">发行明细</span>
  14. <base-button :width="60" icon="Plus" title="新增" @click="showAdd = true"/>
  15. </div>
  16. <!-------发行明细------>
  17. <el-empty v-if="issue.length === 0" description="暂无数据"/>
  18. <div v-else class="flex flex-col flex-center padding mb-20">
  19. <div class="flex flex-center grey bold full-width mr-10 border"
  20. style="background-color: #FAFAFA;height: 50px;">
  21. <span class="flex-child-average">发行时间</span>
  22. <span class="flex-child-average">发行金额(万元)</span>
  23. <span class="flex-child-average">发行期限</span>
  24. <span class="flex-child-average">发行利率</span>
  25. </div>
  26. <div v-for="item in issue" :key='item.id'
  27. class="flex flex-center grey full-width border-bottom border-right border-left mr-10"
  28. style="height: 50px">
  29. <span class="flex-child-average">{{ item.issueDate }}</span>
  30. <span class="flex-child-average">{{ item.issueAmount }}</span>
  31. <span class="flex-child-average">{{ item.issueRate }}</span>
  32. <span class="flex-child-average">{{ item.issueTerm }}</span>
  33. </div>
  34. </div>
  35. </div>
  36. <el-dialog v-model='showAdd' append-to-body width='40%'>
  37. <div class="flex flex-col">
  38. <el-form ref="ruleFormRef"
  39. :model="issueInfo"
  40. class="demo-ruleForm"
  41. label-width="120px"
  42. status-icon>
  43. <el-form-item label="发行时间">
  44. <el-date-picker
  45. v-model="issueInfo.issueDate"
  46. format="YYYY-MM-DD"
  47. placeholder="选择发行时间"
  48. style="width: 100%"
  49. value-format="YYYY-MM-DD"
  50. />
  51. </el-form-item>
  52. <el-form-item label="发行金额">
  53. <el-input v-model="issueInfo.issueAmount"/>
  54. </el-form-item>
  55. <el-form-item label="发行期限">
  56. <el-input v-model="issueInfo.issueRate"/>
  57. </el-form-item>
  58. <el-form-item label="发行利率">
  59. <el-input v-model="issueInfo.issueTerm"/>
  60. </el-form-item>
  61. </el-form>
  62. <div class="full-width flex flex-center mt-10">
  63. <base-button icon="Lock" title="保存" type="1" @click="issueAdd"/>
  64. </div>
  65. </div>
  66. </el-dialog>
  67. </div>
  68. </template>
  69. <script>
  70. import baseButton from '../../../components/base-button.vue'
  71. import basicForm from '../../../components/basic-form/index.vue'
  72. export default {
  73. components: { baseButton, basicForm },
  74. props: {
  75. data: Object,
  76. issue: Array
  77. },
  78. watch: {
  79. data: {
  80. handler (val) {
  81. if (val && val.hasOwnProperty('property')) {
  82. const config = JSON.parse(val.property)
  83. // this.option.column = config
  84. }
  85. },
  86. immediate: true
  87. }
  88. },
  89. data () {
  90. return {
  91. showAdd: false,
  92. keyWords: '',
  93. loading: false,
  94. btnTips: '编辑',
  95. page: {
  96. pageSize: 15,
  97. currentPage: 1,
  98. total: 0
  99. },
  100. option: {
  101. detail: true,
  102. labelWidth: '200px',
  103. column: [
  104. {
  105. prop: 'name',
  106. id: 1,
  107. label: '名称',
  108. type: 'input',
  109. span: '24'
  110. },
  111. {
  112. children: [
  113. {
  114. prop: 'totalAmount',
  115. id: 21,
  116. label: '总投资(万元)',
  117. type: 'number',
  118. parentId: 2,
  119. span: '24'
  120. },
  121. {
  122. label: '地区',
  123. type: 'area',
  124. prop: 'province',
  125. expand: {
  126. dict: '/blade-system/region/lazy-list',
  127. prop: {
  128. label: 'name',
  129. value: 'id'
  130. }
  131. },
  132. id: 22,
  133. parentId: 2,
  134. span: '24'
  135. }
  136. ],
  137. id: 2,
  138. type: 'row'
  139. },
  140. {
  141. children: [
  142. {
  143. prop: 'capital',
  144. id: 41,
  145. label: '不含专项债的资本金',
  146. type: 'number',
  147. parentId: 4,
  148. span: '24'
  149. },
  150. {
  151. prop: 'debt',
  152. id: 42,
  153. label: '项目领域',
  154. type: 'select',
  155. parentId: 4,
  156. span: '24',
  157. expand: {
  158. dict: '/blade-system/dict-biz/dictionary?code=pc-debt-type',
  159. prop: {
  160. label: 'dictValue',
  161. value: 'dictKey'
  162. }
  163. }
  164. }
  165. ],
  166. id: 4,
  167. type: 'row'
  168. },
  169. {
  170. children: [
  171. {
  172. label: '其他债务融资(万元)',
  173. type: 'number',
  174. prop: 'portfolioFinancing',
  175. expand: '',
  176. id: 61,
  177. parentId: 6,
  178. span: '24'
  179. },
  180. {
  181. prop: 'startDate',
  182. id: 62,
  183. label: '建设期',
  184. type: 'daterange',
  185. parentId: 6,
  186. span: '24'
  187. }
  188. ],
  189. id: 6,
  190. type: 'row'
  191. },
  192. {
  193. children: [
  194. {
  195. label: '专项债做资本金(万元)',
  196. type: 'number',
  197. prop: 'debtsAsCapital',
  198. expand: '',
  199. id: 71,
  200. parentId: 7,
  201. span: '24'
  202. },
  203. {
  204. prop: 'operationStartDate',
  205. id: 72,
  206. label: '运营期',
  207. type: 'daterange',
  208. parentId: 7,
  209. span: '24'
  210. }
  211. ],
  212. id: 7,
  213. type: 'row'
  214. },
  215. {
  216. children: [
  217. {
  218. label: '预期收益(万元)',
  219. type: 'number',
  220. prop: 'expectedReturn',
  221. expand: '',
  222. id: 81,
  223. parentId: 8
  224. },
  225. {
  226. prop: 'cost',
  227. id: 82,
  228. label: '成本',
  229. type: 'number',
  230. parentId: 8
  231. }
  232. ],
  233. id: 8,
  234. type: 'row'
  235. },
  236. {
  237. children: [
  238. {
  239. prop: 'costIncomePercent',
  240. id: 121,
  241. label: '成本/收入',
  242. type: 'number',
  243. parentId: 12
  244. },
  245. {
  246. prop: 'coverageMultiple',
  247. id: 131,
  248. label: '覆盖倍数',
  249. type: 'number',
  250. parentId: 13
  251. }
  252. ],
  253. id: 11,
  254. type: 'row'
  255. },
  256. {
  257. children: [
  258. {
  259. prop: 'projectSubject',
  260. id: 112,
  261. label: '主管部门',
  262. type: 'number',
  263. parentId: 11
  264. },
  265. {
  266. prop: 'implementingAgency',
  267. id: 52,
  268. label: '项目业主',
  269. type: 'input',
  270. parentId: 5
  271. }
  272. ],
  273. id: 5,
  274. type: 'row'
  275. },
  276. {
  277. children: [
  278. {
  279. prop: 'accountingFirm',
  280. id: 122,
  281. label: '会计所',
  282. type: 'number',
  283. parentId: 12
  284. },
  285. {
  286. prop: 'lawFirm',
  287. id: 132,
  288. label: '律所',
  289. type: 'number',
  290. parentId: 13
  291. }
  292. ],
  293. id: 12,
  294. type: 'row'
  295. },
  296. {
  297. children: [
  298. {
  299. prop: 'issueCumulative',
  300. id: 51,
  301. label: '申请专项债总额(累计发行)',
  302. type: 'number',
  303. parentId: 5
  304. }
  305. ],
  306. id: 11,
  307. type: 'row'
  308. },
  309. {
  310. prop: 'sourceIncome',
  311. id: 9,
  312. label: '收入来源',
  313. type: 'textarea',
  314. rows: 3,
  315. span: '24'
  316. },
  317. {
  318. prop: 'introduction',
  319. id: 10,
  320. label: '建设内容',
  321. type: 'textarea',
  322. rows: 4,
  323. span: '24'
  324. },
  325. {
  326. prop: 'portfolioFinancing',
  327. id: 111,
  328. label: '其他债务融资来源',
  329. type: 'textarea',
  330. parentId: 11,
  331. rows: 4,
  332. span: '24'
  333. }
  334. ]
  335. },
  336. issueInfo: {
  337. issueDate: '',
  338. issueAmount: '',
  339. issueRate: '',
  340. issueTerm: '',
  341. projectId: ''
  342. }
  343. }
  344. },
  345. methods: {
  346. edit () {
  347. if (this.btnTips === '编辑') {
  348. this.option.detail = false
  349. this.btnTips = '保存'
  350. } else {
  351. this.option.detail = true
  352. this.$api.project.proUpdate(this.data).then(res => {
  353. if (res.code === 200) {
  354. this.$message.success(res.msg)
  355. this.$emit('refInfo')
  356. } else {
  357. this.$message.error(res.msg)
  358. }
  359. })
  360. this.btnTips = '编辑'
  361. }
  362. },
  363. cancel () {
  364. this.option.detail = true
  365. this.btnTips = '编辑'
  366. },
  367. issueAdd () {
  368. this.issueInfo.projectId = this.data.id
  369. this.$api.project.issueAdd(this.issueInfo).then(res => {
  370. if (res.code === 200) {
  371. this.showAdd = false
  372. this.$message.success(res.msg)
  373. this.$emit('refresh')
  374. } else {
  375. this.$message.error(res.msg)
  376. }
  377. })
  378. }
  379. }
  380. }
  381. </script>
  382. <style scoped>
  383. </style>