刘洋 1 tahun lalu
induk
melakukan
c71c097f11

+ 3 - 0
src/components/global/tag-list/index.vue

@@ -41,6 +41,7 @@ import {
   deleteSopFastOptionsApi,
 } from '@/api/sop';
 import { MessagePlugin } from 'tdesign-vue-next';
+import bus from '@/utils/bus';
 const emit = defineEmits(['tagClick']);
 const formRef = ref();
 const props = defineProps({
@@ -89,6 +90,7 @@ const save = async () => {
     setTimeout(() => {
       formRef.value?.clearValidate();
     }, 0);
+    bus.emit('updateFast' + props.contentType);
   });
 };
 const tagClick = (item) => {
@@ -107,6 +109,7 @@ const deleteItem = (item) => {
       deleteSopFastOptionsApi({ id: item.id }).then(() => {
         MessagePlugin.success('删除成功');
         getList();
+        bus.emit('updateFast' + props.contentType);
       });
     },
   });

+ 12 - 3
src/views/service-unit/dispatch/dispatch-manage/create-sop.vue

@@ -155,7 +155,12 @@
             >
               发布
             </t-link>
-            <t-link theme="primary" hover="color" @click="deleteSopItem(row)">
+            <t-link
+              theme="primary"
+              hover="color"
+              @click="deleteSopItem(row)"
+              :disabled="row.sopStatus === 'START'"
+            >
               删除
             </t-link>
           </div>
@@ -246,8 +251,12 @@ const toCreateSop = () => {
   showCreateDialog.value = true;
 };
 const addSopItem = (item) => {
-  saveSubSopListApi({ ...item, crmNo: props.dispatchInfo.crmNo }).then(() => {
-    MessagePlugin.success(item.id ? '修改成功' : '新增成功');
+  saveSubSopListApi({
+    ...item,
+    crmNo: props.dispatchInfo.crmNo,
+    id: curRow.value?.id,
+  }).then(() => {
+    MessagePlugin.success(curRow.value?.id ? '修改成功' : '新增成功');
     fetchData();
   });
 };

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

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

+ 1 - 1
src/views/sop/components/select-metadata.vue

@@ -1,5 +1,5 @@
 <template>
-  <t-popup placement="bottom-left" trigger="click">
+  <t-popup placement="bottom-left" trigger="click" :zIndex="1000">
     <t-button variant="outline">
       <template #icon><svg-icon name="view" color="#262626" /></template>
       显示字段

+ 29 - 9
src/views/sop/sop-manage/office-sop/index.vue

@@ -47,6 +47,7 @@
         @confirm="filterConfirm"
         type="OFFICE_SOP_FLOW"
         contentType="SEARCH"
+        :fastDataList="fastDataList"
       ></select-filter>
     </div>
     <SearchForm :fields="fields" :params="params" :search="search">
@@ -72,13 +73,7 @@
         ></select-type-user>
       </template>
       <template #buttons>
-        <!-- <t-space :size="16">
-          <select-filter
-            :metadata="formWidgetMetadataViewList"
-            @confirm="filterConfirm"
-          ></select-filter> -->
         <t-button theme="primary" @click="search">搜索</t-button>
-        <!-- </t-space> -->
       </template>
     </SearchForm>
 
@@ -232,7 +227,7 @@
 </template>
 
 <script setup name="OfficeSop">
-import { ref, reactive, computed, watch } from 'vue';
+import { ref, reactive, computed, watch, onMounted } from 'vue';
 import useFetchTable from '@/hooks/useFetchTable';
 import { sopListApi, sopBatchCancelApi, getSopFastOptionsApi } from '@/api/sop';
 import { timestampFilter } from '@/utils/filter';
@@ -251,6 +246,7 @@ import { CUSTOMER_TYPE, FLOW_STATUS } from '@/config/constants';
 import { dictToOptionList } from '@/utils/tool';
 import DeviceManageNew from '@/components/common/device-manage-new';
 import { omit } from 'lodash-es';
+import bus from '@/utils/bus';
 const { perm } = usePermission();
 
 const appStore = useAppStore();
@@ -354,7 +350,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(() => {
   const defaultColumns = [
@@ -421,6 +418,12 @@ const getFastSearchOptions = () => {
   });
 };
 getFastSearchOptions();
+onMounted(() => {
+  bus.on('updateFastVIEW', getFastShowOptions);
+  bus.on('updateFastSEARCH', getFastSearchOptions);
+});
+const fastDataList = ref([]);
+
 const fields = computed(() => {
   return [
     {
@@ -482,6 +485,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',
@@ -490,6 +505,12 @@ const fields = computed(() => {
       labelWidth: 104,
       colSpan: 6,
       options: fastShowOptions.value,
+      attrs: {
+        onChange: (val) => {
+          let item = fastShowOptions.value.find((v) => v.id == val);
+          originColumns.value = JSON.parse(item.content);
+        },
+      },
     },
     {
       prop: 'dingPlan',
@@ -606,7 +627,6 @@ const handleBatchCancel = () => {
       );
       if (!res) return;
       MessagePlugin.success('操作成功');
-      // refresh();
       search();
     },
   });

+ 6 - 2
src/views/sop/sop-manage/student-sop/index.vue

@@ -223,7 +223,7 @@
 </template>
 
 <script setup name="StudentSop">
-import { ref, reactive, computed, watch } from 'vue';
+import { ref, reactive, computed, watch, onMounted } from 'vue';
 import useFetchTable from '@/hooks/useFetchTable';
 import { sopListApi, sopBatchCancelApi, getSopFastOptionsApi } from '@/api/sop';
 import { timestampFilter } from '@/utils/filter';
@@ -242,6 +242,7 @@ import { CUSTOMER_TYPE, FLOW_STATUS } from '@/config/constants';
 import { dictToOptionList } from '@/utils/tool';
 import DeviceManageNew from '@/components/common/device-manage-new';
 import { omit } from 'lodash-es';
+import bus from '@/utils/bus';
 const { perm } = usePermission();
 
 const appStore = useAppStore();
@@ -430,7 +431,10 @@ const getFastSearchOptions = () => {
   });
 };
 getFastSearchOptions();
-
+onMounted(() => {
+  bus.on('updateFastVIEW', getFastShowOptions);
+  bus.on('updateFastSEARCH', getFastSearchOptions);
+});
 const fastDataList = ref([]);
 
 const fields = computed(() => {