zhangqi 1 éve
szülő
commit
16ad84d672

+ 1 - 1
src/DRP/HDrpManagement/customerGoals/detail/index.vue

@@ -3,7 +3,7 @@
     <detail-template :headData="mainAreaData" ownertable="salestargetbill" :title="mainData.year + '年度目标'" :tabs="['目标详情','统计']"
     :delParam="{id:'20221118103402',content:{sa_salestargetbillids:[router.currentRoute.value.query.id]}}" >
       <template #operation>
-        <edit :data="mainData"></edit>
+        <edit :data="mainData" @onSuccess="mianData"></edit>
         <tableImport :bindData="{ownerid:router.currentRoute.value.query.id,ownertable:'sa_salestargetbill',usetype:'default'}" :failedData="failedData" :modeParam="{id:20231020111203,content:{}}" @uploadSuccess="importSuccess">
         </tableImport>
       </template>

+ 6 - 1
src/DRP/HDrpManagement/customerGoals/detail/modules/edit.vue

@@ -130,6 +130,11 @@ const showDrawer = ()=>{
   form.value.statisticaldimensionTypeValue = props.data.statisticaldimension.type
   form.value.statisticaldimensionMxValue = props.data.statisticaldimension.mx
   visible.value = true
+  onChange({
+    target:{
+      value:props.data.assessmentindicators
+    }
+  })
   accountList()
   typeList()
 }
@@ -158,7 +163,7 @@ const submit =  () => {
         "id": "20221229104202",
         content:form.value
       })
-      utils.message(res,'创建成功!',()=>{
+      utils.message(res,'保存成功!',()=>{
         emit('onSuccess')
         onClose()
       })

+ 1 - 1
src/DRP/HDrpManagement/performanceGoals/detail/index.vue

@@ -3,7 +3,7 @@
     <detail-template :headData="mainAreaData" ownertable="salestargetbill" :title="mainData.year + '年度目标'" :tabs="['目标详情','统计']"
     :delParam="{id:'20221118103402',content:{sa_salestargetbillids:[router.currentRoute.value.query.id]}}" >
       <template #operation>
-        <edit :data="mainData"></edit>
+        <edit :data="mainData" @onSuccess="mianData"></edit>
 
         <tableImport :bindData="{ownerid:router.currentRoute.value.query.id,ownertable:'sa_salestargetbill',usetype:'default'}" :failedData="failedData" :modeParam="{id:20220913093102,content:{}}" @uploadSuccess="importSuccess">
         </tableImport>

+ 7 - 3
src/DRP/HDrpManagement/performanceGoals/detail/modules/edit.vue

@@ -111,6 +111,11 @@ const showDrawer = ()=>{
   form.value.statisticaldimensionTypeValue = props.data.statisticaldimension.type
   form.value.statisticaldimensionMxValue = props.data.statisticaldimension.mx
   visible.value = true
+  onChange({
+    target:{
+      value:props.data.assessmentindicators
+    }
+  })
   accountList()
   typeList()
 }
@@ -134,7 +139,7 @@ const submit = async () => {
   const res = await Api.post({
     "id": "20220831165302",
     content:{
-      sa_salestargetbillid:0,
+      sa_salestargetbillid:props.data.sa_salestargetbillid,
       sales:[],
       year:form.value.year,
       statisticaldimension:form.value.statisticaldimension,
@@ -142,14 +147,13 @@ const submit = async () => {
       sa_accountclassids:form.value.sa_accountclassids,
     }
   })
-  utils.message(res,'创建成功!',()=>{
+  utils.message(res,'保存成功!',()=>{
     emit('onSuccess')
     onClose()
   })
 }
 const options=ref([{name:'订单审核',value:'订单审核'},{name:'订单提交',value:'订单提交'}])
 const onChange = ({target})=>{
-  console.log(target)
   switch (target.value) {
     case '订单':
       form.value.sa_accountclassids = []

+ 10 - 0
src/router/index.js

@@ -41,6 +41,16 @@ const routes = [
         },
         component: ()=>import(/* webpackChunkName: "about" */ '@/views/reportcenter/index.vue'),
       },
+      {
+        path: '/reportsManage',
+        name: 'reportsManage',
+        meta: {
+          title: '报表管理',
+          name: 'reportsManage',
+          keepAlive:true
+        },
+        component: ()=>import(/* webpackChunkName: "about" */ '@/views/reportsManage/index.vue'),
+      },
       {
         path: '/custom_option',
         name: 'custom_option',

+ 54 - 6
src/views/reportcenter/index.vue

@@ -1,6 +1,11 @@
 <template>
-  <div class="y-container">
-    <listTemp :columns="columns" :param="param" :tableName="'reportcenterTable'">
+  <div class="y-container flex">
+    <div>
+      <ul class="typeMenu">
+        <li :class="item.type == onType ? 'on':''" v-for="item in data" :key="item.index" @click="typeClick(item.type)">{{item.type}}</li>
+      </ul>
+    </div>
+    <listTemp ref="list" :columns="columns" :param="param" :tableName="'reportcenterTable'" :searchType="searchType" :noAutoQuery="true" style="flex:1">
       <template #operation>
         报表中心
       </template>
@@ -17,20 +22,24 @@
   import listTemp from '@/components/listTemplate/index.vue';
   import Api from '@/api/api'
   import { ref } from 'vue'
-  import { useRouter } from "vue-router";
   import { onMounted } from "vue";
   import { useAuthStore } from '@/stores/modules/auth'
   import { storeToRefs } from 'pinia'
   const store = useAuthStore()
   let { app } = storeToRefs(store)
-  const router = useRouter()
   let columns = ref([])
-  let dataSource = ref([])
+  let searchType = ref([
+    {label:'搜索',key:'condition',type:'input'}
+  ])
   let param = ref({
     "content": {
       "pageNumber":1,
       "pageSize":20,
-      "systemappid":app.value.systemappid
+      "systemappid":app.value.systemappid,
+      "where": {
+          "condition": "",
+          "type": "",
+      },
     },
     "id": 20221213094401,
   })
@@ -58,9 +67,48 @@
     })
     window.open(getBaseUrl() + res.data)
   }
+  const list = ref()
+  const data = ref([])
+  const typeList = async ()=> {
+    const res = await Api.requested({
+      "id": 20240407094804,
+      "content": {
+      }
+    })
+    data.value = res.data
+    onType.value = param.value.content.where.type = res.data[0].type
+    list.value.tableData()
+  }
+  const onType = ref('')
+  const typeClick = (value)=>{
+    onType.value = param.value.content.where.type = value
+    list.value.tableData()
+  }
+  onMounted(()=>{
+    typeList()
+  })
 </script>
 <style scoped>
+.flex{
+  display: flex;
+}
 .btn-link{
   text-decoration: underline;
 }
+.typeMenu{
+  padding: 0;
+  list-style: none;
+  width: 150px;
+  margin-right: 10px;
+}
+.typeMenu li{
+  padding:5px 10px;
+  margin-bottom: 5px;
+  cursor: pointer;
+}
+.on{
+  border-radius: 3px;
+  background-color: #1677ff;
+  color: #fff;
+}
 </style>

+ 73 - 0
src/views/reportsManage/index.vue

@@ -0,0 +1,73 @@
+<template>
+  <div class="y-container">
+    <listTemp ref="list" :columns="columns" :param="param" :tableName="'reportcenterTable'" :searchType="searchType">
+      <template #operation>
+        报表管理
+      </template>
+      <template #tb_cell="{data}">
+        <template v-if="data.column.dataIndex == 'name'">
+          <a-button type="link"><span class="btn-link" @click="goDetail(data.record)">{{data.record.name}}</span></a-button>
+        </template>
+        <template v-if="data.column.dataIndex == 'operation'">
+          <set-type :id="data.record.sys_reportid" :types="data.record.type !== '' ? data.record.type:[] " @onSuccess="onSuccess"></set-type>
+        </template>
+      </template>
+    </listTemp>
+  </div>
+</template>
+
+<script setup>
+  import listTemp from '@/components/listTemplate/index.vue';
+  import setType from './modules/type.vue';
+  import Api from '@/api/api'
+  import { ref } from 'vue'
+  import { useAuthStore } from '@/stores/modules/auth'
+  import { storeToRefs } from 'pinia'
+  const store = useAuthStore()
+  let { app } = storeToRefs(store)
+  let columns = ref([])
+  let searchType = ref([
+    {label:'搜索',key:'condition',type:'input'}
+  ])
+  let param = ref({
+    "content": {
+      "pageNumber":1,
+      "pageSize":20,
+      "systemappid":app.value.systemappid
+    },
+    "id": 20240407094904,
+  })
+  const getBaseUrl = () => {
+    
+    if (process.env.NODE_ENV == 'development') return process.env.BASE_API
+    let href = window.location.href
+    let index = href.indexOf('/')
+    let num = 0
+    while (index != -1) {
+      num++
+      index = href.indexOf('/',index+1)
+      if (num++ == 3) {
+        return href.slice(0,index)
+      } 
+    }
+  }
+  const goDetail = async (data)=> {
+    let res = await Api.requested({
+      "id":20221213094501,
+      "content": {
+        sys_reportid:data.sys_reportid,
+        dataid:0
+      }
+    })
+    window.open(getBaseUrl() + res.data)
+  }
+  const list = ref()
+  const onSuccess = ()=>{
+    list.value.tableData()
+  }
+</script>
+<style scoped>
+.btn-link{
+  text-decoration: underline;
+}
+</style>

+ 58 - 0
src/views/reportsManage/modules/type.vue

@@ -0,0 +1,58 @@
+<template>
+  <a-button type="primary" @click="showDrawer">设置分类</a-button>
+  <a-drawer
+    v-model:open="open"
+    title="设置分类"
+    placement="right"
+
+  >
+    <a-checkbox-group v-model:value="checkboxValue" style="width: 100%">
+      <a-row>
+        <a-col v-for="item in data" :key="item.index" :span="8">
+          <a-checkbox :value="item.value">{{item.remarks}}</a-checkbox>
+        </a-col>
+      </a-row>
+    </a-checkbox-group>
+    <template #extra>
+      <a-space>
+        <a-button @click="onClose">关闭</a-button>
+        <a-button type="primary" @click="submit">保存</a-button>
+      </a-space>
+    </template>
+  </a-drawer>
+</template>
+<script setup>
+import { ref,defineProps,defineEmits } from 'vue';
+import Api from '@/api/api'
+import utils from '@/utils/utils'
+const emit = defineEmits(['onSuccess'])
+const props = defineProps(['id','types'])
+const checkboxValue = ref([])
+const open = ref(false);
+const onClose = () => {
+  open.value = false;
+}
+const showDrawer = () => {
+  open.value = true;
+  typeList()
+};
+const data = ref([])
+const typeList = async ()=>{
+  const res = await Api.optionstype('reportclassification')
+  data.value = res.data
+  checkboxValue.value = props.types.split(',')
+}
+const submit = async ()=>{
+  const res = await Api.requested({
+    "id": 20240407095004,
+    "content": {
+      "sys_reportid": props.id,
+      "types":checkboxValue.value
+    }
+  })
+  utils.message(res,'设置成功!',()=>{
+    emit('onSuccess')
+  })
+}
+
+</script>