Browse Source

完善履历

whj 1 year ago
parent
commit
3dc1be594d

+ 49 - 0
src/api/sb/sb-resume.js

@@ -0,0 +1,49 @@
+import { axios } from '@/utils/request'
+import { stringify } from 'qs'
+
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getMeasurePage (parameter) {
+  return axios({
+    url: '/sb/measure-logs/getLogBySbId?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function exportSbMeasure (parameter) {
+  return axios({
+    url: '/sb/measure-logs/export?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    responseType: 'blob'
+  })
+}
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getPositionNoMeasurePage (parameter) {
+  return axios({
+    url: '/sb/infos/positionNo/history?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}

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

@@ -105,6 +105,9 @@ const constantRouterComponents = {
   'Location': () => import('@/views/sb/location/Location'),
   // 设备位号信息
   'SbInfoForLocation': () => import('@/views/sb/info/SbInfoForLocation'),
+  // 设备履历
+  'SbResume': () => import('@/views/sb/resume/SbResume'),
+  'PositionNoResume': () => import('@/views/sb/resume/PositionNoResume'),
   // 备件类别
   'SpareType': () => import('@/views/sqarepartmanage/sparetype/SpareType'),
   // 备件基础信息和报表

+ 1 - 1
src/utils/dict.js

@@ -129,7 +129,7 @@ DictCache.TYPE = {
   SBB: 'SBB', // 用友设备部下面对应的部门code
   DEPT_TYPE_LY: 'DEPT_TYPE_LY', // 龙岩思康新材料有限公司的部门code
   DEPT_TYPE_SD: 'DEPT_TYPE_SD', // 时代思康新材料有限公司的部门code
-
+  SB_MEASURE_OTHER_TYPE: 'SB_MEASURE_OTHER_TYPE', // 操作类型
   FEE_FORM_TYPE: 'FEE_FORM_TYPE', // 成本归属
   OUT_STORE_FORM_STATUS: 'OUT_STORE_FORM_STATUS', // 出库状态
   SPARE_PICK_FORM_TYPE: 'SPARE_PICK_FORM_TYPE', // 领用类型,

+ 2 - 2
src/views/dashboard/SbInfoTypeReport.vue

@@ -234,7 +234,7 @@ export default {
     },
     doExportDetail (record) {
       const parameter = {
-        typeId: record.id
+        typeId: record.typeName === '特种设备' ? '特种设备' : record.id
       }
       exportMonthReport(parameter).then(file => {
         this.BaseTool.UPLOAD.downLoadExportExcel(file)
@@ -242,7 +242,7 @@ export default {
     },
     doExportInfo (record) {
       const parameter = {
-        typeId: record.id
+        typeId: record.typeName === '特种设备' ? '特种设备' : record.id
       }
       exportMonthInfoReport(parameter).then(file => {
         this.BaseTool.UPLOAD.downLoadExportExcel(file)

+ 15 - 0
src/views/sb/info/modules/AddLogForm.vue

@@ -10,6 +10,16 @@
       <a-form-item v-show="false" >
         <a-input v-decorator="['sbId']" type="hidden"/>
       </a-form-item>
+      <a-form-item label="操作类型">
+        <a-select v-decorator="['otherType', { rules: [{ required: true, message: '请选择操作类型' }] }]" placeholder="请选择操作类型">
+          <a-select-option
+            v-for="(label,value) in otherTypeMap"
+            :key="value"
+            :label="label"
+            :value="parseInt(value)">{{ label }}
+          </a-select-option>
+        </a-select>
+      </a-form-item>
       <a-form-item label="更改内容">
         <a-textarea
           v-decorator="['content', { rules: [{ required: true, message: '请输入更改内容' }] }]"
@@ -27,9 +37,14 @@ export default {
     return {
       visible: false,
       confirmLoading: false,
+      otherTypeMap: {},
+
       form: this.$form.createForm(this)
     }
   },
+  created () {
+    this.otherTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_MEASURE_OTHER_TYPE)
+  },
   methods: {
     base (record) {
       this.visible = true

+ 234 - 0
src/views/sb/resume/PositionNoResume.vue

@@ -0,0 +1,234 @@
+<template>
+  <a-card :bordered="false">
+    <div class="table-page-search-wrapper" @keyup.enter="handleEnter">
+      <a-form layout="inline">
+        <a-row :gutter="48">
+          <a-col :md="6" :sm="24">
+            <a-form-item label="设备位号">
+              <a-input v-model.trim="queryParam.sbNoId" placeholder="请输入设备位号"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="设备名称">
+              <a-input v-model.trim="queryParam.sbName" placeholder="请输入设备名称"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="开始时间">
+              <a-date-picker style="width:100%" v-model.trim="queryParam.createdTimeStart" placeholder="请选择开始时间"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="结束时间">
+              <a-date-picker style="width:100%" v-model.trim="queryParam.createdTimeEnd" placeholder="请选择结束时间"/>
+            </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>
+              <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+
+    <div class="table-operator" style="margin-bottom: 8px;">
+      <a-button v-if="$auth('sb-run-fills-add')" type="primary" icon="plus" @click="$refs.baseFormList.base(null,DictCache.VALUE.FILL_INFO_USE_TYPE.FILL_INFO_USE_TYPE_YUN_XING)">新增</a-button>
+      <a-button style="margin-left: 8px" v-if="$auth('sb-run-fills-export')" type="primary" icon="download" @click="doExport">导出</a-button>
+      <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('sb-run-fills-del')">
+        <a-menu slot="overlay">
+          <a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
+            <a-menu-item key="1"><a-icon type="delete" /><a>删除</a></a-menu-item>
+          </a-popconfirm>
+        </a-menu>
+        <a-button style="margin-left: 8px">
+          批量操作 <a-icon type="down" />
+        </a-button>
+      </a-dropdown>
+    </div>
+
+    <s-table
+      ref="table"
+      :onExpand="onExpand"
+      size="default"
+      rowKey="id"
+      :bordered="this.MyGlobalConstant.BORDERED"
+      :columns="columns"
+      :data="loadData"
+      :alert="options.alert"
+      :rowSelection="options.rowSelection"
+      showPagination="auto"
+    >
+      <a-table
+        slot="expandedRowRender"
+        :columns="columns"
+        :data-source="childList"
+        :pagination="false"
+      >
+      </a-table>
+    </s-table>
+  </a-card>
+</template>
+
+<script>
+import { STable, Ellipsis } from '@/components'
+
+import { getPositionNoMeasurePage } from '@/api/sb/sb-resume'
+
+export default {
+  name: 'SbRunFillList',
+  components: {
+    STable,
+    Ellipsis
+  },
+  data () {
+    return {
+      // 查询参数
+      queryParam: {
+      },
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          width: 100,
+          checked: true,
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
+        },
+        {
+          title: '设备名称',
+          checked: true,
+          width: 200,
+          dataIndex: 'sbName'
+        },
+        {
+          title: '操作类型',
+          checked: true,
+          width: 200,
+          dataIndex: 'actionType'
+        },
+        {
+          title: '设备位号',
+          checked: true,
+          width: 200,
+          dataIndex: 'positionNo'
+        },
+        {
+          title: '操作时间',
+          checked: true,
+          width: 200,
+          dataIndex: 'createdTime'
+        }
+      ],
+      otherTypeMap: {},
+      childList: [],
+      // 下拉框map
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        if (this.queryParam.createdTimeStart) {
+          this.queryParam.createdTimeStart = this.BaseTool.Date.formatter(this.queryParam.createdTimeStart, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) + ' 00:00:00'
+        }
+        if (this.queryParam.createdTimeEnd) {
+          this.queryParam.createdTimeEnd = this.BaseTool.Date.formatter(this.queryParam.createdTimeEnd, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) + ' 23:59:59'
+        }
+        parameter = {
+          ...parameter,
+          ...this.queryParam
+        }
+        return getPositionNoMeasurePage(parameter)
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
+
+      options: {
+        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      optionAlertShow: false
+    }
+  },
+  created () {
+    // 下拉框map
+    this.otherTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_MEASURE_OTHER_TYPE)
+  },
+  methods: {
+    tableOption () {
+      if (!this.optionAlertShow) {
+        this.options = {
+          alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+          rowSelection: {
+            selectedRowKeys: this.selectedRowKeys,
+            onChange: this.onSelectChange,
+            getCheckboxProps: record => ({
+              props: {
+                disabled: false,
+                name: record.id
+              }
+            })
+          }
+        }
+        this.optionAlertShow = true
+      } else {
+        this.options = {
+          alert: false,
+          rowSelection: null
+        }
+        this.optionAlertShow = false
+      }
+    },
+    onExpand (expanded, record) { // expanded判断展开or收缩操作,record当前行数据
+      this.childList = record.yiBiaoHisroryVOS
+    },
+    batchDelete (id) {
+      let ids = []
+      if (this.BaseTool.String.isBlank(id)) {
+        const length = this.selectedRows.length
+        if (length === 0) {
+          this.$message.info('请选择要删除的记录')
+          return
+        }
+        ids = this.selectedRows.map(item => item.id)
+      } else {
+        ids = [id]
+      }
+      // deleteSbRunFills(ids).then(res => {
+      //   this.$message.info('删除成功')
+      //   this.handleOk()
+      //   this.$refs.table.clearSelected()
+      // })
+    },
+    handleOk () {
+      this.$refs.table.refresh()
+    },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    resetSearchForm () {
+      this.queryParam = {
+      }
+      this.$refs.table.refresh(true)
+    },
+    doExport () {
+      const parameter = {
+        ...this.queryParam
+      }
+      // exportSbRunFill(parameter).then(file => {
+      //   this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      // })
+    },
+    handleEnter () {
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>

+ 259 - 0
src/views/sb/resume/SbResume.vue

@@ -0,0 +1,259 @@
+<template>
+  <a-card :bordered="false">
+    <div class="table-page-search-wrapper" @keyup.enter="handleEnter">
+      <a-form layout="inline">
+        <a-row :gutter="48">
+          <a-col :md="6" :sm="24">
+            <a-form-item label="设备位号">
+              <a-input v-model.trim="queryParam.positionNo" placeholder="请输入设备位号"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="操作类型">
+              <a-select v-model="queryParam.otherType" placeholder="请选择操作类型">
+                <a-select-option
+                  v-for="(label,value) in otherTypeMap"
+                  :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-date-picker style="width:100%" v-model.trim="queryParam.createdTimeStart" placeholder="请选择开始时间"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="结束时间">
+              <a-date-picker style="width:100%" v-model.trim="queryParam.createdTimeEnd" placeholder="请选择结束时间"/>
+            </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>
+              <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+
+    <div class="table-operator" style="margin-bottom: 8px;">
+      <!-- <a-button v-if="$auth('sb-run-fills-add')" type="primary" icon="plus" @click="$refs.baseFormList.base(null,DictCache.VALUE.FILL_INFO_USE_TYPE.FILL_INFO_USE_TYPE_YUN_XING)">新增</a-button> -->
+      <a-button style="margin-left: 8px" type="primary" icon="download" @click="doExport">履历导出</a-button>
+      <!-- <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('sb-run-fills-del')">
+        <a-menu slot="overlay">
+          <a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
+            <a-menu-item key="1"><a-icon type="delete" /><a>删除</a></a-menu-item>
+          </a-popconfirm>
+        </a-menu>
+        <a-button style="margin-left: 8px">
+          批量操作 <a-icon type="down" />
+        </a-button>
+      </a-dropdown> -->
+    </div>
+
+    <s-table
+      ref="table"
+      size="default"
+      rowKey="id"
+      :bordered="this.MyGlobalConstant.BORDERED"
+      :columns="columns"
+      :data="loadData"
+      :alert="options.alert"
+      :rowSelection="options.rowSelection"
+      showPagination="auto"
+    >
+      <span slot="action" slot-scope="record">
+        <template>
+          <a @click="handleView(record)">查看</a>
+          <operation-button
+            v-if="$auth('sb-run-fills-edit')"
+            @click="handleEdit(record)"
+          >修改</operation-button>
+          <operation-button
+            v-if="$auth('sb-run-fills-del')"
+            :type="2"
+            title="是否要删除该条数据?"
+            @confirm="batchDelete(record.id)">删除</operation-button>
+        </template>
+      </span>
+    </s-table>
+  </a-card>
+</template>
+
+<script>
+import { STable, Ellipsis } from '@/components'
+
+import { getMeasurePage, exportSbMeasure } from '@/api/sb/sb-resume'
+
+export default {
+  name: 'SbRunFillList',
+  components: {
+    STable,
+    Ellipsis
+  },
+  data () {
+    return {
+      // 查询参数
+      queryParam: {
+      },
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          width: 100,
+          checked: true,
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
+        },
+        {
+          title: '设备名称',
+          checked: true,
+          width: 200,
+          dataIndex: 'sbName'
+        },
+        {
+          title: '操作类型',
+          checked: true,
+          width: 200,
+          dataIndex: 'type',
+          customRender: (text, record, index) => {
+            return this.otherTypeMap[text]
+          }
+        },
+        {
+          title: '设备位号',
+          checked: true,
+          width: 200,
+          dataIndex: 'positionNo'
+        },
+        {
+          title: '设备位置',
+          checked: true,
+          width: 200,
+          dataIndex: 'positionName'
+        },
+        {
+          title: '规格型号',
+          checked: true,
+          width: 200,
+          dataIndex: 'sbModel'
+        },
+        {
+          title: '操作时间',
+          checked: true,
+          width: 200,
+          dataIndex: 'createdTime'
+        }
+      ],
+      otherTypeMap: {},
+      // 下拉框map
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        if (this.queryParam.createdTimeStart) {
+          this.queryParam.createdTimeStart = this.BaseTool.Date.formatter(this.queryParam.createdTimeStart, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) + ' 00:00:00'
+        }
+        if (this.queryParam.createdTimeEnd) {
+          this.queryParam.createdTimeEnd = this.BaseTool.Date.formatter(this.queryParam.createdTimeEnd, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) + ' 23:59:59'
+        }
+        parameter = {
+          ...parameter,
+          ...this.queryParam
+        }
+        return getMeasurePage(parameter)
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
+
+      options: {
+        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      optionAlertShow: false
+    }
+  },
+  created () {
+    // 下拉框map
+    this.otherTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_MEASURE_OTHER_TYPE)
+  },
+  methods: {
+    tableOption () {
+      if (!this.optionAlertShow) {
+        this.options = {
+          alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+          rowSelection: {
+            selectedRowKeys: this.selectedRowKeys,
+            onChange: this.onSelectChange,
+            getCheckboxProps: record => ({
+              props: {
+                disabled: false,
+                name: record.id
+              }
+            })
+          }
+        }
+        this.optionAlertShow = true
+      } else {
+        this.options = {
+          alert: false,
+          rowSelection: null
+        }
+        this.optionAlertShow = false
+      }
+    },
+
+    batchDelete (id) {
+      let ids = []
+      if (this.BaseTool.String.isBlank(id)) {
+        const length = this.selectedRows.length
+        if (length === 0) {
+          this.$message.info('请选择要删除的记录')
+          return
+        }
+        ids = this.selectedRows.map(item => item.id)
+      } else {
+        ids = [id]
+      }
+      // deleteSbRunFills(ids).then(res => {
+      //   this.$message.info('删除成功')
+      //   this.handleOk()
+      //   this.$refs.table.clearSelected()
+      // })
+    },
+    handleOk () {
+      this.$refs.table.refresh()
+    },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    resetSearchForm () {
+      this.queryParam = {
+      }
+      this.$refs.table.refresh(true)
+    },
+    doExport () {
+      const parameter = {
+        ...this.queryParam
+      }
+      exportSbMeasure(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    },
+    handleEnter () {
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>