刘洋 10 月之前
父節點
當前提交
c2ea60a3eb

+ 8 - 3
src/api/service-unit.js

@@ -150,11 +150,16 @@ export const saveProcessVarApi = (data) =>
     loading: true,
   });
 //创建/编辑派单明细sop接口
-export const saveSubSopListApi = (data) =>
-  request({
-    url: '/api/admin/tb/crm/detail/sop/save',
+export const saveSubSopListApi = (data, isCloud = false) => {
+  let url = isCloud
+    ? '/api/admin/tb/crm/detail/sop/cloud_mark/save'
+    : '/api/admin/tb/crm/detail/sop/save';
+  return request({
+    url,
     data,
   });
+};
+
 //发布
 export const subSopPublishApi = (params) =>
   request({

+ 110 - 91
src/views/service-unit/dispatch/dispatch-manage/create-sop-item.vue

@@ -26,6 +26,7 @@ const searchForm = ref();
 const props = defineProps({
   visible: Boolean,
   curRow: { type: Object, default: null },
+  isCloud: { type: Boolean, default: false },
 });
 const emit = defineEmits(['update:visible', 'confirm']);
 
@@ -61,106 +62,124 @@ const { formData, isEdit } = useClearDialog(
   }
 );
 
-const fields = ref([
-  {
-    prop: 'courseName',
-    label: '科目名称',
-    labelWidth: 120,
-    colSpan: 12,
-    attrs: {
-      clearable: true,
-    },
-  },
-  {
-    prop: 'scanStartTime',
-    label: '扫描开始时间',
-    type: 'date',
-    labelWidth: 120,
-    colSpan: 12,
-    attrs: {
-      clearable: true,
-      valueType: 'time-stamp',
-    },
-  },
-  {
-    prop: 'examStudentCount',
-    label: '考生人数',
-    labelWidth: 120,
-    colSpan: 12,
-    attrs: {
-      clearable: true,
-    },
-  },
-  {
-    prop: 'scanEndTime',
-    label: '扫描结束时间',
-    type: 'date',
-    labelWidth: 120,
-    colSpan: 12,
-    attrs: {
-      clearable: true,
-      valueType: 'time-stamp',
-    },
-  },
-  {
-    prop: 'contacts',
-    label: '联系人',
-    labelWidth: 120,
-    colSpan: 12,
-    attrs: {
-      clearable: true,
-      maxlength: 15,
-    },
-  },
-  {
-    prop: 'markPaperStartTime',
-    label: '评卷开始时间',
-    type: 'date',
-    labelWidth: 120,
-    colSpan: 12,
-    attrs: {
-      clearable: true,
-      valueType: 'time-stamp',
+const fields = computed(() => {
+  return [
+    {
+      prop: 'courseName',
+      label: '科目名称',
+      labelWidth: 120,
+      colSpan: 12,
+      attrs: {
+        clearable: true,
+      },
     },
-  },
-  {
-    prop: 'mobileNumber',
-    label: '电话',
-    labelWidth: 120,
-    colSpan: 12,
-    attrs: {
-      clearable: true,
+    props.isCloud
+      ? null
+      : {
+          prop: 'scanStartTime',
+          label: '扫描开始时间',
+          type: 'date',
+          labelWidth: 120,
+          colSpan: 12,
+          attrs: {
+            clearable: true,
+            valueType: 'time-stamp',
+          },
+        },
+    {
+      prop: 'examStudentCount',
+      label: '考生人数',
+      labelWidth: 120,
+      colSpan: 12,
+      attrs: {
+        clearable: true,
+      },
     },
-  },
-  {
-    prop: 'markPaperEndTime',
-    label: '评卷结束时间',
-    type: 'date',
-    labelWidth: 120,
-    colSpan: 12,
-    attrs: {
-      clearable: true,
-      valueType: 'time-stamp',
+    props.isCloud
+      ? null
+      : {
+          prop: 'scanEndTime',
+          label: '扫描结束时间',
+          type: 'date',
+          labelWidth: 120,
+          colSpan: 12,
+          attrs: {
+            clearable: true,
+            valueType: 'time-stamp',
+          },
+        },
+    {
+      prop: 'contacts',
+      label: '联系人',
+      labelWidth: 120,
+      colSpan: 12,
+      attrs: {
+        clearable: true,
+        maxlength: 15,
+      },
     },
-  },
-  {
-    prop: 'serviceScope',
-    label: '服务范围',
-    type: 'select',
-    labelWidth: 120,
-    colSpan: 12,
-    options: dictToOptionList(SERVICE_RANGE),
-    attrs: {
-      clearable: true,
+    props.isCloud
+      ? null
+      : {
+          prop: 'markPaperStartTime',
+          label: '评卷开始时间',
+          type: 'date',
+          labelWidth: 120,
+          colSpan: 12,
+          attrs: {
+            clearable: true,
+            valueType: 'time-stamp',
+          },
+        },
+    {
+      prop: 'mobileNumber',
+      label: '电话',
+      labelWidth: 120,
+      colSpan: 12,
+      attrs: {
+        clearable: true,
+      },
     },
-  },
-]);
+    props.isCloud
+      ? null
+      : {
+          prop: 'markPaperEndTime',
+          label: '评卷结束时间',
+          type: 'date',
+          labelWidth: 120,
+          colSpan: 12,
+          attrs: {
+            clearable: true,
+            valueType: 'time-stamp',
+          },
+        },
+    props.isCloud
+      ? null
+      : {
+          prop: 'serviceScope',
+          label: '服务范围',
+          type: 'select',
+          labelWidth: 120,
+          colSpan: 12,
+          options: dictToOptionList(SERVICE_RANGE),
+          attrs: {
+            clearable: true,
+          },
+        },
+  ];
+});
 const createHandler = async () => {
   const formRef = searchForm.value.formRef;
   const valid = await formRef?.validate();
   if (valid !== true) return;
   emit('update:visible', false);
-  emit('confirm', { ...formData, status: 'UN_PUBLISH' });
+  emit('confirm', {
+    courseName: formData.courseName,
+    examStudentCount: formData.examStudentCount,
+    contacts: formData.contacts,
+    mobileNumber: formData.mobileNumber,
+    status: 'UN_PUBLISH',
+  });
 };
 </script>
 <style lang="less" scoped></style>

+ 47 - 26
src/views/service-unit/dispatch/dispatch-manage/create-sop.vue

@@ -53,7 +53,7 @@
         </t-form>
       </t-collapse-panel>
     </t-collapse>
-    <div class="pt-20px" style="border-top: 1px solid #f0f0f0">
+    <div class="pt-20px" style="border-top: 1px solid #f0f0f0" v-if="!isCloud">
       <t-button @click="editProcessVar" v-if="!radioEditStatus">编辑</t-button>
       <t-button @click="editProcessVar" v-else>取消</t-button>
       <t-button
@@ -65,7 +65,7 @@
         >保存</t-button
       >
     </div>
-    <div class="mt-10px">
+    <div class="mt-10px" v-if="!isCloud">
       <t-row :gutter="[0, 0]">
         <t-col
           :span="
@@ -86,7 +86,11 @@
         </t-col>
       </t-row>
     </div>
-    <div class="btn-box pt-20px" style="border-top: 1px solid #f0f0f0">
+    <div
+      class="btn-box pt-20px"
+      style="border-top: 1px solid #f0f0f0"
+      v-if="!isCloud"
+    >
       <t-space>
         <t-button @click="toCreateSop">
           <template #icon><svg-icon name="add-circle" color="#fff" /></template
@@ -163,6 +167,7 @@
               发布
             </t-link>
             <t-link
+              v-if="!isCloud"
               theme="primary"
               hover="color"
               @click="deleteSopItem(row)"
@@ -178,6 +183,7 @@
       v-model:visible="showCreateDialog"
       :curRow="curRow"
       @confirm="addSopItem"
+      :isCloud="isCloud"
     ></CreateSopItem>
 
     <AllocationDialog
@@ -234,29 +240,41 @@ const props = defineProps({
 });
 const emit = defineEmits(['update:modelValue', 'confirm']);
 
+const isCloud = computed(() => {
+  return props.dispatchInfo?.type === 'CLOUD_MARK';
+});
+
 const visible = useVModel(props, 'modelValue', emit);
 const title = computed(() => {
+  if (isCloud.value) return '研究生SOP';
   if (props.type === 'new') return '新增SOP';
   if (props.type === 'edit') return '编辑SOP';
 });
-const columns = [
-  { colKey: 'courseName', title: '科目名称' },
-  { colKey: 'examStudentCount', title: '考生人数', width: 80 },
-  { colKey: 'contacts', title: '联系人', width: 100 },
-  { colKey: 'mobileNumber', title: '电话', width: 120 },
-  { colKey: 'serviceScope', title: '服务范围', width: 100 },
-  { colKey: 'scanStartTime', title: '扫描开始时间', width: 150 },
-  { colKey: 'scanEndTime', title: '扫描结束时间', width: 150 },
-  { colKey: 'markPaperStartTime', title: '评卷开始时间', width: 150 },
-  { colKey: 'markPaperEndTime', title: '评卷结束时间', width: 150 },
-  {
-    colKey: 'operate',
-    title: '管理',
-    fixed: 'right',
-    width: 250,
-    cell: 'operate',
-  },
-];
+const columns = computed(() => {
+  let arr = isCloud.value
+    ? []
+    : [
+        { colKey: 'serviceScope', title: '服务范围', width: 100 },
+        { colKey: 'scanStartTime', title: '扫描开始时间', width: 150 },
+        { colKey: 'scanEndTime', title: '扫描结束时间', width: 150 },
+        { colKey: 'markPaperStartTime', title: '评卷开始时间', width: 150 },
+        { colKey: 'markPaperEndTime', title: '评卷结束时间', width: 150 },
+      ];
+  return [
+    { colKey: 'courseName', title: '科目名称' },
+    { colKey: 'examStudentCount', title: '考生人数', width: 100 },
+    { colKey: 'contacts', title: '联系人', width: 100 },
+    { colKey: 'mobileNumber', title: '电话', width: 140 },
+    ...arr,
+    {
+      colKey: 'operate',
+      title: '管理',
+      fixed: 'right',
+      width: 250,
+      cell: 'operate',
+    },
+  ];
+});
 const showCreateDialog = ref(false);
 const curRow = ref(null);
 const toCreateSop = () => {
@@ -264,11 +282,14 @@ const toCreateSop = () => {
   showCreateDialog.value = true;
 };
 const addSopItem = (item) => {
-  saveSubSopListApi({
-    ...item,
-    crmNo: props.dispatchInfo.crmNo,
-    id: curRow.value?.id,
-  }).then(() => {
+  saveSubSopListApi(
+    {
+      ...item,
+      crmNo: props.dispatchInfo.crmNo,
+      id: curRow.value?.id,
+    },
+    isCloud.value
+  ).then(() => {
     MessagePlugin.success(curRow.value?.id ? '修改成功' : '新增成功');
     fetchData();
   });

+ 1 - 6
src/views/service-unit/dispatch/dispatch-manage/index.vue

@@ -112,12 +112,7 @@
                 修改
               </t-link>
             </template>
-            <t-link
-              theme="primary"
-              hover="color"
-              @click="createSop(row)"
-              :disabled="row.type !== 'OFFICE'"
-            >
+            <t-link theme="primary" hover="color" @click="createSop(row)">
               创建sop
             </t-link>
           </div>