Handy_Cao %!s(int64=2) %!d(string=hai) anos
pai
achega
69c0ed2fc9

+ 16 - 14
src/business/performance/index.ts

@@ -1,4 +1,5 @@
 import { ref, shallowRef } from 'vue'
+import { useLoginStore, useAccountStore } from '@/stores'
 import {
     performanceContractedApply,
     performanceManualConfirm,
@@ -6,15 +7,17 @@ import {
     performanceDelayApply
 } from '@/services/api/performance'
 
+const loginStore = useLoginStore()
+const accountStore = useAccountStore()
 
 // 违约申请请求
-export function usePerformanceContractedApply() {
+export function usePerformanceContractedApply(buyaccountid: number) {
     const loading = shallowRef(false)
 
     const formData = ref<Partial<Proto.PerformanceContractedApplyReq>>({
-        
+        BreachType
     })
-
+    : buyaccountid === accountStore.accountId ? 2 : 1
     const formSubmit = async () => {
         try {
             loading.value = true
@@ -36,19 +39,20 @@ export function usePerformanceContractedApply() {
 }
 
 // 履约手动确认请求
-export function usePerformanceManualConfirm() {
+export function usePerformanceManualConfirm(buyaccountid: number) {
     const loading = shallowRef(false)
 
-    const formData = ref<Partial<Proto.PerformanceManualConfirmReq>>({
-        
+    const confirmFormData = ref<Partial<Proto.PerformanceManualConfirmReq>>({
+        /// 执行方
+        PerformanceExecuteSide: buyaccountid === accountStore.accountId ? 1 : 2
     })
 
-    const formSubmit = async () => {
+    const confirmSubmit = async () => {
         try {
             loading.value = true
             return await performanceManualConfirm({
                 data: {
-                    ...formData.value,
+                    ...confirmFormData.value,
                 }
             })
         } finally {
@@ -58,8 +62,8 @@ export function usePerformanceManualConfirm() {
 
     return {
         loading,
-        formData,
-        formSubmit,
+        confirmFormData,
+        confirmSubmit,
     }
 }
 
@@ -67,9 +71,7 @@ export function usePerformanceManualConfirm() {
 export function usePerformanceModifyContact() {
     const loading = shallowRef(false)
 
-    const formData = ref<Partial<Proto.PerformanceModifyContactReq>>({
-        
-    })
+    const formData = ref<Partial<Proto.PerformanceModifyContactReq>>({ })
 
     const formSubmit = async () => {
         try {
@@ -96,7 +98,7 @@ export function usePerformanceDelayApply() {
     const loading = shallowRef(false)
 
     const formData = ref<Partial<Proto.PerformanceDelayApplyReq>>({
-        
+        applicant: loginStore.userId
     })
 
     const formSubmit = async () => {

+ 23 - 1
src/packages/mobile/views/goods/list/Index.vue

@@ -8,6 +8,14 @@
             <template #last="{ row }">
                 <span :class="row.lastColor">{{ row.last }}</span>
             </template>
+             <!-- 买价 -->
+             <template #bid="{ row }">
+                <span :class="row.bidColor">{{ row.bid }}</span>
+            </template>
+            <!-- 卖价 -->
+            <template #ask="{ row }">
+                <span :class="row.askColor">{{ row.ask }}</span>
+            </template>
             <!-- 涨跌 -->
             <template #rise="{ row }">
                 <span :class="row.lastColor">{{ row.rise }}</span>
@@ -64,11 +72,13 @@ const { dataList } = useRequest(queryQuoteGoodsList, {
 const tableList = computed(() => {
     return dataList.value.map((item) => {
         const quote = futuresStore.getQuoteInfo(item.goodscode)
-        const { goodsname, lastColor, openedColor, lowestColor, highestColor, last, presettle, rise, change, amplitude, highest, lowest, opened } = quote.value ?? {}
+        const { goodsname, lastColor, bidColor, askColor, openedColor, lowestColor, highestColor, last, bid, bidvolume, ask, askvolume, presettle, rise, change, amplitude, highest, lowest, opened, limitdown, limitup } = quote.value ?? {}
         return {
             ...item,
             goodsname,
             lastColor,
+            bidColor,
+            askColor,
             openedColor,
             lowestColor,
             highestColor,
@@ -80,6 +90,12 @@ const tableList = computed(() => {
             lowest: handleNumberValue(lowest),
             highest: handleNumberValue(highest),
             amplitude: parsePercent(amplitude),
+            limitdown: handleNumberValue(limitdown),
+            limitup: handleNumberValue(limitup),
+            bid: handleNumberValue(bid),
+            ask: handleNumberValue(ask),
+            bidvolume: handleNumberValue(bidvolume),
+            askvolume: handleNumberValue(askvolume)
         }
     })
 })
@@ -87,6 +103,10 @@ const tableList = computed(() => {
 const columns: Model.TableColumn[] = [
     { prop: 'goodsname', label: '商品/标的' },
     { prop: 'last', label: '当前价' },
+    { prop: 'bid', label: '买价' },
+    { prop: 'bidvolume', label: '买量' },
+    { prop: 'ask', label: '卖价' },
+    { prop: 'askvolume', label: '卖量' },
     { prop: 'rise', label: '涨跌' },
     { prop: 'change', label: '幅度' },
     { prop: 'opened', label: '今开' },
@@ -94,6 +114,8 @@ const columns: Model.TableColumn[] = [
     { prop: 'lowest', label: '最低' },
     { prop: 'highest', label: '最高' },
     { prop: 'amplitude', label: '振幅' },
+    { prop: 'limitup', label: '涨停' },
+    { prop: 'limitdown', label: '跌停' },
 ]
 
 const rowClick = (row: Model.QuoteGoodsListRsp) => {

+ 96 - 0
src/packages/mobile/views/order/performance/components/breach/Index.vue

@@ -0,0 +1,96 @@
+<!-- 我的订单- 我的履约 - 违约申请 -->
+<template>
+    <app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
+        <app-view class="g-form">
+            <template #header>
+                <app-navbar title="违约申请 " @back="closed" />
+            </template>
+            <Form ref="formRef" class="g-form__container" @submit="formSubmit">
+                <CellGroup title="履约信息">
+                    <Cell title="履约单号" :value="selectedRow.performanceplanid" />
+                    <Cell title="当前步骤" :value="selectedRow.curstepname" />
+                    <Field name="ApplyRemark" label="备注" v-model="formData.ApplyRemark" placeholder="请输入银行卡账号"
+                        :rules="formRules.ApplyRemark" />
+                    <Field name="Attachment" label="附件" :rules="formRules.Attachment" is-link>
+                        <template #input>
+                            <Uploader v-model="formData.Attachment" placeholder="请选择开户银行" />
+                        </template>
+                    </Field>
+                </CellGroup>
+            </Form>
+            <template #footer>
+                <Button type="primary" block round @click="contracted">申请违约</Button>
+            </template>
+        </app-view>
+    </app-modal>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType } from 'vue'
+import { CellGroup, Cell, Button,  Form, FormInstance, FieldRule, Uploader } from 'vant'
+import { dialog, fullloading } from '@/utils/vant'
+import { usePerformanceContractedApply } from '@/business/performance'
+
+import AppModal from '@/components/base/modal/index.vue'
+
+const showModal = shallowRef(true)
+// 是否刷新父组件数据
+const refresh = shallowRef(false)
+
+const props = defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.PerformancePlanRsp>,
+        required: true,
+    }
+})
+
+const { formData, formSubmit} = usePerformanceContractedApply(props.selectedRow.buyaccountid)
+const formRef = shallowRef<FormInstance>()
+
+// 表单验证规则
+const formRules: { [key in keyof Proto.PerformanceContractedApplyReq]?: FieldRule[] } = {
+    ApplyRemark: [{
+        message: '请选择银行信息',
+        validator: () => {
+            return !!formData.value.ApplyRemark
+        }
+    }],
+    Attachment:[{
+        message: '请上传附件',
+        validator: () => {
+            return !!formData.value.Attachment
+        }
+    }],
+}
+
+const contracted = () => {
+    dialog({
+        message: '确认要违约申请吗?',
+        showCancelButton: true,
+    }).then(() => {
+        /// PerformancePlanID
+        formData.value.PerformancePlanID = Number(props.selectedRow.performanceplanid)
+        /// loding....
+        fullloading((hideLoading) => {
+            formSubmit().then(() => {
+                hideLoading('违约申请成功')
+                closed(true)
+            }).catch((err) => {
+                hideLoading(err, 'fail')
+            })
+        })
+    })
+}
+
+/// 关闭弹窗
+const closed = (isRefresh = false) => {
+    refresh.value = isRefresh
+    showModal.value = false
+}
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
+
+</script>

+ 127 - 0
src/packages/mobile/views/order/performance/components/detail/Index.vue

@@ -0,0 +1,127 @@
+<!-- 我的订单- 我的履约 - 详情 -->
+<template>
+    <app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
+        <app-view class="g-form" v-model="loading">
+            <template #header>
+                <app-navbar title="履约详情" @back="closed" />
+            </template>
+            <div v-if="props" class="order-detail__container g-form__container">
+                <CellGroup title="履约信息">
+                    <Cell title="类型" :value="selectedRow.typename" />
+                    <Cell title="商品" :value="selectedRow.wrstandardname" />
+                    <Cell title="仓库" :value="selectedRow.warehousename" />
+                    <Cell title="数量" :value="selectedRow.qty" />
+                    <Cell title="履约金额" :value="formatDecimal(selectedRow.amount)" />
+                    <Cell title="买方" :value="selectedRow.buyusername" />
+                    <Cell title="卖方" :value="selectedRow.sellusername" />
+                    <Cell title="买方已付" :value="formatDecimal(selectedRow.buypaidamount)" />
+                    <Cell title="卖方已收" :value="formatDecimal(selectedRow.sellreceivedamount)" />
+                    <Cell title="当前步骤" :value="selectedRow.curstepname" />
+                    <Cell title="步骤到期时间" :value="formatDate(selectedRow.curstepdeadline)" />
+                    <Cell title="开始时间" :value="formatDate(selectedRow.starttime)" />
+                    <Cell title="关联单号" :value="selectedRow.relatedorderid" />
+                    <Cell title="履约单号" :value="selectedRow.performanceplanid" />
+                </CellGroup>
+                <CellGroup title="执行信息">
+                    
+                </CellGroup>
+            </div>
+            <template #footer>
+                <Button type="primary" block round @click="delay">延期申请</Button>
+                <Button type="info" block round @click="confirm">立即执行</Button>
+            </template>
+        </app-view>
+    </app-modal>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType } from 'vue'
+import { CellGroup, Cell, Button } from 'vant'
+import { dialog, fullloading } from '@/utils/vant'
+import { formatDate, formatDecimal } from '@/filters'
+import { usePerformanceDelayApply, usePerformanceManualConfirm } from '@/business/performance'
+import { queryWrPerformancePlanStep } from '@/services/api/performance'
+
+import AppModal from '@/components/base/modal/index.vue'
+import { useRequest } from '@/hooks/request'
+
+const showModal = shallowRef(true)
+// 是否刷新父组件数据
+const refresh = shallowRef(false)
+const { formData, formSubmit} = usePerformanceDelayApply()
+
+const props = defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.PerformancePlanRsp>,
+        required: true,
+    }
+})
+
+const { confirmFormData, confirmSubmit} = usePerformanceManualConfirm(props.selectedRow.buyaccountid)
+const datelist = shallowRef<Model.WrPerformancePlanStep[]>([])
+const error = shallowRef(false)
+
+const { loading } = useRequest(queryWrPerformancePlanStep, {
+    params: {
+        planid: Number(props.selectedRow.performanceplanid)
+    },
+    onSuccess: (res) => {
+        datelist.value.push(...res.data)
+    },
+    onError: () => {
+        error.value = true
+    }
+})
+
+const delay = () => {
+    dialog({
+        message: '确认要延期申请吗?',
+        showCancelButton: true,
+    }).then(() => {
+        /// 市场ID
+        formData.value.PerformancePlanStepID = Number(props.selectedRow.curstepid)
+
+        /// loding....
+        fullloading((hideLoading) => {
+            formSubmit().then(() => {
+                hideLoading('延期申请成功')
+                closed(true)
+            }).catch((err) => {
+                hideLoading(err, 'fail')
+            })
+        })
+    })
+}
+
+const confirm = () => {
+    dialog({
+        message: '确认要立即执行吗?',
+        showCancelButton: true,
+    }).then(() => {
+        /// 市场ID
+        confirmFormData.value.PerformancePlanStepID = Number(props.selectedRow.curstepid)
+
+        /// loding....
+        fullloading((hideLoading) => {
+            confirmSubmit().then(() => {
+                hideLoading('立即执行申请成功')
+                closed(true)
+            }).catch((err) => {
+                hideLoading(err, 'fail')
+            })
+        })
+    })
+}
+
+/// 关闭弹窗
+const closed = (isRefresh = false) => {
+    refresh.value = isRefresh
+    showModal.value = false
+}
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
+
+</script>

+ 82 - 0
src/packages/mobile/views/order/performance/components/modify/Index.vue

@@ -0,0 +1,82 @@
+<!-- 我的订单- 我的履约 - 修改 -->
+<template>
+    <app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
+        <app-view class="g-form">
+            <template #header>
+                <app-navbar title="信息修改" @back="closed" />
+            </template>
+            <Form ref="formRef" class="g-form__container" @submit="formSubmit">
+                <CellGroup title="履约信息">
+                    <Field name="ContactInfo" v-model="formData.ContactInfo" autosize label="联络信息" type="textarea" placeholder="请输入联络信息"/>
+                    <Field name="ReceiveInfo" v-model="formData.ContactInfo" autosize label="联络信息" type="textarea" placeholder="请输入收货地址">
+                        <template #button>
+                            <Button icon="plus" size="small" type="primary" />
+                        </template>
+                    </Field>
+                    <Field name="ReceiptInfo" v-model="formData.ContactInfo" autosize label="发票信息" type="textarea" placeholder="请输入发票信息">
+                        <template #button>
+                            <Button icon="plus" size="small" type="primary"/>
+                        </template>
+                    </Field>
+                </CellGroup>
+            </Form>
+            <template #footer>
+                <Button type="primary" block round @click="contracted">申请违约</Button>
+            </template>
+        </app-view>
+    </app-modal>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType } from 'vue'
+import { CellGroup, Button,  Form, FormInstance } from 'vant'
+import { dialog, fullloading } from '@/utils/vant'
+import { usePerformanceModifyContact } from '@/business/performance'
+
+import AppModal from '@/components/base/modal/index.vue'
+
+const showModal = shallowRef(true)
+// 是否刷新父组件数据
+const refresh = shallowRef(false)
+
+const props = defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.PerformancePlanRsp>,
+        required: true,
+    }
+})
+
+const { formData, formSubmit} = usePerformanceModifyContact()
+const formRef = shallowRef<FormInstance>()
+
+const contracted = () => {
+    dialog({
+        message: '确认要信息修改申请吗?',
+        showCancelButton: true,
+    }).then(() => {
+        /// PerformancePlanID
+        formData.value.PerformancePlanID = Number(props.selectedRow.performanceplanid)
+        /// loding....
+        fullloading((hideLoading) => {
+            formSubmit().then(() => {
+                hideLoading('信息修改申请成功')
+                closed(true)
+            }).catch((err) => {
+                hideLoading(err, 'fail')
+            })
+        })
+    })
+}
+
+/// 关闭弹窗
+const closed = (isRefresh = false) => {
+    refresh.value = isRefresh
+    showModal.value = false
+}
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
+
+</script>

+ 20 - 0
src/services/api/performance/index.ts

@@ -19,6 +19,26 @@ export function queryPerformancePlan(config: RequestConfig<Model.PerformancePlan
 }
 
 /**
+ * 查询履约信息详情
+ */
+export function queryWrPerformancePlanStep(config: RequestConfig<Model.WrPerformancePlanStepReq> = {}) {
+    return http.commonRequest<Model.WrPerformancePlanStep[]>({
+        url: '/WrTrade2/QueryWrPerformancePlanStep',
+        params: config.data,
+    })
+}
+
+/**
+ * 查询履约步骤枚举
+ */
+export function queryWrPerformanceStepType(config: RequestConfig<Model.WrPerformanceStepTypeReq> = {}) {
+    return http.commonRequest<Model.WrPerformanceStepType[]>({
+        url: '/WrTrade2/QueryWrPerformanceStepType',
+        params: config.data,
+    })
+}
+
+/**
  * 查询履约模板
  */
 export function queryPermancePlanTmp(config: RequestConfig<Model.PermancePlanTmpReq> = {}) {

+ 102 - 0
src/types/model/performance.d.ts

@@ -192,4 +192,106 @@ declare namespace Model {
         /// 履约计划模板ID
         templateid: number
     }
+
+    /// 查询履约步骤枚举
+    interface WrPerformanceStepTypeReq {
+        /// 步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移
+        steptypeid?: number
+    }
+
+    /// 查询履约步骤枚举
+    interface WrPerformanceStepType {
+        /// 能否自动确认 - 0:不可自动确认 1:可自动确认 (可设置自动确认步骤: 1:买方支付 3:买方自提 5:买方确认货 7:买方确认票)
+        canauto: number
+        /// 步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移
+        steptypeid: number
+        /// 步骤类型名称
+        steptypename: string
+    }
+
+    /// 查询履约信息详情
+    interface WrPerformancePlanStepReq {
+        /// 履约计划id(performanceplanid)
+        planid: number
+        /// 当前步骤id
+        curstepid?: number
+    }
+
+    /// 履约信息详情
+    interface WrPerformancePlanStep {
+        /// 延期申请天数
+        delaydays: number
+        /// 品种代码
+        deliverygoodscode: string
+        /// 品种ID
+        deliverygoodsid: number
+        /// 品种名称
+        deliverygoodsname: string
+        /// 结束日期
+        endtime: string
+        /// 单位名称
+        enumdicname: string
+        /// 步骤执行方 - 1:买方 2:卖方
+        executeside: number
+        /// 处理状态 - 1:开始 2:结束 3:冻结请求 4:冻结返回成功 5:冻结返回失败 6:扣款请求 7:扣款返回成功 8:扣款返回失败 9:仓单转移请求 10:仓单转移返回成功 11:仓单转移返回失败 12:加钱请求 13:加钱返回成功 14:加钱返回失败 15:解冻仓单头寸请求 16:解冻仓单头寸返回成功 17:解冻仓单头寸返回失败 18:解冻库位请求 19:解冻库位返回成功 20:解冻库位返回失败
+        handlestatus: number
+        /// 是否自动 - 0:不自动 1:自动
+        isauto: number
+        /// 是否最后收款步骤 - 0:不是 1:是 (暂时不用,由服务自己判断是否为最后一步付款或收款)
+        islastreceivestep: number
+        /// 现货商品最小变动值
+        minivalue: number
+        /// 选择项比较串【{选择项ID}+{冒号}+选择项值 } ,逗号分隔,头尾加逗号】-- 所有选择项拼接,用于比较
+        optioncompare: string
+        /// 超期天数 = 当前时间(数据库时间) - 结束日期
+        overdays: number
+        /// 履约步骤ID(131+Unix秒时间戳(10位)+xxxxxx)
+        performancestepid: string
+        /// 所属履约计划ID
+        planid: string
+        /// 实际完成金额
+        realamount: number
+        /// 关联单号
+        relatedorderid: string
+        /// 剩余天数
+        remaindays: number
+        /// 错误备注
+        remark: string
+        /// 开始日期
+        starttime: string
+        /// 步骤金额
+        stepamount: number
+        /// 距离上一步天数(分钟)
+        stepdays: number
+        /// 步骤序号
+        stepindex: number
+        /// 步骤启动类型 - 1:系统自动 2:手动
+        steplanchtype: number
+        /// 步骤备注
+        stepremark: string
+        /// 步骤状态 - 1:待开始 2:进行中 3:已完成 4:延期(进行中) 5:失败 6:自动完成 7:超时关闭
+        stepstatus: number
+        /// 履约步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移 9:释放卖方冻结 10:货款溢短 11:生成合同[中江] 12:运费 90:确认支付 91. 确认放行 92买方支付(直接扣款) 用于-1模板“
+        steptypeid: number
+        /// 步骤名称
+        steptypename: string
+        /// 步骤值
+        stepvalue: number
+        /// 仓库ID
+        warehouseid: number
+        /// 仓库名称
+        warehousename: string
+        /// 仓单要素类型ID(212+Unix秒时间戳(10位)+xxxxxx)
+        wrfactortypeid: string
+        /// 仓单要素类型名称(选择项要素的名称合并显示,逗号分隔)
+        wrfactortypename: string
+        /// 现货商品代码
+        wrstandardcode: string
+        /// 现货商品ID
+        wrstandardid: number
+        /// 商品名称
+        wrstandardname: string
+        ///  商品
+        wrtypename: string
+    }
 }

+ 2 - 3
src/types/proto/performance.d.ts

@@ -1,5 +1,4 @@
 import { IMessageHead } from './proto'
-import Long from 'long'
 
 declare global {
     namespace Proto {
@@ -14,9 +13,9 @@ declare global {
             /// uint64 违约申请人
             Applicant?: number; 
             /// string 申请备注 
-            ApplyRemark?: string; 
+            ApplyRemark: string; 
             /// string 附件
-            Attachment?: string;
+            Attachment: string;
         }
         // 违约申请应答 0 20 10
         interface PerformanceContractedApplyRsp {