瀏覽代碼

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

li.shaoyi 2 年之前
父節點
當前提交
dd847fb4e9

+ 35 - 1
src/packages/mobile/views/order/position/components/spot/listing/Index.vue

@@ -14,6 +14,8 @@
                     <Cell title="可用量" :value="selectedRow.enableqty" />
                 </CellGroup>
                 <CellGroup title="挂牌信息" inset>
+                    <Field name="PerformanceTemplateID" label="履约模板" placeholder="请选择" v-model="formData.PerformanceTemplateID" :rules="formRules.PerformanceTemplateID"
+                 @click="showPerformancePlan = true" is-link readonly />
                     <Field name="OrderQty" :rules="formRules.OrderQty" label="挂牌数量">
                         <template #input>
                             <Stepper v-model="formData.OrderQty" theme="round" button-size="22"
@@ -33,17 +35,23 @@
                     <Button block square type="danger" @click="formRef?.submit">卖出</Button>
                 </div>
             </template>
+            <component :is="PerformanceTmp" v-model:show="showPerformancePlan" @change="onPerformanceTmpChange" />
         </app-view>
     </app-modal>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, PropType, onMounted } from 'vue'
+import { shallowRef, PropType, onMounted, defineAsyncComponent } from 'vue'
 import { CellGroup, Cell, Button, Stepper, Field, Form, FormInstance, FieldRule } from 'vant'
 import { fullloading } from '@/utils/vant'
 import { useHdWROrder } from '@/business/trade'
+import { onBeforeRouteLeave } from 'vue-router'
 import AppModal from '@/components/base/modal/index.vue'
 
+const PerformanceTmp = defineAsyncComponent(() => import('../../../../../spot/add/components/preformance/index.vue'))
+const showPerformancePlan = shallowRef(false)
+const performance = shallowRef<Partial<Model.PerformancePlanRsp>>({}) //选中的履约模板
+
 const props = defineProps({
     selectedRow: {
         type: Object as PropType<Model.HoldLBRsp>,
@@ -58,6 +66,12 @@ const refresh = shallowRef(false) // 是否刷新父组件数据
 
 // 表单验证规则
 const formRules: { [key in keyof Proto.HdWROrderReq]?: FieldRule[] } = {
+    PerformanceTemplateID: [{
+        message: '请选择履约模板',
+        validator: () => {
+            return !!formData.PerformanceTemplateID
+        }
+    }],
     FixedPrice: [{
         message: '请输入价格',
         validator: () => {
@@ -78,6 +92,16 @@ const formRules: { [key in keyof Proto.HdWROrderReq]?: FieldRule[] } = {
     }],
 }
 
+// 选择履约模板
+const onPerformanceTmpChange = (item: Model.PermancePlanTmpRsp) => {
+    performance.value = item
+    formData.PerformanceTemplateID = item.autoid
+    if (formData.PerformanceTemplateID) {
+        formRef.value?.validate('PerformanceTemplateID')
+    }
+    showPerformancePlan.value = false
+}
+
 const onSubmit = () => {
     const { wrstandardid, subnum, deliverygoodsid, ladingbillid = '0', wrfactortypeid = '0' } = props.selectedRow ?? {}
     formData.WRStandardID = wrstandardid
@@ -110,4 +134,14 @@ onMounted(() => {
 defineExpose({
     closed,
 })
+
+// 离开页面前关闭组件
+onBeforeRouteLeave((to, from, next) => {
+    if (showPerformancePlan.value) {
+        showPerformancePlan.value = false
+        next(false)
+    } else {
+        next()
+    }
+})
 </script>

+ 25 - 0
src/packages/mobile/views/spot/add/components/buy/index.vue

@@ -13,6 +13,8 @@
                         </template>
                     </Field>
                 </template>
+                <Field name="PerformanceTemplateID" label="履约模板" placeholder="请选择" v-model="formData.PerformanceTemplateID" :rules="formRules.PerformanceTemplateID"
+                 @click="showPerformancePlan = true" is-link readonly />
                 <Field name="FixedPrice" :rules="formRules.FixedPrice" label="价格">
                     <template #input>
                         <Stepper v-model="formData.FixedPrice" theme="round" :min="0" :decimal-length="2" :default-value="0"
@@ -38,6 +40,7 @@
             </div>
         </template>
         <component :is="WarehouseReceipt" v-model:show="showWarehouseReceipt" @change="onChange" />
+        <component :is="PerformanceTmp" v-model:show="showPerformancePlan" @change="onPerformanceTmpChange" />
     </app-view>
 </template>
 
@@ -50,12 +53,15 @@ import { useNavigation } from '../../../../../router/navigation'
 import { useHdWROrder } from '@/business/trade'
 
 const WarehouseReceipt = defineAsyncComponent(() => import('./warehouse-receipt.vue'))
+const PerformanceTmp = defineAsyncComponent(() => import('../preformance/index.vue'))
 
 const { routerBack } = useNavigation()
 const { formData, listingSubmit, amount } = useHdWROrder()
 const formRef = shallowRef<FormInstance>()
 const showWarehouseReceipt = shallowRef(false)
+const showPerformancePlan = shallowRef(false)
 const selectedRow = shallowRef<Partial<Model.HoldLBRsp>>({}) //选中的现货仓单
+const performance = shallowRef<Partial<Model.PerformancePlanRsp>>({}) //选中的履约模板
 
 // 表单验证规则
 const formRules: { [key in keyof Proto.HdWROrderReq]?: FieldRule[] } = {
@@ -65,6 +71,12 @@ const formRules: { [key in keyof Proto.HdWROrderReq]?: FieldRule[] } = {
             return !!selectedRow.value.wrfactortypeid
         }
     }],
+    PerformanceTemplateID: [{
+        message: '请选择履约模板',
+        validator: () => {
+            return !!formData.PerformanceTemplateID
+        }
+    }],
     FixedPrice: [{
         message: '请输入价格',
         validator: () => {
@@ -96,6 +108,16 @@ const onChange = (item: Model.HoldLBRsp) => {
     showWarehouseReceipt.value = false
 }
 
+// 选择履约模板
+const onPerformanceTmpChange = (item: Model.PermancePlanTmpRsp) => {
+    performance.value = item
+    formData.PerformanceTemplateID = item.autoid
+    if (formData.PerformanceTemplateID) {
+        formRef.value?.validate('PerformanceTemplateID')
+    }
+    showPerformancePlan.value = false
+}
+
 // 表单提交
 const formSubmit = () => {
     const { wrstandardid, subnum, deliverygoodsid, ladingbillid = '0', wrfactortypeid = '0' } = selectedRow.value
@@ -120,6 +142,9 @@ onBeforeRouteLeave((to, from, next) => {
     if (showWarehouseReceipt.value) {
         showWarehouseReceipt.value = false
         next(false)
+    } else if (showPerformancePlan.value) {
+        showPerformancePlan.value = false
+        next(false)
     } else {
         next()
     }

+ 47 - 0
src/packages/mobile/views/spot/add/components/preformance/index.vue

@@ -0,0 +1,47 @@
+<template>
+    <app-modal direction="right" height="100%">
+        <app-view class="g-form">
+            <template #header>
+                <app-navbar title="选择履约模板" />
+            </template>
+            <RadioGroup class="g-form__container" v-model="checkedRow" v-if="dataList.length">
+                <CellGroup v-for="(item, index) in dataList" :key="index" @click="onChange(item)" inset>
+                    <Cell>
+                        <template #title>
+                            <Radio :name="item" checked-color="#ee0a24">
+                                <ul style="margin-left: .2rem;">
+                                    <li>
+                                        <span>名称:</span>
+                                        <span>{{ item.templatename }}</span>
+                                    </li>
+                                    <ul v-for="(step, i) in item.LstStep" :key="i">
+                                        <span>{{ step.stepinfo }}</span>
+                                        <span>{{ step.stepdate }}</span>
+                                    </ul>
+                                </ul>
+                            </Radio>
+                        </template>
+                    </Cell>
+                </CellGroup>
+            </RadioGroup>
+        </app-view>
+    </app-modal>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef } from 'vue'
+import { RadioGroup, Radio, Cell, CellGroup } from 'vant'
+import { useRequest } from '@/hooks/request'
+import { queryPermancePlanTmp } from '@/services/api/performance'
+import AppModal from '@/components/base/modal/index.vue'
+
+const emit = defineEmits(['update:show', 'change'])
+const checkedRow = shallowRef<Model.PermancePlanTmpRsp>()
+const { dataList } = useRequest(queryPermancePlanTmp)
+
+// 选择履约模板
+const onChange = (item: Model.PermancePlanTmpRsp) => {
+    checkedRow.value = item
+    emit('change', item)
+}
+</script>

+ 35 - 1
src/packages/mobile/views/spot/add/components/sell/index.vue

@@ -2,6 +2,8 @@
     <app-view class="g-form">
         <Form ref="formRef" class="g-form__container" @submit="formSubmit">
             <CellGroup inset>
+                <Field name="PerformanceTemplateID" label="履约模板" placeholder="请选择" v-model="formData.PerformanceTemplateID" :rules="formRules.PerformanceTemplateID"
+                 @click="showPerformancePlan = true" is-link readonly />
                 <Field name="DeliveryGoodsID" label="品类" :rules="formRules.DeliveryGoodsID" is-link>
                     <template #input>
                         <app-select v-model="formData.DeliveryGoodsID" :options="ftDeliveryGoodsList"
@@ -52,11 +54,13 @@
                 <Button type="danger" @click="formRef?.submit" square block>提交</Button>
             </div>
         </template>
+        <component :is="PerformanceTmp" v-model:show="showPerformancePlan" @change="onPerformanceTmpChange" />
     </app-view>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, computed } from 'vue'
+import { shallowRef, computed, defineAsyncComponent } from 'vue'
+import { onBeforeRouteLeave } from 'vue-router'
 import { CellGroup, Button, Field, Form, FormInstance, Stepper, FieldRule, showSuccessToast, showFailToast } from 'vant'
 import { fullloading } from '@/utils/vant'
 import { BuyOrSell } from '@/constants/order'
@@ -67,10 +71,14 @@ import { useHdWROrder } from '@/business/trade'
 import { useAccountStore } from '@/stores'
 import AppSelect from '../../../../../components/base/select/index.vue'
 
+const PerformanceTmp = defineAsyncComponent(() => import('../preformance/index.vue'))
+
 const { routerBack } = useNavigation()
 const { formData, listingSubmit, amount } = useHdWROrder()
 const accountStore = useAccountStore()
 const formRef = shallowRef<FormInstance>()
+const showPerformancePlan = shallowRef(false)
+const performance = shallowRef<Partial<Model.PerformancePlanRsp>>({}) //选中的履约模板
 
 const { dataList: ftDeliveryGoodsList } = useRequest(queryFtDeliveryGoods)
 const { dataList: wrStandardFactoryItems, run: getWrStandardFactoryItems } = useRequest(queryWrStandardFactoryItem, { manual: true })
@@ -84,6 +92,12 @@ const warehouseList = computed(() => {
 
 // 表单验证规则
 const formRules: { [key in keyof Proto.HdWROrderReq]?: FieldRule[] } = {
+    PerformanceTemplateID: [{
+        message: '请选择履约模板',
+        validator: () => {
+            return !!formData.PerformanceTemplateID
+        }
+    }],
     DeliveryGoodsID: [{
         message: '请选择品类',
         validator: () => {
@@ -116,6 +130,16 @@ const formRules: { [key in keyof Proto.HdWROrderReq]?: FieldRule[] } = {
     }],
 }
 
+// 选择履约模板
+const onPerformanceTmpChange = (item: Model.PermancePlanTmpRsp) => {
+    performance.value = item
+    formData.PerformanceTemplateID = item.autoid
+    if (formData.PerformanceTemplateID) {
+        formRef.value?.validate('PerformanceTemplateID')
+    }
+    showPerformancePlan.value = false
+}
+
 // 选择品类时触发
 const onDeliveryGoodsChange = (deliverygoodsid: number) => {
     const item = ftDeliveryGoodsList.value.find((e) => e.deliverygoodsid === deliverygoodsid)
@@ -156,4 +180,14 @@ const formSubmit = () => {
         })
     })
 }
+
+// 离开页面前关闭组件
+onBeforeRouteLeave((to, from, next) => {
+    if (showPerformancePlan.value) {
+        showPerformancePlan.value = false
+        next(false)
+    } else {
+        next()
+    }
+})
 </script>

+ 36 - 1
src/packages/mobile/views/spot/detail/components/listing/index.vue

@@ -2,6 +2,8 @@
     <app-popup class="supply-demand-listing" :title="buyorsell === BuyOrSell.Sell ? '我要卖' : '我要买'" v-model:show="showModal"
         :refresh="refresh">
         <Form class="supply-demand-listing__form" ref="formRef" @submit="onSubmit">
+            <Field name="PerformanceTemplateID" label="履约模板" placeholder="请选择" v-model="formData.PerformanceTemplateID" :rules="formRules.PerformanceTemplateID"
+                 @click="showPerformancePlan = true" is-link readonly />
             <Field name="FixedPrice" :rules="formRules.FixedPrice" label="挂牌价格">
                 <template #input>
                     <Stepper v-model="formData.FixedPrice" theme="round" :decimal-length="2" :auto-fixed="false"
@@ -40,11 +42,12 @@
             <Button :type="buyorsell === BuyOrSell.Sell ? 'primary' : 'danger'" block round
                 @click="formRef?.submit">确定</Button>
         </template>
+        <component :is="PerformanceTmp" v-model:show="showPerformancePlan" @change="onPerformanceTmpChange" />
     </app-popup>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, PropType, onMounted } from 'vue'
+import { shallowRef, PropType, onMounted, defineAsyncComponent } from 'vue'
 import { Form, Field, Stepper, Button, FieldRule, FormInstance } from 'vant'
 import { fullloading, dialog } from '@/utils/vant'
 import { useAccountStore } from '@/stores'
@@ -52,7 +55,10 @@ import { BuyOrSell } from '@/constants/order'
 import { queryHoldLB } from '@/services/api/order'
 import { useHdWROrder } from '@/business/trade'
 import AppPopup from '../../../../../components/base/popup/index.vue'
+import { onBeforeRouteLeave } from 'vue-router'
+
 //import AppSelect from '../../../../../components/base/select/index.vue'
+const PerformanceTmp = defineAsyncComponent(() => import('../../../add/components/preformance/index.vue'))
 
 const props = defineProps({
     quoteItem: {
@@ -65,6 +71,7 @@ const props = defineProps({
     }
 })
 
+const showPerformancePlan = shallowRef(false)
 const { formData, listingSubmit, amount } = useHdWROrder()
 const accountStore = useAccountStore()
 const formRef = shallowRef<FormInstance>()
@@ -72,9 +79,17 @@ const refresh = shallowRef(false) // 是否刷新父组件数据
 const showModal = shallowRef(true)
 //const dataList = shallowRef<Model.HoldLBRsp[]>([]) //现货仓单列表
 const selectedRow = shallowRef<Model.HoldLBRsp>() //选中的现货仓单
+const performance = shallowRef<Partial<Model.PerformancePlanRsp>>({}) //选中的履约模板
+
 
 // 表单验证规则
 const formRules: { [key in keyof Proto.HdWROrderReq]?: FieldRule[] } = {
+    PerformanceTemplateID: [{
+        message: '请选择履约模板',
+        validator: () => {
+            return !!formData.PerformanceTemplateID
+        }
+    }],
     FixedPrice: [{
         message: '请输入价格',
         validator: () => {
@@ -102,6 +117,16 @@ const formRules: { [key in keyof Proto.HdWROrderReq]?: FieldRule[] } = {
     }],
 }
 
+// 选择履约模板
+const onPerformanceTmpChange = (item: Model.PermancePlanTmpRsp) => {
+    performance.value = item
+    formData.PerformanceTemplateID = item.autoid
+    if (formData.PerformanceTemplateID) {
+        formRef.value?.validate('PerformanceTemplateID')
+    }
+    showPerformancePlan.value = false
+}
+
 // 选择仓单
 // const onConfirm = (value: string) => {
 //     selectedRow.value = dataList.value.find((e) => e.wrid === value)
@@ -159,6 +184,16 @@ onMounted(() => {
 defineExpose({
     closed,
 })
+
+// 离开页面前关闭组件
+onBeforeRouteLeave((to, from, next) => {
+    if (showPerformancePlan.value) {
+        showPerformancePlan.value = false
+        next(false)
+    } else {
+        next()
+    }
+})
 </script>
 
 <style lang="less">

+ 1 - 1
src/packages/pc/views/account/sign/components/sign/index.vue

@@ -9,7 +9,7 @@
                 </el-select>
             </el-form-item>
             <el-form-item label="银行卡号" prop="BankAccountNo">
-                <el-input name="BankAccountNo" placeholder="银行卡账户名" :maxlength="30" v-model="formData.BankAccountNo"
+                <el-input name="BankAccountNo" placeholder="银行卡" :maxlength="30" v-model="formData.BankAccountNo"
                     :rules="formRules.BankAccountNo" />
             </el-form-item>
             <el-form-item label="姓名" prop="BankAccountName">

+ 4 - 4
src/packages/pc/views/footer/capital/summary/withdraw/index.vue

@@ -6,10 +6,10 @@
                 <span>{{ accountStore.currentAccountId }}</span>
             </el-form-item>
             <el-form-item label="可用余额">
-                <span>{{ accountStore.currentAccount.currentbalance?.toFixed(2) }}</span>
+                <span>{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}</span>
             </el-form-item>
-            <el-form-item label="出金金额" prop="Amount">
-                <el-input-number placeholder="请输入出金金额" :precision="2" v-model="formData.Amount" />
+            <el-form-item label="提现金额" prop="Amount">
+                <el-input-number placeholder="请输入提现金额" :precision="2" v-model="formData.Amount" />
             </el-form-item>
             <!-- <el-form-item label="金额大写">
                 <span>壹万元</span>
@@ -43,7 +43,7 @@ const formRules: FormRules = {
         required: true,
         message: '请输入金额',
         validator: (rule, value, callback) => {
-            if (value <= (accountStore.currentAccount.currentbalance ?? 0.0)) {
+            if (value <= (accountStore.currentAccount.avaiableMoney ?? 0.0)) {
                 callback()
             } else {
                 callback(new Error('超出可出金额'))