Selaa lähdekoodia

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper into master

seyason 11 kuukautta sitten
vanhempi
commit
40fcb9dcee
26 muutettua tiedostoa jossa 940 lisäystä ja 250 poistoa
  1. 1 0
      fhKeeper/formulahousekeeper/customerBuler-crm/package.json
  2. 6 6
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/index.vue
  3. 1 1
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/contacts/component/information.vue
  4. 17 33
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/operationRecord.vue
  5. 142 45
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/relatedBusiness.vue
  6. 104 46
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/relatedContacts.vue
  7. 152 46
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/relatedOrders.vue
  8. 4 4
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/detail/index.vue
  9. 17 13
      fhKeeper/formulahousekeeper/customerBuler-crm/src/utils/customInstructions.ts
  10. 26 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/utils/tools.ts
  11. 104 4
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/CustomController.java
  12. 6 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Custom.java
  13. 2 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/ContactsService.java
  14. 3 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/CustomService.java
  15. 3 2
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/BusinessOpportunityServiceImpl.java
  16. 8 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ContactsServiceImpl.java
  17. 220 11
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/CustomServiceImpl.java
  18. 15 2
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ProductController.java
  19. 7 7
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/Product.java
  20. 1 1
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/ProductService.java
  21. 8 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/PlanServiceImpl.java
  22. 27 17
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ProductServiceImpl.java
  23. 2 1
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/ProductMapper.xml
  24. 7 7
      fhKeeper/formulahousekeeper/timesheet-workshop/src/views/plan/planComponent.vue
  25. 56 3
      fhKeeper/formulahousekeeper/timesheet-workshop/src/views/product/list.vue
  26. 1 1
      fhKeeper/formulahousekeeper/timesheet-workshop/src/views/workReport/daily.vue

+ 1 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/package.json

@@ -7,6 +7,7 @@
     "dev": "vite",
     "start": "vite",
     "build": "vue-tsc && vite build",
+    "buildNoTs": "vite build",
     "preview": "vite preview"
   },
   "dependencies": {

+ 6 - 6
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/index.vue

@@ -47,14 +47,14 @@
     <div class="flex-1 p-5 overflow-auto">
       <div class="bg-white w-full h-full p-3 shadow-md rounded-md flex flex-col">
         <div class="flex justify-end pb-3">
-          <el-button type="primary" @click="editNewBusiness(false)">新建商机</el-button>
+          <el-button v-permission="['businessAddAnEdit']" type="primary" @click="editNewBusiness(false)">新建商机</el-button>
           <el-button type="primary" @click="showVisible('batchTransferVisible')"
             :disabled="batchTableData.length <= 0">批量转移</el-button>
           <el-button type="primary" @click="batchDeteleItem()" :disabled="batchTableData.length <= 0">批量删除</el-button>
           <el-button type="primary" @click="showVisible('stageSetVisible')">阶段设置</el-button>
           <el-button type="primary" @click="showVisible('deteleBusinessVisible')">回收站</el-button>
-          <el-button type="primary" @click="showVisible('importVisible')">导入</el-button>
-          <el-button type="primary" @click="exportBusinessTableList()" :loading="allLoading.exoprtLoading">导出</el-button>
+          <el-button v-permission="['businessImport']" type="primary" @click="showVisible('importVisible')">导入</el-button>
+          <el-button v-permission="['businessExport']" type="primary" @click="exportBusinessTableList()" :loading="allLoading.exoprtLoading">导出</el-button>
         </div>
         <div class="flex-1 w-full overflow-hidden">
           <el-table ref="businessTableRef" :data="businessTable" border v-loading="allLoading.businessTableLading"
@@ -70,10 +70,10 @@
             </el-table-column>
             <el-table-column label="操作" fixed="right" width="200">
               <template #default="scope">
-                <el-button link type="primary" size="large" @click="editNewBusiness(scope.row)">编辑</el-button>
-                <el-button link type="primary" size="large" @click="newTask(scope.row)">新建任务</el-button>
+                <el-button link type="primary" size="large" @click="editNewBusiness(scope.row)" v-permission="['businessAddAnEdit']">编辑</el-button>
+                <el-button link type="primary" size="large" @click="newTask(scope.row)" v-permission="['tasksAdd']">新建任务</el-button>
                 <el-button link type="danger" size="large"
-                  @click="businessDeteleItem(scope.row.id, scope.row.name)">删除</el-button>
+                  @click="businessDeteleItem(scope.row.id, scope.row.name)" v-permission="['businessAddAnEdit']">删除</el-button>
               </template>
             </el-table-column>
           </el-table>

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/contacts/component/information.vue

@@ -159,7 +159,7 @@ function closeVisible(type: keyof typeof allVisible) {
 }
 
 const formItems = reactive([
-    { label: '联系人', key: 'name', value: '', labelClass: 'w-20 text-right text-gray-500', width: '48%' },
+    { label: '联系人', key: 'contactsName', value: '', labelClass: 'w-20 text-right text-gray-500', width: '48%' },
     { label: '客户', key: 'productName', value: '', labelClass: 'w-22 text-right text-gray-500', width: '48%' },
     { label: '电话', key: 'phone', value: '', labelClass: 'w-22 text-right text-gray-500', width: '48%' },
     { label: '邮箱', key: 'email', value: '', labelClass: 'w-22 text-right text-gray-500', width: '48%' },

+ 17 - 33
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/operationRecord.vue

@@ -5,45 +5,29 @@
         </div>
         <div class="flex-1 overflow-auto pt-5">
             <el-table :data="operationRecordtable" border style="width: 100%;height: 278px;">
-                <el-table-column prop="operatingTime" label="操作时间" width="140" />
-                <el-table-column prop="operator" label="操作人" width="120" />
-                <el-table-column prop="operationContent" label="操作内容" />
+                <el-table-column prop="creaTime" label="操作时间" width="140" />
+                <el-table-column prop="username" label="操作人" width="120" />
+                <el-table-column prop="name" label="操作内容" />
             </el-table>
         </div>
     </div>
 </template>
 <script lang="ts" setup>
-import { ref, reactive, onMounted, onUnmounted, defineExpose, inject } from 'vue'
+import { ref, reactive, onMounted, onUnmounted, defineExpose, inject, watchEffect } from 'vue'
+
+const operationRecordtable = ref([])
+const information = ref({})
+
+const props = defineProps<{
+    data: any
+}>()
+
+watchEffect(() => {
+    const { data } = props
+    information.value = data
+    operationRecordtable.value = data.actionLogs || []
+})
 
-const operationRecordtable = ref([{
-    operationContent: '转移线索',
-    operator: '张三',
-    operatingTime: '2024-04-01',
-}, {
-    operationContent: '转移线索',
-    operator: '张三',
-    operatingTime: '2024-04-01',
-}, {
-    operationContent: '转移线索',
-    operator: '张三',
-    operatingTime: '2024-04-01',
-}, {
-    operationContent: '转移线索',
-    operator: '张三',
-    operatingTime: '2024-04-01',
-}, {
-    operationContent: '转移线索',
-    operator: '张三',
-    operatingTime: '2024-04-01',
-}, {
-    operationContent: '转移线索',
-    operator: '张三',
-    operatingTime: '2024-04-01',
-}, {
-    operationContent: '转移线索',
-    operator: '张三',
-    operatingTime: '2024-04-01',
-},])
 // 生命周期钩子
 onMounted(() => {
 });

+ 142 - 45
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/relatedBusiness.vue

@@ -3,7 +3,7 @@
         <div class="flex justify-between">
             <div class="title">相关商机</div>
             <div>
-                <el-button type="primary">新建商机</el-button>
+                <el-button type="primary" @click="editNewBusiness()">新建商机</el-button>
             </div>
         </div>
         <div class="flex-1 overflow-auto pt-3">
@@ -25,56 +25,153 @@
                 <el-table-column prop="endTime" label="修改时间" width="130" />
             </el-table>
         </div>
+
+        <el-dialog v-model="allVisible.newBusinessisible" width="1000" :show-close="false" top="10vh">
+            <template #header="{ close, titleId, titleClass }">
+                <div class="flex justify-between items-center border-b pb-3 dialog-header">
+                    <h4 :id="titleId">{{ '新建商机' }}</h4>
+                    <div>
+                        <el-button type="primary" @click="editBusiness(false)" :loading="allLoading.businessSaveLading"
+                            :disabled="allLoading.newBusinessSaveLading">保存</el-button>
+                        <el-button @click="closeVisible('newBusinessisible')">取消</el-button>
+                    </div>
+                </div>
+            </template>
+            <div class="h-[60vh] overflow-y-auto scroll-bar pt-3" v-loading="allLoading.generateFormLading">
+                <GenerateForm ref="businessTemplateRef" :data="businessTemplate" :value="businessTemplateValue"
+                    :key="businessTemplateKey" />
+                <div>相关产品</div>
+                <RelatedProducts ref="relatedProductsRef" :productTableList="productTableList"
+                    :productTableListValue="productTableListValue" />
+            </div>
+        </el-dialog>
     </div>
 </template>
 <script lang="ts" setup>
-import { ref, reactive, onMounted, onUnmounted, defineExpose, inject } from 'vue'
+import { get, post } from '@/utils/request';
+import { ref, reactive, onMounted, onUnmounted, defineExpose, inject, watchEffect } from 'vue'
+import { GenerateForm } from '@zmjs/form-design';
+import RelatedProducts from '@/components/relatedProducts/relatedProducts.vue'
+import { GETTABLELIST } from '@/pages/product/api';
+import { GETGENERATEFOEM, UPDATEINSET } from '@/pages/business/api';
+import { setTemplateDataDisable } from '@/utils/tools';
+import { formatDateTime } from '@/utils/times';
+
+const emits = defineEmits(['refreshData']);
+const globalPopup = inject<GlobalPopup>('globalPopup')
+const props = defineProps<{
+    data: any
+}>()
+
+const information = ref<any>({})
+const relatedTaskstable = ref([])
+const relatedProductsRef = ref<typeof RelatedProducts>()
+const businessTemplateRef = ref<typeof GenerateForm>() // 自定义表单dom
+const businessTemplateValue = ref({})
+const businessTemplateKey = ref(1)
+const productTableList = ref([])
+const productTableListValue = ref([])
+const businessTemplate = ref({
+    config: {},
+    list: []
+}) // 自定义表单数据
+const allVisible = reactive({
+    newBusinessisible: false
+})
+const allLoading = reactive({
+    generateFormLading: false,
+    newBusinessSaveLading: false,
+    businessSaveLading: false
+})
+
+function editBusiness(visibles: boolean) {
+    businessTemplateRef.value?.getData().then((res: any) => {
+        let productTableListData = relatedProductsRef?.value?.returnData() || []
+        productTableListData.forEach((item: any) => {
+            delete item.id
+        })
+        let newForm = {
+            ...res,
+            expectedTransactionDate: res.expectedTransactionDate ? formatDateTime(new Date(res.expectedTransactionDate)) : '',
+            businessItemProductList: productTableListData ? JSON.stringify(productTableListData) : []
+        }
+        allLoading.businessSaveLading = true
+        post(UPDATEINSET, { ...businessTemplateValue.value, ...newForm }).then((_res) => {
+            allVisible.newBusinessisible = visibles
+            globalPopup?.showSuccess('保存成功')
+            emits('refreshData')
+        }).finally(() => {
+            allLoading.businessSaveLading = false
+        })
+    }).catch((_err: any) => {
+        console.log(_err)
+        globalPopup?.showError('请填写完整')
+    })
+}
+
+function editNewBusiness() {
+    showVisible('newBusinessisible')
+    allLoading.generateFormLading = true
+    businessTemplateValue.value = { customerId: information.value.id }
+    productTableListValue.value = []
+    setTimeout(() => {
+        businessTemplateRef.value && businessTemplateRef.value.reset()
+        businessTemplateKey.value++
+        allLoading.generateFormLading = false
+    }, 500)
+}
+
+async function getSystemField() {
+    const datas = await get(GETGENERATEFOEM)
+    let newConfig = JSON.parse(datas.data[0].config)
+    newConfig.list = setTemplateDataDisable(newConfig.list, ['customerId'])
+    businessTemplate.value = newConfig
+}
+
+function showVisible(type: keyof typeof allVisible) {
+    allVisible[type] = true
+}
+
+function closeVisible(type: keyof typeof allVisible) {
+    allVisible[type] = false
+}
+
+function getProductTableList() {
+    post(GETTABLELIST, { pageIndex: -1, pageSize: -1 }).then((res) => {
+        if (res.code == 'ok') {
+            const { record, total } = res.data
+            productTableList.value = record.map((item: any) => {
+                const { id, productName, productCode, unit, unitName, typeName, type, price, inventory } = item
+                return {
+                    id,
+                    productId: id,
+                    productName,
+                    productCode,
+                    unit,
+                    unitName,
+                    price,
+                    type,
+                    typeName,
+                    inventory,
+                    quantity: '',
+                    discount: '',
+                    totalPrice: ''
+                }
+            })
+        }
+    })
+}
+
+watchEffect(() => {
+    const { data } = props
+    information.value = data
+    relatedTaskstable.value = []
+})
 
-const relatedTaskstable = ref([{
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}])
 // 生命周期钩子
 onMounted(() => {
+    getProductTableList()
+    getSystemField()
 });
 </script>
 <style scoped lang="scss">

+ 104 - 46
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/relatedContacts.vue

@@ -3,11 +3,11 @@
         <div class="flex justify-between">
             <div class="title">相关联系人</div>
             <div>
-                <el-button type="primary">新建联系人</el-button>
+                <el-button type="primary" @click="editContacts(information)">新建联系人</el-button>
             </div>
         </div>
         <div class="flex-1 overflow-auto pt-3">
-            <el-table :data="relatedTaskstable" border style="width: 100%;height: 300px;">
+            <el-table :data="relatedCustomertable" border style="width: 100%;height: 300px;">
                 <el-table-column label="序号" width="80">
                     <template #default="scope">
                         {{ scope.$index + 1 }}
@@ -29,56 +29,114 @@
                 <el-table-column prop="endTime" label="创建时间" width="130" />
             </el-table>
         </div>
+
+        <!-- 弹窗 -->
+        <el-dialog v-model="allVisible.editContactsVisible" width="1000" :show-close="false" top="10vh">
+            <template #header="{ close, titleId, titleClass }">
+                <div class="flex justify-between items-center border-b pb-3 dialog-header">
+                    <h4 :id="titleId">{{ '新建联系人' }}</h4>
+                    <div>
+                        <el-button type="primary" :loading="allLoading.editContactsSaveLoading"
+                            @click="editContactsSave(false)">新建</el-button>
+                        <el-button @click="closeVisible('editContactsVisible')">取消</el-button>
+                    </div>
+                </div>
+            </template>
+            <div class="h-[60vh] overflow-y-auto scroll-bar pt-3">
+                <div class="ml-4 mr-4">
+                    <GenerateForm ref="contactsTemplateRef" :data="contactsTemplate" :value="contactsTemplateValue"
+                        :key="contactsTemplateRefKey" v-loading="allLoading.contactsTemplateRefLoading" />
+                </div>
+            </div>
+        </el-dialog>
     </div>
 </template>
 <script lang="ts" setup>
-import { ref, reactive, onMounted, onUnmounted, defineExpose, inject } from 'vue'
+import { GETGENERATEFOEM, URL_ADD } from '@/pages/contacts/api';
+import { get, post } from '@/utils/request';
+import { setTemplateDataDisable } from '@/utils/tools';
+import { GenerateForm } from '@zmjs/form-design';
+import { ref, reactive, onMounted, onUnmounted, defineExpose, inject, watchEffect } from 'vue'
+
+const emits = defineEmits(['refreshData']);
+const globalPopup = inject<GlobalPopup>('globalPopup')
+const props = defineProps<{
+    data: any
+}>()
+
+const information = ref({})
+const relatedCustomertable = ref([])
+const contactsTemplateValue = ref({})
+const contactsTemplateRefKey = ref(1)
+const contactsTemplateRef = ref<typeof GenerateForm>()
+const contactsTemplate = ref({
+    list: [],
+    config: {}
+})
+
+function editContactsSave(flag: boolean) {
+    contactsTemplateRef.value?.getData().then((res: any) => {
+        allLoading.editContactsSaveLoading = true
+        post(URL_ADD, { ...contactsTemplateValue.value, ...res }).then((_res) => {
+            allVisible.editContactsVisible = flag
+            globalPopup?.showSuccess('操作成功')
+            if (flag) {
+                contactsTemplateRef.value?.reset()
+            }
+            emits('refreshData')
+        }).finally(() => {
+            allLoading.editContactsSaveLoading = false
+        })
+    }).catch((_err: any) => {
+        console.log(_err)
+        globalPopup?.showError('请填写完整')
+    })
+}
+
+function editContacts(data: any) {
+    showVisible('editContactsVisible')
+    const { id, telPhone } = data
+    contactsTemplateValue.value = { customId: id, phone: telPhone }
+    allLoading.contactsTemplateRefLoading = true
+    setTimeout(() => {
+        contactsTemplateRefKey.value++
+        allLoading.contactsTemplateRefLoading = false
+    }, 1000);
+}
+
+const allLoading = reactive({
+    contactsTemplateRefLoading: false,
+    editContactsSaveLoading: false
+})
+
+const allVisible = reactive({
+    editContactsVisible: false,
+})
+
+watchEffect(() => {
+    const { data } = props
+    information.value = data
+    relatedCustomertable.value = []
+})
+
+async function getSystemField() {
+    const datas = await get(GETGENERATEFOEM)
+    let newConfig = JSON.parse(datas.data[0].config)
+    newConfig.list = setTemplateDataDisable(newConfig.list, ['customId'])
+    contactsTemplate.value = newConfig
+}
+
+function showVisible(type: keyof typeof allVisible) {
+    allVisible[type] = true
+}
+
+function closeVisible(type: keyof typeof allVisible) {
+    allVisible[type] = false
+}
 
-const relatedTaskstable = ref([{
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}])
 // 生命周期钩子
 onMounted(() => {
+    getSystemField()
 });
 </script>
 <style scoped lang="scss">

+ 152 - 46
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/relatedOrders.vue

@@ -3,11 +3,11 @@
         <div class="flex justify-between">
             <div class="title">相关销售订单</div>
             <div>
-                <el-button type="primary">新建销售订单</el-button>
+                <el-button type="primary" @click="editOrder()">新建销售订单</el-button>
             </div>
         </div>
         <div class="flex-1 overflow-auto pt-3">
-            <el-table :data="relatedTaskstable" border style="width: 100%;height: 300px;">
+            <el-table :data="relatedOrders" border style="width: 100%;height: 300px;">
                 <el-table-column prop="priority" label="订单编号" width="130" />
                 <el-table-column prop="taskName" label="订单名称">
                     <template #default="scope">
@@ -27,56 +27,162 @@
                 <el-table-column prop="endTime" label="创建时间" width="130" />
             </el-table>
         </div>
+
+        <!-- 弹窗 -->
+        <el-dialog v-model="allVisible.editOrderVisible" width="1000" :show-close="false" top="10vh">
+            <template #header="{ close, titleId, titleClass }">
+                <div class="flex justify-between items-center border-b pb-3 dialog-header">
+                    <h4 :id="titleId">{{ '新建销售订单' }}</h4>
+                    <div>
+                        <el-button type="primary" :loading="allLoading.editSaveLading"
+                            @click="saveOrder(false)">保存</el-button>
+                        <el-button @click="closeVisible('editOrderVisible')">取消</el-button>
+                    </div>
+                </div>
+            </template>
+            <div class="h-[60vh] overflow-y-auto scroll-bar pt-3" v-loading="allLoading.orderTemplateLoadinng">
+                <GenerateForm ref="orderTemplateRef" :data="orderTemplate" :key="orderTemplateKey"
+                    :value="orderTemplateValue" />
+                <div>相关产品</div>
+                <RelatedProducts ref="relatedProductsRef" :productTableList="productTableList"
+                    :productTableListValue="productTableListValue" />
+            </div>
+        </el-dialog>
     </div>
 </template>
 <script lang="ts" setup>
-import { ref, reactive, onMounted, onUnmounted, defineExpose, inject } from 'vue'
+import { ref, reactive, onMounted, onUnmounted, defineExpose, inject, watchEffect } from 'vue'
+import { setTemplateDataDisable } from '@/utils/tools';
+import { GenerateForm } from '@zmjs/form-design';
+import { get, post } from '@/utils/request';
+
+import RelatedProducts from '@/components/relatedProducts/relatedProducts.vue'
+import { GETGENERATEFOEM, GETTABLELIST, URL_OEDERUPDATE } from '@/pages/order/api';
+import { formatDate } from '@/utils/times';
+
+const emits = defineEmits(['refreshData']);
+const globalPopup = inject<GlobalPopup>('globalPopup')
+const props = defineProps<{
+    data: any
+}>()
+
+const information = ref<any>({})
+const relatedOrders = ref([])
+const productTableList = ref([])
+const productTableListValue = ref([])
+const orderTemplateValue = ref({})
+const orderTemplateKey = ref(1)
+const orderTemplateRef = ref<typeof GenerateForm>()
+const relatedProductsRef = ref<typeof RelatedProducts>()
+const orderTemplate = ref({
+    list: [],
+    config: {}
+})
+const allVisible = reactive({
+    editOrderVisible: false,
+})
+const allLoading = reactive({
+    editSaveLading: false,
+    orderTemplateLoadinng: false,
+})
+
+
+
+function saveOrder(flag: boolean) {
+    orderTemplateRef.value?.getData().then((res: any) => {
+        let productTableListData = relatedProductsRef?.value?.returnData()
+        for (var i in productTableListData) {
+            productTableListData[i].sealPrice = productTableListData[i].sellingPrice,
+                productTableListData[i].discount = productTableListData[i].discount,
+                productTableListData[i].num = productTableListData[i].quantity
+        }
+        const produt = productTableListData ? JSON.stringify(productTableListData) : []
+        allLoading.editSaveLading = true
+        post(URL_OEDERUPDATE, {
+            ...orderTemplateValue.value,
+            ...res,
+            orderEndDate: res.orderEndDate ? formatDate(res.orderEndDate) : '',
+            orderStartDate: res.orderStartDate ? formatDate(res.orderStartDate) : '',
+            orderProductDetailString: produt
+        }).then((_res) => {
+            allVisible.editOrderVisible = flag
+            globalPopup?.showSuccess('操作成功')
+            if (flag) {
+                orderTemplateRef.value?.reset()
+            }
+            emits('refreshData')
+        }).finally(() => {
+            allLoading.editSaveLading = false
+        })
+    }).catch((_err: any) => {
+        globalPopup?.showError('请填写完整')
+    })
+}
+
+function editOrder() {
+    showVisible('editOrderVisible')
+    allLoading.orderTemplateLoadinng = true
+    
+    orderTemplateValue.value = { customId: information.value.id }
+    productTableListValue.value = []
+    setTimeout(() => {
+        orderTemplateRef.value && orderTemplateRef.value.reset()
+        orderTemplateKey.value++
+        allLoading.orderTemplateLoadinng = false
+    }, 1000)
+}
+
+async function getSystemField() {
+    const datas = await get(GETGENERATEFOEM)
+    let newConfig = JSON.parse(datas.data[0].config)
+    newConfig.list = setTemplateDataDisable(newConfig.list, ['customId'])
+    orderTemplate.value = newConfig
+}
+
+function showVisible(type: keyof typeof allVisible) {
+    allVisible[type] = true
+}
+
+function closeVisible(type: keyof typeof allVisible) {
+    allVisible[type] = false
+}
+
+function getProductTableList() {
+    post(GETTABLELIST, { pageIndex: -1, pageSize: -1 }).then((res) => {
+        if (res.code == 'ok') {
+            const { record, total } = res.data
+            productTableList.value = record.map((item: any) => {
+                const { id, productName, productCode, unit, unitName, typeName, type, price, inventory } = item
+                return {
+                    id,
+                    productId: id,
+                    productName,
+                    productCode,
+                    unit,
+                    unitName,
+                    price,
+                    type,
+                    typeName,
+                    inventory,
+                    quantity: '',
+                    discount: '',
+                    totalPrice: ''
+                }
+            })
+        }
+    })
+}
+
+watchEffect(() => {
+    const { data } = props
+    information.value = data
+    relatedOrders.value = []
+})
 
-const relatedTaskstable = ref([{
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}, {
-    taskName: '任务名称20240316-tempalsbls',
-    priority: '中',
-    status: '进行中',
-    executor: '张三',
-    startTime: '2024-04-01',
-    endTime: '2024-04-01',
-}])
 // 生命周期钩子
 onMounted(() => {
+    getProductTableList()
+    getSystemField()
 });
 </script>
 <style scoped lang="scss">

+ 4 - 4
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/detail/index.vue

@@ -31,25 +31,25 @@
             @refreshData="getDetail" />
         </div>
         <div class="bg-white ml-2 shadow-md rounded-md flex-1">
-          <OperationRecord />
+          <OperationRecord :data="information" />
         </div>
       </div>
 
       <div class="w-full h-auto flex justify-between mt-2">
         <div class="bg-white shadow-md rounded-md w-full">
-          <RelatedContacts />
+          <RelatedContacts :data="information" @refreshData="getDetail" />
         </div>
       </div>
 
       <div class="w-full h-auto flex justify-between mt-2">
         <div class="bg-white shadow-md rounded-md w-full">
-          <RelatedBusiness />
+          <RelatedBusiness :data="information" @refreshData="getDetail" />
         </div>
       </div>
 
       <div class="w-full h-auto flex justify-between mt-2">
         <div class="bg-white shadow-md rounded-md w-full">
-          <RelatedOrders />
+          <RelatedOrders :data="information" @refreshData="getDetail" />
         </div>
       </div>
     </div>

+ 17 - 13
fhKeeper/formulahousekeeper/customerBuler-crm/src/utils/customInstructions.ts

@@ -3,22 +3,26 @@ import { Directive, ObjectDirective } from 'vue';
 // 权限控制
 const PermissionDirective: Directive = {
     mounted(el: HTMLElement, binding: { value: string[] }, vnode: any) {
-        const routePath = vnode.ctx.appContext.config.globalProperties.$route.path;
-        console.log(extractPath(routePath))
-        // const currentRoute = getCurrentInstance()?.appContext.config.globalProperties.$route;
-        // console.log('Current Route:', currentRoute);
-
-        // const permissions = binding.value;
-        // if (!Array.isArray(permissions)) {
-        //     console.error('Permissions must be provided as an array.');
-        //     return;
-        // }
-        // if (!permissions.some((permission: string) => permission === 'admin')) {
-        //     el.parentNode && el.parentNode.removeChild(el)
-        // }
+        const routePath: string = vnode.ctx.appContext.config.globalProperties.$route.path;
+        const userInfo: { userInfo: { functionList: { code: string }[] } } | null = JSON.parse(localStorage.getItem('storeInfo') || '');
+        const authorityCodes: string[] = (userInfo?.userInfo?.functionList || []).map(({ code }) => code);
+        const permissions: string[] = binding.value;
+
+        if (!Array.isArray(permissions)) {
+            console.error('权限必须以数组形式提供');
+            return;
+        }
+
+        if (!permissions.every(permission => authorityCodes.includes(permission))) {
+            el.parentNode && el.parentNode.removeChild(el);
+        }
+
+        console.log(extractPath(routePath), authorityCodes);
+        console.log(permissions, !permissions.every(permission => authorityCodes.includes(permission)))
     }
 };
 
+// input 字符串数字
 const PositiveIntegerDirective: ObjectDirective = {
     mounted(el: HTMLElement) {
         el.addEventListener('input', handleInput);

+ 26 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/utils/tools.ts

@@ -237,3 +237,29 @@ export function getTemplateKey(list: Array<any>) {
   });
   return models;
 }
+
+/**
+ * 设置模板数据禁用
+ * @param list 模板数据
+ * @param fieldList 需要禁用的字段
+ * @returns 
+ */
+export function setTemplateDataDisable(list: Array<any>, fieldList: Array<any>) {
+  let result = list;
+  result.forEach((item: any) => {
+    if (item.type === 'grid') {
+      item.columns.forEach((column: any) => {
+        column.list.forEach((subItem: any) => {
+          if (fieldList.includes(subItem.model)) {
+            subItem.options.disabled = true
+          }
+        });
+      });
+    } else {
+      if (fieldList.includes(item.model)) {
+        item.options.disabled = true;
+      }
+    }
+  })
+  return result;
+} 

+ 104 - 4
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/CustomController.java

@@ -1,15 +1,20 @@
 package com.management.platform.controller;
 
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.management.platform.entity.Clue;
-import com.management.platform.entity.Custom;
-import com.management.platform.entity.UploadFile;
-import com.management.platform.entity.User;
+import com.management.platform.entity.*;
 import com.management.platform.mapper.ClueMapper;
 import com.management.platform.mapper.CustomMapper;
+import com.management.platform.mapper.SysFormMapper;
 import com.management.platform.mapper.UserMapper;
+import com.management.platform.service.ContactsService;
 import com.management.platform.service.CustomService;
+import com.management.platform.service.WxCorpInfoService;
+import com.management.platform.service.impl.ExcelExportServiceImpl;
 import com.management.platform.util.HttpRespMsg;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -18,10 +23,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -45,16 +52,32 @@ public class CustomController {
     @Autowired
     private UserMapper userMapper;
 
+    @Resource
+    private ExcelExportServiceImpl excelExportService;
+    @Resource
+    private SysFormMapper sysFormMapper;
+    @Autowired
+    private WxCorpInfoService wxCorpInfoService;
+    @Autowired
+    private ContactsService contactsService;
+
+
     @RequestMapping("list")
     public HttpRespMsg list(Custom custom, HttpServletRequest request) {
         return customService.getList(custom, request);
     }
 
+
     @RequestMapping("getAllCustom")
     public HttpRespMsg getAllCustom(HttpServletRequest request) {
         return customService.getAllCustom(request);
     }
 
+    @RequestMapping("getAllContacts")
+    public HttpRespMsg getAllContacts(HttpServletRequest request) {
+        return contactsService.getAll(request);
+    }
+
     @RequestMapping("deleteList")
     public HttpRespMsg deleteList(Custom custom, HttpServletRequest request) {
         return customService.getDeleteList(custom, request);
@@ -76,6 +99,83 @@ public class CustomController {
         return customService.getInfo(custom, request);
     }
 
+    @RequestMapping("/importData")
+    public HttpRespMsg importData(MultipartFile multipartFile){
+        return customService.importData(multipartFile);
+    }
+
+    @Value(value = "${upload.path}")
+    private String path;
+    @RequestMapping("/exportData")
+    public HttpRespMsg exportData(Custom custom , HttpServletRequest request) throws Exception {
+        User user = userMapper.selectById(request.getHeader("token"));
+        SysForm sysForm = sysFormMapper.selectOne(new LambdaQueryWrapper<SysForm>().eq(SysForm::getCompanyId, user.getCompanyId()).eq(SysForm::getCode, "Thread").eq(SysForm::getIsCurrent, 1));
+        WxCorpInfo wxCorpInfo = wxCorpInfoService.getOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, user.getCompanyId()));
+        String config = sysForm.getConfig();
+        JSONObject configOb = JSON.parseObject(config);
+        JSONArray configObJSONArray = configOb.getJSONArray("list");
+        List<List<String>> dataList=new ArrayList<>();
+        List<String> titleList=new ArrayList<>();
+        for (int i = 0; i < configObJSONArray.size(); i++) {
+            JSONObject item = configObJSONArray.getJSONObject(i);
+            titleList.add(item.getString("label"));
+        }
+        dataList.add(titleList);
+        HttpRespMsg msg = list(custom, request);
+        Map<String, Object> msgData = (Map<String, Object>) msg.getData();
+        List<BusinessOpportunity> bos = (List<BusinessOpportunity>) msgData.get("record");
+        for (BusinessOpportunity bo1 : bos) {
+            List<String> item=new ArrayList<>();
+            for (int i = 0; i < configObJSONArray.size(); i++) {
+                JSONObject target = configObJSONArray.getJSONObject(i);
+                if(target.getString("type").equals("grid")){
+                    JSONArray columns = target.getJSONArray("columns");
+                    for (int i1 = 0; i1 < columns.size(); i1++) {
+                        JSONObject columnsJSONObject = columns.getJSONObject(i1);
+                        JSONArray list = columnsJSONObject.getJSONArray("list");
+                        for (int i2 = 0; i2 < list.size(); i2++) {
+                            JSONObject object = list.getJSONObject(i2);
+                            String model = object.getString("model");
+                            String targetName = model.substring(0, 1).toUpperCase() + model.substring(1);
+                            Class<? extends BusinessOpportunity> aClass = bo1.getClass();
+                            String value = String.valueOf(aClass.getMethod("get" + targetName).invoke(bo1)==null?"":aClass.getMethod("get" + targetName).invoke(bo1));
+                            if(model.equals("inchargerId")){
+                                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                                    value = "$userName"+String.valueOf(aClass.getMethod("getInchargerName").invoke(bo1))+"$";
+                                }else {
+                                    value = String.valueOf(aClass.getMethod("getInchargerName").invoke(bo1));
+                                }
+                            }
+                            item.add(value);
+                        }
+                    }
+                }else {
+                    String model = target.getString("model");
+                    String targetName = model.substring(0, 1).toUpperCase() + model.substring(1);
+                    Class<? extends BusinessOpportunity> aClass = bo1.getClass();
+                    String value = String.valueOf(aClass.getMethod("get" + targetName).invoke(bo1)==null?"":aClass.getMethod("get" + targetName).invoke(bo1));
+                    if(model.equals("inchargerId")){
+                        if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                            value = "$userName"+String.valueOf(aClass.getMethod("getInchargerName").invoke(bo1))+"$";
+                        }else {
+                            value = String.valueOf(aClass.getMethod("getInchargerName").invoke(bo1));
+                        }
+                    }
+                    if(model.equals("contactsId")){
+                        if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                            value = "$userName"+String.valueOf(aClass.getMethod("getContactsName").invoke(bo1))+"$";
+                        }else {
+                            value = String.valueOf(aClass.getMethod("getContactsName").invoke(bo1));
+                        }
+                    }
+                    item.add(value);
+                }
+            }
+            dataList.add(item);
+        }
+        String fileName="商机表导出_"+ System.currentTimeMillis();
+        return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName,dataList,path);
+    }
 
     // 批量放入回收站
     @RequestMapping("deleter")

+ 6 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Custom.java

@@ -110,6 +110,8 @@ public class Custom extends Model<Custom> {
      */
     @TableField("tel_phone")
     private String telPhone;
+    @TableField("contacts_name")
+    private String contactsName;
 
     /**
      * 传真
@@ -124,6 +126,10 @@ public class Custom extends Model<Custom> {
     private String countryBilling;
     @TableField(exist = false)
     private String userId;
+    @TableField(exist = false)
+    private List<Contacts> contacts;
+    @TableField(exist = false)
+    private List<SalesOrder> salesOrders;
 
     /**
      * 开单地址-省/市

+ 2 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/ContactsService.java

@@ -47,4 +47,6 @@ public interface ContactsService extends IService<Contacts> {
     int transferContacts(Contacts contactsGet, User user);
 
     int claimContacts(Contacts contactsGet, User user);
+
+    HttpRespMsg getAll(HttpServletRequest request);
 }

+ 3 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/CustomService.java

@@ -58,4 +58,7 @@ public interface CustomService extends IService<Custom> {
     HttpRespMsg getCustomerTotalCount(String startDate, String endDate, String userId, Integer departmentId, Integer exportType, HttpServletRequest request);
 
     HttpRespMsg getCustomerTransferRate(String startDate, String endDate, String userId, Integer departmentId, Integer exportType, HttpServletRequest request);
+
+    HttpRespMsg importData(MultipartFile multipartFile);
+
 }

+ 3 - 2
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/BusinessOpportunityServiceImpl.java

@@ -66,12 +66,13 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
     private BusinessItemProductMapper bipMapper;
     @Resource
     private UserMapper userMapper;
+    @Autowired
+    private UploadFileMapper uploadFileMapper;
     @Resource
     private BusinessItemProductMapper biMapper;
     @Autowired
     private SysFormMapper sysFormMapper;
-    @Autowired
-    private UploadFileMapper uploadFileMapper;
+
     @Resource
     private HttpServletRequest request;
 

+ 8 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ContactsServiceImpl.java

@@ -739,5 +739,13 @@ public class ContactsServiceImpl extends ServiceImpl<ContactsMapper, Contacts> i
         }
     }
 
+    @Override
+    public HttpRespMsg getAll(HttpServletRequest request) {
+        User user = userMapper.selectById(request.getHeader("Token"));
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        httpRespMsg.setData(contactsMapper.selectList(new QueryWrapper<Contacts>().eq("company_id",user.getCompanyId())));
+        return httpRespMsg;
+    }
+
 
 }

+ 220 - 11
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/CustomServiceImpl.java

@@ -1,5 +1,9 @@
 package com.management.platform.service.impl;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.management.platform.entity.*;
@@ -8,20 +12,30 @@ import com.management.platform.mapper.*;
 import com.management.platform.service.CustomService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.service.SysFunctionService;
+import com.management.platform.service.WxCorpInfoService;
+import com.management.platform.util.ExcelUtil;
 import com.management.platform.util.FileUtil;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.MessageUtils;
+import org.apache.poi.ss.usermodel.CellType;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+import org.apache.poi.xssf.usermodel.XSSFRow;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.annotation.Resource;
 import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.io.File;
-import java.io.IOException;
+import java.io.*;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.net.URLEncoder;
 import java.util.*;
 
@@ -43,12 +57,25 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
     private BusinessItemCustomMapper businessItemCustomMapper;
     @Autowired
     private CustomItemContactsMapper customItemContactsMapper;
+    @Resource
+    private ExcelExportServiceImpl excelExportService;
+    @Resource
+    private SysFormMapper sysFormMapper;
+    @Autowired
+    private WxCorpInfoService wxCorpInfoService;
     @Autowired
     private ActionLogMapper actionLogMapper;
 
     @Autowired
     private UploadFileMapper uploadFileMapper;
 
+
+    @Resource
+    private HttpServletRequest request;
+
+    @Resource
+    private SysDictMapper sysDictMapper;
+
     @Autowired
     private BusinessOpportunityMapper businessOpportunityMapper;
     @Autowired
@@ -99,6 +126,13 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
 //                msg.setError("电话号码重复了");
                 return msg;
             }
+
+            if (custom.getCustomName() != null && contactsMapper.selectCount(new QueryWrapper<Contacts>()
+                    .eq("name", custom.getContactsName())
+            ) == 0) {
+                msg.setError("此联系人不存在");
+                return msg;
+            }
             custom.setCreateTime(new Date());
             custom.setCreatorId(user.getId());
             custom.setIsDelete(0);
@@ -110,6 +144,13 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
             actionLog.setItemId(custom.getId());
             actionLogMapper.insert(actionLog);
             customMapper.insert(custom);
+            if (custom.getCustomName() != null && custom.getCustomName()!="" &&custom.getTelPhone() !="" &&custom.getTelPhone()!=null){
+                Contacts contacts = contactsMapper.selectOne(new QueryWrapper<Contacts>().eq("name", custom.getCustomName()).eq("phone", custom.getTelPhone()));
+                if (contacts != null){
+                    contacts.setCustomId(custom.getId());
+                    contactsMapper.update(contacts,new UpdateWrapper<Contacts>().eq("id",contacts.getId()));
+                }
+            }
         }
         msg.setMsg("操作成功");
         return msg;
@@ -170,6 +211,8 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
         customMapper.update(custom, updateWrapper);
     }
 
+    @Autowired
+    private SalesOrderMapper salesOrderMapper;
     @Override
     public HttpRespMsg getInfo(Custom custom, HttpServletRequest request) {
         Custom custom1 = customMapper.getInfo(custom.getId());
@@ -180,15 +223,19 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
         custom1.setBusinessOpportunitys(businessOpportunityMapper.selectList(new QueryWrapper<BusinessOpportunity>().eq("customer_id",custom1.getId())));
         //操作记录
         custom1.setActionLogs(actionLogMapper.selectList(new QueryWrapper<ActionLog>().eq("code","custom").eq("item_id",custom1.getId())));
-        List<CustomItemContacts> contacts = customItemContactsMapper.selectList(new QueryWrapper<CustomItemContacts>().eq("contacts_id", custom1.getId()));
-        List<Integer> ids = new ArrayList<>();
-        for (CustomItemContacts contact : contacts) {
-            ids.add(contact.getCustomId());
-        }
-        if (ids.size() > 0){
-            List<Contacts> cs = contactsMapper.selectListByIds(ids);
-            custom1.setContactsList(cs);
-        }
+//        List<CustomItemContacts> contacts = customItemContactsMapper.selectList(new QueryWrapper<CustomItemContacts>().eq("contacts_id", custom1.getId()));
+//        List<Integer> ids = new ArrayList<>();
+//        for (CustomItemContacts contact : contacts) {
+//            ids.add(contact.getCustomId());
+//        }
+//        if (ids.size() > 0){
+//            List<Contacts> cs = contactsMapper.selectListByIds(ids);
+//            custom1.setContactsList(cs);
+//        }
+        //联系人
+        custom1.setContacts(contactsMapper.selectList((new QueryWrapper<Contacts>().eq("custom_id",custom1.getId()))));
+        //订单
+        custom1.setSalesOrders(salesOrderMapper.selectList((new QueryWrapper<SalesOrder>().eq("custom_id",custom1.getId()))));
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         httpRespMsg.setData(custom1);
         return httpRespMsg;
@@ -432,6 +479,168 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
 
     }
 
+    @Override
+    public HttpRespMsg importData(MultipartFile multipartFile) {
+        HttpRespMsg msg=new HttpRespMsg();
+        String fileName = multipartFile.getOriginalFilename();
+        File file = new File(fileName == null ? "file" : fileName);
+        User user = userMapper.selectById(request.getHeader("token"));
+        Integer companyId = user.getCompanyId();
+        WxCorpInfo wxCorpInfo = wxCorpInfoService.getOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
+        List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getCompanyId, companyId));
+        List<SysDict> sysDictOfClueSources = sysDictMapper.selectList(new LambdaQueryWrapper<SysDict>().eq(SysDict::getCompanyId, companyId).eq(SysDict::getCode, "ClueSources"));
+        InputStream inputStream = null;
+        OutputStream outputStream = null;
+        try {
+            inputStream = multipartFile.getInputStream();
+            outputStream = new FileOutputStream(file);
+            byte[] buffer = new byte[4096];
+            int temp = 0;
+            while ((temp = inputStream.read(buffer, 0, 4096)) != -1) {
+                outputStream.write(buffer, 0, temp);
+            }
+            inputStream.close();
+            outputStream.close();
+            //解析表格
+            XSSFWorkbook workbook = new XSSFWorkbook(file);
+            //我们只需要第一个sheet
+            XSSFSheet sheet = workbook.getSheetAt(0);
+            //由于第一行需要指明列对应的标题
+            int rowNum = sheet.getLastRowNum();
+            //获取当前表单模板 校验规则
+            SysForm sysForm = sysFormMapper.selectOne(new LambdaQueryWrapper<SysForm>().eq(SysForm::getCode, "Customer").eq(SysForm::getCompanyId, companyId).eq(SysForm::getIsCurrent, 1));
+            if(sysForm==null){
+                msg.setError("当前模块未配置自定义模板,需先完成配置");
+                return msg;
+            }
+            String config = sysForm.getConfig();
+            JSONObject configOb = JSON.parseObject(config);
+            JSONArray configObJSONArray = configOb.getJSONArray("list");
+            List<String> userNameList=new ArrayList<>();
+            HttpRespMsg respMsg=new HttpRespMsg();
+            for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
+                XSSFRow row = sheet.getRow(rowIndex);
+                if (row == null) {
+                    continue;
+                }
+                //跳过空行
+                if (ExcelUtil.isRowEmpty(row)) {
+                    continue;
+                }
+                //获取到当前行的列数据
+                int cellNum = row.getLastCellNum();
+                for (int i = 0; i < cellNum; i++) {
+                    JSONObject item = configObJSONArray.getJSONObject(i);
+                    String modelName = item.getString("model");
+                    XSSFCell cell = row.getCell(i);
+                    if(cell!=null){
+                        switch (item.getString("type")){
+//                            case "time":cell.setCellType(CellType.NUMERIC);
+//                                break;
+                            default:cell.setCellType(CellType.STRING);
+                        }
+                    }
+                    if(modelName.equals("inchargerId")){
+                        System.out.println("=====");
+                        System.out.println(modelName);
+                        System.out.println(cell.toString());
+                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                            userNameList.add(cell.getStringCellValue());
+                        }
+                    }
+
+                }
+            }
+            System.out.println("参与搜索的人员列表"+userNameList + userNameList.size());
+            if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1&&userNameList.size()>0){
+                respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
+                if(respMsg.code.equals("0")){
+                    msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
+                    return msg;
+                }
+            }
+            List<User> targetUserList= (List<User>) respMsg.data;
+            //直接忽略空行 从row1开始
+            for (int rowIndex = 1; rowIndex <= rowNum; rowIndex++) {
+                XSSFRow row = sheet.getRow(rowIndex);
+                if (row == null) {
+                    continue;
+                }
+                //跳过空行
+                if (ExcelUtil.isRowEmpty(row)) {
+                    continue;
+                }
+                //获取到当前行的列数据
+                int cellNum = row.getLastCellNum();
+                Custom custom =new Custom();
+                custom.setCompanyId(companyId);
+                custom.setCreateTime(new Date());
+                custom.setCreatorId(user.getId());
+                for (int i = 0; i < cellNum; i++) {
+                    JSONObject item = configObJSONArray.getJSONObject(i);
+                    String modelName = item.getString("model");
+                    String className = modelName.substring(0, 1).toUpperCase() + modelName.substring(1);
+                    String getter="get"+className;
+                    String setter="set"+className;
+                    XSSFCell cell = row.getCell(i);
+                    if(cell!=null){
+                        switch (item.getString("type")){
+
+                            default:cell.setCellType(CellType.STRING);
+                        }
+                    }
+                    //校验当前列是否为必填
+                    JSONObject options = item.getJSONObject("options");
+                    JSONObject rules = options.getJSONObject("rules");
+                    Boolean required = rules.getBoolean("required");
+                    if(required){
+                        if(StringUtils.isEmpty(cell.getStringCellValue())){
+                            msg.setError(item.getString("label")+"值不能为空值");
+                            return msg;
+                        }
+                    }
+                    if(modelName.equals("inchargerId")){
+                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                            String userName = cell.getStringCellValue();
+                            Optional<User> first;
+                            if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                                Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(userName)).findFirst();
+                                first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(userName))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
+                            }else {
+                                first= userList.stream().filter(u -> u.getName().equals(userName)||(u.getJobNumber()!=null&&u.getJobNumber().equals(userName))).findFirst();
+                            }
+                            if (first.isPresent()) {
+                                custom.setInchargerId(first.get().getId());
+                            } else {
+                                msg.setError("负责人["+userName+"]在系统中不存在");
+                                return msg;
+                            }
+                        }
+                    }else {
+                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                            Class<Clue> clueClass = Clue.class;
+                            Method method = clueClass.getMethod(setter,String.class);
+                            method.invoke(custom,cell.getStringCellValue());
+                        }
+                    }
+
+                }
+                customMapper.insert(custom);
+            }
+        } catch (IOException | NoSuchMethodException e) {
+            e.printStackTrace();
+        } catch (IllegalAccessException e) {
+            e.printStackTrace();
+        } catch (InvocationTargetException e) {
+            e.printStackTrace();
+        } catch (Exception e) {
+            e.printStackTrace();
+            msg.setError("验证失败");
+            return msg;
+        }
+        return msg;
+    }
+
 
     private Custom setNull(Custom clue) {
         if (clue.getPlate1() == "") {

+ 15 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ProductController.java

@@ -6,6 +6,7 @@ import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.PlanService;
 import com.management.platform.service.ProductService;
 import com.management.platform.util.HttpRespMsg;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
@@ -37,8 +38,8 @@ public class ProductController {
     PlanService planService;
 
     @RequestMapping("/getProductPage")
-    public HttpRespMsg getProductPage(Integer cateId, @RequestParam Integer pageIndex, @RequestParam Integer pageSize, String name, String code) {
-        return productService.getProductPage(cateId, pageIndex, pageSize, name, code, request);
+    public HttpRespMsg getProductPage(Integer cateId, @RequestParam Integer pageIndex, @RequestParam Integer pageSize, String name, String code,@RequestParam(defaultValue = "0")Integer status) {
+        return productService.getProductPage(cateId, pageIndex, pageSize, name, code,status, request);
     }
 
     @RequestMapping("/saveProductInfo")
@@ -76,6 +77,7 @@ public class ProductController {
      * @return
      */
     @RequestMapping(value = "/importData",method = RequestMethod.POST)
+    @Transactional(rollbackFor = Exception.class)
     public HttpRespMsg importData(@RequestParam("file") MultipartFile file,@RequestParam Integer categoryId){
         return productService.importData(file,categoryId,request);
     }
@@ -96,5 +98,16 @@ public class ProductController {
 
         return productService.insertProductInfo(name,id,request);
     }
+
+    @RequestMapping("/deactivate")
+    public HttpRespMsg deactivate(Integer id,Integer value){
+        HttpRespMsg msg=new HttpRespMsg();
+        Product product = productService.getById(id);
+        product.setStatus(value);
+        if(!productService.updateById(product)){
+            msg.setError("验证失败");
+        }
+        return msg;
+    }
 }
 

+ 7 - 7
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/Product.java

@@ -8,12 +8,6 @@ import java.io.Serializable;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
-import org.springframework.validation.annotation.Validated;
-
-import javax.validation.Valid;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-import javax.validation.constraints.NotNull;
 
 /**
  * <p>
@@ -21,7 +15,7 @@ import javax.validation.constraints.NotNull;
  * </p>
  *
  * @author Seyason
- * @since 2023-07-21
+ * @since 2024-06-03
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -99,6 +93,12 @@ public class Product extends Model<Product> {
     @TableField("description")
     private String description;
 
+    /**
+     * 0-启用 1-停用
+     */
+    @TableField("status")
+    private Integer status;
+
 
     @Override
     protected Serializable pkVal() {

+ 1 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/ProductService.java

@@ -17,7 +17,7 @@ import javax.servlet.http.HttpServletRequest;
  */
 public interface ProductService extends IService<Product> {
 
-    HttpRespMsg getProductPage(Integer cateId, Integer pageIndex, Integer pageSize, String name, String code, HttpServletRequest request);
+    HttpRespMsg getProductPage(Integer cateId, Integer pageIndex, Integer pageSize, String name, String code,Integer status, HttpServletRequest request);
 
     HttpRespMsg saveProductInfo(Product product, HttpServletRequest request);
 

+ 8 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/PlanServiceImpl.java

@@ -613,6 +613,10 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
                         if(first.isPresent()){
                             throw new Exception("重复的排产工单号"+productSchedulingNumCell.getStringCellValue());
                         }
+                        Integer count = planMapper.selectCount(new LambdaQueryWrapper<Plan>().eq(Plan::getProductSchedulingNum, productSchedulingNumCell.getStringCellValue()));
+                        if(count>0){
+                            throw new Exception("已存在的排产工单号"+productSchedulingNumCell.getStringCellValue());
+                        }
                         plan.setProductSchedulingNum(productSchedulingNumCell.getStringCellValue());
                     }
                     if(steelStampNumberCell!=null&&!StringUtils.isEmpty(steelStampNumberCell.getStringCellValue())){
@@ -740,6 +744,10 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
                         if(first.isPresent()){
                             throw new Exception("重复的任务变更通知号"+taskChangeNoticeNumCell.getStringCellValue());
                         }
+                        Integer count = planMapper.selectCount(new LambdaQueryWrapper<Plan>().eq(Plan::getTaskChangeNoticeNum, taskChangeNoticeNumCell.getStringCellValue()));
+                        if(count>0){
+                            throw new Exception("已存在的排产工单号"+taskChangeNoticeNumCell.getStringCellValue());
+                        }
                         plan.setTaskChangeNoticeNum(taskChangeNoticeNumCell.getStringCellValue());
                     }
                     if(taskNameCell!=null){

+ 27 - 17
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ProductServiceImpl.java

@@ -22,6 +22,7 @@ import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
@@ -32,6 +33,7 @@ import javax.servlet.http.HttpServletRequest;
 import java.io.*;
 import java.math.BigDecimal;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -71,7 +73,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
     private ExcelExportService excelExportService;
 
     @Override
-    public HttpRespMsg getProductPage(Integer cateId, Integer pageIndex, Integer pageSize, String name, String code, HttpServletRequest request) {
+    public HttpRespMsg getProductPage(Integer cateId, Integer pageIndex, Integer pageSize, String name, String code,Integer status, HttpServletRequest request) {
         QueryWrapper<Product> queryWrapper = new QueryWrapper<>();
         if (cateId != null) {
             queryWrapper.eq("category_id",cateId);
@@ -82,6 +84,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
         if (!StringUtils.isEmpty(code)) {
             queryWrapper.like("code",code);
         }
+        queryWrapper.eq("status",status);
         User user = userMapper.selectById(request.getHeader("Token"));
         queryWrapper.eq("company_id",user.getCompanyId()).orderByDesc("id");
 
@@ -310,17 +313,18 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
                     if(StringUtils.isEmpty(nameCell.getStringCellValue())){
                         continue;
                     }
-                    Integer count = productMapper.selectCount(new LambdaQueryWrapper<Product>()
+                    Product selectOne = productMapper.selectOne(new LambdaQueryWrapper<Product>()
                             .eq(companyId != null, Product::getCompanyId, companyId)
-                            .eq(!StringUtils.isEmpty( nameCell.getStringCellValue()), Product::getName,  nameCell.getStringCellValue())
+                            .eq(!StringUtils.isEmpty(nameCell.getStringCellValue()), Product::getName, nameCell.getStringCellValue())
                     );
-                    if(count==0){
+                    if(selectOne!=null){
                         product.setName(nameCell.getStringCellValue());
-
-                    }else{
-                        msg.setError("产品名和已存在的产品重复");
-                        return msg;
+                        product.setId(selectOne.getId());
                     }
+//                    else{
+//                        msg.setError("产品名和已存在的产品重复");
+//                        return msg;
+//                    }
 
                 }else{
                     msg.setError("产品名称不能为空");
@@ -472,16 +476,22 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
             }
 
             //插入数据
-            if(saveBatch(productList)) {
-
+            if(saveOrUpdateBatch(productList)) {
+                List<Integer> productIds = productList.stream().map(Product::getId).distinct().collect(Collectors.toList());
+                List<ProdProcedure> prodProcedures = prodProcedureMapper.selectList(new LambdaQueryWrapper<ProdProcedure>().in(ProdProcedure::getProductId, productIds));
                 for (Product product : productList) {
-                    prodProcedureList.stream()
-                            .filter(prodProcedure -> prodProcedure.getProductName().equals(product.getName()))
-                            .forEach(prodProcedure ->{
-                                prodProcedure.setProductId(product.getId());
-                                prodProcedure.setCompanyId(companyId);
-
-                            } );
+                    List<ProdProcedure> procedureList = prodProcedures.stream().filter(p -> p.getProductId().equals(product.getId())).collect(Collectors.toList());
+                    //找到当前产品下的工序版本号集合
+                    List<String> versionNumberList = procedureList.stream().map(ProdProcedure::getVersionNumber).distinct().collect(Collectors.toList());
+                    List<ProdProcedure> procedures = prodProcedureList.stream()
+                            .filter(prodProcedure -> prodProcedure.getProductName().equals(product.getName())).collect(Collectors.toList());
+                    for (ProdProcedure prodProcedure : procedures) {
+                        if(versionNumberList.contains(prodProcedure.getVersionNumber())){
+                            throw new Exception("产品["+product.getName()+"]下工序["+prodProcedure.getName()+"]版本号["+prodProcedure.getVersionNumber()+"]已存在");
+                        }
+                        prodProcedure.setProductId(product.getId());
+                        prodProcedure.setCompanyId(companyId);
+                    }
                 }
             }
             prodProcedureService.saveBatch(prodProcedureList);

+ 2 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/ProductMapper.xml

@@ -16,11 +16,12 @@
         <result column="column_number" property="columnNumber" />
         <result column="vehicle_number" property="vehicleNumber" />
         <result column="description" property="description" />
+        <result column="status" property="status" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, name, category_id, company_id, category_name, code, group_number, order_number, unit, column_number, vehicle_number, description
+        id, name, category_id, company_id, category_name, code, group_number, order_number, unit, column_number, vehicle_number, description, status
     </sql>
 
 </mapper>

+ 7 - 7
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/plan/planComponent.vue

@@ -427,13 +427,13 @@ export default {
     addInput() {
       console.log('===========', this.todayPlanForm.steelStampNumberList)
       console.log('===========', this.todayPlanForm)
-      if (this.todayPlanForm.steelStampNumberList.length >= 9) {
-        this.$message({
-          message: '超过最大条数(9)',
-          type: "error",
-        });
-        return
-      }
+      // if (this.todayPlanForm.steelStampNumberList.length >= 9) {
+      //   this.$message({
+      //     message: '超过最大条数(9)',
+      //     type: "error",
+      //   });
+      //   return
+      // }
       this.todayPlanForm.steelStampNumberList.push({
         id: null,
         steelStampNumberStart: '',

+ 56 - 3
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/product/list.vue

@@ -14,6 +14,16 @@
                     <el-input v-model="code" placeholder="请输入" clearable="true" size="small">
                     </el-input>
                 </el-form-item>
+                <el-form-item label="产品状态">
+                    <el-select v-model="status" placeholder="请选择">
+                        <el-option
+                        v-for="item in productStatus"
+                        :key="item.value"
+                        :label="item.label"
+                        :value="item.value">
+                        </el-option>
+                    </el-select>
+                </el-form-item>
                 <el-form-item>
                     <el-button @click="getList" size="small">查询</el-button>
                 </el-form-item>
@@ -60,6 +70,10 @@
                             </el-form-item>
                             <el-form-item>
                                 <el-table :data="props.row.tableProdProcedure.procedureList" border style="width: 100%">
+                                    <el-table-column
+                                        type="index"
+                                        width="50">
+                                    </el-table-column>
                                     <el-table-column prop="name" label="工序名称" width="180">
                                     </el-table-column>
                                     <el-table-column prop="workingTime" label="单件工时" width="180">
@@ -120,10 +134,11 @@
             <el-table-column prop="groupNumber" label="编组"></el-table-column>
             <el-table-column prop="columnNumber" label="每列数量"></el-table-column>
             <el-table-column prop="vehicleNumber" label="每辆数量"></el-table-column>
-            <el-table-column label="操作" width="200" fixed="right">
+            <el-table-column label="操作" width="250" fixed="right">
                 <template slot-scope="scope">
                     <el-button size="mini" @click="handleAdd(scope.$index, scope.row)">编辑</el-button>
                     <el-button size="mini" @click="copyProduct(scope.row)">复制</el-button>
+                    <el-button size="mini" @click="deactivate(scope.row)">{{scope.row.status==0?'停用':'启用'}}</el-button>
                 </template>
             </el-table-column>
         </el-table>
@@ -885,7 +900,17 @@ export default {
             dataListBf: [],
             imgUrlLists: '',
             imgUrlListFlg: false,
-            estimatedWorkTime: ''
+            estimatedWorkTime: '',
+            productStatus:[
+                {
+                value: '0',
+                label: '启用'
+                }, {
+                value: '1',
+                label: '停用'
+                }
+            ],
+            status:'0'
         };
     },
     // 过滤器
@@ -1586,6 +1611,33 @@ export default {
                     });
                 });
         },
+        deactivate(item){
+            var value
+            item.status==0?value=1:value=0
+            this.http.post('/product/deactivate', {
+                id:item.id,value:value
+            },
+            res => {
+                if (res.code == "ok") {
+                    this.$message({
+                        message: item.status==0?'停用成功':'启用成功',
+                        type: "success"
+                    });
+                } else {
+                    this.$message({
+                        message: res.msg,
+                        type: "error"
+                    });
+                }
+                this.getList()
+            },
+            error => {
+                this.$message({
+                    message: error,
+                    type: "error"
+                });
+            });
+        },
         addProjectLevel(row) {
             this.addProjectLevelDialog = true
             if (!row) {
@@ -3007,7 +3059,8 @@ export default {
                 pageSize: this.size,
                 name: this.name,
                 code: this.code,
-                cateId: this.cateId
+                cateId: this.cateId,
+                status:this.status
             }
 
             this.http.post('/product/getProductPage', parameter,

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/workReport/daily.vue

@@ -4127,7 +4127,7 @@
                 let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
                 sessionStorage.msg = this.date + day,
                 this.getReportList();
-                this.getDepartment();
+                // this.getDepartment();
                 this.curDate = item.date;
             },
             canClick(i, item){