|
@@ -193,7 +193,7 @@
|
|
|
|
|
|
<s-table
|
|
|
ref="table"
|
|
|
- @expand="onExpand"
|
|
|
+ :onExpand="onExpand"
|
|
|
size="default"
|
|
|
rowKey="id"
|
|
|
:widthSpace="true"
|
|
@@ -263,6 +263,20 @@
|
|
|
:status="DictCache.COLOR.SB_MEASURE_STATUS[text]"
|
|
|
:text="yesNoMap[text]" />
|
|
|
</span>
|
|
|
+ <div slot="expandedRowRender" slot-scope="record" style="width:100%;">
|
|
|
+
|
|
|
+ <a-card title="检定记录" :bordered="false" style="width:100%;position: relative; z-inde:9999">
|
|
|
+ <a slot="extra" @click="addLogBySb(record)">新增</a>
|
|
|
+ <a-table :columns="childColumns1" :data-source="childMap[1]">
|
|
|
+ </a-table>
|
|
|
+ </a-card>
|
|
|
+
|
|
|
+ <a-card title="设备更改记录" :bordered="false" style="width:100%">
|
|
|
+ <a-table :columns="childColumns2" :data-source="childMap[2]">
|
|
|
+ </a-table>
|
|
|
+ </a-card>
|
|
|
+
|
|
|
+ </div>
|
|
|
</s-table>
|
|
|
</div>
|
|
|
</a-col>
|
|
@@ -283,12 +297,14 @@
|
|
|
<base-form-measure-in-store ref="baseModalMeasureInStore" @ok="handleOk"/>
|
|
|
<base-form-location ref="baseFormLocation" @ok="handleOk" />
|
|
|
<SbChangeLogSelectModal ref="sbChangeRecordSelectModal" @ok="handleOk" />
|
|
|
+ <AddLogForm ref="addLogForm" @ok="handleLogOk" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { STable, Ellipsis } from '@/components'
|
|
|
import BaseForm from './modules/BaseForm'
|
|
|
+import AddLogForm from './modules/AddLogForm'
|
|
|
import DetailSbMeasure from '@/views/sb/measurelog/modules/DetailSbCheckBatch'
|
|
|
import BaseFormStatusLog from '@/views/sb/status-log/modules/BaseForm'
|
|
|
import Detail from './modules/Detail'
|
|
@@ -297,7 +313,7 @@ import BaseFormMeasureInStore from './modules/BaseFormMeasureInStore'
|
|
|
import BaseFormLocation from './modules/BaseFormLocation'
|
|
|
import DownloadModal from '@/views/download/DownloadModal'
|
|
|
import PreviewModal from '@/views/preview/PreviewModal'
|
|
|
-import { getSbInfoPage, deleteSbInfos, querySbInfo, fetchSbInfo, fetchSbInfos, exportSbInfo, batchLocationList } from '@/api/sb/info'
|
|
|
+import { getSbInfoPage, deleteSbInfos, querySbInfo, getLogBySbId, updateLogBySbId, fetchSbInfo, fetchSbInfos, exportSbInfo, batchLocationList } from '@/api/sb/info'
|
|
|
import { queryDept } from '@/api/upms/dept'
|
|
|
import { generateSbCodeAll } from '@/api/upms/code'
|
|
|
import { fetchSbTypeTree } from '@/api/sb/type'
|
|
@@ -313,6 +329,7 @@ export default {
|
|
|
components: {
|
|
|
STable,
|
|
|
Ellipsis,
|
|
|
+ AddLogForm,
|
|
|
BaseForm,
|
|
|
DetailSbMeasure,
|
|
|
Detail,
|
|
@@ -382,6 +399,7 @@ export default {
|
|
|
lineMap: {},
|
|
|
unitMap: {},
|
|
|
areaList: {},
|
|
|
+ childMap: {},
|
|
|
companyList: {},
|
|
|
projectList: {},
|
|
|
isChildMap: {},
|
|
@@ -567,7 +585,6 @@ export default {
|
|
|
{
|
|
|
title: '检定有效期',
|
|
|
dataIndex: 'nextCheckDate',
|
|
|
- fixed: 'right',
|
|
|
width: 150,
|
|
|
checked: true
|
|
|
},
|
|
@@ -604,12 +621,117 @@ export default {
|
|
|
title: '操作',
|
|
|
key: 'action',
|
|
|
checked: true,
|
|
|
- fixed: 'right',
|
|
|
align: 'center',
|
|
|
width: '120',
|
|
|
scopedSlots: { customRender: 'action' }
|
|
|
}
|
|
|
],
|
|
|
+ childColumns1: [
|
|
|
+ {
|
|
|
+ title: '序号',
|
|
|
+ dataIndex: 'index',
|
|
|
+ width: 100,
|
|
|
+ checked: true,
|
|
|
+ customRender: (text, record, index) => {
|
|
|
+ return index + 1
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备名称',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'sbName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备位号',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'sbPositionNo'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备位置',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'sbPositionName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备类型',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'typeName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '规格型号',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'guige'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '更改内容',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'content'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作时间',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'updateTime'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ childColumns2: [
|
|
|
+ {
|
|
|
+ title: '序号',
|
|
|
+ dataIndex: 'index',
|
|
|
+ width: 100,
|
|
|
+ checked: true,
|
|
|
+ customRender: (text, record, index) => {
|
|
|
+ return index + 1
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备名称',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'sbName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备位号',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'positionNo'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备位置',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'sbPositionName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备类型',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'typeName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '规格型号',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'sbModel'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '检定有效期',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'youXiaoQi'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作时间',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'updateTime'
|
|
|
+ }
|
|
|
+ ],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
parameter = {
|
|
@@ -899,13 +1021,22 @@ export default {
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
onExpand (expanded, record) { // expanded判断展开or收缩操作,record当前行数据
|
|
|
- console.log(expanded)
|
|
|
+ console.log(expanded, record)
|
|
|
+ this.childMap = {}
|
|
|
if (expanded) {
|
|
|
- querySbInfo({ positionNo: record.positionNo }).then(res => {
|
|
|
- record.children = res.data
|
|
|
+ getLogBySbId({ sbId: record.id }).then(res => {
|
|
|
+ this.childMap = res.data
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ addLogBySb (record) {
|
|
|
+ this.$refs.addLogForm.base(record)
|
|
|
+ },
|
|
|
+ handleLogOk (val) {
|
|
|
+ getLogBySbId({ sbId: val.id }).then(res => {
|
|
|
+ this.childMap = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
doImport () {
|
|
|
this.$refs.importModal.base(null, null)
|
|
|
},
|
|
@@ -950,5 +1081,6 @@ export default {
|
|
|
}
|
|
|
/deep/ .orange{
|
|
|
background:rgb(245, 132, 91);
|
|
|
+
|
|
|
}
|
|
|
</style>
|