xiongchao 3 years ago
parent
commit
820f1be006

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

@@ -44,7 +44,7 @@
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-select v-decorator="['needStop', {initialValue: DictCache.VALUE.YES_NO.NO,rules: [{required: true, message: '是否停机不能为空'}]}]" placeholder="请选择">
+            <a-select @change="changeNeedStop" v-decorator="['needStop', {initialValue: DictCache.VALUE.YES_NO.NO,rules: [{required: true, message: '是否停机不能为空'}]}]" placeholder="请选择">
               <a-select-option
                 v-for="(label,value) in needStopMap"
                 :key="value"
@@ -54,7 +54,7 @@
             </a-select>
           </a-form-item>
         </row-item>
-        <row-item>
+        <row-item v-show="needStop === 0">
           <a-form-item
             label="要求日期"
             :labelCol="BaseTool.Constant.labelCol"
@@ -250,6 +250,7 @@ export default {
       levelMap: {},
       questionMap: {},
       treeData: [],
+      needStop: 0,
       needStopMap: {},
       statusMap: {},
       userInfo: this.$store.getters.userInfo,
@@ -390,6 +391,9 @@ export default {
         }
       })
     },
+    changeNeedStop (value) {
+      this.needStop = value
+    },
     handleCancel (values) {
       this.visible = false
       this.confirmLoading = false

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

@@ -6,8 +6,8 @@
           <span class="table-page-search-submitButtons" style="float: right">
             <a-button v-if="$auth('repair-application-forms-finish')" style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewBom()">备件BOM</a-button>
             <a-button v-if="$auth('repair-application-forms-finish')" 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 || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" type="primary" @click="handleAssign">派工</a-button>
-            <a-popconfirm v-if="$auth('repair-application-forms-deal') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" title="是否要接收?" @confirm="receive">
+            <a-button v-if="$auth('repair-application-forms-assign') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" style="margin-left: 16px" 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.REBACK === model.status)" title="是否要接收?" @confirm="receive">
               <a-button style="margin-left: 8px">接收</a-button>
             </a-popconfirm>
             <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>

+ 28 - 17
src/views/repair/application-form/modules/RepairApplicationFormTable.vue

@@ -45,13 +45,11 @@
     >
       <span slot="action" slot-scope="record">
         <template>
-<!--          <a @click="handleView(record)">查看</a>-->
+          <!--          <a @click="handleView(record)">查看</a>-->
           <template v-if="[1,2].includes(type)">
-<!--            <operation-button
-              v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === record.status && $auth('repair-application-forms-edit')"
-              @click="handleEdit(record)" >修改</operation-button>-->
             <operation-button
-              v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === record.status && $auth('repair-application-forms-del')"
+              @click="handleViewReason(record)">原因分析</operation-button>
+            <operation-button
               :type="2"
               title="是否要删除该条数据?"
               @confirm="batchDelete(record.id)">删除</operation-button>
@@ -67,6 +65,7 @@
     </s-table>
     <imp-base-form ref="baseModal" @ok="handleOk"/>
     <detail ref="detailModal" @ok="handleOk"/>
+    <detail-repair-reason ref="detailRepairReason" @ok="handleOk"/>
   </a-card>
 </template>
 
@@ -75,12 +74,15 @@ import { STable, Ellipsis } from '@/components'
 import ImpBaseForm from './ImpBaseForm'
 import Detail from './Detail'
 import { getRepairApplicationFormPage, deleteRepairApplicationForms, fetchRepairApplicationForm, exportRepairApplicationForm } from '@/api/repair/application-form'
+import DetailRepairReason from '@/views/repair/repair-reason/modules/DetailRepairReason'
+
 export default {
   name: 'RepairApplicationFormTable',
   components: {
     STable,
     Ellipsis,
     ImpBaseForm,
+    DetailRepairReason,
     Detail
   },
   props: {
@@ -140,22 +142,24 @@ export default {
         //  return record.partName
         // }
         // },
-        // {
-        // title: '报修人',
-        // checked: true,
-        // dataIndex: 'userName'
-        // },
+        {
+          title: '报修人',
+          width: '150px',
+          checked: true,
+          dataIndex: 'userName'
+        },
         {
           title: '维修人',
           checked: true,
           width: '150px',
           dataIndex: 'repairUserName'
         },
-        // {
-        // title: '报修单号',
-        // checked: true,
-        // dataIndex: 'no'
-        // },
+        {
+          title: '报修单号',
+          checked: true,
+          width: '200px',
+          dataIndex: 'no'
+        },
         {
           title: '报修来源',
           checked: true,
@@ -191,13 +195,13 @@ export default {
         {
           title: '报修时间',
           checked: true,
-          width: '150px',
+          width: '200px',
           dataIndex: 'applyTime'
         },
         {
           title: '维修完成时间',
           checked: true,
-          width: '150px',
+          width: '200px',
           dataIndex: 'repairEndTime'
         },
         // {
@@ -212,6 +216,8 @@ export default {
           title: '操作',
           checked: true,
           key: 'action',
+          width: '200px',
+          fixed: 'right',
           align: 'center',
           scopedSlots: { customRender: 'action' }
         }
@@ -353,6 +359,11 @@ export default {
     handleDispatching (record) {
       const modal = this.$refs.dispatchBaseForm
       modal.base(record)
+    },
+    handleViewReason (record) {
+      this.visible = false
+      const modal = this.$refs.detailRepairReason
+      modal.base(record)
     }
   }
 }

+ 8 - 1
src/views/repair/repair-reason/RepairReason.vue

@@ -122,6 +122,12 @@ export default {
             return this.BaseTool.Object.getField(this.typeMap, text)
           }
         },
+        {
+          title: '改进内容',
+          dataIndex: 'changeRepairPlanContent',
+          ellipsis: true,
+          width: '200px'
+        },
         {
           title: '操作',
           key: 'action',
@@ -148,7 +154,8 @@ export default {
       },
       selectedRowKeys: [],
       selectedRows: [],
-
+      typeMap: {},
+      statusMap: {},
       options: {
         alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
         rowSelection: {

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

@@ -92,6 +92,7 @@ export default {
     return {
       confirmLoading: false,
       mdl: {},
+      typeMap: {},
       modalTitle: null,
       visible: false,
       // 下拉框map

+ 38 - 16
src/views/repair/repair-reason/modules/DetailRepairReason.vue

@@ -1,5 +1,12 @@
 <template>
-  <div v-show="visible">
+  <a-modal
+    :title="modalTitle"
+    :width="1000"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    class="ant-modal2"
+    @cancel="handleCancel"
+  >
     <a-row :gutter="48" slot="extra">
       <a-col :md="48" :sm="48">
         <span class="table-page-search-submitButtons" style="float: right">
@@ -7,14 +14,17 @@
         </span>
       </a-col>
     </a-row>
-    <title-divider title="设备信息" width="90px"></title-divider>
+    <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-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.applyTime }}</detail-list-item>
+      <detail-list-item term="维修结束时间">{{ model.repairEndTime }}</detail-list-item>
     </detail-list>
-    <title-divider title="历史故障原因分析" width="180px"></title-divider>
+    <title-divider title="原因分析" width="180px"></title-divider>
     <div class="table-operator" style="margin-bottom:8px;">
     </div>
     <a-table
@@ -32,8 +42,7 @@
     </a-table>
     <base-form ref="baseModal" @ok="handleOk"/>
     <detail ref="detailModal" @ok="handleOk"/>
-
-  </div>
+  </a-modal>
 </template>
 
 <script>
@@ -80,11 +89,14 @@ export default {
         {
           title: '序号',
           dataIndex: 'index',
-          width: '70px',
           customRender: (text, record, index) => {
             return `${index + 1}`
           }
         },
+        {
+          title: '编号',
+          dataIndex: 'no'
+        },
         {
           title: '分析时间',
           dataIndex: 'analyzeTime',
@@ -97,14 +109,23 @@ export default {
           width: '200px'
         },
         {
-          title: '检查处理过程',
+          title: '处理过程',
           dataIndex: 'checkProcess',
           ellipsis: true,
           width: '200px'
         },
         {
-          title: '原因分析',
-          dataIndex: 'reasonAnalysis',
+          title: '改进措施类别',
+          dataIndex: 'type',
+          ellipsis: true,
+          width: '200px',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.typeMap, text)
+          }
+        },
+        {
+          title: '改进内容',
+          dataIndex: 'changeRepairPlanContent',
           ellipsis: true,
           width: '200px'
         },
@@ -116,24 +137,25 @@ export default {
           scopedSlots: { customRender: 'action' }
         }
       ],
+      typeMap: {},
       data: []
     }
   },
   created () {
     // 下拉框map
-
+    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_REASON_TYPE)
   },
   methods: {
     base (record) {
       this.visible = true
       this.model = record
       this.modalTitle = '历史故障原因分析'
-      queryRepairReason({ sbId: record.id }).then(res => {
+      queryRepairReason({ repairId: this.model.id }).then(res => {
         this.data = res.data
       })
     },
     handleOk () {
-      queryRepairReason({ sbId: this.model.id }).then(res => {
+      queryRepairReason({ repairId: this.model.id }).then(res => {
         this.data = res.data
       })
     },

+ 2 - 4
src/views/sb/info/modules/Detail.vue

@@ -177,7 +177,6 @@ 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 RepairReasonTable from '@/views/repair/repair-reason/modules/RepairReasonTable'
 import RepairFeeTable from '@/views/repair/fee/modules/RepairFeeTable'
 import PartInfoList from '@/views/part/info/modules/PartInfoList'
 const DetailListItem = DetailList.Item
@@ -199,7 +198,6 @@ export default {
     PartInfoList,
     DetailSbMeasure,
     DetailSbInfo,
-    RepairReasonTable,
     RepairFeeTable
   },
   data () {
@@ -400,8 +398,8 @@ export default {
         this.$refs.spotJobTable.handleOk()
         return
       }
-      if (this.activeKey === '4' && this.BaseTool.Object.isNotBlank(this.$refs.repairReasonTable)) {
-        this.$refs.repairReasonTable.handleOk()
+      if (this.activeKey === '4' && this.BaseTool.Object.isNotBlank(this.$refs.repairApplicationFormTable)) {
+        this.$refs.repairApplicationFormTable.handleOk()
       }
       if (this.activeKey === '5' && this.BaseTool.Object.isNotBlank(this.$refs.repairFeeTable)) {
         this.$refs.repairFeeTable.handleOk()