Jelajahi Sumber

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP20_WEB_GLOBAL

li.shaoyi 2 tahun lalu
induk
melakukan
c310d43406

+ 2 - 2
src/packages/mobile/views/order/list/components/goodsorder/detail/Index.vue

@@ -11,9 +11,9 @@
                     <Cell title="方向" :value="getBuyOrSellName(selectedRow.buyorsell)" />
                     <Cell title="类型" :value="getBuildTypeName(selectedRow.buildtype)" />
                     <Cell title="挂摘类型" :value="getListingSelectTypeName(selectedRow.listingselecttype)" />
-                    <Cell title="委托数量" :value="formatDecimal(selectedRow.orderqty)" />
+                    <Cell title="委托数量" :value="selectedRow.orderqty" />
                     <Cell title="委托价格" :value="formatDecimal(selectedRow.orderprice)" />
-                    <Cell title="成交数量" :value="formatDecimal(selectedRow.tradeqty)" />
+                    <Cell title="成交数量" :value="selectedRow.tradeqty" />
                     <Cell title="委托状态" :value="getWRTradeOrderStatusName(selectedRow.orderstatus)" />
                     <Cell title="委托时间" :value="formatDate(selectedRow.ordertime)" />
                     <Cell title="委托单号" :value="selectedRow.orderid" />

+ 2 - 2
src/packages/mobile/views/order/list/components/goodsorder/list/Index.vue

@@ -24,7 +24,7 @@
                         </li>
                         <li>
                             <span>委托数量</span>
-                            <span>{{ formatDecimal(item.orderqty) }}</span>
+                            <span>{{ item.orderqty }}</span>
                         </li>
                         <li>
                             <span>委托价格</span>
@@ -32,7 +32,7 @@
                         </li>
                         <li>
                             <span>成交数量</span>
-                            <span>{{ formatDecimal(item.tradeqty) }}</span>
+                            <span>{{ item.tradeqty }}</span>
                         </li>
                     </ul>
                 </div>

+ 44 - 22
src/packages/mobile/views/order/performance/components/detail/Index.vue

@@ -26,9 +26,15 @@
 
                 </CellGroup>
             </div>
+            <Form ref="formRef" class="g-form__container" @submit="toConfirm">
+                <Dialog :title="dialogTitle" v-model:show="show" show-cancel-button @confirm ="toConfirm" @cancel="show=false">
+                    <Field name="DelayDays" v-model="formData.delaydays" type="number" v-if="showDays" label="延期天数" :rules="formRules.delaydays" placeholder="请输入延期天数" />
+                    <Field name="Remark" label="备注" v-model="remark" :rules="formRules.remark" placeholder="请输入备注信息" />
+                </Dialog>
+            </Form>
             <template #footer>
-                <Button type="danger" block round @click="delay">延期申请</Button>
-                <Button type="info" block round @click="confirm">立即执行</Button>
+                <Button type="primary" v-if="selectedRow.buyorsell===selectedRow.executeside-1" block round @click="showConfirm(true)">延期申请</Button>
+                <Button type="warning" v-if="selectedRow.buyorsell===selectedRow.executeside-1" block round @click="showConfirm(false)">立即执行</Button>
             </template>
         </app-view>
     </app-modal>
@@ -36,8 +42,8 @@
 
 <script lang="ts" setup>
 import { shallowRef, PropType } from 'vue'
-import { CellGroup, Cell, Button } from 'vant'
-import { dialog, fullloading } from '@/utils/vant'
+import { CellGroup, Cell, Button, Dialog, Field, FieldRule, Form, FormInstance } from 'vant'
+import { fullloading } from '@/utils/vant'
 import { formatDate, formatDecimal } from '@/filters'
 import { usePerformanceDelayApply, usePerformanceManualConfirm } from '@/business/performance'
 import { queryWrPerformancePlanStep } from '@/services/api/performance'
@@ -48,7 +54,8 @@ import { useRequest } from '@/hooks/request'
 const showModal = shallowRef(true)
 // 是否刷新父组件数据
 const refresh = shallowRef(false)
-const { formData, formSubmit } = usePerformanceDelayApply()
+const { formData, formSubmit} = usePerformanceDelayApply()
+const formRef = shallowRef<FormInstance>()
 
 const props = defineProps({
     selectedRow: {
@@ -60,6 +67,22 @@ const props = defineProps({
 const { confirmFormData, confirmSubmit } = usePerformanceManualConfirm(props.selectedRow.buyaccountid)
 const datelist = shallowRef<Model.WrPerformancePlanStep[]>([])
 const error = shallowRef(false)
+const show = shallowRef(false)
+const showDays = shallowRef(false)
+const remark = shallowRef('')
+const dialogTitle = shallowRef('是否要手动执行步骤?')
+
+// 表单验证规则
+const formRules: { [key in keyof Proto.PerformanceDelayApplyReq | 'remark' ]?: FieldRule[] } = {
+    delaydays: [{
+        required: true,
+        message: '请输入延期天数'
+    }],
+    remark: [{
+        required: true,
+        message: '请输入备注信息'
+    }],
+}
 
 const { loading } = useRequest(queryWrPerformancePlanStep, {
     params: {
@@ -73,14 +96,19 @@ const { loading } = useRequest(queryWrPerformancePlanStep, {
     }
 })
 
-const delay = () => {
-    dialog({
-        message: '确认要延期申请吗?',
-        showCancelButton: true,
-    }).then(() => {
-        /// 市场ID
-        formData.value.PerformancePlanStepID = Number(props.selectedRow.curstepid)
+const showConfirm = (showDelay: boolean) => {
+    dialogTitle.value = showDelay ? '确定要延期申请吗?' : '是否要手动执行步骤?'
+    showDays.value = showDelay
+    show.value = true
+}
 
+const toConfirm = () => {
+    const { curstepid } = props.selectedRow
+    console.log(props.selectedRow)
+    if (showDays.value === true) { /// 延期
+        /// 市场ID
+        formData.value.PerformancePlanStepID = curstepid
+        formData.value.applyremark = remark.value
         /// loding....
         fullloading((hideLoading) => {
             formSubmit().then(() => {
@@ -90,16 +118,10 @@ const delay = () => {
                 hideLoading(err, 'fail')
             })
         })
-    })
-}
-
-const confirm = () => {
-    dialog({
-        message: '确认要立即执行吗?',
-        showCancelButton: true,
-    }).then(() => {
+    } else { /// 手动确认
         /// PerformancePlanStepID
-        confirmFormData.value.PerformancePlanStepID = Number(props.selectedRow.curstepid)
+        confirmFormData.value.PerformancePlanStepID = curstepid
+        confirmFormData.value.StepRemark = remark.value
         /// loding....
         fullloading((hideLoading) => {
             confirmSubmit().then(() => {
@@ -109,7 +131,7 @@ const confirm = () => {
                 hideLoading(err, 'fail')
             })
         })
-    })
+    }
 }
 
 /// 关闭弹窗

+ 1 - 2
src/packages/mobile/views/order/performance/components/modify/Index.vue

@@ -9,7 +9,7 @@
                 <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"
+                    <Field name="ReceiveInfo" v-model="formData.ContactInfo" autosize label="收货地址" type="textarea"
                         placeholder="请输入收货地址">
                         <template #button>
                             <Button icon="plus" size="small" type="primary" />
@@ -35,7 +35,6 @@ import { shallowRef, PropType } from 'vue'
 import { CellGroup, Button, Field, 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)

+ 6 - 6
src/packages/mobile/views/order/position/components/goods/list/Index.vue

@@ -19,27 +19,27 @@
                     </ul>
                     <ul>
                         <li>
-                            <span>持有数量</span>
+                            <span>持有数量</span>
                             <span>{{ formatDecimal(item.curpositionqty) }}</span>
                         </li>
                         <li>
-                            <span>持仓均价</span>
+                            <span>持仓均价</span>
                             <span>{{ handleNumberValue(formatDecimal(item.averageprice)) }}</span>
                         </li>
                         <li>
-                            <span>冻结数量</span>
+                            <span>冻结数量</span>
                             <span>{{ formatDecimal(item.frozenqty) }}</span>
                         </li>
                         <li>
-                            <span>持仓金额</span>
+                            <span>持仓金额</span>
                             <span>{{ formatDecimal(item.curholderamount) }}</span>
                         </li>
                         <li>
-                            <span>可用数量</span>
+                            <span>可用数量</span>
                             <span>{{ formatDecimal(item.enableqty) }}</span>
                         </li>
                         <li>
-                            <span>参考损益</span>
+                            <span>参考损益</span>
                             <span :class="closepl(item) ? 'g-price-up' : 'g-price-down'">{{ formatDecimal(closepl(item))
                             }}</span>
                         </li>

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

@@ -55,6 +55,8 @@ declare namespace Model {
         enddate: string
         /// 单位名称
         enumdicname: string
+        /// 步骤执行方 - 1:买方 2:卖方
+        executeside: number
         /// 运费
         expressfee: number
         /// 是否确认运费 - 0:无 1:买方确认 2:卖方确认

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

@@ -33,7 +33,7 @@ declare global {
             /// MessageHead 消息头
             Header?: IMessageHead;
             /// uint64 履约计划步骤ID
-            PerformancePlanStepID?: number;
+            PerformancePlanStepID?: string;
             /// uint32 申请延期天数
             delaydays?: number;
             /// uint64 申请人
@@ -59,7 +59,7 @@ declare global {
             /// MessageHead 消息头
             Header?: IMessageHead;
             /// uint64 履约计划步骤ID
-            PerformancePlanStepID?: number;
+            PerformancePlanStepID?: string;
             /// double 溢短金额
             OverShortAmount?: number;
             /// uint32 履约步骤执行方 1买方 2 卖方