抱杆配套管理
This commit is contained in:
parent
2640c40b17
commit
9deec6f550
|
|
@ -5,6 +5,7 @@ const addUrl = '/material/maWhole/add' // 添加
|
|||
const selectListUrl = '/material/maWhole/selectList' // 查询首页
|
||||
const selectListByIdUrl = '/material/maWhole/selectListById' // 查询详情
|
||||
const deleteByIdUrl = '/material/maWhole/deleteById' // 删除
|
||||
const treeTypeUrl = '/system/select/getDeviceTypeTree' // 设备树
|
||||
|
||||
// 物品类型 选择配件
|
||||
export function getMaType(query) {
|
||||
|
|
@ -15,6 +16,15 @@ export function getMaType(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// 设备树
|
||||
export function getDeviceTypeTree(params = {}){
|
||||
return request({
|
||||
url: treeTypeUrl,
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 新增
|
||||
export function addMaWhole(data) {
|
||||
return request({
|
||||
|
|
|
|||
|
|
@ -144,7 +144,13 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getMaType, addMaWhole, searchSelectList, searchSelectListById, deleteById } from '@/api/store/poleConfig'
|
||||
import {
|
||||
getDeviceTypeTree,
|
||||
addMaWhole,
|
||||
searchSelectList,
|
||||
searchSelectListById,
|
||||
deleteById,
|
||||
} from '@/api/store/poleConfig'
|
||||
export default {
|
||||
name: 'poleConfig',
|
||||
data() {
|
||||
|
|
@ -178,25 +184,15 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.getList()
|
||||
getMaType({ parentId: 1 }).then(res => {
|
||||
// 处理为typeOptions需要的数据格式
|
||||
const data = res.data
|
||||
this.typeOptions = this.getTree(data)
|
||||
})
|
||||
getMaType({ parentId: 2 }).then(res => {
|
||||
// 处理为mountingsOptions需要的数据格式
|
||||
const data = res.data
|
||||
this.mountingsOptions = this.getTree(data)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 获取列表
|
||||
async getList(data = {}) {
|
||||
this.houseList = []
|
||||
this.queryParams.pageNum = data.page || 1
|
||||
this.queryParams.pageSize = data.limit || 10
|
||||
this.queryParams.keyWord = this.formData.keyWord || ''
|
||||
const res = await searchSelectList({ ...this.queryParams })
|
||||
console.log('🚀 ~ getList ~ res:', res);
|
||||
this.houseList = res.data.result
|
||||
this.total = res.data.totalCount || 0
|
||||
},
|
||||
|
|
@ -228,6 +224,18 @@ export default {
|
|||
this.$nextTick(() => {
|
||||
this.$refs.dialogForm.resetFields()
|
||||
})
|
||||
getDeviceTypeTree().then(res => {
|
||||
// 处理为typeOptions需要的数据格式
|
||||
const data = res.data
|
||||
// this.typeOptions = this.getTree(data)
|
||||
// this.mountingsOptions = this.getTree(data)
|
||||
this.typeOptions = this.mountingsOptions = this.getTree(data)
|
||||
})
|
||||
// getDeviceTypeTree().then(res => {
|
||||
// // 处理为mountingsOptions需要的数据格式
|
||||
// const data = res.data
|
||||
// this.mountingsOptions = this.getTree(data)
|
||||
// })
|
||||
},
|
||||
// 详情弹框
|
||||
handleDetail(row) {
|
||||
|
|
@ -263,7 +271,7 @@ export default {
|
|||
},
|
||||
// 选择物品类型
|
||||
handleTypeOptions(val) {
|
||||
this.dialogForm.parentId = val[val.length - 1]
|
||||
this.dialogForm.parentId = val[3]
|
||||
},
|
||||
// 选择配件
|
||||
handleMountingsOptions(val) {
|
||||
|
|
@ -271,11 +279,11 @@ export default {
|
|||
this.dialogForm.mountingsValue = val
|
||||
const selected = this.$refs.mountingsTree.getCheckedNodes()
|
||||
// 过滤出 level = 2 的数据
|
||||
const filterSel = selected.filter(item => item.level === 2)
|
||||
const filterSel = selected.filter(item => item.level === 4)
|
||||
this.selectList = filterSel.map(item => {
|
||||
return {
|
||||
typeId: item.value,
|
||||
typeName: item.pathLabels[0],
|
||||
typeName: item.pathLabels[2],
|
||||
typeModelName: item.label,
|
||||
totalNum: 1,
|
||||
}
|
||||
|
|
@ -296,7 +304,6 @@ export default {
|
|||
},
|
||||
// 删除
|
||||
handleDeleteDialog(row) {
|
||||
console.log('🚀 ~ handleDeleteDialog ~ row:', row);
|
||||
// 根据row.parentId删除
|
||||
this.dialogList = this.dialogList.filter(item => item.typeId !== row.typeId)
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue