whj 11 months ago
parent
commit
a89215d0e7

+ 7 - 1
src/views/check/checkjob/PollingCheckJobFinish.vue

@@ -1,11 +1,17 @@
 <template>
-  <CheckJob :check-type="2" :status="DictCache.VALUE.CHECK_JOB_STATUS.FINISHED" :status-list="[]"/>
+  <CheckJob :check-type="2" :sbId="sbId" :status="DictCache.VALUE.CHECK_JOB_STATUS.FINISHED" :status-list="[]"/>
 </template>
 
 <script>
 import CheckJob from './CheckJob'
 export default {
   name: 'PollingCheckJobFinish',
+  props: {
+    sbId: {
+      type: String,
+      default: null
+    }
+  },
   components: {
     CheckJob
   }

+ 2 - 1
src/views/dashboard/RepairReportSbInfo.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="page-header-index-wide">
-    <a-card :title="title" :loading="loading" v-show="visible" :bordered="false" :body-style="{padding: '0'}">
+    <a-card :title="title" :loading="loading" :bordered="false" :body-style="{padding: '0'}">
       <div class="salesCard">
         <a-tabs default-active-key="1" size="large" :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}">
           <div class="extra-wrapper" slot="tabBarExtraContent">
@@ -125,6 +125,7 @@ export default {
   },
   created () {
     this.categoryMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
+    this.base()
   },
   mounted () {
     /* this.$nextTick(function () {

+ 1 - 0
src/views/dashboard/RepairReportSbInfoFee.vue

@@ -125,6 +125,7 @@ export default {
   },
   created () {
     this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FEE_TYPE)
+    this.base()
   },
   mounted () {
     /* this.$nextTick(function () {

+ 8 - 1
src/views/remote/measure/RemoteMeasure.vue

@@ -104,6 +104,12 @@ export default {
     BaseForm,
     Detail
   },
+  props: {
+    sbId: {
+      type: String,
+      default: null
+    }
+  },
   data () {
     return {
       advanced: false,
@@ -111,7 +117,7 @@ export default {
       map: {},
       // 查询参数
       queryParam: {
-        sbId: this.$route.query.sbId
+        ...this.$route.query
       },
       // 表头
       columns: [
@@ -175,6 +181,7 @@ export default {
         parameter = {
           ...parameter,
           ...this.queryParam,
+          sbId: this.sbId,
           dataScope: {
             sortBy: 'desc',
             sortName: 'update_time'

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

@@ -261,6 +261,10 @@ export default {
     status: {
       type: Number,
       default: null
+    },
+    sbId: {
+      type: String,
+      default: null
     }
   },
   data () {
@@ -429,6 +433,7 @@ export default {
           ...parameter,
           ...this.queryParam,
           type: null,
+          sbId: this.sbId,
           dataScope: {
             sortBy: 'asc, desc',
             sortName: 'status, apply_time'

+ 7 - 0
src/views/repair/fee/RepairFee.vue

@@ -123,6 +123,12 @@ export default {
     BaseForm,
     Detail
   },
+  props: {
+    sbId: {
+      type: String,
+      default: null
+    }
+  },
   data () {
     return {
       // 查询参数
@@ -239,6 +245,7 @@ export default {
         parameter = {
           ...parameter,
           ...this.queryParam,
+          sbId: this.sbId,
           dataScope: {
             sortBy: 'desc',
             sortName: 'update_time'

+ 8 - 7
src/views/sb/info/modules/ChangeLogsDetail.vue

@@ -1,10 +1,6 @@
 <template>
-  <a-modal
+  <a-card
     title="变动记录"
-    :width="1300"
-    :visible="visible"
-    :confirmLoading="confirmLoading"
-    @cancel="handleCancel"
   >
     <s-table
       ref="table"
@@ -19,7 +15,7 @@
     <template slot="footer">
       <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">确定</a-button>
     </template>
-  </a-modal>
+  </a-card>
 </template>
 
 <script>
@@ -32,6 +28,12 @@ export default {
   components: {
     STable
   },
+  props: {
+    model: {
+      type: Object,
+      default: () => {}
+    }
+  },
   data () {
     return {
       confirmLoading: false,
@@ -95,7 +97,6 @@ export default {
   },
   methods: {
     base (record) {
-      this.visible = true
       console.log(record)
       this.model = record
       this.$refs.table.refresh()

+ 65 - 27
src/views/sb/info/modules/DetailC.vue

@@ -35,6 +35,7 @@
       <a-space>
         <a-button style="margin-left: 20px" type="default" @click="handleEdit()">修改</a-button>
         <a-button type="default" :loading="confirmLoading" @click="handleOk()">刷新</a-button>
+        <a-button type="default" :loading="confirmLoading" @click="handleTuiCalendar(1)">检点日历</a-button>
         <a-button type="primary" @click="handleBack">返回</a-button>
 
       </a-space>
@@ -54,16 +55,27 @@ import LocationList from './detail/LocationList.vue'
 import SbModelBom from '@/views/sb/modelbom/SbModelBom.vue'
 import CheckStandard from '@/views/check/checkstandard/CheckStandard.vue'
 import CheckJob from '@/views/check/checkjob/CheckJob.vue'
+import PollingCheckJobFinish from '@/views/check/checkjob/PollingCheckJobFinish.vue'
 import DetailSbMeasure from './detail/DetailSbCheck.vue'
+import ChangeLogsDetail from './ChangeLogsDetail.vue'
+import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable.vue'
+import RepairForm from '@/views/repair/application-form/RepairForm.vue'
+import RepairFee from '@/views/repair/fee/RepairFee.vue'
+import SbStatusLog from '@/views/sb/status-log/SbStatusLog.vue'
+import SbStopLog from '@/views/sb/stop-logs/SbStopLog.vue'
+import RemoteMeasure from '@/views/remote/measure/RemoteMeasure.vue'
+import SbTreeModal from './SbTreeModal'
+import RepairReportSbInfo from '@/views/dashboard/RepairReportSbInfo.vue'
+import RepairReportSbInfoFee from '@/views/dashboard/RepairReportSbInfoFee.vue'
 
 // api
 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 { queryNumSbLocation } from '@/api/sb/location'
 import { queryNumModelbom } from '@/api/sb/modelbom'
 import { fetchSbInfo, queryChildNumSbInfo } from '@/api/sb/info'
+import { queryNumCheckjob, queryTuiCalendarIgnores } from '@/api/check/checkjob'
 
 export default {
   name: 'DetailC',
@@ -76,7 +88,18 @@ export default {
     SbModelBom,
     CheckStandard,
     CheckJob,
-    DetailSbMeasure
+    DetailSbMeasure,
+    ChangeLogsDetail,
+    SparePartUsedSelectTable,
+    PollingCheckJobFinish,
+    RepairForm,
+    RepairFee,
+    SbStatusLog,
+    SbStopLog,
+    RemoteMeasure,
+    SbTreeModal,
+    RepairReportSbInfo,
+    RepairReportSbInfoFee
   },
   data () {
     return {
@@ -105,17 +128,11 @@ export default {
         case 0:
         case 1:
         case 7:
+        case 8:
           props = {
             model: this.model
           }
           break
-        case 2:
-        case 3:
-        case 4:
-          props = {
-            sbId: this.model.id
-          }
-          break
         case 5:
         case 6:
           props = {
@@ -124,6 +141,11 @@ export default {
             sbNo: this.model.no
           }
           break
+        default:
+          props = {
+            sbId: this.model.id
+          }
+          break
       }
       return props
     },
@@ -214,84 +236,84 @@ export default {
           icon: 'appstore',
           show: true,
           isMy: false,
-          component: 'DetailSbMeasure'
+          component: 'ChangeLogsDetail'
         },
         {
           name: '配件记录',
           icon: 'appstore',
           show: true,
           isMy: false,
-          component: 'DetailSbMeasure'
+          component: 'SparePartUsedSelectTable'
         },
         {
           name: '保养记录',
           icon: 'appstore',
           show: true,
           isMy: false,
-          component: 'DetailSbMeasure'
+          component: 'PollingCheckJobFinish'
         },
         {
           name: '历史故障',
           icon: 'appstore',
           show: true,
           isMy: false,
-          component: 'DetailSbMeasure'
+          component: 'RepairForm'
         },
         {
           name: '历史费用',
           icon: 'appstore',
           show: true,
           isMy: false,
-          component: 'DetailSbMeasure'
+          component: 'RepairFee'
         },
         {
           name: '状态变更记录',
           icon: 'appstore',
           show: true,
           isMy: false,
-          component: 'DetailSbMeasure'
+          component: 'SbStatusLog'
         },
         {
           name: '停机记录',
           icon: 'appstore',
           show: true,
           isMy: false,
-          component: 'DetailSbMeasure'
+          component: 'SbStopLog'
         },
         {
           name: '遥测点位',
           icon: 'appstore',
           show: true,
           isMy: false,
-          component: 'DetailSbMeasure'
+          component: 'RemoteMeasure'
         },
         {
           name: '设备树',
           icon: 'appstore',
           show: true,
           isMy: false,
-          component: 'DetailSbMeasure'
-        },
-        {
-          name: '检点日历',
-          icon: 'appstore',
-          show: true,
-          isMy: false,
-          component: 'DetailSbMeasure'
+          component: 'SbTreeModal'
         },
+        // {
+        //   name: '检点日历',
+        //   icon: 'appstore',
+        //   show: true,
+        //   isMy: false,
+        //   component: 'DetailSbMeasure'
+        // },
         {
           name: '工单分析',
           icon: 'appstore',
           show: true,
           isMy: false,
-          component: 'DetailSbMeasure'
+          component: 'RepairReportSbInfo'
         },
         {
           name: '费用分析',
           icon: 'appstore',
           show: true,
           isMy: false,
-          component: 'DetailSbMeasure'
+          component: 'RepairReportSbInfoFee'
         }
       ]
     }
@@ -322,6 +344,22 @@ export default {
       this.activeKey = 0
       this.$emit('ok')
     },
+    handleTuiCalendar (level) {
+      const that = this
+      queryTuiCalendarIgnores({ sbId: this.model.id, type: level }).then(res => {
+        const a = document.createElement('a')
+        a.target = '_blank'
+        a.href = '/tui-calendar/checkJobCalendar.html?'
+        localStorage.setItem('calendarList', JSON.stringify(res.data.calendarList))
+        var scheduleList = res.data.scheduleList
+        scheduleList.forEach((item) => {
+          item.start = that.BaseTool.Moment(item.start, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+          item.end = that.BaseTool.Moment(item.end, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        })
+        localStorage.setItem('scheduleList', JSON.stringify(scheduleList))
+        a.click()
+      })
+    },
     fetchNum () {
       Promise.all([
         queryNumPartInfo({ sbId: this.model.id }),

+ 8 - 2
src/views/sb/info/modules/SbTreeModal.vue

@@ -27,6 +27,12 @@ export default {
   components: {
     WorkTree
   },
+  props: {
+    sbId: {
+      default: null,
+      type: String
+    }
+  },
   data () {
     return {
       visibleTree: true,
@@ -41,7 +47,7 @@ export default {
   },
   methods: {
     base () {
-      getSbTreeInfo(this.$route.query.id).then(res => {
+      getSbTreeInfo(this.sbId).then(res => {
         console.log(res)
         const list = this.formatTreeData(res.data)
         this.list = list
@@ -115,7 +121,7 @@ export default {
   width: 100%;
 }
 .direction{
-  position: fixed;
+  position: absolute;
   display: flex;
   flex-direction: column;
   justify-content: space-around;

+ 7 - 0
src/views/sb/status-log/SbStatusLog.vue

@@ -83,6 +83,12 @@ export default {
     BaseForm,
     Detail
   },
+  props: {
+    sbId: {
+      type: String,
+      default: null
+    }
+  },
   data () {
     return {
       statusMap: {},
@@ -147,6 +153,7 @@ export default {
         parameter = {
           ...parameter,
           ...this.queryParam,
+          sbId: this.sbId,
           dataScope: {
             sortBy: 'desc',
             sortName: 'created_time'

+ 7 - 0
src/views/sb/stop-logs/SbStopLog.vue

@@ -78,6 +78,12 @@ export default {
     BaseForm,
     Detail
   },
+  props: {
+    sbId: {
+      type: String,
+      default: null
+    }
+  },
   data () {
     return {
       statusMap: {},
@@ -151,6 +157,7 @@ export default {
         parameter = {
           ...parameter,
           ...this.queryParam,
+          sbId: this.sbId,
           dataScope: {
             sortBy: 'desc',
             sortName: 'created_time'

+ 77 - 73
src/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable.vue

@@ -1,75 +1,75 @@
 <template>
-    <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.trim="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>
+  <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.trim="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 type="primary" icon="plus" @click="handleAddSpecial()">新增专用备件</a-button>
-        <a-button v-if="type == 2" type="primary" icon="plus" @click="handleAdd()">新增</a-button>
-        <a-dropdown v-action:edit v-if=" type == 2 && selectedRowKeys.length > 0">
-          <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>
+    <div class="table-operator" >
+      <a-button type="primary" icon="plus" @click="handleAddSpecial()">新增专用备件</a-button>
+      <a-button v-if="type == 2" type="primary" icon="plus" @click="handleAdd()">新增</a-button>
+      <a-dropdown v-action:edit v-if=" type == 2 && selectedRowKeys.length > 0">
+        <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"
-        :customRow="options.customRow"
-        :rowSelection="options.rowSelection"
-        showPagination="auto"
-      >
-        <span slot="action" slot-scope="record1">
-          <template>
-            <a @click="handleView(record1)">查看</a>
-            <a-divider type="vertical" />
-            <a @click="handleEdit(record1)">修改</a>
-            <a-divider type="vertical" />
-            <a-popconfirm v-if="record1.status==1" @confirm="handleFeiqi(record1.id)">
-              <a>废弃</a>
-            </a-popconfirm>
-          </template>
-        </span>
-        <span slot="status" slot-scope="text">
-          <badge
-            :status="DictCache.COLOR.SPARE_PART_USED_STATUS[text]"
-            :text="statusMap[text]" />
-        </span>
-      </s-table>
-      <base-form ref="baseModal" @ok="handleOk"/>
-      <spare-store-select-modal ref="spareStoreSelectModal" @selected="handleSpareStoreSelected"/>
-      <special-spare-base-form ref='specialSpareBaseForm' @ok='handleOk'/>
-      <detail ref="detailModal"/>
-      <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-card>
+    <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>
+          <a-divider type="vertical" />
+          <a @click="handleEdit(record1)">修改</a>
+          <a-divider type="vertical" />
+          <a-popconfirm v-if="record1.status==1" @confirm="handleFeiqi(record1.id)">
+            <a>废弃</a>
+          </a-popconfirm>
+        </template>
+      </span>
+      <span slot="status" slot-scope="text">
+        <badge
+          :status="DictCache.COLOR.SPARE_PART_USED_STATUS[text]"
+          :text="statusMap[text]" />
+      </span>
+    </s-table>
+    <base-form ref="baseModal" @ok="handleOk"/>
+    <spare-store-select-modal ref="spareStoreSelectModal" @selected="handleSpareStoreSelected"/>
+    <special-spare-base-form ref="specialSpareBaseForm" @ok="handleOk"/>
+    <detail ref="detailModal"/>
+    <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-card>
 </template>
 
 <script>
@@ -109,6 +109,10 @@ export default {
     modelParams: {
       type: Object,
       default: () => ({})
+    },
+    sbId: {
+      type: String,
+      default: ''
     }
   },
   watch: {
@@ -132,7 +136,7 @@ export default {
       sbId: null,
       // 查询参数
       queryParam: {
-        sbId: this.$route.query.id
+        sbId: this.sbId
       },
       // 表头
       columns: [
@@ -306,11 +310,11 @@ export default {
     handleEdit (record) {
       fetchSparePartUsed({ id: record.id }).then(res => {
         const modal = this.$refs.baseModal
-        modal.base(res.data,{sbId:record.id, modelId: record.modelId})
+        modal.base(res.data, { sbId: record.id, modelId: record.modelId })
       })
     },
     handleFeiqi (id) {
-      updateSparePartUsed({ id: id, status: 2}).then(res => {
+      updateSparePartUsed({ id: id, status: 2 }).then(res => {
         this.$message.info('废弃成功')
         this.handleOk()
         this.$refs.table.clearSelected()
@@ -367,7 +371,7 @@ export default {
       this.$refs.specialSpareBaseForm.base(params)
     },
     handleAdd () {
-      this.$refs.baseModal.base(null,{sbId:this.tableParams.id, modelId:this.tableParams.modelId, repairId:this.tableParams.repairId})
+      this.$refs.baseModal.base(null, { sbId: this.tableParams.id, modelId: this.tableParams.modelId, repairId: this.tableParams.repairId })
     },
     handleCancel () {
       this.visible = false