Эх сурвалжийг харах

Merge branch 'demo_' of http://123.60.19.203:8088/hitch/hitch-antd

guarantee-lsq 2 жил өмнө
parent
commit
2ceb8059e7

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

@@ -7,41 +7,58 @@
     @cancel="handleCancel"
     :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>
-    <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>
 </template>
 
 <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 {
   name: 'LongYanSelectSpareForm',
@@ -49,9 +66,12 @@ export default {
     return {
       model: null,
       visible: false,
+      show: true,
       confirmLoading: false,
       keyword: '',
+      errorTypeId: '',
       dataSource: [],
+      errorType: [],
       columns: [
         {
           title: '序号',
@@ -61,31 +81,33 @@ export default {
           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: '操作',
           key: 'action',
           align: 'center',
-          width: 150,
+          width: 100,
           scopedSlots: { customRender: 'action' }
         }
       ]
     }
   },
   components: {
+    ResolveDetail
   },
   props: {
   },
@@ -94,6 +116,9 @@ export default {
   },
   methods: {
     base (record) {
+      getRepairType().then(res => {
+        this.errorType = res.data
+      })
       this.visible = true
       this.model = record
       console.log(record)
@@ -102,6 +127,7 @@ export default {
     getInfo () {
       getRepairSchemePage({
         keyword: this.keyword,
+        errorTypeId: this.errorTypeId,
         dataScope: {
           sortBy: 'desc',
           sortName: 'created_time'
@@ -112,8 +138,16 @@ export default {
     },
     resetSearchForm () {
       this.keyword = ''
+      this.errorTypeId = ''
       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({
         id: val.id,
@@ -123,9 +157,14 @@ export default {
         this.handleCancel()
       })
     },
+    handleOk () {
+      this.show = true
+    },
     handleCancel () {
       this.visible = false
       this.confirmLoading = false
+      this.keyword = ''
+      this.errorTypeId = ''
       this.$emit('ok')
     }
   }

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

@@ -1,20 +1,22 @@
 <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-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 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>
     <title-divider title="维修方案" width="90px"></title-divider>
     <detail-list title="" :col="1">
@@ -41,6 +43,7 @@
 
 <script>
 import DetailList from '@/components/tools/DetailList'
+import { getRepairType } from '@/api/repair/repair'
 
 const DetailListItem = DetailList.Item
 
@@ -50,10 +53,11 @@ export default {
     DetailList,
     DetailListItem
   },
-  data() {
+  data () {
     return {
       confirmLoading: false,
       mdl: {},
+      errorType: [],
       modalTitle: null,
       visible: false,
       // 下拉框map
@@ -74,6 +78,9 @@ export default {
   methods: {
     base (record) {
       this.visible = true
+      getRepairType().then(res => {
+        this.errorType = res.data
+      })
       this.modalTitle = '方案详情'
       this.model = record
     },

+ 1 - 1
src/views/sb/info/SbInfo.vue

@@ -386,7 +386,7 @@ export default {
         {
           title: '设备编号',
           dataIndex: 'no',
-          width: 120,
+          width: 150,
           checked: true
         },
         {

+ 29 - 3
src/views/sb/info/modules/BaseForm.vue

@@ -53,7 +53,7 @@
                 v-decorator="['ppNo']"/>
             </a-form-item>
           </a-col>
-<!--          <a-col :lg="12" :md="24" :sm="24">
+          <!--          <a-col :lg="12" :md="24" :sm="24">
             <a-form-item
               label="是否子设备"
               :labelCol="BaseTool.Constant.labelCol"
@@ -210,7 +210,7 @@
         </a-col>
       </a-row>
       <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
-<!--        <a-col :lg="12" :md="24" :sm="24">
+        <!--        <a-col :lg="12" :md="24" :sm="24">
           <a-form-item
             label="大小/尺寸"
             :labelCol="BaseTool.Constant.labelCol"
@@ -821,7 +821,23 @@
               :labelCol="BaseTool.Constant.labelCol"
               :wrapperCol="BaseTool.Constant.wrapperCol"
             >
-              <a-select @change="childChange" v-decorator="['isMeasure', { rules: [{required: true, message: '是否需要检定不能为空'}]}]" placeholder="请选择">
+              <a-select @change="isMeasureChange" v-decorator="['isMeasure', { rules: [{required: true, message: '是否需要检定不能为空'}]}]" placeholder="请选择">
+                <a-select-option
+                  v-for="(label,value) in yesNoMap"
+                  :key="value"
+                  :label="label"
+                  :value="parseInt(value)">{{ label }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="是否自检"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-select v-decorator="['isSelf', { rules: [{required: isSelfRequired, message: '是否需要检定不能为空'}]}]" placeholder="请选择">
                 <a-select-option
                   v-for="(label,value) in yesNoMap"
                   :key="value"
@@ -991,6 +1007,7 @@ export default {
       useFileList: [], // 使用手册
       recheckFileList: [], // 验收手册
       sbFileList: [], // 设备图片,
+      isSelfRequired: false, // 是否自检,
       uploadUrl: uploadUrl,
       qrcodesrc: null,
       id: null,
@@ -1163,6 +1180,7 @@ export default {
           'model',
           'cph',
           'isMeasure',
+          'isSelf',
           'positionId',
           'producerName',
           'useArea',
@@ -1465,6 +1483,14 @@ export default {
         })
       }
     },
+    // 设置为需要检定的,是否自检也要设置
+    isMeasureChange (value) {
+      if (value === this.DictCache.VALUE.YES_NO.YES) {
+        this.isSelfRequired = true
+      } else {
+        this.isSelfRequired = false
+      }
+    },
     handleSbSelect () {
       this.$refs.sbInfoSelectModal.base({}, { isChild: this.DictCache.VALUE.SB_IS_CHILD.IS_PARENT })
     },

+ 2 - 2
vue.config.js

@@ -100,11 +100,11 @@ const vueConfig = {
 
   devServer: {
     // development server port 8000
-    port: 8050,
+    port: 8000,
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://localhost:5050',
+        target: 'http://localhost:5000',
         ws: false,
         changeOrigin: true,
         pathRewrite: {