zhangjie 1 year ago
parent
commit
261a43a4bf

+ 9 - 11
src/views/sop/sop-manage/device-out-in/index.vue

@@ -16,10 +16,10 @@
         <select-service-unit v-model="params[item.prop]"></select-service-unit>
         <select-service-unit v-model="params[item.prop]"></select-service-unit>
       </template>
       </template>
       <template #location>
       <template #location>
-        <select-area v-model="params.location" value-type="full"></select-area>
+        <select-area v-model="params.location" :level="2"></select-area>
       </template>
       </template>
       <template #address>
       <template #address>
-        <select-area v-model="params.address" value-type="full"></select-area>
+        <select-area v-model="params.address" :level="2"></select-area>
       </template>
       </template>
       <template #user="{ item, params }">
       <template #user="{ item, params }">
         <select-filter-user
         <select-filter-user
@@ -105,6 +105,9 @@ const fields = ref([
     labelWidth: 100,
     labelWidth: 100,
     colSpan: 6,
     colSpan: 6,
     options: dictToOptionList(DEVICE_USAGE_TYPE),
     options: dictToOptionList(DEVICE_USAGE_TYPE),
+    attrs: {
+      clearable: true,
+    },
   },
   },
   {
   {
     prop: 'userId',
     prop: 'userId',
@@ -117,6 +120,7 @@ const fields = ref([
   {
   {
     prop: 'deviceStatus',
     prop: 'deviceStatus',
     label: '运行状态',
     label: '运行状态',
+    type: 'select',
     labelWidth: 100,
     labelWidth: 100,
     colSpan: 6,
     colSpan: 6,
     options: dictToOptionList(RUNNING_STATUS),
     options: dictToOptionList(RUNNING_STATUS),
@@ -179,18 +183,14 @@ const params = reactive({
   time: [],
   time: [],
   deviceNo: '',
   deviceNo: '',
   customName: '',
   customName: '',
-  location: ['', '', ''],
-  address: ['', '', ''],
+  location: '',
+  address: '',
 });
 });
 const transParams = computed(() => {
 const transParams = computed(() => {
   return {
   return {
-    ...omit(params, ['time', 'location', 'address']),
+    ...omit(params, ['time']),
     inOutTimeStart: params.time[0],
     inOutTimeStart: params.time[0],
     inOutTimeEnd: params.time[1],
     inOutTimeEnd: params.time[1],
-    address: params.address,
-    deviceNo: params.deviceNo,
-    address: params.address.join(''),
-    location: params.location.join(''),
   };
   };
 });
 });
 const {
 const {
@@ -205,5 +205,3 @@ const addSuccess = () => {
   search();
   search();
 };
 };
 </script>
 </script>
-
-<style></style>

+ 10 - 8
src/views/sop/sop-manage/office-sop/index.vue

@@ -9,19 +9,15 @@
         <template #icon><svg-icon name="delete" color="#fff" /></template>
         <template #icon><svg-icon name="delete" color="#fff" /></template>
         作废
         作废
       </t-button>
       </t-button>
-      <!-- <t-button variant="outline" @click="handleAdd">
-        <template #icon><svg-icon name="view" color="#262626" /></template>
-        显示字段</t-button
-      > -->
       <select-metadata
       <select-metadata
         v-model="params.formWidgetMetadataList"
         v-model="params.formWidgetMetadataList"
         multiple
         multiple
       ></select-metadata>
       ></select-metadata>
-      <t-button variant="outline" @click="handleAdd">
+      <t-button variant="outline" @click="handleRefresh">
         <template #icon><svg-icon name="refresh" color="#262626" /></template>
         <template #icon><svg-icon name="refresh" color="#262626" /></template>
         刷新</t-button
         刷新</t-button
       >
       >
-      <t-button variant="outline" @click="handleAdd">
+      <t-button variant="outline" @click="handleSort">
         <template #icon><svg-icon name="sort" color="#262626" /></template>
         <template #icon><svg-icon name="sort" color="#262626" /></template>
         排序</t-button
         排序</t-button
       >
       >
@@ -171,7 +167,7 @@ import { useAppStore } from '@/store';
 const appStore = useAppStore();
 const appStore = useAppStore();
 
 
 const selectedRowKeys = ref([]);
 const selectedRowKeys = ref([]);
-const selectChange = (value, { selectedRowData }) => {
+const selectChange = (value) => {
   selectedRowKeys.value = value;
   selectedRowKeys.value = value;
 };
 };
 
 
@@ -246,7 +242,13 @@ const {
   onChange,
   onChange,
 } = useFetchTable(sopListApi, { params: transParams });
 } = useFetchTable(sopListApi, { params: transParams });
 
 
-const handleAdd = () => {};
+const handleSort = () => {
+  // TODO:
+};
+const handleRefresh = () => {
+  search();
+};
+
 const toggleSubMenuHandle = () => {
 const toggleSubMenuHandle = () => {
   appStore.toggleSubMenu();
   appStore.toggleSubMenu();
 };
 };

+ 164 - 48
src/views/sop/sop-manage/student-sop/index.vue

@@ -9,23 +9,27 @@
         <template #icon><svg-icon name="delete" color="#262626" /></template>
         <template #icon><svg-icon name="delete" color="#262626" /></template>
         作废
         作废
       </t-button>
       </t-button>
-      <t-button variant="outline" @click="handleAdd">
-        <template #icon><svg-icon name="view" color="#262626" /></template>
-        显示字段</t-button
-      >
-      <t-button variant="outline" @click="handleAdd">
+      <select-metadata
+        v-model="params.formWidgetMetadataList"
+        multiple
+      ></select-metadata>
+      <t-button variant="outline" @click="handleRefresh">
         <template #icon><svg-icon name="refresh" color="#262626" /></template>
         <template #icon><svg-icon name="refresh" color="#262626" /></template>
         刷新</t-button
         刷新</t-button
       >
       >
-      <t-button variant="outline" @click="handleAdd">
+      <t-button variant="outline" @click="handleSort">
         <template #icon><svg-icon name="sort" color="#262626" /></template>
         <template #icon><svg-icon name="sort" color="#262626" /></template>
         排序</t-button
         排序</t-button
       >
       >
-      <t-button variant="outline" @click="handleAdd">
+      <t-button
+        v-if="appStore.showSubmenu"
+        variant="outline"
+        @click="toggleSubMenuHandle"
+      >
         <template #icon><svg-icon name="enlarge" color="#262626" /></template>
         <template #icon><svg-icon name="enlarge" color="#262626" /></template>
         放大</t-button
         放大</t-button
       >
       >
-      <t-button variant="outline" @click="handleAdd">
+      <t-button v-else variant="outline" @click="toggleSubMenuHandle">
         <template #icon><svg-icon name="shrink" color="#262626" /></template>
         <template #icon><svg-icon name="shrink" color="#262626" /></template>
         缩小</t-button
         缩小</t-button
       >
       >
@@ -37,11 +41,6 @@
     </SearchForm>
     </SearchForm>
 
 
     <div class="flex-1 page-wrap">
     <div class="flex-1 page-wrap">
-      <div class="btn-group">
-        <t-button theme="success" :disabled="!selectedRowKeys.length"
-          >批量作废</t-button
-        >
-      </div>
       <t-table
       <t-table
         size="small"
         size="small"
         row-key="id"
         row-key="id"
@@ -60,36 +59,108 @@
         :selected-row-keys="selectedRowKeys"
         :selected-row-keys="selectedRowKeys"
         @select-change="selectChange"
         @select-change="selectChange"
       >
       >
+        <template #beginTime="{ col, row }">
+          {{ timestampFilter(row[col.colKey]) }}
+        </template>
+        <template #examStartTime="{ col, row }">
+          {{ timestampFilter(row[col.colKey]) }}
+        </template>
+        <template #examEndTime="{ col, row }">
+          {{ timestampFilter(row[col.colKey]) }}
+        </template>
+        <template #flowCreateTime="{ col, row }">
+          {{ timestampFilter(row[col.colKey]) }}
+        </template>
+        <template #flowUpdateTime="{ col, row }">
+          {{ timestampFilter(row[col.colKey]) }}
+        </template>
         <template #operate="{ row }">
         <template #operate="{ row }">
           <div class="table-operations" @click.stop>
           <div class="table-operations" @click.stop>
-            <t-link theme="primary" hover="color" @click="toCurSopFlow(row)">
+            <t-link
+              theme="primary"
+              hover="color"
+              @click="editSopFlowHandle(row, 'fill')"
+            >
               填报
               填报
             </t-link>
             </t-link>
-            <t-link theme="primary" hover="color" @click="createSopFlow(row)">
+            <t-link
+              theme="primary"
+              hover="color"
+              @click="editSopFlowHandle(row, 'new')"
+            >
               新增SOP
               新增SOP
             </t-link>
             </t-link>
-            <t-link theme="primary" hover="color" @click="toCurSopFlow(row)">
+            <t-link
+              theme="primary"
+              hover="color"
+              @click="createViolationHandle(row)"
+            >
               新增违规
               新增违规
             </t-link>
             </t-link>
-            <t-link theme="primary" hover="color" @click="toCurSopFlow(row)">
+            <t-link
+              theme="primary"
+              hover="color"
+              @click="createQualityIssueHandle(row)"
+            >
               上报质量问题
               上报质量问题
             </t-link>
             </t-link>
-            <t-link theme="primary" hover="color" @click="planChange(row)">
+            <t-link
+              theme="primary"
+              hover="color"
+              @click="planChangeHandle(row)"
+            >
               计划变更报备
               计划变更报备
             </t-link>
             </t-link>
           </div>
           </div>
         </template>
         </template>
       </t-table>
       </t-table>
     </div>
     </div>
+
+    <!-- SopStepDialog -->
+    <sop-step-dialog
+      v-model:visible="showSopStepDialog"
+      :sop="curSopData"
+      :type="curSopType"
+      @confirm="fetchData"
+    ></sop-step-dialog>
+    <!-- QualityIssueDialog -->
+    <quality-issue-dialog
+      v-model:visible="showQualityIssueDialog"
+      :sop="curSopData"
+      type="new"
+      @confirm="fetchData"
+    ></quality-issue-dialog>
+    <!-- PlanChangeDialog -->
+    <PlanChangeDialog
+      v-model:visible="showPlanChangeDialog"
+      :sop="curSopData"
+      type="new"
+      @confirm="fetchData"
+    ></PlanChangeDialog>
+    <!-- AddViolationDialog -->
+    <add-violation-dialog
+      v-model:visible="showAddViolationDialog"
+      :sop="curSopData"
+      type="new"
+    ></add-violation-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
 <script setup lang="jsx" name="StudentSop">
 <script setup lang="jsx" name="StudentSop">
-import { ref, reactive } from 'vue';
-import { sopBatchCancelApi } from '@/api/sop';
+import { ref, reactive, computed } from 'vue';
 import useFetchTable from '@/hooks/useFetchTable';
 import useFetchTable from '@/hooks/useFetchTable';
+import { sopListApi, sopBatchCancelApi } from '@/api/sop';
+import { timestampFilter } from '@/utils/filter';
+import SopStepDialog from '../sop-step/sop-step-dialog.vue';
+import QualityIssueDialog from '../quality-issue/quality-issue-dialog.vue';
+import PlanChangeDialog from '../plan-change/plan-change-dialog.vue';
+import AddViolationDialog from '../../sop-monitor/violation-registration/add-violation-dialog.vue';
+import { useAppStore } from '@/store';
+
+const appStore = useAppStore();
+
 const selectedRowKeys = ref([]);
 const selectedRowKeys = ref([]);
-const selectChange = (value, { selectedRowData }) => {
+const selectChange = (value) => {
   selectedRowKeys.value = value;
   selectedRowKeys.value = value;
 };
 };
 const columns = [
 const columns = [
@@ -99,29 +170,29 @@ const columns = [
     width: 50,
     width: 50,
     fixed: 'left',
     fixed: 'left',
   },
   },
-  { colKey: 'serviceName', title: '服务单元' },
-  { colKey: 'sopNo', title: 'SOP流水号' },
-  { colKey: 'crmNo', title: '项目单号' },
-  { colKey: 'beginTime', title: '派单时间' },
-  { colKey: 'customManagerName', title: '客户经理' },
-  { colKey: 'customManagerTypeStr', title: '客户类型' },
-  { colKey: 'customName', title: '客户名称' },
-  { colKey: 'crmName', title: '项目名称' },
-  { colKey: 'productName', title: '实施产品' },
-  { colKey: 'examStartTime', title: '考试开始时间' },
-  { colKey: 'examEndTime', title: '考试结束时间' },
+  { 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: '提交人' },
-  { colKey: 'flowCreateTime', title: '提交时间' },
-  { colKey: 'flowUpdateTime', title: '更新时间' },
-  { colKey: 'status', title: '流程状态' },
-  { colKey: 'taskName', title: '流程节点' },
-  { colKey: 'pendApproveName', title: '当前节点负责人' },
+  { colKey: 'flowCreateName', title: '提交人', width: 140 },
+  { colKey: 'flowCreateTime', title: '提交时间', width: 180 },
+  { colKey: 'flowUpdateTime', title: '更新时间', width: 180 },
+  { colKey: 'status', title: '流程状态', width: 120 },
+  { colKey: 'taskName', title: '流程节点', width: 160 },
+  { colKey: 'pendApproveName', title: '当前节点负责人', width: 140 },
   {
   {
     title: '管理',
     title: '管理',
     colKey: 'operate',
     colKey: 'operate',
     fixed: 'right',
     fixed: 'right',
-    width: 240,
+    width: 420,
   },
   },
 ];
 ];
 const fields = ref([
 const fields = ref([
@@ -149,17 +220,30 @@ const fields = ref([
 ]);
 ]);
 const params = reactive({
 const params = reactive({
   serviceId: '',
   serviceId: '',
+  formWidgetMetadataList: [],
+});
+const transParams = computed(() => {
+  return { ...params, type: 'CLOUD_MARK_SOP_FLOW' };
 });
 });
-
 const {
 const {
   loading: tableLoading,
   loading: tableLoading,
   pagination,
   pagination,
   tableData,
   tableData,
   search,
   search,
+  fetchData,
   onChange,
   onChange,
-} = useFetchTable(getTableData);
+} = useFetchTable(sopListApi, { params: transParams });
+
+const handleSort = () => {
+  // TODO:
+};
+const handleRefresh = () => {
+  search();
+};
 
 
-const handleAdd = () => {};
+const toggleSubMenuHandle = () => {
+  appStore.toggleSubMenu();
+};
 
 
 const handleBatchCancel = () => {
 const handleBatchCancel = () => {
   if (!selectedRowKeys.value.length) {
   if (!selectedRowKeys.value.length) {
@@ -184,15 +268,47 @@ const handleBatchCancel = () => {
   });
   });
 };
 };
 
 
-const createSopFlow = (row) => {
-  router.push({ name: 'StuSopStep' });
+const showAddViolationDialog = ref(false);
+const createViolationHandle = (row) => {
+  curSopData.value = row;
+  showAddViolationDialog.value = true;
 };
 };
-const toCurSopFlow = (row) => {
-  router.push({ name: 'StuSopStep' });
+
+const showSopStepDialog = ref(false);
+const curSopData = ref({});
+const curSopType = ref('');
+const editSopFlowHandle = (row, type = 'fill') => {
+  curSopType.value = type;
+
+  if (type === 'new') {
+    curSopData.value = {
+      ...row,
+      flowDeploymentId:
+        appStore.getFlowDetailByType('OFFICE_SOP_FLOW')?.flowDeploymentId,
+    };
+  } else {
+    curSopData.value = row;
+  }
+  showSopStepDialog.value = true;
 };
 };
 
 
-const planChange = (row) => {
-  curRow.value = row;
+const showPlanChangeDialog = ref(false);
+const planChangeHandle = (row) => {
+  curSopData.value = {
+    ...row,
+    flowDeploymentId: appStore.getFlowDetailByType('PROJECT_EXCHANGE_FLOW')
+      ?.flowDeploymentId,
+  };
   showPlanChangeDialog.value = true;
   showPlanChangeDialog.value = true;
 };
 };
+
+const showQualityIssueDialog = ref(false);
+const createQualityIssueHandle = (row) => {
+  curSopData.value = {
+    ...row,
+    flowDeploymentId: appStore.getFlowDetailByType('QUALITY_PROBLEM_FLOW')
+      ?.flowDeploymentId,
+  };
+  showQualityIssueDialog.value = true;
+};
 </script>
 </script>

+ 2 - 1
src/views/system/config-manage/checkin-manage/edit-checkin-dialog.vue

@@ -16,7 +16,8 @@
         </t-col>
         </t-col>
         <t-col :span="6">
         <t-col :span="6">
           <t-form-item label="服务单元" name="serviceId">
           <t-form-item label="服务单元" name="serviceId">
-            <t-select v-model="formData.serviceId"> </t-select>
+            <select-service-unit v-model="formData.serviceId">
+            </select-service-unit>
           </t-form-item>
           </t-form-item>
         </t-col>
         </t-col>
         <t-col :span="6">
         <t-col :span="6">