Bladeren bron

fix: 市场管理-客户管理

liqh 5 maanden geleden
bovenliggende
commit
12243ce05e
16 gewijzigde bestanden met toevoegingen van 1473 en 1054 verwijderingen
  1. 112 86
      src/views/business-rules/risk-rules/components/rules-list/index.vue
  2. 1 1
      src/views/market-manage/external-manage/customer-manage/customer-create/index.vue
  3. 229 154
      src/views/market-manage/external-manage/customer-manage/customer-list/index.vue
  4. 0 99
      src/views/market-manage/external-manage/customer-manage/single-customer/components/clue-info.vue
  5. 0 91
      src/views/market-manage/external-manage/customer-manage/single-customer/components/contract-info.vue
  6. 0 146
      src/views/market-manage/external-manage/customer-manage/single-customer/components/decision-chain.vue
  7. 0 85
      src/views/market-manage/external-manage/customer-manage/single-customer/components/edit-info.vue
  8. 198 91
      src/views/market-manage/external-manage/customer-manage/single-customer/components/file-info.vue
  9. 259 0
      src/views/market-manage/external-manage/customer-manage/single-customer/components/invoice-list.vue
  10. 0 114
      src/views/market-manage/external-manage/customer-manage/single-customer/components/project-info.vue
  11. 262 0
      src/views/market-manage/external-manage/customer-manage/single-customer/components/project-list.vue
  12. 0 85
      src/views/market-manage/external-manage/customer-manage/single-customer/components/repayment-info.vue
  13. 259 0
      src/views/market-manage/external-manage/customer-manage/single-customer/components/settlement-list.vue
  14. 0 84
      src/views/market-manage/external-manage/customer-manage/single-customer/components/view-info.vue
  15. 8 18
      src/views/market-manage/external-manage/customer-manage/single-customer/index.vue
  16. 145 0
      src/views/market-manage/external-manage/customer-manage/single-customer/modules/fileDetail.vue

+ 112 - 86
src/views/business-rules/risk-rules/components/rules-list/index.vue

@@ -3,7 +3,7 @@
     <bs-table v-bind="tableOptions">
       <template #searchRight>
         <a-space>
-          <a-button type="primary" @click="openEditDrawer">
+          <a-button type="primary" @click="goDetailPage">
             <template #icon>
               <PlusOutlined />
             </template>
@@ -15,112 +15,177 @@
   </div>
 </template>
 
-<script setup>
+<script setup lang="jsx">
   import BsTable, { useBsTable } from '/@/components/BsUi/Table/index.js';
-  import { onMounted, ref ,watch} from 'vue';
-  import { pick } from 'lodash';
-  import { rulesApi } from '/@/api/business-rules/rules-api';
-
-  // ----------------------- 以下是字段定义 emits props ---------------------
+  import { onMounted, ref, watch } from 'vue';
+  import { useRouter } from 'vue-router';
 
   const props = defineProps({
     selectedRulesId: String,
   });
-  // ----------------------- 表格/列表/ 搜索 ---------------------
-
-  const selectedRulesId = ref(props.selectedRulesId);
 
   const {
     tableOptions,
+    fetchTableData,
     setTablePropsValue: setValue,
     getTablePropsValue: getValue,
   } = useBsTable({
     tableOptions: {
+      url: '/supports/risk/rule/queryPage',
       gridOptions: {
         loading: false,
         columns: [
+          {
+            type: 'seq',
+            width: 80,
+            align: 'center',
+          },
           {
             title: '风险维度',
             field: 'riskDimension',
             width: 85,
             ellipsis: true,
+            formatter: ({ cellValue }) => {
+              return cellValue && cellValue.length > 0 ? cellValue[0].valueName : '';
+            },
           },
           {
             title: '风险模板',
-            field: 'riskModel',
+            // field: 'riskModel',
             width: 85,
             ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.riskModel?.[0].valueName}</span>;
+              },
+            },
           },
           {
             title: '风险等级',
             field: 'riskLevel',
+            width: 85,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.riskLevel?.[0].valueName}</span>;
+              },
+            },
           },
           {
             title: '风险指标',
             field: 'riskMetrics',
-
             width: 110,
             ellipsis: true,
           },
           {
             title: '指标定义',
             field: 'definedMetrics',
-
             width: 100,
             ellipsis: true,
           },
           {
             title: '条件运算符',
             field: 'operator',
-
             width: 100,
             ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.operator?.[0].valueName}</span>;
+              },
+            },
           },
           {
             title: '条件控制值',
             field: 'conditionalValue',
-
             width: 100,
             ellipsis: true,
           },
           {
             title: '提醒方式',
             field: 'remindWay',
-
             width: 100,
             ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.remindWay?.[0].valueName}</span>;
+              },
+            },
           },
           {
             title: '提醒时间(每天)',
             field: 'remindTime',
-
             width: 120,
             ellipsis: true,
           },
           {
             title: '风险等级',
             field: 'riskGrade',
-
             width: 100,
             ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.riskGrade?.[0].valueName}</span>;
+              },
+            },
           },
           {
             title: '状态',
             field: 'enable',
-
             width: 100,
             ellipsis: true,
+            // formatter: (cellValue) => {
+            //   return cellValue === 'true' ? '启用' : '禁用';
+            // },
+            slots: {
+              default({ row, column }) {
+                return <span>{row.enable === 'true' ? '启用' : '禁用'}</span>;
+              },
+            },
           },
-
           {
-            field: 'action',
+            field: 'opt',
             title: '操作',
+            width: '120px',
+            fixed: 'right',
+            align: 'center',
+            slots: {
+              default({ row, column }) {
+                return (
+                  <a-button
+                    type='text'
+                    size='small'
+                    onClick={() => {
+                      goDetailPage(row);
+                    }}
+                  >
+                    编辑
+                  </a-button>
+                );
+              },
+            },
           },
         ],
+        data: [
+          {
+            id: 1,
+            name: '测试数据',
+            dictField: [
+              {
+                dictKeyId: '',
+                dictValueId: '',
+                remark: '',
+                sort: 3,
+                status: 1,
+                valueCode: '03',
+                valueName: '微信公众号',
+              },
+            ],
+          },
+        ], // 模拟数据源
       },
       searchConfig: {
         enabled: true,
-        fieldSpan: 4,
+        fieldSpan: 6,
         fields: [
           {
             field: 'name',
@@ -147,84 +212,45 @@
             },
           },
         ],
-        onSearch() {
-          fetchTableData2();
-        },
-        onReset() {
-          fetchTableData2();
-        },
       },
       pagerConfig: {
         enabled: true,
         pageSize: 10,
         pageNum: 1,
-        total: 100,
-        onChange: () => {
-          fetchTableData2();
-        },
       },
-      toolbarConfig: {
-        onRefresh() {
-          fetchTableData2();
-        },
+      toolbarConfig: {},
+      tableSearchBeforeBiz() {
+        const searchParams = getValue('searchConfig.data');
+        setValue('searchConfig.data', { ...searchParams, key: props.selectedRulesId });
       },
     },
   });
 
-  //检测数据变化
- watch(
-  () => props.selectedRulesId,
-  (newValue) => {
-   selectedRulesId.value=newValue;
-   fetchTableData2();
-  },
-  { immediate: true }
-);
-
-  const getSearchParams = () => {
-    return getValue('searchConfig.data');
-  };
-  const getPageInfo = () => {
-    return pick(getValue('pagerConfig'), ['pageNum', 'pageSize']);
-  };
-
-  async function fetchTableData2() {
-    setValue('gridOptions.loading', true);
-
-    const params = {
-      ...getSearchParams(),
-      ...getPageInfo(),
-      selectedRulesId:selectedRulesId.value,
-    };
-
-    rulesApi.queryRulesList(params).then((res) => {
-      setValue('gridOptions.data', res.data.list);
-      setValue('gridOptions.loading', false);
-    });
-  }
-  const fetchTableData = () => {
-    setValue('gridOptions.loading', true);
-
-    const params = {
-      ...getSearchParams(),
-      ...getPageInfo(),
-      selectedRulesId:selectedRulesId.value,
-    };
-
-    rulesApi.queryRulesList(params).then((res) => {
-      console.log('res', res);
-      setValue('gridOptions.data', res.data.list);
-      setValue('gridOptions.loading', false);
-    });
-  };
+  // 监听 selectedRulesId 的变化
+  watch(
+    () => props.selectedRulesId,
+    (newVal, oldVal) => {
+      if (newVal !== oldVal) {
+        fetchTableData(newVal);
+      }
+    },
+    { immediate: true }
+  );
 
   onMounted(() => {
     console.log('表格已加载');
-    fetchTableData2();
   });
-  const openEditDrawer = () => {
-    addOrEditDrawerRef.value.showDrawer();
-  };
+
+  const router = useRouter();
+  function goDetailPage(record) {
+    console.log('record', record);
+    router.push({
+      path: '/business-rules/create-rules',
+      query: {
+        id: record.id,
+      },
+    });
+  }
 </script>
 
 <style scoped lang="scss">

+ 1 - 1
src/views/market-manage/external-manage/customer-manage/customer-create/index.vue

@@ -193,7 +193,7 @@
   import { useRouter } from 'vue-router';
   import { message, Modal } from 'ant-design-vue';
   import _ from 'lodash';
-  // import { customerApi } from '/@/api/teamwork/customer/customer-api';
+  import { clientManageApi } from '/@/api/market-manage/index.js';
   import AreaCascader from '/@/components/framework/area-cascader/index.vue';
   import DictSelect from '/@/components/support/dict-select/index.vue';
   import Upload from '/@/components/support/file-upload/index.vue';

+ 229 - 154
src/views/market-manage/external-manage/customer-manage/customer-list/index.vue

@@ -1,170 +1,245 @@
-
 <template>
-  <a-card class="employee-container">
-    <a-table
-      size="small"
-      :columns="columns"
-      :data-source="tableData"
-      :pagination="false"
-      :loading="tableLoading"
-      :scroll="{ x: 1500 }"
-      row-key="employeeId"
-      bordered
-    >
-      <template #bodyCell="{ record, column }">
-        <template v-if="column.dataIndex === 'operate'">
-          <div class="smart-table-operate">
-            <a-button v-privilege="'system:employee:update'" type="link" size="small" @click="goDetailPage(record)">编辑</a-button>
-          </div>
-        </template>
+  <div class="table-demo">
+    <bs-table v-bind="tableOptions">
+      <template #searchRight>
+        <a-space>
+          <a-button type="primary" @click="goDetailPage">
+            <template #icon>
+              <PlusOutlined />
+            </template>
+            <span>新增</span>
+          </a-button>
+        </a-space>
       </template>
-    </a-table>
-  </a-card>
+    </bs-table>
+  </div>
 </template>
-<script setup lang="ts">
-    import { onMounted } from 'vue';
-    import { useRouter } from 'vue-router';
-    import _ from 'lodash';
-    import { computed, createVNode, reactive, ref, watch } from 'vue';
-    import { rulesApi } from '/@/api/business-rules/rules-api';
-    import { smartSentry } from '/@/lib/smart-sentry';
-
-    import useDict from '/@/utils/dict-util';
-    const initDict = async () => {
-      await useDict.init(['performance_method']);
-    };
-
-    onMounted(async () => {
-      await initDict();
-      queryRules();
-    });
 
-    // ----------------------- 以下是字段定义 emits props ---------------------
+<script setup lang="jsx">
+  import BsTable, { useBsTable } from '/@/components/BsUi/Table/index.js';
+  import { onMounted, ref, watch } from 'vue';
+  import { useRouter } from 'vue-router';
 
-    const props = defineProps({
-      selectedRulesId: Number,
-      breadcrumb: Array,
-    });
+  const props = defineProps({
+    selectedRulesId: String,
+  });
 
-    // ----------------------- 表格/列表/ 搜索 ---------------------
-    //字段
-    const columns = ref([
-      {
-        title: '风险维度',
-        dataIndex: 'riskDimension',
-        align: 'center',
-        width: 85,
-      },
-      {
-        title: '风险指标',
-        dataIndex: 'riskDimension',
-        align: 'center',
-        width: 70,
-      },
-      {
-        title: '指标定义',
-        dataIndex: 'riskDimension',
-        align: 'center',
-        width: 100,
-      },
-      {
-        title: '条件运算符',
-        dataIndex: 'phone',
-        align: 'center',
-        width: 100,
-      },
-      {
-        title: '条件控制值',
-        dataIndex: 'email',
-        align: 'center',
-        width: 100,
-        ellipsis: true,
-      },
-      {
-        title: '提醒方式',
-        dataIndex: 'administratorFlag',
-        align: 'center',
-        width: 60,
-      },
-      {
-        title: '提醒时间(每天)',
-        dataIndex: 'disabledFlag',
-        align: 'center',
-        width: 60,
+  const {
+    tableOptions,
+    fetchTableData,
+    setTablePropsValue: setValue,
+    getTablePropsValue: getValue,
+  } = useBsTable({
+    tableOptions: {
+      url: '/supports/risk/rule/queryPage',
+      gridOptions: {
+        loading: false,
+        columns: [
+          {
+            type: 'seq',
+            width: 80,
+            align: 'center',
+          },
+          {
+            title: '风险维度',
+            field: 'riskDimension',
+            width: 85,
+            ellipsis: true,
+            formatter: ({ cellValue }) => {
+              return cellValue && cellValue.length > 0 ? cellValue[0].valueName : '';
+            },
+          },
+          {
+            title: '风险模板',
+            // field: 'riskModel',
+            width: 85,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.riskModel?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '风险等级',
+            field: 'riskLevel',
+            width: 85,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.riskLevel?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '风险指标',
+            field: 'riskMetrics',
+            width: 110,
+            ellipsis: true,
+          },
+          {
+            title: '指标定义',
+            field: 'definedMetrics',
+            width: 100,
+            ellipsis: true,
+          },
+          {
+            title: '条件运算符',
+            field: 'operator',
+            width: 100,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.operator?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '条件控制值',
+            field: 'conditionalValue',
+            width: 100,
+            ellipsis: true,
+          },
+          {
+            title: '提醒方式',
+            field: 'remindWay',
+            width: 100,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.remindWay?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '提醒时间(每天)',
+            field: 'remindTime',
+            width: 120,
+            ellipsis: true,
+          },
+          {
+            title: '风险等级',
+            field: 'riskGrade',
+            width: 100,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.riskGrade?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '状态',
+            field: 'enable',
+            width: 100,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row.enable === 'true' ? '启用' : '禁用'}</span>;
+              },
+            },
+          },
+          {
+            field: 'opt',
+            title: '操作',
+            width: '120px',
+            fixed: 'right',
+            align: 'center',
+            slots: {
+              default({ row, column }) {
+                return (
+                  <a-button
+                    type='text'
+                    size='small'
+                    onClick={() => {
+                      goDetailPage(row);
+                    }}
+                  >
+                    编辑
+                  </a-button>
+                );
+              },
+            },
+          },
+        ],
+        data: [
+          {
+            id: 1,
+            name: '测试数据',
+            dictField: [
+              {
+                dictKeyId: '',
+                dictValueId: '',
+                remark: '',
+                sort: 3,
+                status: 1,
+                valueCode: '03',
+                valueName: '微信公众号',
+              },
+            ],
+          },
+        ], // 模拟数据源
       },
-      {
-        title: '风险等级',
-        dataIndex: 'positionName',
-        align: 'center',
-        width: 100,
-        ellipsis: true,
+      searchConfig: {
+        enabled: false,
+        fieldSpan: 4,
+        fields: [
+          {
+            field: 'name',
+            label: '',
+            component: 'a-input',
+            componentProps: {
+              placeholder: '请输入服务商名称',
+            },
+          },
+          {
+            field: 'name1',
+            label: '',
+            component: 'a-select',
+            componentProps: {
+              placeholder: '请选择地址',
+            },
+          },
+          {
+            field: 'name2',
+            label: '',
+            component: 'a-select',
+            componentProps: {
+              placeholder: '请选择服务商类型',
+            },
+          },
+        ],
       },
-      {
-        title: '状态',
-        dataIndex: 'roleNameList',
-        align: 'center',
-        width: 100,
+      pagerConfig: {
+        enabled: true,
+        pageSize: 10,
+        pageNum: 1,
       },
-      {
-        title: '操作',
-        dataIndex: 'operate',
-        align: 'center',
-        fixed: 'right',
-        width: 140,
+      toolbarConfig: {},
+      tableSearchBeforeBiz() {
+        const searchParams = getValue('searchConfig.data');
+        setValue('searchConfig.data', { ...searchParams, key: props.selectedRulesId });
       },
-    ]);
-    const tableData = ref();
+    },
+  });
 
-    const tableLoading = ref(false);
-    // 查询
-    async function queryRules() {
-      tableLoading.value = true;
-      try {
-        let res = await rulesApi.queryRulesList();
-        tableData.value = res.data;
-      } catch (error) {
-        smartSentry.captureError(error);
-      } finally {
-        tableLoading.value = false;
-      }
-    }
+  onMounted(() => {
+    console.log('表格已加载');
+  });
 
-
-    // ----------------------- 添加、修改、禁用、重置密码 ------------------------------------
-
-    const router = useRouter();
-    function goDetailPage(record) {
-      console.log("record",record);
-      router.push({
-        path: '/business-rules/create-rules',
-        query: {
-          id: record.id,
-        },
-      });
-    }
-</script>
-<style scoped lang="less">
-  .employee-container {
-    height: 100%;
-  }
-
-  .header {
-    display: flex;
-    align-items: center;
-  }
-
-  .query-operate {
-    margin-left: auto;
-    display: flex;
-    align-items: center;
-    margin-bottom: 20px;
+  const router = useRouter();
+  function goDetailPage(record) {
+    console.log('record', record);
+    router.push({
+      path: '/market-manage/external-manage/customer-manage/customer-create',
+      query: {
+        id: record.id,
+      },
+    });
   }
+</script>
 
-  .btn-group {
-    margin: 10px 0;
-
-    .btn {
-      margin-right: 8px;
-    }
+<style scoped lang="scss">
+  .table-demo {
   }
 </style>

+ 0 - 99
src/views/market-manage/external-manage/customer-manage/single-customer/components/clue-info.vue

@@ -1,99 +0,0 @@
-<template>
-    <a-table size="small" :pagination="false" bordered :dataSource="dataSource" :columns="columns" />
-    <!-- 分页 -->
-    <div class="smart-query-table-page" v-if="dataSource.length">
-        <a-pagination showSizeChanger showQuickJumper show-less-items :pageSizeOptions="PAGE_SIZE_OPTIONS"
-            :defaultPageSize="pagination.pageSize" v-model:current="pagination.pageNum"
-            v-model:pageSize="pagination.pageSize" :total="total" @change="fetchTableData"
-            @showSizeChange="fetchTableData" :show-total="(total) => `共${total}条`" />
-    </div>
-</template>
-
-<script setup name="线索信息">
-import { formatMoney } from '/@/utils/str-util.js';
-import { ref, reactive } from 'vue';
-import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
-
-// 分页数据
-const pagination = reactive({
-    pageNum: 1,
-    pageSize: PAGE_SIZE,
-});
-
-// 数据总数
-const total = ref(0);
-
-const columns = reactive([
-    {
-        title: '序号',
-        dataIndex: '_index',
-        width: 50,
-    },
-    {
-        title: '线索编号',
-        dataIndex: 'clueNumber',
-    },
-    {
-        title: '线索名称',
-        dataIndex: 'clueName',
-    },
-    {
-        title: '线索类型',
-        dataIndex: 'clueType',
-    },
-    {
-        title: '决策关键人',
-        dataIndex: 'decisionMaker',
-    },
-    {
-        title: '电话',
-        dataIndex: 'phone',
-    },
-    {
-        title: '招标方式',
-        dataIndex: 'tenderMethod',
-    },
-    {
-        title: '预计开标时间',
-        dataIndex: 'expectedOpeningTime',
-    },
-    {
-        title: '预计合同金额',
-        dataIndex: 'expectedContractAmount',
-        customRender: ({ text }) => {
-            return formatMoney(text, 2);
-        }
-    },
-    {
-        title: '创建时间',
-        dataIndex: 'createTime',
-    },
-]);
-
-// 生成模拟数据
-function generateMockData(totalData = 10) {
-    const sourceData = columns;
-    const data = [];
-    for (let i = 0; i < totalData; i++) {
-        const item = {};
-        for (let j = 0; j < sourceData.length; j++) {
-            item[sourceData[j].dataIndex] = `row${i + 1},col${j + 1}`;
-        }
-        item._index = i + 1;
-
-        data.push(item);
-    }
-    total.value = data.length;
-    return data;
-}
-
-function fetchTableData() {
-    const data = generateMockData();
-    dataSource.value = data;
-    total.value = data.length;
-}
-
-const dataSource = reactive(generateMockData());
-</script>
-
-<style lang="less" scoped></style>

+ 0 - 91
src/views/market-manage/external-manage/customer-manage/single-customer/components/contract-info.vue

@@ -1,91 +0,0 @@
-<template>
-  <CommonTable ref="commonTableRef" :tableOptions="tableConfig"> </CommonTable>
-</template>
-
-<script setup lang="jsx">
-import { ref } from 'vue';
-import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
-import useDict from '/@/utils/dict-util';
-await useDict.init(['province_city_district', 'BLINK_CUSTOMER_PARTNER_LEVEL', 'BLINK_CUSTOMER_TYPE']);
-
-// 定义 props
-const props = defineProps({
-  id: {
-    type: String,
-    default: () => ({}),
-  },
-});
-
-const commonTableRef = ref(null);
-const tableConfig = ref({
-  // 设置网络请求地址
-  url: '/supports/customer/contract/queryPage',
-  // 设置网络请求方式为GET
-  requestMethod: 'GET',
-  tableId: TABLE_ID_CONST.TEAMWORK.CUSTOMER_MANAGE.CONTRACT_LIST,
-  columns: [
-    {
-      title: '合同名称',
-      dataIndex: 'contractName',
-      align: 'center',
-    },
-    {
-      title: '合同ID',
-      dataIndex: 'contractCode',
-      align: 'center',
-    },
-    {
-      title: '税率',
-      dataIndex: 'rate',
-      align: 'center',
-    },
-    {
-      title: '合同金额(元)',
-      dataIndex: 'contractAmount',
-      align: 'center',
-    },
-    {
-      title: '补充协议金额(元)',
-      dataIndex: 'supplementaryAmount',
-      align: 'center',
-    },
-    {
-      title: '合同总金额(元)',
-      dataIndex: 'contractTotalAmount',
-      align: 'center',
-    },
-    {
-      title: '开票金额(元)',
-      dataIndex: 'invoiceAmount',
-      align: 'center',
-    },
-    {
-      title: '开票进度',
-      dataIndex: 'invoicePercent',
-      align: 'center',
-    },
-    {
-      title: '回款金额(元)',
-      dataIndex: 'paymentAmount',
-      align: 'center',
-    },
-    {
-      title: '回款进度',
-      dataIndex: 'paymentPercent',
-      align: 'center',
-    },
-  ],
-  tableAttrs: {},
-  showIndexColumn: true,
-  // 请求前传参
-  beforeFetch({ params }) {
-    return {
-      customerId: props.id,
-      ...params,
-    };
-  },
-  // afterFetch({ data }) {},
-});
-</script>
-
-<style lang="less" scoped></style>

+ 0 - 146
src/views/market-manage/external-manage/customer-manage/single-customer/components/decision-chain.vue

@@ -1,146 +0,0 @@
-<template>
-  <CommonTable ref="commonTableRef" :tableOptions="tableConfig"> </CommonTable>
-  <addDec ref="addDecRef" :visible="isModalVisible" @refresh="initPage"> </addDec>
-</template>
-
-<script setup lang="jsx">
-  import { ref } from 'vue';
-  import { useRouter } from 'vue-router';
-  import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
-  import useDict from '/@/utils/dict-util';
-  import { customerApi } from '/@/api/teamwork/customer/customer-api.js';
-  import addDec from '../modules/add-decision.vue';
-  import { SmartLoading } from '/@/components/framework/smart-loading';
-  import { smartSentry } from '/@/lib/smart-sentry';
-  import { message, Modal } from 'ant-design-vue';
-
-  await useDict.init(['province_city_district', 'BLINK_CUSTOMER_PARTNER_LEVEL', 'BLINK_CUSTOMER_TYPE']);
-
-  // 定义 props
-  const props = defineProps({
-    id: {
-      type: String,
-      default: () => ({}),
-    },
-  });
-  const commonTableRef = ref(null);
-  const addDecRef = ref();
-  const router = useRouter();
-
-  const tableConfig = ref({
-    // 设置网络请求地址
-    url: '/supports/customer/decision/list',
-
-    // 设置网络请求方式为GET
-    requestMethod: 'GET',
-    tableId: TABLE_ID_CONST.TEAMWORK.CUSTOMER_MANAGE.PAYMENT_LIST,
-    buttons: [
-      {
-        label: '新增',
-        iconName: 'PlusOutlined',
-        attrs: {
-          type: 'primary',
-          onClick: () => {
-            addDecRef.value.showModal({ customerId: props.id });
-          },
-        },
-      },
-    ],
-    columns: [
-      {
-        title: '决策人',
-        dataIndex: 'decisionName',
-        align: 'center',
-      },
-      {
-        title: '职务',
-        dataIndex: 'staffName',
-        align: 'center',
-      },
-      {
-        title: '职务权重',
-        dataIndex: 'staffWeight',
-        align: 'center',
-      },
-      {
-        title: '电话',
-        dataIndex: 'phoneNumber',
-        align: 'center',
-      },
-      {
-        title: '年龄',
-        dataIndex: 'decisionAge',
-        align: 'center',
-      },
-      {
-        title: '性别',
-        dataIndex: 'decisionSex',
-        align: 'center',
-      },
-      {
-        title: '操作',
-        dataIndex: 'action',
-        fixed: 'right',
-        align: 'center',
-        width: 110,
-        customRender: ({ text, record, index, column }) => {
-          return (
-            <div class='smart-table-operate'>
-              <a-button type='link' onClick={() => addDecRef.value.showModal({ ...record, customerId: props.id })}>
-                编辑
-              </a-button>
-              <a-button type='link' danger onClick={() => onDelete(record)}>
-                删除
-              </a-button>
-            </div>
-          );
-        },
-      },
-    ],
-    tableAttrs: {},
-    showIndexColumn: true,
-    // 请求前传参
-    beforeFetch({ params }) {
-      return {
-        customerId: props.id,
-        ...params,
-      };
-    },
-    // afterFetch({ data }) {},
-  });
-
-  function initPage() {
-    commonTableRef.value.reload();
-  }
-
-  //确认删除
-  function onDelete(data) {
-    Modal.confirm({
-      title: '提示',
-      content: '确定要删除吗?',
-      okText: '删除',
-      okType: 'danger',
-      onOk() {
-        requestDelete(data);
-      },
-      cancelText: '取消',
-      onCancel() {},
-    });
-  }
-
-  //请求删除
-  async function requestDelete(data) {
-    SmartLoading.show();
-    try {
-      await customerApi.DecisionDelete(data.id);
-      message.success('删除成功');
-      initPage();
-    } catch (e) {
-      smartSentry.captureError(e);
-    } finally {
-      SmartLoading.hide();
-    }
-  }
-</script>
-
-<style lang="less" scoped></style>

+ 0 - 85
src/views/market-manage/external-manage/customer-manage/single-customer/components/edit-info.vue

@@ -1,85 +0,0 @@
-<template>
-  <CommonTable ref="commonTableRef" :tableOptions="tableConfig"> </CommonTable>
-</template>
-
-<script setup lang="jsx">
-import { ref } from 'vue';
-import { useRouter } from 'vue-router';
-import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
-import useDict from '/@/utils/dict-util';
-await useDict.init(['province_city_district', 'BLINK_CUSTOMER_PARTNER_LEVEL', 'BLINK_CUSTOMER_TYPE']);
-
-// 定义 props
-const props = defineProps({
-  id: {
-    type: String,
-    default: () => ({}),
-  },
-});
-
-const commonTableRef = ref(null);
-const router = useRouter();
-
-const tableConfig = ref({
-  // 设置网络请求地址
-  url: '/supports/customer/repayment/queryPage',
-
-  // 设置网络请求方式为GET
-  requestMethod: 'GET',
-  tableId: TABLE_ID_CONST.TEAMWORK.CUSTOMER_MANAGE.EDIT_LIST,
-  columns: [
-    {
-      title: '回款方',
-      dataIndex: 'repaymentUnitName',
-      align: 'center',
-    },
-    {
-      title: '回款日期',
-      dataIndex: 'repaymentDate',
-      align: 'center',
-    },
-    {
-      title: '关联合同',
-      dataIndex: 'relatedContract',
-      align: 'center',
-    },
-    {
-      title: '关联项目',
-      dataIndex: 'relatedDelivery',
-      align: 'center',
-    },
-    {
-      title: '回款金额(元)',
-      dataIndex: 'paymentAmount',
-      align: 'center',
-    },
-    {
-      title: '回款进度',
-      dataIndex: 'paymentPercent',
-      align: 'center',
-    },
-    {
-      title: '开票金额(元)',
-      align: 'center',
-    },
-    {
-      title: '开票进度',
-      dataIndex: 'invoicePercent',
-      align: 'center',
-    },
-  ],
-  tableAttrs: {},
-  showIndexColumn: true,
-  // 请求前传参
-  beforeFetch({ params }) {
-    return {
-      dataId: props.id,
-      type: '4',
-      ...params,
-    };
-  },
-  // afterFetch({ data }) {},
-});
-</script>
-
-<style lang="less" scoped></style>

+ 198 - 91
src/views/market-manage/external-manage/customer-manage/single-customer/components/file-info.vue

@@ -1,103 +1,210 @@
 <template>
-  <CommonTable ref="commonTableRef" :tableOptions="tableConfig"> </CommonTable>
+  <div class="table-demo">
+    <bs-table v-bind="tableOptions">
+      <template #searchRight>
+        <a-space>
+          <a-button type="primary" @click="goDetailPage">
+            <template #icon>
+              <PlusOutlined />
+            </template>
+            <span>新增</span>
+          </a-button>
+        </a-space>
+      </template>
+    </bs-table>
+  </div>
 </template>
 
 <script setup lang="jsx">
-import { ref } from 'vue';
-import { useRouter } from 'vue-router';
-import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
-import useDict from '/@/utils/dict-util';
-await useDict.init(['province_city_district', 'BLINK_CUSTOMER_PARTNER_LEVEL', 'BLINK_CUSTOMER_TYPE']);
+  import BsTable, { useBsTable } from '/@/components/BsUi/Table/index.js';
+  import { onMounted, ref, watch } from 'vue';
+  import { useRouter } from 'vue-router';
 
-// 定义 props
-const props = defineProps({
-  id: {
-    type: String,
-    default: () => ({}),
-  },
-});
+  const props = defineProps({
+    selectedRulesId: String,
+  });
 
-const commonTableRef = ref(null);
-const router = useRouter();
-
-const tableConfig = ref({
-  // 设置网络请求地址
-  url: '/supports/customer/file/queryPage',
-
-  // 设置网络请求方式为GET
-  requestMethod: 'GET',
-
-  tableId: TABLE_ID_CONST.TEAMWORK.CUSTOMER_MANAGE.FILE_LIST,
-
-  buttons: [
-    {
-      label: '上传附件',
-      iconName: 'PlusOutlined',
-      attrs: {
-        type: 'primary',
-        onClick: () => {
-          router.push({
-            path: '',
-          });
-        },
+  const {
+    tableOptions,
+    fetchTableData,
+    setTablePropsValue: setValue,
+    getTablePropsValue: getValue,
+  } = useBsTable({
+    tableOptions: {
+      url: '/supports/risk/rule/queryPage',
+      gridOptions: {
+        loading: false,
+        columns: [
+          {
+            type: 'seq',
+            width: 80,
+            align: 'center',
+          },
+          {
+            title: '附件名称',
+            field: 'riskDimension',
+            width: 185,
+            ellipsis: true,
+            formatter: ({ cellValue }) => {
+              return cellValue && cellValue.length > 0 ? cellValue[0].valueName : '';
+            },
+          },
+          {
+            title: '附件大小',
+            field: 'riskModel',
+            width: 85,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.riskModel?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '操作人',
+            field: 'riskLevel',
+            width: 120,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.riskLevel?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '操作时间',
+            field: 'riskMetrics',
+            width: 110,
+            ellipsis: true,
+          },
+          {
+            field: 'opt',
+            title: '操作',
+            width: '200px',
+            fixed: 'right',
+            align: 'center',
+            slots: {
+              default({ row, column }) {
+                return (
+                  <><a-button
+                    type='text'
+                    size='small'
+                    onClick={() => {
+                      goDetailPage(row);
+                    } }
+                  >
+                    预览
+                  </a-button><a-button
+                    type='text'
+                    size='small'
+                    onClick={() => {
+                      goDetailPage(row);
+                    } }
+                  >
+                      下载
+                    </a-button><a-button
+                      type='text'
+                      size='small'
+                      onClick={() => {
+                        goDetailPage(row);
+                      } }
+                    >
+                      删除
+                    </a-button></>
+                );
+              },
+            },
+          },
+        ],
+        data: [
+          {
+            id: 1,
+            name: '测试数据',
+            dictField: [
+              {
+                dictKeyId: '',
+                dictValueId: '',
+                remark: '',
+                sort: 3,
+                status: 1,
+                valueCode: '03',
+                valueName: '微信公众号',
+              },
+            ],
+          },
+        ], // 模拟数据源
+      },
+      searchConfig: {
+        enabled: false,
+        fieldSpan: 4,
+        fields: [
+          {
+            field: 'name',
+            label: '',
+            component: 'a-input',
+            componentProps: {
+              placeholder: '请输入服务商名称',
+            },
+          },
+          {
+            field: 'name1',
+            label: '',
+            component: 'a-select',
+            componentProps: {
+              placeholder: '请选择地址',
+            },
+          },
+          {
+            field: 'name2',
+            label: '',
+            component: 'a-select',
+            componentProps: {
+              placeholder: '请选择服务商类型',
+            },
+          },
+        ],
+      },
+      pagerConfig: {
+        enabled: true,
+        pageSize: 10,
+        pageNum: 1,
+      },
+      toolbarConfig: {},
+      tableSearchBeforeBiz() {
+        const searchParams = getValue('searchConfig.data');
+        setValue('searchConfig.data', { ...searchParams, key: props.selectedRulesId });
       },
     },
-  ],
-  columns: [
-    {
-      title: '附件名称',
-      dataIndex: 'fileName',
-      align: 'center',
-    },
-    {
-      title: '附件大小',
-      dataIndex: 'fileSize',
-      align: 'center',
-    },
-    {
-      title: '上传人',
-      dataIndex: 'creatorName',
-      align: 'center',
-    },
-    {
-      title: '创建时间',
-      dataIndex: 'createTime',
-      align: 'center',
+  });
+
+  // 监听 selectedRulesId 的变化
+  watch(
+    () => props.selectedRulesId,
+    (newVal, oldVal) => {
+      if (newVal !== oldVal) {
+        fetchTableData(newVal);
+      }
     },
-    {
-      title: '操作',
-      dataIndex: 'action',
-      fixed: 'right',
-      align: 'center',
-      width: 160,
-      customRender: ({ text, record, index, column }) => {
-        return (
-          <div class='smart-table-operate'>
-            <a-button type='link' onClick={() => goDetailPage(record)}>
-              预览
-            </a-button>
-            <a-button type='link' onClick={() => goDetailPage(record)}>
-              下载
-            </a-button>
-            <a-button type='link' danger onClick={() => goDetailPage(record)}>
-              删除
-            </a-button>
-          </div>
-        );
+    { immediate: true }
+  );
+
+  onMounted(() => {
+    console.log('表格已加载');
+  });
+
+  const router = useRouter();
+  function goDetailPage(record) {
+    console.log('record', record);
+    router.push({
+      path: '/market-manage/external-manage/customer-manage/customer-create',
+      query: {
+        id: record.id,
       },
-    },
-  ],
-  tableAttrs: {},
-  showIndexColumn: true,
-  // 请求前传参
-  beforeFetch({ params }) {
-    return {
-      customerId: props.id,
-      ...params,
-    };
-  },
-  // afterFetch({ data }) {},
-});
+    });
+  }
 </script>
 
-<style lang="less" scoped></style>
+<style scoped lang="scss">
+  .table-demo {
+  }
+</style>

+ 259 - 0
src/views/market-manage/external-manage/customer-manage/single-customer/components/invoice-list.vue

@@ -0,0 +1,259 @@
+<template>
+  <div class="table-demo">
+    <bs-table v-bind="tableOptions">
+      <template #searchRight>
+        <a-space>
+          <a-button type="primary" @click="goDetailPage">
+            <template #icon>
+              <PlusOutlined />
+            </template>
+            <span>新增</span>
+          </a-button>
+        </a-space>
+      </template>
+    </bs-table>
+  </div>
+</template>
+
+<script setup lang="jsx">
+  import BsTable, { useBsTable } from '/@/components/BsUi/Table/index.js';
+  import { onMounted, ref, watch } from 'vue';
+  import { useRouter } from 'vue-router';
+
+  const props = defineProps({
+    selectedRulesId: String,
+  });
+
+  const {
+    tableOptions,
+    fetchTableData,
+    setTablePropsValue: setValue,
+    getTablePropsValue: getValue,
+  } = useBsTable({
+    tableOptions: {
+      url: '/supports/risk/rule/queryPage',
+      gridOptions: {
+        loading: false,
+        columns: [
+          {
+            type: 'seq',
+            width: 80,
+            align: 'center',
+          },
+          {
+            title: '风险维度',
+            field: 'riskDimension',
+            width: 85,
+            ellipsis: true,
+            formatter: ({ cellValue }) => {
+              return cellValue && cellValue.length > 0 ? cellValue[0].valueName : '';
+            },
+          },
+          {
+            title: '风险模板',
+            // field: 'riskModel',
+            width: 85,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.riskModel?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '风险等级',
+            field: 'riskLevel',
+            width: 85,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.riskLevel?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '风险指标',
+            field: 'riskMetrics',
+            width: 110,
+            ellipsis: true,
+          },
+          {
+            title: '指标定义',
+            field: 'definedMetrics',
+            width: 100,
+            ellipsis: true,
+          },
+          {
+            title: '条件运算符',
+            field: 'operator',
+            width: 100,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.operator?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '条件控制值',
+            field: 'conditionalValue',
+            width: 100,
+            ellipsis: true,
+          },
+          {
+            title: '提醒方式',
+            field: 'remindWay',
+            width: 100,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.remindWay?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '提醒时间(每天)',
+            field: 'remindTime',
+            width: 120,
+            ellipsis: true,
+          },
+          {
+            title: '风险等级',
+            field: 'riskGrade',
+            width: 100,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.riskGrade?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '状态',
+            field: 'enable',
+            width: 100,
+            ellipsis: true,
+            // formatter: (cellValue) => {
+            //   return cellValue === 'true' ? '启用' : '禁用';
+            // },
+            slots: {
+              default({ row, column }) {
+                return <span>{row.enable === 'true' ? '启用' : '禁用'}</span>;
+              },
+            },
+          },
+          {
+            field: 'opt',
+            title: '操作',
+            width: '120px',
+            fixed: 'right',
+            align: 'center',
+            slots: {
+              default({ row, column }) {
+                return (
+                  <a-button
+                    type='text'
+                    size='small'
+                    onClick={() => {
+                      goDetailPage(row);
+                    }}
+                  >
+                    编辑
+                  </a-button>
+                );
+              },
+            },
+          },
+        ],
+        data: [
+          {
+            id: 1,
+            name: '测试数据',
+            dictField: [
+              {
+                dictKeyId: '',
+                dictValueId: '',
+                remark: '',
+                sort: 3,
+                status: 1,
+                valueCode: '03',
+                valueName: '微信公众号',
+              },
+            ],
+          },
+        ], // 模拟数据源
+      },
+      searchConfig: {
+        enabled: false,
+        fieldSpan: 4,
+        fields: [
+          {
+            field: 'name',
+            label: '',
+            component: 'a-input',
+            componentProps: {
+              placeholder: '请输入服务商名称',
+            },
+          },
+          {
+            field: 'name1',
+            label: '',
+            component: 'a-select',
+            componentProps: {
+              placeholder: '请选择地址',
+            },
+          },
+          {
+            field: 'name2',
+            label: '',
+            component: 'a-select',
+            componentProps: {
+              placeholder: '请选择服务商类型',
+            },
+          },
+        ],
+      },
+      pagerConfig: {
+        enabled: true,
+        pageSize: 10,
+        pageNum: 1,
+      },
+      toolbarConfig: {},
+      tableSearchBeforeBiz() {
+        const searchParams = getValue('searchConfig.data');
+        setValue('searchConfig.data', { ...searchParams, key: props.selectedRulesId });
+      },
+    },
+  });
+
+  // 监听 selectedRulesId 的变化
+  watch(
+    () => props.selectedRulesId,
+    (newVal, oldVal) => {
+      if (newVal !== oldVal) {
+        fetchTableData(newVal);
+      }
+    },
+    { immediate: true }
+  );
+
+  onMounted(() => {
+    console.log('表格已加载');
+  });
+
+  const router = useRouter();
+  function goDetailPage(record) {
+    console.log('record', record);
+    router.push({
+      path: '/market-manage/external-manage/customer-manage/customer-create',
+      query: {
+        id: record.id,
+      },
+    });
+  }
+</script>
+
+<style scoped lang="scss">
+  .table-demo {
+  }
+</style>

+ 0 - 114
src/views/market-manage/external-manage/customer-manage/single-customer/components/project-info.vue

@@ -1,114 +0,0 @@
-<template>
-  <CommonTable ref="commonTableRef" :tableOptions="tableConfig"> </CommonTable>
-  <getProjectNum ref="getProjectNumRef" :visible="isModalVisible"> </getProjectNum>
-</template>
-
-<script setup lang="jsx">
-  import { ref } from 'vue';
-  import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
-  import getProjectNum from '../modules/get-projectnum.vue';
-  import useDict from '/@/utils/dict-util';
-  await useDict.init(['province_city_district', 'BLINK_CUSTOMER_PARTNER_LEVEL', 'BLINK_CUSTOMER_TYPE']);
-
-  // 定义 props
-  const props = defineProps({
-    id: {
-      type: String,
-      default: () => ({}),
-    },
-  });
-
-  const commonTableRef = ref(null);
-  const getProjectNumRef = ref();
-
-  const tableConfig = ref({
-    // 设置网络请求地址
-    url: '/supports/customer/delivery/queryPage',
-
-    // 设置网络请求方式为GET
-    requestMethod: 'GET',
-    tableId: TABLE_ID_CONST.TEAMWORK.CUSTOMER_MANAGE.PROJECT_LIST,
-    columns: [
-      {
-        title: '项目名称',
-        dataIndex: 'deliveryName',
-        align: 'center',
-      },
-      {
-        title: '项目ID',
-        dataIndex: 'deliveryCode',
-        align: 'center',
-      },
-      {
-        title: '项目状态',
-        dataIndex: 'status',
-        align: 'center',
-      },
-      {
-        title: '任务数量',
-        dataIndex: 'taskCount',
-        align: 'center',
-        customRender: ({ text, record, index, column }) => {
-          return (
-            <div class='smart-table-operate'>
-              <a type='link' onClick={() => handlegetProjectNum(record)}>
-                {text}
-              </a>
-            </div>
-          );
-        },
-      },
-      {
-        title: '预计开始时间',
-        dataIndex: 'planStartDate',
-        align: 'center',
-      },
-      {
-        title: '预计结束时间',
-        dataIndex: 'planEndDate',
-        align: 'center',
-      },
-      {
-        title: '预计人天',
-        dataIndex: 'planDays',
-        align: 'center',
-      },
-      {
-        title: '实际人天',
-        dataIndex: 'actualDays',
-        align: 'center',
-      },
-      {
-        title: '交付经理',
-        dataIndex: 'deliveryManager',
-        align: 'center',
-      },
-    ],
-    tableAttrs: {},
-    showIndexColumn: true,
-    // 请求前传参
-    beforeFetch({ params }) {
-      return {
-        customerId: props.id,
-        ...params,
-      };
-    },
-    // afterFetch({ data }) {},
-  });
-
-  function goDetailPage(record) {
-    // console.log('111111', record);
-    // router.push({
-    //   path: '/teamwork/customer-manage/single-customer',
-    //   query: {
-    //     ...record,
-    //   },
-    // });
-  }
-
-  function handlegetProjectNum(record) {
-    getProjectNumRef.value.showModal({ ...record });
-  }
-</script>
-
-<style lang="less" scoped></style>

+ 262 - 0
src/views/market-manage/external-manage/customer-manage/single-customer/components/project-list.vue

@@ -0,0 +1,262 @@
+<template>
+  <div class="table-demo">
+    <bs-table v-bind="tableOptions">
+      <template #searchRight>
+        <a-space>
+          <a-button type="primary" @click="goDetailPage">
+            <template #icon>
+              <PlusOutlined />
+            </template>
+            <span>新增</span>
+          </a-button>
+        </a-space>
+      </template>
+      <template #toolbarLeft>
+        <a-space> 累计客户:XXX|黑名单客户:XXX|S级客户 </a-space>
+      </template>
+    </bs-table>
+  </div>
+</template>
+
+<script setup lang="jsx">
+  import BsTable, { useBsTable } from '/@/components/BsUi/Table/index.js';
+  import { onMounted, ref, watch } from 'vue';
+  import { useRouter } from 'vue-router';
+
+  const props = defineProps({
+    selectedRulesId: String,
+  });
+
+  const {
+    tableOptions,
+    fetchTableData,
+    setTablePropsValue: setValue,
+    getTablePropsValue: getValue,
+  } = useBsTable({
+    tableOptions: {
+      url: '/supports/risk/rule/queryPage',
+      gridOptions: {
+        loading: false,
+        columns: [
+          {
+            type: 'seq',
+            width: 80,
+            align: 'center',
+          },
+          {
+            title: '风险维度',
+            field: 'riskDimension',
+            width: 85,
+            ellipsis: true,
+            formatter: ({ cellValue }) => {
+              return cellValue && cellValue.length > 0 ? cellValue[0].valueName : '';
+            },
+          },
+          {
+            title: '风险模板',
+            // field: 'riskModel',
+            width: 85,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.riskModel?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '风险等级',
+            field: 'riskLevel',
+            width: 85,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.riskLevel?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '风险指标',
+            field: 'riskMetrics',
+            width: 110,
+            ellipsis: true,
+          },
+          {
+            title: '指标定义',
+            field: 'definedMetrics',
+            width: 100,
+            ellipsis: true,
+          },
+          {
+            title: '条件运算符',
+            field: 'operator',
+            width: 100,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.operator?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '条件控制值',
+            field: 'conditionalValue',
+            width: 100,
+            ellipsis: true,
+          },
+          {
+            title: '提醒方式',
+            field: 'remindWay',
+            width: 100,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.remindWay?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '提醒时间(每天)',
+            field: 'remindTime',
+            width: 120,
+            ellipsis: true,
+          },
+          {
+            title: '风险等级',
+            field: 'riskGrade',
+            width: 100,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.riskGrade?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '状态',
+            field: 'enable',
+            width: 100,
+            ellipsis: true,
+            // formatter: (cellValue) => {
+            //   return cellValue === 'true' ? '启用' : '禁用';
+            // },
+            slots: {
+              default({ row, column }) {
+                return <span>{row.enable === 'true' ? '启用' : '禁用'}</span>;
+              },
+            },
+          },
+          {
+            field: 'opt',
+            title: '操作',
+            width: '120px',
+            fixed: 'right',
+            align: 'center',
+            slots: {
+              default({ row, column }) {
+                return (
+                  <a-button
+                    type='text'
+                    size='small'
+                    onClick={() => {
+                      goDetailPage(row);
+                    }}
+                  >
+                    编辑
+                  </a-button>
+                );
+              },
+            },
+          },
+        ],
+        data: [
+          {
+            id: 1,
+            name: '测试数据',
+            dictField: [
+              {
+                dictKeyId: '',
+                dictValueId: '',
+                remark: '',
+                sort: 3,
+                status: 1,
+                valueCode: '03',
+                valueName: '微信公众号',
+              },
+            ],
+          },
+        ], // 模拟数据源
+      },
+      searchConfig: {
+        enabled: false,
+        fieldSpan: 4,
+        fields: [
+          {
+            field: 'name',
+            label: '',
+            component: 'a-input',
+            componentProps: {
+              placeholder: '请输入服务商名称',
+            },
+          },
+          {
+            field: 'name1',
+            label: '',
+            component: 'a-select',
+            componentProps: {
+              placeholder: '请选择地址',
+            },
+          },
+          {
+            field: 'name2',
+            label: '',
+            component: 'a-select',
+            componentProps: {
+              placeholder: '请选择服务商类型',
+            },
+          },
+        ],
+      },
+      pagerConfig: {
+        enabled: true,
+        pageSize: 10,
+        pageNum: 1,
+      },
+      toolbarConfig: {},
+      tableSearchBeforeBiz() {
+        const searchParams = getValue('searchConfig.data');
+        setValue('searchConfig.data', { ...searchParams, key: props.selectedRulesId });
+      },
+    },
+  });
+
+  // 监听 selectedRulesId 的变化
+  watch(
+    () => props.selectedRulesId,
+    (newVal, oldVal) => {
+      if (newVal !== oldVal) {
+        fetchTableData(newVal);
+      }
+    },
+    { immediate: true }
+  );
+
+  onMounted(() => {
+    console.log('表格已加载');
+  });
+
+  const router = useRouter();
+  function goDetailPage(record) {
+    console.log('record', record);
+    router.push({
+      path: '/market-manage/external-manage/customer-manage/customer-create',
+      query: {
+        id: record.id,
+      },
+    });
+  }
+</script>
+
+<style scoped lang="scss">
+  .table-demo {
+  }
+</style>

+ 0 - 85
src/views/market-manage/external-manage/customer-manage/single-customer/components/repayment-info.vue

@@ -1,85 +0,0 @@
-<template>
-  <CommonTable ref="commonTableRef" :tableOptions="tableConfig"> </CommonTable>
-</template>
-
-<script setup lang="jsx">
-import { ref } from 'vue';
-import { useRouter } from 'vue-router';
-import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
-import useDict from '/@/utils/dict-util';
-await useDict.init(['province_city_district', 'BLINK_CUSTOMER_PARTNER_LEVEL', 'BLINK_CUSTOMER_TYPE']);
-
-// 定义 props
-const props = defineProps({
-  id: {
-    type: String,
-    default: () => ({}),
-  },
-});
-
-const commonTableRef = ref(null);
-const router = useRouter();
-
-const tableConfig = ref({
-  // 设置网络请求地址
-  url: '/supports/customer/repayment/queryPage',
-
-  // 设置网络请求方式为GET
-  requestMethod: 'GET',
-  tableId: TABLE_ID_CONST.TEAMWORK.CUSTOMER_MANAGE.PAYMENT_LIST,
-  columns: [
-    {
-      title: '回款方',
-      dataIndex: 'repaymentUnitName',
-      align: 'center',
-    },
-    {
-      title: '回款日期',
-      dataIndex: 'repaymentDate',
-      align: 'center',
-    },
-    {
-      title: '关联合同',
-      dataIndex: 'relatedContract',
-      align: 'center',
-    },
-    {
-      title: '关联项目',
-      dataIndex: 'relatedDelivery',
-      align: 'center',
-    },
-    {
-      title: '回款金额(元)',
-      dataIndex: 'paymentAmount',
-      align: 'center',
-    },
-    {
-      title: '回款进度',
-      dataIndex: 'paymentPercent',
-      align: 'center',
-    },
-    {
-      title: '开票金额(元)',
-      dataIndex: 'invoiceAmount',
-      align: 'center',
-    },
-    {
-      title: '开票进度',
-      dataIndex: 'invoicePercent',
-      align: 'center',
-    },
-  ],
-  tableAttrs: {},
-  showIndexColumn: true,
-  // 请求前传参
-  beforeFetch({ params }) {
-    return {
-      customerId: props.id,
-      ...params,
-    };
-  },
-  // afterFetch({ data }) {},
-});
-</script>
-
-<style lang="less" scoped></style>

+ 259 - 0
src/views/market-manage/external-manage/customer-manage/single-customer/components/settlement-list.vue

@@ -0,0 +1,259 @@
+<template>
+  <div class="table-demo">
+    <bs-table v-bind="tableOptions">
+      <template #searchRight>
+        <a-space>
+          <a-button type="primary" @click="goDetailPage">
+            <template #icon>
+              <PlusOutlined />
+            </template>
+            <span>新增</span>
+          </a-button>
+        </a-space>
+      </template>
+    </bs-table>
+  </div>
+</template>
+
+<script setup lang="jsx">
+  import BsTable, { useBsTable } from '/@/components/BsUi/Table/index.js';
+  import { onMounted, ref, watch } from 'vue';
+  import { useRouter } from 'vue-router';
+
+  const props = defineProps({
+    selectedRulesId: String,
+  });
+
+  const {
+    tableOptions,
+    fetchTableData,
+    setTablePropsValue: setValue,
+    getTablePropsValue: getValue,
+  } = useBsTable({
+    tableOptions: {
+      url: '/supports/risk/rule/queryPage',
+      gridOptions: {
+        loading: false,
+        columns: [
+          {
+            type: 'seq',
+            width: 80,
+            align: 'center',
+          },
+          {
+            title: '风险维度',
+            field: 'riskDimension',
+            width: 85,
+            ellipsis: true,
+            formatter: ({ cellValue }) => {
+              return cellValue && cellValue.length > 0 ? cellValue[0].valueName : '';
+            },
+          },
+          {
+            title: '风险模板',
+            // field: 'riskModel',
+            width: 85,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.riskModel?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '风险等级',
+            field: 'riskLevel',
+            width: 85,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.riskLevel?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '风险指标',
+            field: 'riskMetrics',
+            width: 110,
+            ellipsis: true,
+          },
+          {
+            title: '指标定义',
+            field: 'definedMetrics',
+            width: 100,
+            ellipsis: true,
+          },
+          {
+            title: '条件运算符',
+            field: 'operator',
+            width: 100,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.operator?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '条件控制值',
+            field: 'conditionalValue',
+            width: 100,
+            ellipsis: true,
+          },
+          {
+            title: '提醒方式',
+            field: 'remindWay',
+            width: 100,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.remindWay?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '提醒时间(每天)',
+            field: 'remindTime',
+            width: 120,
+            ellipsis: true,
+          },
+          {
+            title: '风险等级',
+            field: 'riskGrade',
+            width: 100,
+            ellipsis: true,
+            slots: {
+              default({ row, column }) {
+                return <span>{row?.riskGrade?.[0].valueName}</span>;
+              },
+            },
+          },
+          {
+            title: '状态',
+            field: 'enable',
+            width: 100,
+            ellipsis: true,
+            // formatter: (cellValue) => {
+            //   return cellValue === 'true' ? '启用' : '禁用';
+            // },
+            slots: {
+              default({ row, column }) {
+                return <span>{row.enable === 'true' ? '启用' : '禁用'}</span>;
+              },
+            },
+          },
+          {
+            field: 'opt',
+            title: '操作',
+            width: '120px',
+            fixed: 'right',
+            align: 'center',
+            slots: {
+              default({ row, column }) {
+                return (
+                  <a-button
+                    type='text'
+                    size='small'
+                    onClick={() => {
+                      goDetailPage(row);
+                    }}
+                  >
+                    编辑
+                  </a-button>
+                );
+              },
+            },
+          },
+        ],
+        data: [
+          {
+            id: 1,
+            name: '测试数据',
+            dictField: [
+              {
+                dictKeyId: '',
+                dictValueId: '',
+                remark: '',
+                sort: 3,
+                status: 1,
+                valueCode: '03',
+                valueName: '微信公众号',
+              },
+            ],
+          },
+        ], // 模拟数据源
+      },
+      searchConfig: {
+        enabled: false,
+        fieldSpan: 4,
+        fields: [
+          {
+            field: 'name',
+            label: '',
+            component: 'a-input',
+            componentProps: {
+              placeholder: '请输入服务商名称',
+            },
+          },
+          {
+            field: 'name1',
+            label: '',
+            component: 'a-select',
+            componentProps: {
+              placeholder: '请选择地址',
+            },
+          },
+          {
+            field: 'name2',
+            label: '',
+            component: 'a-select',
+            componentProps: {
+              placeholder: '请选择服务商类型',
+            },
+          },
+        ],
+      },
+      pagerConfig: {
+        enabled: true,
+        pageSize: 10,
+        pageNum: 1,
+      },
+      toolbarConfig: {},
+      tableSearchBeforeBiz() {
+        const searchParams = getValue('searchConfig.data');
+        setValue('searchConfig.data', { ...searchParams, key: props.selectedRulesId });
+      },
+    },
+  });
+
+  // 监听 selectedRulesId 的变化
+  watch(
+    () => props.selectedRulesId,
+    (newVal, oldVal) => {
+      if (newVal !== oldVal) {
+        fetchTableData(newVal);
+      }
+    },
+    { immediate: true }
+  );
+
+  onMounted(() => {
+    console.log('表格已加载');
+  });
+
+  const router = useRouter();
+  function goDetailPage(record) {
+    console.log('record', record);
+    router.push({
+      path: '/market-manage/external-manage/customer-manage/customer-create',
+      query: {
+        id: record.id,
+      },
+    });
+  }
+</script>
+
+<style scoped lang="scss">
+  .table-demo {
+  }
+</style>

+ 0 - 84
src/views/market-manage/external-manage/customer-manage/single-customer/components/view-info.vue

@@ -1,84 +0,0 @@
-<template>
-  <CommonTable ref="commonTableRef" :tableOptions="tableConfig"> </CommonTable>
-</template>
-
-<script setup lang="jsx">
-import { ref } from 'vue';
-import { useRouter } from 'vue-router';
-import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
-import useDict from '/@/utils/dict-util';
-await useDict.init(['province_city_district', 'BLINK_CUSTOMER_PARTNER_LEVEL', 'BLINK_CUSTOMER_TYPE']);
-
-// 定义 props
-const props = defineProps({
-  id: {
-    type: String,
-    default: () => ({}),
-  },
-});
-
-const commonTableRef = ref(null);
-
-const tableConfig = ref({
-  // 设置网络请求地址
-  url: '/supports/view/record/queryPage',
-
-  // 设置网络请求方式为GET
-  requestMethod: 'GET',
-  tableId: TABLE_ID_CONST.TEAMWORK.CUSTOMER_MANAGE.VIEW_LIST,
-  columns: [
-    {
-      title: '回款方',
-      dataIndex: 'repaymentUnitName',
-      align: 'center',
-    },
-    {
-      title: '回款日期',
-      dataIndex: 'repaymentDate',
-      align: 'center',
-    },
-    {
-      title: '关联合同',
-      dataIndex: 'relatedContract',
-      align: 'center',
-    },
-    {
-      title: '关联项目',
-      dataIndex: 'relatedDelivery',
-      align: 'center',
-    },
-    {
-      title: '回款金额(元)',
-      dataIndex: 'paymentAmount',
-      align: 'center',
-    },
-    {
-      title: '回款进度',
-      dataIndex: 'paymentPercent',
-      align: 'center',
-    },
-    {
-      title: '开票金额(元)',
-      align: 'center',
-    },
-    {
-      title: '开票进度',
-      dataIndex: 'invoicePercent',
-      align: 'center',
-    },
-  ],
-  tableAttrs: {},
-  showIndexColumn: true,
-  // 请求前传参
-  beforeFetch({ params }) {
-    return {
-      dataId: props.id,
-      type: '4',
-      ...params,
-    };
-  },
-  // afterFetch({ data }) {},
-});
-</script>
-
-<style lang="less" scoped></style>

+ 8 - 18
src/views/market-manage/external-manage/customer-manage/single-customer/index.vue

@@ -68,43 +68,33 @@
   const tabList = [
     {
       key: '0',
-      tab: '客户信息',
+      tab: '基本信息',
       component: defineAsyncComponent(() => import('./components/customer-info.vue')),
     },
     {
       key: '1',
-      tab: '跟进记录',
-      component: defineAsyncComponent(() => import('./components/follow-up.vue')),
+      tab: '项目信息',
+      component: defineAsyncComponent(() => import('./components/project-list.vue')),
     },
     {
       key: '2',
-      tab: '决策链条信息',
-      component: defineAsyncComponent(() => import('./components/decision-chain.vue')),
+      tab: '结算管理',
+      component: defineAsyncComponent(() => import('./components/settlement-list.vue')),
     },
     {
       key: '3',
-      tab: '合同信息',
-      component: defineAsyncComponent(() => import('./components/contract-info.vue')),
+      tab: '开票管理',
+      component: defineAsyncComponent(() => import('./components/invoice-list.vue')),
     },
     {
       key: '4',
-      tab: '项目信息',
-      component: defineAsyncComponent(() => import('./components/project-info.vue')),
-    },
-    {
-      key: '5',
-      tab: '回款信息',
-      component: defineAsyncComponent(() => import('./components/repayment-info.vue')),
-    },
-    {
-      key: '6',
       tab: '文件资料',
       component: defineAsyncComponent(() => import('./components/file-info.vue')),
     },
   ];
 
   onMounted(() => {
-    getSingleCustomerList();
+    // getSingleCustomerList();
   });
 
   // 查询列表

+ 145 - 0
src/views/market-manage/external-manage/customer-manage/single-customer/modules/fileDetail.vue

@@ -0,0 +1,145 @@
+<!--
+  * 部门表单 弹窗
+  *
+  * @Author:    BoundLink
+  * @Date:      2022-08-08 20:46:18
+-->
+<template>
+  <a-modal v-model:open="visible" width="40%" title="文件登记" @ok="onSubmit" @cancel="closeModal" destroyOnClose>
+    <a-form class="smart-query-form" ref="formRef" labelWrap :label-col="labelCol" :model="form" :rules="rules">
+      <div class="cost-compose">
+        <div class="basic-info">
+          <div class="basic-info-form">
+            <a-row :gutter="16" class="smart-query-form-row">
+              <a-col :span="24">
+                <a-form-item label="文件类别" name="fileType" class="smart-query-form-item">
+                  <DictSelect key-code="MATE_DELIVERY_FILE_TYPE" v-model:value="form.fileType" placeholder="请选择文件类别" width="100%" />
+                </a-form-item>
+              </a-col>
+            </a-row>
+            <a-row :gutter="16" class="smart-query-form-row">
+              <a-col :span="24">
+                <a-form-item label="备注" name="remark" class="smart-query-form-item">
+                  <a-textarea v-model:value="form.remark" placeholder="请输入备注" :auto-size="{ minRows: 2, maxRows: 5 }" />
+                </a-form-item>
+              </a-col>
+            </a-row>
+            <a-row :gutter="16" class="smart-query-form-row">
+              <a-col :span="24">
+                <a-form-item label="文件" name="form.attachment" class="smart-query-form-item">
+                  <Upload
+                    ref="UploadRef"
+                    :defaultFileList="defaultFileList"
+                    :maxUploadSize="10"
+                    :folder="FILE_FOLDER_TYPE_ENUM.COMMON.value"
+                    buttonText="上传文件"
+                    listType="text"
+                    extraMsg="最多上传10个附件"
+                    @change="changeAttachment"
+                  />
+                </a-form-item>
+              </a-col>
+            </a-row>
+          </div>
+        </div>
+      </div>
+    </a-form>
+  </a-modal>
+</template>
+<script setup>
+  import { reactive, ref } from 'vue';
+  import { theme, message, Modal } from 'ant-design-vue';
+  import _ from 'lodash';
+  import DictSelect from '/@/components/support/dict-select/index.vue';
+  import Upload from '/@/components/support/file-upload/index.vue';
+  import { projectApi } from '/@/api/project/project-api';
+  import { FILE_FOLDER_TYPE_ENUM } from '/@/constants/support/file-const';
+
+  // ----------------------- 对外暴漏 ---------------------
+  defineExpose({
+    showModal,
+  });
+
+  // ----------------------- modal 的显示与隐藏 ---------------------
+
+  const labelCol = { style: { width: '70px' } };
+  const emits = defineEmits(['refresh']);
+  const visible = ref(false);
+  const UploadRef = ref();
+  function showModal(params) {
+    visible.value = true;
+    form.deliveryId = params;
+  }
+
+  function closeModal() {
+    UploadRef.value.clear();
+    visible.value = false;
+    resetFormData();
+  }
+
+  // ----------------------- form 表单操作 ---------------------
+  const formRef = ref();
+
+  const formDefault = {
+    deliveryId: undefined, // 项目id
+    fileType: undefined, // 文件类别
+    remark: undefined, //备注
+    attachment: undefined, // 文件
+  };
+
+  let form = reactive({
+    ...formDefault,
+  });
+
+  // 表单校验规则
+  const fromRules = {
+    // decisionName: [{ required: true, message: '决策人姓名不能为空' }],
+  };
+
+  // 重置表单数据
+  function resetFormData() {
+    Object.assign(form, formDefault);
+  }
+
+  // ----------------------- 上传附件 ----------------------------
+  // 已上传的附件列表
+  const defaultFileList = ref([]);
+  function changeAttachment(fileList) {
+    defaultFileList.value = fileList;
+    form.attachment = _.isEmpty(fileList) ? [] : fileList;
+  }
+
+  // ----------------------- form 表单  ajax 操作 ---------------------
+  function onSubmit() {
+    formRef.value
+      .validateFields()
+      .then((values) => {
+        Modal.confirm({
+          title: '提示',
+          content: '确定要提交吗?',
+          okText: '确认',
+          onOk() {
+            console.log('form', form);
+            postFileData();
+          },
+          cancelText: '取消',
+          onCancel() {},
+        });
+      })
+      .catch((error) => {
+        console.log('step1_error', error);
+      });
+  }
+
+  const postFileData = async () => {
+    await projectApi.addFileList(form);
+    message.success('提交成功');
+    emits('refreshTable');
+    onClose();
+  };
+
+  function onClose() {
+    Object.assign(form, formDefault);
+    visible.value = false;
+  }
+</script>