Explorar o código

领导驾驶舱弹框——分页待优化版

wyh hai 1 ano
pai
achega
d09fc10d67

+ 6 - 2
src/views/dashboard/Analysis.vue

@@ -3,12 +3,14 @@
     <index-chart v-if="indexStyle==1"></index-chart>
     <index-bdc v-if="indexStyle==2"></index-bdc>
     <index-task v-if="indexStyle==3"></index-task>
+    <first-index v-if="indexStyle==4"></first-index>
     <div style="width: 100%;text-align: right;margin-top: 20px">
       请选择首页样式:
       <a-radio-group v-model="indexStyle">
         <a-radio :value="1">统计图表</a-radio>
         <a-radio :value="2">统计图表2</a-radio>
         <a-radio :value="3">任务表格</a-radio>
+        <a-radio :value="4">任务表格2</a-radio>
       </a-radio-group>
     </div>
     <!-- <a-empty :description="false" style="height: 210px;margin-top: 200px;"/> -->
@@ -19,17 +21,19 @@
   import IndexChart from './IndexChart'
   import IndexTask from "./IndexTask"
   import IndexBdc from './IndexBdc'
+  import FirstIndex from './firstIndex.vue'
 
   export default {
     name: "Analysis",
     components: {
       IndexChart,
       IndexTask,
-      IndexBdc
+      IndexBdc,
+      FirstIndex
     },
     data() {
       return {
-        indexStyle:1
+        indexStyle:4
       }
     },
     created() {

+ 15 - 1
src/views/module_kzks/dashboard/Analysis.vue

@@ -8,7 +8,7 @@
         <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px', cursor: 'pointer' }" v-for="(item, index) in zhibiaoTotal" :key="index" @click="clickItemTotal(item, index)">
           <chart-card :loading="loading" :title="item.title+' (万元) / 当月'" :total="totalPrice(item.monthTotal)">
             <a-tooltip :title="`点击查看${item.title}明细`" slot="action">
-              <a-icon type="info-circle-o" />
+              <a-icon type="info-circle-o" @click="handleMX(item, index)"/>
             </a-tooltip>
             <div>
               <trend :flag="setJiantou(item.monthTb)" style="margin-right: 16px;">
@@ -192,6 +192,9 @@
         <j-select-depart v-model="selecteddeparts" :multi="true" @back="backDepartInfo" :backDepart="true" :treeOpera="true" @change="okChange"></j-select-depart>
       </div>
     </template>
+
+    <!-- 弹框列表 -->
+    <list-modal ref="modalForm" :listData = "listData"></list-modal>
     
 
 
@@ -215,6 +218,7 @@
   import deptZbphTable from './components/deptZbphTable.vue'
 
   import { getLoginfo,getVisitInfo } from '@/api/api'
+  import ListModal from './components/listModal.vue'
 
   const chb8Names = [
     { name: '外协费', value: 'wxf' },
@@ -242,6 +246,7 @@
       twoYAxisChart,
 
       deptZbphTable,
+        ListModal,
     },
     data() {
       return {
@@ -389,6 +394,9 @@
 
         // 所长选择部门查看:多选
         selecteddeparts: '', // 用来组件选择的 
+
+        // 点击弹框展示项
+        listData: {}
       }
     },
     computed: {
@@ -432,6 +440,12 @@
       this.searchZbphChange('month')
     },
     methods: {
+      // 弹框
+      handleMX(item, index){
+        // console.log(9898,item, index)
+        this.listData = item
+        // this.$refs.modalForm.getList();
+      },
       //限制选择年份
       disabledYear(current){
         // 不可以选择之前的日期,今天包括之后可以选,控制大于小于来实现选择之前的日期还是之后的日期

+ 208 - 0
src/views/module_kzks/dashboard/components/listModal.vue

@@ -0,0 +1,208 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        class="j-table-force-nowrap">
+    </a-table>
+    <!-- <list-modal-list :listData = "dataXQ"></list-modal-list> -->
+    <template slot="footer">
+        <a-button @click="handleCancel">取消</a-button>
+    </template>
+  </j-modal>
+</template>
+
+<script>
+// import ListModalList from './listModalList.vue'
+import { httpAction, getAction, postAction } from '@/api/manage'
+import { filterObj } from '@/utils/util';
+
+  export default {
+    name: 'ListModal',
+    props: {
+        listData: {
+            type: Object,
+            default: function(){
+                return {} // 使用工厂函数返回默认值
+            }
+        }
+    },
+    components: {
+        // ListModalList
+    },
+    data () {
+      return {
+        title:'',
+        width:1200,
+        visible: false,
+        disableSubmit: false,
+        dataXQ: {},
+        columns: [],
+        dataSource: [],
+        ipagination: {
+            current: 1,
+            pageSize: 10,
+            pageSizeOptions: ['10', '20', '30'],
+            showTotal: (total, range) => {
+            return range[0] + "-" + range[1] + " 共" + total + "条"
+            },
+            showQuickJumper: true,
+            showSizeChanger: true,
+            total: 0
+        },
+        loading: false,
+        url: {
+          htelist: "/index/getDetailIncome",
+          skelist: "/index/getDetailReceived",
+          zcelist: "",
+          lrelist: "",
+        },
+      }
+    },
+    watch: {
+      listData: {
+        handler(newValue, oldValue){
+        //   console.log(66666,newValue, oldValue)
+          this.dataXQ = newValue
+          this.getList()
+        },
+        immediate: true,
+        deep: true
+      }
+    },
+    methods: {
+      getList () {
+        console.log(99999,this.dataXQ)
+        this.title = this.dataXQ.title
+        this.loading = true
+        var params = this.getQueryParams();//查询条件
+        if (this.dataXQ.hdValue) {
+            if (this.dataXQ.hdValue == 'hte') {
+                this.columns= [
+                    {
+                    title: '序号',
+                    dataIndex: '',
+                    key:'rowIndex',
+                    width:60,
+                    align:"center",
+                    customRender:function (t,r,index) {
+                        return parseInt(index)+1;
+                    }
+                    },
+                    {
+                    title:'任务编号',
+                    align:"center",
+                    dataIndex: 'rwbh'
+                    },
+                    {
+                    title:'合同名称',
+                    align:"center",
+                    dataIndex: 'htmc'
+                    },
+                    {
+                    title:'合同分配额',
+                    align:"center",
+                    dataIndex: 'htfpe'
+                    },
+                    {
+                    title:'签署日期',
+                    align:"center",
+                    dataIndex: 'qsrq'
+                    },
+                ]
+                getAction(this.url.htelist, params).then((response) => {
+                    console.log(7777,response.result)
+                    this.dataSource = response.result.records
+                    this.ipagination.total = response.result.total
+                    this.loading = false
+                })
+            }
+            if (this.dataXQ.hdValue == 'ske') {
+                this.columns= [
+                    {
+                    title: '序号',
+                    dataIndex: '',
+                    key:'rowIndex',
+                    width:60,
+                    align:"center",
+                    customRender:function (t,r,index) {
+                        return parseInt(index)+1;
+                    }
+                    },
+                    {
+                    title:'任务编号',
+                    align:"center",
+                    dataIndex: 'rwbh'
+                    },
+                    {
+                    title:'任务收款金额',
+                    align:"center",
+                    dataIndex: 'rwskje'
+                    },
+                    {
+                    title:'到款日期/汇票到期日期',
+                    align:"center",
+                    dataIndex: 'dkhpdqrq'
+                    },
+                ]
+                getAction(this.url.skelist, params).then((response) => {
+                    console.log(7777,response.result.records)
+                    this.dataSource = response.result.records
+                    this.ipagination.total = response.result.total
+                    this.loading = false
+                })
+            }
+            if (this.dataXQ.hdValue == 'zce') {
+                
+            }
+            if (this.dataXQ.hdValue == 'lre') {
+                
+            }
+            this.visible=true
+        } else {
+            this.visible=false
+        }
+      },
+      getQueryParams() {
+        //获取查询条件
+        let sqp = {}
+        if(this.superQueryParams){
+            sqp['superQueryParams']=encodeURI(this.superQueryParams)
+            sqp['superQueryMatchType'] = this.superQueryMatchType
+        }
+        var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
+        param.pageNo = this.ipagination.current;
+        param.pageSize = this.ipagination.pageSize;
+        return filterObj(param);
+      },
+      close () {
+        this.columns= []
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 155 - 0
src/views/module_kzks/dashboard/components/listModalList.vue

@@ -0,0 +1,155 @@
+<template>
+  <a-card :bordered="false">
+
+    <!-- table区域-begin -->
+    <div>
+      <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div> -->
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+
+  export default {
+    name: 'ListModalList',
+    mixins:[JeecgListMixin, mixinDevice],
+    props: {
+        listData: {
+            type: Object,
+            default: function(){
+                return {} // 使用工厂函数返回默认值
+            }
+        }
+    },
+    components: {
+    },
+    data () {
+      return {
+        // 表头
+        columns: [
+            {
+            title: '序号',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+                return parseInt(index)+1;
+            }
+            },
+            {
+            title:'任务编号',
+            align:"center",
+            dataIndex: 'rwbh'
+            },
+            {
+            title:'合同名称',
+            align:"center",
+            dataIndex: 'htmc'
+            },
+            {
+            title:'合同分配额',
+            align:"center",
+            dataIndex: 'htfpe'
+            },
+            {
+            title:'签署日期',
+            align:"center",
+            dataIndex: 'qsrq'
+            },
+        ],
+        url: {
+          list: "/index/getDetailIncome",
+          
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    watch: {
+      listData: {
+        handler(newValue, oldValue){
+          console.log(777777,newValue, oldValue)
+        },
+        immediate: true,
+        deep: true
+      }
+    },
+    created() {
+        
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>