刘洋 1 year ago
parent
commit
586d53eefa

+ 18 - 6
src/views/sop/components/select-filter/index.vue

@@ -126,6 +126,12 @@ const props = defineProps({
       return [];
     },
   },
+  fastDataList: {
+    type: Array,
+    default() {
+      return [];
+    },
+  },
 });
 const formWidgetMetadataOperation = ref('AND');
 const visible = ref(false);
@@ -135,14 +141,20 @@ const toggleVisible = () => {
 
 const dataList = ref([]);
 
-// const metadataList = computed(() => {
-//   return [...props.metadata];
-// });
-const metadataList = ref([...props.metadata]);
+const metadataList = computed(() => {
+  return [...props.metadata];
+});
+// const metadataList = ref([...props.metadata]);
+// watch(
+//   () => props.metadata,
+//   (val) => {
+//     metadataList.value = [...(val || [])];
+//   }
+// );
 watch(
-  () => props.metadata,
+  () => props.fastDataList,
   (val) => {
-    metadataList.value = [...(val || [])];
+    dataList.value = [...(val || [])];
   }
 );
 

+ 93 - 84
src/views/sop/sop-manage/office-sop/index.vue

@@ -65,6 +65,12 @@
           type="REGION_MANAGER"
         ></select-type-user>
       </template>
+      <template #crmUserId="{ item, params }">
+        <select-type-user
+          v-model="params[item.prop]"
+          type="ACCOUNT_MANAGER"
+        ></select-type-user>
+      </template>
       <template #buttons>
         <!-- <t-space :size="16">
           <select-filter
@@ -387,91 +393,94 @@ const getFastSearchOptions = () => {
   });
 };
 getFastSearchOptions();
-const fields = ref([
-  {
-    prop: 'serviceId',
-    label: '服务单元',
-    type: 'select',
-    labelWidth: 104,
-    colSpan: 6,
-    cell: 'service',
-  },
-  {
-    prop: 'leadId',
-    label: '大区经理',
-    labelWidth: 104,
-    colSpan: 6,
-    cell: 'leadId',
-  },
-  {
-    prop: 'customName',
-    label: '客户名称',
-    labelWidth: 104,
-    colSpan: 6,
-  },
-  {
-    prop: 'taskKey',
-    label: '当前节点',
-    type: 'select',
-    labelWidth: 104,
-    colSpan: 6,
-    options:
-      appStore
-        .getFlowDetailByType('OFFICE_SOP_FLOW')
-        ?.setupList?.map((item) => ({ value: item, label: item })) || [],
-  },
-  {
-    prop: 'crmUserId',
-    label: '客户经理',
-    labelWidth: 104,
-    colSpan: 6,
-  },
+const fields = computed(() => {
+  return [
+    {
+      prop: 'serviceId',
+      label: '服务单元',
+      type: 'select',
+      labelWidth: 104,
+      colSpan: 6,
+      cell: 'service',
+    },
+    {
+      prop: 'leadId',
+      label: '大区经理',
+      labelWidth: 104,
+      colSpan: 6,
+      cell: 'leadId',
+    },
+    {
+      prop: 'customName',
+      label: '客户名称',
+      labelWidth: 104,
+      colSpan: 6,
+    },
+    {
+      prop: 'taskKey',
+      label: '当前节点',
+      type: 'select',
+      labelWidth: 104,
+      colSpan: 6,
+      options:
+        appStore
+          .getFlowDetailByType('OFFICE_SOP_FLOW')
+          ?.setupList?.map((item) => ({ value: item, label: item })) || [],
+    },
+    {
+      prop: 'crmUserId',
+      label: '客户经理',
+      labelWidth: 104,
+      colSpan: 6,
+      cell: 'crmUserId',
+    },
 
-  {
-    prop: 'crmName',
-    label: '项目名称',
-    labelWidth: 104,
-    colSpan: 6,
-  },
-  {
-    prop: 'sopNo',
-    label: 'sop号',
-    labelWidth: 104,
-    colSpan: 6,
-  },
-  {
-    prop: 'fastSearch',
-    label: '快捷搜索',
-    type: 'select',
-    labelWidth: 104,
-    colSpan: 6,
-    options: fastSearchOptions.value,
-  },
-  {
-    prop: 'fastColumns',
-    label: '快捷显示',
-    type: 'select',
-    labelWidth: 104,
-    colSpan: 6,
-    options: fastShowOptions.value,
-  },
-  {
-    prop: 'dingPlan',
-    label: '打卡在时限内',
-    type: 'select',
-    labelWidth: 104,
-    colSpan: 6,
-    options: [
-      { value: true, label: '是' },
-      { value: false, label: '否' },
-    ],
-  },
-  {
-    prop: 'buttons',
-    colSpan: 4,
-    labelWidth: 16,
-  },
-]);
+    {
+      prop: 'crmName',
+      label: '项目名称',
+      labelWidth: 104,
+      colSpan: 6,
+    },
+    {
+      prop: 'sopNo',
+      label: 'sop号',
+      labelWidth: 104,
+      colSpan: 6,
+    },
+    {
+      prop: 'fastSearch',
+      label: '快捷搜索',
+      type: 'select',
+      labelWidth: 104,
+      colSpan: 6,
+      options: fastSearchOptions.value,
+    },
+    {
+      prop: 'fastColumns',
+      label: '快捷显示',
+      type: 'select',
+      labelWidth: 104,
+      colSpan: 6,
+      options: fastShowOptions.value,
+    },
+    {
+      prop: 'dingPlan',
+      label: '打卡在时限内',
+      type: 'select',
+      labelWidth: 104,
+      colSpan: 6,
+      options: [
+        { value: true, label: '是' },
+        { value: false, label: '否' },
+      ],
+    },
+    {
+      prop: 'buttons',
+      colSpan: 4,
+      labelWidth: 16,
+    },
+  ];
+});
 const params = reactive({
   serviceId: '',
   leadId: '',

+ 28 - 4
src/views/sop/sop-manage/student-sop/index.vue

@@ -47,6 +47,7 @@
         @confirm="filterConfirm"
         type="CLOUD_MARK_SOP_FLOW"
         contentType="SEARCH"
+        :fastDataList="fastDataList"
       ></select-filter>
     </div>
     <SearchForm :fields="fields" :params="params" :search="search">
@@ -59,6 +60,12 @@
           }"
         ></select-service-unit>
       </template>
+      <template #crmUserId="{ item, params }">
+        <select-type-user
+          v-model="params[item.prop]"
+          type="ACCOUNT_MANAGER"
+        ></select-type-user>
+      </template>
       <template #leadId="{ item, params }">
         <select-type-user
           v-model="params[item.prop]"
@@ -326,7 +333,8 @@ const defaultTableColumns = [
 originColumns.value = cloneDeep(defaultTableColumns);
 
 const originFieldIds = computed(() => {
-  return originColumns.value.map((item) => item.fieldId);
+  // return originColumns.value.map((item) => item.fieldId);
+  return defaultTableColumns.map((item) => item.fieldId);
 });
 
 const columns = computed(() => {
@@ -394,6 +402,9 @@ const getFastSearchOptions = () => {
   });
 };
 getFastSearchOptions();
+
+const fastDataList = ref([]);
+
 const fields = computed(() => {
   return [
     {
@@ -433,6 +444,7 @@ const fields = computed(() => {
       label: '客户经理',
       labelWidth: 104,
       colSpan: 6,
+      cell: 'crmUserId',
     },
 
     {
@@ -454,6 +466,18 @@ const fields = computed(() => {
       labelWidth: 104,
       colSpan: 6,
       options: fastSearchOptions.value,
+      attrs: {
+        onChange: (val) => {
+          let item = fastSearchOptions.value.find((v) => v.id == val);
+          let content = JSON.parse(item.content);
+          fastDataList.value = content.dataList;
+          params.formWidgetMetadataOperation =
+            content.formWidgetMetadataOperation;
+          // formWidgetMetadataViewList.value = content.metadataList;
+          originColumns.value = content.metadataList;
+          filterConfirm(content.dataList, content.formWidgetMetadataOperation);
+        },
+      },
     },
     {
       prop: 'fastColumns',
@@ -503,9 +527,9 @@ const params = reactive({
 });
 
 const transParams = computed(() => {
-  let formWidgetMetadataViewList = params.formWidgetMetadataViewList.filter(
-    (item) => !originFieldIds.value.includes(item.fieldId)
-  );
+  let formWidgetMetadataViewList = params.formWidgetMetadataViewList
+    .filter((item) => !originFieldIds.value.includes(item.fieldId))
+    .map((item) => ({ fieldId: item.fieldId }));
   return {
     ...omit(params, ['fastSearch', 'fastColumns']),
     formWidgetMetadataViewList,