li.shaoyi 2 سال پیش
والد
کامیت
f854c891a9

+ 19 - 0
src/packages/mobile/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 #576675;
+        }
+
+        &__title {
+            margin-bottom: 8px;
+        }
+
+        &.selected &__title {
+            font-weight: bold;
+        }
+    }
+}

+ 51 - 0
src/packages/mobile/components/modules/performance/index.vue

@@ -0,0 +1,51 @@
+<template>
+    <Field type="number" :label="label" @click="show = true" is-link readonly>
+        <template #input>
+            <input :placeholder="placeholder" :value="templateName" />
+            <PerformanceList v-model:show="show" :market-id="marketId" :selected-id="modelValue" @change="onChange" />
+        </template>
+    </Field>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef } from 'vue'
+import { Field } from 'vant'
+import PerformanceList from './list/index.vue'
+
+defineProps({
+    modelValue: Number,
+    marketId: Number,
+    label: {
+        type: String,
+        default: '履约模板'
+    },
+    placeholder: {
+        type: String,
+        default: '请选择'
+    }
+})
+
+const emit = defineEmits(['update:modelValue', 'change'])
+const show = shallowRef(false)
+const templateName = shallowRef<string>()
+
+const onChange = (item?: Model.PermancePlanTmpRsp) => {
+    templateName.value = item?.templatename
+    emit('update:modelValue', item?.autoid)
+}
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed: () => {
+        if (show.value) {
+            show.value = false
+            return false
+        }
+        return true
+    },
+})
+</script>
+
+<style lang="less">
+@import './index.less';
+</style>

+ 21 - 0
src/packages/mobile/components/modules/performance/list/index.less

@@ -0,0 +1,21 @@
+.app-performance {
+    &__step {
+        display: flex;
+        overflow-x: auto;
+        padding-top: .2rem;
+
+        li {
+            display: flex;
+            flex-direction: column;
+            align-items: center;
+
+            &:not(:first-child) {
+                margin-left: .1rem;
+            }
+
+            span {
+                white-space: nowrap;
+            }
+        }
+    }
+}

+ 74 - 0
src/packages/mobile/components/modules/performance/list/index.vue

@@ -0,0 +1,74 @@
+<template>
+    <app-modal direction="right" height="100%" v-model:show="showModal">
+        <app-view class="app-performance">
+            <template #header>
+                <app-navbar title="履约模板" @back="showModal = false" />
+            </template>
+            <RadioGroup v-model="checkedRow" @change="onChange">
+                <CellGroup>
+                    <Cell v-for="(item, index) in dataList" :key="index" arrow-direction="down">
+                        <template #title>
+                            <Radio :name="item">{{ item.templatename }}</Radio>
+                        </template>
+                        <template #label>
+                            <ul class="app-performance__step">
+                                <li v-for="(step, i) in item.LstStep" :key="i">
+                                    <Tag size="large">{{ step.stepinfo }}</Tag>
+                                    <span>{{ step.stepdate }}</span>
+                                </li>
+                            </ul>
+                        </template>
+                    </Cell>
+                </CellGroup>
+            </RadioGroup>
+        </app-view>
+    </app-modal>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, computed } from 'vue'
+import { RadioGroup, Radio, CellGroup, Cell, Tag } from 'vant'
+import { useRequest } from '@/hooks/request'
+import { queryPermancePlanTmp } from '@/services/api/performance'
+import AppModal from '@/components/base/modal/index.vue'
+
+const props = defineProps({
+    show: {
+        type: Boolean,
+        default: false
+    },
+    selectedId: Number,
+    marketId: Number,
+})
+
+const emit = defineEmits(['update:show', 'change'])
+const checkedRow = shallowRef<Model.PermancePlanTmpRsp>()
+
+const showModal = computed({
+    get: () => props.show,
+    set: (val) => emit('update:show', val)
+})
+
+const { dataList } = useRequest(queryPermancePlanTmp, {
+    params: {
+        marketid: props.marketId
+    },
+    onFinally: () => {
+        const item = dataList.value.find((e) => e.autoid === props.selectedId)
+        if (item) {
+            checkedRow.value = item
+        } else {
+            emit('change')
+        }
+    }
+})
+
+const onChange = () => {
+    emit('change', checkedRow.value)
+    showModal.value = false
+}
+</script>
+
+<style lang="less">
+@import './index.less';
+</style>

+ 1 - 1
src/packages/mobile/views/goods/detail/components/listing/Index.vue

@@ -234,7 +234,7 @@ const closed = (isRefresh = true) => {
 }
 
 onMounted(() => {
-    const { last = 0, agreeunit = 0, presettle = 0 } = quote.value ?? {}
+    const { last = 0, presettle = 0 } = quote.value ?? {}
     formData.OrderPrice = last || presettle
     formData.OrderQty = qtyStep.value
 })

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

@@ -7,7 +7,7 @@
             </template>
             <div class="order-detail__container g-form__container">
                 <CellGroup title="挂牌点价成交信息">
-                    <Cell title="商品代码/名称" :value="selectedRow.goodscode+'/'+selectedRow.goodsname"/>
+                    <Cell title="商品代码/名称" :value="selectedRow.goodscode + '/' + selectedRow.goodsname" />
                     <Cell title="方向" :value="getBuyOrSellName(selectedRow.buyorsell)" />
                     <Cell title="类型" :value="getBuildTypeName(selectedRow.buildtype)" />
                     <Cell title="成交数量" :value="selectedRow.tradeqty" />
@@ -33,7 +33,7 @@ import { getBuyOrSellName, getBuildTypeName } from '@/constants/order'
 const showModal = shallowRef(true)
 const refresh = shallowRef(false) // 是否刷新父组件数据
 
-const props = defineProps({
+defineProps({
     selectedRow: {
         type: Object as PropType<Model.TradeDetailRsp>,
         required: true,

+ 3 - 5
src/packages/mobile/views/order/position/components/pricing/list/Index.vue

@@ -54,7 +54,7 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, defineAsyncComponent } from 'vue'
+import { shallowRef } from 'vue'
 import { Button } from 'vant'
 import { useComponent } from '@/hooks/component'
 import { useRequest } from '@/hooks/request'
@@ -62,9 +62,8 @@ import { queryTradePosition } from '@/services/api/order'
 import AppPullRefresh from '../../../../../../components/base/pull-refresh/index.vue'
 import { getBuyOrSellName } from '@/constants/order'
 import { formatDecimal } from '@/filters'
-import { useUserStore } from '@/stores'
 import { useNavigation } from '../../../../../../router/navigation'
-import { BuyOrSell, BuildType, PriceMode } from '@/constants/order'
+import { BuyOrSell, BuildType } from '@/constants/order'
 
 const componentMap = new Map<string, unknown>([
     // ['close', defineAsyncComponent(() => import('../close/Index.vue'))],
@@ -72,13 +71,12 @@ const componentMap = new Map<string, unknown>([
 ])
 
 const { router } = useNavigation()
-const userStore = useUserStore()
 const dataList = shallowRef<Model.TradePositionRsp[]>([])
 const selectedRow = shallowRef<Model.TradePositionRsp>()
 const error = shallowRef(false)
 const pullRefreshRef = shallowRef()
 
-const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
+const { componentRef, componentId, closeComponent } = useComponent(() => {
     pullRefreshRef.value?.refresh()
 })
 

+ 7 - 29
src/packages/mobile/views/spot/detail/components/listing/index.vue

@@ -2,8 +2,7 @@
     <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 />
+            <Performance ref="performanceRef" v-model="formData.PerformanceTemplateID" />
             <Field name="FixedPrice" :rules="formRules.FixedPrice" label="挂牌价格">
                 <template #input>
                     <Stepper v-model="formData.FixedPrice" theme="round" :decimal-length="2" :auto-fixed="false"
@@ -42,7 +41,6 @@
             <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>
 
@@ -55,10 +53,9 @@ 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 Performance = defineAsyncComponent(() => import('../../../../../components/modules/performance/index.vue'))
 
 const props = defineProps({
     quoteItem: {
@@ -71,15 +68,14 @@ const props = defineProps({
     }
 })
 
-const showPerformancePlan = shallowRef(false)
 const { formData, listingSubmit, amount } = useHdWROrder()
 const accountStore = useAccountStore()
 const formRef = shallowRef<FormInstance>()
+const performanceRef = shallowRef()
 const refresh = shallowRef(false) // 是否刷新父组件数据
 const showModal = shallowRef(true)
 //const dataList = shallowRef<Model.HoldLBRsp[]>([]) //现货仓单列表
 const selectedRow = shallowRef<Model.HoldLBRsp>() //选中的现货仓单
-const performance = shallowRef<Partial<Model.PerformancePlanRsp>>({}) //选中的履约模板
 
 
 // 表单验证规则
@@ -117,16 +113,6 @@ 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)
@@ -136,8 +122,10 @@ const onPerformanceTmpChange = (item: Model.PermancePlanTmpRsp) => {
 
 // 关闭弹窗
 const closed = (isRefresh = false) => {
-    refresh.value = isRefresh
-    showModal.value = false
+    if (performanceRef.value?.closed()) {
+        refresh.value = isRefresh
+        showModal.value = false
+    }
 }
 
 // 提交挂牌
@@ -184,16 +172,6 @@ onMounted(() => {
 defineExpose({
     closed,
 })
-
-// 离开页面前关闭组件
-onBeforeRouteLeave((to, from, next) => {
-    if (showPerformancePlan.value) {
-        showPerformancePlan.value = false
-        next(false)
-    } else {
-        next()
-    }
-})
 </script>
 
 <style lang="less">

+ 3 - 3
src/packages/pc/components/base/upload/index.vue

@@ -12,14 +12,14 @@
                 <el-button type="primary">上传</el-button>
             </slot>
         </el-upload>
-        <el-image-viewer :url-list="imageList.map((e)=>e.filePath)" :initial-index="imageIndex" @close="onViewerClose"
+        <el-image-viewer :url-list="imageList.map((e) => e.filePath)" :initial-index="imageIndex" @close="onViewerClose"
             v-if="showViewer" teleported />
     </div>
 </template>
 
 <script lang="ts" setup>
 import { shallowRef, shallowReactive, computed, PropType, toRaw, onMounted } from 'vue'
-import { ElMessage, UploadProps, UploadUserFile, UploadRawFile, UploadFile, UploadFiles, UploadInstance, genFileId } from 'element-plus'
+import { ElMessage, UploadProps, UploadRawFile, UploadFile, UploadFiles, UploadInstance, genFileId } from 'element-plus'
 import { getFileUrl } from '@/filters'
 import service from '@/services'
 
@@ -47,7 +47,7 @@ const emit = defineEmits(['change'])
 const { uploadUrl } = service.config
 const uploadRef = shallowRef<UploadInstance>()
 const showViewer = shallowRef(false)
-const fileList = shallowRef<UploadUserFile[]>([])
+const fileList = shallowRef<UploadFiles>([])
 const acceptTypes = shallowReactive<string[]>([]) // 接受上传的文件类型
 const uploadTypes = shallowReactive<string[]>([]) // 允许上传的文件类型
 const imageIndex = shallowRef(0)

+ 25 - 21
src/packages/pc/views/account/sign/components/certification/index.vue

@@ -1,23 +1,24 @@
 <!-- 账户管理-实名认证 -->
 <template>
     <app-drawer title="实名认证" v-model:show="show" :width="500" :loading="loading" :refresh="refresh">
-        <el-form ref="formRef" class="el-form--vertical" label-width="100px" :rules="formRules">
-            <el-form-item prop="username" label="姓名">
-                <el-input placeholder="请输入用户姓名" v-model="formData.username" name="username" :rules="formRules.username" />
-            </el-form-item>
-            <el-form-item prop="cardnum" label="证件号码">
-                <el-input placeholder="请输入证件号码" v-model="formData.cardnum" name="cardnum" :rules="formRules.cardnum" />
-            </el-form-item>
+        <el-form ref="formRef" class="el-form--vertical" label-width="120px" :model="formData" :rules="formRules">
             <el-form-item label="证件类型" prop="cardtype">
                 <el-select v-model="formData.cardtype">
-                    <el-option :label="item.label" :value="item.value" v-for="(item, index) in enums" :key="index" />
+                    <el-option :label="item.label" :value="item.value" v-for="(item, index) in getCertificateTypeList()"
+                        :key="index" />
                 </el-select>
             </el-form-item>
-            <el-form-item label="证件正面照片">
+            <el-form-item prop="username" label="姓名">
+                <el-input placeholder="请输入用户姓名" v-model="formData.username" />
+            </el-form-item>
+            <el-form-item prop="cardnum" label="证件号码">
+                <el-input placeholder="请输入证件号码" v-model="formData.cardnum" />
+            </el-form-item>
+            <el-form-item prop="cardfrontphotourl" label="证件正面照片">
                 <app-upload :file-types="['image']" type-message="请选择正确的图片类型" @change="b_afterRead"
                     :rules="formRules.cardfrontphotourl" />
             </el-form-item>
-            <el-form-item label="证件反面照片">
+            <el-form-item prop="cardbackphotourl" label="证件反面照片">
                 <app-upload :file-types="['image']" type-message="请选择正确的图片类型" @change="f_afterRead"
                     :rules="formRules.cardbackphotourl" />
             </el-form-item>
@@ -30,7 +31,7 @@
 </template>  
 
 <script lang="ts" setup>
-import { ref, computed } from 'vue'
+import { ref } from 'vue'
 import { ElMessage, FormInstance, FormRules } from 'element-plus'
 import { getCertificateTypeList } from "@/constants/account";
 import { addAuthReq } from '@/business/user'
@@ -42,15 +43,14 @@ const refresh = ref(false)
 const formRef = ref<FormInstance>()
 const { formData, formSubmit, loading } = addAuthReq()
 
-/// 获取对应的证件枚举类型
-const enums = computed(() => { return getCertificateTypeList().map(obj => { return { label: obj.label, value: obj.value } }) })
-
-const b_afterRead = (filePath: string) => {
+const b_afterRead = ({ filePath }: { filePath: string }) => {
     formData.cardfrontphotourl = filePath
+    formRef.value?.validateField('cardfrontphotourl')
 }
 
-const f_afterRead = (filePath: string) => {
+const f_afterRead = ({ filePath }: { filePath: string }) => {
     formData.cardbackphotourl = filePath
+    formRef.value?.validateField('cardbackphotourl')
 }
 
 // 表单验证规则
@@ -81,11 +81,15 @@ const onCancel = (isRefresh = false) => {
 }
 
 const onSubmit = () => {
-    formSubmit().then(() => {
-        ElMessage.success('实名认证提交请求成功')
-        onCancel(true)
-    }).catch((err) => {
-        ElMessage.error('实名认证提交请求失败:' + err)
+    formRef.value?.validate((valid) => {
+        if (valid) {
+            formSubmit().then(() => {
+                ElMessage.success('实名认证提交请求成功')
+                onCancel(true)
+            }).catch((err) => {
+                ElMessage.error('实名认证提交请求失败:' + err)
+            })
+        }
     })
 }
 </script>

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

@@ -3,7 +3,7 @@
     <app-table :data="tableList" v-model:columns="tableColumns" :loading="loading" @row-click="onRowClick" showIndex>
         <!-- 规格 -->
         <template #spec="{ row }">
-            {{ row.agreeunit + getGoodsUnitName(row.goodunitid) }}
+            {{ handleNumberValue(row.agreeunit, getGoodsUnitName(row.goodunitid)) }}
         </template>
         <!-- 卖价 -->
         <template #ask="{ row }">

BIN
src/packages/qxst/assets/images/hongbao-open.png


BIN
src/packages/qxst/assets/images/hongbao.png