chenyuehu 3 éve
szülő
commit
969b2fcbb7
1 módosított fájl, 52 hozzáadás és 22 törlés
  1. 52 22
      src/views/repair/application-form/modules/DetailRepair.vue

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

@@ -4,9 +4,12 @@
       <a-row :gutter="48" slot="extra">
         <a-col :md="48" :sm="48">
           <span class="table-page-search-submitButtons" style="float: right">
+            <a-button v-if="showSbFlag" style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewBom()">备件BOM</a-button>
+            <a-button v-if="showSbFlag" 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" 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.ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" title="是否要接收?" @confirm="receive">
-              <a-button>接收</a-button>
+              <a-button style="margin-left: 16px">接收</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>
             <a-button v-if="$auth('repair-application-forms-dispatch') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" style="margin-left: 8px" type="primary" @click="handleDispatch">转派</a-button>
@@ -81,26 +84,26 @@
           </div>
         </a-layout-sider>
       </a-layout>
-        <title-divider title="维修项目" width="90px"></title-divider>
-        <div class="table-operator" v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status">
-          <a-button type="primary" @click="handleRepairProjectSelect">
-            <a-icon type="plus"/>
-            添加
-          </a-button>
-        </div>
-        <a-table
-          :data-source="data"
-          :columns="columns"
-          tableLayout="auto"
-          rowKey="id">
-          <span slot="action" slot-scope="record">
-            <template>
-              <a-popconfirm v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" title="是否要删除该条数据?" @confirm="batchDelete(record.relationId)">
-                <a>删除</a>
-              </a-popconfirm>
-            </template>
-          </span>
-          </a-table>
+      <title-divider title="维修项目" width="90px"></title-divider>
+      <div class="table-operator" v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status">
+        <a-button type="primary" @click="handleRepairProjectSelect">
+          <a-icon type="plus"/>
+          添加
+        </a-button>
+      </div>
+      <a-table
+        :data-source="data"
+        :columns="columns"
+        tableLayout="auto"
+        rowKey="id">
+        <span slot="action" slot-scope="record">
+          <template>
+            <a-popconfirm v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" title="是否要删除该条数据?" @confirm="batchDelete(record.relationId)">
+              <a>删除</a>
+            </a-popconfirm>
+          </template>
+        </span>
+      </a-table>
       <title-divider title="备件清单" width="90px"></title-divider>
       <div class="table-operator" v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status">
         <a-button type="primary" @click="handleSpareStoreSelect">
@@ -202,6 +205,8 @@
     <fee-detail ref="feeDetail" @ok="handleOk" />
     <reason-base-form ref="reasonForm" @ok="handleOk" />
     <reason-detail ref="reasonDetail" @ok="handleOk" />
+    <detail-sb-bom ref="detailSbBomModal" @ok="handleOk"/>
+    <detail-sb-check ref="detailSbCheckModal" @ok="handleOk"/>
   </div>
 </template>
 
@@ -229,7 +234,9 @@ import { deleteRepairFees, fetchRepairFee, queryRepairFee } from '@/api/repair/f
 import ReasonBaseForm from '@/views/repair/repair-reason/modules/BaseForm'
 import ReasonDetail from '@/views/repair/repair-reason/modules/Detail'
 import { deleteRepairReasons, fetchRepairReason, queryRepairReason } from '@/api/repair/repair-reason'
-
+import DetailSbBom from '@/views/sb/modelbom/modules/DetailSbBom'
+import DetailSbCheck from '@/views/check/checkstandard/modules/DetailSbCheck'
+import { fetchSbInfo } from '@/api/sb/info'
 const DetailListItem = DetailList.Item
 
 export default {
@@ -237,6 +244,8 @@ export default {
   components: {
     CheckForm,
     DetailList,
+    DetailSbCheck,
+    DetailSbBom,
     ReasonBaseForm,
     ReasonDetail,
     DetailListItem,
@@ -262,6 +271,8 @@ export default {
       needStopMap: {},
       dispatchList: [],
       visible: false,
+      showSbFlag: false,
+      sbInfo: {},
       // 下拉框map
       sourceMap: {},
       typeMap: {},
@@ -495,10 +506,19 @@ export default {
   methods: {
     base (record) {
       this.visible = true
+      this.showSbFlag = false
       this.modalTitle = '详情'
       this.model = record
       this.activeKey = 'a'
       this.dispatchList = JSON.parse(record.repairDispatchList)
+      const sbId = record.sbId
+      if (sbId) {
+        fetchSbInfo({ id: sbId }).then(res => {
+          this.sbInfo = res.data
+          this.showSbFlag = true
+        })
+      }
+
       this.init()
     },
     init () {
@@ -515,6 +535,16 @@ export default {
         this.dataReason = res.data
       })
     },
+    handleViewBom (record) {
+      this.visible = false
+      const modal = this.$refs.detailSbBomModal
+      modal.base(this.sbInfo)
+    },
+    handleViewCheck (record) {
+      this.visible = false
+      const modal = this.$refs.detailSbCheckModal
+      modal.base(this.sbInfo)
+    },
     handleCancel () {
       this.visible = false
       this.confirmLoading = false