xiongchao 3 years ago
parent
commit
59c39e25c8

+ 28 - 0
src/api/repair/application-form.js

@@ -154,6 +154,34 @@ export function finish (parameter) {
   })
 }
 
+/**
+ * examine func 提交审核
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function examine (parameter) {
+  return axios({
+    url: '/repair/application-forms/examine/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
+
+/**
+ * examine func 审核同意
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function examineOk (result, parameter) {
+  return axios({
+    url: '/repair/application-forms/examined/' + parameter.id + '/' + result,
+    method: 'PUT',
+    data: parameter
+  })
+}
+
 /**
  * update func
  * parameter: { }

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

@@ -169,6 +169,10 @@ const constantRouterComponents = {
   'TransferStoreDetail': () => import('@/views/store/transferstoredetail/TransferStoreDetail'),
   // 报修单
   'RepairApplicationForm': () => import('@/views/repair/application-form/RepairApplicationForm'),
+  // 报修单待审核
+  'RepairApplicationFormExamining': () => import('@/views/repair/application-form/RepairApplicationFormExamining'),
+  // 报修单已审核
+  'RepairApplicationFormExamined': () => import('@/views/repair/application-form/RepairApplicationFormExamined'),
   'RepairOut': () => import('@/views/repair/application-form/RepairOut'),
   // 验收单
   'RepairCheckForm': () => import('@/views/repair/application-form/RepairCheckForm'),

+ 9 - 4
src/utils/dict.js

@@ -768,7 +768,9 @@ DictCache.VALUE = {
     PROCESSING: 3, // 处理中
     NOT_ACCEPTANCE: 4, // 待验收
     REBACK: 5, // 已驳回
-    FINISHED: 6// 已完成
+    FINISHED: 6, // 已完成
+    EXAMINING: 7, //
+    EXAMINED: 8 //
   },
   /**
    * 维修状态
@@ -1273,9 +1275,12 @@ DictCache.COLOR = {
   REPAIR_APPLICATION_FORM_STATUS: {
     1: 'warning', // 待分配
     2: 'processing', // 已分配
-    3: 'warning', // 已接收
-    4: 'default', // 已撤销
-    5: 'success' // 已完成
+    3: 'warning', // 已接收处理中
+    4: 'default', // 待验收
+    5: 'success', // 已驳回
+    6: 'default', // 已完成
+    7: 'success', // 提交检查
+    8: 'default' // 已检查完毕
   },
   /**
    * 维修状态

+ 297 - 0
src/views/repair/application-form/RepairApplicationFormExamined.vue

@@ -0,0 +1,297 @@
+<template>
+  <a-card :bordered="false">
+    <div v-show="visible">
+      <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">
+        <a-button v-if="$auth('repair-application-forms-add')" type="primary" icon="plus" @click="$refs.baseModal.base()">新增</a-button>
+        <a-button style="margin-left: 8px" v-if="$auth('repair-application-forms-export')" type="primary" icon="download" @click="doExport">导出</a-button>
+        <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('repair-application-forms-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"
+        :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="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === record.status && $auth('repair-application-forms-edit')"
+              @click="handleEdit(record)" >审核</operation-button>
+          </template>
+        </span>
+        <span slot="status" slot-scope="text">
+          <badge :text="BaseTool.Object.getField(statusMap,text)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_STATUS[text]"/>
+        </span>
+      </s-table>
+    </div>
+    <base-form ref="baseModal" @ok="handleOk"/>
+    <detail ref="detailModal" @ok="handleOk"/>
+    <dispatch-base-form ref="dispatchBaseForm" @ok="handleOk" />
+  </a-card>
+</template>
+
+<script>
+import { STable, Ellipsis } from '@/components'
+import BaseForm from './modules/BaseForm'
+import Detail from './modules/Detail'
+import { getRepairApplicationFormPage, deleteRepairApplicationForms, fetchRepairApplicationForm, exportRepairApplicationForm } from '@/api/repair/application-form'
+import DispatchBaseForm from '@/views/repair/application-form/modules/DispatchBaseForm'
+
+export default {
+  name: 'RepairApplicationFormList',
+  components: {
+    STable,
+    Ellipsis,
+    BaseForm,
+    Detail,
+    DispatchBaseForm
+  },
+  data () {
+    return {
+      // 查询参数
+      queryParam: {
+        status: this.DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.EXAMINED
+      },
+      visible: true,
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          checked: true,
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
+        },
+        {
+          title: '设备编号',
+          checked: true,
+          dataIndex: 'sbNo'
+        },
+        {
+          title: '设备名称',
+          checked: true,
+          dataIndex: 'sbId',
+          customRender: (text, record, index) => {
+            return record.sbName
+          }
+        },
+        {
+          title: '报修人',
+          checked: true,
+          dataIndex: 'actualUser'
+        },
+        {
+          title: '维修人',
+          checked: true,
+          dataIndex: 'repairUserName'
+        },
+        {
+          title: '报修来源',
+          checked: true,
+          dataIndex: 'source',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.sourceMap, text)
+          }
+        },
+        {
+          title: '报修时间',
+          checked: true,
+          dataIndex: 'applyTime'
+        },
+        {
+          title: '紧急等级',
+          checked: true,
+          dataIndex: 'level',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.levelMap, text)
+          }
+        },
+        {
+          title: '是否停机',
+          checked: true,
+          dataIndex: 'needStop',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.needStopMap,text)
+          }
+        },
+        {
+          title: '报修状态',
+          checked: true,
+          dataIndex: 'status',
+          scopedSlots: { customRender: 'status' }
+        },
+
+        {
+          title: '创建日期',
+          dataIndex: 'createdTime'
+        },
+        {
+          title: '操作',
+          checked: true,
+          key: 'action',
+          width: '200px',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 下拉框map
+      sourceMap: {},
+      levelMap: {},
+      statusMap: {},
+      needStopMap: {},
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          ...this.queryParam,
+          type: 1,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
+          }
+        }
+        return getRepairApplicationFormPage(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
+        }
+      },
+      optionAlertShow: false
+    }
+  },
+  created () {
+    // 下拉框map
+    this.sourceMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_SOURCE)
+    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.tableOption()
+  },
+  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]
+      }
+      deleteRepairApplicationForms(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+        this.$refs.table.clearSelected()
+      })
+    },
+    handleEdit (record) {
+      fetchRepairApplicationForm({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleView (record) {
+      fetchRepairApplicationForm({ id: record.id }).then(res => {
+        this.visible = false
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    handleOk () {
+      this.visible = true
+      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
+      }
+      exportRepairApplicationForm(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    },
+    handleDispatching (record) {
+      const modal = this.$refs.dispatchBaseForm
+      modal.base(record)
+    }
+  }
+}
+</script>

+ 297 - 0
src/views/repair/application-form/RepairApplicationFormExamining.vue

@@ -0,0 +1,297 @@
+<template>
+  <a-card :bordered="false">
+    <div v-show="visible">
+      <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">
+        <a-button v-if="$auth('repair-application-forms-add')" type="primary" icon="plus" @click="$refs.baseModal.base()">新增</a-button>
+        <a-button style="margin-left: 8px" v-if="$auth('repair-application-forms-export')" type="primary" icon="download" @click="doExport">导出</a-button>
+        <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('repair-application-forms-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"
+        :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="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === record.status && $auth('repair-application-forms-edit')"
+              @click="handleEdit(record)" >审核</operation-button>
+          </template>
+        </span>
+        <span slot="status" slot-scope="text">
+          <badge :text="BaseTool.Object.getField(statusMap,text)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_STATUS[text]"/>
+        </span>
+      </s-table>
+    </div>
+    <base-form ref="baseModal" @ok="handleOk"/>
+    <detail-examine ref="detailModal" @ok="handleOk"/>
+    <dispatch-base-form ref="dispatchBaseForm" @ok="handleOk" />
+  </a-card>
+</template>
+
+<script>
+import { STable, Ellipsis } from '@/components'
+import BaseForm from './modules/BaseForm'
+import DetailExamine from './modules/DetailExamine'
+import { getRepairApplicationFormPage, deleteRepairApplicationForms, fetchRepairApplicationForm, exportRepairApplicationForm } from '@/api/repair/application-form'
+import DispatchBaseForm from '@/views/repair/application-form/modules/DispatchBaseForm'
+
+export default {
+  name: 'RepairApplicationFormList',
+  components: {
+    STable,
+    Ellipsis,
+    BaseForm,
+    DetailExamine,
+    DispatchBaseForm
+  },
+  data () {
+    return {
+      // 查询参数
+      queryParam: {
+        status: this.DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.EXAMINING
+      },
+      visible: true,
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          checked: true,
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
+        },
+        {
+          title: '设备编号',
+          checked: true,
+          dataIndex: 'sbNo'
+        },
+        {
+          title: '设备名称',
+          checked: true,
+          dataIndex: 'sbId',
+          customRender: (text, record, index) => {
+            return record.sbName
+          }
+        },
+        {
+          title: '报修人',
+          checked: true,
+          dataIndex: 'actualUser'
+        },
+        {
+          title: '维修人',
+          checked: true,
+          dataIndex: 'repairUserName'
+        },
+        {
+          title: '报修来源',
+          checked: true,
+          dataIndex: 'source',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.sourceMap, text)
+          }
+        },
+        {
+          title: '报修时间',
+          checked: true,
+          dataIndex: 'applyTime'
+        },
+        {
+          title: '紧急等级',
+          checked: true,
+          dataIndex: 'level',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.levelMap, text)
+          }
+        },
+        {
+          title: '是否停机',
+          checked: true,
+          dataIndex: 'needStop',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.needStopMap,text)
+          }
+        },
+        {
+          title: '报修状态',
+          checked: true,
+          dataIndex: 'status',
+          scopedSlots: { customRender: 'status' }
+        },
+
+        {
+          title: '创建日期',
+          dataIndex: 'createdTime'
+        },
+        {
+          title: '操作',
+          checked: true,
+          key: 'action',
+          width: '200px',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 下拉框map
+      sourceMap: {},
+      levelMap: {},
+      statusMap: {},
+      needStopMap: {},
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          ...this.queryParam,
+          type: 1,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
+          }
+        }
+        return getRepairApplicationFormPage(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
+        }
+      },
+      optionAlertShow: false
+    }
+  },
+  created () {
+    // 下拉框map
+    this.sourceMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_SOURCE)
+    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.tableOption()
+  },
+  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]
+      }
+      deleteRepairApplicationForms(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+        this.$refs.table.clearSelected()
+      })
+    },
+    handleEdit (record) {
+      fetchRepairApplicationForm({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleView (record) {
+      fetchRepairApplicationForm({ id: record.id }).then(res => {
+        this.visible = false
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    handleOk () {
+      this.visible = true
+      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
+      }
+      exportRepairApplicationForm(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    },
+    handleDispatching (record) {
+      const modal = this.$refs.dispatchBaseForm
+      modal.base(record)
+    }
+  }
+}
+</script>

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

@@ -38,28 +38,6 @@
               v-decorator="['sbCph', {rules: [{required: true, message: '设备使用位置不能为空'}]}]" />
           </a-form-item>
         </row-item>
-        <!--<row-item>
-          <a-form-item
-            label="部件id"
-            :labelCol="BaseTool.Constant.labelCol"
-            :wrapperCol="BaseTool.Constant.wrapperCol"
-            v-show="false"
-          >
-            <a-input
-              v-decorator="['partId', {rules: [{required: false, message: '设备id不能为空'}]}]" />
-          </a-form-item>
-          <a-form-item
-            label="部件名称"
-            :labelCol="BaseTool.Constant.labelCol"
-            :wrapperCol="BaseTool.Constant.wrapperCol"
-          >
-            <a-input
-              disabled
-              style="width: 70%"
-              v-decorator="['partName', {rules: [{required: false, message: '部件名称不能为空'}]}]" />
-            <a-button :disabled="!BaseTool.Object.isNotBlank(this.form.getFieldValue('sbId'))" style="width: 30%" type="primary" @click="handlePartSelect">选择</a-button>
-          </a-form-item>
-        </row-item>-->
         <row-item>
           <a-form-item
             label="是否停机"
@@ -76,22 +54,19 @@
             </a-select>
           </a-form-item>
         </row-item>
-        <!--<row-item>
+        <row-item>
           <a-form-item
-            label="报修人"
+            label="维修时间"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-select v-decorator="['repairUserId', {rules: [{required: true, message: '报修人不能为空'}]}]" placeholder="请选择">
-              <a-select-option
-                v-for="item in userList"
-                :key="item.userId"
-                :label="item.realName"
-                :value="item.userId">{{ item.realName }}
-              </a-select-option>
-            </a-select>
+            <a-input
+              style="width: 70%"
+              suffix="小时"
+              v-decorator="['limitHours', {rules: [{required: true, message: '多少小时内需要维修好'}]}]" />
+            <a-button style="width: 30%" type="primary" @click="handleSbSelect">选择</a-button>
           </a-form-item>
-        </row-item>-->
+        </row-item>
         <row-item>
           <a-form-item
             label="报修单号"
@@ -335,6 +310,7 @@ export default {
           'partId',
           'repairUserId',
           'no',
+          'limitHours',
           'source',
           'level',
           'content',

+ 1 - 0
src/views/repair/application-form/modules/Detail.vue

@@ -17,6 +17,7 @@
             <detail-list-item term="报修单号">{{ model.no }}</detail-list-item>
             <detail-list-item term="设备编号">{{ model.sbNo }}</detail-list-item>
             <detail-list-item term="设备名称">{{ model.sbName }}</detail-list-item>
+            <detail-list-item term="预留维修时间">{{ model.limitHours }}</detail-list-item>
             <detail-list-item term="使用位置">{{ model.sbCph }}</detail-list-item>
             <!--<detail-list-item term="部件名称">{{ model.partName }}</detail-list-item>-->
             <detail-list-item term="是否停机">{{ BaseTool.Object.getField(needStopMap,model.needStop) }}</detail-list-item>

+ 1 - 0
src/views/repair/application-form/modules/DetailCheck.vue

@@ -16,6 +16,7 @@
           <detail-list-item term="报修单号">{{ model.no }}</detail-list-item>
           <detail-list-item term="设备编号">{{ model.sbNo }}</detail-list-item>
           <detail-list-item term="设备名称">{{ model.sbName }}</detail-list-item>
+          <detail-list-item term="预留维修时间">{{ model.limitHours }}</detail-list-item>
           <detail-list-item term="使用位置">{{ model.sbCph }}</detail-list-item>
           <!--<detail-list-item term="部件名称">{{ model.partName }}</detail-list-item>-->
           <detail-list-item term="是否停机">{{ BaseTool.Object.getField(needStopMap,model.needStop) }}</detail-list-item>

+ 572 - 0
src/views/repair/application-form/modules/DetailExamine.vue

@@ -0,0 +1,572 @@
+<template>
+  <div>
+    <a-card :bordered="false" :loading="loading" v-show="visible" class="card" :title="modalTitle">
+      <a-row :gutter="48" slot="extra">
+        <a-col :md="48" :sm="48">
+          <span class="table-page-search-submitButtons" style="float: right">
+            <a-button v-if="$auth('repair-application-forms-approve') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.EXAMINING === model.status" style="margin-left: 8px" type="primary" @click="handleApprove()">完成</a-button>
+            <a-button v-if="$auth('repair-application-forms-reback') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.EXAMINING === model.status" style="margin-left: 8px" type="danger" @click="handleReturn()">驳回</a-button>
+            <a-button style="margin-left: 8px" @click="handleCancel">返回</a-button>
+          </span>
+        </a-col>
+      </a-row>
+      <a-layout>
+        <a-layout-content style="background-color: rgb(255, 255, 255)">
+          <a-divider orientation="left">报修详情</a-divider>
+          <detail-list title="" :col="3">
+            <detail-list-item term="报修单号">{{ model.no }}</detail-list-item>
+            <detail-list-item term="设备编号">{{ model.sbNo }}</detail-list-item>
+            <detail-list-item term="设备名称">{{ model.sbName }}</detail-list-item>
+            <detail-list-item term="预留维修时间">{{ model.limitHours }}</detail-list-item>
+            <detail-list-item term="使用位置">{{ model.sbCph }}</detail-list-item>
+            <!--<detail-list-item term="部件名称">{{ model.partName }}</detail-list-item>-->
+            <detail-list-item term="是否停机">{{ BaseTool.Object.getField(needStopMap,model.needStop) }}</detail-list-item>
+            <detail-list-item term="报修人">{{ model.userName }}</detail-list-item>
+            <detail-list-item term="报修来源">{{ BaseTool.Object.getField(this.sourceMap, model.source) }}</detail-list-item>
+            <detail-list-item term="紧急等级"><badge :text="BaseTool.Object.getField(levelMap,model.level)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_LEVEL[model.applicationLevel]"/></detail-list-item>
+            <detail-list-item term="报修时间">{{ model.applyTime }}</detail-list-item>
+            <detail-list-item term="报修状态"><badge :text="BaseTool.Object.getField(statusMap,model.status)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_STATUS[model.status]"/></detail-list-item>
+          </detail-list>
+          <detail-list title="" :col="1">
+            <!--<detail-list-item term="故障描述">{{ BaseTool.Object.getField(this.descripitionMap, model.content) }}</detail-list-item>-->
+            <detail-list-item term="故障描述">{{ model.content }}</detail-list-item>
+          </detail-list>
+          <detail-list title="报修图片:" :col="6">
+            <upload-image-detail :images-list="model.applicationFileList"/>
+          </detail-list>
+          <a-divider orientation="left">维修详情</a-divider>
+          <detail-list title="" :col="3">
+            <detail-list-item term="故障类别">{{ model.repairErrorTypeName }}</detail-list-item>
+            <detail-list-item term="维修开始时间">{{ model.repairStartTime }}</detail-list-item>
+            <detail-list-item term="维修结束时间">{{ model.repairEndTime }}</detail-list-item>
+            <detail-list-item term="维修耗时">{{ model.repairMinutes }}</detail-list-item>
+            <detail-list-item term="维修人员">{{ model.repairUserName }}</detail-list-item>
+          <!--<detail-list-item term="维修次数">{{ model.repairTimes }}</detail-list-item>-->
+          </detail-list>
+          <detail-list title="" :col="1">
+            <detail-list-item term="维修描述">{{ model.repairContent }}</detail-list-item>
+          </detail-list>
+          <detail-list title="维修图片:" :col="6">
+            <upload-image-detail :images-list="model.repairFileList"/>
+          </detail-list>
+          <a-divider v-if="dispatchList != null" orientation="left">转派详情</a-divider>
+          <detail-list v-for="item in dispatchList" title="" :col="3">
+            <detail-list-item term="转派人">{{ item.username }}</detail-list-item>
+            <detail-list-item term="转派时间">{{ item.time }}</detail-list-item>
+            <detail-list-item term="转派备注">{{ item.remark }}</detail-list-item>
+          </detail-list>
+          <a-divider orientation="left">验收详情</a-divider>
+          <detail-list title="" :col="3">
+            <detail-list-item term="验收开始时间">{{ model.checkStartTime }}</detail-list-item>
+            <detail-list-item term="验收结束时间">{{ model.checkEndTime }}</detail-list-item>
+            <detail-list-item term="验收人员">{{ model.checkUserName }}</detail-list-item>
+            <detail-list-item term="验收描述">{{ model.checkContent }}</detail-list-item>
+          </detail-list>
+          <detail-list title="验收图片:" :col="6">
+            <upload-image-detail :images-list="model.checkFileList"/>
+          </detail-list>
+        </a-layout-content>
+        <a-layout-sider style="background-color: rgb(255, 255, 255)">
+          <div style="margin-top: 30px;margin-left: 30px;">
+            <a-steps progress-dot :current="6" direction="vertical" >
+              <a-step title="报修时间:" :description="''+model.applyTime?model.applyTime:''" />
+              <a-step title="维修开始时间:" :description="''+model.repairStartTime?model.repairStartTime:''" />
+              <a-step title="维修结束时间:" :description="''+model.repairEndTime?model.repairEndTime:''" />
+              <a-step title="验收开始时间:" :description="''+model.checkStartTime?model.checkStartTime:''" />
+              <a-step title="验收结束时间:" :description="''+model.checkEndTime?model.checkEndTime:''" />
+            </a-steps>
+          </div>
+        </a-layout-sider>
+      </a-layout>
+      <!--    <title-divider title="维修项目" width="90px"></title-divider>-->
+      <!--    <div class="table-operator" v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)">-->
+      <!--      <a-button type="primary" @click="handleRepairProjectSelect">-->
+      <!--        <a-icon type="plus"/>-->
+      <!--        添加-->
+      <!--      </a-button>-->
+      <!--    </div>-->
+      <!--    <a-table-->
+      <!--      :data-source="data"-->
+      <!--      :columns="columns"-->
+      <!--      tableLayout="auto"-->
+      <!--      rowKey="id">-->
+      <!--    </a-table>-->
+      <title-divider title="配件清单" width="90px"></title-divider>
+      <!--      <div class="table-operator" v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)">-->
+      <!--        <a-button type="primary" @click="handleSpareSelect">-->
+      <!--          <a-icon type="plus"/>-->
+      <!--          添加-->
+      <!--        </a-button>-->
+      <!--      </div>-->
+      <a-table
+        :data-source="dataSpare"
+        :columns="columnsSpare"
+        tableLayout="auto"
+        rowKey="id">
+
+      </a-table>
+
+      <title-divider title="费用清单" width="90px"></title-divider>
+      <!--      <div class="table-operator" v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)">-->
+      <!--        <a-button type="primary" @click="handleAddFee">-->
+      <!--          <a-icon type="plus"/>-->
+      <!--          添加-->
+      <!--        </a-button>-->
+      <!--      </div>-->
+      <a-table
+        :data-source="dataFee"
+        :columns="columnsFee"
+        tableLayout="auto"
+        rowKey="id">
+<!--        <span slot="action" slot-scope="record">-->
+<!--          <template>-->
+<!--            <a @click="handleViewFee(record)">查看</a>-->
+<!--            <operation-button-->
+<!--              v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)"-->
+<!--              @click="handleEditFee(record)" >修改</operation-button>-->
+
+<!--            <operation-button-->
+<!--              v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)"-->
+<!--              :type="2"-->
+<!--              title="确认删除该笔费用?"-->
+<!--              @confirm="batchDeleteFee(record.id)" >删除</operation-button>-->
+<!--          </template>-->
+<!--        </span>-->
+      </a-table>
+      <!--<q-tabs :activeKey="activeKey" @change="changeTab">
+      <q-tab-pane key="a" tab="配件更换">
+        <spare-part-used-select-table :type="1" :table-params="{sbId: model.sbId, modelId: model.modelId, repairId: model.id}" ref="sparePartUsedSelectTable"/>
+      </q-tab-pane>
+      <q-tab-pane key="b" tab="备件领用">
+        <spare-pick-form-select-table :type="1" :table-params="{repairId: model.id, repairNo: model.no}" ref="sparePickFormSelectTable"/>
+      </q-tab-pane>
+    </q-tabs>-->
+      <title-divider title="原因分析" width="90px"></title-divider>
+      <!--      <div class="table-operator" v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)">-->
+      <!--        <a-button type="primary" @click="handleAddReason">-->
+      <!--          <a-icon type="plus"/>-->
+      <!--          添加-->
+      <!--        </a-button>-->
+      <!--      </div>-->
+      <a-table
+        :data-source="dataReason"
+        :columns="columnsReason"
+        tableLayout="fixed"
+        rowKey="id">
+        <span slot="action" slot-scope="record">
+          <template>
+            <a @click="handleViewReason(record)">查看</a>
+            <!--            <operation-button-->
+            <!--              v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)"-->
+            <!--              @click="handleEditReason(record)" >修改</operation-button>-->
+
+            <!--            <operation-button-->
+            <!--              v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)"-->
+            <!--              :type="2"-->
+            <!--              title="确认删除该记录?"-->
+            <!--              @confirm="batchDeleteReason(record.id)" >删除</operation-button>-->
+          </template>
+        </span>
+      </a-table>
+
+    </a-card>
+    <examine-form ref="examineForm" @ok="handleOk" />
+    <fee-base-form ref="feeForm" @ok="handleOk" />
+    <reason-base-form ref="reasonForm" @ok="handleOk" />
+    <finish-form ref="finishForm" @ok="handleOk" />
+    <dispatch-form ref="dispatchForm" @ok="handleCancel" />
+    <fee-detail ref="feeDetail" @ok="handleOk" />
+    <reason-detail ref="reasonDetail" @ok="handleOk" />
+  </div>
+</template>
+
+<script>
+import DetailList from '@/components/tools/DetailList'
+import { fetchRepairApplicationForm, examineOk } from '@/api/repair/application-form'
+import ExamineForm from './ExamineForm'
+import FinishForm from './FinishForm'
+import DispatchForm from './DispatchForm'
+import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable'
+import SparePickFormSelectTable from '@/views/store/sparepickform/modules/SparePickFormSelectTable'
+import { selectSparePartUsedListByRepairId } from '@/api/sqarepartmanage/sparepartused'
+import { selectRepairProjectListByRepairId } from '@/api/repair/repairprojectrelation'
+import FeeBaseForm from '@/views/repair/fee/modules/BaseForm'
+import ReasonBaseForm from '@/views/repair/repair-reason/modules/BaseForm'
+import FeeDetail from '@/views/repair/fee/modules/Detail'
+import ReasonDetail from '@/views/repair/repair-reason/modules/Detail'
+import { deleteRepairFees, fetchRepairFee, queryRepairFee } from '@/api/repair/fee'
+import { deleteRepairReasons, fetchRepairReason, queryRepairReason } from '@/api/repair/repair-reason'
+const DetailListItem = DetailList.Item
+
+export default {
+  name: 'RepairApplicationFormDetail',
+  components: {
+    ExamineForm,
+    DetailList,
+    DetailListItem,
+    FinishForm,
+    FeeDetail,
+    ReasonDetail,
+    FeeBaseForm,
+    ReasonBaseForm,
+    DispatchForm,
+    SparePartUsedSelectTable,
+    SparePickFormSelectTable
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      needStopMap: {},
+      dispatchList: [],
+      activeKey: 'a',
+      visible: false,
+      loading: false,
+      // 下拉框map
+      sourceMap: {},
+      levelMap: {},
+      descripitionMap: {},
+      statusMap: {},
+      typeMap: {},
+      repairProjectMap: {},
+      repairTechnologyMap: {},
+      data: [],
+      dataSpare: [],
+      dataFee: [],
+      dataReason: [],
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return `${index + 1}`
+          }
+        },
+        {
+          title: '编码',
+          dataIndex: 'no'
+        },
+        {
+          title: '名称',
+          dataIndex: 'name'
+        },
+        {
+          title: '维修类别',
+          dataIndex: 'type',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.repairProjectMap, text)
+          }
+        },
+        {
+          title: '维修工艺',
+          dataIndex: 'technology',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.repairTechnologyMap, text)
+          }
+        },
+        {
+          title: '标准工时',
+          dataIndex: 'standardHours'
+        },
+        {
+          title: '标准费用',
+          dataIndex: 'standardMoney'
+        },
+        {
+          title: '考核工时',
+          dataIndex: 'checkHours'
+        }
+      ],
+      columnsSpare: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return `${index + 1}`
+          }
+        },
+        {
+          title: '备件名称',
+          dataIndex: 'spareId',
+          customRender: (text, record, index) => {
+            return record.spareName
+          }
+        },
+        {
+          title: '数量',
+          dataIndex: 'num'
+        },
+        {
+          title: '价格',
+          dataIndex: 'price'
+        },
+        {
+          title: '总价',
+          dataIndex: 'totalPrice'
+        }
+      ],
+      columnsFee: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return `${index + 1}`
+          }
+        },
+        {
+          title: '费用金额',
+          dataIndex: 'fee',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '费用类别',
+          dataIndex: 'type',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.typeMap, text)
+          }
+        },
+        {
+          title: '费用原因',
+          dataIndex: 'reason'
+        },
+        {
+          title: '费用描述',
+          dataIndex: 'descripition'
+        },
+        {
+          title: '备注',
+          dataIndex: 'remark'
+        }
+      ],
+      columnsReason: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          width: '70',
+          customRender: (text, record, index) => {
+            return `${index + 1}`
+          }
+        },
+        {
+          title: '分析时间',
+          dataIndex: 'analyzeTime',
+          width: '200px'
+        },
+        {
+          title: '问题描述',
+          dataIndex: 'problemDesc',
+          ellipsis: true,
+          width: '200px'
+        },
+        {
+          title: '原因分析',
+          dataIndex: 'reasonAnalysis',
+          ellipsis: true,
+          width: '200px'
+        },
+        {
+          title: '改进措施',
+          dataIndex: 'improveMeasure',
+          ellipsis: true,
+          width: '200px'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          width: '200px',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      model: {
+        'id': null,
+        'sbId': null,
+        'partId': null,
+        'repairUserId': null,
+        'needStop': null,
+        'no': null,
+        'source': null,
+        'applyTime': null,
+        'level': null,
+        'content': null,
+        'status': null,
+        'remark': null,
+        'updateTime': null,
+        'createdUserId': null,
+        'updateUserId': null,
+        'createdUserName': null,
+        'sbName': null,
+        'partName': null,
+        'updateUserName': null,
+        'repairFormVO': null,
+        'repairCheckVO': null
+      }
+    }
+  },
+  created () {
+    // 下拉框map
+    this.sourceMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_SOURCE)
+    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.statusRepairMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FORM_STATUS)
+    this.statusCheckMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_CHECK_STATUS)
+    this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
+    this.repairProjectMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_PROJECT_TYPE)
+    this.repairTechnologyMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_TECHNOLOGY_TYPE)
+    this.descripitionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_QUESTION)
+    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FEE_TYPE)
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.modalTitle = '详情'
+      this.model = record
+      this.dispatchList = JSON.parse(record.repairDispatchList)
+      this.init()
+    },
+    init () {
+      selectRepairProjectListByRepairId({ id: this.model.id }).then(res => {
+        this.data = res.data
+      })
+      selectSparePartUsedListByRepairId({ id: this.model.id }).then(res => {
+        this.dataSpare = res.data
+      })
+      queryRepairFee({ repairId: this.model.id }).then(res => {
+        this.dataFee = res.data
+      })
+      queryRepairReason({ repairId: this.model.id }).then(res => {
+        this.dataReason = res.data
+      })
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+      this.$emit('ok')
+    },
+    receive () {
+      receive(this.model).then(() => {
+        this.$message.info('任务接收成功,请及时维修')
+        this.handleOk()
+      })
+    },
+    batchDeleteFee (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]
+      }
+      deleteRepairFees(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+        this.$refs.table.clearSelected()
+      })
+    },
+    handleAddFee () {
+      const modal = this.$refs.feeForm
+      modal.base(null, this.model)
+    },
+    handleEditFee (record) {
+      fetchRepairFee({ id: record.id }).then(res => {
+        const modal = this.$refs.feeForm
+        modal.base(res.data, this.model)
+      })
+    },
+    handleViewFee (record) {
+      fetchRepairFee({ id: record.id }).then(res => {
+        const modal = this.$refs.feeDetail
+        modal.base(res.data)
+      })
+    },
+    batchDeleteReason (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]
+      }
+      deleteRepairReasons(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+        this.$refs.table.clearSelected()
+      })
+    },
+    handleAddReason () {
+      const modal = this.$refs.reasonForm
+      this.visible = false
+      modal.base(null, this.model)
+    },
+    handleEditReason (record) {
+      fetchRepairReason({ id: record.id }).then(res => {
+        const modal = this.$refs.reasonForm
+        this.visible = false
+        modal.base(res.data, this.model)
+      })
+    },
+    handleViewReason (record) {
+      fetchRepairReason({ id: record.id }).then(res => {
+        const modal = this.$refs.reasonDetail
+        modal.base(res.data)
+      })
+    },
+    handleApprove () {
+      examineOk(1, this.model).then(() => {
+        this.$message.info('审批成功,维修单已关闭')
+        this.model.status = this.DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.EXAMINED
+        this.handleOk()
+      })
+    },
+    handleReturn () {
+      const modal = this.$refs.examineForm
+      modal.base(this.model)
+    },
+    handleOk () {
+      this.loading = true
+      fetchRepairApplicationForm({ id: this.model.id }).then(res => {
+        this.loading = false
+        this.model = res.data
+        this.visible = true
+        this.dispatchList = JSON.parse(this.model.repairDispatchList)
+        this.init()
+      })
+    },
+    handleFinish () {
+      const modal = this.$refs.finishForm
+      modal.base(this.model)
+    },
+    handleSpareSelect () {
+      this.$refs.spareSelectModal.base()
+    },
+    handleDispatch () {
+      const modal = this.$refs.dispatchForm
+      modal.base(this.model)
+    },
+    changeTab (activeKey) {
+      this.activeKey = activeKey
+      if (this.activeKey === 'a' && this.BaseTool.Object.isNotBlank(this.$refs.sparePartUsedSelectTable)) {
+        const modal = this.$refs.sparePartUsedSelectTable
+        modal.handleOk()
+        return
+      }
+      if (this.activeKey === 'b' && this.BaseTool.Object.isNotBlank(this.$refs.sparePickFormSelectTable)) {
+        const modal = this.$refs.sparePickFormSelectTable
+        modal.handleOk()
+      }
+    }
+  }
+}
+</script>

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

@@ -6,7 +6,6 @@
           <span class="table-page-search-submitButtons" style="float: right">
             <a-button v-if="showSbFlag" style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewBom()">备件BOM</a-button>
             <a-button v-if="showSbFlag" style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewCheck()">保养项目</a-button>
-
             <a-button v-if="$auth('repair-application-forms-assign') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status" type="primary" @click="handleAssign">派工</a-button>
             <a-popconfirm v-if="$auth('repair-application-forms-deal') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" title="是否要接收?" @confirm="receive">
               <a-button style="margin-left: 16px">接收</a-button>
@@ -14,7 +13,9 @@
             <a-button v-if="$auth('repair-application-forms-out') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING >= model.status) && model.type != 2" style="margin-left: 8px" type="primary" @click="handleOut">委外</a-button>
             <a-button v-if="$auth('repair-application-forms-dispatch') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" style="margin-left: 8px" type="primary" @click="handleDispatch">转派</a-button>
             <a-button v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="primary" @click="handleFinish()">维修完成</a-button>
-            <!--          <a-button v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="primary" @click="handleSparePick">领用备件</a-button>-->
+            <a-popconfirm v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ACCEPTANCE === model.status" title="是否要提交审核该条数据?" @confirm="handleExamine">
+              <a-button style="margin-left: 8px" type="primary">提交审核</a-button>
+            </a-popconfirm>
             <a-button style="margin-left: 8px" @click="handleCancel">返回</a-button>
           </span>
         </a-col>
@@ -26,6 +27,7 @@
             <detail-list-item term="报修单号">{{ model.no }}</detail-list-item>
             <detail-list-item term="设备编号">{{ model.sbNo }}</detail-list-item>
             <detail-list-item term="设备名称">{{ model.sbName }}</detail-list-item>
+            <detail-list-item term="预留维修时间">{{ model.limitHours }}</detail-list-item>
             <detail-list-item term="使用位置">{{ model.sbCph }}</detail-list-item>
             <detail-list-item term="是否停机">{{ BaseTool.Object.getField(needStopMap,model.needStop) }}</detail-list-item>
             <detail-list-item term="报修人">{{ model.userName }}</detail-list-item>
@@ -218,7 +220,7 @@
 
 <script>
 import DetailList from '@/components/tools/DetailList'
-import { fetchRepairApplicationForm, approve, receive } from '@/api/repair/application-form'
+import { fetchRepairApplicationForm, examine, approve, receive } from '@/api/repair/application-form'
 import CheckForm from './CheckForm'
 import BaseOutForm from './BaseOutForm'
 import FinishForm from './FinishForm'
@@ -630,6 +632,15 @@ export default {
       const modal = this.$refs.finishForm
       modal.base(this.model)
     },
+    handleExamine () {
+      examine({ id: this.model.id }).then(res => {
+        this.loading = false
+        this.visible = true
+        this.model.status = this.DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.EXAMINING
+        this.$message.info('已提交,请等待审核')
+      })
+      this.init()
+    },
     handleDispatch () {
       const modal = this.$refs.dispatchForm
       modal.base(this.model)

+ 116 - 0
src/views/repair/application-form/modules/ExamineForm.vue

@@ -0,0 +1,116 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="800"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    class="ant-modal2"
+    @cancel="handleCancel"
+  >
+    <a-form :form="form">
+
+      <a-form-item v-show="false" >
+        <a-input v-decorator="['id']" type="hidden"/>
+      </a-form-item>
+
+      <row-list :col="2">
+        <row-item>
+          <a-form-item
+            label="原因"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
+          >
+            <a-textarea
+              :rows="4"
+              v-decorator="['checkContent', {rules: [{required: true, message: '原因不能为空'}]}]"/>
+          </a-form-item>
+        </row-item>
+      </row-list>
+    </a-form>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
+    </template>
+  </a-modal>
+</template>
+
+<script>
+import pick from 'lodash.pick'
+import { examineOk } from '@/api/repair/application-form'
+
+export default {
+  name: 'BaseRepairApplicationForm',
+  data () {
+    return {
+      confirmLoading: false,
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      visible: false,
+      // 下拉框map
+      sourceMap: {},
+      levelMap: {},
+      needStopMap: {},
+      descripitionMap: {},
+      statusMap: {},
+      model: null,
+      userList: []
+    }
+  },
+  components: {
+  },
+  props: {
+  },
+  created () {
+    // 下拉框map
+    this.sourceMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_SOURCE)
+    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)
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.model = record
+      // 如果是空标识添加
+      if (this.BaseTool.Object.isBlank(record)) {
+        this.modalTitle = '添加'
+        return
+      }
+      this.modalTitle = '驳回'
+      const { form: { setFieldsValue } } = this
+      // 日期处理
+      record.applyTime = this.BaseTool.Moment(record.applyTime, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id'
+        ])))
+      })
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        // 日期处理
+        examineOk(0, values)
+          .then(() => {
+            this.handleCancel(values)
+          }).catch(() => {
+            this.confirmLoading = false
+          })
+      })
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.form.resetFields()
+      if (this.BaseTool.Object.isNotBlank(values)) {
+        this.$emit('ok')
+      }
+    }
+
+  }
+}
+</script>