|
|
@@ -0,0 +1,148 @@
|
|
|
+<template>
|
|
|
+ <!--新增履约模板-->
|
|
|
+ <Drawer :title="'新增履约模板'"
|
|
|
+ :placement="'right'"
|
|
|
+ :visible="visible"
|
|
|
+ @cancel="cancel"
|
|
|
+ class="top486">
|
|
|
+ <a-spin :spinning="loading">
|
|
|
+ <div class="listed">
|
|
|
+ <a-form class="inlineForm dialogForm">
|
|
|
+ <a-input-search placeholder="搜索朋友编码或名称"
|
|
|
+ class="searchFriendInput noSuffixInput"
|
|
|
+ enter-button
|
|
|
+ v-model:value="searchValue"
|
|
|
+ @search="handleSearch">
|
|
|
+ <template #prefix>
|
|
|
+ <SearchOutlined />
|
|
|
+ </template>
|
|
|
+ </a-input-search>
|
|
|
+ <div class="formBar">
|
|
|
+ <!-- <a-checkbox-group class="commonCheckboxGroup"> -->
|
|
|
+ <div class="item"
|
|
|
+ v-for="(item, index) in getViewFriends()"
|
|
|
+ :key="index + '11'">
|
|
|
+ <a-checkbox v-model:checked="item.checked">
|
|
|
+ <span>{{item.frienduserid}} {{ item.friendname }}</span>
|
|
|
+ </a-checkbox>
|
|
|
+ </div>
|
|
|
+ <!-- </a-checkbox-group> -->
|
|
|
+ </div>
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-col :span="24"
|
|
|
+ class="fixedBtns">
|
|
|
+ <a-form-item class="btnCenter">
|
|
|
+ <a-button class="listedBtn"
|
|
|
+ @click="submit">确定</a-button>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+ </a-spin>
|
|
|
+ </Drawer>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts">
|
|
|
+import { defineComponent, PropType, ref } from 'vue';
|
|
|
+import { Des } from '@/common/components/commonDes';
|
|
|
+import { _closeModal } from '@/common/setup/modal/modal';
|
|
|
+import Drawer from '@/common/components/drawer/index.vue';
|
|
|
+import { PlusOutlined, MinusOutlined, SearchOutlined } from '@ant-design/icons-vue';
|
|
|
+import { QueryWrFriendApplyRsp } from '@/services/go/wrtrade/interface';
|
|
|
+import { TempWrOrderQuoteDetail } from '@/views/market/spot_trade/components/post_buying/interface';
|
|
|
+import { queryQueryWrFriend } from '@/services/go/wrtrade';
|
|
|
+import { message } from 'ant-design-vue';
|
|
|
+
|
|
|
+interface FriendList extends QueryWrFriendApplyRsp {
|
|
|
+ checked: boolean;
|
|
|
+}
|
|
|
+
|
|
|
+export default defineComponent({
|
|
|
+ emits: ['cancel', 'update'],
|
|
|
+ name: 'warehouse_receipt_trade_blocs_delisting',
|
|
|
+ components: { Des, Drawer, PlusOutlined, MinusOutlined, SearchOutlined },
|
|
|
+ setup(props, context) {
|
|
|
+ const { visible, cancel } = _closeModal(context);
|
|
|
+ const loading = ref<boolean>(false);
|
|
|
+ const searchValue = ref<string>('');
|
|
|
+ const myFriends = ref<FriendList[]>([]);
|
|
|
+ // 查询好友列表
|
|
|
+ function queryMyFriend(value?: string) {
|
|
|
+ loading.value = true;
|
|
|
+ queryQueryWrFriend(value)
|
|
|
+ .then((res) => {
|
|
|
+ if (res) {
|
|
|
+ myFriends.value = [];
|
|
|
+ res.forEach((el) => {
|
|
|
+ myFriends.value.push({ ...el, checked: false });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err: string) => message.error(err))
|
|
|
+ .finally(() => {
|
|
|
+ loading.value = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ queryMyFriend();
|
|
|
+ function getViewFriends() {
|
|
|
+ if (searchValue.value) {
|
|
|
+ return myFriends.value.filter((el) => String(el.frienduserid).includes(searchValue.value));
|
|
|
+ } else {
|
|
|
+ return myFriends.value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ function submit() {
|
|
|
+ const result: string[] = [];
|
|
|
+ myFriends.value.forEach((el) => {
|
|
|
+ if (el.checked) {
|
|
|
+ result.push(el.frienduserid);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (result.length) {
|
|
|
+ context.emit('update', result);
|
|
|
+ } else {
|
|
|
+ message.warn('请选择朋友');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ function handleSearch(value: string) {
|
|
|
+ // const findResult = myFriends.value.find((e) => String(e.frienduserid).includes(value));
|
|
|
+ // if (findResult) {
|
|
|
+ // searchFriend.value = [findResult];
|
|
|
+ // } else {
|
|
|
+ // queryMyFriend(value);
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ loading,
|
|
|
+ myFriends,
|
|
|
+ cancel,
|
|
|
+ visible,
|
|
|
+ submit,
|
|
|
+ searchValue,
|
|
|
+ getViewFriends,
|
|
|
+ };
|
|
|
+ },
|
|
|
+});
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.listed {
|
|
|
+ padding: 18px 20px 0;
|
|
|
+ .formBar {
|
|
|
+ height: calc(100% - 120px);
|
|
|
+ padding: 0 20px 0 13px;
|
|
|
+ margin-top: 16px;
|
|
|
+ background: #08131f;
|
|
|
+ border: 1px solid #10202f;
|
|
|
+ .item {
|
|
|
+ width: 100%;
|
|
|
+ height: 50px;
|
|
|
+ line-height: 50px;
|
|
|
+ border-bottom: 1px solid #10202f;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|