agreementAccount.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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 @click="handleClick(1)">
  72. <a-icon type="file" />
  73. 商品消费
  74. </a-button>
  75. </div>
  76. <div class="oper-item">
  77. <a-button @click="handleClick(2)">
  78. <a-icon type="file" />
  79. 入账
  80. </a-button>
  81. </div>
  82. <div class="oper-item">
  83. <a-button @click="handleClick(3)">
  84. <a-icon type="file" />
  85. 转账
  86. </a-button>
  87. </div>
  88. <div class="oper-item">
  89. <a-button @click="handleClick(4)">
  90. <a-icon type="file" />
  91. 结算
  92. </a-button>
  93. </div>
  94. <div class="oper-item">
  95. <a-button @click="handleClick(5)">
  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. <goods-consume-modal ref="goodsConsumeForm" @ok="modalFormOk" :agreementModel="agreementUnitInfo"></goods-consume-modal>
  132. <account-enter-modal ref="accountEnterForm" @ok="modalFormOk"></account-enter-modal>
  133. <account-reverse-entry-modal :maxMoney="parseFloat(accountModel.consume)" ref="accountReverseEnterForm" @ok="modalFormOk"></account-reverse-entry-modal>
  134. <account-transfer-modal :maxMoney="parseFloat(accountModel.consume)" ref="accountTransferForm" @ok="modalFormOk"></account-transfer-modal>
  135. <settlement-modal :maxMoney="parseFloat(accountModel.consume)" ref="settlementForm" @ok="modalFormOk"></settlement-modal>
  136. </a-card>
  137. </template>
  138. <script>
  139. import moment from 'moment';
  140. import GoodsConsumeModal from './account/goodsConsumeModal'
  141. import AccountEnterModal from './account/accountEnterModal'
  142. import AccountReverseEntryModal from './account/accountReverseEntryModal'
  143. import AccountTransferModal from './account/accountTransferModal'
  144. import SettlementModal from './account/settlementModal'
  145. export default {
  146. name: 'agreementAccount',
  147. components: { SettlementModal, AccountTransferModal, AccountReverseEntryModal, AccountEnterModal, GoodsConsumeModal },
  148. data() {
  149. var my_date = new Date();
  150. var first_date = new Date(my_date.getFullYear(), my_date.getMonth(), 1);
  151. var last_date = new Date(my_date.getFullYear(), my_date.getMonth() + 1, 0);
  152. return {
  153. settleType: 1,
  154. dateFormat: 'YYYY-MM-DD',
  155. rangeValue: [moment(first_date), moment(last_date)],
  156. defaultRange: [first_date.format('yyyy-MM-dd'), last_date.format('yyyy-MM-dd')],
  157. agreementUnitInfo: {},
  158. accountModel: {
  159. consume: '0',
  160. payment: '0',
  161. used: '0',
  162. surplus: '0'
  163. }
  164. }
  165. },
  166. activated() {
  167. console.log(99999)
  168. var agreementUnitInfo = JSON.parse(localStorage.getItem("agreementUnitInfo"));
  169. this.agreementUnitInfo = Object.assign({}, agreementUnitInfo);
  170. this.$forceUpdate()
  171. },
  172. created() {
  173. var agreementUnitInfo = JSON.parse(localStorage.getItem("agreementUnitInfo"));
  174. this.agreementUnitInfo = Object.assign({}, agreementUnitInfo);
  175. var temp = {
  176. consume: '20',
  177. payment: '0',
  178. used: '0',
  179. surplus: '0'
  180. }
  181. this.accountModel = Object.assign({}, temp);
  182. // console.log(agreementUnitInfo.customerName)
  183. },
  184. methods: {
  185. moment,
  186. onRangeChange(e) {
  187. console.log(this.rangeValue);
  188. },
  189. onTypeChange(e) {
  190. console.log(e);
  191. },
  192. handleClick(type){
  193. console.log('当前类型: '+type);
  194. if (type == 1){
  195. this.$refs.goodsConsumeForm.edit();
  196. this.$refs.goodsConsumeForm.title="入账";
  197. this.$refs.goodsConsumeForm.disableSubmit = true;
  198. }
  199. else if(type == 2){
  200. this.$refs.accountEnterForm.edit();
  201. this.$refs.accountEnterForm.title="入账";
  202. this.$refs.accountEnterForm.disableSubmit = true;
  203. }
  204. else if(type == 3){
  205. this.$refs.accountTransferForm.edit();
  206. this.$refs.accountTransferForm.title="转账";
  207. this.$refs.accountTransferForm.disableSubmit = true;
  208. }
  209. else if(type == 4){
  210. this.$refs.settlementForm.edit();
  211. this.$refs.settlementForm.title="结算";
  212. this.$refs.settlementForm.disableSubmit = true;
  213. }
  214. else if(type == 5){
  215. this.$refs.accountReverseEnterForm.edit();
  216. this.$refs.accountReverseEnterForm.title="冲账";
  217. this.$refs.accountReverseEnterForm.disableSubmit = true;
  218. }
  219. },
  220. modalFormOk() {
  221. },
  222. }
  223. }
  224. </script>
  225. <style scoped>
  226. .info {
  227. text-align: center;
  228. }
  229. .title {
  230. font-size: 16px;
  231. font-weight: 500;
  232. }
  233. .value {
  234. padding-top: 10px;
  235. }
  236. .bak_red {
  237. background-color: red;
  238. }
  239. .padding_8 {
  240. padding: 8px 0;
  241. border-radius: 10px;
  242. }
  243. .border_radius_10 {
  244. border-radius: 10px;
  245. }
  246. .oper-wrapper {
  247. display: flex;
  248. width: 100%;
  249. }
  250. .oper-item {
  251. margin-right: 10px;
  252. }
  253. .kajimi {
  254. margin-top: 20px;
  255. display: flex;
  256. align-items: center;
  257. }
  258. </style>