刘洋 1 year ago
parent
commit
7930f84d03

+ 7 - 0
src/api/sop.js

@@ -285,3 +285,10 @@ export const deleteSopFastOptionsApi = (params) =>
     params,
     loading: true,
   });
+
+export const saveAllocationApi = (data) =>
+  request({
+    url: '/api/admin/sop/allocation',
+    data,
+    loading: true,
+  });

+ 18 - 4
src/components/common/device-manage-new/index.vue

@@ -28,7 +28,7 @@
               <t-form-item label="项目名称">{{ sop.crmName }}</t-form-item>
             </t-col>
             <t-col :span="4">
-              <t-form-item label="科目名称">{{}}</t-form-item>
+              <t-form-item label="科目名称">{{ sop.courseName }}</t-form-item>
             </t-col>
             <t-col :span="4">
               <t-form-item label="客户类型">{{
@@ -39,10 +39,14 @@
               <t-form-item label="客户名称">{{ sop.customName }}</t-form-item>
             </t-col>
             <t-col :span="4">
-              <t-form-item label="实施产品">{{ sop.productName }}</t-form-item>
+              <t-form-item label="实施产品">{{
+                crmInfo.productName
+              }}</t-form-item>
             </t-col>
             <t-col :span="4">
-              <t-form-item label="服务单元">{{ sop.serviceName }}</t-form-item>
+              <t-form-item label="服务单元">{{
+                crmInfo.serviceUnitName
+              }}</t-form-item>
             </t-col>
           </t-row>
         </t-form>
@@ -63,9 +67,10 @@
 </template>
 
 <script lang="ts" name="DeviceManageNew" setup>
-import { computed, ref } from 'vue';
+import { computed, ref, watch } from 'vue';
 import Tab1 from './tab1.vue';
 import Tab2 from './tab2.vue';
+import { sopEditApi } from '@/api/sop';
 const props = defineProps({
   visible: Boolean,
   sop: {
@@ -77,4 +82,13 @@ const props = defineProps({
 });
 const curStep = ref('设备签收登记');
 const emit = defineEmits(['update:visible', 'confirm']);
+const crmInfo = ref({});
+watch(
+  () => props.sop,
+  () => {
+    sopEditApi(props.sop.id).then((res) => {
+      crmInfo.value = res?.crmInfo || {};
+    });
+  }
+);
 </script>

+ 21 - 7
src/views/service-unit/dispatch/dispatch-manage/allocation-dialog.vue

@@ -117,11 +117,13 @@ import {
   getAllocationInfoApi,
   saveAllocationInfoApi,
 } from '@/api/service-unit';
+import { saveAllocationApi } from '@/api/sop';
 import useClearDialog from '@/hooks/useClearDialog';
 const emit = defineEmits(['update:visible', 'success']);
 const props = defineProps({
   visible: Boolean,
   curRow: Object,
+  fromSop: Boolean,
 });
 const requestInfo = ref({});
 const formRef = ref(null);
@@ -149,7 +151,9 @@ const { formData, isEdit } = useClearDialog(
   props,
   formRef,
   () => {
-    formData.crmDetailId = props.curRow?.crmDetailId || props.curRow?.id; //两种场景使用了人员调配,一个是菜单页面的SOP列表,一个是创建sop里的sop列表
+    formData.crmDetailId = props.fromSop
+      ? props.curRow?.crmDetailId
+      : props.curRow?.id; //两种场景使用了人员调配,一个是菜单页面的SOP列表,一个是创建sop里的sop列表
     formData.allocationParams = init();
     getOptions();
   }
@@ -160,7 +164,7 @@ const options2 = ref([]);
 const options3 = ref([]);
 const getOptions = () => {
   getAllocationInfoApi({
-    crmDetailId: props.curRow?.crmDetailId || props.curRow?.id,
+    crmDetailId: props.fromSop ? props.curRow?.crmDetailId : props.curRow?.id,
   }).then((res) => {
     requestInfo.value = res;
     tableData.value[0].history = res.regionCoordinatorInfo.historicalList;
@@ -219,11 +223,21 @@ const save = async () => {
   } else if (!formData.allocationParams[2].userIdList?.length) {
     return MessagePlugin.error('工程师必选');
   }
-  saveAllocationInfoApi(formData).then(() => {
-    MessagePlugin.success('保存成功');
-    emit('update:visible', false);
-    emit('success');
-  });
+  if (props.fromSop) {
+    saveAllocationApi({ ...formData, flowId: props.curRow?.flowId }).then(
+      () => {
+        MessagePlugin.success('保存成功');
+        emit('update:visible', false);
+        emit('success');
+      }
+    );
+  } else {
+    saveAllocationInfoApi(formData).then(() => {
+      MessagePlugin.success('保存成功');
+      emit('update:visible', false);
+      emit('success');
+    });
+  }
 };
 
 onMounted(() => {});

+ 1 - 0
src/views/service-unit/dispatch/dispatch-manage/create-sop.vue

@@ -248,6 +248,7 @@ const columns = [
 const showCreateDialog = ref(false);
 const curRow = ref(null);
 const toCreateSop = () => {
+  curRow.value = null;
   showCreateDialog.value = true;
 };
 const addSopItem = (item) => {

+ 1 - 0
src/views/sop/sop-manage/office-sop/index.vue

@@ -235,6 +235,7 @@
       v-model:visible="showAllocationDialog"
       :curRow="curSopData"
       @success="search"
+      :fromSop="true"
     ></AllocationDialog>
   </div>
 </template>

+ 5 - 0
src/views/sop/sop-manage/sop-step/index.vue

@@ -76,6 +76,11 @@
                 sopInfo.serviceName
               }}</t-form-item>
             </t-col>
+            <t-col :span="3">
+              <t-form-item label="科目名称">{{
+                sopInfo.courseName
+              }}</t-form-item>
+            </t-col>
           </t-row>
         </t-form>
       </t-collapse-panel>

+ 17 - 17
src/views/work-hours/work-hours-manage/work-attendance/index.vue

@@ -268,21 +268,21 @@ const fields = ref([
       clearable: true,
     },
   },
-  {
-    prop: 'violationHoursLimit',
-    type: 'number',
-    label: '违规工时',
-    labelWidth: 80,
-    colSpan: 6,
-    attrs: {
-      theme: 'column',
-      decimalPlaces: 0,
-      max: 1000000,
-      min: 0,
-      label: '>',
-      style: 'width: 100%',
-    },
-  },
+  // {
+  //   prop: 'violationHoursLimit',
+  //   type: 'number',
+  //   label: '违规工时',
+  //   labelWidth: 80,
+  //   colSpan: 6,
+  //   attrs: {
+  //     theme: 'column',
+  //     decimalPlaces: 0,
+  //     max: 1000000,
+  //     min: 0,
+  //     label: '>',
+  //     style: 'width: 100%',
+  //   },
+  // },
   {
     prop: 'dingExceptionLimit',
     type: 'number',
@@ -341,7 +341,7 @@ const params = reactive({
   supplierId: '',
   customName: '',
   sopNo: '',
-  violationHoursLimit: null,
+  // violationHoursLimit: null,
   dingExceptionLimit: null,
   // remainLimit: null,
   exceptionLimit: null,
@@ -378,7 +378,7 @@ const columns = [
   { colKey: 'weekends', title: '周末(天)', width: 120 },
   { colKey: 'legalHolidays', title: '法定节假日(天)', width: 160 },
   { colKey: 'workHours', title: '累计工时(小时)', width: 160 },
-  { colKey: 'violationDays', title: '违规工时(天)', width: 140 },
+  // { colKey: 'violationDays', title: '违规工时(天)', width: 140 },
   { colKey: 'dingExceptionCount', title: '考勤异常数(次)', width: 150 },
   { colKey: 'remainCount', title: '剩余补卡次数(次)', width: 160 },
   { colKey: 'exceptionCount', title: '待处理异常数(次)', width: 160 },

+ 17 - 20
src/views/work-hours/work-hours-manage/work-statistics/index.vue

@@ -152,9 +152,6 @@ const fields = ref([
       {
         type: 'button',
         text: '搜索',
-        attrs: {
-          style: { marginLeft: '0 !important' },
-        },
         onClick: () => {
           search();
           getStatisticsInfo();
@@ -188,21 +185,21 @@ const fields = ref([
       clearable: true,
     },
   },
-  {
-    prop: 'days',
-    type: 'number',
-    label: '违规工时',
-    labelWidth: 80,
-    colSpan: 6,
-    attrs: {
-      theme: 'column',
-      decimalPlaces: 0,
-      max: 1000000,
-      min: 0,
-      label: '>',
-      style: 'width: 100%',
-    },
-  },
+  // {
+  //   prop: 'days',
+  //   type: 'number',
+  //   label: '违规工时',
+  //   labelWidth: 80,
+  //   colSpan: 6,
+  //   attrs: {
+  //     theme: 'column',
+  //     decimalPlaces: 0,
+  //     max: 1000000,
+  //     min: 0,
+  //     label: '>',
+  //     style: 'width: 100%',
+  //   },
+  // },
 ]);
 const mixinSearch = () => {
   search();
@@ -216,7 +213,7 @@ const params = reactive({
   supplierId: '',
   custom: '',
   sopNo: '',
-  days: '',
+  // days: '',
 });
 
 const columns = [
@@ -245,7 +242,7 @@ const columns = [
   { colKey: 'weekends', title: '周末(天)', width: 120 },
   { colKey: 'holidays', title: '法定节假日(天)', width: 160 },
   { colKey: 'workHours', title: '累计工时(小时)', width: 140 },
-  { colKey: 'violationDays', title: '违规工时(天)', width: 140 },
+  // { colKey: 'violationDays', title: '违规工时(天)', width: 140 },
   { colKey: 'submitter', title: '提交人', width: 120 },
   {
     colKey: 'submissionTime',