stepTwo.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <div>
  3. <div class="formContent-item_title">房屋信息</div>
  4. <el-table :data="$parent.tableArr" style="width: 100%" class="mrbt20">
  5. <el-table-column prop="communityName" label="所属社区"> </el-table-column>
  6. <el-table-column prop="buildingName" label="楼栋"> </el-table-column>
  7. <el-table-column prop="unitName" label="单元"> </el-table-column>
  8. <el-table-column prop="floorNumber" label="楼层"> </el-table-column>
  9. <el-table-column prop="roomNumber" label="房间号"> </el-table-column>
  10. <el-table-column prop="buildingTypeDict" label="房屋类型"> </el-table-column>
  11. <el-table-column prop="buildingArea" label="建筑面积">
  12. <template slot-scope="scope">{{
  13. !!scope.row.buildingArea ? scope.row.buildingArea + '㎡' : '-'
  14. }}</template></el-table-column
  15. >
  16. </el-table>
  17. <el-form ref="form" :rules="$parent.idsObjRules" label-width="90px">
  18. <div v-for="(item, index) in $parent.idsObj" :key="index">
  19. <el-col :span="12">
  20. <el-form-item label="租金规则" :rules="rulesFun('租金规则', item.ruleId)">
  21. <el-select v-model="item.ruleId" placeholder="请选择租金规则" clearable @change="ruleIdChange(index, item.ruleId)">
  22. <el-option v-for="(item, index) in tegyArr" :key="index" :label="item.chargeName" :value="item.id"></el-option>
  23. </el-select>
  24. </el-form-item>
  25. </el-col>
  26. <el-table :data="item.thisArr" style="width: 100%; clear: both" class="mrbt20">
  27. <el-table-column prop="chargeName" label="费用名称"> </el-table-column>
  28. <el-table-column label="计费方式">
  29. <template slot-scope="scope">
  30. <span v-if="scope.row.chargeMode === 1">固定收费 </span>
  31. <span v-if="scope.row.chargeMode === 2">价格*面积收费</span>
  32. <span v-if="scope.row.chargeMode === 3">阶梯计费 </span>
  33. <span v-if="scope.row.chargeMode === 4">单价*用量</span>
  34. </template>
  35. </el-table-column>
  36. <el-table-column label="单价"> </el-table-column>
  37. <el-table-column label="月租金">
  38. <template slot-scope="scope">
  39. {{ scope.row.chargePrice }}
  40. </template>
  41. </el-table-column>
  42. <el-table-column prop="roomNumber" label="计费周期">
  43. <template slot-scope="scope"> {{ scope.row.chargeCycle || 0 }} 个月 </template>
  44. </el-table-column>
  45. <el-table-column prop="buildingTypeDict" label="滞纳金标准">
  46. <template slot-scope="scope">
  47. 欠费{{ scope.row.arrearsDays }}天后,收{{ scope.row.lateFee || 0 }} ‰滞纳金
  48. </template>
  49. </el-table-column>
  50. <el-table-column prop="buildingArea" label="递增规则">
  51. <template slot-scope="scope">
  52. {{ scope.row.increasingYear }}年后,每年递增 {{ scope.row.increasingPercentage || 0 }} %
  53. </template></el-table-column
  54. >
  55. </el-table>
  56. <el-col :span="13">
  57. <el-form-item label="免租期">
  58. <el-date-picker
  59. v-model="item.timesTwo"
  60. class="timeWidth"
  61. value-format="yyyy-MM"
  62. type="monthrange"
  63. range-separator="至"
  64. start-placeholder="开始月份"
  65. end-placeholder="结束月份"
  66. @change="effectiveDateToggle(item, item.timesTwo)"
  67. :editable="false"
  68. ></el-date-picker>
  69. </el-form-item>
  70. </el-col>
  71. <el-col :span="12"
  72. ><el-form-item label="租赁保证金">
  73. <el-input v-model="item.earnestMoney" placeholder="请输入租赁保证金"></el-input> </el-form-item
  74. ></el-col>
  75. <el-col :span="12"
  76. ><el-form-item label="租赁保证金是否抵扣第一期租金:" label-width="220px">
  77. <el-radio v-model="item.enable" :label="1">是</el-radio>
  78. <el-radio v-model="item.enable" :label="2">否</el-radio>
  79. </el-form-item></el-col
  80. >
  81. </div>
  82. </el-form>
  83. </div>
  84. </template>
  85. <script>
  86. export default {
  87. data() {
  88. return {
  89. times: [],
  90. tegyArr: [],
  91. thisRule: []
  92. };
  93. },
  94. methods: {
  95. rulesFun(name, val) {
  96. return {
  97. required: true,
  98. message: `${name}不能为空`,
  99. trigger: 'change',
  100. validator(rule, value, cb) {
  101. if (!val) {
  102. cb(new Error());
  103. } else {
  104. cb();
  105. }
  106. }
  107. };
  108. },
  109. effectiveDateToggle(item, val) {
  110. item.freeTime = `${!!val ? val[0] + '###' : ''}${!!val ? val[1] : ''}`;
  111. },
  112. ruleIdChange(index, id) {
  113. if (!!id) {
  114. this.thisRule.splice(index, 0, 0);
  115. } else {
  116. this.thisRule[index] = 1;
  117. }
  118. this.tegyArr.map((item) => {
  119. if (item.id == id) {
  120. this.$parent.idsObj[index].thisArr = [item];
  121. this.$parent.idsObj[index].chargePrice = item.chargePrice;
  122. this.$parent.idsObj[index].cycle = item.chargeCycle;
  123. this.$parent.idsObj[index].increasingPercentage = item.increasingPercentage;
  124. this.$parent.idsObj[index].increasingYear = item.increasingYear;
  125. }
  126. });
  127. },
  128. getList() {
  129. const { formData, idsObj } = this.$parent;
  130. let arrs = [];
  131. idsObj.map((item) => {
  132. arrs.push({
  133. amount: item.chargePrice,
  134. cycle: item.cycle,
  135. earnestMoney: item.earnestMoney,
  136. enable: item.enable,
  137. endTime: formData.endTime,
  138. takeEffectDate: formData.startTime,
  139. freeTime: item.freeTime,
  140. houseId: item.houseId,
  141. increasingPercentage: item.increasingPercentage,
  142. increasingYear: item.increasingYear
  143. });
  144. });
  145. this.$http
  146. .post('/sc-community/contract/getPlans', arrs)
  147. .then(({ data }) => {
  148. idsObj.map((item) => {
  149. item.contractPlanDtos = data[item.houseId];
  150. });
  151. })
  152. .catch(function () {});
  153. },
  154. getTegy() {
  155. this.$http
  156. .get('/sc-charge/scChargeStrategy/page', { pageNum: 1, pageSize: 15, chargeType: 8 })
  157. .then(({ data }) => {
  158. this.tegyArr = data.list;
  159. })
  160. .catch(function () {});
  161. },
  162. chanIndexSumit(resolve) {
  163. if (!!this.thisRule.length) {
  164. let len = 0;
  165. this.thisRule.map((item) => {
  166. if (item == 0) {
  167. len++;
  168. }
  169. });
  170. if (this.$parent.tableArr.length == len) {
  171. resolve && resolve();
  172. } else {
  173. this.$message.info('请选择完规则项');
  174. }
  175. } else {
  176. this.$message.info('请选择规则项');
  177. }
  178. }
  179. },
  180. created() {
  181. this.getTegy();
  182. }
  183. };
  184. </script>
  185. <style lang="scss" scoped>
  186. .formContent-item_title {
  187. clear: both;
  188. }
  189. .mrbt20 {
  190. margin-bottom: 20px;
  191. }
  192. /deep/ .el-date-editor .el-range-separator {
  193. padding: 0;
  194. }
  195. /deep/ .el-form-item__label,
  196. /deep/ .el-input__inner {
  197. font-size: 12px;
  198. }
  199. </style>