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
3d9dfbd1
Commit
3d9dfbd1
authored
Aug 03, 2023
by
CenXinYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化Table组件,实现序列类型自定义
Signed-off-by:
CenXinYi
<
2810162984@qq.com
>
parent
22c6d056
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
101 deletions
+93
-101
index.vue
src/components/Table/BaseTable/index.vue
+8
-7
checkProcess.vue
src/views/equipment/checkProcess.vue
+79
-85
index.vue
src/views/processManagement/inventoryRecord/index.vue
+6
-9
No files found.
src/components/Table/BaseTable/index.vue
View file @
3d9dfbd1
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
@
sort-change=
"changeTableSort"
@
sort-change=
"changeTableSort"
>
>
<el-table-column
type=
"index"
label=
"序号"
width=
"50
"
/>
<el-table-column
v-if=
"allTableArguments.columObj.nIndex"
type=
"index"
label=
"序号"
width=
"50"
:index=
"allTableArguments.columObj.nIndextable ? nIndex : ''
"
/>
<!-- TODO: 选择框是否开启,selectable控制是否单行禁用 -->
<!-- TODO: 选择框是否开启,selectable控制是否单行禁用 -->
<el-table-column
v-if=
"allTableArguments.columObj.selection"
type=
"selection"
:selectable=
"allTableArguments.columObj.selectable"
width=
"50px"
/>
<el-table-column
v-if=
"allTableArguments.columObj.selection"
type=
"selection"
:selectable=
"allTableArguments.columObj.selectable"
width=
"50px"
/>
...
@@ -87,12 +87,6 @@ export default {
...
@@ -87,12 +87,6 @@ export default {
default
:
()
=>
{
default
:
()
=>
{
return
new
BaseTableArgumentsTest
()
return
new
BaseTableArgumentsTest
()
}
}
},
nIndex
:
{
type
:
Function
,
default
:
()
=>
{
return
Function
}
}
}
},
},
data
()
{
data
()
{
...
@@ -102,6 +96,13 @@ export default {
...
@@ -102,6 +96,13 @@ export default {
}
}
},
},
methods
:
{
methods
:
{
/* TODO:自定义分页索引,实现索引继承 */
nIndex
(
index
)
{
// TODO: 当前页数 - 1 * 每页数据条数 + 1
const
page
=
this
.
allTableArguments
.
queryParams
.
page
// TODO: 当前页码
const
rows
=
this
.
allTableArguments
.
queryParams
.
rows
// TODO: 每页条数
return
index
+
1
+
(
page
-
1
)
*
rows
},
changeTableSort
(
val
)
{
changeTableSort
(
val
)
{
this
.
$emit
(
'change-table-sort'
,
val
)
this
.
$emit
(
'change-table-sort'
,
val
)
},
},
...
...
src/views/equipment/checkProcess.vue
View file @
3d9dfbd1
...
@@ -33,18 +33,17 @@
...
@@ -33,18 +33,17 @@
/>
/>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
type=
"primary"
style=
"padding: 8px 7px;"
size=
"small"
icon=
"el-icon-search"
@
click=
"handleQuery"
>
查询
</el-button>
<el-button
type=
"primary"
style=
"padding: 8px 7px;"
size=
"small"
icon=
"el-icon-search"
@
click=
"handleQuery"
>
查询
</el-button>
<el-button
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>
<el-button
style=
"padding: 8px 7px;"
:type=
"typePrimary"
:size=
"smallSize"
:icon=
"addIcon"
@
click=
"checkType"
>
开始盘点
</el-button>
<el-button
style=
"padding: 8px 7px;"
:type=
"typePrimary"
:size=
"smallSize"
:icon=
"addIcon"
@
click=
"checkType"
>
开始盘点
</el-button>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
style=
"padding: 8px 7px;"
type=
"danger"
:size=
"smallSize"
@
click=
"deleteByType"
icon=
"el-icon-minus
"
>
结束盘点
</el-button>
<el-button
style=
"padding: 8px 7px;"
type=
"danger"
:size=
"smallSize"
icon=
"el-icon-minus"
@
click=
"deleteByType
"
>
结束盘点
</el-button>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
...
@@ -149,7 +148,7 @@
...
@@ -149,7 +148,7 @@
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
</div>
</div>
</el-dialog>
</el-dialog>
<!-- 弹出框。。。。。。。。。。。。。。。。。。。。。。。 -->
<!-- 弹出框。。。。。。。。。。。。。。。。。。。。。。。 -->
<el-dialog
class=
"aboutSingleDetails"
:title=
"title"
:visible
.
sync=
"openDetails"
width=
"700px"
append-to-body
>
<el-dialog
class=
"aboutSingleDetails"
:title=
"title"
:visible
.
sync=
"openDetails"
width=
"700px"
append-to-body
>
<el-form
ref=
"formDetails"
:model=
"singleDetails"
size=
"small"
label-width=
"90px"
>
<el-form
ref=
"formDetails"
:model=
"singleDetails"
size=
"small"
label-width=
"90px"
>
<el-row>
<el-row>
...
@@ -165,8 +164,6 @@
...
@@ -165,8 +164,6 @@
</el-col>
</el-col>
</el-row>
</el-row>
<el-row>
<el-row>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"plocation:"
prop=
"plocation"
>
<el-form-item
label=
"plocation:"
prop=
"plocation"
>
...
@@ -194,12 +191,10 @@
...
@@ -194,12 +191,10 @@
<el-row>
<el-row>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"厚度:"
prop=
"phd"
>
<el-form-item
label=
"厚度:"
prop=
"phd"
>
<el-input
v-model
.
trim=
"singleDetails.phd"
:readonly=
"true"
/>
<el-input
v-model
.
trim=
"singleDetails.phd"
:readonly=
"true"
/>
</el-form-item>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
</el-col>
</el-col>
<el-col
:span=
"12"
/>
</el-row>
</el-row>
<el-row>
<el-row>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
...
@@ -221,27 +216,27 @@
...
@@ -221,27 +216,27 @@
:visible
.
sync=
"table"
:visible
.
sync=
"table"
direction=
"rtl"
direction=
"rtl"
size=
"50%"
size=
"50%"
>
>
<el-table
v-loading=
"loading"
border
:data=
"tableList"
@
selection-change=
"handleSelectionChange"
style=
"padding: 0 10px;
"
>
<el-table
v-loading=
"loading"
border
:data=
"tableList"
style=
"padding: 0 10px;"
@
selection-change=
"handleSelectionChange
"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"80"
/>
<el-table-column
type=
"index"
label=
"序号"
width=
"80"
/>
<el-table-column
label=
"pn"
prop=
"pn"
>
<el-table-column
label=
"pn"
prop=
"pn"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
pn
||
'-'
}}
{{
scope
.
row
.
pn
||
'-'
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"lot"
prop=
"lot"
>
<el-table-column
label=
"lot"
prop=
"lot"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
lot
||
'-'
}}
{{
scope
.
row
.
lot
||
'-'
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"位置"
prop=
"plocation"
>
<el-table-column
label=
"位置"
prop=
"plocation"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
plocation
||
'-'
}}
{{
scope
.
row
.
plocation
||
'-'
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"厚度"
prop=
"phd"
>
<el-table-column
label=
"厚度"
prop=
"phd"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
phd
||
'-'
}}
{{
scope
.
row
.
phd
||
'-'
}}
</
template
>
</
template
>
...
@@ -261,9 +256,9 @@ import {
...
@@ -261,9 +256,9 @@ import {
getRole
,
getRole
,
updateRole
updateRole
}
from
'@/api/system/role'
}
from
'@/api/system/role'
import
{
checkType
,
listCheck
,
addList
,
deleteByType
,
checkInventory
}
from
'@/api/equipment/check'
import
{
checkType
,
listCheck
,
addList
,
deleteByType
,
checkInventory
}
from
'@/api/equipment/check'
import
{
roleMenuTreeselect
,
roleMenuTreeselectMC
,
treeselect
as
menuTreeselect
}
from
'@/api/system/menu'
import
{
roleMenuTreeselect
,
roleMenuTreeselectMC
,
treeselect
as
menuTreeselect
}
from
'@/api/system/menu'
import
{
roleDeptTreeselect
,
treeselect
as
deptTreeselect
}
from
'@/api/system/dept'
import
{
roleDeptTreeselect
,
treeselect
as
deptTreeselect
}
from
'@/api/system/dept'
// import { getRolesByInsId } from '../../../api/businessManage/template'
// import { getRolesByInsId } from '../../../api/businessManage/template'
export
default
{
export
default
{
name
:
'Role'
,
name
:
'Role'
,
...
@@ -271,13 +266,13 @@ export default {
...
@@ -271,13 +266,13 @@ export default {
return
{
return
{
// 需要盘点的list
// 需要盘点的list
checkFrom
:
{
checkFrom
:
{
Ptype
:
''
,
Ptype
:
''
,
checkList
:
[],
checkList
:
[]
},
},
table
:
false
,
table
:
false
,
tableList
:[],
tableList
:
[],
// 选中的列表
// 选中的列表
selectList
:[],
selectList
:
[],
// TODO: 表单里的单项详情参数
// TODO: 表单里的单项详情参数
singleDetails
:
{
singleDetails
:
{
equipmentName
:
''
,
equipmentName
:
''
,
...
@@ -372,10 +367,10 @@ export default {
...
@@ -372,10 +367,10 @@ export default {
label
:
'仅本人数据权限'
label
:
'仅本人数据权限'
}
}
],
],
check
:[],
check
:
[],
// 菜单列表
// 菜单列表
menuOptions
:
[],
menuOptions
:
[],
equipmentList
:[],
equipmentList
:
[],
// 部门列表
// 部门列表
tOptions
:
[],
tOptions
:
[],
// 查询参数
// 查询参数
...
@@ -386,8 +381,8 @@ export default {
...
@@ -386,8 +381,8 @@ export default {
roleKey
:
undefined
,
roleKey
:
undefined
,
flag
:
undefined
,
flag
:
undefined
,
ptype
:
2
,
ptype
:
2
,
pstatus
:
0
,
pstatus
:
0
,
delFlag
:
0
delFlag
:
0
},
},
// 表单参数
// 表单参数
...
@@ -437,18 +432,18 @@ export default {
...
@@ -437,18 +432,18 @@ export default {
},
},
methods
:
{
methods
:
{
checkInventory
()
{
checkInventory
()
{
this
.
table
=
true
;
this
.
table
=
true
checkInventory
(
2
)
checkInventory
(
2
)
.
then
(
response
=>
{
.
then
(
response
=>
{
// 处理返回的数据
// 处理返回的数据
this
.
tableList
=
response
.
data
;
this
.
tableList
=
response
.
data
console
.
log
(
response
);
console
.
log
(
response
)
})
})
.
catch
(
error
=>
{
.
catch
(
error
=>
{
// 处理请求错误
// 处理请求错误
console
.
error
(
error
);
console
.
error
(
error
)
});
})
},
},
// TODO: 获取所选行详情信息操作
// TODO: 获取所选行详情信息操作
handleDetail
(
row
)
{
handleDetail
(
row
)
{
this
.
singleDetails
=
this
.
formReset
this
.
singleDetails
=
this
.
formReset
...
@@ -457,60 +452,59 @@ export default {
...
@@ -457,60 +452,59 @@ export default {
this
.
openDetails
=
!
this
.
openDetails
this
.
openDetails
=
!
this
.
openDetails
},
},
deleteByType
()
{
deleteByType
()
{
// 添加二次确认对话框
this
.
$confirm
(
"确认要结束盘点吗?"
,
"提示"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
,
})
.
then
(()
=>
{
// 用户点击确定按钮时执行的回调函数
deleteByType
(
2
).
then
(
flag
=>
{
if
(
flag
.
data
>
0
)
{
this
.
$message
.
success
(
"结束盘点成功"
);
}
else
{
this
.
$message
.
error
(
"当前未开始盘点"
);
}
});
})
.
catch
(()
=>
{
// 用户点击取消按钮时执行的回调函数,可以忽略这里的实现
});
},
checkType
()
{
checkType
(
2
).
then
(
total
=>
{
if
(
total
.
data
!==
0
)
{
this
.
$message
.
error
(
"请先结束盘点"
);
}
else
{
let
data
=
[];
if
(
this
.
selectList
.
length
===
0
)
{
data
=
this
.
equipmentList
;
}
else
{
data
=
this
.
selectList
;
}
// 添加二次确认对话框
// 添加二次确认对话框
this
.
$confirm
(
"确认要进行盘点吗?"
,
"提示"
,
{
this
.
$confirm
(
'确认要结束盘点吗?'
,
'提示'
,
{
confirmButtonText
:
"确定"
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
"取消"
,
cancelButtonText
:
'取消'
,
type
:
"warning"
,
type
:
'warning'
})
})
.
then
(()
=>
{
.
then
(()
=>
{
// 用户点击确定按钮时执行的回调函数
// 用户点击确定按钮时执行的回调函数
addList
(
data
).
then
(
flag
=>
{
deleteByType
(
2
).
then
(
flag
=>
{
if
(
flag
.
data
.
influence
>
0
)
{
if
(
flag
.
data
>
0
)
{
this
.
$message
.
success
(
"盘点成功"
);
this
.
$message
.
success
(
'结束盘点成功'
)
}
else
{
}
else
{
this
.
$message
.
error
(
"盘点失败"
);
this
.
$message
.
error
(
'当前未开始盘点'
)
}
}
})
;
})
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
// 用户点击取消按钮时执行的回调函数,可以忽略这里的实现
// 用户点击取消按钮时执行的回调函数,可以忽略这里的实现
});
})
}
},
});
checkType
()
{
},
checkType
(
2
).
then
(
total
=>
{
if
(
total
.
data
!==
0
)
{
this
.
$message
.
error
(
'请先结束盘点'
)
}
else
{
let
data
=
[]
if
(
this
.
selectList
.
length
===
0
)
{
data
=
this
.
equipmentList
}
else
{
data
=
this
.
selectList
}
// 添加二次确认对话框
this
.
$confirm
(
'确认要进行盘点吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
})
.
then
(()
=>
{
// 用户点击确定按钮时执行的回调函数
addList
(
data
).
then
(
flag
=>
{
if
(
flag
.
data
.
influence
>
0
)
{
this
.
$message
.
success
(
'盘点成功'
)
}
else
{
this
.
$message
.
error
(
'盘点失败'
)
}
})
})
.
catch
(()
=>
{
// 用户点击取消按钮时执行的回调函数,可以忽略这里的实现
})
}
})
},
handelTab
(
i
,
e
)
{
handelTab
(
i
,
e
)
{
const
that
=
this
const
that
=
this
...
@@ -670,7 +664,7 @@ export default {
...
@@ -670,7 +664,7 @@ export default {
},
},
/** 重置按钮操作 */
/** 重置按钮操作 */
resetQuery
()
{
resetQuery
()
{
this
.
queryParams
=
{
this
.
queryParams
=
{
page
:
1
,
page
:
1
,
rows
:
10
,
rows
:
10
,
ptype
:
2
,
ptype
:
2
,
...
...
src/views/processManagement/inventoryRecord/index.vue
View file @
3d9dfbd1
...
@@ -116,6 +116,7 @@
...
@@ -116,6 +116,7 @@
:is=
"BaseTable"
:is=
"BaseTable"
:key=
"queryParams.rows"
:key=
"queryParams.rows"
:all-table-arguments=
"allTableArguments"
:all-table-arguments=
"allTableArguments"
@
n-index=
"nIndex"
@
handle-detail=
"handleDetail"
@
handle-detail=
"handleDetail"
@
change-table-sort=
"changeTableSort"
@
change-table-sort=
"changeTableSort"
/>
/>
...
@@ -309,6 +310,10 @@ export default {
...
@@ -309,6 +310,10 @@ export default {
inventoryRecordList
:
[],
inventoryRecordList
:
[],
// TODO: 用来说明每一列的类型
// TODO: 用来说明每一列的类型
columObj
:
{
columObj
:
{
// 序列
nIndex
:
true
,
// 序列根据条件是否继承排序顺序
nIndextable
:
false
,
// 选择框
// 选择框
selection
:
false
,
selection
:
false
,
// 选择框根据条件是否可选
// 选择框根据条件是否可选
...
@@ -401,13 +406,7 @@ export default {
...
@@ -401,13 +406,7 @@ export default {
BaseTable
()
{
BaseTable
()
{
return
BaseTable
return
BaseTable
},
},
/* TODO:自定义分页索引,实现索引继承 */
nIndex
(
index
)
{
// TODO: 当前页数 - 1 * 每页数据条数 + 1
const
page
=
this
.
queryParams
.
page
// TODO: 当前页码
const
rows
=
this
.
queryParams
.
rows
// TODO: 每页条数
return
index
+
1
+
(
page
-
1
)
*
rows
},
// TODO: 用来汇总Table组件所需要的全部数据并一次性传输给子组件
// TODO: 用来汇总Table组件所需要的全部数据并一次性传输给子组件
allTableArguments
()
{
allTableArguments
()
{
const
baseTableArgumentsTest
=
new
BaseTableArgumentsTest
()
const
baseTableArgumentsTest
=
new
BaseTableArgumentsTest
()
...
@@ -448,8 +447,6 @@ export default {
...
@@ -448,8 +447,6 @@ export default {
listLog
(
this
.
queryParams
,
this
.
addDateRange
(
this
.
queryEntity
,
this
.
dateRange
)).
then
(
response
=>
{
listLog
(
this
.
queryParams
,
this
.
addDateRange
(
this
.
queryEntity
,
this
.
dateRange
)).
then
(
response
=>
{
this
.
inventoryRecordList
=
response
.
rows
this
.
inventoryRecordList
=
response
.
rows
this
.
total
=
response
.
total
this
.
total
=
response
.
total
// 暂时还没写后端 this.selectOptionsAboutPoperate = selectOptionsAboutPoperate
// this.selectOptionsAboutPtype = selectOptionsAboutPtype
this
.
loading
=
false
this
.
loading
=
false
})
})
},
},
...
...
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