agreementAccount.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <template>
  2. <a-card class="container">
  3. <div class="info">
  4. <a-row :gutter="[16, 16]">
  5. <a-col :span="4" class="padding_8">
  6. <div class="title">
  7. 协议单位
  8. </div>
  9. <div class="value">
  10. {{ agreementUnitInfo.customerName }}
  11. <a-tag color="cyan">
  12. {{ agreementUnitInfo.accountStatus_dictText }}
  13. </a-tag>
  14. </div>
  15. </a-col>
  16. <a-col :span="3" class="padding_8">
  17. <div class="title">
  18. 客户类型
  19. </div>
  20. <div class="value">
  21. {{ agreementUnitInfo.customerType_dictText }}
  22. </div>
  23. </a-col>
  24. <a-col :span="3" class="padding_8">
  25. <div class="title">
  26. 消费
  27. </div>
  28. <div class="value">
  29. {{ accountModel.consume }}
  30. </div>
  31. </a-col>
  32. <a-col :span="3" class="padding_8">
  33. <div class="title">
  34. 收款
  35. </div>
  36. <div class="value">
  37. {{ accountModel.payment }}
  38. </div>
  39. </a-col>
  40. <a-col :span="3" class="padding_8">
  41. <div class="title">
  42. 记账额度
  43. </div>
  44. <div class="value">
  45. {{ agreementUnitInfo.bookkeeping == null || agreementUnitInfo.bookkeeping ==
  46. 0 ? '无限制' : agreementUnitInfo.bookkeeping }}
  47. </div>
  48. </a-col>
  49. <a-col :span="4" class="padding_8">
  50. <div class="title">
  51. 已用额度
  52. </div>
  53. <div class="value">
  54. {{ accountModel.used }}
  55. </div>
  56. </a-col>
  57. <a-col :span="4" class="bak_red padding_8 border_radius_10">
  58. <div class="title" style="color: white;">
  59. 剩余额度
  60. </div>
  61. <div class="value" style="color: white; font-weight: 600;">
  62. {{ (agreementUnitInfo.bookkeeping == null || agreementUnitInfo.bookkeeping == 0 ? '--.--' :
  63. (agreementUnitInfo.bookkeeping - accountModel.used)) }}
  64. </div>
  65. </a-col>
  66. </a-row>
  67. </div>
  68. <div class="oper">
  69. <div class="oper-wrapper">
  70. <div class="oper-item">
  71. <a-button>
  72. <a-icon type="file" />
  73. 商品消费
  74. </a-button>
  75. </div>
  76. <div class="oper-item">
  77. <a-button>
  78. <a-icon type="file" />
  79. 入账
  80. </a-button>
  81. </div>
  82. <div class="oper-item">
  83. <a-button>
  84. <a-icon type="file" />
  85. 转账
  86. </a-button>
  87. </div>
  88. <div class="oper-item">
  89. <a-button>
  90. <a-icon type="file" />
  91. 结算
  92. </a-button>
  93. </div>
  94. <div class="oper-item">
  95. <a-button>
  96. <a-icon type="file" />
  97. 冲账
  98. </a-button>
  99. </div>
  100. </div>
  101. <div class="kajimi">
  102. <a-radio-group button-style="solid" v-model="settleType" @change="onTypeChange">
  103. <a-radio-button :value="0">
  104. 全部
  105. </a-radio-button>
  106. <a-radio-button :value="1">
  107. 未结算
  108. </a-radio-button>
  109. <a-radio-button :value="2">
  110. 已结算
  111. </a-radio-button>
  112. </a-radio-group>
  113. <span style="display: inline-block; margin-left: 10px;">
  114. <a-range-picker v-model="rangeValue" @change="onRangeChange" :format="dateFormat" />
  115. </span>
  116. <span style="display: inline-block; margin-left: 10px;">
  117. <a-button>
  118. <a-icon type="search" />
  119. 查询
  120. </a-button>
  121. </span>
  122. <span style="display: block; margin-left: 10px;">
  123. <a-tag color="orange">
  124. <pre style="margin: 0;">消费:¥300 收款:¥0 余额:¥-300</pre>
  125. </a-tag>
  126. </span>
  127. </div>
  128. </div>
  129. <div class="cotent">
  130. </div>
  131. </a-card>
  132. </template>
  133. <script>
  134. import moment from 'moment';
  135. export default {
  136. name: 'agreementAccount',
  137. data() {
  138. var my_date = new Date();
  139. var first_date = new Date(my_date.getFullYear(), my_date.getMonth(), 1);
  140. var last_date = new Date(my_date.getFullYear(), my_date.getMonth() + 1, 0);
  141. return {
  142. settleType: 1,
  143. dateFormat: 'YYYY-MM-DD',
  144. rangeValue: [moment(first_date), moment(last_date)],
  145. defaultRange: [first_date.format('yyyy-MM-dd'), last_date.format('yyyy-MM-dd')],
  146. agreementUnitInfo: {},
  147. accountModel: {
  148. consume: '0',
  149. payment: '0',
  150. used: '0',
  151. surplus: '0'
  152. }
  153. }
  154. },
  155. activated() {
  156. console.log(99999)
  157. var agreementUnitInfo = JSON.parse(localStorage.getItem("agreementUnitInfo"));
  158. this.agreementUnitInfo = Object.assign({}, agreementUnitInfo);
  159. this.$forceUpdate()
  160. },
  161. created() {
  162. var agreementUnitInfo = JSON.parse(localStorage.getItem("agreementUnitInfo"));
  163. this.agreementUnitInfo = Object.assign({}, agreementUnitInfo);
  164. var temp = {
  165. consume: '0',
  166. payment: '0',
  167. used: '0',
  168. surplus: '0'
  169. }
  170. this.accountModel = Object.assign({}, temp);
  171. // console.log(agreementUnitInfo.customerName)
  172. },
  173. methods: {
  174. moment,
  175. onRangeChange(e) {
  176. console.log(this.rangeValue);
  177. },
  178. onTypeChange(e) {
  179. console.log(e);
  180. }
  181. }
  182. }
  183. </script>
  184. <style scoped>
  185. .info {
  186. text-align: center;
  187. }
  188. .title {
  189. font-size: 16px;
  190. font-weight: 500;
  191. }
  192. .value {
  193. padding-top: 10px;
  194. }
  195. .bak_red {
  196. background-color: red;
  197. }
  198. .padding_8 {
  199. padding: 8px 0;
  200. border-radius: 10px;
  201. }
  202. .border_radius_10 {
  203. border-radius: 10px;
  204. }
  205. .oper-wrapper {
  206. display: flex;
  207. width: 100%;
  208. }
  209. .oper-item {
  210. margin-right: 10px;
  211. }
  212. .kajimi {
  213. margin-top: 20px;
  214. display: flex;
  215. align-items: center;
  216. }
  217. </style>