li.shaoyi 4 年之前
父节点
当前提交
d2a20bf9a1

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

@@ -1,5 +1,5 @@
 <template>
-  <!-- 业务账户 -->
+  <!-- 账户管理 -->
   <div class="account_info_business account_info_container" :loading="loading">
     <filterCustomTable @search="search"></filterCustomTable>
     <div class="tltLeft">

+ 2 - 2
src/views/information/account_info/list/setup.ts

@@ -113,9 +113,9 @@ export function handleTableList(fn: Function, tableList: Ref<ErmcpLoginUserEx[]>
 export function handleBtnList(btnList: BtnListType[], item: ErmcpLoginUser) {
     switch (item.loginstatus) {
         case 1: // 正常
-            return btnList.filter((e) => e.lable !== '解');
+            return btnList.filter((e) => e.lable !== '解');
         case 2: // 冻结
-            return btnList.filter((e) => e.lable === '解' || e.lable === '详情');
+            return btnList.filter((e) => e.lable === '解' || e.lable === '详情');
     }
 };
 

+ 90 - 112
src/views/information/custom/index.vue

@@ -1,27 +1,13 @@
 <template>
   <!-- 客户资料 -->
-  <div class="plan_uncommitted"
-       :loading="loading">
+  <div class="plan_uncommitted" :loading="loading">
     <Filter @search="search">
-      <mtp-table-button class="btn-list-sticky"
-                        :buttons="addButton"
-                        @click="openComponent" />
+      <mtp-table-button class="btn-list-sticky" :buttons="addButton" @click="openComponent" />
     </Filter>
-    <a-table :columns="getColumns(columns)"
-             class="srcollYTable"
-             :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }"
-             :pagination="false"
-             :loading="loading"
-             :expandedRowKeys="expandedRowKeys"
-             :customRow="Rowclick"
-             rowKey="key"
-             :data-source="tableList">
+    <a-table :columns="getColumns(columns)" class="srcollYTable" :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }" :pagination="false" :loading="loading" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" rowKey="key" :data-source="tableList">
       <!-- 额外的展开行 -->
       <template #expandedRowRender="{ record }">
-        <mtp-table-button class="btn-list-sticky"
-                          :buttons="handleBtnList(buttons,record)"
-                          :record="record"
-                          @click="openComponent" />
+        <mtp-table-button class="btn-list-sticky" :buttons="handleBtnList(buttons,record)" :record="record" @click="openComponent" />
       </template>
       <template #status="{ text }">
         <a>{{ getStatusName(text) }}</a>
@@ -32,9 +18,6 @@
       <template #birthday="{text}">
         {{text && text !== '--' ? formatTime(text, 'd') : '--'}}
       </template>
-      <template #nickname="{record}">
-        {{record.username}}
-      </template>
       <template #userinfotype="{ text }">
         <a>{{ getUserInfoTypeName(text) }}</a>
       </template>
@@ -46,13 +29,8 @@
       </template>
     </a-table>
     <!-- 右键 -->
-    <contextMenu :contextMenu="contextMenu"
-                 @cancel="closeContext"
-                 :list="buttons"> </contextMenu>
-    <component :is="componentId"
-               v-if="componentId"
-               :selectedRow="selectedRow"
-               @cancel="closeComponent"> </component>
+    <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="buttons"> </contextMenu>
+    <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" @cancel="closeComponent"> </component>
   </div>
 </template>
 
@@ -72,95 +50,95 @@ import Filter from './compoments/filterTable/index.vue';
 import { pingan_custom_column, qian_hai_jin_custom_column } from './setup';
 
 export default defineComponent({
-    name: EnumRouterName.plan_audit,
-    components: {
-        contextMenu,
-        MtpTableButton,
-        Filter,
-        detail: defineAsyncComponent(() => import('./compoments/detail/index.vue')), // 详情
-        add: defineAsyncComponent(() => import('./compoments/add/index.vue')), // 新增
-        check: defineAsyncComponent(() => import('./compoments/check/index.vue')), // 审核
-        delete: defineAsyncComponent(() => import('./compoments/delete/index.vue')), // 删除
-        modify: defineAsyncComponent(() => import('./compoments/add/index.vue')), // 修改
-        recover: defineAsyncComponent(() => import('./compoments/recover/index.vue')), // 恢复
-        disable: defineAsyncComponent(() => import('./compoments/disable/index.vue')), // 停用
-        cancel: defineAsyncComponent(() => import('./compoments/cancel/index.vue')), // 撤销
-    },
-    setup() {
-        const { isRouterName } = useRouteName();
-        // 新增权限按钮
-        const addButton = getTableButton(['add']);
-        // 表格权限按钮
-        const buttons = getTableButton(['add'], true);
-        // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList<QhjCustomer>();
+  name: EnumRouterName.plan_audit,
+  components: {
+    contextMenu,
+    MtpTableButton,
+    Filter,
+    detail: defineAsyncComponent(() => import('./compoments/detail/index.vue')), // 详情
+    add: defineAsyncComponent(() => import('./compoments/add/index.vue')), // 新增
+    check: defineAsyncComponent(() => import('./compoments/check/index.vue')), // 审核
+    delete: defineAsyncComponent(() => import('./compoments/delete/index.vue')), // 删除
+    modify: defineAsyncComponent(() => import('./compoments/add/index.vue')), // 修改
+    recover: defineAsyncComponent(() => import('./compoments/recover/index.vue')), // 恢复
+    disable: defineAsyncComponent(() => import('./compoments/disable/index.vue')), // 停用
+    cancel: defineAsyncComponent(() => import('./compoments/cancel/index.vue')), // 撤销
+  },
+  setup() {
+    const { isRouterName } = useRouteName();
+    // 新增权限按钮
+    const addButton = getTableButton(['add']);
+    // 表格权限按钮
+    const buttons = getTableButton(['add'], true);
+    // 表格列表数据
+    const { loading, tableList, queryTable } = queryTableList<QhjCustomer>();
 
-        // 获取列表数据
-        const queryTableAction = () => {
-            const userid = getUserId();
-            if (isRouterName('custom_checkpending')) {
-                // 待审核
-                queryTable(queryCustomerInfo, { userid, querytype: 2, includesub: 1 });
-            } else if (isRouterName('custom_normal')) {
-                // 正常
-                queryTable(queryCustomerInfo, { userid, querytype: 3, includesub: 1 });
-            } else if (isRouterName('custom_disabled')) {
-                // 停用
-                queryTable(queryCustomerInfo, { userid, querytype: 4, includesub: 1 });
-            }
-        };
+    // 获取列表数据
+    const queryTableAction = () => {
+      const userid = getUserId();
+      if (isRouterName('custom_checkpending')) {
+        // 待审核
+        queryTable(queryCustomerInfo, { userid, querytype: 2, includesub: 1 });
+      } else if (isRouterName('custom_normal')) {
+        // 正常
+        queryTable(queryCustomerInfo, { userid, querytype: 3, includesub: 1 });
+      } else if (isRouterName('custom_disabled')) {
+        // 停用
+        queryTable(queryCustomerInfo, { userid, querytype: 4, includesub: 1 });
+      }
+    };
 
-        // 处理根据状态显示对应按钮
-        const handleBtnList = (btnList: BtnListType[], item: QhjCustomer) => {
-            switch (item.status) {
-                case 2: // 待审核
-                    return btnList.filter((e) => e.code !== 'modify');
-                case 5: // 拒绝审核
-                    return btnList.filter((e) => e.code !== 'check');
-                default:
-                    return btnList;
-            }
-        };
+    // 处理根据状态显示对应按钮
+    const handleBtnList = (btnList: BtnListType[], item: QhjCustomer) => {
+      switch (item.status) {
+        case 2: // 待审核
+          return btnList.filter((e) => e.code !== 'modify');
+        case 5: // 拒绝审核
+          return btnList.filter((e) => e.code !== 'check');
+        default:
+          return btnList;
+      }
+    };
 
-        // 表头
-        const getColumns = (columns: ColumnType[]) => {
-            if (isPingAnOem()) {
-                // 平安
-                return pingan_custom_column();
-            } else if (isQianHaiJin()) {
-                // 千海金
-                return qian_hai_jin_custom_column();
-            } else {
-                return columns;
-            }
-        };
+    // 表头
+    const getColumns = (columns: ColumnType[]) => {
+      if (isPingAnOem()) {
+        // 平安
+        return pingan_custom_column();
+      } else if (isQianHaiJin()) {
+        // 千海金
+        return qian_hai_jin_custom_column();
+      } else {
+        return columns;
+      }
+    };
 
-        // 搜索
-        function search() {}
+    // 搜索
+    function search() { }
 
-        // 表格通用逻辑
-        const param: ComposeTableParam = {
-            queryFn: queryTableAction,
-            menuType: EnumRouterName.plan_audit,
-            tableName: 'table_pcweb_userinfo',
-            tableFilterKey: ['userinfotype', 'nickname', 'customername', 'mobile'],
-            isDetail: true,
-        };
+    // 表格通用逻辑
+    const param: ComposeTableParam = {
+      queryFn: queryTableAction,
+      menuType: EnumRouterName.plan_audit,
+      tableName: 'table_pcweb_userinfo',
+      tableFilterKey: ['userinfotype', 'nickname', 'customername', 'mobile'],
+      isDetail: true,
+    };
 
-        return {
-            ...handleComposeTable<QhjCustomer>(param),
-            loading,
-            tableList,
-            getStatusName,
-            buttons,
-            addButton,
-            getUserInfoTypeName,
-            getCardTypeEnumItemName,
-            getColumns,
-            handleBtnList,
-            formatTime,
-            search,
-        };
-    },
+    return {
+      ...handleComposeTable<QhjCustomer>(param),
+      loading,
+      tableList,
+      getStatusName,
+      buttons,
+      addButton,
+      getUserInfoTypeName,
+      getCardTypeEnumItemName,
+      getColumns,
+      handleBtnList,
+      formatTime,
+      search,
+    };
+  },
 });
 </script>

+ 2 - 2
src/views/information/spot-contract/components/add/index.vue

@@ -48,14 +48,14 @@
             </a-col>
             <a-col :span="12">
               <a-form-item label="销售方">
-                <span class="white">{{ getRootUserInfo().nickname ?? getRootUserInfo().accountname }}</span>
+                <span class="white">{{ getRootUserInfo().accountname }}</span>
               </a-form-item>
             </a-col>
           </template>
           <template v-else>
             <a-col :span="12">
               <a-form-item label="采购方">
-                <span class="white">{{ getRootUserInfo().nickname ?? getRootUserInfo().accountname }}</span>
+                <span class="white">{{ getRootUserInfo().accountname }}</span>
               </a-form-item>
             </a-col>
             <a-col :span="12">

+ 78 - 75
src/views/information/spot-contract/list/purchase/index.vue

@@ -8,7 +8,7 @@
       <!-- 额外的展开行 -->
       <!-- 额外的展开行 -->
       <template #expandedRowRender="{ record }">
-        <mtp-table-button class="btn-list-sticky" :buttons="handleBtnList(secondBtn,record)" :record="record" @click="openComponent" />
+        <mtp-table-button class="btn-list-sticky" :buttons="handleBtnList(record)" :record="record" @click="openComponent" />
       </template>
       <template #biztype="{ text }">
         <a>{{ getBizTypeName(text) }}</a>
@@ -48,7 +48,7 @@
       </template>
     </a-table>
     <!-- 右键 -->
-    <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="secondBtn"> </contextMenu>
+    <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="handleBtnList(selectedRow)"> </contextMenu>
     <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" :contractType="1" @cancel="closeComponent"></component>
   </div>
 </template>
@@ -67,82 +67,85 @@ import { BtnListType } from '@/common/components/btnList/interface';
 import { useRoute } from 'vue-router';
 
 export default defineComponent({
-    name: EnumRouterName.spot_contract_unsubmitted,
-    components: {
-        filterCustomTable,
-        contextMenu,
-        detail: defineAsyncComponent(() => import('../../components/detail/index.vue')),
-        add: defineAsyncComponent(() => import('../../components/add/index.vue')),
-        resubmit: defineAsyncComponent(() => import('../../components/modify/index.vue')),
-        cancel: defineAsyncComponent(() => import('../../components/cancel/index.vue')),
-        delete: defineAsyncComponent(() => import('../../components/delete/index.vue')),
-        MtpTableButton,
-    },
-    setup() {
-        const { name: routeName } = useRoute();
-        // 权限按钮
-        const firstBtn = getTableButton(['add']);
-        const secondBtn = getTableButton(['add'], true);
-        // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList<Ermcp3ContractRsp>();
+  name: EnumRouterName.spot_contract_unsubmitted,
+  components: {
+    filterCustomTable,
+    contextMenu,
+    detail: defineAsyncComponent(() => import('../../components/detail/index.vue')),
+    add: defineAsyncComponent(() => import('../../components/add/index.vue')),
+    resubmit: defineAsyncComponent(() => import('../../components/modify/index.vue')),
+    cancel: defineAsyncComponent(() => import('../../components/cancel/index.vue')),
+    delete: defineAsyncComponent(() => import('../../components/delete/index.vue')),
+    MtpTableButton,
+  },
+  setup() {
+    const { name: routeName } = useRoute();
+    // 权限按钮
+    const firstBtn = getTableButton(['add']);
+    const secondBtn = getTableButton(['add'], true);
+    // 表格列表数据
+    const { loading, tableList, queryTable } = queryTableList<Ermcp3ContractRsp>();
 
-        // 获取列表数据
-        const queryTableAction = () => {
-            switch (routeName) {
-                // 新增合同
-                case 'purchase_contract':
-                    queryTable(QuerySpotContract, { contracttype: 1, querytype: '1,2' });
-                    break;
-                // 已完结合同
-                case 'purchase_finish':
-                    queryTable(QuerySpotContract, { contracttype: 1, querytype: '4' });
-                    break;
-            }
-            // 获取 业务账户
-            queryBusinessManager();
-        };
+    // 获取列表数据
+    const queryTableAction = () => {
+      switch (routeName) {
+        // 新增合同
+        case 'purchase_contract':
+          queryTable(QuerySpotContract, { contracttype: 1, querytype: '1,2' });
+          break;
+        // 已完结合同
+        case 'purchase_finish':
+          queryTable(QuerySpotContract, { contracttype: 1, querytype: '4' });
+          break;
+      }
+      // 获取 业务账户
+      queryBusinessManager();
+    };
 
-        // 处理根据状态显示对应按钮
-        const handleBtnList = (btnList: BtnListType[], item: Ermcp3ContractRsp) => {
-            switch (item.contracctstatus) {
-                case 1: // 待审核
-                case 2: // 执行中
-                case 3: // 正常完结
-                case 5: // 异常完结
-                    return btnList.filter((e) => e.code !== 'delete');
-                case 6: // 已撤回
-                    return btnList.filter((e) => e.code !== 'cancel');
-                default:
-                    return btnList;
-            }
-        };
+    // 处理根据状态显示对应按钮
+    const handleBtnList = (item: Ermcp3ContractRsp) => {
+      if (item) {
+        switch (item.contracctstatus) {
+          case 1: // 待审核
+          case 2: // 执行中
+          case 3: // 正常完结
+          case 5: // 异常完结
+            return secondBtn.filter((e) => e.code !== 'delete');
+          case 6: // 已撤回
+            return secondBtn.filter((e) => e.code !== 'cancel');
+          default:
+            return secondBtn;
+        }
+      }
+      return []
+    };
 
-        // 表格通用逻辑
-        const param: ComposeTableParam = {
-            queryFn: queryTableAction,
-            menuType: EnumRouterName.spot_contract_unsubmitted,
-            tableName: 'table_pcweb_delivery',
-            tableFilterKey: ['pricetype', 'contractno', 'sellusername'],
-            tableFilterCB,
-            isDetail: true,
-        };
+    // 表格通用逻辑
+    const param: ComposeTableParam = {
+      queryFn: queryTableAction,
+      menuType: EnumRouterName.spot_contract_unsubmitted,
+      tableName: 'table_pcweb_delivery',
+      tableFilterKey: ['pricetype', 'contractno', 'sellusername'],
+      tableFilterCB,
+      isDetail: true,
+    };
 
-        return {
-            ...handleComposeTable<Ermcp3ContractRsp>(param),
-            loading,
-            tableList,
-            getBizTypeName,
-            getPriceTypeName,
-            getContractStatusName,
-            getContractTypeName,
-            formatTime,
-            formatValue,
-            findManagerName,
-            handleEnumdic,
-            firstBtn,
-            secondBtn,
-            handleBtnList,
-        };
-    },
+    return {
+      ...handleComposeTable<Ermcp3ContractRsp>(param),
+      loading,
+      tableList,
+      getBizTypeName,
+      getPriceTypeName,
+      getContractStatusName,
+      getContractTypeName,
+      formatTime,
+      formatValue,
+      findManagerName,
+      handleEnumdic,
+      firstBtn,
+      secondBtn,
+      handleBtnList,
+    };
+  },
 });
 </script>