408249787 2 年之前
父节点
当前提交
dccea7863f
共有 2 个文件被更改,包括 100 次插入54 次删除
  1. 79 40
      src/views/repair/application-form/modules/SchemeLibrary.vue
  2. 21 14
      src/views/repair/repair/modules/Detail.vue

+ 79 - 40
src/views/repair/application-form/modules/SchemeLibrary.vue

@@ -7,41 +7,58 @@
     @cancel="handleCancel"
     @cancel="handleCancel"
     :footer="null"
     :footer="null"
   >
   >
-    <div>
-      <a-form layout="inline">
-        <a-row >
-          <a-col :md="8" :sm="24">
-            <a-form-item label="关键字">
-              <a-input v-model="keyword" placeholder="请输入关键字!"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="8" :sm="24">
-            <span class="table-page-search-submitButtons">
-              <a-button type="primary" @click="getInfo">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
-            </span>
-          </a-col>
-        </a-row>
-      </a-form>
+    <div v-show="show">
+      <div>
+        <a-form layout="inline">
+          <a-row >
+            <a-col :md="8" :sm="24">
+              <a-form-item label="关键字">
+                <a-input style="width: 100%" v-model="keyword" placeholder="请输入关键字!"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="8" :sm="24">
+              <a-form-item label="故障类别">
+                <a-select style="width: 200px" v-model="errorTypeId">
+                  <a-select-option v-for="item in errorType" :key="item.id" :value="item.id">
+                    {{ item.title }}
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="8" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" @click="getInfo">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <a-table
+        :columns="columns"
+        :data-source="dataSource"
+        bordered
+        :defaultExpandAllRows="true"
+      >
+        <template v-slot:index="text,record,index">
+          {{ index+1 }}
+        </template>
+        <template v-slot:errorTypeId="text,record">
+          {{ errorType.find(item=>item.id===text).title }}
+        </template>
+        <template v-slot:action="text,record">
+          <a-button type="link" @click="addRepairSchemes(record)"> 获取 </a-button>
+          <a-button type="link" @click="handleViewRepairResolve(record)"> 查看</a-button>
+        </template>
+      </a-table>
     </div>
     </div>
-    <a-table
-      :columns="columns"
-      :data-source="dataSource"
-      bordered
-      :defaultExpandAllRows="true"
-    >
-      <template v-slot:index="text,record,index">
-        {{ index+1 }}
-      </template>
-      <template v-slot:action="text,record">
-        <a-button type="link" @click="addRepairSchemes(record)"> 获取 </a-button>
-      </template>
-    </a-table>
+    <resolve-detail ref="resolveDetail" @ok="handleOk"/>
   </a-modal>
   </a-modal>
 </template>
 </template>
 
 
 <script>
 <script>
-import { getRepairSchemePage, addRepairSchemes } from '@/api/repair/repair'
+import { getRepairSchemePage, addRepairSchemes, getRepairType, fetchRepairScheme } from '@/api/repair/repair'
+import ResolveDetail from '@/views/repair/repair/modules/Detail'
 
 
 export default {
 export default {
   name: 'LongYanSelectSpareForm',
   name: 'LongYanSelectSpareForm',
@@ -49,9 +66,12 @@ export default {
     return {
     return {
       model: null,
       model: null,
       visible: false,
       visible: false,
+      show: true,
       confirmLoading: false,
       confirmLoading: false,
       keyword: '',
       keyword: '',
+      errorTypeId: '',
       dataSource: [],
       dataSource: [],
+      errorType: [],
       columns: [
       columns: [
         {
         {
           title: '序号',
           title: '序号',
@@ -61,31 +81,33 @@ export default {
           scopedSlots: { customRender: 'index' }
           scopedSlots: { customRender: 'index' }
         },
         },
         {
         {
-          title: '维修建议',
-          width: 100,
-          dataIndex: 'opinion'
+          title: '故障描述',
+          width: 150,
+          dataIndex: 'errorContent'
         },
         },
         {
         {
-          title: '方案提供者',
-          dataIndex: 'createdUserName',
-          width: 120
+          title: '方案描述',
+          dataIndex: 'opinion',
+          width: 150
         },
         },
         {
         {
-          title: '方案提供时间',
-          dataIndex: 'createdTime',
-          width: 150
+          title: '故障类别',
+          dataIndex: 'errorTypeId',
+          width: 100,
+          scopedSlots: { customRender: 'errorTypeId' }
         },
         },
         {
         {
           title: '操作',
           title: '操作',
           key: 'action',
           key: 'action',
           align: 'center',
           align: 'center',
-          width: 150,
+          width: 100,
           scopedSlots: { customRender: 'action' }
           scopedSlots: { customRender: 'action' }
         }
         }
       ]
       ]
     }
     }
   },
   },
   components: {
   components: {
+    ResolveDetail
   },
   },
   props: {
   props: {
   },
   },
@@ -94,6 +116,9 @@ export default {
   },
   },
   methods: {
   methods: {
     base (record) {
     base (record) {
+      getRepairType().then(res => {
+        this.errorType = res.data
+      })
       this.visible = true
       this.visible = true
       this.model = record
       this.model = record
       console.log(record)
       console.log(record)
@@ -102,6 +127,7 @@ export default {
     getInfo () {
     getInfo () {
       getRepairSchemePage({
       getRepairSchemePage({
         keyword: this.keyword,
         keyword: this.keyword,
+        errorTypeId: this.errorTypeId,
         dataScope: {
         dataScope: {
           sortBy: 'desc',
           sortBy: 'desc',
           sortName: 'created_time'
           sortName: 'created_time'
@@ -112,8 +138,16 @@ export default {
     },
     },
     resetSearchForm () {
     resetSearchForm () {
       this.keyword = ''
       this.keyword = ''
+      this.errorTypeId = ''
       this.getInfo()
       this.getInfo()
     },
     },
+    handleViewRepairResolve (record) {
+      this.show = false
+      fetchRepairScheme({ id: record.id }).then(res => {
+        const modal = this.$refs.resolveDetail
+        modal.base(res.data)
+      })
+    },
     addRepairSchemes (val) {
     addRepairSchemes (val) {
       addRepairSchemes({
       addRepairSchemes({
         id: val.id,
         id: val.id,
@@ -123,9 +157,14 @@ export default {
         this.handleCancel()
         this.handleCancel()
       })
       })
     },
     },
+    handleOk () {
+      this.show = true
+    },
     handleCancel () {
     handleCancel () {
       this.visible = false
       this.visible = false
       this.confirmLoading = false
       this.confirmLoading = false
+      this.keyword = ''
+      this.errorTypeId = ''
       this.$emit('ok')
       this.$emit('ok')
     }
     }
   }
   }

+ 21 - 14
src/views/repair/repair/modules/Detail.vue

@@ -1,20 +1,22 @@
 <template>
 <template>
-  <a-card :bordered='false' 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 style='margin-left: 8px' type='default' @click='handleCancel()'>返回</a-button>
-              </span>
+  <a-card :bordered="false" 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 style="margin-left: 8px" type="default" @click="handleCancel()">返回</a-button>
+        </span>
       </a-col>
       </a-col>
     </a-row>
     </a-row>
-    <detail-list title='' :col='2'>
-      <detail-list-item term='方案提供者'>{{ model.createdUserName }}</detail-list-item>
-      <detail-list-item term='方案提供时间'>{{ model.createdTime }}</detail-list-item>
-      <detail-list-item term='方案修改者'>{{ model.updateUserName }}</detail-list-item>
-      <detail-list-item term='方案修改时间'>{{ model.updateTime }}</detail-list-item>
+    <detail-list title="" :col="2">
+      <detail-list-item term="方案提供者">{{ model.createdUserName }}</detail-list-item>
+      <detail-list-item term="方案提供时间">{{ model.createdTime }}</detail-list-item>
+      <detail-list-item term="方案修改者">{{ model.updateUserName }}</detail-list-item>
+      <detail-list-item term="方案修改时间">{{ model.updateTime }}</detail-list-item>
     </detail-list>
     </detail-list>
-    <detail-list title='' :col='1'>
-      <detail-list-item term='维修意见'>{{ model.opinion }}</detail-list-item>
+    <detail-list title="" :col="2">
+      <detail-list-item term="故障描述">{{ model.errorContent }}</detail-list-item>
+      <detail-list-item term="故障类别">{{ errorType.find(item=>item.id===model.errorTypeId).title }}</detail-list-item>
+      <detail-list-item term="维修意见">{{ model.opinion }}</detail-list-item>
     </detail-list>
     </detail-list>
     <title-divider title="维修方案" width="90px"></title-divider>
     <title-divider title="维修方案" width="90px"></title-divider>
     <detail-list title="" :col="1">
     <detail-list title="" :col="1">
@@ -41,6 +43,7 @@
 
 
 <script>
 <script>
 import DetailList from '@/components/tools/DetailList'
 import DetailList from '@/components/tools/DetailList'
+import { getRepairType } from '@/api/repair/repair'
 
 
 const DetailListItem = DetailList.Item
 const DetailListItem = DetailList.Item
 
 
@@ -50,10 +53,11 @@ export default {
     DetailList,
     DetailList,
     DetailListItem
     DetailListItem
   },
   },
-  data() {
+  data () {
     return {
     return {
       confirmLoading: false,
       confirmLoading: false,
       mdl: {},
       mdl: {},
+      errorType: [],
       modalTitle: null,
       modalTitle: null,
       visible: false,
       visible: false,
       // 下拉框map
       // 下拉框map
@@ -74,6 +78,9 @@ export default {
   methods: {
   methods: {
     base (record) {
     base (record) {
       this.visible = true
       this.visible = true
+      getRepairType().then(res => {
+        this.errorType = res.data
+      })
       this.modalTitle = '方案详情'
       this.modalTitle = '方案详情'
       this.model = record
       this.model = record
     },
     },