Merge remote-tracking branch 'origin/dev-nx' into dev-nx

This commit is contained in:
liang.chao 2024-07-22 20:48:49 +08:00
commit 3bc4aa50b3
8 changed files with 458 additions and 409 deletions

View File

@ -366,6 +366,11 @@
width="55" width="55"
align="center" align="center"
v-if="repairTitle === '维修'" v-if="repairTitle === '维修'"
:selectable="
(row) => {
return row.status == 1
}
"
/> />
<el-table-column <el-table-column
label="类型名称" label="类型名称"

View File

@ -1,218 +1,217 @@
<template> <template>
<el-select <el-select
class="user-select-tree" class="user-select-tree"
v-model="textStr" v-model="textStr"
:placeholder="placeholder" :placeholder="placeholder"
ref="select" ref="select"
:filterable="true" :filterable="true"
:remote="true" :clearable="clearable"
:remote-method="remoteMethod" @clear="clearSelect"
:clearable="clearable" @visible-change="visibleChange"
@clear="clearSelect" :popper-append-to-body="false"
@visible-change="visibleChange" style="width: 100%"
:popper-append-to-body="false"
style="width: 100%"
>
<el-option
v-model="value"
style="
height: 100%;
max-height: 200px;
overflow-y: auto;
padding: 0;
background-color: #ffffff;
"
> >
<el-tree <el-option
:data="treeList" v-model="value"
:props="treeProps" style="
:filter-node-method="filterNode" height: 100%;
:current-node-key="currentKey" max-height: 200px;
highlight-current overflow-y: auto;
default-expand-all padding: 0;
:node-key="nodeKey" background-color: #ffffff;
ref="selectTree" "
:check-strictly="true"
@node-click="handleTreeClick"
>
<span
slot-scope="{ data }"
:title="data[treeProps.label]"
class="ellipsis"
> >
{{ data[treeProps.label] }} <el-tree
</span> :data="treeList"
</el-tree> :props="treeProps"
</el-option> :filter-node-method="filterNode"
</el-select> :current-node-key="currentKey"
highlight-current
default-expand-all
:node-key="nodeKey"
ref="selectTree"
:check-strictly="true"
@node-click="handleTreeClick"
>
<span
slot-scope="{ data }"
:title="data[treeProps.label]"
class="ellipsis"
>
{{ data[treeProps.label] }}
</span>
</el-tree>
</el-option>
</el-select>
</template> </template>
<script> <script>
export default { export default {
name: 'index', name: 'index',
props: { props: {
treeList: { treeList: {
type: Array type: Array,
}, // }, //
treeProps: Object, // treeProps: Object, //
nodeKey: String, // nodeKey: String, //
defaultSelect: { defaultSelect: {
// //
type: Boolean, type: Boolean,
default: true default: true,
},
defaultData: {
type: Object,
default: null,
},
clearable: { type: Boolean, default: false },
placeholder: { type: String, default: '请选择' },
}, },
defaultData: { data() {
type: Object, return {
default: null textStr: '',
}, value: '',
clearable: { type: Boolean, default: false }, filterText: '',
placeholder: { type: String, default: '请选择' } currentKey: '',
}, highlightNode: -1,
data() {
return {
textStr: '',
value: '',
filterText: '',
currentKey: '',
highlightNode: -1
}
},
watch: {
// clearable(val) {
// console.log('val-----', val);
// },
clearable: {
handler: function(val,old) {
},
// obj.name
immediate: true
},
filterText(val) {
this.$refs.selectTree.filter(val)
},
defaultData(val) {
if (this.highlightNode === -1) {
this.setEdit(val)
}
},
treeList(val) {
if (val.length > 0) {
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]
this.highlightNode = this.value
this.currentKey = this.value
this.$refs.selectTree.setCurrentKey(this.highlightNode)
this.$emit('handleNodeClick', this.value)
}
})
}
}
},
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 = ''
},
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() { watch: {
this.value = null // clearable(val) {
this.textStr = null // console.log('val-----', val);
this.currentKey = undefined // },
this.highlightNode = undefined clearable: {
this.$refs.selectTree.setCurrentKey(this.highlightNode) handler: function (val, old) {},
this.$refs.select.clearSingleSelect() // obj.name
// this.value = '' immediate: true,
// this.textStr = '' },
// this.currentKey = undefined filterText(val) {
// this.highlightNode = undefined this.$refs.selectTree.filter(val)
// this.$refs.selectTree.setCurrentKey(this.highlightNode) },
defaultData(val) {
if (this.highlightNode === -1) {
this.setEdit(val)
}
},
treeList(val) {
if (val.length > 0) {
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
]
this.highlightNode = this.value
this.currentKey = this.value
this.$refs.selectTree.setCurrentKey(this.highlightNode)
this.$emit('handleNodeClick', this.value)
}
})
}
},
},
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 = ''
},
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() {
this.value = ''
this.textStr = ''
this.$refs.selectTree.setCurrentKey()
this.$emit('handleNodeClick', '')
},
}, },
clearSelect() {
this.value = ''
this.textStr = ''
this.$refs.selectTree.setCurrentKey()
this.$emit('handleNodeClick', '')
}
}
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.user-select-tree { .user-select-tree {
::v-deep { // ::v-deep {
.el-icon-::before { // .el-icon-::before {
content: '\ea1b'; // content: '\ea1b';
font-family: 'icomoon' !important; // font-family: 'icomoon' !important;
display: inline-block; // display: inline-block;
-webkit-transform: scale(0.83); // -webkit-transform: scale(0.83);
font-size: 10px; // font-size: 10px;
//width: 100%; // //width: 100%;
//height: 100%; // //height: 100%;
color: #666666; // color: #666666;
pointer-events: none; // pointer-events: none;
} // }
.el-input.is-focus { // .el-input.is-focus {
.el-icon- { // .el-icon- {
transform: rotate(0deg); // transform: rotate(0deg);
} // }
} // }
.el-input__inner { // .el-input__inner {
height: 36px; // height: 36px;
line-height: 36px; // line-height: 36px;
} // }
.el-input__icon { // .el-input__icon {
line-height: 36px; // line-height: 36px;
} // }
.el-tree-node__content { // .el-tree-node__content {
height: 32px; // height: 32px;
} // }
} // }
} }
</style> </style>

View File

@ -377,6 +377,11 @@
type="selection" type="selection"
width="55" width="55"
align="center" align="center"
:selectable="
(row) => {
return row.status == 1
}
"
v-if="repairTitle === '维修'" v-if="repairTitle === '维修'"
/> />
<el-table-column <el-table-column

View File

@ -1,218 +1,217 @@
<template> <template>
<el-select <el-select
class="user-select-tree" class="user-select-tree"
v-model="textStr" v-model="textStr"
:placeholder="placeholder" :placeholder="placeholder"
ref="select" ref="select"
:filterable="true" :filterable="true"
:remote="true" :clearable="clearable"
:remote-method="remoteMethod" @clear="clearSelect"
:clearable="clearable" @visible-change="visibleChange"
@clear="clearSelect" :popper-append-to-body="false"
@visible-change="visibleChange" style="width: 100%"
:popper-append-to-body="false"
style="width: 100%"
>
<el-option
v-model="value"
style="
height: 100%;
max-height: 200px;
overflow-y: auto;
padding: 0;
background-color: #ffffff;
"
> >
<el-tree <el-option
:data="treeList" v-model="value"
:props="treeProps" style="
:filter-node-method="filterNode" height: 100%;
:current-node-key="currentKey" max-height: 200px;
highlight-current overflow-y: auto;
default-expand-all padding: 0;
:node-key="nodeKey" background-color: #ffffff;
ref="selectTree" "
:check-strictly="true"
@node-click="handleTreeClick"
>
<span
slot-scope="{ data }"
:title="data[treeProps.label]"
class="ellipsis"
> >
{{ data[treeProps.label] }} <el-tree
</span> :data="treeList"
</el-tree> :props="treeProps"
</el-option> :filter-node-method="filterNode"
</el-select> :current-node-key="currentKey"
highlight-current
default-expand-all
:node-key="nodeKey"
ref="selectTree"
:check-strictly="true"
@node-click="handleTreeClick"
>
<span
slot-scope="{ data }"
:title="data[treeProps.label]"
class="ellipsis"
>
{{ data[treeProps.label] }}
</span>
</el-tree>
</el-option>
</el-select>
</template> </template>
<script> <script>
export default { export default {
name: 'index', name: 'index',
props: { props: {
treeList: { treeList: {
type: Array type: Array,
}, // }, //
treeProps: Object, // treeProps: Object, //
nodeKey: String, // nodeKey: String, //
defaultSelect: { defaultSelect: {
// //
type: Boolean, type: Boolean,
default: true default: true,
},
defaultData: {
type: Object,
default: null,
},
clearable: { type: Boolean, default: false },
placeholder: { type: String, default: '请选择' },
}, },
defaultData: { data() {
type: Object, return {
default: null textStr: '',
}, value: '',
clearable: { type: Boolean, default: false }, filterText: '',
placeholder: { type: String, default: '请选择' } currentKey: '',
}, highlightNode: -1,
data() {
return {
textStr: '',
value: '',
filterText: '',
currentKey: '',
highlightNode: -1
}
},
watch: {
// clearable(val) {
// console.log('val-----', val);
// },
clearable: {
handler: function(val,old) {
},
// obj.name
immediate: true
},
filterText(val) {
this.$refs.selectTree.filter(val)
},
defaultData(val) {
if (this.highlightNode === -1) {
this.setEdit(val)
}
},
treeList(val) {
if (val.length > 0) {
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]
this.highlightNode = this.value
this.currentKey = this.value
this.$refs.selectTree.setCurrentKey(this.highlightNode)
this.$emit('handleNodeClick', this.value)
}
})
}
}
},
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 = ''
},
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() { watch: {
this.value = null // clearable(val) {
this.textStr = null // console.log('val-----', val);
this.currentKey = undefined // },
this.highlightNode = undefined clearable: {
this.$refs.selectTree.setCurrentKey(this.highlightNode) handler: function (val, old) {},
this.$refs.select.clearSingleSelect() // obj.name
// this.value = '' immediate: true,
// this.textStr = '' },
// this.currentKey = undefined filterText(val) {
// this.highlightNode = undefined this.$refs.selectTree.filter(val)
// this.$refs.selectTree.setCurrentKey(this.highlightNode) },
defaultData(val) {
if (this.highlightNode === -1) {
this.setEdit(val)
}
},
treeList(val) {
if (val.length > 0) {
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
]
this.highlightNode = this.value
this.currentKey = this.value
this.$refs.selectTree.setCurrentKey(this.highlightNode)
this.$emit('handleNodeClick', this.value)
}
})
}
},
},
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 = ''
},
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() {
this.value = ''
this.textStr = ''
this.$refs.selectTree.setCurrentKey()
this.$emit('handleNodeClick', '')
},
}, },
clearSelect() {
this.value = ''
this.textStr = ''
this.$refs.selectTree.setCurrentKey()
this.$emit('handleNodeClick', '')
}
}
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.user-select-tree { .user-select-tree {
::v-deep { // ::v-deep {
.el-icon-::before { // .el-icon-::before {
content: '\ea1b'; // content: '\ea1b';
font-family: 'icomoon' !important; // font-family: 'icomoon' !important;
display: inline-block; // display: inline-block;
-webkit-transform: scale(0.83); // -webkit-transform: scale(0.83);
font-size: 10px; // font-size: 10px;
//width: 100%; // //width: 100%;
//height: 100%; // //height: 100%;
color: #666666; // color: #666666;
pointer-events: none; // pointer-events: none;
} // }
.el-input.is-focus { // .el-input.is-focus {
.el-icon- { // .el-icon- {
transform: rotate(0deg); // transform: rotate(0deg);
} // }
} // }
.el-input__inner { // .el-input__inner {
height: 36px; // height: 36px;
line-height: 36px; // line-height: 36px;
} // }
.el-input__icon { // .el-input__icon {
line-height: 36px; // line-height: 36px;
} // }
.el-tree-node__content { // .el-tree-node__content {
height: 32px; // height: 32px;
} // }
} // }
} }
</style> </style>

View File

@ -124,6 +124,14 @@
<a <a
:href="filePreviewUrl + row.fileUrl" :href="filePreviewUrl + row.fileUrl"
target="_blank" target="_blank"
:download="row.fileName"
v-if="fileTypeJudge(row.fileName)"
>查看</a
>
<a
:href="filePreviewUrl + row.fileUrl"
target="_blank"
v-else
>查看</a >查看</a
> >
</template> </template>
@ -345,6 +353,11 @@ export default {
) )
console.log('数据导出', data) console.log('数据导出', data)
}, },
fileTypeJudge(url) {
const file = url.split('.')[1]
const docList = ['doc', 'docx', 'xls', 'xlsx']
return docList.some((e) => e === file)
},
}, },
} }
</script> </script>

View File

@ -5,9 +5,20 @@
<el-table-column align="center" label="文件名称" prop="name" /> <el-table-column align="center" label="文件名称" prop="name" />
<el-table-column align="center" label="操作"> <el-table-column align="center" label="操作">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<a :href="`${filePreviewUrl}${row.url}`" target="_blank" <a
:href="`${filePreviewUrl}${row.url}`"
target="_blank"
:download="row.name"
v-if="fileTypeJudge(row.name)"
>查看</a >查看</a
> >
<a
v-else
:href="`${filePreviewUrl}${row.url}`"
target="_blank"
>
查看
</a>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -50,6 +61,13 @@ export default {
return tableList || [] return tableList || []
}, },
}, },
methods: {
fileTypeJudge(url) {
const file = url.split('.')[1]
const docList = ['doc', 'docx']
return docList.some((e) => e === file)
},
},
} }
</script> </script>

View File

@ -297,7 +297,11 @@
</el-table> </el-table>
<div slot="footer" class="dialog-footer" style="text-align: center"> <div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="submitForm" v-if="!isDetail" <el-button
type="primary"
@click="submitForm"
v-if="!isDetail"
:loading="codingLoading"
> </el-button > </el-button
> >
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
@ -431,6 +435,7 @@ export default {
isDetail: false, isDetail: false,
surplusNoBindNum: 0, surplusNoBindNum: 0,
codingLoading: false,
} }
}, },
mounted() { mounted() {
@ -723,18 +728,23 @@ export default {
) )
return // return //
} }
editPurchaseMacode(this.codeList).then((response) => { this.codingLoading = true
if (response.data && response.data.length > 0) { editPurchaseMacode(this.codeList)
this.codeList = response.data .then((response) => {
this.$modal.msgError( if (response.data && response.data.length > 0) {
'编码绑定失败,存在重复编码,请重新输入', this.codeList = response.data
) this.$modal.msgError(
} else { '编码绑定失败,存在重复编码,请重新输入',
this.$modal.msgSuccess('编码绑定成功') )
this.open = false } else {
this.getList() this.$modal.msgSuccess('编码绑定成功')
} this.open = false
}) this.getList()
}
})
.finally(() => {
this.codingLoading = false
})
} }
}, },
hasDuplicateField(array, field) { hasDuplicateField(array, field) {

View File

@ -43,7 +43,7 @@ module.exports = {
// target: `https://test-cc.zhgkxt.com`,//线上环境-南网 // target: `https://test-cc.zhgkxt.com`,//线上环境-南网
// target: `https://z.csgmall.com.cn`, // target: `https://z.csgmall.com.cn`,
target: `http://192.168.2.167:28080`, //超 target: `http://192.168.2.134:28080`, //超
// target: `http://10.40.92.81:28080`, //韩/ // target: `http://10.40.92.81:28080`, //韩/
// target: `http://10.40.92.74:8080`,//旭/ // target: `http://10.40.92.74:8080`,//旭/
// target: `http://192.168.2.248:28080`, //帅 // target: `http://192.168.2.248:28080`, //帅