index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <div class="rightSpot">
  3. <div class="title">
  4. <div class="tltLeft">
  5. <span class="blue">
  6. <svg class="icon svg-icon" aria-hidden="true">
  7. <use xlink:href="#icon-shuzhuangtu" />
  8. </svg>
  9. {{selctedMG.mg.middlegoodsname}}({{getGoodsUnitEnumItemName(selctedMG.mg.goodsunitid)}})
  10. </span>
  11. <span class="green ml10">{{selctedMG.mg.isvalid ? '正常' : '停用'}}</span>
  12. <span class="green ml10">套保比例{{(selctedMG.mg.needhedgeratio * 100).toFixed(2)}}%</span>
  13. <span class="green ml10">套利比例100%</span>
  14. </div>
  15. <div class="tltBtns">
  16. <template v-if="isNormal">
  17. <BtnList :btnList="forDataBtn" />
  18. </template>
  19. <template>
  20. <a-button class="blueBtn">恢复</a-button>
  21. </template>
  22. </div>
  23. </div>
  24. <div class="spotCont">
  25. <a-collapse class="spotCollapse" :bordered="false">
  26. <template #expandIcon="props">
  27. <svg class="icon svg-icon" aria-hidden="true" v-if="props.isActive == 0">
  28. <use xlink:href="#icon-shouqi1" />
  29. </svg>
  30. <svg class="icon svg-icon" aria-hidden="true" v-else>
  31. <use xlink:href="#icon-shouqi2" />
  32. </svg>
  33. </template>
  34. <a-collapse-panel key="1">
  35. <template #header>
  36. <a-row class="headRow">
  37. <a-col :span="8">期货品种({{selctedMG.gplist.length}})</a-col>
  38. <a-col :span="8">单位</a-col>
  39. <a-col :span="8">品种系数</a-col>
  40. </a-row>
  41. </template>
  42. <template v-for="(item, i) in selctedMG.gplist" :key="i + '1111'">
  43. <a-row class="contRow">
  44. <a-col :span="8">{{item.goodsgroupname}}</a-col>
  45. <a-col :span="8">{{item.enumdicname}}</a-col>
  46. <a-col :span="8">{{item.convertratio}}</a-col>
  47. </a-row>
  48. <a-collapse>
  49. <template #expandIcon="props">
  50. <svg
  51. class="icon svg-icon"
  52. aria-hidden="true"
  53. v-if="props.isActive == 0"
  54. >
  55. <use xlink:href="#icon-shouqi1" />
  56. </svg>
  57. <svg class="icon svg-icon" aria-hidden="true" v-else>
  58. <use xlink:href="#icon-shouqi2" />
  59. </svg>
  60. </template>
  61. <a-collapse-panel>
  62. <template #header>
  63. <a-row class="headRow">
  64. <a-col :span="8">期货合约({{item.glist.length}})</a-col>
  65. <a-col :span="8">单位</a-col>
  66. <a-col :span="8">合约系数</a-col>
  67. </a-row>
  68. </template>
  69. <a-row class="contRow" v-for="sub in item.glist" :key="sub.goodsid">
  70. <a-col :span="8">{{sub.goodsname}}</a-col>
  71. <a-col :span="8">{{sub.enumdicname}}</a-col>
  72. <a-col :span="8">{{sub.agreeunit}}</a-col>
  73. </a-row>
  74. </a-collapse-panel>
  75. </a-collapse>
  76. </template>
  77. </a-collapse-panel>
  78. <a-collapse-panel key="2">
  79. <template #header>
  80. <a-row class="headRow">
  81. <a-col :span="8">现货品种({{selctedMG.dglist.length}})</a-col>
  82. <a-col :span="8">单位</a-col>
  83. <a-col :span="8">品种系数</a-col>
  84. </a-row>
  85. </template>
  86. <template v-for="(item, i) in selctedMG.dglist" :key="i + '33'">
  87. <a-row class="contRow">
  88. <a-col :span="8">{{item.data.deliverygoodsname}}</a-col>
  89. <a-col :span="8">{{item.data.enumdicname}}</a-col>
  90. <a-col :span="8">{{item.data.agreeunit}}</a-col>
  91. </a-row>
  92. <a-collapse>
  93. <template #expandIcon="props">
  94. <svg
  95. class="icon svg-icon"
  96. aria-hidden="true"
  97. v-if="props.isActive == 0"
  98. >
  99. <use xlink:href="#icon-shouqi1" />
  100. </svg>
  101. <svg class="icon svg-icon" aria-hidden="true" v-else>
  102. <use xlink:href="#icon-shouqi2" />
  103. </svg>
  104. </template>
  105. <a-collapse-panel>
  106. <template #header>
  107. <a-row class="headRow">
  108. <a-col :span="8">商品({{item.gmlist.length}})</a-col>
  109. <a-col :span="8">单位</a-col>
  110. <a-col :span="8">标仓系数</a-col>
  111. </a-row>
  112. </template>
  113. <a-row
  114. class="contRow"
  115. v-for="(sub) in item.gmlist"
  116. :key="sub.goodsid"
  117. >
  118. <a-col :span="8">{{sub.wrstandardname}}</a-col>
  119. <a-col :span="8">{{sub.enumdicname}}</a-col>
  120. <a-col :span="8">{{sub.convertfactor}}</a-col>
  121. </a-row>
  122. </a-collapse-panel>
  123. </a-collapse>
  124. </template>
  125. </a-collapse-panel>
  126. </a-collapse>
  127. </div>
  128. <HedgingDetail :selctedMG="selctedMG" />
  129. <HedgingModify @refresh="refresh" :selctedMG="selctedMG" />
  130. </div>
  131. </template>
  132. <script lang="ts">
  133. import { defineComponent, PropType, reactive } from 'vue';
  134. import { initMG } from '@/views/information/goods/list/hedging-variety/setup';
  135. import { Ermcp3MiddleGoodsDetail2 } from '@/services/go/ermcp/goodsInfo/interface';
  136. import { initData } from '@/common/methods';
  137. import HedgingModify from '../hedgingModify/index.vue';
  138. import HedgingDetail from '../hedgingDetail/index.vue';
  139. import { BtnList } from '@/common/export/table';
  140. import { getThirdMenuData, handleBtnList } from '@/common/setup/table/button';
  141. import { getGoodsUnitEnumItemName } from '@/common/constants/enumsName';
  142. export default defineComponent({
  143. name: 'rightHedging',
  144. props: {
  145. selctedMG: {
  146. default: initMG,
  147. type: Object as PropType<Ermcp3MiddleGoodsDetail2>,
  148. },
  149. isNormal: {
  150. default: true,
  151. type: Boolean,
  152. },
  153. },
  154. components: {
  155. BtnList,
  156. HedgingDetail,
  157. HedgingModify,
  158. },
  159. setup(props, context) {
  160. const menuList = getThirdMenuData();
  161. const temp = menuList.find((e) => e.code === 'goods_info_hedge');
  162. let list = undefined;
  163. if (temp) {
  164. list = temp.children.find((e) => e.code === 'goods_info_hedge_normal');
  165. }
  166. const { forDataBtn } = handleBtnList(list, 'goods_info_hedge_normal', true);
  167. function refresh() {
  168. context.emit('refresh');
  169. }
  170. initData(() => {});
  171. return { getGoodsUnitEnumItemName, forDataBtn, refresh };
  172. },
  173. });
  174. </script>
  175. <style lang="less">
  176. .rightSpot {
  177. width: 100%;
  178. height: 100%;
  179. padding: 10px 12px;
  180. .flex;
  181. flex-direction: column;
  182. .title {
  183. width: 100%;
  184. height: 35px;
  185. .flex;
  186. justify-content: space-between;
  187. div {
  188. align-self: center;
  189. align-items: center;
  190. }
  191. .tltLeft {
  192. font-size: 16px;
  193. .icon {
  194. font-size: 20px;
  195. fill: @m-blue0;
  196. margin-right: 10px;
  197. }
  198. }
  199. .tltBtns {
  200. .ant-btn + .ant-btn {
  201. margin-left: 10px;
  202. }
  203. }
  204. }
  205. .spotCont {
  206. width: 100%;
  207. padding: 0 30px;
  208. }
  209. }
  210. .blue {
  211. color: @m-blue0;
  212. }
  213. .green {
  214. color: @m-green0;
  215. }
  216. .ml10 {
  217. margin-left: 10px;
  218. }
  219. .blueBtn {
  220. width: 80px;
  221. height: 26px;
  222. text-align: center;
  223. background: linear-gradient(0deg, @m-blue2, @m-blue0);
  224. box-shadow: -1px 0px 0px 0px #121618;
  225. .rounded-corners(3px);
  226. border: 0;
  227. color: @m-white0;
  228. font-size: 14px;
  229. &:hover,
  230. &:focus {
  231. background: linear-gradient(0deg, @m-blue2-hover, @m-blue0-hover);
  232. color: @m-white0-hover;
  233. }
  234. }
  235. .redBtn {
  236. width: 80px;
  237. height: 26px;
  238. background: linear-gradient(0deg, @m-red0, @m-red1);
  239. .rounded-corners(3px);
  240. border: 0;
  241. color: @m-white0;
  242. font-size: 14px;
  243. &:hover,
  244. &:focus {
  245. background: linear-gradient(0deg, @m-red0-hover, @m-red1-hover);
  246. color: @m-white0-hover;
  247. }
  248. }
  249. .ant-collapse {
  250. background-color: transparent;
  251. border: 0;
  252. .ant-collapse-item {
  253. border: 0;
  254. .ant-collapse-header {
  255. background-color: transparent;
  256. border-bottom: 0;
  257. }
  258. .ant-collapse-content {
  259. background-color: transparent;
  260. border-top: 0;
  261. }
  262. }
  263. }
  264. </style>;