Browse Source

指标排行

yuhan 1 year ago
parent
commit
64407d12b4

+ 2 - 0
src/api/kzksApi.js

@@ -37,6 +37,7 @@ const getdataByChb = (params)=>getAction("/index/getEightCostsInfo", params);
 // const getdataByChb = (params)=>getAction("/index/getEightCost", params);
 const getdataByLr = (params)=>getAction("/index/countLreByDate", params);
 const getdataBySk = (params)=>getAction("/index/countTotalReceivedByDate", params);
+const deptZhibiaoPaihang = (params)=>getAction("/index/getCompletRateByDate", params);
 
 
 export {
@@ -55,6 +56,7 @@ export {
   getdataByLr,
   getdataByChb,
   getdataBySk,
+  deptZhibiaoPaihang,
 }
 
 

+ 1 - 1
src/utils/request.js

@@ -17,7 +17,7 @@ let apiBaseUrl = window._CONFIG['domianURL'] || "/jeecg-boot";
 const service = axios.create({
   //baseURL: '/jeecg-boot',
   baseURL: apiBaseUrl, // api base_url
-  timeout: 60000 // 请求超时时间
+  timeout: 600000 // 请求超时时间
 })
 
 const err = (error) => {

+ 116 - 7
src/views/module_kzks/dashboard/Analysis.vue

@@ -31,6 +31,7 @@
         
       </a-row>
 
+      <!-- 第二级模块:折/柱形图 -->
       <a-card :loading="loading" :bordered="false" :body-style="{padding: '0'}">
         <div class="salesCard">
           <a-tabs default-active-key="1" size="large" :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}">
@@ -96,6 +97,54 @@
           </a-tabs>
         </div>
       </a-card>
+
+      <!-- 第三级模块:部门指标排行 -->
+      <a-card :loading="loading" :bordered="false" :body-style="{padding: '0'}" style="margin-top: 20px;">
+        <div class="salesCard">
+          <a-tabs default-active-key="1" size="large" :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}">
+            <div class="extra-wrapper" slot="tabBarExtraContent">
+              <div class="extra-item">
+                <a-button :type="zbPhParams.time==='month'?'primary':'link'" @click="searchZbphChange('month')">按月查询</a-button>
+                <a-button :type="zbPhParams.time==='year'?'primary':'link'" @click="searchZbphChange('year')">按年查询</a-button>
+              </div>
+              <a-month-picker v-if="zbPhParams.time === 'month'" placeholder="请选择月" :value="zbPhParams.beginDate" @change="zbphSearchChange" />
+              <!-- <a-date-picker  v-if="zbPhParams.time === 'year'"
+                @Change=zbphSearchChange
+                placeholder="请选择年"
+                mode="year"
+                v-model="zbPhParams.beginDate"
+                format="YYYY"
+                allowClear="false"
+              /> -->
+              <a-date-picker
+                v-if="zbPhParams.time === 'year'"
+                mode="year"
+                format="YYYY"
+                :value="zbPhParams.yearValue"
+                :open="zbphYearIsopen"
+                placeholder="请选择年份"
+                @focus="changeopen"
+                @panelChange="handlePanelChange1">
+              </a-date-picker>
+
+            </div>
+            <a-tab-pane loading="true" tab="下达部门指标排行" key="1">
+              <a-row>
+                <a-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
+                  <deptZbphTable :dataSource="zbPhDataSource.jycsCharts" class="dept-zbph-table"></deptZbphTable>
+                </a-col>
+              </a-row>
+            </a-tab-pane>
+            <a-tab-pane loading="true" tab="责任部门指标排行" key="2">
+              <a-row>
+                <a-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
+                  <deptZbphTable :dataSource="zbPhDataSource.zrbmCharts" class="dept-zbph-table"></deptZbphTable>
+                </a-col>
+              </a-row>
+            </a-tab-pane>
+          </a-tabs>
+        </div>
+      </a-card>
       
       <!-- <a-card :loading="loading" :bordered="false" :body-style="{padding: '0'}" :style="{ marginTop: '24px' }">
         <div class="salesCard">
@@ -144,7 +193,7 @@
 
 <script>
   import moment from 'moment'
-  import { getZhibiaoCollect, getdataByHt, getdataBySk,  getdataByChb, getdataByLr, } from '@/api/kzksApi'
+  import { getZhibiaoCollect, getdataByHt, getdataBySk,  getdataByChb, getdataByLr, deptZhibiaoPaihang, } from '@/api/kzksApi'
 
   import ChartCard from '@/components/ChartCard'
   import RankList from '@/components/chart/RankList'
@@ -156,6 +205,8 @@
   import pieContentChart from './components/pieContentChart.vue'
   import twoYAxisChart from './components/twoYAxisChart.vue'
 
+  import deptZbphTable from './components/deptZbphTable.vue'
+
   import { getLoginfo,getVisitInfo } from '@/api/api'
 
   const chb8Names = [
@@ -180,6 +231,8 @@
       rankingChart,
       pieContentChart,
       twoYAxisChart,
+
+      deptZbphTable,
     },
     data() {
       return {
@@ -245,7 +298,7 @@
 
         // 选择指标
         chooseValue: 'hte',
-        chartTitle: '成本',
+        chartTitle: '合同',
 
         // 折线柱形总览图
         lineBarXAxisData: [],
@@ -257,12 +310,16 @@
         rankingYAxisNames: ["部门06", "部门01", "部门05", "部门10", "部门07", "部门04", "部门03", "部门08", "部门09", "部门02"],
         yAxisNumbers: [50, 42, 26, 23, 15, 14, 12, 8, 5, 1],
 
-
         // 双y轴总览图
         twoYAxisData: {},
         // 排行
 
-
+        // 部门指标排行
+        zbPhParams: {
+          beginDate: null,
+          yearValue: null, // 因为dataPick是moment格式,所以加一个进行转化显示用
+          time: ''
+        },
         columns: [
           {
             title: '序号',
@@ -310,8 +367,11 @@
             dataIndex: 'htDate'
           },
         ],
-        dataSource: [],
-        ipagination: {},
+        zbphYearIsopen: false,
+        zbPhDataSource: {
+          jycsCharts: [],
+          zrbmCharts: [],
+        },
 
       }
     },
@@ -351,6 +411,9 @@
       this.initLogInfo();
       this.getZhibiaoCollect()
       this.setNowDate()
+      // 部门指标排行
+      // this.deptZhibiaoPaihang()
+      this.searchZbphChange('month')
     },
     methods: {
       getZhibiaoCollect(){
@@ -552,7 +615,50 @@
            }
          })
       },
-
+      // 获取部门指标排行数据
+      deptZhibiaoPaihang(){
+        deptZhibiaoPaihang(this.zbPhParams).then(res => {
+          console.log(res)
+          this.zbPhDataSource = res.result
+        })
+      },
+      // 部门指标排行搜索
+      searchZbphChange(type){
+        this.zbPhParams.time = type
+        const now = new Date()
+        const year = now.getFullYear(); // 年
+        const month = now.getMonth() + 1; // 月
+        const monthBetter = month >= 10 ? month : '0' + month
+        const endDate = `${year}-${monthBetter}`
+        if(type === 'month'){
+          this.zbPhParams.yearValue = ''
+          this.zbPhParams.beginDate = endDate
+        }
+        if(type === 'year'){
+          this.zbPhParams.yearValue = moment(year, 'YYYY')
+          this.zbPhParams.beginDate = year
+          console.log(this.zbPhParams)
+        }
+        this.deptZhibiaoPaihang()
+      },
+      // 部门指标排行按月选择确事件
+      zbphSearchChange(date, dateString){
+        // console.log(date, dateString)
+        this.zbPhParams.beginDate = dateString
+        this.deptZhibiaoPaihang()
+      },
+      handlePanelChange1(value, mode) {
+        // console.log(value);
+        // console.log(mode);
+        // console.log(moment(value).format('YYYY'))
+        this.zbPhParams.yearValue = value
+        this.zbPhParams.beginDate = moment(value).format('YYYY')
+        this.deptZhibiaoPaihang()
+        this.zbphYearIsopen = false
+      },
+      changeopen() {
+        this.zbphYearIsopen = true;
+      },
     }
   }
 </script>
@@ -605,4 +711,7 @@
       }
     }
   }
+  .dept-zbph-table{
+    padding: 0 20px 20px;
+  }
 </style>

+ 87 - 0
src/views/module_kzks/dashboard/components/deptZbphTable.vue

@@ -0,0 +1,87 @@
+<template>
+  <a-table
+    ref="table"
+    size="middle"
+    :scroll="{x:true}"
+    bordered
+    rowKey="id"
+    :columns="columns"
+    :dataSource="dataSource"
+    class="j-table-force-nowrap">
+    <!-- :loading="loading" -->
+    <!-- :pagination="ipagination" -->
+    
+  </a-table>
+</template>
+
+<script>
+  // import '@/assets/less/TableExpand.less'
+  // import { mixinDevice } from '@/utils/mixin'
+  // import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  export default {
+    name: '',
+    // mixins:[JeecgListMixin, mixinDevice],
+    props: {
+      dataSource: {
+        type: Array,
+        default: []
+      }
+    },
+    data () {
+      return {
+        // 表头
+        columns: [
+          {
+            title: '序号',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'部门',
+            align:"center",
+            dataIndex: 'depart'
+          },
+          {
+            title:'当期指标',
+            align:"center",
+            dataIndex: 'departKpi'
+          },
+          // {
+          //   title:'项目进度',
+          //   align:"center",
+          //   dataIndex: 'processpercent'
+          // },
+          {
+            title:'当期合同额',
+            align:"center",
+            dataIndex: 'contractAmount'
+          },
+          {
+            title:'当期已收款',
+            align:"center",
+            dataIndex: 'received'
+          },
+          {
+            title:'完成度',
+            align:"center",
+            dataIndex: 'kpiCompletRate'
+          },
+        ],
+      }
+    },
+    created() {
+    },
+    methods: {
+      initDictConfig(){
+      },
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 11 - 10
src/views/module_kzks/kpiImportList/KpiImportList.vue

@@ -6,7 +6,8 @@
         <a-row :gutter="24">
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="指标年份">
-              <j-date placeholder="请选择指标年份" v-model="queryParam.year"></j-date>
+              <!-- <j-date placeholder="请选择指标年份" v-model="queryParam.year"></j-date> -->
+              <a-input placeholder="请选择指标年份" v-model="queryParam.year"></a-input>
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -31,7 +32,7 @@
 
     <!-- 操作按钮区域 -->
     <div class="table-operator">
-      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
       <a-button type="primary" icon="download" @click="handleExportXls('年指标导入')">导出</a-button>
       <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
         <a-button type="primary" icon="import">导入</a-button>
@@ -164,14 +165,14 @@
             align:"center",
             dataIndex: 'department'
           },
-          {
-            title: '操作',
-            dataIndex: 'action',
-            align:"center",
-            fixed:"right",
-            width:147,
-            scopedSlots: { customRender: 'action' }
-          }
+          // {
+          //   title: '操作',
+          //   dataIndex: 'action',
+          //   align:"center",
+          //   fixed:"right",
+          //   width:147,
+          //   scopedSlots: { customRender: 'action' }
+          // }
         ],
         url: {
           list: "/kpiImportList/kpiImportList/list",

+ 221 - 0
src/views/module_kzks/kpiProjectMonth/KzksKpiProjectMonthList.vue

@@ -0,0 +1,221 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="责任部门">
+              <a-input placeholder="请输入责任部门" v-model="queryParam.zrbm"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="下达部门">
+              <a-input placeholder="请输入下达部门" v-model="queryParam.jycs"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              <a @click="handleToggleSearch" style="margin-left: 8px">
+                {{ toggleSearchStatus ? '收起' : '展开' }}
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+              </a>
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <!-- <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('每月月底考核项目进度表')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload> -->
+      <!-- 高级查询区域 -->
+      <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown>
+    </div> -->
+
+    <!-- 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"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        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>
+
+    <kzks-kpi-project-month-modal ref="modalForm" @ok="modalFormOk"></kzks-kpi-project-month-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import KzksKpiProjectMonthModal from './modules/KzksKpiProjectMonthModal'
+
+  export default {
+    name: 'KzksKpiProjectMonthList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      KzksKpiProjectMonthModal
+    },
+    data () {
+      return {
+        description: '每月月底考核项目进度表管理页面',
+        // 表头
+        columns: [
+          {
+            title: '序号',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'任务号',
+            align:"center",
+            dataIndex: 'taskno'
+          },
+          {
+            title:'项目进度',
+            align:"center",
+            dataIndex: 'processpercent'
+          },
+          {
+            title:'责任部门',
+            align:"center",
+            dataIndex: 'zrbm'
+          },
+          {
+            title:'下达部门',
+            align:"center",
+            dataIndex: 'jycs'
+          },
+          {
+            title:'合同额',
+            align:"center",
+            dataIndex: 'contractfpe'
+          },
+          {
+            title:'已收款',
+            align:"center",
+            dataIndex: 'taskmoney'
+          },
+          {
+            title:'进度日期',
+            align:"center",
+            dataIndex: 'ym'
+          },
+        ],
+        url: {
+          list: "/kpiProjectMonth/kzksKpiProjectMonth/list",
+          delete: "/kpiProjectMonth/kzksKpiProjectMonth/delete",
+          deleteBatch: "/kpiProjectMonth/kzksKpiProjectMonth/deleteBatch",
+          exportXlsUrl: "/kpiProjectMonth/kzksKpiProjectMonth/exportXls",
+          importExcelUrl: "kpiProjectMonth/kzksKpiProjectMonth/importExcel",
+          
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'string',value:'taskno',text:'任务号',dictCode:''})
+        fieldList.push({type:'BigDecimal',value:'processpercent',text:'项目进度',dictCode:''})
+        fieldList.push({type:'string',value:'zrbm',text:'责任部门',dictCode:''})
+        fieldList.push({type:'string',value:'jycs',text:'下达部门',dictCode:''})
+        fieldList.push({type:'BigDecimal',value:'contractfpe',text:'合同额',dictCode:''})
+        fieldList.push({type:'BigDecimal',value:'taskmoney',text:'已收款',dictCode:''})
+        // fieldList.push({type:'int',value:'year',text:'当前任务进度的年份',dictCode:''})
+        // fieldList.push({type:'int',value:'month',text:'当前任务进度的月份',dictCode:''})
+        fieldList.push({type:'string',value:'ym',text:'进度日期',dictCode:''})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 144 - 0
src/views/module_kzks/kpiProjectMonth/modules/KzksKpiProjectMonthForm.vue

@@ -0,0 +1,144 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="任务号/来自科研任务" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="taskno">
+              <a-input v-model="model.taskno" placeholder="请输入任务号/来自科研任务"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="项目进度/来自科研任务" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processpercent">
+              <a-input-number v-model="model.processpercent" placeholder="请输入项目进度/来自科研任务" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="责任部门/来自科研任务" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zrbm">
+              <a-input v-model="model.zrbm" placeholder="请输入责任部门/来自科研任务"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="下达部门/来自科研任务" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jycs">
+              <a-input v-model="model.jycs" placeholder="请输入下达部门/来自科研任务"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="合同额/来自收款合同的合同分配额 " :labelCol="labelCol" :wrapperCol="wrapperCol" prop="contractfpe">
+              <a-input-number v-model="model.contractfpe" placeholder="请输入合同额/来自收款合同的合同分配额 " style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="已收款/ 来自合同收款详细的任务收款额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="taskmoney">
+              <a-input-number v-model="model.taskmoney" placeholder="请输入已收款/ 来自合同收款详细的任务收款额" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="当前任务进度的年份" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="year">
+              <a-input-number v-model="model.year" placeholder="请输入当前任务进度的年份" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="当前任务进度的月份" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="month">
+              <a-input-number v-model="model.month" placeholder="请输入当前任务进度的月份" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="当前任务进度的年月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ym">
+              <a-input v-model="model.ym" placeholder="请输入当前任务进度的年月"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'KzksKpiProjectMonthForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+        },
+        url: {
+          add: "/kpiProjectMonth/kzksKpiProjectMonth/add",
+          edit: "/kpiProjectMonth/kzksKpiProjectMonth/edit",
+          queryById: "/kpiProjectMonth/kzksKpiProjectMonth/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+         
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
src/views/module_kzks/kpiProjectMonth/modules/KzksKpiProjectMonthModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <kzks-kpi-project-month-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></kzks-kpi-project-month-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import KzksKpiProjectMonthForm from './KzksKpiProjectMonthForm'
+
+  export default {
+    name: 'KzksKpiProjectMonthModal',
+    components: {
+      KzksKpiProjectMonthForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
src/views/module_kzks/kpiProjectMonth/modules/KzksKpiProjectMonthModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <kzks-kpi-project-month-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></kzks-kpi-project-month-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import KzksKpiProjectMonthForm from './KzksKpiProjectMonthForm'
+  export default {
+    name: 'KzksKpiProjectMonthModal',
+    components: {
+      KzksKpiProjectMonthForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>