li.shaoyi 3 năm trước cách đây
mục cha
commit
76b8455fdf

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

@@ -1,4 +1,5 @@
 import { shallowRef, reactive } from 'vue'
+import { formatDate } from '@/filters'
 import { useDataTable } from '@/hooks/datatable'
 import { EchartsDataset } from '@/hooks/echarts/line/interface'
 import { queryTHJPurchaseTransfer, queryTHJPurchaseTransferDetail } from '@/services/api/contract'
@@ -59,7 +60,7 @@ export function useContractDetails(wrstandardid: number) {
 
                 res.data.history.forEach(({ c, ts }) => {
                     chartData.price.push(c)
-                    chartData.date.push(ts)
+                    chartData.date.push(formatDate(ts))
                 })
             },
             complete: () => {

+ 1 - 1
src/packages/mobile/App.vue

@@ -16,7 +16,7 @@ eventBus.$on('LogoutNotify', (msg) => {
     if (msg) {
       dialog(msg as string)
     }
-    router.replace({ name: 'login' })
+    router.replace({ name: 'UserLogin' })
   })
 })
 </script>

+ 32 - 45
src/packages/mobile/router/index.ts

@@ -9,7 +9,7 @@ const { getToken } = useLoginStore()
 const routes: Array<RouteRecordRaw> = [
   {
     path: '/:pathMatch(.*)*',
-    name: 'error',
+    name: 'Error',
     component: () => import('../views/error/404.vue'),
     meta: {
       ignoreAuth: true,
@@ -17,7 +17,7 @@ const routes: Array<RouteRecordRaw> = [
   },
   {
     path: '/boot',
-    name: 'boot',
+    name: 'Boot',
     component: () => import('../views/boot/index.vue'),
     meta: {
       ignoreAuth: true,
@@ -29,62 +29,49 @@ const routes: Array<RouteRecordRaw> = [
     children: [
       {
         path: '',
-        name: 'home',
+        name: 'Home',
         component: () => import('../views/home/index.vue'),
       }
     ]
   },
   {
-    path: '/login',
+    path: '/user',
     component: Page,
     children: [
       {
-        path: '',
-        name: 'login',
+        path: 'login',
+        name: 'UserLogin',
         component: () => import('../views/user/login/index.vue'),
         meta: {
           ignoreAuth: true,
         },
-      }
-    ]
-  },
-  {
-    path: '/logoff',
-    component: Page,
-    children: [
-      {
-        path: '',
-        name: 'logoff',
-        component: () => import('../views/user/logoff/index.vue'),
-      }
-    ]
-  },
-  {
-    path: '/register',
-    component: Page,
-    children: [
+      },
       {
-        path: '',
-        name: 'register',
+        path: 'register',
+        name: 'UserRegister',
         component: () => import('../views/user/register/index.vue'),
         meta: {
           ignoreAuth: true,
         },
-      }
-    ]
-  },
-  {
-    path: '/forget',
-    component: Page,
-    children: [
+      },
       {
-        path: '',
-        name: 'forget',
+        path: 'forget',
+        name: 'UserForget',
         component: () => import('../views/user/forget/index.vue'),
         meta: {
           ignoreAuth: true,
         },
       },
+      {
+        path: 'logoff',
+        name: 'UserLogoff',
+        component: () => import('../views/user/logoff/index.vue'),
+      },
+      {
+        path: 'password',
+        name: 'UserPassword',
+        component: () => import('../views/user/password/index.vue'),
+      },
     ]
   },
   {
@@ -358,18 +345,18 @@ const routes: Array<RouteRecordRaw> = [
     ]
   },
   {
-    path: '/setting',
+    path: '/navigation',
     component: Page,
     children: [
       {
-        path: '',
-        name: 'setting',
-        component: () => import('../views/setting/main/index.vue'),
+        path: 'setting',
+        name: 'NavigationSetting',
+        component: () => import('../views/navigation/setting/index.vue'),
       },
       {
-        path: 'password',
-        name: 'setting-password',
-        component: () => import('../views/setting/password/index.vue'),
+        path: 'invoice',
+        name: 'NavigationInvoice',
+        component: () => import('../views/navigation/invoice/index.vue'),
       },
     ]
   }
@@ -388,16 +375,16 @@ router.beforeEach((to, from, next) => {
       next();
     } else {
       next({
-        name: 'login',
+        name: 'UserLogin',
         query: { redirect: to.fullPath },
       });
     }
   } else {
-    if (to.name === 'boot' || to.name === 'login') {
+    if (to.name === 'Boot' || to.name === 'UserLogin') {
       next();
     } else {
       next({
-        name: 'boot',
+        name: 'Boot',
         query: { redirect: to.fullPath },
       });
     }

+ 1 - 1
src/packages/mobile/views/boot/index.vue

@@ -55,7 +55,7 @@ const skip = () => {
   plus.exitFullSreen()
   // 判断服务是否初始化完成
   if (state.loading) {
-    router.replace('/login')
+    router.replace('/user/login')
   } else {
     const redirect = route.query.redirect
     if (redirect) {

+ 13 - 6
src/packages/mobile/views/goods/details/index.vue

@@ -33,16 +33,23 @@
                         <div class="form-qty">
                             <div class="form-qty__input">
                                 <input type="number" v-model="formData.Qty" placeholder="必填" />
-                                <span v-if="selectedDate">≤{{ selectedDate.remainqty }}{{
-                                        getGoodsUnitName(goodsinfo.unitid)
-                                }}</span>
                             </div>
                             <div class="form-qty__label">
-                                <span>定金{{ deposit }}元</span>
+                                <span> 预付款(含定金){{ deposit }}元</span>
                             </div>
                         </div>
                     </template>
                 </Field>
+                <Field label="可用数量" v-if="selectedDate">
+                    <template #input>
+                        <span>{{ selectedDate.remainqty.toString() + getGoodsUnitName(goodsinfo.unitid) }}</span>
+                    </template>
+                </Field>
+                <Field label="参考价" v-if="selectedDate">
+                    <template #input>
+                        <span>{{ `${selectedDate.unitprice ?? 0.00}元/${getGoodsUnitName(goodsinfo.unitid)}` }}</span>
+                    </template>
+                </Field>
                 <Field label="收货信息" name="addressInfo" :rules="formRules.addressInfo" @click="openComponent('address')"
                     is-link v-if="showAddressInfo">
                     <template #input>
@@ -65,10 +72,10 @@
             <div class="submitbar">
                 <Button type="primary" @click="formRef?.submit" round block>采购下单</Button>
             </div>
-            <div class="titlebar" v-if="selectedDate">
+            <!-- <div class="titlebar" v-if="selectedDate">
                 <span>参考价(元/{{ getGoodsUnitName(goodsinfo.unitid) }})</span>
                 <span>{{ selectedDate.unitprice ?? 0.00 }}</span>
-            </div>
+            </div> -->
             <template v-if="chartData.price.length">
                 <Divider>历史价格走势</Divider>
                 <div class="chart">

+ 4 - 10
src/packages/mobile/views/home/components/mine/index.vue

@@ -59,12 +59,6 @@
         <li @click="routerTo('my-wareorder')">
           <app-iconfont icon="icon-wodecangdan" label-direction="bottom">我的仓单</app-iconfont>
         </li>
-        <li @click="routerTo('mine-invoice')">
-          <app-iconfont icon="icon-fapiaoxinxi" label-direction="bottom">发票信息</app-iconfont>
-        </li>
-        <li @click="routerTo('mine-address')">
-          <app-iconfont icon="icon-shouhuodizhi" label-direction="bottom">收货地址</app-iconfont>
-        </li>
       </ul>
     </div>
     <div class="g-navmenu">
@@ -90,9 +84,9 @@
             <app-iconfont icon="icon-guanyuzhengce">关于隐私</app-iconfont>
           </template>
         </Cell>
-        <Cell is-link :to="{ name: 'rules-fpsm' }">
+        <Cell is-link :to="{ name: 'NavigationInvoice' }">
           <template #title>
-            <app-iconfont icon="icon-fapiaoshuoming">发票说明</app-iconfont>
+            <app-iconfont icon="icon-fapiaoshuoming">关于发票</app-iconfont>
           </template>
         </Cell>
         <Cell is-link :to="{ name: 'rules-fwrx' }">
@@ -100,7 +94,7 @@
             <app-iconfont icon="icon-kefurexian">服务热线</app-iconfont>
           </template>
         </Cell>
-        <Cell is-link :to="{ name: 'setting' }">
+        <Cell is-link :to="{ name: 'NavigationSetting' }">
           <template #title>
             <app-iconfont icon="icon-shezhi">设置</app-iconfont>
           </template>
@@ -110,7 +104,7 @@
             <app-iconfont icon="icon-guanyuwomen">关于我们</app-iconfont>
           </template>
         </Cell>
-        <Cell is-link :to="{ name: 'logoff' }">
+        <Cell is-link :to="{ name: 'UserLogoff' }">
           <template #title>
             <app-iconfont icon="icon-zhuxiaofuwu">注销服务</app-iconfont>
           </template>

+ 4 - 3
src/packages/mobile/views/mine/address/index.vue

@@ -3,7 +3,7 @@
         <template #header>
             <app-navbar title="收货地址管理" />
         </template>
-        <RadioGroup class="mine-address__container" v-model="selectedRow" v-if="dataList.length">
+        <RadioGroup class="mine-address__container" v-model="checkedRow" v-if="dataList.length">
             <ul class="list">
                 <li class="list-item" v-for="(item, index) in dataList" :key="index">
                     <div class="list-item__checkbox" @click="onChange(item)" v-if="showRadio">
@@ -61,11 +61,12 @@ const props = defineProps({
 const emit = defineEmits(['change'])
 const { dataList, getUserAddressList } = useAddress()
 const { componentRef, componentId, openComponent, closeComponent } = useComponent(getUserAddressList)
-const selectedRow = shallowRef(props.checked)
+const checkedRow = shallowRef(props.checked)
+const selectedRow = shallowRef()
 
 // 选择地址
 const onChange = (item: Model.UserReceiveInfoRsp) => {
-    selectedRow.value = item
+    checkedRow.value = item
     emit('change', item)
 }
 

+ 4 - 3
src/packages/mobile/views/mine/invoice/index.vue

@@ -3,7 +3,7 @@
         <template #header>
             <app-navbar title="发票信息" />
         </template>
-        <RadioGroup class="mine-invoice__container" v-model="selectedRow" v-if="dataList.length">
+        <RadioGroup class="mine-invoice__container" v-model="checkedRow" v-if="dataList.length">
             <ul class="list">
                 <li class="list-item" v-for="(item, index) in dataList" :key="index">
                     <div class="list-item__checkbox" @click="onChange(item)" v-if="showRadio">
@@ -58,11 +58,12 @@ const props = defineProps({
 const emit = defineEmits(['change'])
 const { dataList, getUserInvoiceList } = useInvoice()
 const { componentRef, componentId, openComponent, closeComponent } = useComponent(getUserInvoiceList)
-const selectedRow = shallowRef(props.checked)
+const checkedRow = shallowRef(props.checked)
+const selectedRow = shallowRef()
 
 // 选择发票
 const onChange = (item: Model.WrUserReceiptInfoRsp) => {
-    selectedRow.value = item
+    checkedRow.value = item
     emit('change', item)
 }
 

+ 37 - 2
src/packages/mobile/views/mine/order/list/components/purchasetrade/index.vue

@@ -3,14 +3,49 @@
         <app-pull-refresh v-model:error="error" v-model:pageIndex="pageIndex" :page-count="pageCount"
             @refresh="onRefresh">
             <app-list :columns="columns" :data-list="dataList" @click="onClick" />
-            <!-- <Button>更多</Button> -->
+            <!-- <ul>
+                <li v-for="(item, index) in dataList" :key="index">
+                    <div>
+                        <div>
+                            <span>{{ item.warehousename }}</span>
+                            <span>{{ item.enddatemonth }}</span>
+                            <span>{{ item.depositrate }}</span>
+                            <span>{{ item.tradeqty }}</span>
+                        </div>
+                        <div>
+                            <span>{{ item.thjorderstatusdisplay }}</span>
+                        </div>
+                    </div>
+                    <div>
+                        <table>
+                            <tr>
+                                <td>定金</td>
+                                <td>{{ item.payeddeposit }}</td>
+                                <td>参考价</td>
+                                <td>0</td>
+                                <td>到期日</td>
+                                <td>0</td>
+                            </tr>
+                            <tr>
+                                <td>购买价</td>
+                                <td>0</td>
+                                <td>实际价</td>
+                                <td>0</td>
+                                <td>尾款</td>
+                                <td>0</td>
+                            </tr>
+                        </table>
+                        <Button @click="onClick(item)">详情</Button>
+                    </div>
+                </li>
+            </ul> -->
         </app-pull-refresh>
     </app-view>
 </template>
 
 <script lang="ts" setup>
-
 import { shallowRef } from 'vue'
+import { Button } from 'vant'
 import { useNavigation } from '@/hooks/navigation'
 import { useTHJPurchaseTradeDetail } from '@/business/order'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'

+ 18 - 0
src/packages/mobile/views/navigation/invoice/index.vue

@@ -0,0 +1,18 @@
+<template>
+    <app-view class="navmenu-invoice" :loading="false">
+        <template #header>
+            <app-navbar title="发票" />
+        </template>
+        <div class="g-navmenu" style="margin-top:.2rem">
+            <CellGroup>
+                <Cell title="发票说明" :to="{ name: 'rules-fpsm' }" is-link />
+                <Cell title="发票信息" :to="{ name: 'mine-invoice' }" is-link />
+                <Cell title="收货地址" :to="{ name: 'mine-address' }" is-link />
+            </CellGroup>
+        </div>
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+import { Cell, CellGroup } from 'vant'
+</script>

+ 2 - 2
src/packages/mobile/views/setting/main/index.vue → src/packages/mobile/views/navigation/setting/index.vue

@@ -1,11 +1,11 @@
 <template>
-    <app-view class="setting">
+    <app-view class="navmenu-setting" :loading="false">
         <template #header>
             <app-navbar title="设置" />
         </template>
         <div class="g-navmenu" style="margin-top:.2rem">
             <CellGroup>
-                <Cell is-link :to="{ name: 'setting-password' }">
+                <Cell is-link :to="{ name: 'UserPassword' }">
                     <template #title>
                         <app-iconfont icon="icon-yonghuzhucexieyi">修改密码</app-iconfont>
                     </template>

+ 2 - 2
src/packages/mobile/views/user/login/index.vue

@@ -9,8 +9,8 @@
           :rules="[{ required: true, message: '请输入密码' }]" autocomplete="off" />
       </CellGroup>
       <div class="button-link">
-        <span @click="navigationTo('register')">用户注册</span>
-        <span @click="navigationTo('forget')">忘记密码</span>
+        <span @click="navigationTo('UserRegister')">用户注册</span>
+        <span @click="navigationTo('UserForget')">忘记密码</span>
       </div>
       <div class="button-submit">
         <Button type="primary" native-type="submit" round block>登录</Button>

+ 1 - 1
src/packages/mobile/views/setting/password/index.vue → src/packages/mobile/views/user/password/index.vue

@@ -1,5 +1,5 @@
 <template>
-    <app-view class="g-form setting-password">
+    <app-view class="g-form user-password">
         <template #header>
             <app-navbar title="修改密码" />
         </template>