Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
template_vue
Project
Project
Details
Activity
Releases
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
胡宝山
template_vue
Commits
2fb6c7b0
Commit
2fb6c7b0
authored
Jul 29, 2023
by
wdy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
样品库样品种类
parent
eeed2ff2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
162 additions
and
30 deletions
+162
-30
sampleType.js
src/api/sample/sampleType.js
+48
-0
index.vue
src/views/sample/sampleType/index.vue
+114
-30
No files found.
src/api/sample/sampleType.js
0 → 100644
View file @
2fb6c7b0
import
request
from
'@/utils/request'
// 查询列表
export
function
queryList
(
params
)
{
return
request
({
url
:
'/wbchemistrymapping/queryWbChemistryMappingByPagination'
,
method
:
'get'
,
params
})
}
// 添加基础信息接口
export
function
add
(
data
)
{
return
request
({
url
:
'/wbchemistrymapping/add'
,
method
:
'post'
,
data
,
headers
:
{
'Content-Type'
:
'application/json;charset=UTF-8'
}
})
}
// 根据id查询基础信息接口
export
function
getDetailById
(
id
)
{
return
request
({
url
:
'/wbchemistrymapping/detail/'
+
id
,
method
:
'get'
})
}
// 编辑基础信息接口
export
function
updataInfo
(
data
)
{
return
request
({
url
:
'/wbchemistrymapping/update'
,
method
:
'put'
,
data
,
headers
:
{
'Content-Type'
:
'application/json;charset=UTF-8'
}
})
}
// 逻辑删除基础信息接口
export
function
deleteLogical
(
id
)
{
return
request
({
url
:
'/wbchemistrymapping/deleteLogical/'
+
id
,
method
:
'delete'
})
}
src/views/sample/sampleType/index.vue
View file @
2fb6c7b0
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
</el-form-item>
</el-form-item>
<el-form-item
label=
"name"
prop=
"name"
>
<el-form-item
label=
"name"
prop=
"name"
>
<el-input
<el-input
v-model=
"queryParams.name"
v-model=
"queryParams.
d
name"
placeholder=
"请输入名称"
placeholder=
"请输入名称"
clearable
clearable
size=
"small"
size=
"small"
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
type=
"primary"
style=
"padding: 8px 7px;"
icon=
"el-icon-search"
size=
"small"
@
click=
"handleQuery"
>
查询
</el-button>
<el-button
type=
"primary"
style=
"padding: 8px 7px;"
icon=
"el-icon-search"
size=
"small"
@
click=
"handleQuery"
>
查询
</el-button>
<el-button
type=
"primary"
style=
"padding: 8px 7px;"
icon=
"el-icon-refresh"
size=
"small"
@
click=
"resetQuery"
>
重置
</el-button>
<el-button
style=
"padding: 8px 7px;"
icon=
"el-icon-refresh"
size=
"small"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form-item>
<div
style=
"float: right"
>
<div
style=
"float: right"
>
<el-form-item>
<el-form-item>
...
@@ -57,29 +57,19 @@
...
@@ -57,29 +57,19 @@
{{
scope
.
row
.
pn
||
'-'
}}
{{
scope
.
row
.
pn
||
'-'
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"
qty"
prop=
"qty
"
:show-overflow-tooltip=
"true"
>
<el-table-column
label=
"
dname"
prop=
"dname
"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
qty
||
'-'
}}
{{
scope
.
row
.
dname
||
'-'
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"
name"
prop=
"name
"
:show-overflow-tooltip=
"true"
>
<el-table-column
label=
"
dno"
prop=
"dno
"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
name
||
'-'
}}
{{
scope
.
row
.
dno
||
'-'
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"
max_qty"
prop=
"max_qty
"
:show-overflow-tooltip=
"true"
>
<el-table-column
label=
"
remarks"
prop=
"remarks
"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
max_qty
||
'-'
}}
{{
scope
.
row
.
remarks
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"min_qty"
prop=
"min_qty"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
min_qty
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"unit"
prop=
"unit"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
unit
||
'-'
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"操作人"
prop=
"createName"
:show-overflow-tooltip=
"true"
>
<el-table-column
label=
"操作人"
prop=
"createName"
:show-overflow-tooltip=
"true"
>
...
@@ -87,9 +77,9 @@
...
@@ -87,9 +77,9 @@
{{
scope
.
row
.
createName
||
'-'
}}
{{
scope
.
row
.
createName
||
'-'
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"操作时间"
prop=
"create
_d
ate"
:show-overflow-tooltip=
"true"
>
<el-table-column
label=
"操作时间"
prop=
"create
D
ate"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
create
_d
ate
||
'-'
}}
{{
scope
.
row
.
create
D
ate
||
'-'
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"操作"
>
<el-table-column
label=
"操作"
>
...
@@ -122,28 +112,56 @@
...
@@ -122,28 +112,56 @@
v-show=
"total>0"
v-show=
"total>0"
:total=
"total"
:total=
"total"
:page
.
sync=
"queryParams.page"
:page
.
sync=
"queryParams.page"
:limit
.
sync=
"queryParams.
page
"
:limit
.
sync=
"queryParams.
rows
"
@
pagination=
"getList"
@
pagination=
"getList"
/>
/>
<!-- 新增修改弹出 -->
<!-- 新增修改弹出 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
:close-on-click-modal=
"false"
@
close=
"cancel"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
size=
"small"
label-width=
"80px"
>
<el-form-item
label=
"pn"
prop=
"pn"
>
<el-input
v-model
.
trim=
"form.pn"
:maxlength=
"30"
placeholder=
"请输入pn"
/>
</el-form-item>
<el-form-item
label=
"dname"
prop=
"dname"
>
<el-input
v-model
.
trim=
"form.dname"
:maxlength=
"30"
placeholder=
"请输入dname"
/>
</el-form-item>
<el-form-item
label=
"dno"
prop=
"dno"
>
<el-input
v-model
.
trim=
"form.dno"
:maxlength=
"30"
placeholder=
"请输入dno"
/>
</el-form-item>
<el-form-item
label=
"remarks"
prop=
"remarks"
>
<el-input
v-model
.
trim=
"form.remarks"
:maxlength=
"30"
placeholder=
"请输入remarks"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
queryList
}
from
'@/api/sample/basicInformation'
import
{
add
,
deleteLogical
,
getDetailById
,
queryList
,
updataInfo
}
from
'@/api/sample/sampleType'
import
{
parseTime
}
from
'@/utils'
export
default
{
export
default
{
name
:
'Index'
,
name
:
'Index'
,
data
()
{
data
()
{
return
{
return
{
title
:
''
,
open
:
false
,
form
:
{},
rules
:
{
pn
:
[{
required
:
true
,
message
:
'请输入pn'
,
trigger
:
'blur'
}],
dname
:
[{
required
:
true
,
message
:
'请输入name'
,
trigger
:
'blur'
}]
},
total
:
0
,
total
:
0
,
loading
:
false
,
loading
:
false
,
queryParams
:
{
queryParams
:
{
page
:
1
,
page
:
1
,
rows
:
10
,
rows
:
10
,
pn
:
''
,
pn
:
''
,
name
:
''
d
name
:
''
},
},
statusOptions
:
{},
statusOptions
:
{},
basicinfoMationList
:
[]
basicinfoMationList
:
[]
...
@@ -153,17 +171,67 @@ export default {
...
@@ -153,17 +171,67 @@ export default {
this
.
getList
()
this
.
getList
()
},
},
methods
:
{
methods
:
{
handleDelete
()
{
// 删除
handleDelete
(
row
)
{
const
id
=
row
.
businessId
this
.
$confirm
(
'是否确认操作?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
res
=>
{
deleteLogical
(
id
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
this
.
$message
.
success
(
'操作成功'
)
this
.
getList
()
}
})
})
},
},
handleUpdate
()
{
// 修改
handleUpdate
(
row
)
{
const
id
=
row
.
businessId
getDetailById
(
id
).
then
(
res
=>
{
this
.
form
=
res
.
data
this
.
open
=
true
this
.
title
=
'修改样品种类表单'
})
},
// 提交
submitForm
()
{
this
.
$refs
.
form
.
validate
((
valid
)
=>
{
if
(
valid
)
{
// 校验通过,提交表单或进行其他操作
if
(
this
.
form
.
businessId
!==
undefined
)
{
updataInfo
(
this
.
form
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
this
.
open
=
false
this
.
$message
.
success
(
'操作成功'
)
this
.
getList
()
this
.
reFrom
()
}
else
if
(
res
.
code
===
null
)
{
this
.
$message
.
error
(
res
.
message
)
}
})
}
else
{
add
(
this
.
form
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
this
.
open
=
false
this
.
$message
.
success
(
'操作成功'
)
this
.
getList
()
this
.
reFrom
()
}
else
if
(
res
.
code
===
null
)
{
this
.
$message
.
error
(
res
.
message
)
}
})
}
}
})
},
},
// 初始化获取数据
// 初始化获取数据
getList
()
{
getList
()
{
this
.
loading
=
true
this
.
loading
=
true
queryList
(
this
.
queryParams
).
then
(
res
=>
{
queryList
(
this
.
queryParams
).
then
(
res
=>
{
console
.
log
(
'res'
,
res
)
res
.
rows
.
createDate
=
parseTime
(
res
.
rows
.
createDate
,
'{y}-{m}-{d}'
)
this
.
total
=
res
.
total
this
.
total
=
res
.
total
this
.
basicinfoMationList
=
res
.
rows
this
.
basicinfoMationList
=
res
.
rows
this
.
loading
=
false
this
.
loading
=
false
...
@@ -180,15 +248,31 @@ export default {
...
@@ -180,15 +248,31 @@ export default {
page
:
1
,
page
:
1
,
rows
:
10
,
rows
:
10
,
pn
:
''
,
pn
:
''
,
name
:
''
d
name
:
''
}
}
this
.
getList
()
this
.
getList
()
},
},
handleAdd
()
{
handleAdd
()
{
this
.
open
=
true
this
.
title
=
'添加样品种类表单'
},
},
handleExport
()
{
handleExport
()
{
},
cancel
()
{
this
.
open
=
false
this
.
reFrom
()
},
// 清空表单
reFrom
()
{
this
.
form
=
{
businessId
:
undefined
,
pn
:
''
,
dname
:
''
,
dno
:
''
,
remarks
:
''
}
this
.
$refs
.
form
.
clearValidate
()
}
}
}
}
}
}
...
...
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