zhangjie před 1 rokem
rodič
revize
856387aece

+ 8 - 2
src/views/sop/components/select-metadata.vue

@@ -81,14 +81,20 @@ const onChange = () => {
   const selectedData = optionList.value.filter(
     (item) => selected.value && selected.value.includes(item.fieldId)
   );
-  emit('update:modelValue', selected.value);
+  emit(
+    'update:modelValue',
+    selected.value.map((item) => {
+      return { fieldId: item };
+    })
+  );
   emit('change', selectedData);
 };
 
 watch(
   () => props.modelValue,
   (val) => {
-    selected.value = val;
+    const data = val || [];
+    selected.value = data.map((item) => item.fieldId);
   },
   {
     immediate: true,

+ 51 - 32
src/views/sop/sop-manage/office-sop/index.vue

@@ -205,38 +205,57 @@ const selectChange = (value) => {
   selectedRowKeys.value = value;
 };
 
-const columns = [
-  {
-    colKey: 'row-select',
-    type: 'multiple',
-    width: 50,
-    fixed: 'left',
-  },
-  { colKey: 'serviceName', title: '服务单元', width: 160 },
-  { colKey: 'sopNo', title: 'SOP流水号', width: 200 },
-  { colKey: 'crmNo', title: '项目单号', width: 200 },
-  { colKey: 'beginTime', title: '派单时间', width: 180 },
-  { colKey: 'customManagerName', title: '客户经理', width: 140 },
-  { colKey: 'customManagerTypeStr', title: '客户类型', width: 120 },
-  { colKey: 'customName', title: '客户名称', width: 140 },
-  { colKey: 'crmName', title: '项目名称', minWidth: 160 },
-  { colKey: 'productName', title: '实施产品', width: 120 },
-  { colKey: 'examStartTime', title: '考试开始时间', width: 180 },
-  { colKey: 'examEndTime', title: '考试结束时间', width: 180 },
-  //...
-  { colKey: 'flowCreateName', title: '提交人', width: 140 },
-  { colKey: 'flowCreateTime', title: '提交时间', width: 180 },
-  { colKey: 'flowUpdateTime', title: '更新时间', width: 180 },
-  { colKey: 'statusStr', title: '流程状态', width: 120 },
-  { colKey: 'taskName', title: '流程节点', width: 160 },
-  { colKey: 'pendApproveName', title: '当前节点负责人', width: 140 },
-  {
-    title: '管理',
-    colKey: 'operate',
-    fixed: 'right',
-    width: 450,
-  },
-];
+const columns = computed(() => {
+  const defaultColumns = [
+    {
+      colKey: 'row-select',
+      type: 'multiple',
+      width: 50,
+      fixed: 'left',
+    },
+    { colKey: 'serviceName', title: '服务单元', width: 160 },
+    { colKey: 'sopNo', title: 'SOP流水号', width: 200 },
+    { colKey: 'crmNo', title: '项目单号', width: 200 },
+    { colKey: 'beginTime', title: '派单时间', width: 180 },
+    { colKey: 'customManagerName', title: '客户经理', width: 140 },
+    { colKey: 'customManagerTypeStr', title: '客户类型', width: 120 },
+    { colKey: 'customName', title: '客户名称', width: 140 },
+    { colKey: 'crmName', title: '项目名称', minWidth: 160 },
+    { colKey: 'productName', title: '实施产品', width: 120 },
+    { colKey: 'examStartTime', title: '考试开始时间', width: 180 },
+    { colKey: 'examEndTime', title: '考试结束时间', width: 180 },
+    { colKey: 'flowCreateName', title: '提交人', width: 140 },
+    { colKey: 'flowCreateTime', title: '提交时间', width: 180 },
+    { colKey: 'flowUpdateTime', title: '更新时间', width: 180 },
+    { colKey: 'statusStr', title: '流程状态', width: 120 },
+    { colKey: 'taskName', title: '流程节点', width: 160 },
+    { colKey: 'pendApproveName', title: '当前节点负责人', width: 140 },
+    {
+      title: '管理',
+      colKey: 'operate',
+      fixed: 'right',
+      width: 450,
+    },
+  ];
+
+  if (formWidgetMetadataViewList.value.length) {
+    let metadataColumns = formWidgetMetadataViewList.value.map((item) => {
+      return {
+        colKey: item.fieldId,
+        title: item.fieldTitle,
+        minWidth: 120,
+      };
+    });
+    return [
+      ...defaultColumns.slice(0, -1),
+      ...metadataColumns,
+      ...defaultColumns.slice(-1),
+    ];
+  } else {
+    return defaultColumns;
+  }
+});
+
 const fields = ref([
   {
     prop: 'serviceId',

+ 1 - 4
src/views/sop/sop-manage/sop-step/index.vue

@@ -561,10 +561,7 @@ const getFormData = () => {
     }
   } else {
     // 新增 or 填报
-    const stepData = allSteps.value.find(
-      (item) => item.taskName === curStep.value
-    );
-    data = { ...stepData };
+    data = { ...curStepData.value };
     data.formProperty = data.formProperty.map((item) => {
       return {
         ...item,

+ 51 - 32
src/views/sop/sop-manage/student-sop/index.vue

@@ -204,38 +204,57 @@ const selectedRowKeys = ref([]);
 const selectChange = (value) => {
   selectedRowKeys.value = value;
 };
-const columns = [
-  {
-    colKey: 'row-select',
-    type: 'multiple',
-    width: 50,
-    fixed: 'left',
-  },
-  { colKey: 'serviceName', title: '服务单元', width: 160 },
-  { colKey: 'sopNo', title: 'SOP流水号', width: 200 },
-  { colKey: 'crmNo', title: '项目单号', width: 200 },
-  { colKey: 'beginTime', title: '派单时间', width: 180 },
-  { colKey: 'customManagerName', title: '客户经理', width: 140 },
-  { colKey: 'customManagerTypeStr', title: '客户类型', width: 120 },
-  { colKey: 'customName', title: '客户名称', width: 140 },
-  { colKey: 'crmName', title: '项目名称', minWidth: 160 },
-  { colKey: 'productName', title: '实施产品', width: 120 },
-  { colKey: 'examStartTime', title: '考试开始时间', width: 180 },
-  { colKey: 'examEndTime', title: '考试结束时间', width: 180 },
-  //...
-  { colKey: 'flowCreateName', title: '提交人', width: 140 },
-  { colKey: 'flowCreateTime', title: '提交时间', width: 180 },
-  { colKey: 'flowUpdateTime', title: '更新时间', width: 180 },
-  { colKey: 'statusStr', title: '流程状态', width: 120 },
-  { colKey: 'taskName', title: '流程节点', width: 160 },
-  { colKey: 'pendApproveName', title: '当前节点负责人', width: 140 },
-  {
-    title: '管理',
-    colKey: 'operate',
-    fixed: 'right',
-    width: 420,
-  },
-];
+const columns = computed(() => {
+  const defaultColumns = [
+    {
+      colKey: 'row-select',
+      type: 'multiple',
+      width: 50,
+      fixed: 'left',
+    },
+    { colKey: 'serviceName', title: '服务单元', width: 160 },
+    { colKey: 'sopNo', title: 'SOP流水号', width: 200 },
+    { colKey: 'crmNo', title: '项目单号', width: 200 },
+    { colKey: 'beginTime', title: '派单时间', width: 180 },
+    { colKey: 'customManagerName', title: '客户经理', width: 140 },
+    { colKey: 'customManagerTypeStr', title: '客户类型', width: 120 },
+    { colKey: 'customName', title: '客户名称', width: 140 },
+    { colKey: 'crmName', title: '项目名称', minWidth: 160 },
+    { colKey: 'productName', title: '实施产品', width: 120 },
+    { colKey: 'examStartTime', title: '考试开始时间', width: 180 },
+    { colKey: 'examEndTime', title: '考试结束时间', width: 180 },
+    { colKey: 'flowCreateName', title: '提交人', width: 140 },
+    { colKey: 'flowCreateTime', title: '提交时间', width: 180 },
+    { colKey: 'flowUpdateTime', title: '更新时间', width: 180 },
+    { colKey: 'statusStr', title: '流程状态', width: 120 },
+    { colKey: 'taskName', title: '流程节点', width: 160 },
+    { colKey: 'pendApproveName', title: '当前节点负责人', width: 140 },
+    {
+      title: '管理',
+      colKey: 'operate',
+      fixed: 'right',
+      width: 450,
+    },
+  ];
+
+  if (formWidgetMetadataViewList.value.length) {
+    let metadataColumns = formWidgetMetadataViewList.value.map((item) => {
+      return {
+        colKey: item.fieldId,
+        title: item.fieldTitle,
+        minWidth: 120,
+      };
+    });
+    return [
+      ...defaultColumns.slice(0, -1),
+      ...metadataColumns,
+      ...defaultColumns.slice(-1),
+    ];
+  } else {
+    return defaultColumns;
+  }
+});
+
 const fields = ref([
   {
     prop: 'serviceId',