index.vue 10 KB

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