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公共部分
baseURL: process.env.VUE_APP_BASE_API,
// 超时
timeout: 10000
timeout: 30000
})
// request拦截器

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -645,7 +645,10 @@ export default {
//
selectDevice(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
})
},

View File

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