eqptBaseInfo.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <div id="contrl" class="contrl">
  3. <el-divider content-position="left"><span style="color:#ff6154;">生成测算表</span></el-divider>
  4. <el-form ref="eqptBaseInfo" :model="eqptBaseInfo" label-width="auto" style="margin-top: 10px;"
  5. :rules="eqptBaseInfoRules">
  6. <el-row :gutter="10">
  7. <el-col :span="12">
  8. <el-form-item label="工期:" class="form-item" prop="constructionPeriod">
  9. <el-input-number v-model="eqptBaseInfo.constructionPeriod" clearable style="width: 95%;"
  10. :precision="2" :step="0.1" />
  11. </el-form-item>
  12. </el-col>
  13. </el-row>
  14. <el-row :gutter="10">
  15. <el-col :span="12">
  16. <el-form-item label="利息:" class="form-item" prop="interest">
  17. <el-input-number v-model="eqptBaseInfo.interest" clearable style="width: 95%;" :precision="2"
  18. :step="0.1" />%
  19. </el-form-item>
  20. </el-col>
  21. </el-row>
  22. <el-row :gutter="10">
  23. <el-col :span="12">
  24. <el-form-item label="前期费用率:" class="form-item" prop="preConstructionCostRatio">
  25. <el-input-number v-model="eqptBaseInfo.preConstructionCostRatio" clearable style="width: 95%;"
  26. :precision="2" :step="0.1" />%
  27. </el-form-item>
  28. </el-col>
  29. </el-row>
  30. <el-row :gutter="10">
  31. <el-col :span="12">
  32. <el-form-item label="建设单位管理费率:" class="form-item" prop="managementExpenseRatio">
  33. <el-input-number v-model="eqptBaseInfo.managementExpenseRatio" clearable style="width: 95%;"
  34. :precision="2" :step="0.1" />%
  35. </el-form-item>
  36. </el-col>
  37. </el-row>
  38. <el-button plain type="danger" style="float: right;" @click="updateBaseInfo()">
  39. 下一步
  40. <el-icon style="vertical-align: -20%;">
  41. <ArrowRightBold />
  42. </el-icon>
  43. </el-button>
  44. </el-form>
  45. </div>
  46. </template>
  47. <script>
  48. import { mapStores } from 'pinia'
  49. import { assetsProjectInfo } from '@/stores/assetsProjectStore';
  50. import { hasImportedEquipment } from '@/api/assetsCalculateEqptData';
  51. import { updateCalculateBaseInfo, getCalculateBaseInfo } from '@/api/assetsCalculate';
  52. export default {
  53. data() {
  54. return {
  55. hasImportedEquipment: false,
  56. eqptBaseInfo: {},
  57. eqptBaseInfoRules: {
  58. constructionPeriod: [
  59. { required: true, message: '请输入工期', trigger: 'blur' }
  60. ],
  61. interest: [
  62. { required: true, message: '请输入利息', trigger: 'blur' }
  63. ],
  64. preConstructionCostRatio: [
  65. { required: true, message: '请输入前期费用率', trigger: 'blur' }
  66. ],
  67. managementExpenseRatio: [
  68. { required: true, message: '请输入建设单位管理费率', trigger: 'blur' }
  69. ]
  70. },
  71. needUpdateStore: true
  72. }
  73. },
  74. created() {
  75. if(this.projectStore.calculateProgress) {
  76. this.getBaseInfo();
  77. }
  78. },
  79. computed: {
  80. ...mapStores(assetsProjectInfo),
  81. },
  82. methods: {
  83. // 更新测算表基础测算信息
  84. updateBaseInfo() {
  85. this.$refs.eqptBaseInfo.validate((valid) => {
  86. if (valid) {
  87. let params = {};
  88. params.calculateId = this.projectStore.calculateProgress.id;
  89. params.baseInfo = JSON.stringify(this.eqptBaseInfo);
  90. updateCalculateBaseInfo(params).then(res => {
  91. if (res.code == 200) {
  92. ElMessage({
  93. showClose: true,
  94. message: res.message,
  95. type: 'success'
  96. })
  97. // 更新本地缓存的测算表进度
  98. if (this.needUpdateStore) {
  99. this.projectStore.calculateProgress.progress = 'IMPORT';
  100. }
  101. this.$router.push('/home/assets/workbench/calculate/importInfo');
  102. }
  103. })
  104. }
  105. })
  106. },
  107. // 获取测算表基础信息
  108. getBaseInfo() {
  109. getCalculateBaseInfo(this.projectStore.calculateProgress.id).then(res => {
  110. if (res.data) {
  111. this.eqptBaseInfo = JSON.parse(res.data);
  112. // 返回不为空说明该步骤以前已经完成了,不需要更新本地缓存
  113. this.needUpdateStore = false;
  114. }
  115. })
  116. }
  117. }
  118. }
  119. </script>
  120. <style scoped>
  121. /* .contrl {
  122. font-size: 20px;
  123. width: 75%;
  124. border-right: 1.5px #dae1eb solid;
  125. padding: 0px 20px 20px 0px;
  126. float: left;
  127. } */
  128. :deep(.el-input__wrapper.is-focus) {
  129. --el-input-focus-border: #ff6154;
  130. --el-input-focus-border-color: #ff6154;
  131. }
  132. .target-windows {
  133. margin-top: 80px;
  134. overflow-y: scroll;
  135. padding: 5px;
  136. border: 1.5px #dae1eb solid;
  137. border-radius: 0.3em;
  138. }
  139. .title-div {
  140. height: 80px;
  141. line-height: 80px;
  142. width: 300px;
  143. float: left;
  144. font-size: 20px;
  145. font-weight: 900;
  146. }
  147. :deep(*) {
  148. color-scheme: light;
  149. --el-color-primary: #ff6154;
  150. --el-color-primary-light-3: #ff7154;
  151. --el-color-primary-light-5: #ff8154;
  152. --el-color-primary-light-7: #ff9154;
  153. --el-color-primary-light-8: #ffa999;
  154. --el-color-primary-light-9: #ffa854;
  155. --el-color-primary-dark-2: #ff8154;
  156. }
  157. </style>