xiongchao 3 lat temu
rodzic
commit
b2ef83945f

+ 16 - 0
src/api/repair/repair-reason.js

@@ -49,6 +49,22 @@ export function updateRepairReason (parameter) {
     })
 }
 
+/**
+ * query list func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function queryNumRepairReason (parameter) {
+  return axios({
+    url: '/repair/repair-reasons/num?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
 /**
  * fetch single func
  * parameter: { }

+ 5 - 0
src/views/repair/application-form/MyRepairForm.vue

@@ -112,6 +112,11 @@ export default {
             return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
           }
         },
+        {
+          title: '设备编号',
+          checked: true,
+          dataIndex: 'sbNo'
+        },
         {
           title: '设备名称',
           checked: true,

+ 5 - 0
src/views/repair/application-form/RepairApplicationForm.vue

@@ -109,6 +109,11 @@ export default {
             return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
           }
         },
+        {
+          title: '设备编号',
+          checked: true,
+          dataIndex: 'sbNo'
+        },
         {
           title: '设备名称',
           checked: true,

+ 6 - 0
src/views/repair/application-form/RepairCheckForm.vue

@@ -97,6 +97,12 @@ export default {
             return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
           }
         },
+
+        {
+          title: '设备编号',
+          checked: true,
+          dataIndex: 'sbNo'
+        },
         {
           title: '设备名称',
           checked: true,

+ 5 - 0
src/views/repair/application-form/RepairForm.vue

@@ -120,6 +120,11 @@ export default {
             return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
           }
         },
+        {
+          title: '设备编号',
+          checked: true,
+          dataIndex: 'sbNo'
+        },
         {
           title: '设备名称',
           checked: true,

+ 6 - 0
src/views/repair/application-form/RepairOut.vue

@@ -112,6 +112,12 @@ export default {
           checked: true,
           dataIndex: 'outNo'
         },
+
+        {
+          title: '设备编号',
+          checked: true,
+          dataIndex: 'sbNo'
+        },
         {
           title: '设备名称',
           checked: true,

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

@@ -15,6 +15,7 @@
           <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.sbCph }}</detail-list-item>
             <!--<detail-list-item term="部件名称">{{ model.partName }}</detail-list-item>-->

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

@@ -14,6 +14,7 @@
         <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.sbCph }}</detail-list-item>
           <!--<detail-list-item term="部件名称">{{ model.partName }}</detail-list-item>-->

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

@@ -24,6 +24,7 @@
           <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.sbCph }}</detail-list-item>
             <detail-list-item term="是否停机">{{ BaseTool.Object.getField(needStopMap,model.needStop) }}</detail-list-item>

+ 3 - 0
src/views/repair/repair-reason/modules/BaseForm.vue

@@ -12,6 +12,7 @@
     <a-form :form="form">
       <a-form-item v-show="false" >
         <a-input v-decorator="['id']" type="hidden"/>
+        <a-input v-decorator="['sbId']" type="hidden"/>
         <a-input v-decorator="['repairId']" type="hidden"/>
       </a-form-item>
       <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
@@ -233,6 +234,7 @@ export default {
         this.$nextTick(() => {
           setFieldsValue(Object.assign(pick(repairForm, [
             'repairId',
+            'sbId',
             'no'
           ])))
         })
@@ -250,6 +252,7 @@ export default {
       this.$nextTick(() => {
         setFieldsValue(Object.assign(pick(record, [
           'id',
+          'sbId',
           'repairId',
           'no',
           'analyzeTime',

+ 37 - 5
src/views/repair/repair-reason/modules/Detail.vue

@@ -10,9 +10,6 @@
     <detail-list title="" :col="2">
       <detail-list-item term="编号">{{ model.no }}</detail-list-item>
       <detail-list-item term="分析时间">{{ model.analyzeTime }}</detail-list-item>
-      <detail-list-item term="更新日期">{{ model.updateTime }}</detail-list-item>
-      <detail-list-item term="创建人">{{ model.createdUserName }}</detail-list-item>
-      <detail-list-item term="更新人">{{ model.updateUserName }}</detail-list-item>
     </detail-list>
 
     <a-row>
@@ -33,13 +30,42 @@
         <div class="content">{{ model.reasonAnalysis }}</div>
       </a-col>
     </a-row>
-    <a-row>
+<!--    <a-row>
       <a-col style="margin-top: 10px">
         <div class="term">改进措施:</div>
         <div class="content">{{ model.improveMeasure }}</div>
       </a-col>
+    </a-row>-->
+    <a-row>
+      <a-col style="margin-top: 10px">
+        <div class="term">更新维修计划:</div>
+        <div class="content">{{ model.changeRepairPlanContent }}</div>
+      </a-col>
+    </a-row>
+    <a-row>
+      <a-col style="margin-top: 10px">
+        <div class="term">更新备件计划:</div>
+        <div class="content">{{ model.changeSparePlanContent }}</div>
+      </a-col>
+    </a-row>
+    <a-row>
+      <a-col style="margin-top: 10px">
+        <div class="term">人员培训:</div>
+        <div class="content">{{ model.userTeachContent }}</div>
+      </a-col>
+    </a-row>
+    <a-row>
+      <a-col style="margin-top: 10px">
+        <div class="term">设备改造升级:</div>
+        <div class="content">{{ model.sbChangeContent }}</div>
+      </a-col>
+    </a-row>
+    <a-row>
+      <a-col style="margin-top: 10px">
+        <div class="term">其他:</div>
+        <div class="content">{{ model.otherChangeContent }}</div>
+      </a-col>
     </a-row>
-
     <template slot="footer">
       <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
     </template>
@@ -65,11 +91,17 @@ export default {
       // 下拉框map
       model: {
         'no': null,
+        'sbId': null,
         'repairId': null,
         'analyzeTime': null,
         'problemDesc': null,
         'checkProcess': null,
         'reasonAnalysis': null,
+        'changeRepairPlanContent': null,
+        'changeSparePlanContent': null,
+        'userTeachContent': null,
+        'sbChangeContent': null,
+        'otherChangeContent': null,
         'improveMeasure': null
       }
     }

+ 206 - 0
src/views/repair/repair-reason/modules/DetailRepairReason.vue

@@ -0,0 +1,206 @@
+<template>
+  <div v-show="visible">
+    <a-row :gutter="48" slot="extra">
+      <a-col :md="48" :sm="48">
+        <span class="table-page-search-submitButtons" style="float: right">
+          <a-button style="margin-left: 8px" @click="handleCancel()">返回</a-button>
+        </span>
+      </a-col>
+    </a-row>
+    <title-divider title="设备信息" width="90px"></title-divider>
+    <detail-list title="" :col="3">
+      <detail-list-item term="设备新号">{{ model.no }}</detail-list-item>
+      <detail-list-item term="设备旧号">{{ model.zbh }}</detail-list-item>
+      <detail-list-item term="型号">{{ model.model }}</detail-list-item>
+      <detail-list-item term="设备名称">{{ model.name }}</detail-list-item>
+    </detail-list>
+    <title-divider title="历史故障原因分析" width="180px"></title-divider>
+    <div class="table-operator" style="margin-bottom:8px;">
+    </div>
+    <a-table
+      :data-source="data"
+      :columns="columns"
+      tableLayout="auto"
+      :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+      :scroll="{x: 1500 }"
+      rowKey="id">
+      <span slot="action" slot-scope="record">
+        <template>
+          <a v-if="$auth('sb-infos-edit')" @click="handleView(record)">查看</a>
+        </template>
+      </span>
+    </a-table>
+    <base-form ref="baseModal" @ok="handleOk"/>
+    <detail ref="detailModal" @ok="handleOk"/>
+
+  </div>
+</template>
+
+<script>
+import DetailList from '@/components/tools/DetailList'
+import { queryRepairReason, deleteRepairReasons, fetchRepairReason, exportRepairReason } from '@/api/repair/repair-reason'
+import BaseForm from './BaseForm'
+import Detail from './Detail'
+import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
+const DetailListItem = DetailList.Item
+
+export default {
+  name: 'DetailRepairReason',
+  components: {
+    DetailList,
+    DetailListItem,
+    BaseForm,
+    Detail,
+    SbInfoSelectModal
+  },
+  props: {
+  },
+  data () {
+    return {
+      status: null,
+      selectedRowKeys: [], // Check here to configure the default column
+      optionAlertShow: false,
+      confirmLoading: false,
+      mdl: {},
+      model: {
+        'id': null,
+        'modelId': null,
+        'no': null,
+        'zbh': null,
+        'name': null,
+        'nameModel': null,
+        'unit': null,
+        'level': null,
+        'useType': null
+      },
+      modalTitle: null,
+      visible: false,
+      typeMap: {},
+      statusMap: {},
+      actionTypeMap: {},
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          width: '70px',
+          customRender: (text, record, index) => {
+            return `${index + 1}`
+          }
+        },
+        {
+          title: '分析时间',
+          dataIndex: 'analyzeTime',
+          width: '200px'
+        },
+        {
+          title: '故障现象',
+          dataIndex: 'problemDesc',
+          ellipsis: true,
+          width: '200px'
+        },
+        {
+          title: '检查处理过程',
+          dataIndex: 'checkProcess',
+          ellipsis: true,
+          width: '200px'
+        },
+        {
+          title: '原因分析',
+          dataIndex: 'reasonAnalysis',
+          ellipsis: true,
+          width: '200px'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          width: '200px',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      data: []
+    }
+  },
+  created () {
+    // 下拉框map
+    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_STANDARD_TYPE)
+    this.periodTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_PERIOD_TYPE)
+    this.actionTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_ACTION_TYPE)
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_JOB_STATUS)
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.model = record
+      this.modalTitle = '历史故障原因分析'
+      queryRepairReason({ sbId: record.id }).then(res => {
+        this.data = res.data
+      })
+    },
+    handleOk () {
+      queryRepairReason({ sbId: this.model.id }).then(res => {
+        this.data = res.data
+      })
+    },
+    handleAdd () {
+      const modal = this.$refs.baseModal
+      modal.base(null, this.model.id)
+    },
+    handleView (record) {
+      fetchRepairReason({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        res.data.partName = record.partName
+        modal.base(res.data)
+      })
+    },
+    handleEdit (record) {
+      fetchRepairReason({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleGenerate (record) {
+      const modal = this.$refs.baseModalInsert
+      modal.base(null, record.id)
+    },
+    handleCancel () {
+      this.visible = false
+      this.selectedRowKeys = []
+      this.confirmLoading = false
+      this.$emit('ok')
+    },
+    batchDelete (id) {
+      let ids = []
+      if (this.BaseTool.String.isBlank(id)) {
+        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()
+      })
+    },
+    doExport () {
+      const parameter = {
+        ...this.queryParam
+      }
+      parameter.modelId = this.model.id
+      exportRepairReason(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    },
+    handleSbSelect () {
+      this.$refs.sbInfoSelectModal.base()
+    },
+    onSelectChange (selectedRowKeys) {
+      this.selectedRowKeys = selectedRowKeys
+    }
+  }
+}
+</script>

+ 0 - 281
src/views/repair/repair-reason/modules/RepairReasonSelectModal.vue

@@ -1,281 +0,0 @@
-<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>
-
-            <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>
-</template>
-
-<script>
-    import { STable, Ellipsis } from '@/components'
-    import Detail from './Detail'
-    import { getRepairReasonPage, fetchRepairReason } from '@/api/repair/repair-reason'
-
-    export default {
-        name: 'RepairReasonSelectModal',
-        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}`
-                        }
-                    },
-                                                                                                                                                {
-                                title: '编号',
-                                dataIndex: 'no'
-                            },
-                                                                                                                                                        {
-                                title: '维修编号ID',
-                                dataIndex: 'repairId'
-                            },
-                                                                                                                                                        {
-                                title: '分析时间',
-                                dataIndex: 'analyzeTime'
-                            },
-                                                                                                                                                        {
-                                title: '问题描述',
-                                dataIndex: 'problemDesc'
-                            },
-                                                                                                                                                        {
-                                title: '原因分析',
-                                dataIndex: 'reasonAnalysis'
-                            },
-                                                                                                                                                        {
-                                title: '改进措施',
-                                dataIndex: 'improveMeasure'
-                            },
-                                                                                            {
-                        title: '操作',
-                        key: 'action',
-                        width: '200px',
-                        align: 'center',
-                        scopedSlots: { customRender: 'action' }
-                    }
-                ],
-                // 下拉框map
-                                // 加载数据方法 必须为 Promise 对象
-                loadData: parameter => {
-                    parameter = {
-                        ...parameter,
-                        ...this.queryParam,
-                        ...this.extraQueryParam,
-                        dataScope: {
-                            sortBy: 'desc',
-                            sortName: 'update_time'
-                        }
-                    }
-                    return getRepairReasonPage(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,
-                isCreated: false
-            }
-        },
-        created () {
-            // 下拉框map
-                    },
-        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) {
-                fetchRepairReason({ 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>

+ 22 - 8
src/views/sb/info/modules/Detail.vue

@@ -16,12 +16,12 @@
             <a-badge :count="numCheckStandard" title="保养项目总数" :number-style="{ backgroundColor: '#52c41a' }">
               <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewCheck()">保养项目</a-button>
             </a-badge>
-            <!--            <a-badge :count="numCheckjob" title="待保养任务总数" :number-style="{ backgroundColor: '#52c41a' }">
-              <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="checkJobTableWaitDoListView()">待保养任务</a-button>
-            </a-badge>-->
             <a-badge :count="numCheckjob" title="待保养项目总数" :number-style="{ backgroundColor: '#52c41a' }">
               <a-button style="margin-left: 8px" type="default" @click="handleViewCheckJob()">保养任务</a-button>
             </a-badge>
+            <a-badge :count="numRepairReason" title="历史故障分析总数" :number-style="{ backgroundColor: '#52c41a' }">
+              <a-button style="margin-left: 8px" type="default" @click="handleViewRepairReason()">历史故障分析</a-button>
+            </a-badge>
             <a-button v-show="model.useType==4" style="margin-left: 8px" type="default" @click="handleMeasure()">检定记录</a-button>
             <a-button style="margin-left: 8px" type="primary" @click="handleCancel()">返回</a-button>
           </span>
@@ -135,9 +135,6 @@
       </detail-list>
       <title-divider title="相关数据" width="90px"></title-divider>
       <q-tabs :activeKey="activeKey" @change="changeTab">
-        <q-tab-pane key="1" tab="报修记录">
-          <repair-application-form-table :type="2" :table-params="{sbId: model.id, sbName: model.name}" ref="repairApplicationFormTable" />
-        </q-tab-pane>
         <q-tab-pane key="2" tab="配件记录">
           <spare-part-used-select-table :type="2" :table-params="{sbId: model.id, modelId: model.modelId}" ref="sparePartUsedSelectTable"/>
         </q-tab-pane>
@@ -151,6 +148,7 @@
     <detail-sb-check-job ref="detailSbCheckJobModal" @ok="handleOk"/>
     <detail-sb-measure ref="detailSbMeasureModal" @ok="handleOk"/>
     <detail-sb-info ref="detailSbInfoModal" @ok="handleOk"/>
+    <detail-repair-reason ref="detailRepairReasonModal" @ok="handleOk"/>
     <part-info-list ref="partInfoList" />
     <!--    <check-job-table-wait-do :type="2" :check-type="2" ref="checkJobTableWaitDo" @ok="handleOk"/>-->
   </a-card>
@@ -164,6 +162,7 @@ import CheckJobTable from '@/views/check/checkjob/modules/CheckJobTable'
 import { fetchFirmProducer } from '@/api/firm/producer'
 import { queryNumCheckStandard } from '@/api/check/checkstandard'
 import { queryNumCheckjob } from '@/api/check/checkjob'
+import { queryNumRepairReason } from '@/api/repair/repair-reason'
 import { queryNumPartInfo } from '@/api/part/info'
 import { queryNumModelbom } from '@/api/sb/modelbom'
 import { queryChildNumSbInfo } from '@/api/sb/info'
@@ -176,6 +175,7 @@ import DetailSbCheck from '@/views/check/checkstandard/modules/DetailSbCheck'
 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 DetailRepairReason from '@/views/repair/repair-reason/modules/DetailRepairReason'
 import PartInfoList from '@/views/part/info/modules/PartInfoList'
 const DetailListItem = DetailList.Item
 
@@ -195,7 +195,8 @@ export default {
     DetailSbCheckJob,
     PartInfoList,
     DetailSbMeasure,
-    DetailSbInfo
+    DetailSbInfo,
+    DetailRepairReason
   },
   data () {
     return {
@@ -291,6 +292,7 @@ export default {
       },
       numCheckStandard: 0,
       numCheckjob: 0,
+      numRepairReason: 0,
       numModelbom: 0,
       numPartInfo: 0,
       numChildSbInfo: 0,
@@ -354,6 +356,11 @@ export default {
       const modal = this.$refs.detailSbCheckJobModal
       modal.base(this.model)
     },
+    handleViewRepairReason (record) {
+      this.visible = false
+      const modal = this.$refs.detailRepairReasonModal
+      modal.base(this.model)
+    },
     handleMeasure (record) {
       this.visible = false
       const modal = this.$refs.detailSbMeasureModal
@@ -372,12 +379,19 @@ export default {
       })
     },
     fetchNum () {
-      Promise.all([queryNumPartInfo({ sbId: this.model.id }), queryNumModelbom({ sbId: this.model.id }), queryNumCheckStandard({ sbId: this.model.id }), queryNumCheckjob({ sbId: this.model.id, status: this.DictCache.VALUE.CHECK_JOB_STATUS.NOT_EXECUTE })])
+      Promise.all([
+        queryNumPartInfo({ sbId: this.model.id }),
+        queryNumModelbom({ sbId: this.model.id }),
+        queryNumCheckStandard({ sbId: this.model.id }),
+        queryNumCheckjob({ sbId: this.model.id, status: this.DictCache.VALUE.CHECK_JOB_STATUS.NOT_EXECUTE }),
+        queryNumRepairReason({ sbId: this.model.id })
+      ])
         .then((values) => {
           this.numPartInfo = values[0].data
           this.numModelbom = values[1].data
           this.numCheckStandard = values[2].data
           this.numCheckjob = values[3].data
+          this.numRepairReason = values[4].data
         })
 
       // 如果是父设备,则要获取子设备的数量,并点击后可以看到子设备的情况