songxy 1 vuosi sitten
vanhempi
commit
dca71991e4

+ 1 - 1
client/src/api/oa/kpgl/index.ts

@@ -15,6 +15,6 @@ export const processContractInvoice = (params) => {
 }
 
 // 开票查询多选导出
-export const exportContractInvoiceListExcel = (data: { idList?: string[] }) => {
+export const exportContractInvoiceListExcel = (data: any) => {
   return request.downloadPost({ url: '/contract-invoice/list/excel', data }, '/business')
 }

+ 41 - 9
client/src/components/TreeSelectV2/index.vue

@@ -58,6 +58,7 @@ const $props = withDefaults(
       expend: boolean
       filterMethod: any
       placeholder: string
+      labelAll: boolean
     }>
   >(),
   {
@@ -67,6 +68,7 @@ const $props = withDefaults(
       children: 'children'
     },
     expend: true,
+    labelAll: false,
     placeholder: '请选择'
   }
 )
@@ -97,11 +99,6 @@ const treeRef = ref<InstanceType<typeof ElTreeV2>>()
 const onQueryFilter = (query: string) => {
   treeRef.value!.filter(query)
 }
-const nodeClickHandle = (data) => {
-  visiable.value = false
-  labelName.value = data[$props.props['label'] ?? 'label']
-  $emit('update:modelValue', data[$props.props['value'] ?? 'value'])
-}
 const getExpandedIds = (nodes?: any[]) => {
   if (nodes && nodes.length === 0) return []
   const ids: any[] = []
@@ -130,17 +127,49 @@ const setExpandedKeys = async () => {
   const allChooseIds = getExpandedIds($props.data)
   treeRef.value?.setExpandedKeys(allChooseIds)
 }
-watchEffect(() => {
-  if ($props.data && $props.expend) {
-    setExpandedKeys()
+const nodeClickHandle = (data) => {
+  visiable.value = false
+  $emit('update:modelValue', data[$props.props['value'] ?? 'value'])
+  //@ts-ignore
+  const item = treeRef.value?.getNode($props.modelValue)
+  if (item && $props.labelAll) {
+    const arrs = initLabelNameAll(item)
+    labelName.value = arrs.join('-')
+    return
   }
-})
+  labelName.value = data[$props.props['label'] ?? 'label']
+}
+
 watchEffect(() => {
+  //@ts-ignore
   const item = treeRef.value?.getNode($props.modelValue)
   if (item) {
+    if ($props.labelAll) {
+      const arrs = initLabelNameAll(item)
+      labelName.value = arrs.join('-')
+      return
+    }
     labelName.value = item['label'] as string
   }
+  //默认全部展开
+  if ($props.data && $props.expend) {
+    setExpandedKeys()
+  }
 })
+const initLabelNameAll = (item): string[] => {
+  const arrs: string[] = []
+  const recursion = (item) => {
+    if (item) {
+      arrs.push(item.label)
+      if (item.parent) {
+        recursion(item.parent)
+      }
+    }
+  }
+  recursion(item)
+  arrs.reverse()
+  return arrs
+}
 </script>
 
 <style lang="scss" scoped>
@@ -174,5 +203,8 @@ watchEffect(() => {
       flex-shrink: 0;
     }
   }
+  // :deep(.el-input__wrapper) {
+  //   padding: 0px;
+  // }
 }
 </style>

+ 31 - 0
client/src/views/OaSystem/components/ProjectTypeTree/index copy.vue

@@ -0,0 +1,31 @@
+<template>
+  <el-tree-select
+    v-model="projectType"
+    style="width: 100%"
+    node-key="id"
+    filterable
+    check-strictly
+    :filter-node-method="filterNodeMethod"
+    :props="{ label: 'name' }"
+    :data="projectTypeTree"
+    :render-after-expand="false"
+    :expend="true"
+    placeholder=" "
+  />
+</template>
+
+<script setup lang="ts">
+import { useQuery } from '@tanstack/vue-query'
+import { getProjectType } from '@/service/project'
+import { filterNodeMethod } from '@/utils/tree'
+
+defineOptions({ name: 'ProjectTypeTree' })
+const props = defineProps<{ modelValue: any }>()
+const emit = defineEmits<{ (e: 'update:modelValue', v: string): void }>()
+const projectType = computed({
+  get: () => props.modelValue,
+  set: (val) => emit('update:modelValue', val)
+})
+
+const { data: projectTypeTree } = useQuery([getProjectType.name], getProjectType)
+</script>

+ 5 - 3
client/src/views/OaSystem/components/ProjectTypeTree/index.vue

@@ -1,14 +1,15 @@
 <template>
-  <el-tree-select
+  <tree-select-v2
     v-model="projectType"
     style="width: 100%"
     node-key="id"
     filterable
     check-strictly
-    :filter-node-method="filterNodeMethod"
-    :props="{ label: 'name' }"
+    :filter-method="filterNodeMethod"
+    :props="{ label: 'name', value: 'id' }"
     :data="projectTypeTree"
     :render-after-expand="false"
+    :label-all="true"
     placeholder=" "
   />
 </template>
@@ -17,6 +18,7 @@
 import { useQuery } from '@tanstack/vue-query'
 import { getProjectType } from '@/service/project'
 import { filterNodeMethod } from '@/utils/tree'
+import TreeSelectV2 from '@/components/TreeSelectV2/index.vue'
 
 defineOptions({ name: 'ProjectTypeTree' })
 const props = defineProps<{ modelValue: any }>()

+ 24 - 30
client/src/views/OaSystem/financialManagement/kpglPage/deptIndex.vue

@@ -256,8 +256,28 @@ const idList = ref<string[]>([])
 const handleSelectionChange = (arrs) => {
   idList.value = arrs.map((item) => item.id)
 }
+/**
+ * 初始化查询时间类条件
+ */
+const initQueryParams = () => {
+  if (invoiceTime.value?.length > 0) {
+    queryParams.invoiceOn = formatDate(invoiceTime.value[0], 'YYYY-MM-DD')
+    queryParams.invoiceOff = formatDate(invoiceTime.value[1], 'YYYY-MM-DD')
+  } else {
+    queryParams.invoiceOn = ''
+    queryParams.invoiceOff = ''
+  }
+  if (returnTime.value?.length > 0) {
+    queryParams.returnOn = formatDate(returnTime.value[0], 'YYYY-MM-DD')
+    queryParams.returnOff = formatDate(returnTime.value[1], 'YYYY-MM-DD')
+  } else {
+    queryParams.returnOn = ''
+    queryParams.returnOff = ''
+  }
+}
 /** 列表导出 */
 const getExportContractInvoiceListExcel = async () => {
+  initQueryParams()
   const sendData = {}
   if (idList.value.length > 0) {
     sendData['idList'] = idList.value
@@ -271,20 +291,7 @@ const list = ref([]) // 列表的数
 /** 查询列表 */
 const getList = async () => {
   loading.value = true
-  if (invoiceTime.value?.length > 0) {
-    queryParams.invoiceOn = formatDate(invoiceTime.value[0], 'YYYY-MM-DD')
-    queryParams.invoiceOff = formatDate(invoiceTime.value[1], 'YYYY-MM-DD')
-  } else {
-    queryParams.invoiceOn = ''
-    queryParams.invoiceOff = ''
-  }
-  if (returnTime.value?.length > 0) {
-    queryParams.returnOn = formatDate(returnTime.value[0], 'YYYY-MM-DD')
-    queryParams.returnOff = formatDate(returnTime.value[1], 'YYYY-MM-DD')
-  } else {
-    queryParams.returnOn = ''
-    queryParams.returnOff = ''
-  }
+  initQueryParams()
   try {
     const data = await kpglApi.queryContractInvoicePage(queryParams)
     list.value = data.records
@@ -296,24 +303,11 @@ const getList = async () => {
 //统计信息
 const getStatics = async () => {
   loading.value = true
-  if (invoiceTime.value?.length > 0) {
-    queryParams.invoiceOn = formatDate(invoiceTime.value[0], 'YYYY-MM-DD')
-    queryParams.invoiceOff = formatDate(invoiceTime.value[1], 'YYYY-MM-DD')
-  } else {
-    queryParams.invoiceOn = ''
-    queryParams.invoiceOff = ''
-  }
-  if (returnTime.value?.length > 0) {
-    queryParams.returnOn = formatDate(returnTime.value[0], 'YYYY-MM-DD')
-    queryParams.returnOff = formatDate(returnTime.value[1], 'YYYY-MM-DD')
-  } else {
-    queryParams.returnOn = ''
-    queryParams.returnOff = ''
-  }
+  initQueryParams()
   const data = await kpglApi.getStatics(queryParams)
   infoList.value[0].num = data?.ykp ?? 0
-  infoList.value[1].num = data?.yhk ?? 0
-  infoList.value[2].num = (data?.ykp ?? 0) - (data?.yhk ?? 0)
+  infoList.value[1].num = data?.periodReturnAmount ?? 0
+  infoList.value[2].num = (data?.ykp ?? 0) - (data?.periodReturnAmount ?? 0)
 }
 const handleCurrentChange = (pageNo: number) => {
   queryParams.pageNo = pageNo

+ 28 - 32
client/src/views/OaSystem/financialManagement/kpglPage/index.vue

@@ -221,7 +221,7 @@
 <script setup lang="ts">
 import * as kpglApi from '@/api/oa/kpgl'
 import { openProcessFlow } from '@/utils/flow'
-import { DICT_TYPE, getIntDictOptions, getDictLabel } from '@/utils/dict'
+import { DICT_TYPE, getDictLabel } from '@/utils/dict'
 import { formatDate, dateFormatter2 } from '@/utils/formatTime'
 import TableLayout from '../../oaViews/layout/TableLayout.vue'
 import UserOrgTree from '@/views/OaSystem/components/UserOrgTree/index.vue'
@@ -284,21 +284,10 @@ const idList = ref<string[]>([])
 const handleSelectionChange = (arrs) => {
   idList.value = arrs.map((item) => item.id)
 }
-/** 列表导出 */
-const getExportContractInvoiceListExcel = async () => {
-  const sendData = {}
-  if (idList.value.length > 0) {
-    sendData['idList'] = idList.value
-  }
-  const data = await kpglApi.exportContractInvoiceListExcel(sendData)
-  download.excel(data, '开票台账导出记录.xls')
-}
-const loading = ref(true) // 列表的加载中
-const total = ref(0) // 列表的总页数
-const list = ref([]) // 列表的数
-/** 查询列表 */
-const getList = async () => {
-  loading.value = true
+/**
+ * 初始化查询时间类条件
+ */
+const initQueryParams = () => {
   if (invoiceTime.value?.length > 0) {
     queryParams.invoiceOn = formatDate(invoiceTime.value[0], 'YYYY-MM-DD')
     queryParams.invoiceOff = formatDate(invoiceTime.value[1], 'YYYY-MM-DD')
@@ -313,6 +302,26 @@ const getList = async () => {
     queryParams.returnOn = ''
     queryParams.returnOff = ''
   }
+}
+/** 列表导出 */
+const getExportContractInvoiceListExcel = async () => {
+  initQueryParams()
+  const sendData = {
+    ...queryParams
+  }
+  if (idList.value.length > 0) {
+    sendData['idList'] = idList.value
+  }
+  const data = await kpglApi.exportContractInvoiceListExcel(sendData)
+  download.excel(data, '开票台账导出记录.xls')
+}
+const loading = ref(true) // 列表的加载中
+const total = ref(0) // 列表的总页数
+const list = ref([]) // 列表的数
+/** 查询列表 */
+const getList = async () => {
+  loading.value = true
+  initQueryParams()
   try {
     const data = await kpglApi.queryContractInvoicePage(queryParams)
     list.value = data.records
@@ -324,24 +333,11 @@ const getList = async () => {
 //统计信息
 const getStatics = async () => {
   loading.value = true
-  if (invoiceTime.value?.length > 0) {
-    queryParams.invoiceOn = formatDate(invoiceTime.value[0], 'YYYY-MM-DD')
-    queryParams.invoiceOff = formatDate(invoiceTime.value[1], 'YYYY-MM-DD')
-  } else {
-    queryParams.invoiceOn = ''
-    queryParams.invoiceOff = ''
-  }
-  if (returnTime.value?.length > 0) {
-    queryParams.returnOn = formatDate(returnTime.value[0], 'YYYY-MM-DD')
-    queryParams.returnOff = formatDate(returnTime.value[1], 'YYYY-MM-DD')
-  } else {
-    queryParams.returnOn = ''
-    queryParams.returnOff = ''
-  }
+  initQueryParams()
   const data = await kpglApi.getStatics(queryParams)
   infoList.value[0].num = data?.ykp ?? 0
-  infoList.value[1].num = data?.yhk ?? 0
-  infoList.value[2].num = (data?.ykp ?? 0) - (data?.yhk ?? 0)
+  infoList.value[1].num = data?.periodReturnAmount ?? 0
+  infoList.value[2].num = (data?.ykp ?? 0) - (data?.periodReturnAmount ?? 0)
 }
 const handleCurrentChange = (pageNo: number) => {
   queryParams.pageNo = pageNo

+ 27 - 31
client/src/views/OaSystem/financialManagement/kpglPage/myIndex.vue

@@ -260,9 +260,31 @@ const idList = ref<string[]>([])
 const handleSelectionChange = (arrs) => {
   idList.value = arrs.map((item) => item.id)
 }
+/**
+ * 初始化查询时间类条件
+ */
+const initQueryParams = () => {
+  if (invoiceTime.value?.length > 0) {
+    queryParams.invoiceOn = formatDate(invoiceTime.value[0], 'YYYY-MM-DD')
+    queryParams.invoiceOff = formatDate(invoiceTime.value[1], 'YYYY-MM-DD')
+  } else {
+    queryParams.invoiceOn = ''
+    queryParams.invoiceOff = ''
+  }
+  if (returnTime.value?.length > 0) {
+    queryParams.returnOn = formatDate(returnTime.value[0], 'YYYY-MM-DD')
+    queryParams.returnOff = formatDate(returnTime.value[1], 'YYYY-MM-DD')
+  } else {
+    queryParams.returnOn = ''
+    queryParams.returnOff = ''
+  }
+}
 /** 列表导出 */
 const getExportContractInvoiceListExcel = async () => {
-  const sendData = {}
+  initQueryParams()
+  const sendData = {
+    ...queryParams
+  }
   if (idList.value.length > 0) {
     sendData['idList'] = idList.value
   }
@@ -276,20 +298,7 @@ const list = ref([]) // 列表的数
 /** 查询列表 */
 const getList = async () => {
   loading.value = true
-  if (invoiceTime.value?.length > 0) {
-    queryParams.invoiceOn = formatDate(invoiceTime.value[0], 'YYYY-MM-DD')
-    queryParams.invoiceOff = formatDate(invoiceTime.value[1], 'YYYY-MM-DD')
-  } else {
-    queryParams.invoiceOn = ''
-    queryParams.invoiceOff = ''
-  }
-  if (returnTime.value?.length > 0) {
-    queryParams.returnOn = formatDate(returnTime.value[0], 'YYYY-MM-DD')
-    queryParams.returnOff = formatDate(returnTime.value[1], 'YYYY-MM-DD')
-  } else {
-    queryParams.returnOn = ''
-    queryParams.returnOff = ''
-  }
+  initQueryParams()
   try {
     const data = await kpglApi.queryContractInvoicePage(queryParams)
     list.value = data.records
@@ -301,25 +310,12 @@ const getList = async () => {
 //统计信息
 const getStatics = async () => {
   loading.value = true
-  if (invoiceTime.value?.length > 0) {
-    queryParams.invoiceOn = formatDate(invoiceTime.value[0], 'YYYY-MM-DD')
-    queryParams.invoiceOff = formatDate(invoiceTime.value[1], 'YYYY-MM-DD')
-  } else {
-    queryParams.invoiceOn = ''
-    queryParams.invoiceOff = ''
-  }
-  if (returnTime.value?.length > 0) {
-    queryParams.returnOn = formatDate(returnTime.value[0], 'YYYY-MM-DD')
-    queryParams.returnOff = formatDate(returnTime.value[1], 'YYYY-MM-DD')
-  } else {
-    queryParams.returnOn = ''
-    queryParams.returnOff = ''
-  }
+  initQueryParams()
   const data = await kpglApi.getStatics(queryParams)
   if (data) {
     infoList.value[0].num = data.ykp ?? 0
-    infoList.value[1].num = data.yhk ?? 0
-    infoList.value[2].num = (data.ykp ?? 0) - (data.yhk ?? 0)
+    infoList.value[1].num = data.periodReturnAmount ?? 0
+    infoList.value[2].num = (data.ykp ?? 0) - (data.periodReturnAmount ?? 0)
   }
 }
 const handleCurrentChange = (pageNo: number) => {

+ 2 - 1
client/src/views/OaSystem/projectCenter/projectDetail/components/xmht/index.vue

@@ -203,9 +203,10 @@
             <tr>
               <td class="th">销售经理:</td>
               <td>
+                <span v-if="!editor">{{ mContractDetail['areaManager'] }}</span>
                 <UserOrgTree
+                  v-else
                   v-model="mContractDetail.areaManagerId"
-                  :disabled="!editor"
                   placeholder="请选择销售经理"
                 />
               </td>

+ 15 - 8
client/src/views/OaSystem/projectCenter/projectDetail/components/xmxx/index.vue

@@ -63,11 +63,12 @@
               <tr>
                 <td class="th">项目经理:</td>
                 <td>
+                  <span v-if="isMaster ? !editor : !cEditor">{{ projectDetail['xmjl'] }}</span>
                   <UserOrgTree
+                    v-else
                     class="form-item-disable-style"
                     v-model="projectDetail['xmjlId']"
                     @node-click="xmjlNodeClickHandler"
-                    :disabled="isMaster ? !editor : !cEditor"
                   />
                 </td>
                 <td class="th">责任部门:</td>
@@ -105,11 +106,13 @@
               <tr v-show="isMaster">
                 <td class="th">销售人员:</td>
                 <td>
+                  <span v-if="!editor">{{ projectDetail['xsry'] }}</span>
                   <UserOrgTree
+                    v-else
                     class="form-item-disable-style"
                     v-model="projectDetail['xsryId']"
+                    @node-click="xsryNodeClickHandler"
                     placeholder="请选择销售人员"
-                    :disabled="!editor"
                   />
                 </td>
                 <td class="th">行政区:</td>
@@ -337,7 +340,6 @@ const onHandleSuccess = () => {
   ElMessage({ message: '子项目提交成功', type: 'success' })
   subProjectShow.value = false
 }
-
 const saveChildProject = () => {
   cEditor.value = !cEditor.value
   if (cEditor.value) return
@@ -348,12 +350,14 @@ const saveChildProject = () => {
  * @param type 0表示主项目 1表示子项目
  * **/
 const saveProjectHandle = (type: number): void => {
-  if (type === 0 && !isMaster) return
-  const obj = {
-    projectTypeId: parentProjectDetail.projectTypeId,
-    projectTypeName: parentProjectDetail.projectTypeName
+  // if (type === 0 && !isMaster) return
+  if (type === 1) {
+    const obj = {
+      projectTypeId: parentProjectDetail.projectTypeId,
+      projectTypeName: parentProjectDetail.projectTypeName
+    }
+    Object.assign(projectDetail.value, obj)
   }
-  Object.assign(projectDetail.value, obj)
   save(projectDetail.value)
 }
 
@@ -366,6 +370,9 @@ const { mutate: save } = useMutation(saveProject, {
 const nodeClickHandler = (data: any) => {
   projectDetail.value.zrbm = data.label
 }
+const xsryNodeClickHandler = (item: any) => {
+  projectDetail.value.xsry = item.label
+}
 const xmjlNodeClickHandler = (data: any) => {
   projectDetail.value.xmjl = data.label
 }