Commit 7eda9a1d authored by 刘宇扬's avatar 刘宇扬

入库

parent 152f286d
...@@ -193,7 +193,7 @@ export default { ...@@ -193,7 +193,7 @@ export default {
data() { data() {
return { return {
// TODO: 表单里的单项详情参数 // TODO: 表单里的单项详情参数
equipmentList: '', equipmentList: [],
handleSelectionChange: '', handleSelectionChange: '',
singleDetails: { singleDetails: {
equipmentName: '', equipmentName: '',
...@@ -339,9 +339,6 @@ export default { ...@@ -339,9 +339,6 @@ export default {
} }
}, },
mounted() { mounted() {
this.$nextTick(() => {
this.$refs.input1.$refs.input.focus()
})
}, },
/** 路由离开前存储筛选条件*/ /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
...@@ -475,6 +472,7 @@ export default { ...@@ -475,6 +472,7 @@ export default {
this.open = false this.open = false
this.$message.success('操作成功') this.$message.success('操作成功')
this.getList() this.getList()
this.queryParams.page = 1
this.reFrom() this.reFrom()
} else if (res.code === null) { } else if (res.code === null) {
this.$message.error(res.message) this.$message.error(res.message)
...@@ -486,6 +484,7 @@ export default { ...@@ -486,6 +484,7 @@ export default {
this.open = false this.open = false
this.$message.success('操作成功') this.$message.success('操作成功')
this.getList() this.getList()
this.queryParams.page = 1
this.reFrom() this.reFrom()
} else if (res.code === null) { } else if (res.code === null) {
this.$message.error(res.message) this.$message.error(res.message)
......
...@@ -135,6 +135,15 @@ export default { ...@@ -135,6 +135,15 @@ export default {
}, },
methods: { methods: {
handleDelete(row) { handleDelete(row) {
this.form = {
pn: '',
lot: '',
plocation: '',
phd: '',
flag: 1,
ptype: 1,
pstatus: 0
}
// 检查选中行是否已存在于selectedRows数组中 // 检查选中行是否已存在于selectedRows数组中
const index = this.selectedRows.findIndex(selectedRow => selectedRow === row) const index = this.selectedRows.findIndex(selectedRow => selectedRow === row)
if (index !== -1) { if (index !== -1) {
...@@ -148,6 +157,10 @@ export default { ...@@ -148,6 +157,10 @@ export default {
this.tableData = this.tableData.filter(row => !this.selectedRows.includes(row)) this.tableData = this.tableData.filter(row => !this.selectedRows.includes(row))
// 清空selectedRows数组 // 清空selectedRows数组
this.selectedRows = [] this.selectedRows = []
// 清空输入框
this.form.pn = ''
this.form.lot = ''
this.form.phd = ''
}, },
handleUpdate(row) { handleUpdate(row) {
this.form.pn = row.pn this.form.pn = row.pn
...@@ -159,9 +172,6 @@ export default { ...@@ -159,9 +172,6 @@ export default {
} }
}) })
console.log('form.index', this.form) console.log('form.index', this.form)
// console.log('tableData', this.tableData)
// this.selectedItem = { ...row } // 存储当前被选中的表格行数据
// this.showForm = true // 显示表单
}, },
handleConfirm() { handleConfirm() {
this.flag = false this.flag = false
......
...@@ -217,7 +217,7 @@ export default { ...@@ -217,7 +217,7 @@ export default {
data() { data() {
return { return {
// TODO: 表单里的单项详情参数 // TODO: 表单里的单项详情参数
equipmentList: '', equipmentList: [],
singleDetails: { singleDetails: {
equipmentName: '', equipmentName: '',
equipmentCode: '', equipmentCode: '',
...@@ -443,35 +443,8 @@ export default { ...@@ -443,35 +443,8 @@ export default {
// this.searchForm.custGroup = nodes.map(item => item.code) // this.searchForm.custGroup = nodes.map(item => item.code)
}, },
// 选中所有下级节点 // 选中所有下级节点
checkNode(data, check) {
// 遍历所有下级节点信息
data.forEach(item => {
// 通过节点信息设置选中状态
this.$refs.menu.setChecked(item, check, false)
// 是否包含下级节点,包含下级节点则选中所有下级节点
if (item.children !== undefined) {
this.checkNode(item.children, check)
}
})
},
// 所有菜单节点数据 // 所有菜单节点数据
getMenuAllCheckedKeys() {
// 目前被选中的菜单节点
const checkedKeys = this.$refs.menu.getHalfCheckedKeys()
// 半选中的菜单节点
const halfCheckedKeys = this.$refs.menu.getCheckedKeys()
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys)
return checkedKeys
},
// 所有部门节点数据 // 所有部门节点数据
getDeptAllCheckedKeys() {
// 目前被选中的部门节点
const checkedKeys = this.$refs.dept.getHalfCheckedKeys()
// // 半选中的部门节点
const halfCheckedKeys = this.$refs.dept.getCheckedKeys()
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys)
return this.$refs.dept.getCheckedKeys()
},
/** 根据角色ID查询菜单树结构 */ /** 根据角色ID查询菜单树结构 */
getRoleMenuTreeselect(roleId) { getRoleMenuTreeselect(roleId) {
return roleMenuTreeselect(roleId).then(response => { return roleMenuTreeselect(roleId).then(response => {
...@@ -518,9 +491,6 @@ export default { ...@@ -518,9 +491,6 @@ export default {
}, },
// 表单重置 // 表单重置
reset() { reset() {
if (this.$refs.menu !== undefined) {
this.$refs.menu.setCheckedKeys([])
}
this.menuExpand = false this.menuExpand = false
this.menuNodeAll = false this.menuNodeAll = false
this.deptExpand = true this.deptExpand = true
...@@ -576,27 +546,7 @@ export default { ...@@ -576,27 +546,7 @@ export default {
// } // }
// }, // },
// 树权限(全选/全不选) // 树权限(全选/全不选)
handleCheckedTreeNodeAll(value, type) {
if (type === 'menu') {
this.$refs.menu.setCheckedNodes(value ? this.menuOptions : [])
} else if (type === 'dept') {
this.$refs.dept.setCheckedNodes(value ? this.deptOptions : [])
}
},
// 树权限(展开/折叠) // 树权限(展开/折叠)
handleCheckedTreeExpand(value, type) {
if (type === 'menu') {
const treeList = this.menuOptions
for (let i = 0; i < treeList.length; i++) {
this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value
}
} else if (type === 'dept') {
const treeList = this.deptOptions
for (let i = 0; i < treeList.length; i++) {
this.$refs.dept.store.nodesMap[treeList[i].id].expanded = value
}
}
},
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset() this.reset()
...@@ -625,20 +575,6 @@ export default { ...@@ -625,20 +575,6 @@ export default {
}) })
}, },
/** 分配数据权限操作 */ /** 分配数据权限操作 */
handleDataScope(row) {
this.deptOptions = []
this.form.dataScope = undefined
const roleId = this.form.businessId
this.form.menuId = row.businessId
this.form.menuName = row.menuName
const roleDeptTreeselect = this.getRoleDeptTreeselect(roleId, this.form.menuId)
this.$nextTick(() => {
roleDeptTreeselect.then(res => {
this.$refs.dept.setCheckedKeys(res.data.checkedKeys)
})
})
this.title = '分配数据权限'
},
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
...@@ -653,6 +589,7 @@ export default { ...@@ -653,6 +589,7 @@ export default {
this.open = false this.open = false
this.$message.success('操作成功') this.$message.success('操作成功')
this.getList() this.getList()
this.queryParams.page = 1
this.reFrom() this.reFrom()
} else if (res.code === null) { } else if (res.code === null) {
this.$message.error(res.message) this.$message.error(res.message)
...@@ -664,6 +601,7 @@ export default { ...@@ -664,6 +601,7 @@ export default {
this.open = false this.open = false
this.$message.success('操作成功') this.$message.success('操作成功')
this.getList() this.getList()
this.queryParams.page = 1
this.reFrom() this.reFrom()
} else if (res.code === null) { } else if (res.code === null) {
this.$message.error(res.message) this.$message.error(res.message)
......
...@@ -223,7 +223,7 @@ export default { ...@@ -223,7 +223,7 @@ export default {
// 是否显示弹出层(数据详情) // 是否显示弹出层(数据详情)
openDetails: false, openDetails: false,
// // TODO: 模拟测试数据 // // TODO: 模拟测试数据
equipmentList: '', equipmentList: [],
typeParent: 'text', typeParent: 'text',
typePrimary: 'primary', typePrimary: 'primary',
typeSuccess: 'success', typeSuccess: 'success',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment