bug修复

This commit is contained in:
bb_pan 2025-04-11 15:07:56 +08:00
parent b231b658ee
commit 71c2819059
11 changed files with 116 additions and 130 deletions

View File

@ -17,7 +17,7 @@ const service = axios.create({
// axios中请求配置有baseURL选项表示请求URL公共部分 // axios中请求配置有baseURL选项表示请求URL公共部分
baseURL: process.env.VUE_APP_BASE_API, baseURL: process.env.VUE_APP_BASE_API,
// 超时 // 超时
timeout: 10000 timeout: 30000
}) })
// request拦截器 // request拦截器

View File

@ -190,8 +190,8 @@
</el-form-item> </el-form-item>
<el-form-item label="单位类型" prop="typeId"> <el-form-item label="单位类型" prop="typeId">
<el-radio-group v-model="form.typeId"> <el-radio-group v-model="form.typeId">
<el-radio :label="0">内部单位</el-radio> <el-radio label="0">内部单位</el-radio>
<el-radio :label="1">外部单位</el-radio> <el-radio label="1">外部单位</el-radio>
</el-radio-group> </el-radio-group>
<!-- <el-select <!-- <el-select
v-model="form.typeId" v-model="form.typeId"

View File

@ -695,7 +695,7 @@
:file-list="scrapInfoParams.fileList" :file-list="scrapInfoParams.fileList"
:action-url="actionUrl" :action-url="actionUrl"
:limit="3" :limit="3"
:multiple="true" :multiple="false"
@remove="handleRemove" @remove="handleRemove"
@success="handleSuccess" @success="handleSuccess"
> >

View File

@ -88,6 +88,7 @@
size="small" size="small"
maxlength="10" maxlength="10"
style="width: 350px" style="width: 350px"
@change="changeNum(domain)"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
@ -529,6 +530,13 @@ export default {
key: Date.now(), key: Date.now(),
}) })
}, },
changeNum(domain) {
const reg = /^[1-9]\d*$/
if (!reg.test(domain.partNum)) {
this.$message.error('请输入大于0的正整数')
domain.partNum = ''
}
},
submit() { submit() {
this.$refs['dynamicValidateForm'].validate((valid) => { this.$refs['dynamicValidateForm'].validate((valid) => {
if (valid) { if (valid) {

View File

@ -758,6 +758,7 @@ export default {
this.queryParams.backUnit = '' this.queryParams.backUnit = ''
this.queryParams.backPro = '' this.queryParams.backPro = ''
this.queryParams.keyword = '' this.queryParams.keyword = ''
this.queryParams.repairStatus = ''
this.resetForm('queryForm') this.resetForm('queryForm')
this.$refs.mychildSon.inputValue = '' this.$refs.mychildSon.inputValue = ''
this.handleQuery() this.handleQuery()

View File

@ -6,16 +6,17 @@
ref="select" ref="select"
:filterable="true" :filterable="true"
:clearable="clearable" :clearable="clearable"
:filter-method="remoteMethod"
:popper-append-to-body="false"
@clear="clearSelect" @clear="clearSelect"
@visible-change="visibleChange" @visible-change="visibleChange"
:popper-append-to-body="false"
style="width: 100%" style="width: 100%"
> >
<el-option <el-option
v-model="value" :value="value"
style=" style="
height: 100%; height: 100%;
max-height: 200px; max-height: 300px;
overflow-y: auto; overflow-y: auto;
padding: 0; padding: 0;
background-color: #ffffff; background-color: #ffffff;
@ -27,7 +28,7 @@
:filter-node-method="filterNode" :filter-node-method="filterNode"
:current-node-key="currentKey" :current-node-key="currentKey"
highlight-current highlight-current
default-expand-all :default-expand-all="defaultExpandAll"
:node-key="nodeKey" :node-key="nodeKey"
ref="selectTree" ref="selectTree"
:check-strictly="true" :check-strictly="true"
@ -44,26 +45,19 @@
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
<script> <script>
export default { export default {
name: 'index', name: 'index',
props: { props: {
treeList: { treeList: Array,
type: Array, treeProps: Object,
}, // nodeKey: String,
treeProps: Object, // defaultSelect: { type: Boolean, default: true },
nodeKey: String, // defaultData: { type: Object, default: null },
defaultSelect: {
//
type: Boolean,
default: true,
},
defaultData: {
type: Object,
default: null,
},
clearable: { type: Boolean, default: false }, clearable: { type: Boolean, default: false },
placeholder: { type: String, default: '请选择' }, placeholder: { type: String, default: '请选择' },
defaultExpandAll: { type: Boolean, default: false },
}, },
data() { data() {
return { return {
@ -75,32 +69,24 @@ export default {
} }
}, },
watch: { watch: {
// clearable(val) {
// console.log('val-----', val);
// },
clearable: {
handler: function (val, old) {},
// obj.name
immediate: true,
},
filterText(val) { filterText(val) {
this.$refs.selectTree.filter(val) if (this.$refs.selectTree) {
this.$refs.selectTree.filter(val)
this.expandAll()
}
}, },
defaultData(val) { defaultData(val) {
if (this.highlightNode === -1) { if (this.highlightNode === -1 && val) {
this.setEdit(val) this.setEdit(val)
} }
}, },
treeList(val) { treeList(val) {
if (val.length > 0) { if (val.length > 0 && this.defaultSelect) {
this.$nextTick(() => { this.$nextTick(() => {
if (this.defaultSelect) { const defaultNode = val[0][this.treeProps.children]?.[0]
this.value = if (defaultNode) {
val[0][this.treeProps.children][0][this.nodeKey] this.value = defaultNode[this.nodeKey]
this.textStr = this.textStr = defaultNode[this.treeProps.label]
val[0][this.treeProps.children][0][
this.treeProps.label
]
this.highlightNode = this.value this.highlightNode = this.value
this.currentKey = this.value this.currentKey = this.value
this.$refs.selectTree.setCurrentKey(this.highlightNode) this.$refs.selectTree.setCurrentKey(this.highlightNode)
@ -111,107 +97,73 @@ export default {
}, },
}, },
methods: { methods: {
remoteMethod(query) {
this.filterText = query
},
filterNode(value, data) {
if (!value) return true
return data[this.treeProps.label]?.includes(value)
},
handleTreeClick(data, checked) {
if (
data[this.treeProps.children] &&
data[this.treeProps.children].length !== 0
) {
this.$refs.selectTree.setCurrentKey(this.highlightNode)
} else {
this.value = data[this.nodeKey]
this.textStr = data[this.treeProps.label]
this.highlightNode = this.value
this.currentKey = this.value
this.$emit('handleNodeClick', this.value)
this.$refs.selectTree.setCheckedKeys([this.highlightNode])
this.$refs.select.blur() //
}
},
setEdit(obj) { setEdit(obj) {
if (obj.name !== '' && obj.value !== '') { if (obj && obj.name !== '' && obj.value !== '') {
this.value = obj.value this.value = obj.value
this.textStr = obj.name this.textStr = obj.name
this.highlightNode = obj.value
this.currentKey = obj.value
this.$nextTick(() => { this.$nextTick(() => {
this.highlightNode = this.value
this.currentKey = this.value
this.$refs.selectTree.setCurrentKey(this.highlightNode) this.$refs.selectTree.setCurrentKey(this.highlightNode)
}) })
} }
}, },
visibleChange() {
this.filterText = ''
},
filterNode(value, data) {
if (!value) return true
return data[this.treeProps.label].indexOf(value) !== -1
},
remoteMethod(query) {
setTimeout(() => {
this.filterText = query
}, 100)
},
//
handleTreeClick(data, checked) {
this.filterText = ''
if (checked) {
// //
if (
data[this.treeProps.children] !== undefined &&
data[this.treeProps.children].length !== 0
) {
this.$refs.selectTree.setCurrentKey(this.highlightNode)
} else {
this.value = data[this.nodeKey]
this.textStr = data[this.treeProps.label]
this.$forceUpdate()
this.currentKey = this.value
this.highlightNode = data[this.nodeKey]
this.$emit('handleNodeClick', this.value)
this.$refs.selectTree.setCheckedKeys([this.highlightNode])
this.$refs.select.blur()
}
}
},
clearFun() {
this.value = null
this.textStr = null
this.currentKey = undefined
this.highlightNode = undefined
this.$refs.selectTree.setCurrentKey(this.highlightNode)
this.$refs.select.clearSingleSelect()
// this.value = ''
// this.textStr = ''
// this.currentKey = undefined
// this.highlightNode = undefined
// this.$refs.selectTree.setCurrentKey(this.highlightNode)
},
clearSelect() { clearSelect() {
this.value = '' this.value = ''
this.textStr = '' this.textStr = ''
this.$refs.selectTree.setCurrentKey() this.currentKey = undefined
this.highlightNode = undefined
if (this.$refs.selectTree) {
this.$refs.selectTree.setCurrentKey(undefined)
}
this.$emit('handleNodeClick', '') this.$emit('handleNodeClick', '')
}, },
visibleChange() {
this.filterText = ''
},
expandAll() {
const tree = this.$refs.selectTree
if (!tree || !tree.store || !tree.store.nodesMap) return
Object.values(tree.store.nodesMap).forEach(node => {
node.expanded = true
})
},
}, },
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.user-select-tree { .user-select-tree {
// ::v-deep { .el-tree-node__content {
// .el-icon-::before { height: 32px;
// content: '\ea1b'; }
// font-family: 'icomoon' !important;
// display: inline-block;
// -webkit-transform: scale(0.83);
// font-size: 10px;
// //width: 100%;
// //height: 100%;
// color: #666666;
// pointer-events: none;
// }
// .el-input.is-focus { .el-input__inner {
// .el-icon- { height: 36px;
// transform: rotate(0deg); line-height: 36px;
// } }
// }
// .el-input__inner {
// height: 36px;
// line-height: 36px;
// }
// .el-input__icon {
// line-height: 36px;
// }
// .el-tree-node__content {
// height: 32px;
// }
// }
} }
</style> </style>

View File

@ -129,12 +129,20 @@
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<!-- 序号 -->
<el-table-column <el-table-column
label="序号"
type="index"
width="55"
align="center"
:index="(index) => (queryParams.pageNum - 1) * queryParams.pageSize + index + 1"
/>
<!-- <el-table-column
label="角色编号" label="角色编号"
prop="roleId" prop="roleId"
width="120" width="120"
align="center" align="center"
/> /> -->
<el-table-column <el-table-column
align="center" align="center"
label="角色名称" label="角色名称"

View File

@ -74,7 +74,7 @@
v-model="row.deviceNum" v-model="row.deviceNum"
style="width: 180px" style="width: 180px"
placeholder="请输入数量" placeholder="请输入数量"
@change="deviceNumChange" @change="deviceNumChange(row)"
maxlength="9" maxlength="9"
/> />
</template> </template>
@ -272,10 +272,11 @@ export default {
} }
}, },
// //
deviceNumChange(val) { deviceNumChange(row) {
let reg = /^[1-9]\d*$/ let reg = /^[1-9]\d*$/
if (!reg.test(val)) { if (!reg.test(row.deviceNum)) {
this.$message.error('请输入大于0的正整数') this.$message.error('请输入大于0的正整数')
row.deviceNum = ''
} }
}, },
// //

View File

@ -277,7 +277,7 @@ export default {
parentId: [ parentId: [
{ {
required: true, required: true,
message: '上级部门不能为空', message: '上级名称不能为空',
trigger: 'blur', trigger: 'blur',
}, },
], ],
@ -389,7 +389,7 @@ export default {
handleUpdate(row) { handleUpdate(row) {
this.reset() this.reset()
this.open = true this.open = true
this.title = '修改部门' this.title = '修改配件'
this.isEdit = true this.isEdit = true
this.initGetPartType(row) this.initGetPartType(row)
}, },
@ -496,8 +496,14 @@ export default {
'children', 'children',
) )
this.form = JSON.parse(JSON.stringify(row)) this.form = JSON.parse(JSON.stringify(row))
// this.form.currentId =
// currentItem && currentItem.reverse().map((ele) => ele.paId)
this.form.currentId = this.form.currentId =
currentItem && currentItem.reverse().map((ele) => ele.paId) currentItem &&
currentItem
.reverse()
.map((ele) => ele.parentId)
.filter((id) => id !== 0) // 0
this.initApiGetPartTree() this.initApiGetPartTree()
}, },
}, },

View File

@ -645,7 +645,10 @@ export default {
// //
selectDevice(id) { selectDevice(id) {
console.log(id) console.log(id)
getListByMaType({ typeId: id }).then((response) => { // getListByMaType({ typeId: id }).then((response) => {
// this.modelList = response.data
// })
getTypeList({ level: '4', typeId: id }).then((response) => {
this.modelList = response.data this.modelList = response.data
}) })
}, },

View File

@ -26,6 +26,7 @@
clearable clearable
filterable filterable
style="width: 240px" style="width: 240px"
@change="changeType"
> >
<el-option <el-option
v-for="typeItem in typeList" v-for="typeItem in typeList"
@ -288,6 +289,12 @@ export default {
this.resetForm('queryForm') this.resetForm('queryForm')
this.handleQuery() this.handleQuery()
}, },
changeType(typeId) {
// console.log('🚀 ~ changeType ~ typeId:', typeId)
getTypeList({ level: '4', typeId }).then((response) => {
this.modelList = response.data
})
},
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {