li.shaoyi 4 년 전
부모
커밋
bbbfc697b2

+ 1 - 1
src/common/setup/table/button.ts

@@ -15,7 +15,7 @@ import router from '@/router'
 export function getClassName(val: string): BtnClassName {
     let result: BtnClassName = 'btnDeafault'
     const btnDanger = ['disable', 'cancle', 'cancel', 'delete', 'logout', 'locked', 'refuse']
-    const operBtn = ['add', 'modify', 'reset', 'credit', 'payment', 'confirm_withdrawal', 'complete_stocking', 'upload_logistics', 'buy', 'listed', 'delisting',
+    const operBtn = ['add', 'modify', 'check', 'reset', 'credit', 'payment', 'confirm_withdrawal', 'complete_stocking', 'upload_logistics', 'buy', 'listed', 'delisting',
         'receipt', 'confirm_pickup']
     const map = new Map<BtnClassName, string[]>([
         ['btnDanger', btnDanger],

+ 13 - 9
src/services/go/adress/index.ts

@@ -10,7 +10,7 @@ export function getAddress() {
     const city: Addresss[] = []; // 市
     const district: Addresss[] = []; // 区
     // 获取地址数据
-    request({ method: 'get', url: './config/address.json' }).then(res => {
+    const addressList = request({ method: 'get', url: './config/address.json' }).then(res => {
         res.data.forEach((el: Addresss) => {
             const { divisionlevel } = el;
             if (divisionlevel === 'city') { // 市
@@ -29,20 +29,24 @@ export function getAddress() {
      * @param autoid 省id
      */
     function getCityList(autoid: number) {
-        const province = provinceList.value.find(e => e.autoid === autoid)
-        if (province) {
-            cityList.value = city.filter(e => e.parentcode === province.divisioncode)
-        }
+        addressList.then(() => {
+            const province = provinceList.value.find(e => e.autoid === autoid)
+            if (province) {
+                cityList.value = city.filter(e => e.parentcode === province.divisioncode)
+            }
+        })
     }
     /**
      * 获取 区  数据
      * @param autoid 市 id
      */
     function getDistrictList(autoid: number) {
-        const temp = city.find(e => e.autoid === autoid)
-        if (temp) {
-            districtList.value = district.filter(e => e.parentcode === temp.divisioncode)
-        }
+        addressList.then(() => {
+            const temp = city.find(e => e.autoid === autoid)
+            if (temp) {
+                districtList.value = district.filter(e => e.parentcode === temp.divisioncode)
+            }
+        })
     }
     function getName(arr: Addresss[], autoid: number): string {
         const temp = arr.find(e => e.autoid === autoid)

+ 9 - 0
src/views/iframe/index.vue

@@ -7,10 +7,19 @@
 
 <script lang="ts">
 import { defineComponent } from 'vue';
+import { onBeforeRouteLeave } from 'vue-router';
 import { getIframeUrl } from './setup';
+import { QueryDeliveryGoodsDetail } from '@/services/go/ermcp/goodsInfo/index';
 
 export default defineComponent({
     setup() {
+        onBeforeRouteLeave((to, from, next) => {
+            // 路由跳转查询现货商品,解决新增商品后本地缓存无数据
+            if (from.path.includes('/info/goods')) {
+                QueryDeliveryGoodsDetail();
+            }
+            next();
+        });
         return {
             ...getIframeUrl(),
         };

+ 8 - 23
src/views/information/account_info/compoments/unlocked-business/index.vue

@@ -1,20 +1,11 @@
 <template>
-  <!-- 解锁业务账户 -->
-  <a-modal class="add-custom"
-           title="解锁业务账户"
-           v-model:visible="visible"
-           @cancel="cancel"
-           centered
-           :maskClosable="false"
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="submit">解锁</a-button>
-    </template>
-    <Detail :selectedData="selectedRow" />
-  </a-modal>
+    <!-- 解锁业务账户 -->
+    <a-modal class="add-custom" title="解锁业务账户" v-model:visible="visible" @cancel="cancel" centered :maskClosable="false" width="890px">
+        <template #footer>
+            <a-button key="submit" type="primary" :loading="loading" @click="submit">解锁</a-button>
+        </template>
+        <Detail :selectedData="selectedRow" />
+    </a-modal>
 </template>
 
 <script lang="ts">
@@ -68,10 +59,4 @@ export default defineComponent({
         };
     },
 });
-</script>
-
-<style lang="less">
-.add-custom {
-}
-</style
->;
+</script>

+ 4 - 4
src/views/information/account_info/list/account_info_business/index.vue

@@ -55,7 +55,7 @@ import { handlerManagerList } from '@/common/setup/user';
 import { getLoginStatusEnumItemName } from '@/common/constants/enumsName';
 import { ErmcpLoginUserEx } from '@/services/go/ermcp/account/interface';
 import { getUserName } from '@/services/bus/user';
-import { _handleTableList } from '../setup';
+import { handleTableList } from '../setup';
 import { ref } from 'vue';
 import { handleModalComponent } from '@/common/setup/asyncComponent';
 import { getTableButton } from '@/common/setup/table/button';
@@ -71,8 +71,8 @@ export default defineComponent({
         account_spot_add: defineAsyncComponent(() => import('../../compoments/add-business/index.vue')),
         account_spot_resetpwd: defineAsyncComponent(() => import('../../compoments/reset-business/index.vue')),
         account_spot_locked: defineAsyncComponent(() => import('../../compoments/locked-business/index.vue')),
+        account_spot_unlocked: defineAsyncComponent(() => import('../../compoments/unlocked-business/index.vue')),
         account_spot_cancel: defineAsyncComponent(() => import('../../compoments/cancel-business/index.vue')),
-        account_info_business_btn_unlocked: defineAsyncComponent(() => import('../../compoments/unlocked-business/index.vue')),
     },
     setup() {
         // 加载状态
@@ -80,11 +80,11 @@ export default defineComponent({
         const { tableList, queryTable } = handlerManagerList(loading, 1);
 
         const firstBtn = getTableButton(['account_spot_add']);
-        const secondBtn = getTableButton(['account_spot_modify', 'account_spot_resetpwd', 'account_spot_locked', 'account_spot_cancel', 'detail']);
+        const secondBtn = getTableButton(['account_spot_add'], true);
 
         // 处理根据状态显示对应按钮
         function handleBtnAction() {
-            _handleTableList(queryTable, tableList, secondBtn);
+            handleTableList(queryTable, tableList, secondBtn);
         }
 
         // 弹窗选中的数据

+ 2 - 2
src/views/information/account_info/list/account_info_manager/index.vue

@@ -78,9 +78,9 @@ export default defineComponent({
         MtpTableButton,
         filterCustomTable,
         detail: defineAsyncComponent(() => import('../../compoments/detail-managers/index.vue')), // 详情
-        account_manager_add: defineAsyncComponent(() => import('../../compoments/add-managers/index.vue')), // 新增权限模板
+        account_manager_add: defineAsyncComponent(() => import('../../compoments/add-managers-permission/index.vue')), // 新增权限模板
         account_manager_setting: defineAsyncComponent(() => import('../../compoments/managers-permission/index.vue')), // 权限设置
-        account_manager_child_add: defineAsyncComponent(() => import('../../compoments/add-managers-permission/index.vue')), // 新增角色
+        account_manager_child_add: defineAsyncComponent(() => import('../../compoments/add-managers/index.vue')), //  新增角色
         account_manager_child_modify: defineAsyncComponent(() => import('../../compoments/modify-managers/index.vue')), // 修改
         account_trade_child_cancel: defineAsyncComponent(() => import('../../compoments/cancel-managers/index.vue')), // 注销
         account_manager_child_locked: defineAsyncComponent(() => import('../../compoments/locked-managers/index.vue')), // 锁定

+ 0 - 22
src/views/information/account_info/list/setup.ts

@@ -99,28 +99,6 @@ export function handleModalData<T extends object>() {
     return { selectedData, openAction }
 }
 
-export function _handleTableList(fn: Function, tableList: Ref<ErmcpLoginUserEx[]>, btnList: BtnListType[]) {
-    fn().then(() => {
-        tableList.value.forEach((el) => {
-            // 过滤无效
-            const arr = el.userlist.filter((item) => item.loginstatus !== 3);
-            arr.forEach((item) => {
-                const { loginstatus } = item;
-                let result = [...btnList];
-                if (loginstatus === 1) {
-                    // 正常
-                    result = btnList.filter((e) => e.lable !== '解锁');
-                } else if (loginstatus === 2) {
-                    // 冻结
-                    result = btnList.filter((e) => e.lable === '解锁' || e.lable === '详情');
-                }
-                Object.assign(item, { btnList: result });
-            });
-            Object.assign(el, { userlist: arr });
-        });
-    });
-}
-
 export function handleTableList(fn: Function, tableList: Ref<ErmcpLoginUserEx[]>, btnList: BtnListType[]) {
     fn().then(() => {
         tableList.value.forEach((el) => {