choosePermancePlanTmp.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <!--选择履约模板-->
  3. <Drawer :title="'选择履约模板'"
  4. :placement="'right'"
  5. :visible="visible"
  6. @cancel="cancel"
  7. :class="[position === 'top' ? 'top486' : 'delistingBottom']">
  8. <span class="add-permance"
  9. @click="open">
  10. <svg class="icon svg-icon"
  11. aria-hidden="true">
  12. <use xlink:href="#icon-xinjianzengjiaxinzeng-20" />
  13. </svg>
  14. </span>
  15. <a-spin :spinning="loading">
  16. <div class="moduleContent">
  17. <div class="itemBar"
  18. v-for="item in tableList"
  19. :key="item.autoid"
  20. @click="chooseTemp(item)">
  21. <div class="itemName">{{item.templatename}}</div>
  22. <div class="rulesCont">
  23. <a-row>
  24. <a-col :span="24"
  25. class="ruleCol">
  26. <div class="line"
  27. v-for="sub in item.LstStep"
  28. :key="sub.autoid">
  29. <div class="name">{{sub.steptypename}}</div>
  30. <div class="time">{{sub.stepdate}}</div>
  31. </div>
  32. </a-col>
  33. </a-row>
  34. </div>
  35. </div>
  36. </div>
  37. </a-spin>
  38. </Drawer>
  39. <Add v-if="show"
  40. :position="position"
  41. @cancel="closeAddTemp" />
  42. </template>
  43. <script lang="ts">
  44. import { defineComponent, PropType, ref } from 'vue';
  45. import { Des } from '@/common/components/commonDes';
  46. import { _closeModal } from '@/common/setup/modal/modal';
  47. import Drawer from '@/common/components/drawer/index.vue';
  48. import { QueryPermancePlanTmpReq, QueryPermancePlanTmpRsp } from '@/services/go/wrtrade/interface';
  49. import { queryQueryPermancePlanTmp } from '@/services/go/wrtrade';
  50. import { getUsrId } from '@/services/bus/user';
  51. import { queryTableList } from '@/common/setup/table';
  52. import Add from '@/common/components/permanceTemp/addPermanceTemp.vue';
  53. function hanldeOpenAndCloseComponent<T>() {
  54. const show = ref<boolean>(false);
  55. const selected = ref<T>(); // 选中的朋友 id 列表
  56. function close(value: any) {
  57. if (value) {
  58. selected.value = value;
  59. }
  60. show.value = false;
  61. }
  62. function open() {
  63. show.value = true;
  64. }
  65. return { show, selected, close, open };
  66. }
  67. export default defineComponent({
  68. emits: ['cancel', 'update'],
  69. name: 'queryQueryPermancePlanTmp',
  70. components: { Des, Drawer, Add },
  71. props: {
  72. position: {
  73. type: String,
  74. default: 'top',
  75. },
  76. // 新版本仓单贸易挂牌时,都需要选择履约模板,查询时增加marketID参数
  77. marketid: {
  78. type: Number,
  79. default: undefined,
  80. }
  81. },
  82. setup(props, context) {
  83. const { visible, cancel } = _closeModal(context);
  84. // 新增模板
  85. const { show, close, open } = hanldeOpenAndCloseComponent();
  86. const param: QueryPermancePlanTmpReq = {
  87. // userid: getUsrId(), // 新版本不用传userid
  88. tmptype: '0,2',
  89. };
  90. if (props.marketid) { param.marketid = props.marketid }
  91. const { loading, tableList, queryTable } = queryTableList<QueryPermancePlanTmpRsp>();
  92. queryTable(queryQueryPermancePlanTmp, param);
  93. function closeAddTemp(isRefresh: boolean) {
  94. if (isRefresh) {
  95. queryTable(queryQueryPermancePlanTmp, param);
  96. }
  97. close(null);
  98. }
  99. // 选择履约模板
  100. function chooseTemp(item: QueryPermancePlanTmpRsp) {
  101. context.emit('update', item);
  102. cancel();
  103. }
  104. return {
  105. loading,
  106. cancel,
  107. visible,
  108. tableList,
  109. show,
  110. close,
  111. open,
  112. chooseTemp,
  113. closeAddTemp,
  114. };
  115. },
  116. });
  117. </script>
  118. <style lang="less" scoped>
  119. .add-permance {
  120. position: absolute;
  121. top: 10px;
  122. right: 20px;
  123. .icon {
  124. font-size: 20px;
  125. color: @m-blue25;
  126. }
  127. }
  128. .moduleContent {
  129. padding: 10px 20px 0;
  130. width: 470px;
  131. height: 100%;
  132. overflow-y: auto;
  133. .itemBar {
  134. width: 100%;
  135. padding: 0 14px 6px;
  136. margin-bottom: 10px;
  137. .flex;
  138. flex-direction: column;
  139. background: @m-blue34;
  140. .rounded-corners(5px);
  141. .itemName {
  142. width: 100%;
  143. height: 40px;
  144. line-height: 40px;
  145. border-bottom: 1px solid @m-blue20;
  146. color: @m-white11;
  147. font-size: 16px;
  148. }
  149. }
  150. }
  151. /*滚动条样式*/
  152. ::-webkit-scrollbar {
  153. //width: 10px;
  154. height: 4px;
  155. }
  156. /* 滚动的滑块 */
  157. ::-webkit-scrollbar-thumb {
  158. border-radius: 2px;
  159. background-color: @m-blue35;
  160. }
  161. /* 滚动条两端的按钮 */
  162. ::-webkit-scrollbar-button {
  163. background-color: transparent;
  164. display: none;
  165. }
  166. /* 内层滚动槽 */
  167. ::-webkit-scrollbar-track-piece {
  168. background-color: transparent;
  169. }
  170. /* 边角 */
  171. ::-webkit-scrollbar-corner,
  172. .el-input::-webkit-scrollbar-corner {
  173. background-color: @m-blue35;
  174. }
  175. </style>