li.shaoyi 2 năm trước cách đây
mục cha
commit
aab8bf555a

+ 1 - 2
src/business/auth/index.ts

@@ -97,8 +97,7 @@ export function useAuth(autoLogin = false) {
                 throw '登录失败'
             }
         } catch (err) {
-            loading.value = false
-            setAutoLoginData()
+            logout(() => loading.value = false)
             return Promise.reject(err)
         }
     }

+ 1 - 1
src/packages/mobile/components/layouts/form/index.vue

@@ -3,7 +3,7 @@
         <div class="app-form__header">
             <slot name="header"></slot>
         </div>
-        <Form ref="formRef" class="register-form" @submit="formSubmit">
+        <Form ref="formRef" class="app-form__body" @submit="formSubmit">
             <slot></slot>
         </Form>
         <div class="app-form__footer">

+ 18 - 13
src/packages/mobile/views/purchase/detail/index.vue

@@ -36,7 +36,7 @@
                 </Field>
                 <Field label="剩余数量" v-if="selectedDate">
                     <template #input>
-                        <span>{{ selectedDate.remainqty.toString() + getGoodsUnitName(goodsinfo.unitid) }}</span>
+                        <span>{{ maxQty.toString() + getGoodsUnitName(goodsinfo.unitid) }}</span>
                     </template>
                 </Field>
                 <Field v-model="formData.Qty" name="Qty" type="digit" label="采购数量" :rules="formRules.Qty">
@@ -50,7 +50,7 @@
                 </Field>
                 <Field label="预付款(含定金)" v-if="selectedDate">
                     <template #input>
-                        <span style="color:#999">{{ `${deposit}(≤${avaiableMoney.toFixed(2)}元)` }}</span>
+                        <span style="color:#999">{{ `${totalAmount}(≤${avaiableMoney.toFixed(2)}元)` }}</span>
                     </template>
                 </Field>
                 <Field label="收货信息" name="addressInfo" :rules="formRules.addressInfo" @click="openComponent('address')"
@@ -155,8 +155,18 @@ const presaleApplyDeposits = computed(() => {
     return result.sort((a, b) => b.value - a.value)
 })
 
-// 计算定金
-const deposit = computed(() => {
+// 计算可用数量
+const maxQty = computed(() => {
+    const { remainqty = 0 } = selectedDate.value ?? {}
+    const { type, qty = 0 } = presaleApplyDeposits.value.find((e) => e.value === formData.value.DepositRate) ?? {}
+    if (type === 2) {
+        return Math.min(qty, remainqty)
+    }
+    return remainqty
+})
+
+// 计算总金额
+const totalAmount = computed(() => {
     const { Qty = 0, DepositRate = 0 } = formData.value
     const { unitprice = 0 } = selectedDate.value ?? {}
     return (unitprice * DepositRate * Qty).toFixed(2)
@@ -207,16 +217,11 @@ const formRules: { [key in keyof Proto.SpotPresaleDestingOrderReq | 'addressInfo
     Qty: [{
         message: '请输入采购数量',
         validator: (val) => {
-            if (val) {
-                const deposit = presaleApplyDeposits.value.find((e) => e.value === formData.value.DepositRate)
-                if (deposit) {
-                    const qty = Number(val)
-                    if (qty > 0 && qty <= deposit.qty) {
-                        return true
-                    }
-                    return '采购数量不能大于 ' + deposit.qty
+            if (val && Number(val)) {
+                if (Number(val) <= maxQty.value) {
+                    return true
                 }
-                return true
+                return `采购数量不能大于 ${maxQty.value} ${getGoodsUnitName(goodsinfo.value.unitid)}`
             }
             return false
         }

+ 1 - 6
src/packages/pc/components/layouts/page/index.vue

@@ -21,10 +21,7 @@
         <div class="app-page__container">
           <router-view v-slot="{ Component, route }">
             <transition name="view" mode="out-in">
-              <!--组件缓存-->
-              <keep-alive :exclude="state.excludeViews">
-                <component :is="handleComponent(Component, route)" :key="route.fullPath" />
-              </keep-alive>
+              <component :is="handleComponent(Component, route)" :key="route.fullPath" />
             </transition>
           </router-view>
         </div>
@@ -40,13 +37,11 @@
 import { ref } from 'vue'
 import { RouteRecordNormalized, RouteRecordName } from 'vue-router'
 import client from '@/utils/client'
-import historyRouter from '../../../router/historyRouter'
 import AppHeader from '../header/index.vue'
 import AppFooter from '../footer/index.vue'
 import AppNavbar from '../navbar/index.vue'
 import AppSidebar from '../sidebar/index.vue'
 
-const { state } = historyRouter;
 const isCollapse = ref(client.state.isMobile);
 
 // 手动给组件添加 name 属性,处理缓存 exclude 无效的问题

+ 10 - 2
src/packages/pc/views/ratio/components/history/index.vue

@@ -1,6 +1,10 @@
 <template>
     <app-drawer title="比例流水" :width="960" v-model:show="show">
         <app-table :data="dataList" :columns="tableColumns" :loading="loading" border>
+            <!-- 变更时间 -->
+            <template #updatetime="{ value }">
+                {{ formatDate(value) }}
+            </template>
             <template #footer>
                 <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
                     @change="onRefresh" />
@@ -12,6 +16,7 @@
 <script lang="ts" setup>
 import { shallowRef, PropType } from 'vue'
 import { ElMessage } from 'element-plus'
+import { formatDate } from '@/filters'
 import { useDataTable } from '@/hooks/datatable'
 import { queryTHJInvesotrDepositLog } from '@/services/api/common'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
@@ -30,12 +35,12 @@ const show = shallowRef(true)
 const loading = shallowRef(false)
 
 const tableColumns = shallowRef<Model.TableColumn[]>([
-    { prop: 'updatetime', label: '变更时间' },
+    { prop: 'updatetime', label: '变更时间', width: 180 },
     { prop: 'oridepositqty', label: '变更前' },
     { prop: 'changeqty', label: '变更值' },
     { prop: 'curdepositqty', label: '变更后' },
     { prop: 'accountname', label: '采购人' },
-    { prop: 'wrtradedetailid', label: '采购单号', width: 180 },
+    { prop: 'wrtradedetailid', label: '采购单号', width: 200 },
 ])
 
 const getTHJInvesotrDepositLog = () => {
@@ -44,6 +49,9 @@ const getTHJInvesotrDepositLog = () => {
         data: {
             userid: props.selectedRow.userid,
             depositrate: props.selectedRow.depositrate,
+            page: pageIndex.value,
+            pagesize: pageSize.value,
+
         },
         success: (res) => {
             total.value = res.total

+ 1 - 1
src/stores/modules/futures.ts

@@ -156,7 +156,7 @@ const handleQuote = timerInterceptor.setThrottle(() => {
             Object.entries(item).forEach(([key, value]) => {
                 // 只更新存在的属性
                 if (Reflect.has(quote, key)) {
-                    Object.defineProperty(quote, key, value)
+                    Object.defineProperty(quote, key, { value })
                 }
             })
             quote.last = last