|
@@ -1,14 +1,14 @@
|
|
|
<template>
|
|
|
<a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
|
|
|
- <a-row :gutter="48" slot="extra">
|
|
|
+ <a-row :gutter="48" slot="extra" v-show="visibleOther">
|
|
|
<a-col :md="48" :sm="48">
|
|
|
<span class="table-page-search-submitButtons" style="float: right">
|
|
|
<a-button style="margin-left: 8px" @click="handleCancel()">返回</a-button>
|
|
|
</span>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
- <title-divider title="型号信息" width="90px"></title-divider>
|
|
|
- <detail-list title="" :col="3">
|
|
|
+ <title-divider title="型号信息" width="90px" v-show="visibleOther"></title-divider>
|
|
|
+ <detail-list title="" :col="3" v-show="visibleOther">
|
|
|
<detail-list-item term="型号">{{ model.model }}</detail-list-item>
|
|
|
<detail-list-item term="名称型号">{{ model.nameModel }}</detail-list-item>
|
|
|
<detail-list-item term="设备名称">{{ model.name }}</detail-list-item>
|
|
@@ -19,8 +19,8 @@
|
|
|
<detail-list-item term="计量单位">{{ model.unit }}</detail-list-item>
|
|
|
<detail-list-item term="设备原值">{{ BaseTool.Amount.formatter(model.value) }}</detail-list-item>
|
|
|
</detail-list>
|
|
|
- <title-divider title="BOM信息" width="90px"></title-divider>
|
|
|
- <div class="table-operator" style="margin-bottom: 8px;">
|
|
|
+ <title-divider title="BOM信息" width="90px" v-show="visibleOther"></title-divider>
|
|
|
+ <div class="table-operator" style="margin-bottom: 8px;" v-show="visibleOther">
|
|
|
<a-button type="primary" @click="handleAdd">
|
|
|
<a-icon type="plus"/>
|
|
|
单条添加
|
|
@@ -29,6 +29,10 @@
|
|
|
<a-icon type="plus"/>
|
|
|
批量添加
|
|
|
</a-button>
|
|
|
+ <a-button style="margin-left:8px;" type="primary" @click="handleAddSpareInfo">
|
|
|
+ <a-icon type="plus"/>
|
|
|
+ 添加备件
|
|
|
+ </a-button>
|
|
|
<a-button style="margin-left: 8px" type="primary" icon="download" @click="downTemplate">下载模板</a-button>
|
|
|
<a-button style="margin-left: 8px" type="primary" icon="download" @click="doExport">导出</a-button>
|
|
|
<a-button style="margin-left:8px;" type="primary" @click="doImport">
|
|
@@ -38,6 +42,7 @@
|
|
|
</div>
|
|
|
<a-table
|
|
|
:data-source="data"
|
|
|
+ v-show="visibleOther"
|
|
|
:columns="columns"
|
|
|
tableLayout="auto"
|
|
|
rowKey="id">
|
|
@@ -52,6 +57,7 @@
|
|
|
</span>
|
|
|
</a-table>
|
|
|
<base-form ref="baseModal" @ok="handleOk"/>
|
|
|
+ <spare-base-form ref='spareBaseModal' @ok='handleOk'/>
|
|
|
<import-form-add ref="importModal" @ok="handleOk"></import-form-add>
|
|
|
<spare-part-info-select-modal :type="'checkbox'" ref="spareSelectModal" @selected="handleSpareSelected"/>
|
|
|
</a-card>
|
|
@@ -63,6 +69,7 @@ import { addSbModelBomBatch, selectSpareInfoListByModelId, deleteSbModelBoms, ex
|
|
|
import SparePartInfoSelectModal from '@/views/sqarepartmanage/sparepartinfo/modules/SparePartInfoSelectModal'
|
|
|
import BaseForm from './BaseForm'
|
|
|
import ImportFormAdd from './ImportFormAdd'
|
|
|
+import SpareBaseForm from '@/views/sqarepartmanage/sparepartinfo/modules/BaseForm'
|
|
|
const DetailListItem = DetailList.Item
|
|
|
|
|
|
export default {
|
|
@@ -72,7 +79,8 @@ export default {
|
|
|
DetailListItem,
|
|
|
BaseForm,
|
|
|
SparePartInfoSelectModal,
|
|
|
- ImportFormAdd
|
|
|
+ ImportFormAdd,
|
|
|
+ SpareBaseForm
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
@@ -90,6 +98,7 @@ export default {
|
|
|
},
|
|
|
modalTitle: null,
|
|
|
visible: false,
|
|
|
+ visibleOther: true,
|
|
|
useTypeMap: {},
|
|
|
levelMap: {},
|
|
|
unitMap: {},
|
|
@@ -172,10 +181,15 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
handleOk () {
|
|
|
+ this.visibleOther = true
|
|
|
selectSpareInfoListByModelId({ id: this.model.id }).then(res => {
|
|
|
this.data = res.data
|
|
|
})
|
|
|
},
|
|
|
+ handleAddSpareInfo () {
|
|
|
+ this.visibleOther = false
|
|
|
+ this.$refs.spareBaseModal.base('', this.model.id)
|
|
|
+ },
|
|
|
handleSpareSelect () {
|
|
|
this.$refs.spareSelectModal.base({}, { yt: 1 })
|
|
|
},
|