Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TF-MOM-WEB
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TFMOM
TF-MOM-WEB
Commits
c63a77e8
Commit
c63a77e8
authored
Nov 22, 2023
by
jingnan
👀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物料关键字组件自定义
parent
689ec9fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
175 additions
and
0 deletions
+175
-0
index.vue
...ateComponents/components/MaterialKeywordsSelect/index.vue
+175
-0
No files found.
applications/dee-mes/src/privateComponents/components/MaterialKeywordsSelect/index.vue
0 → 100644
View file @
c63a77e8
<
template
>
<div
class=
"MaterialKeywordsSelect"
>
<el-select
:value=
"value"
:loading=
"loading"
filterable
remote
clearable
:remote-method=
"remoteMethod"
:disabled=
"disabled"
:placeholder=
"!options.length?'至少输入三位进行查询':'暂无数据'"
@
change=
"change"
@
clear=
"clear"
>
<el-option
v-for=
"item in options"
:key=
"item.key"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</div>
</
template
>
<
script
>
export
default
{
name
:
'MaterialKeywordsSelect'
,
componentName
:
'物料关键词'
,
props
:
{
value
:
{
type
:
[
String
,
Number
],
default
:
''
},
basicData
:
{
type
:
Object
,
default
:
()
=>
({})
},
form
:
{
type
:
Object
,
default
:
()
=>
({
sorties
:
''
})
},
disabled
:
{
type
:
Boolean
,
default
:
false
}
},
data
()
{
return
{
loading
:
false
,
options
:
[],
remoteFlag
:
true
,
material
:
[]
}
},
computed
:
{},
watch
:
{
},
methods
:
{
remoteMethod
(
query
,
id
)
{
if
((
!
query
||
query
.
length
<
3
)
&&
!
id
)
return
if
(
this
.
remoteFlag
)
{
this
.
remoteFlag
=
false
this
.
tableColumnSelect
=
true
const
params
=
{
'pageFrom'
:
1
,
'pageSize'
:
20
,
'searchItems'
:
{
'children'
:
[
{
'items'
:
[
{
'fieldName'
:
'resCode'
,
'operator'
:
'LIKE'
,
'value'
:
query
},
{
'fieldName'
:
'resName'
,
'operator'
:
'LIKE'
,
'value'
:
query
},
{
'fieldName'
:
'modelNo'
,
'operator'
:
'LIKE'
,
'value'
:
query
},
{
'fieldName'
:
'spec'
,
'operator'
:
'LIKE'
,
'value'
:
query
},
{
'fieldName'
:
'techSpec'
,
'operator'
:
'LIKE'
,
'value'
:
query
}
],
'operator'
:
'OR'
}
],
'items'
:
[]
},
'openProps'
:
[
{
'name'
:
'extUnit'
},
{
'name'
:
'resType2'
}
],
'sortItem'
:
[
{
'fieldName'
:
'modifyTime'
,
'sortOrder'
:
'desc'
}
]
}
this
.
loading
=
true
this
.
options
=
[]
this
.
$api
.
searchApi
(
'ExtDxProcessMaterial'
,
params
).
then
(
res
=>
{
if
(
res
.
items
&&
res
.
items
.
content
.
length
)
{
this
.
material
=
res
.
items
.
content
this
.
options
=
res
.
items
.
content
.
map
(
item
=>
{
const
labelParts
=
[]
if
(
item
.
resName
)
labelParts
.
push
(
item
.
resName
+
'/'
)
if
(
item
.
modelNo
)
labelParts
.
push
(
item
.
modelNo
+
'/'
)
if
(
item
.
techSpec
)
labelParts
.
push
(
item
.
techSpec
+
'/'
)
if
(
item
.
spec
)
labelParts
.
push
(
item
.
spec
+
'/'
)
if
(
item
.
supplyStatus
)
labelParts
.
push
(
item
.
supplyStatus
+
'/'
)
if
(
item
.
supplierName
)
labelParts
.
push
(
item
.
supplierName
+
'/'
)
const
label
=
labelParts
.
join
(
''
)
return
{
label
,
value
:
item
.
resCode
}
})
}
else
{
this
.
options
=
[]
}
})
.
catch
((
err
)
=>
console
.
log
(
err
))
.
finally
(()
=>
{
this
.
loading
=
false
this
.
remoteFlag
=
true
this
.
tableColumnSelect
=
false
})
}
else
{
this
.
$utils
.
showMessageWarning
(
'上一步请求正在查询中,请稍后'
)
}
},
// 切换物料下拉
changeMaterial
(
v
)
{
// 带出物料相关默认值
const
SELECT_MATERIAL
=
this
.
material
.
find
((
item
)
=>
item
.
resCode
===
v
)
if
(
SELECT_MATERIAL
)
{
this
.
$set
(
this
.
form
,
'partName'
,
SELECT_MATERIAL
.
resName
)
}
},
change
(
val
)
{
this
.
changeMaterial
(
val
)
this
.
$emit
(
'input'
,
val
)
},
clear
()
{
this
.
$set
(
this
.
form
,
'partName'
,
''
)
this
.
$emit
(
'input'
)
}
}
}
</
script
>
<
style
lang=
"scss"
>
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment