single.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <div class="lookDetail">
  3. <div class="formContent-item_title">{{ chiData.assets }}</div>
  4. <el-form ref="form" :model="formData" :rules="formRules" label-width="110px">
  5. <template v-for="(item, index) in formLook">
  6. <el-col :span="12" :key="index">
  7. <el-form-item :label="labelType(item.label, item.prop)">
  8. <template v-if="item.slot">
  9. <template v-if="item.slot == 'assetsArea' && thisItem['chargeType'] == 4">
  10. {{ !!thisItem['parkingDetail'] ? thisItem['parkingDetail'] : '--' }}
  11. </template>
  12. <template v-else-if="item.slot == 'chargeMode'">
  13. {{ !!chargeModeValue[thisItem[item.prop]] ? chargeModeValue[thisItem[item.prop]] : '--' }}
  14. </template>
  15. <template v-else-if="item.slot == 'chargeStatus'">
  16. <span class="redText">未缴费</span>
  17. </template>
  18. <template v-else-if="item.slot === 'payEndTime'">
  19. <div style="white-space: nowrap">{{ typeTimeTransition(thisItem.payBeginTime, thisItem.payEndTime) }}</div>
  20. </template>
  21. <template v-else>
  22. {{ thisItem[item.prop] || '--' }}
  23. </template>
  24. </template>
  25. <template v-else>
  26. {{ thisItem[item.prop] || '--' }}
  27. </template>
  28. </el-form-item>
  29. </el-col>
  30. </template>
  31. <div class="inline">
  32. <el-form-item label="支付方式" prop="payType">
  33. <el-select v-model="formData.payType">
  34. <el-option label="微信" :value="1"></el-option>
  35. <el-option label="支付宝" :value="2"></el-option>
  36. <el-option label="现金" :value="3"></el-option>
  37. <el-option label="其他" :value="5"></el-option>
  38. </el-select>
  39. </el-form-item>
  40. <el-form-item label="应收金额(元)"
  41. ><div style="white-space: nowrap">{{ thisItem.receivableAmount }}</div></el-form-item
  42. >
  43. <el-form-item label="实收金额(元)" required
  44. ><el-input oninput="value=value.replace(/[^0-9.]/g,'')" disabled v-model="thisItem.amount"></el-input
  45. ></el-form-item>
  46. </div>
  47. <el-form-item label="备注信息" placeholder="请输入备注信息">
  48. <el-input type="textarea" maxlength="100" v-model="formData.remark" show-word-limit resize="none" rows="3"></el-input>
  49. </el-form-item>
  50. </el-form>
  51. </div>
  52. </template>
  53. <script >
  54. export default {
  55. props: ['params'],
  56. data() {
  57. return {
  58. chargeModeValue: {
  59. 1: '固定收费',
  60. 2: '价格*面积收费',
  61. 4: '单价*用量'
  62. },
  63. formLook: [
  64. {
  65. label: '费用名称:',
  66. prop: 'chargeName'
  67. },
  68. {
  69. label: '计费方式:',
  70. prop: 'chargeMode',
  71. slot: 'chargeMode'
  72. },
  73. {
  74. label: '面积(㎡):',
  75. prop: 'assetsArea',
  76. slot: 'assetsArea'
  77. },
  78. {
  79. label: '价格(元/月):',
  80. prop: 'chargePrice'
  81. },
  82. {
  83. label: '费用金额(元):',
  84. prop: 'amount'
  85. },
  86. {
  87. label: '账期:',
  88. prop: 'paymentDays'
  89. },
  90. {
  91. label: '滞纳金(元):',
  92. prop: 'lateFee'
  93. },
  94. {
  95. label: '缴费状态:',
  96. prop: 'chargeStatus',
  97. slot: 'chargeStatus'
  98. },
  99. {
  100. label: '业主:',
  101. prop: 'residentName'
  102. },
  103. {
  104. label: '业主手机号:',
  105. prop: 'phone'
  106. },
  107. {
  108. label: '账单计费日期:',
  109. prop: 'payEndTime',
  110. slot: 'payEndTime'
  111. }
  112. ],
  113. thisItem: {},
  114. chiData: {},
  115. formData: {
  116. payType: '',
  117. remark: '',
  118. amount: '',
  119. billList: [
  120. {
  121. amount: '',
  122. billId: ''
  123. }
  124. ]
  125. },
  126. formRules: {
  127. payType: [this.$valid.selectRequired('支付方式')],
  128. amount: [this.$valid.inputRequired('实收金额')]
  129. }
  130. };
  131. },
  132. methods: {
  133. submit() {
  134. this.$refs.form.validate((valid) => {
  135. if (valid) {
  136. var loading = this.$loading();
  137. let installData = {
  138. payType: this.formData.payType,
  139. remark: this.formData.remark,
  140. billList: [
  141. {
  142. amount: this.thisItem.amount,
  143. billId: this.thisItem.id
  144. }
  145. ]
  146. };
  147. this.$http
  148. .post('/sc-charge/charge/bill/payee', installData)
  149. .then(({ status, msg }) => {
  150. if (status == 0) {
  151. this.$message.success(msg);
  152. this.params.callback();
  153. this.$emit('close');
  154. } else {
  155. this.$message.error(msg);
  156. }
  157. loading.close();
  158. })
  159. .catch(() => {
  160. loading.close();
  161. });
  162. }
  163. });
  164. },
  165. getDatali(id) {
  166. this.$http
  167. .get('/sc-charge/charge/bill/findUserBillDetail', { id: id })
  168. .then(({ data, msg, status }) => {
  169. if (status == 0) {
  170. this.thisItem = data;
  171. }
  172. })
  173. .catch(() => {});
  174. },
  175. typeTimeTransition(start, end) {
  176. let text = '';
  177. if (!!end) {
  178. let f = start.slice(5, 7),
  179. l = end.slice(5, 7);
  180. if (Number(f) == Number(l)) {
  181. text = start;
  182. } else {
  183. text = `${start.slice(0, 8)}-${end.slice(0, 8)}`;
  184. }
  185. }
  186. return text;
  187. },
  188. labelType(lab, val) {
  189. let type = this.thisItem['chargeType'];
  190. if (val == 'assetsArea') {
  191. if (type == 2) {
  192. lab = '用量(吨):';
  193. } else if (type == 3) {
  194. lab = '用量(度):';
  195. } else if (type == 4) {
  196. lab = '车位:';
  197. }
  198. } else if (val == 'chargePrice') {
  199. if (type == 2) {
  200. lab = '价格(元/吨):';
  201. } else if (type == 3) {
  202. lab = '价格(元/度):';
  203. }
  204. }
  205. return lab;
  206. }
  207. },
  208. created() {
  209. this.getDatali(this.params.data.id);
  210. this.chiData = this.params.data;
  211. }
  212. };
  213. </script>
  214. <style lang="scss" scoped>
  215. .lookDetail {
  216. /deep/ .el-form-item__label,
  217. /deep/.el-form-item__content {
  218. font-size: 12px;
  219. white-space: nowrap;
  220. }
  221. }
  222. .inline {
  223. clear: left;
  224. display: flex;
  225. justify-content: space-between;
  226. }
  227. </style>