hfxc226 2 yıl önce
ebeveyn
işleme
d302e44f18

+ 2 - 1
.gitignore

@@ -7,4 +7,5 @@
 *.fatbin
 
 /node_modules/
-/.idea/
+/.idea/
+/dist/

+ 100 - 0
src/api/report/application-form.js

@@ -51,6 +51,106 @@ export function exportMonthReportBig24Month (parameter) {
   })
 }
 
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getSbInfoReport (parameter) {
+  return axios({
+    url: '/report/repair/sbInfo?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * export file
+ * parameter: { }
+ * @param parameter :
+  * @returns {*}
+ */
+export function exportSbInfoReport (parameter) {
+  return axios({
+    url: '/report/repair/sbInfo/export?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    responseType: 'blob'
+  })
+}
+
+/**
+ * export file
+ * parameter: { }
+ * @param parameter :
+  * @returns {*}
+ */
+export function exportSbInfoReportYear (parameter) {
+  return axios({
+    url: '/report/repair/sbInfo/export/year?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    responseType: 'blob'
+  })
+}
+
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getSbInfoReportFee (parameter) {
+  return axios({
+    url: '/report/repair/sbInfo/fee?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * export file
+ * parameter: { }
+ * @param parameter :
+  * @returns {*}
+ */
+export function exportSbInfoReportFee (parameter) {
+  return axios({
+    url: '/report/repair/sbInfo/fee/export?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    responseType: 'blob'
+  })
+}
+
+/**
+ * export file
+ * parameter: { }
+ * @param parameter :
+  * @returns {*}
+ */
+export function exportSbInfoReportFeeYear (parameter) {
+  return axios({
+    url: '/report/repair/sbInfo/fee/export/year?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    responseType: 'blob'
+  })
+}
+
 /**
  * page func
  * parameter: { }

+ 2 - 0
src/router/generator-platform-routers.js

@@ -325,6 +325,8 @@ const constantRouterComponents = {
   'CheckJobReportWeek': () => import('@/views/dashboard/CheckJobReportWeek'), // 保养任务周工作负荷统计报表
   'RepairReport': () => import('@/views/dashboard/RepairReport'), // >24小时停机次数按月统计
   'RepairReportSbAll': () => import('@/views/dashboard/RepairReportSbAll'), // 设备故障次数按月统计
+  'RepairReportSbInfo': () => import('@/views/dashboard/RepairReportSbInfo'), // 设备维修报表
+  'RepairReportSbInfoFee': () => import('@/views/dashboard/RepairReportSbInfoFee'), // 设备维修费用报表
   'RepairReportMttr': () => import('@/views/dashboard/RepairReportMttr'), // MTTR月统计报表
   'RepairReportFee': () => import('@/views/dashboard/RepairReportFee') // 费用按月统计
 }

+ 57 - 1
src/views/check/checkstandard/CheckStandard.vue

@@ -19,6 +19,56 @@
                 <a-input v-model="queryParam.sbName" placeholder="请输入设备名称"/>
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="设备类型">
+                <a-tree-select
+                  style="width: 100%"
+                  :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
+                  :treeData="treeData"
+                  :treeNodeFilterProp="'title'"
+                  :showSearch="true"
+                  v-model="queryParam.typeId"
+                  placeholder="请选择"
+                >
+                </a-tree-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="设备等级">
+                <a-select v-model="queryParam.sbLevel" placeholder="请选择">
+                  <a-select-option
+                    v-for="(label,value) in sbLevelMap"
+                    :key="value"
+                    :label="label"
+                    :value="parseInt(value)">{{ label }}
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="维护等级">
+                <a-select v-model="queryParam.level" placeholder="请选择">
+                  <a-select-option
+                    v-for="(label,value) in levelMap"
+                    :key="value"
+                    :label="label"
+                    :value="parseInt(value)">{{ label }}
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="计划周期">
+                <a-select v-model="queryParam.periodType" placeholder="请选择">
+                  <a-select-option
+                    v-for="(label,value) in periodTypeMap"
+                    :key="value"
+                    :label="label"
+                    :value="parseInt(value)">{{ label }}
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
             <a-col :md="6 || 24" :sm="24">
               <span class="table-page-search-submitButtons">
                 <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
@@ -40,7 +90,7 @@
           <a-icon type="upload"/>
           新增导入
         </a-button>
-<!--        <a-button style="margin-left:8px;" type="primary" @click="doImportOldVersion">
+        <!--        <a-button style="margin-left:8px;" type="primary" @click="doImportOldVersion">
           <a-icon type="upload"/>
           老版本导入
         </a-button>-->
@@ -130,6 +180,7 @@ import {
   exportCheckStandard
 } from '@/api/check/checkstandard'
 import DetailStandardCheckJob from '@/views/check/checkjob/modules/DetailStandardCheckJob'
+import { fetchSbTypeTree } from '@/api/sb/type'
 
 export default {
   name: 'CheckStandardList',
@@ -257,6 +308,8 @@ export default {
       enableMap: {},
       periodTypeMap: {},
       levelMap: {},
+      sbLevelMap: {},
+      treeData: [],
       checkUserTypeMap: {},
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -296,6 +349,9 @@ export default {
     this.actionTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_ACTION_TYPE)
     this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_LEVEL)
     this.checkUserTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_USER_TYPE)
+    fetchSbTypeTree().then(res => {
+      this.treeData = res.data
+    })
     this.tableOption()
   },
   methods: {

+ 16 - 0
src/views/check/checkstandard/modules/DetailSbCheck.vue

@@ -32,6 +32,17 @@
         <a-icon type="delete"/>
         删除
       </a-button>
+      <a-form-item style="margin-left:8px;" label="维护等级">
+        <a-select v-model="queryParam.level" placeholder="请选择">
+          <a-select-option
+            v-for="(label,value) in levelMap"
+            :key="value"
+            :label="label"
+            @change="changeLevel"
+            :value="parseInt(value)">{{ label }}
+          </a-select-option>
+        </a-select>
+      </a-form-item>
       <!--      <a-button style="margin-left: 8px" type="primary" icon="download" @click="doExport">导出</a-button>-->
     </div>
     <a-table
@@ -227,6 +238,11 @@ export default {
         this.data = res.data
       })
     },
+    changeLevel (value) {
+      queryCheckStandard({ sbId: this.model.id, level: value, type: this.checkType }).then(res => {
+        this.data = res.data
+      })
+    },
     handleOk () {
       queryCheckStandard({ sbId: this.model.id, type: this.checkType }).then(res => {
         this.data = res.data

+ 42 - 8
src/views/dashboard/CheckJobReport.vue

@@ -21,14 +21,42 @@
             <a-button style="margin-left: 8px" type="default" @click="getData()">查询</a-button>
             <a-button style="margin-left: 8px" type="primary" icon="printer" @click="handlePrint()">打印</a-button>
             <a-button style="margin-left: 8px" type="primary" @click="doExport()">导出</a-button>
-            <a-select style="margin-left: 8px" @change="changeLevel" v-model="queryParam.standardLevel" placeholder="请选择">
-              <a-select-option
-                v-for="(label,value) in levelMap"
-                :key="value"
-                :label="label"
-                :value="parseInt(value)">{{ label }}
-              </a-select-option>
-            </a-select>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="设备类型">
+                <a-tree-select
+                  style="width: 100%"
+                  :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
+                  :treeData="treeData"
+                  :treeNodeFilterProp="'title'"
+                  :showSearch="true"
+                  v-model="queryParam.typeId"
+                  placeholder="请选择"
+                >
+                </a-tree-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="设备等级">
+                <a-select v-model="queryParam.sbLevel" placeholder="请选择">
+                  <a-select-option
+                    v-for="(label,value) in sbLevelMap"
+                    :key="value"
+                    :label="label"
+                    :value="parseInt(value)">{{ label }}
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-select style="margin-left: 8px" @change="changeLevel" v-model="queryParam.standardLevel" placeholder="请选择">
+                <a-select-option
+                  v-for="(label,value) in levelMap"
+                  :key="value"
+                  :label="label"
+                  :value="parseInt(value)">{{ label }}
+                </a-select-option>
+              </a-select>
+            </a-col>
           </div>
           <a-tab-pane loading="true" tab="图形统计" key="1">
             <a-row>
@@ -76,6 +104,7 @@ import { Chart } from '@antv/g2'
 import PrintInCheckJobReport from '@/views/dashboard/modules/PrintInCheckJobReport'
 import DetailCheckJobReport from '@/views/dashboard/modules/DetailCheckJobReport'
 import moment from 'moment'
+import { fetchSbTypeTree } from '@/api/sb/type'
 
 export default {
   name: 'Analysis',
@@ -94,6 +123,8 @@ export default {
     return {
       loading: false,
       serverData: [],
+      sbLevelMap: {},
+      treeData: [],
       monthFormat: 'YYYY-MM',
       defaultStartMonth: this.BaseTool.Moment().format(this.BaseTool.Date.PICKER_NORM_YEAR) + '-01',
       defaultEndMonth: this.BaseTool.Moment().format(this.BaseTool.Date.PICKER_NORM_YEAR) + '-12',
@@ -147,6 +178,9 @@ export default {
   },
   created () {
     this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_LEVEL)
+    fetchSbTypeTree().then(res => {
+      this.treeData = res.data
+    })
   },
   mounted () {
     this.$nextTick(function () {

+ 274 - 0
src/views/dashboard/RepairReportSbInfo.vue

@@ -0,0 +1,274 @@
+<template>
+  <div class="page-header-index-wide">
+    <a-card :title="title" :loading="loading" v-show="visible" :bordered="false" :body-style="{padding: '0'}">
+      <div class="salesCard">
+        <a-tabs default-active-key="1" size="large" :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}">
+          <div class="extra-wrapper" slot="tabBarExtraContent">
+            <a-button style="margin-left: 8px" type="default" @click="getData()">查询</a-button>
+            <a-button style="margin-left: 8px" type="primary" icon="printer" @click="handlePrint()">打印</a-button>
+            <a-button style="margin-left: 8px" type="primary" @click="doExport()">导出</a-button>
+            <a-button style="margin-left: 8px" type="primary" @click="handleCancel()">返回</a-button>
+          </div>
+          <a-tab-pane loading="true" tab="图形统计" key="1">
+            <a-row>
+              <a-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
+                <div style="padding: 10px">
+                  <div id="container" style="width: 100%;overflow-x:auto"></div>
+                </div>
+              </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">
+                <div style="padding: 10px">
+                  <a-table
+                    bordered
+                    :data-source="tableData"
+                    :columns="columns"
+                    tableLayout="auto"
+                    :scroll="{x: 1, y: BaseTool.Constant.scrollY }"
+                    rowKey="month">
+                    <span slot="action" slot-scope="record">
+                      <template>
+                        <a @click="handleView(record)">查看明细</a>
+                        <a-divider type="vertical" />
+                        <a @click="doExportDetail(record)">导出</a>
+                      </template>
+                    </span>
+                  </a-table>
+                </div>
+              </a-col>
+            </a-row>
+          </a-tab-pane>
+        </a-tabs>
+      </div>
+    </a-card>
+    <print-in-repair-report ref="basePrintModal" @ok="handleOk"/>
+    <detail-repair-report ref="detailModal" @ok="handleOk"/>
+  </div>
+</template>
+
+<script>
+import { getSbInfoReport, exportSbInfoReport, exportSbInfoReportYear } from '@/api/report/application-form'
+import { Chart } from '@antv/g2'
+import PrintInRepairReport from '@/views/dashboard/modules/PrintInRepairReport'
+import DetailRepairReport from '@/views/dashboard/modules/DetailRepairReport'
+import moment from 'moment'
+// const DataSet = require('@antv/data-set')
+export default {
+  name: 'RepairReportSbInfo',
+  components: {
+    PrintInRepairReport,
+    Chart,
+    DetailRepairReport
+  },
+  props: {
+    sbId: {
+      type: String,
+      default: null
+    },
+    title: {
+      type: String,
+      default: '设备维修分析'
+    }
+  },
+  data () {
+    return {
+      loading: false,
+      serverData: [],
+      monthFormat: 'YYYY-MM',
+      queryParam: {
+        // year: 2021,
+        sbId: this.sbId
+      },
+      visible: false,
+      chart: null, // 创建一个chart变量
+      chartsData: [],
+      tableData: [],
+      categoryMap: {},
+      fields: [],
+      // 表头
+      columns: [
+        {
+          title: '年份',
+          width: 180,
+          dataIndex: 'year'
+        },
+        {
+          title: '工单次数',
+          width: 120,
+          dataIndex: 'num'
+        },
+        {
+          title: '工单类型',
+          width: 120,
+          dataIndex: 'category',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.categoryMap, text)
+          }
+        },
+        {
+          title: '寿命',
+          width: 120,
+          dataIndex: 'workYear'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          width: '200px',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ]
+    }
+  },
+  created () {
+    this.categoryMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
+  },
+  mounted () {
+    /* this.$nextTick(function () {
+      this.getData()
+    }) */
+  },
+  methods: {
+    moment,
+    base () {
+      this.visible = true
+      this.getData()
+    },
+    onStartChange (date, dateString) {
+      this.queryParam.startMonth = this.BaseTool.Date.formatter(dateString + '-01', this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+    },
+    onEndChange (date, dateString) {
+      this.queryParam.endMonth = this.BaseTool.Date.formatter(dateString + '-01', this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+    },
+    getData () {
+      getSbInfoReport(this.queryParam)
+        .then(res => {
+          this.chartsData = res.data.data
+          this.tableData = res.data.dataTable
+
+          // 需要将数据分组:总数,完成数
+          /*  const groupData = []
+          this.tableData.forEach(function (data) {
+            groupData.push({ name: '总数', year: data.year + '', num: data.num })
+            groupData.push({ name: '计划数', year: data.year + '', num: data.planNum })
+            groupData.push({ name: '非计划数', year: data.year + '', num: data.notPlanNum })
+          }) */
+          this.tableData.forEach(function (data) {
+            data.year = data.year + ''
+          })
+          this.getCharts('container', this.tableData)// 调用统计图
+        })
+    },
+    getCharts (id, data) {
+      this.chart && this.chart.destroy()// 防止点击搜索按钮新增一个
+      this.chart = new Chart({
+        container: 'container',
+        autoFit: true,
+        height: 400
+      })
+      this.chart.data(data)
+      this.chart.scale('num', {
+        nice: true
+      })
+      this.chart.tooltip({
+        showMarkers: false,
+        shared: true
+      })
+      this.chart.interval().position('year*num').color('name').adjust([
+        {
+          type: 'dodge',
+          marginRatio: 0
+        }
+      ])
+      this.chart.interaction('active-region')
+      this.chart.legend({
+        position: 'bottom'
+      })
+      this.chart.render()
+    },
+    doExport () {
+      const parameter = {
+        ...this.queryParam
+      }
+      exportSbInfoReport(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    },
+    doExportDetail (record) {
+      const parameter = {
+        ...this.queryParam,
+        year: record.year,
+        category: record.category
+      }
+      exportSbInfoReportYear(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    },
+    handlePrint (record) {
+      const modal = this.$refs.basePrintModal
+      this.visible = false
+      modal.base({ startMonth: this.queryParam.startMonth, endMonth: this.queryParam.endMonth, title: this.title, data: this.chartsData })
+    },
+    handleView (record) {
+      const modal = this.$refs.detailModal
+      modal.base(record)
+    },
+    handleOk () {
+      this.visible = true
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+      this.$emit('ok')
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+.extra-wrapper {
+  line-height: 55px;
+  padding-right: 24px;
+
+  .extra-item {
+    display: inline-block;
+    margin-right: 24px;
+
+    a {
+      margin-left: 24px;
+    }
+  }
+}
+
+.antd-pro-pages-dashboard-analysis-twoColLayout {
+  position: relative;
+  display: flex;
+  display: block;
+  flex-flow: row wrap;
+}
+
+.antd-pro-pages-dashboard-analysis-salesCard {
+  height: calc(100% - 24px);
+  /deep/ .ant-card-head {
+    position: relative;
+  }
+}
+
+.dashboard-analysis-iconGroup {
+  i {
+    margin-left: 16px;
+    color: rgba(0,0,0,.45);
+    cursor: pointer;
+    transition: color .32s;
+    color: black;
+  }
+}
+.analysis-salesTypeRadio {
+  position: absolute;
+  right: 54px;
+  bottom: 12px;
+}
+</style>

+ 274 - 0
src/views/dashboard/RepairReportSbInfoFee.vue

@@ -0,0 +1,274 @@
+<template>
+  <div class="page-header-index-wide">
+    <a-card :title="title" :loading="loading" v-show="visible" :bordered="false" :body-style="{padding: '0'}">
+      <div class="salesCard">
+        <a-tabs default-active-key="1" size="large" :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}">
+          <div class="extra-wrapper" slot="tabBarExtraContent">
+            <a-button style="margin-left: 8px" type="default" @click="getData()">查询</a-button>
+            <a-button style="margin-left: 8px" type="primary" icon="printer" @click="handlePrint()">打印</a-button>
+            <a-button style="margin-left: 8px" type="primary" @click="doExport()">导出</a-button>
+            <a-button style="margin-left: 8px" type="primary" @click="handleCancel()">返回</a-button>
+          </div>
+          <a-tab-pane loading="true" tab="图形统计" key="1">
+            <a-row>
+              <a-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
+                <div style="padding: 10px">
+                  <div id="container" style="width: 100%;overflow-x:auto"></div>
+                </div>
+              </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">
+                <div style="padding: 10px">
+                  <a-table
+                    bordered
+                    :data-source="tableData"
+                    :columns="columns"
+                    tableLayout="auto"
+                    :scroll="{x: 1, y: BaseTool.Constant.scrollY }"
+                    rowKey="month">
+                    <span slot="action" slot-scope="record">
+                      <template>
+                        <a @click="handleView(record)">查看明细</a>
+                        <a-divider type="vertical" />
+                        <a @click="doExportDetail(record)">导出</a>
+                      </template>
+                    </span>
+                  </a-table>
+                </div>
+              </a-col>
+            </a-row>
+          </a-tab-pane>
+        </a-tabs>
+      </div>
+    </a-card>
+    <print-in-repair-report ref="basePrintModal" @ok="handleOk"/>
+    <detail-repair-report ref="detailModal" @ok="handleOk"/>
+  </div>
+</template>
+
+<script>
+import { getSbInfoReportFee, exportSbInfoReportFee, exportSbInfoReportFeeYear } from '@/api/report/application-form'
+import { Chart } from '@antv/g2'
+import PrintInRepairReport from '@/views/dashboard/modules/PrintInRepairReport'
+import DetailRepairReport from '@/views/dashboard/modules/DetailRepairReport'
+import moment from 'moment'
+// const DataSet = require('@antv/data-set')
+export default {
+  name: 'RepairReportSbInfoFee',
+  components: {
+    PrintInRepairReport,
+    Chart,
+    DetailRepairReport
+  },
+  props: {
+    sbId: {
+      type: String,
+      default: null
+    },
+    title: {
+      type: String,
+      default: '设备费用分析'
+    }
+  },
+  data () {
+    return {
+      loading: false,
+      serverData: [],
+      monthFormat: 'YYYY-MM',
+      queryParam: {
+        // year: 2021,
+        sbId: this.sbId
+      },
+      visible: false,
+      chart: null, // 创建一个chart变量
+      chartsData: [],
+      typeMap: {},
+      tableData: [],
+      fields: [],
+      // 表头
+      columns: [
+        {
+          title: '年份',
+          width: 180,
+          dataIndex: 'year'
+        },
+        {
+          title: '费用次数',
+          width: 120,
+          dataIndex: 'num'
+        },
+        {
+          title: '费用类型',
+          width: 120,
+          dataIndex: 'type',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.typeMap, text)
+          }
+        },
+        {
+          title: '寿命',
+          width: 120,
+          dataIndex: 'workYear'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          width: '200px',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ]
+    }
+  },
+  created () {
+    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FEE_TYPE)
+  },
+  mounted () {
+    /* this.$nextTick(function () {
+      this.getData()
+    }) */
+  },
+  methods: {
+    moment,
+    base () {
+      this.visible = true
+      this.getData()
+    },
+    onStartChange (date, dateString) {
+      this.queryParam.startMonth = this.BaseTool.Date.formatter(dateString + '-01', this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+    },
+    onEndChange (date, dateString) {
+      this.queryParam.endMonth = this.BaseTool.Date.formatter(dateString + '-01', this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+    },
+    getData () {
+      getSbInfoReportFee(this.queryParam)
+        .then(res => {
+          this.chartsData = res.data.data
+          this.tableData = res.data.dataTable
+
+          // 需要将数据分组:总数,完成数
+          /*  const groupData = []
+          this.tableData.forEach(function (data) {
+            groupData.push({ name: '总数', year: data.year + '', num: data.num })
+            groupData.push({ name: '计划数', year: data.year + '', num: data.planNum })
+            groupData.push({ name: '非计划数', year: data.year + '', num: data.notPlanNum })
+          }) */
+          this.tableData.forEach(function (data) {
+            data.year = data.year + ''
+          })
+          this.getCharts('container', this.tableData)// 调用统计图
+        })
+    },
+    getCharts (id, data) {
+      this.chart && this.chart.destroy()// 防止点击搜索按钮新增一个
+      this.chart = new Chart({
+        container: 'container',
+        autoFit: true,
+        height: 400
+      })
+      this.chart.data(data)
+      this.chart.scale('num', {
+        nice: true
+      })
+      this.chart.tooltip({
+        showMarkers: false,
+        shared: true
+      })
+      this.chart.interval().position('year*num').color('name').adjust([
+        {
+          type: 'dodge',
+          marginRatio: 0
+        }
+      ])
+      this.chart.interaction('active-region')
+      this.chart.legend({
+        position: 'bottom'
+      })
+      this.chart.render()
+    },
+    doExport () {
+      const parameter = {
+        ...this.queryParam
+      }
+      exportSbInfoReportFee(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    },
+    doExportDetail (record) {
+      const parameter = {
+        ...this.queryParam,
+        year: record.year,
+        type: record.type
+      }
+      exportSbInfoReportFeeYear(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    },
+    handlePrint (record) {
+      const modal = this.$refs.basePrintModal
+      this.visible = false
+      modal.base({ startMonth: this.queryParam.startMonth, endMonth: this.queryParam.endMonth, title: this.title, data: this.chartsData })
+    },
+    handleView (record) {
+      const modal = this.$refs.detailModal
+      modal.base(record)
+    },
+    handleOk () {
+      this.visible = true
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+      this.$emit('ok')
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+.extra-wrapper {
+  line-height: 55px;
+  padding-right: 24px;
+
+  .extra-item {
+    display: inline-block;
+    margin-right: 24px;
+
+    a {
+      margin-left: 24px;
+    }
+  }
+}
+
+.antd-pro-pages-dashboard-analysis-twoColLayout {
+  position: relative;
+  display: flex;
+  display: block;
+  flex-flow: row wrap;
+}
+
+.antd-pro-pages-dashboard-analysis-salesCard {
+  height: calc(100% - 24px);
+  /deep/ .ant-card-head {
+    position: relative;
+  }
+}
+
+.dashboard-analysis-iconGroup {
+  i {
+    margin-left: 16px;
+    color: rgba(0,0,0,.45);
+    cursor: pointer;
+    transition: color .32s;
+    color: black;
+  }
+}
+.analysis-salesTypeRadio {
+  position: absolute;
+  right: 54px;
+  bottom: 12px;
+}
+</style>

+ 304 - 305
src/views/purchase/supplier-goods-list/modules/SupplierGoodsListSelectModal.vue

@@ -1,321 +1,320 @@
 <template>
-    <a-modal
-            :title="modalTitle"
-            :width="1000"
-            :visible="visible"
-            :confirmLoading="confirmLoading"
-            class="ant-modal2"
-            @cancel="handleCancel"
-    >
-        <a-card :bordered="false">
-            <div class="table-page-search-wrapper">
-                <a-form layout="inline">
-                    <a-row :gutter="48">
-                        <a-col :md="8" :sm="24">
-                            <a-form-item label="关键字">
-                                <a-input v-model="queryParam.keyword" placeholder="请输入名称/类型名称"/>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :md="8 || 24" :sm="24">
-                <span class="table-page-search-submitButtons">
-                  <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
-                  <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
-                </span>
-                        </a-col>
-                    </a-row>
-                </a-form>
-            </div>
+  <a-modal
+    :title="modalTitle"
+    :width="1000"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    class="ant-modal2"
+    @cancel="handleCancel"
+  >
+    <a-card :bordered="false">
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline">
+          <a-row :gutter="48">
+            <a-col :md="8" :sm="24">
+              <a-form-item label="关键字">
+                <a-input v-model="queryParam.keyword" placeholder="请输入名称/类型名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="8 || 24" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
 
-            <div class="table-operator">
-            </div>
+      <div class="table-operator">
+      </div>
 
-            <s-table
-                    ref="table"
-                    size="default"
-                    rowKey="id"
-                    :columns="columns"
-                    :data="loadData"
-                    :alert="options.alert"
-                    :customRow="options.customRow"
-                    :rowSelection="options.rowSelection"
-                    showPagination="auto"
-            >
-                <span slot="action" slot-scope="record1">
-                  <template>
-                    <a @click="handleView(record1)">查看</a>
-                  </template>
-                </span>
-            </s-table>
-            <detail ref="detailModal"/>
-        </a-card>
-        <template slot="footer">
-            <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">取消</a-button>
-            <a-button :loading="confirmLoading" type="primary" @click="handleSelect()">确定</a-button>
-        </template>
-    </a-modal>
+      <s-table
+        ref="table"
+        size="default"
+        rowKey="id"
+        :columns="columns"
+        :data="loadData"
+        :alert="options.alert"
+        :customRow="options.customRow"
+        :rowSelection="options.rowSelection"
+        showPagination="auto"
+      >
+        <span slot="action" slot-scope="record1">
+          <template>
+            <a @click="handleView(record1)">查看</a>
+          </template>
+        </span>
+      </s-table>
+      <detail ref="detailModal"/>
+    </a-card>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">取消</a-button>
+      <a-button :loading="confirmLoading" type="primary" @click="handleSelect()">确定</a-button>
+    </template>
+  </a-modal>
 </template>
 
 <script>
-    import { STable, Ellipsis } from '@/components'
-    import Detail from './Detail'
-    import { getSupplierGoodsListPage, fetchSupplierGoodsList } from '@/api/purchase/supplier-goods-list'
+import { STable, Ellipsis } from '@/components'
+import Detail from './Detail'
+import { getSupplierGoodsListPage, fetchSupplierGoodsList } from '@/api/purchase/supplier-goods-list'
 
-    export default {
-        name: 'SupplierGoodsListSelectModal',
-        components: {
-            STable,
-            Ellipsis,
-            Detail
+export default {
+  name: 'SupplierGoodsListSelectModal',
+  components: {
+    STable,
+    Ellipsis,
+    Detail
+  },
+  props: {
+    type: {
+      type: String,
+      default: 'radio'
+    },
+    selectedRowKey: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+    selectedRow: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    }
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      visible: false,
+      record: null,
+      // 查询参数
+      queryParam: {
+      },
+      extraQueryParam: {
+      },
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
         },
-        props: {
-            type: {
-                type: String,
-                default: 'radio'
-            },
-            selectedRowKey: {
-                type: Array,
-                default: () => {
-                    return []
-                }
-            },
-            selectedRow: {
-                type: Array,
-                default: () => {
-                    return []
-                }
-            }
+        {
+          title: '供应商主键',
+          dataIndex: 'supplierId'
         },
-        data () {
-            return {
-                confirmLoading: false,
-                mdl: {},
-                modalTitle: null,
-                visible: false,
-                record: null,
-                // 查询参数
-                queryParam: {
-                },
-                extraQueryParam: {
-                },
-                // 表头
-                columns: [
-                    {
-                        title: '序号',
-                        dataIndex: 'index',
-                        customRender: (text, record, index) => {
-                            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
-                        }
-                    },
-                                                                                                                                                {
-                                title: '供应商主键',
-                                dataIndex: 'supplierId'
-                            },
-                                                                                                                                                        {
-                                title: '供应商名称',
-                                dataIndex: 'supplierName'
-                            },
-                                                                                                                                                        {
-                                title: '编号',
-                                dataIndex: 'no'
-                            },
-                                                                                                                                                            {
-                                    title: '类别',
-                                    dataIndex: 'type',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Object.getField(this.typeMap, text)
-                                    }                  ,
-                                },
-                                                                                                                                                        {
-                                title: '名称',
-                                dataIndex: 'name'
-                            },
-                                                                                                                                                        {
-                                title: '规格',
-                                dataIndex: 'specs'
-                            },
-                                                                                                                                                            {
-                                    title: '单位',
-                                    dataIndex: 'unit',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Object.getField(this.unitMap, text)
-                                    }                  ,
-                                },
-                                                                                                                                                            {
-                                    title: '单价',
-                                    dataIndex: 'price',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Amount.formatter(text)
-                                    }                                ,
-                                },
-                                                                                                                                                            {
-                                    title: '库存',
-                                    dataIndex: 'stock',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Amount.formatter(text)
-                                    }                                ,
-                                },
-                                                                                                                                                        {
-                                title: '删除标志',
-                                dataIndex: 'delFlag'
-                            },
-                                                                                                                                                                                                    {
-                                title: '创建人名称',
-                                dataIndex: 'createdUserName'
-                            },
-                                                                                                                                                        {
-                                title: '创建时间',
-                                dataIndex: 'createdTime'
-                            },
-                                                                                                                                                                                                                                {
-                        title: '操作',
-                        key: 'action',
-                        width: '200px',
-                        align: 'center',
-                        scopedSlots: { customRender: 'action' }
-                    }
-                ],
-                // 下拉框map
-                                    typeMap: {},
-                                    unitMap: {},
-                                // 加载数据方法 必须为 Promise 对象
-                loadData: parameter => {
-                    parameter = {
-                        ...parameter,
-                        ...this.queryParam,
-                        ...this.extraQueryParam,
-                        dataScope: {
-                            sortBy: 'desc',
-                            sortName: 'update_time'
-                        }
-                    }
-                    return getSupplierGoodsListPage(Object.assign(parameter, this.queryParam))
-                            .then(res => {
-                                return res.data
-                            })
-                },
-                selectedRowKeys: [],
-                selectedRows: [],
+        {
+          title: '供应商名称',
+          dataIndex: 'supplierName'
+        },
+        {
+          title: '编号',
+          dataIndex: 'no'
+        },
+        {
+          title: '类别',
+          dataIndex: 'type',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.typeMap, text)
+          }
+        },
+        {
+          title: '名称',
+          dataIndex: 'name'
+        },
+        {
+          title: '规格',
+          dataIndex: 'specs'
+        },
+        {
+          title: '单位',
+          dataIndex: 'unit',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.unitMap, text)
+          }
+        },
+        {
+          title: '单价',
+          dataIndex: 'price',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '库存',
+          dataIndex: 'stock',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '删除标志',
+          dataIndex: 'delFlag'
+        },
+        {
+          title: '创建人名称',
+          dataIndex: 'createdUserName'
+        },
+        {
+          title: '创建时间',
+          dataIndex: 'createdTime'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          width: '200px',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 下拉框map
+      typeMap: {},
+      unitMap: {},
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          ...this.queryParam,
+          ...this.extraQueryParam,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
+          }
+        }
+        return getSupplierGoodsListPage(Object.assign(parameter, this.queryParam))
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
 
-                options: {
-                    alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
-                    rowSelection: {
-                        selectedRowKeys: this.selectedRowKeys,
-                        onChange: this.onSelectChange
-                    }
+      options: {
+        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      optionAlertShow: false,
+      isCreated: false
+    }
+  },
+  created () {
+    // 下拉框map
+    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SUPPLIER_GOODS_LIST_TYPE)
+    this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SUPPLIER_GOODS_LIST_UNIT)
+  },
+  methods: {
+    tableOption () {
+      if (!this.optionAlertShow) {
+        this.options = {
+          alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+          rowSelection: {
+            selectedRowKeys: this.selectedRowKeys,
+            onChange: this.onSelectChange,
+            type: this.type,
+            getCheckboxProps: record => ({
+              props: {
+                disabled: false,
+                name: record.id
+              }
+            })
+          },
+          customRow: (record) => {
+            return {
+              on: { // 事件
+                click: (event) => { // 点击行
+                  // 选择对象
+                  this.mySelect([record.id], [record])
                 },
-                optionAlertShow: false,
-                isCreated: false
-            }
-        },
-        created () {
-            // 下拉框map
-                            this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SUPPLIER_GOODS_LIST_TYPE)
-                            this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SUPPLIER_GOODS_LIST_UNIT)
-                    },
-        methods: {
-            tableOption () {
-                if (!this.optionAlertShow) {
-                    this.options = {
-                        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
-                        rowSelection: {
-                            selectedRowKeys: this.selectedRowKeys,
-                            onChange: this.onSelectChange,
-                            type: this.type,
-                            getCheckboxProps: record => ({
-                                props: {
-                                    disabled: false,
-                                    name: record.id
-                                }
-                            })
-                        },
-                        customRow: (record) => {
-                            return {
-                                on: { // 事件
-                                    click: (event) => { // 点击行
-                                        // 选择对象
-                                        this.mySelect([record.id], [record])
-                                    },
-                                    dblclick: (event) => {
-                                        this.mySelect([record.id], [record])
-                                        this.handleSelect()
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    this.optionAlertShow = true
-                } else {
-                    this.options = {
-                        alert: false,
-                        rowSelection: null
-                    }
-                    this.optionAlertShow = false
-                }
-            },
-            handleView (record) {
-                fetchSupplierGoodsList({ id: record.id }).then(res => {
-                    const modal = this.$refs.detailModal
-                    modal.base(res.data)
-                })
-            },
-            handleOk () {
-                this.$refs.table.refresh()
-            },
-            onSelectChange (selectedRowKeys, selectedRows) {
-                this.selectedRowKeys = selectedRowKeys
-                this.selectedRows = selectedRows
-            },
-            resetSearchForm () {
-                this.queryParam = {
-                }
-                this.$refs.table.refresh(true)
-            },
-            base (record, queryParam = {}) {
-                this.visible = true
-                this.modalTitle = '选择信息'
-                this.extraQueryParam = queryParam
-                this.record = record
-                if (this.isCreated) {
-                    this.$refs.table.clearSelected()
-                    this.options.rowSelection.type = this.type
-                    this.handleOk()
-                } else {
-                    this.tableOption()
-                    this.isCreated = true
-                }
-            },
-            handleCancel () {
-                this.visible = false
-                this.confirmLoading = false
-            },
-            handleSelect () {
-                if (this.selectedRowKeys.length === 0) {
-                    this.$message.warn('请至少选择一项信息')
-                } else {
-                    this.confirmLoading = true
-                    this.$emit('selected', this.record, this.selectedRowKeys, this.selectedRows)
-                    this.confirmLoading = false
-                    this.visible = false
+                dblclick: (event) => {
+                  this.mySelect([record.id], [record])
+                  this.handleSelect()
                 }
-            },
-            mySelect(selectedRowKeys, selectedRows) {
-                if (this.type === 'radio') {
-                    this.$refs.table.updateSelect(selectedRowKeys, selectedRows)
-                            this.$refs.table.rowSelection.onChange(selectedRowKeys, selectedRows)
-                } else {
-                    let mySelectedRowKeys
-                    let mySelectedRows = this.selectedRows.filter(item => item.id !== selectedRowKeys[0])
-                    if (this.selectedRowKeys.includes(selectedRowKeys[0])) {
-                        mySelectedRowKeys = this.selectedRowKeys.filter(item => item !== selectedRowKeys[0])
-                    } else {
-                        mySelectedRowKeys = [...selectedRowKeys, ...this.selectedRowKeys]
-                        mySelectedRows = [...mySelectedRows, ...selectedRows]
-                    }
-                    this.$refs.table.updateSelect(mySelectedRowKeys, mySelectedRows)
-                            this.$refs.table.rowSelection.onChange(mySelectedRowKeys, mySelectedRows)
-                }
-
+              }
             }
+          }
+        }
+        this.optionAlertShow = true
+      } else {
+        this.options = {
+          alert: false,
+          rowSelection: null
+        }
+        this.optionAlertShow = false
+      }
+    },
+    handleView (record) {
+      fetchSupplierGoodsList({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    handleOk () {
+      this.$refs.table.refresh()
+    },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    resetSearchForm () {
+      this.queryParam = {
+      }
+      this.$refs.table.refresh(true)
+    },
+    base (record, queryParam = {}) {
+      this.visible = true
+      this.modalTitle = '选择信息'
+      this.extraQueryParam = queryParam
+      this.record = record
+      if (this.isCreated) {
+        this.$refs.table.clearSelected()
+        this.options.rowSelection.type = this.type
+        this.handleOk()
+      } else {
+        this.tableOption()
+        this.isCreated = true
+      }
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+    },
+    handleSelect () {
+      if (this.selectedRowKeys.length === 0) {
+        this.$message.warn('请至少选择一项信息')
+      } else {
+        this.confirmLoading = true
+        this.$emit('selected', this.record, this.selectedRowKeys, this.selectedRows)
+        this.confirmLoading = false
+        this.visible = false
+      }
+    },
+    mySelect (selectedRowKeys, selectedRows) {
+      if (this.type === 'radio') {
+        this.$refs.table.updateSelect(selectedRowKeys, selectedRows)
+        this.$refs.table.rowSelection.onChange(selectedRowKeys, selectedRows)
+      } else {
+        let mySelectedRowKeys
+        let mySelectedRows = this.selectedRows.filter(item => item.id !== selectedRowKeys[0])
+        if (this.selectedRowKeys.includes(selectedRowKeys[0])) {
+          mySelectedRowKeys = this.selectedRowKeys.filter(item => item !== selectedRowKeys[0])
+        } else {
+          mySelectedRowKeys = [...selectedRowKeys, ...this.selectedRowKeys]
+          mySelectedRows = [...mySelectedRows, ...selectedRows]
         }
+        this.$refs.table.updateSelect(mySelectedRowKeys, mySelectedRows)
+        this.$refs.table.rowSelection.onChange(mySelectedRowKeys, mySelectedRows)
+      }
     }
+  }
+}
 </script>

+ 15 - 3
src/views/repair/application-form/RepairApplicationForm.vue

@@ -29,6 +29,18 @@
                 <a-input v-model="queryParam.content" placeholder="问题描述模糊查询"/>
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="状态">
+                <a-select v-model="queryParam.category" placeholder="请选择">
+                  <a-select-option
+                    v-for="(label,value) in categoryMap"
+                    :key="value"
+                    :label="label"
+                    :value="parseInt(value)">{{ label }}
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="状态">
                 <a-select v-model="queryParam.status" placeholder="请选择">
@@ -213,7 +225,7 @@ export default {
           width: '100px',
           dataIndex: 'category',
           customRender: (text, record, index) => {
-            return this.BaseTool.Object.getField(this.planFlagMap, text)
+            return this.BaseTool.Object.getField(this.categoryMap, text)
           }
         },
         {
@@ -293,7 +305,7 @@ export default {
       levelMap: {},
       statusMap: {},
       needStopMap: {},
-      planFlagMap: {},
+      categoryMap: {},
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         parameter = {
@@ -329,7 +341,7 @@ export default {
     this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL)
     this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
     this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
-    this.planFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
+    this.categoryMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
     // 获取浏览器的请求参数:报修单编号:no
     const no = this.$route.query.no
     if (no != null) {

+ 3 - 3
src/views/repair/application-form/modules/BaseForm.vue

@@ -46,7 +46,7 @@
           >
             <a-select @change="changePlanFlag" v-decorator="['category', {rules: [{required: true, message: '计划性维修不能为空'}]}]" placeholder="请选择">
               <a-select-option
-                v-for="(label,value) in planFlagMap"
+                v-for="(label,value) in categoryMap"
                 :key="value"
                 :label="label"
                 :value="parseInt(value)">{{ label }}
@@ -269,7 +269,7 @@ export default {
       needStop: null,
       needStopMap: {},
       category: 0,
-      planFlagMap: {},
+      categoryMap: {},
       statusMap: {},
       userInfo: this.$store.getters.userInfo,
       userList: [],
@@ -298,7 +298,7 @@ export default {
     this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
     this.questionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_QUESTION)
     this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
-    this.planFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
+    this.categoryMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
     this.getUsers()
   },
   methods: {

+ 49 - 0
src/views/repair/fee/RepairFee.vue

@@ -8,6 +8,54 @@
               <a-input v-model="queryParam.keyword" placeholder="请输入名称/类型名称"/>
             </a-form-item>
           </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="设备新号">
+              <a-input v-model="queryParam.sbNo" placeholder="请输入设备新号"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="设备名称">
+              <a-input v-model="queryParam.sbName" placeholder="请输入设备名称"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="设备类型">
+              <a-tree-select
+                style="width: 100%"
+                :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
+                :treeData="treeData"
+                :treeNodeFilterProp="'title'"
+                :showSearch="true"
+                v-model="queryParam.typeId"
+                placeholder="请选择"
+              >
+              </a-tree-select>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="设备等级">
+              <a-select v-model="queryParam.sbLevel" placeholder="请选择">
+                <a-select-option
+                  v-for="(label,value) in sbLevelMap"
+                  :key="value"
+                  :label="label"
+                  :value="parseInt(value)">{{ label }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="维修类别">
+              <a-select v-model="queryParam.category" placeholder="请选择">
+                <a-select-option
+                  v-for="(label,value) in categoryMap"
+                  :key="value"
+                  :label="label"
+                  :value="parseInt(value)">{{ label }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
           <a-col :md="8 || 24" :sm="24">
             <span class="table-page-search-submitButtons">
               <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
@@ -80,6 +128,7 @@ export default {
       queryParam: {
       },
       moneyTypeMap: {},
+      categoryMap: {},
       // 表头
       columns: [
         {

+ 70 - 9
src/views/sb/info/SbInfo.vue

@@ -18,12 +18,68 @@
               <a-row :gutter="48">
                 <a-col :md="6" :sm="24">
                   <a-form-item label="关键字">
-                    <a-input v-model="queryParam.keyword" placeholder="请输入名称/设备新号"/>
+                    <a-input v-model="queryParam.keyword" placeholder="名称/设备新号"/>
                   </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="24">
                   <a-form-item label="设备旧号">
-                    <a-input v-model="queryParam.zbh" placeholder="请输入设备旧号"/>
+                    <a-input v-model="queryParam.zbh" placeholder="设备旧号"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="第一维修人">
+                    <a-input v-model="queryParam.repairUserName" placeholder="第一维修人"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="第二维修人">
+                    <a-input v-model="queryParam.repairUserSecondName" placeholder="第二维修人"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="设备等级">
+                    <a-select v-model="queryParam.level" placeholder="请选择">
+                      <a-select-option
+                        v-for="(label,value) in levelMap"
+                        :key="value"
+                        :label="label"
+                        :value="parseInt(value)">{{ label }}
+                      </a-select-option>
+                    </a-select>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="自定义类型">
+                    <a-select v-model="queryParam.useType" placeholder="请选择">
+                      <a-select-option
+                        v-for="(label,value) in useTypeMap"
+                        :key="value"
+                        :label="label"
+                        :value="parseInt(value)">{{ label }}
+                      </a-select-option>
+                    </a-select>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="规格型号">
+                    <a-input v-model="queryParam.model" placeholder="规格型号"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="所属车间">
+                    <a-select v-model="queryParam.positionId" placeholder="请选择">
+                      <a-select-option
+                        v-for="({id,name}) in sbPositionData"
+                        :key="id"
+                        :label="name"
+                        :value="id">{{ name }}
+                      </a-select-option>
+                    </a-select>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="生产商">
+                    <a-input v-model="queryParam.producerName" placeholder="生产商名称"/>
                   </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="24">
@@ -46,6 +102,7 @@
                       <a-select-option
                         v-for="(label,value) in statusMap"
                         :key="value"
+                        :defaultValue="DictCache.VALUE.SB_INFO_STATUS.IN_USE"
                         :label="label"
                         :value="parseInt(value)">{{ label }}
                       </a-select-option>
@@ -176,7 +233,7 @@ import BaseFormStatusLog from '@/views/sb/status-log/modules/BaseForm'
 import Detail from './modules/Detail'
 import DownloadModal from '@/views/download/DownloadModal'
 import PreviewModal from '@/views/preview/PreviewModal'
-import { updateSbInfoStatus, getSbInfoPage, deleteSbInfos, fetchSbInfo, fetchSbInfos, exportSbInfo } from '@/api/sb/info'
+import { getSbInfoPage, deleteSbInfos, fetchSbInfo, fetchSbInfos, exportSbInfo } from '@/api/sb/info'
 import { queryDept } from '@/api/upms/dept'
 import { generateSbCodeAll } from '@/api/upms/code'
 import { fetchSbTypeTree } from '@/api/sb/type'
@@ -184,6 +241,7 @@ import ImportFormAdd from './modules/ImportFormAdd'
 import ImportFormUpdate from './modules/ImportFormUpdate'
 import PrintSbCode from '@/views/sb/info/modules/PrintSbCode'
 import PrintInSbInfoBatch from '@/views/sb/info/modules/PrintInSbInfoBatch'
+import { querySbPosition } from '@/api/sb/position'
 
 export default {
   name: 'SbInfoList',
@@ -219,6 +277,7 @@ export default {
       },
       depreciationTypeMap: {},
       visible: true,
+      sbPositionData: [],
       levelMap: {},
       unitMap: {},
       areaList: {},
@@ -309,13 +368,13 @@ export default {
           dataIndex: 'repairUserNameSecond'
         },
         {
-          title: '使用位置',
+          title: '所属车间',
           checked: true,
           width: 200,
-          dataIndex: 'cph'
+          dataIndex: 'positionName'
         },
         {
-          title: '使用部门',
+          title: '使用机台',
           checked: true,
           width: 200,
           dataIndex: 'saveUserName'
@@ -326,7 +385,6 @@ export default {
           width: 120,
           checked: true
         },
-
         {
           title: '大小尺寸',
           dataIndex: 'zz',
@@ -388,7 +446,7 @@ export default {
           width: 120,
           checked: true
         },
-        {
+        /* {
           title: '检定日期',
           dataIndex: 'checkDate',
           width: 150,
@@ -425,7 +483,7 @@ export default {
               return this.BaseTool.Date.getCountBetween(new Date(), record.nextCheckDate, 1) + '天'
             }
           }
-        },
+        }, */
         {
           title: '状态',
           checked: true,
@@ -482,6 +540,9 @@ export default {
     this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
     this.isChildMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_CHILD)
     this.isShowMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_SHOW)
+    querySbPosition().then(res => {
+      this.sbPositionData = res.data
+    })
   },
   methods: {
     tableOption () {

+ 2 - 2
src/views/sb/info/modules/BaseForm.vue

@@ -191,7 +191,7 @@
       </a-row>
 
       <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
-        <a-col :lg="12" :md="24" :sm="24">
+<!--        <a-col :lg="12" :md="24" :sm="24">
           <a-form-item
             label="使用位置"
             :labelCol="BaseTool.Constant.labelCol"
@@ -200,7 +200,7 @@
             <a-input
               v-decorator="['cph']" />
           </a-form-item>
-        </a-col>
+        </a-col>-->
         <a-col :lg="12" :md="24" :sm="24">
           <a-form-item
             label="生产商"

+ 19 - 1
src/views/sb/info/modules/Detail.vue

@@ -21,6 +21,8 @@
             </a-badge>
             <a-button v-show="model.useType==4" style="margin-left: 8px" type="default" @click="handleMeasure()">检定记录</a-button>
             <a-button v-if="$auth('check-polling-jobs-tui-calendar-first')" style="margin-left: 8px" type="error" @click="handleTuiCalendar(1)">保养日历</a-button>
+            <a-button style="margin-left: 8px" type="default" @click="handleRepairReportSbInfo()">工单分析</a-button>
+            <a-button style="margin-left: 8px" type="default" @click="handleRepairReportSbInfoFee()">费用分析</a-button>
             <a-button style="margin-left: 8px" type="primary" @click="handleCancel()">返回</a-button>
           </span>
         </a-col>
@@ -165,6 +167,8 @@
     <detail-sb-measure ref="detailSbMeasureModal" @ok="handleOk"/>
     <detail-sb-info ref="detailSbInfoModal" @ok="handleOk"/>
     <part-info-list ref="partInfoList" />
+    <repair-report-sb-info ref="repairReportSbInfo" :sb-id="model.id" @ok="handleOk"/>
+    <repair-report-sb-info-fee ref="repairReportSbInfoFee" :sb-id="model.id" @ok="handleOk"/>
     <!--    <check-job-table-wait-do :type="2" :check-type="2" ref="checkJobTableWaitDo" @ok="handleOk"/>-->
   </a-card>
 </template>
@@ -192,6 +196,8 @@ import DetailSbCheckJob from '@/views/check/checkjob/modules/DetailSbCheckJob'
 import DetailSbMeasure from '@/views/sb/measurelog/modules/DetailSbCheck'
 import DetailSbInfo from '@/views/sb/info/modules/DetailSbInfo'
 import RepairFeeTable from '@/views/repair/fee/modules/RepairFeeTable'
+import RepairReportSbInfo from '@/views/dashboard/RepairReportSbInfo'
+import RepairReportSbInfoFee from '@/views/dashboard/RepairReportSbInfoFee'
 import PartInfoList from '@/views/part/info/modules/PartInfoList'
 const DetailListItem = DetailList.Item
 
@@ -214,7 +220,9 @@ export default {
     DetailSbInfo,
     RepairFeeTable,
     SbStatusLogTable,
-    SbStopLogTable
+    SbStopLogTable,
+    RepairReportSbInfo,
+    RepairReportSbInfoFee
   },
   data () {
     return {
@@ -374,6 +382,16 @@ export default {
       const modal = this.$refs.detailSbMeasureModal
       modal.base(this.model)
     },
+    handleRepairReportSbInfo  () {
+      this.visible = false
+      const modal = this.$refs.repairReportSbInfo
+      modal.base()
+    },
+    handleRepairReportSbInfoFee  () {
+      this.visible = false
+      const modal = this.$refs.repairReportSbInfoFee
+      modal.base()
+    },
     base (record) {
       this.visible = true
       this.visibleDetail = true

+ 14 - 0
src/views/sqarepartmanage/sparepartinfo/SparePartInfo.vue

@@ -78,6 +78,18 @@
                   </a-select>
                 </a-form-item>
               </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="是否专用">
+                  <a-select v-model="queryParam.isSpecial" placeholder="请选择">
+                    <a-select-option
+                      v-for="(label,value) in specialMap"
+                      :key="value"
+                      :label="label"
+                      :value="parseInt(value)">{{ label }}
+                    </a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="关联设备">
                   <a-input v-model="queryParam.model" placeholder="新号/旧号/名称/规格"/>
@@ -373,6 +385,7 @@ export default {
       unitMap: {},
       cdMap: {},
       ytMap: {},
+      specialMap: {},
       id: null,
       visible: true,
       spareTypeTreeData: [],
@@ -392,6 +405,7 @@ export default {
     this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
     this.cdMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PRODUCER_AREA)
     this.ytMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SPARE_USE_TYPE)
+    this.specialMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
     this.tableOption()
     fetchSpareTypeTree({}).then(res => {
       this.spareTypeTreeData = res.data

+ 18 - 0
src/views/sqarepartmanage/sparepartinfo/modules/BaseForm.vue

@@ -378,6 +378,22 @@
             </a-select>
           </a-form-item>
         </row-item>
+        <row-item>
+          <a-form-item
+            label="是否专用"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['isSpecial', {rules: [{required: true, message: '是否专用不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in specialMap"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </row-item>
         <row-item>
           <a-form-item
             label="备注"
@@ -486,6 +502,7 @@ export default {
       unitMap: {},
       cdMap: {},
       ytMap: {},
+      specialMap: {},
       spareTypeData: [],
       spareTypeDataMiddle: [],
       spareTypeDataChild: [],
@@ -549,6 +566,7 @@ export default {
   created () {
     // 下拉框map
     this.setTree()
+    this.specialMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
     this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SPARE_PART_INFO_LEVEL)
     this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
     this.cdMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PRODUCER_AREA)

+ 14 - 0
src/views/sqarepartmanage/sparepartinfo/modules/SparePartInfoSelectModal.vue

@@ -38,6 +38,18 @@
                     <a-input v-model="queryParam.initNo" placeholder="原厂编号"/>
                   </a-form-item>
                 </a-col>
+                <a-col :md="6 || 24" :sm="24">
+                  <a-form-item label="">
+                    <a-select v-model="queryParam.isSpecial" placeholder="请选择">
+                      <a-select-option
+                        v-for="(label,value) in specialMap"
+                        :key="value"
+                        :label="label"
+                        :value="parseInt(value)">{{ label }}
+                      </a-select-option>
+                    </a-select>
+                  </a-form-item>
+                </a-col>
                 <a-col :md="8" :sm="24">
                   <a-form-item label="关联设备">
                     <a-input v-model="queryParam.model" placeholder="新号/旧号/名称/规格"/>
@@ -124,6 +136,7 @@ export default {
       confirmLoading: false,
       mdl: {},
       modalTitle: null,
+      specialMap: {},
       visible: false,
       record: null,
       spareTypeTreeData: [],
@@ -208,6 +221,7 @@ export default {
     // 下拉框map
     this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SPARE_PART_INFO_LEVEL)
     this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
+    this.specialMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
   },
   methods: {
     tableOption () {