li.shaoyi 2 anos atrás
pai
commit
988a6bdd9b

+ 1 - 1
src/hooks/request/index.ts

@@ -80,7 +80,7 @@ export function useRequest<TParams extends object, TResponse>(fetcher: (params:
     }
 
     const cancel = () => {
-        console.warn('取消请求')
+        //console.warn('取消请求')
     }
 
     if (!manual) {

+ 2 - 0
src/packages/pc/components/base/drawer/index.less

@@ -1,4 +1,6 @@
 .app-drawer {
+    --el-mask-color: rgba(0, 0, 0, .25);
+
     &__wrapper {
         display: flex;
         flex-direction: column;

+ 2 - 0
src/packages/pc/components/base/table/index.less

@@ -1,4 +1,6 @@
 .app-table {
+    --el-mask-color: rgba(0, 0, 0, .25);
+
     display: flex;
     flex-direction: column;
     height: 100%;

+ 1 - 1
src/packages/pc/components/base/table/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="app-table" v-loading="loading" element-loading-background="rgba(0, 0, 0, .5)">
+  <div class="app-table" v-loading="loading">
     <div class="app-table__header">
       <div class="block block--left" v-if="$slots.header">
         <slot name="header"></slot>

+ 14 - 3
src/packages/pc/components/modules/listing/index.vue

@@ -5,8 +5,7 @@
         </div>
         <div class="app-listing__form">
             <h4 class="block-title">订单挂牌</h4>
-            <el-form ref="formRef" size="small" label-width="50px" label-position="left" :model="formData"
-                :rules="formRules">
+            <el-form ref="formRef" size="small" label-width="50px" :model="formData" :rules="formRules">
                 <el-form-item prop="GoodsID" label="商品">
                     <el-select placeholder="请选择" v-model="goodsStore.goodsId">
                         <el-option :label="item.goodsname" :value="item.goodsid"
@@ -26,6 +25,7 @@
                 </el-form-item>
                 <el-form-item prop="OrderQty" label="数量">
                     <el-input-number placeholder="请输入" :min="agreeunit" :step="qtyStep" v-model="orderQty" />
+                    <span>{{ getGoodsUnitName(quote?.goodunitid) }}</span>
                     <el-radio-group v-model="qtyStep" @change="onRadioChange">
                         <el-radio-button v-for="(value, index) in qtyStepList" :key="index" :label="value" />
                     </el-radio-group>
@@ -60,6 +60,7 @@ import { shallowRef, computed, watch } from 'vue'
 import { ElMessage, ElMessageBox, FormInstance, FormRules } from 'element-plus'
 import { EPriceMode, EListingSelectType, EDelistingType, EBuildType, EValidType, EOrderOperateType } from '@/constants/client'
 import { BuyOrSell, getBuyOrSellList } from '@/constants/order'
+import { getGoodsUnitName } from '@/constants/unit'
 import { useRequest } from '@/hooks/request'
 import { queryTradePosition } from '@/services/api/order'
 import { useOrder } from '@/business/trade'
@@ -124,7 +125,17 @@ const sellQty = computed(() => {
 })
 
 const formRules: FormRules = {
-    OrderPrice: [{ required: true, message: '请输入价格' }],
+    OrderPrice: [{
+        required: true,
+        type: 'number',
+        validator: (rule, value, callback) => {
+            if (value) {
+                callback()
+            } else {
+                callback(new Error('请输入价格'))
+            }
+        }
+    }],
     OrderQty: [{
         required: true,
         validator: (rule, value, callback) => {

+ 22 - 0
src/packages/pc/components/modules/performance-rule/index.less

@@ -0,0 +1,22 @@
+.app-performance-rule {
+    display: flex;
+
+    &:empty {
+        display: none;
+    }
+
+    .block {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+
+        &:not(:first-child) {
+            margin-left: 10px;
+        }
+
+        &-label {
+            font-size: 12px;
+            margin-top: 4px;
+        }
+    }
+}

+ 23 - 0
src/packages/pc/components/modules/performance-rule/index.vue

@@ -0,0 +1,23 @@
+<template>
+    <div class="app-performance-rule">
+        <div class="block" v-for="(step, j) in item.LstStep" :key="j">
+            <el-tag :type="j % 2 ? 'warning' : ''" disable-transitions>{{ step.steptypename }}</el-tag>
+            <span class="block-label">{{ step.stepdate }}</span>
+        </div>
+    </div>
+</template>
+
+<script lang="ts" setup>
+import { PropType } from 'vue'
+
+defineProps({
+    item: {
+        type: Object as PropType<Model.PermancePlanTmpRsp>,
+        required: true
+    }
+})
+</script>
+
+<style lang="less">
+@import './index.less';
+</style>

+ 19 - 0
src/packages/pc/components/modules/performance/index.less

@@ -0,0 +1,19 @@
+.app-performance {
+    &-item {
+        height: auto;
+        padding: 10px;
+        line-height: 1;
+
+        &:not(:first-child) {
+            border-top: 1px solid #efefef;
+        }
+
+        &__title {
+            margin-bottom: 8px;
+        }
+
+        &.selected &__title {
+            font-weight: bold;
+        }
+    }
+}

+ 50 - 0
src/packages/pc/components/modules/performance/index.vue

@@ -0,0 +1,50 @@
+<template>
+    <el-select popper-class="app-performance" value-key="autoid" :placeholder="placeholder" v-model="data"
+        @change="onChange" clearable>
+        <el-option class="app-performance-item" v-for="(item, i) in dataList" :key="i" :label="item.templatename"
+            :value="item">
+            <h4 class="app-performance-item__title">{{ item.templatename }}</h4>
+            <app-performance-rule :item="item" />
+        </el-option>
+    </el-select>
+</template>
+
+<script lang="ts" setup>
+import { useRequest } from '@/hooks/request'
+import { queryPermancePlanTmp } from '@/services/api/performance'
+import AppPerformanceRule from '../performance-rule/index.vue'
+
+const props = defineProps({
+    modelValue: Number,
+    marketId: Number,
+    placeholder: {
+        type: String,
+        default: '请选择'
+    }
+})
+
+const emit = defineEmits(['update:modelValue'])
+
+const { data, dataList } = useRequest(queryPermancePlanTmp, {
+    params: {
+        marketid: props.marketId
+    },
+    onSuccess: (res) => {
+        data.value = res.data.find((e) => e.autoid === props.modelValue)
+    },
+    onFinally: () => {
+        if (!data.value) {
+            // 履约模板不存在时清空
+            emit('update:modelValue')
+        }
+    }
+})
+
+const onChange = (item: Model.PermancePlanTmpRsp) => {
+    emit('update:modelValue', item.autoid)
+}
+</script>
+
+<style lang="less">
+@import './index.less';
+</style>

+ 5 - 2
src/packages/pc/views/market/trade/goods/index.vue

@@ -1,7 +1,8 @@
 <!-- 交易市场-订单交易 -->
 <template>
     <app-table :data="tableList" v-model:columns="tableColumns" :loading="loading" @row-click="onRowClick" showIndex />
-    <component ref="componentRef" :is="Detail" v-bind="{ goodsId }" @closed="closeComponent" v-if="componentId" />
+    <component ref="componentRef" v-bind="{ goodsId }" :is="componentMap.get(componentId)" @closed="closeComponent"
+        v-if="componentId" />
 </template>
 
 <script lang="ts" setup>
@@ -12,7 +13,9 @@ import { useFuturesStore, useGoodsStore } from '@/stores'
 import quoteSocket from '@/services/websocket/quote'
 import AppTable from '@pc/components/base/table/index.vue'
 
-const Detail = defineAsyncComponent(() => import('./detail/index.vue')) // 详情
+const componentMap = new Map<string, unknown>([
+    ['detail', defineAsyncComponent(() => import('./detail/index.vue'))], // 详情
+])
 
 const futuresStore = useFuturesStore()
 const goodsStore = useGoodsStore()

+ 12 - 2
src/packages/pc/views/market/trade/spot/index.vue

@@ -5,17 +5,26 @@
             <app-filter :options="filterOptons" :loading="loading" />
         </template>
     </app-table>
+    <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)" @closed="closeComponent"
+        v-if="componentId" />
 </template>
 
 <script lang="ts" setup>
-import { shallowRef } from 'vue'
+import { shallowRef, defineAsyncComponent } from 'vue'
+import { useComponent } from '@/hooks/component'
 import { useDataFilter } from '@/hooks/datatable'
 import { useRequest } from '@/hooks/request'
 import { queryOrderQuote } from '@/services/api/goods'
 import AppTable from '@pc/components/base/table/index.vue'
 import AppFilter from '@pc/components/base/table-filter/index.vue'
 
+const componentMap = new Map<string, unknown>([
+    ['order', defineAsyncComponent(() => import('./order/index.vue'))], // 买卖大厅
+])
+
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => run(), false)
 const { filterOptons, getQueryParams } = useDataFilter<Model.OrderQuoteReq>()
+const selectedRow = shallowRef<Model.OrderQuoteRsp>()
 
 const { dataList, loading, run } = useRequest(queryOrderQuote, {
     params: {
@@ -53,6 +62,7 @@ const onSearch = (clear = false) => {
 }
 
 const onRowClick = (row: Model.OrderQuoteRsp) => {
-    console.log(row)
+    selectedRow.value = row
+    openComponent('order')
 }
 </script>

+ 128 - 0
src/packages/pc/views/market/trade/spot/order/delisting/index.vue

@@ -0,0 +1,128 @@
+<!-- 交易市场-仓单交易-买卖大厅-摘牌 -->
+<template>
+    <app-drawer title="摘牌" v-model:show="show" :loading="loading" :refresh="refresh">
+        <el-form ref="formRef" class="el-form--vertical" label-width="100px" label-position="left" :model="formData"
+            :rules="formRules">
+            <el-form-item label="挂牌方">
+                <span>{{ quoteDetail.username }}</span>
+            </el-form-item>
+            <el-form-item label="挂牌价格">
+                <span>{{ quoteDetail.fixedprice }}</span>
+            </el-form-item>
+            <el-form-item label="剩余数量">
+                <span>{{ quoteDetail.orderqty + quoteDetail.enumdicname }}</span>
+            </el-form-item>
+            <el-form-item label="可用数量" v-if="quoteDetail.buyorsell === BuyOrSell.Buy">
+                <span>{{ holdLB?.enableqty ?? 0 }}</span>
+            </el-form-item>
+            <el-form-item prop="OrderQty" label="摘牌数量">
+                <el-input-number placeholder="请输入" :min="0" :precision="0" v-model="formData.OrderQty" />
+                <span>{{ quoteDetail.enumdicname }}</span>
+            </el-form-item>
+            <el-form-item label="货款金额">
+                <span>{{ amount }}</span>
+            </el-form-item>
+            <el-form-item label="可用资金">
+                <span>{{ accountStore.avaiableMoney.toFixed(2) }}</span>
+            </el-form-item>
+        </el-form>
+        <template #footer>
+            <el-button type="primary" @click="onSubmit">提交</el-button>
+            <el-button @click="onCancel(false)" plain>取消</el-button>
+        </template>
+    </app-drawer>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType, computed } from 'vue'
+import { ElMessage, FormInstance, FormRules } from 'element-plus'
+import { BuyOrSell } from '@/constants/order'
+import { useRequest } from '@/hooks/request'
+import { queryHoldLB } from '@/services/api/order'
+import { useHdWRDealOrder } from '@/business/trade'
+import { useAccountStore } from '@/stores'
+import AppDrawer from '@pc/components/base/drawer/index.vue'
+
+const props = defineProps({
+    quoteItem: {
+        type: Object as PropType<Model.OrderQuoteRsp>,
+        required: true
+    },
+    quoteDetail: {
+        type: Object as PropType<Model.OrderQuoteDetailRsp>,
+        required: true
+    }
+})
+
+const { formData, formSubmit, loading } = useHdWRDealOrder()
+const accountStore = useAccountStore()
+const show = shallowRef(true)
+const refresh = shallowRef(false)
+const formRef = shallowRef<FormInstance>()
+
+// 持仓记录
+const { data: holdLB } = useRequest(queryHoldLB, {
+    params: {
+        wrfactortypeid: props.quoteItem.wrfactortypeid
+    },
+    onSuccess: (res) => {
+        holdLB.value = res.data[0]
+    }
+})
+
+// 货款金额
+const amount = computed(() => {
+    const { OrderQty = 0 } = formData
+    const { fixedprice = 0 } = props.quoteDetail
+    return (OrderQty * fixedprice).toFixed(2)
+})
+
+const formRules: FormRules = {
+    OrderQty: [{
+        required: true,
+        type: 'number',
+        validator: (rule, value, callback) => {
+            if (value) {
+                callback()
+            } else {
+                callback(new Error('请输入摘牌数量'))
+            }
+        }
+    }],
+}
+
+const onCancel = (isRefresh = false) => {
+    show.value = false
+    refresh.value = isRefresh
+}
+
+const onSubmit = () => {
+    formRef.value?.validate((valid) => {
+        if (valid) {
+            const { wrfactortypeid = '0' } = props.quoteItem ?? {}
+            const { wrtradeorderid = '0', marketid, buyorsell } = props.quoteDetail ?? {}
+
+            formData.Header = {
+                MarketID: marketid
+            }
+            formData.BuyOrSell = buyorsell === BuyOrSell.Buy ? BuyOrSell.Sell : BuyOrSell.Buy
+            formData.RelatedWRTradeOrderID = wrtradeorderid
+            formData.WRFactorTypeId = wrfactortypeid
+
+            if (formData.BuyOrSell === BuyOrSell.Sell) {
+                const { subnum, ladingbillid = '0', wrfactortypeid = '0' } = holdLB.value ?? {}
+                formData.LadingBillId = ladingbillid
+                formData.SubNum = subnum
+                formData.WRFactorTypeId = wrfactortypeid
+            }
+
+            formSubmit().then(() => {
+                ElMessage.success('提交成功')
+                onCancel(true)
+            }).catch((err) => {
+                ElMessage.error('提交失败:' + err)
+            })
+        }
+    })
+}
+</script>

+ 8 - 0
src/packages/pc/views/market/trade/spot/order/index.less

@@ -0,0 +1,8 @@
+.market-trade-goods-detail-order {
+    display: flex;
+    height: 100%;
+
+    .app-table {
+        flex: 1;
+    }
+}

+ 123 - 0
src/packages/pc/views/market/trade/spot/order/index.vue

@@ -0,0 +1,123 @@
+<!-- 交易市场-仓单交易-买卖大厅 -->
+<template>
+    <teleport to="#appPageTeleport">
+        <app-view class="g-view-detail">
+            <template #header>
+                <div class="g-view-detail__header">
+                    <el-button type="primary" icon="ArrowLeftBold" @click="emit('closed')" link />
+                    <div class="btnbar">
+                        <el-button type="primary" @click="openComponent('listing')">挂牌求购</el-button>
+                    </div>
+                </div>
+            </template>
+            <div class="market-trade-spot-order" style="display: flex;height: 100%;">
+                <app-table class="sell" :data="sellList" v-model:columns="sellColumns" :row-key="rowKey"
+                    :expand-row-keys="expandKeys" @row-click="rowClick" showIndex>
+                    <!-- 展开行 -->
+                    <template #expand="{ row }">
+                        <div class="buttonbar">
+                            <el-button type="primary" size="small" :disabled="row.userid === loginStore.userId"
+                                @click="openComponent('delisting')">摘牌</el-button>
+                        </div>
+                    </template>
+                </app-table>
+                <app-table class="buy" :data="buyList" v-model:columns="buyColumns" :row-key="rowKey"
+                    :expand-row-keys="expandKeys" @row-click="rowClick" showIndex>
+                    <!-- 展开行 -->
+                    <template #expand="{ row }">
+                        <div class="buttonbar">
+                            <el-button type="primary" size="small" :disabled="row.userid === loginStore.userId"
+                                @click="openComponent('delisting')">摘牌</el-button>
+                        </div>
+                    </template>
+                </app-table>
+                <component ref="componentRef" v-bind="{ quoteItem, quoteDetail }" :is="componentMap.get(componentId)"
+                    @closed="closeComponent" v-if="componentId" />
+            </div>
+        </app-view>
+    </teleport>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, defineAsyncComponent, onUnmounted, PropType } from 'vue'
+import { useRequest } from '@/hooks/request'
+import { BuyOrSell } from '@/constants/order'
+import { useComponent } from '@/hooks/component'
+import { useComposeTable } from '@pc/components/base/table'
+import { queryOrderQuote, queryOrderQuoteDetail } from '@/services/api/goods'
+import { useLoginStore } from '@/stores'
+import eventBus from '@/services/bus'
+import AppTable from '@pc/components/base/table/index.vue'
+
+const props = defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.OrderQuoteRsp>,
+        required: true
+    },
+})
+
+const emit = defineEmits(['closed'])
+
+const componentMap = new Map<string, unknown>([
+    ['listing', defineAsyncComponent(() => import('./listing/index.vue'))], // 挂牌
+    ['delisting', defineAsyncComponent(() => import('./delisting/index.vue'))], // 摘牌
+])
+
+const loginStore = useLoginStore()
+const { rowKey, expandKeys, selectedRow: quoteDetail, rowClick } = useComposeTable<Model.OrderQuoteDetailRsp>({ rowKey: 'wrtradeorderid' })
+const { componentRef, componentId, openComponent, closeComponent } = useComponent()
+
+const { data: quoteItem, run: getOrderQuote } = useRequest(queryOrderQuote, {
+    params: {
+        wrpricetype: 1,
+        wrfactortypeid: props.selectedRow.wrfactortypeid
+    },
+    onSuccess: (res) => {
+        quoteItem.value = res.data[0]
+    }
+})
+
+// 买大厅列表
+const { dataList: buyList, run: getBuyList } = useRequest(queryOrderQuoteDetail, {
+    params: {
+        wrpricetype: 1,
+        haswr: 1,
+        wrfactortypeid: props.selectedRow.wrfactortypeid,
+        buyorsell: BuyOrSell.Buy
+    },
+})
+
+// 卖大厅列表
+const { dataList: sellList, run: getSellList } = useRequest(queryOrderQuoteDetail, {
+    params: {
+        wrpricetype: 1,
+        haswr: 1,
+        wrfactortypeid: props.selectedRow.wrfactortypeid,
+        buyorsell: BuyOrSell.Sell
+    },
+})
+
+const buyColumns = shallowRef<Model.TableColumn[]>([
+    { prop: 'username', label: '销售方' },
+    { prop: 'orderqty', label: '卖量' },
+    { prop: 'fixedprice', label: '卖价' },
+])
+
+const sellColumns = shallowRef<Model.TableColumn[]>([
+    { prop: 'fixedprice', label: '买价' },
+    { prop: 'orderqty', label: '买量' },
+    { prop: 'username', label: '购买方' },
+])
+
+// 挂牌委托变更广播通知
+const listingOrderChangeNtf = eventBus.$on('ListingOrderChangeNtf', () => {
+    getOrderQuote()
+    getBuyList()
+    getSellList()
+})
+
+onUnmounted(() => listingOrderChangeNtf.cancel())
+</script>
+<style lang="less">
+@import './index.less';
+</style>

+ 138 - 0
src/packages/pc/views/market/trade/spot/order/listing/index.vue

@@ -0,0 +1,138 @@
+<!-- 交易市场-仓单交易-买卖大厅-挂牌 -->
+<template>
+    <app-drawer title="挂牌" v-model:show="show" :loading="loading" :refresh="refresh">
+        <el-form ref="formRef" class="el-form--vertical" label-width="100px" label-position="left" :model="formData"
+            :rules="formRules">
+            <el-form-item prop="PerformanceTemplateID" label="履约方式">
+                <Performance :market-id="17201" v-model="formData.PerformanceTemplateID" />
+            </el-form-item>
+            <el-form-item prop="FixedPrice" label="挂牌价格">
+                <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.FixedPrice" />
+            </el-form-item>
+            <el-form-item label="可用数量" v-if="buyOrSell === BuyOrSell.Sell">
+                <span>{{ holdLB?.enableqty ?? 0 }}</span>
+            </el-form-item>
+            <el-form-item prop="OrderQty" label="挂牌数量">
+                <el-input-number placeholder="请输入" :min="0" :precision="0" v-model="formData.OrderQty" />
+            </el-form-item>
+            <el-form-item label="货款金额">
+                <span>{{ amount }}</span>
+            </el-form-item>
+            <el-form-item label="可用资金">
+                <span>{{ accountStore.avaiableMoney.toFixed(2) }}</span>
+            </el-form-item>
+        </el-form>
+        <template #footer>
+            <el-button type="primary" @click="onSubmit">提交</el-button>
+            <el-button @click="onCancel(false)" plain>取消</el-button>
+        </template>
+    </app-drawer>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType } from 'vue'
+import { ElMessage, FormInstance, FormRules } from 'element-plus'
+import { BuyOrSell } from '@/constants/order'
+import { useRequest } from '@/hooks/request'
+import { queryHoldLB } from '@/services/api/order'
+import { useHdWROrder } from '@/business/trade'
+import { useAccountStore } from '@/stores'
+import AppDrawer from '@pc/components/base/drawer/index.vue'
+import Performance from '@pc/components/modules/performance/index.vue'
+
+const props = defineProps({
+    quoteItem: {
+        type: Object as PropType<Model.OrderQuoteRsp>,
+        required: true
+    },
+    buyOrSell: {
+        type: Number,
+        default: BuyOrSell.Buy
+    }
+})
+
+const { formData, listingSubmit, loading, amount } = useHdWROrder()
+const accountStore = useAccountStore()
+const show = shallowRef(true)
+const refresh = shallowRef(false)
+const formRef = shallowRef<FormInstance>()
+
+// 持仓记录
+const { data: holdLB } = useRequest(queryHoldLB, {
+    params: {
+        wrfactortypeid: props.quoteItem.wrfactortypeid
+    },
+    onSuccess: (res) => {
+        holdLB.value = res.data[0]
+    }
+})
+
+const formRules: FormRules = {
+    PerformanceTemplateID: [{
+        required: true,
+        type: 'number',
+        message: '请选择履约方式'
+    }],
+    FixedPrice: [{
+        required: true,
+        type: 'number',
+        validator: (rule, value, callback) => {
+            if (value) {
+                callback()
+            } else {
+                callback(new Error('请输入价格'))
+            }
+        }
+    }],
+    OrderQty: [{
+        required: true,
+        type: 'number',
+        validator: (rule, value, callback) => {
+            if (value) {
+                const { enableqty = 0 } = holdLB.value ?? {}
+                if (props.buyOrSell === BuyOrSell.Buy || value <= enableqty) {
+                    callback()
+                } else {
+                    callback(new Error('可用数量不足'))
+                }
+            } else {
+                callback(new Error('请输入挂牌数量'))
+            }
+        }
+    }],
+}
+
+const onCancel = (isRefresh = false) => {
+    show.value = false
+    refresh.value = isRefresh
+}
+
+const onSubmit = () => {
+    formRef.value?.validate((valid) => {
+        if (valid) {
+            formData.BuyOrSell = props.buyOrSell
+
+            if (formData.BuyOrSell === BuyOrSell.Buy) {
+                const { wrstandardid, deliverygoodsid, wrfactortypeid = '0' } = props.quoteItem ?? {}
+                formData.WRStandardID = wrstandardid
+                formData.DeliveryGoodsID = deliverygoodsid
+                formData.WRFactorTypeId = wrfactortypeid
+            } else {
+                const { wrstandardid, subnum, deliverygoodsid, ladingbillid = '0', wrfactortypeid = '0' } = holdLB.value ?? {}
+                formData.WRStandardID = wrstandardid
+                formData.DeliveryGoodsID = deliverygoodsid
+                formData.LadingBillId = ladingbillid
+                formData.WRFactorTypeId = wrfactortypeid
+                formData.SubNum = subnum
+            }
+
+            listingSubmit().then(() => {
+                ElMessage.success('提交成功')
+                onCancel(true)
+            }).catch((err) => {
+                ElMessage.error('提交失败:' + err)
+            })
+        }
+    })
+}
+</script>

+ 1 - 1
src/services/api/performance/index.ts

@@ -32,7 +32,7 @@ export function queryWrPerformancePlanStep(config: RequestConfig<Model.WrPerform
  * 查询履约步骤枚举
  */
 export function queryWrPerformanceStepType(config: RequestConfig<Model.WrPerformanceStepTypeReq> = {}) {
-    return http.commonRequest<Model.WrPerformanceStepType[]>({
+    return http.commonRequest<Model.WrPerformanceStepTypeRsp[]>({
         url: '/WrTrade2/QueryWrPerformanceStepType',
         params: config.data,
     })

+ 2 - 0
src/stores/storage.ts

@@ -17,6 +17,8 @@ function createSessionData() {
         userRoutes: <Model.UserRoutes[]>[],
         allEnums: <Model.EnumRsp[]>[], // 枚举信息
         errorInfos: <Model.ErrorInfosRsp[]>[], // 错误信息
+        performanceStepTypes: <Model.WrPerformanceStepTypeRsp[]>[], // 履约步骤枚举
+        performanceTemplates: <Model.PermancePlanTmpRsp[]>[], // 履约模板
     }
 }
 

+ 31 - 51
src/types/model/performance.d.ts

@@ -137,62 +137,42 @@ declare namespace Model {
 
     /** 查询履约模板 请求 */
     interface PermancePlanTmpReq {
-        /// 用户id
-        userid?: number
-        /// 模板类型(逗号隔开), 0:通用 1:交割 2:仓单贸易 3:预售集采 7:竞拍-竞价式 8:竞拍-大宗式 9:荷兰式–失效枚举:4:竞拍-降价式 (无仓单) 5:挂牌期权 6:竞拍-降价式
-        tmptype?: number
-        /// 是否包含公共模板(用户id为空的) 1-包含
-        includepub?: number
-        /// 市场id(天津麦顿指定此参数,其它不用)
-        marketid?: number
+        userid?: number; // 用户id
+        tmptype?: string; // 模板类型(逗号隔开), 0:通用 1:交割 2:仓单贸易 3:预售集采 7:竞拍-竞价式 8:竞拍-大宗式 9:荷兰式–失效枚举:4:竞拍-降价式 (无仓单) 5:挂牌期权 6:竞拍-降价式
+        includepub?: number; // 是否包含公共模板(用户id为空的) 1-包含
+        marketid?: number; // 市场id(天津麦顿指定此参数,其它不用)
     }
 
     /** 查询履约模板 回应 */
     interface PermancePlanTmpRsp {
-        /// AutoID 模板id
-        autoid: number
-        /// 创建时间
-        createtime: string
-        /// 创建人
-        creatorid: number
-        /// 步骤信息列表
-        lstStep: [ListStep] 
-        /// 支付方式 - 1:冻结 2:扣款
-        paymenttype: number
-        /// 提货方式 - 1:无 2:买方自提 3:卖方发货
-        takemode: number
-        /// 模板名称
-        templatename: string
-        /// 模板类型 - 0:通用 1:交割 2:仓单贸易 3:预售集采 7:竞拍-竞价式 8:竞拍-大宗式 9:荷兰式–失效枚举:4:竞拍-降价式 (无仓单) 5:挂牌期权 6:竞拍-降价式
-        templatetype: number
-        /// 所属用户
-        userid: number
+        autoid: number;//AutoID 模板id
+        createtime: string;//创建时间
+        creatorid: number;//创建人
+        paymenttype: number;//支付方式 - 1:冻结 2:扣款
+        takemode: number;//提货方式 - 1:无 2:买方自提 3:卖方发货
+        templatename: string;//模板名称
+        templatetype: number;//模板类型 - number;
+        LstStep: PerformanceStep[],// 步骤信息列表
+        //:通用 1:交割 2:仓单贸易 3:预售集采 7:竞拍-竞价式 8:竞拍-大宗式 9:荷兰式–失效枚举:4:竞拍-降价式 (无仓单) 5:挂牌期权 6:竞拍-降价式
+        userid: number;//所属用户
     }
 
-    /// 步骤信息列表
-    interface ListStep {
-        /// AutoID
-        autoid: number
-        /// 是否自动 - 0:不自动 1:自动
-        isauto: number
-        /// 备注
-        remark: string
-        /// 天数信息(T+N)
-        stepdate: string
-        /// 距离上一步天数
-        stepdays: number
-        /// 步骤序号
-        stepindex: number
-        /// 步骤信息(步骤名称+步骤值)
-        stepinfo: string
-        /// 履约步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移 9:释放卖方冻结 10:货款溢短 11:生成合同[中江] 12:运费 90:确认支付 91. 确认放行 92买方支付(直接扣款) 用于-1模板“
-        steptypeid: number
-        /// 步骤名称
-        steptypename: string
-        /// 步骤值
-        stepvalue: number
-        /// 履约计划模板ID
-        templateid: number
+    /** 履约模板步骤 */
+    interface PerformanceStep {
+        autoid: number;//AutoID
+        isauto: number;//是否自动 - number;
+        //:不自动 1:自动
+        remark: string;//备注
+        stepdate: string;//天数信息(T+N)
+        stepdays: number;//距离上一步天数
+        stepindex: number;//步骤序号
+        stepinfo: string;//步骤信息(步骤名称+步骤值)
+        steptypeid: number;//履约步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移 9:释放卖方冻结 1number;
+        //:货款溢短 11:生成合同[中江] 12:运费 9number;
+        //:确认支付 91. 确认放行 92买方支付(直接扣款) 用于-1模板“
+        steptypename: string;//步骤名称
+        stepvalue: number;//步骤值
+        templateid: number;//履约计划模板ID
     }
 
     /// 查询履约步骤枚举
@@ -202,7 +182,7 @@ declare namespace Model {
     }
 
     /// 查询履约步骤枚举
-    interface WrPerformanceStepType {
+    interface WrPerformanceStepTypeRsp {
         /// 能否自动确认 - 0:不可自动确认 1:可自动确认 (可设置自动确认步骤: 1:买方支付 3:买方自提 5:买方确认货 7:买方确认票)
         canauto: number
         /// 步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移