Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
klck
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
位宇华
klck
Commits
71096709
Commit
71096709
authored
Jul 27, 2023
by
张兴海
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物资模块,导入模块,状态修改
parent
b9a2a7da
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
1010 additions
and
993 deletions
+1010
-993
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
...ava/com/ruoyi/web/controller/common/CommonController.java
+1
-1
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesController.java
...va/com/ruoyi/system/controller/ActSuppliesController.java
+13
-5
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesDetailsController.java
...ruoyi/system/controller/ActSuppliesDetailsController.java
+1
-1
ruoyi-supplies/src/main/java/com/ruoyi/system/domain/ActSupplies.java
...es/src/main/java/com/ruoyi/system/domain/ActSupplies.java
+4
-4
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesServiceImpl.java
...com/ruoyi/system/service/impl/ActSuppliesServiceImpl.java
+8
-7
ruoyi-ui/src/views/system/ActSuppliesDetails/ActSuppliesDetails/index.vue
...ws/system/ActSuppliesDetails/ActSuppliesDetails/index.vue
+7
-5
ruoyi-ui/src/views/system/Actsupplies/Actsupplies/index.vue
ruoyi-ui/src/views/system/Actsupplies/Actsupplies/index.vue
+384
-382
ruoyi-ui/src/views/system/Actsupplies/Actsupplies/indexone.vue
...-ui/src/views/system/Actsupplies/Actsupplies/indexone.vue
+13
-13
ruoyi-ui/src/views/system/supplies/index.vue
ruoyi-ui/src/views/system/supplies/index.vue
+1
-0
ruoyi-ui/src/views/system/supplies/index_template.vue
ruoyi-ui/src/views/system/supplies/index_template.vue
+1
-0
ruoyi-ui/src/views/system/suppliesrole/index.vue
ruoyi-ui/src/views/system/suppliesrole/index.vue
+4
-3
ruoyi-ui/src/views/system/suppliesroledetail/index.vue
ruoyi-ui/src/views/system/suppliesroledetail/index.vue
+573
-572
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
View file @
71096709
...
...
@@ -48,7 +48,7 @@ public class CommonController
{
throw
new
Exception
(
StringUtils
.
format
(
"文件名称({})非法,不允许下载。 "
,
fileName
));
}
String
realFileName
=
System
.
currentTimeMillis
()
+
fileName
.
substring
(
fileName
.
indexOf
(
"_"
)
+
1
);
String
realFileName
=
fileName
.
substring
(
fileName
.
indexOf
(
"_"
)
+
1
);
System
.
out
.
println
(
realFileName
);
String
filePath
=
RuoYiConfig
.
getDownloadPath
()
+
fileName
;
System
.
out
.
println
(
filePath
);
...
...
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesController.java
View file @
71096709
...
...
@@ -44,7 +44,6 @@ public class ActSuppliesController extends BaseController
}
/**
* 查询物料总分类管理列表
*/
...
...
@@ -70,7 +69,6 @@ public class ActSuppliesController extends BaseController
}
/**
* 导出物料总分类管理列表
*/
...
...
@@ -79,9 +77,19 @@ public class ActSuppliesController extends BaseController
@GetMapping
(
"/export"
)
public
AjaxResult
export
(
ActSupplies
actSupplies
)
{
List
<
ActSupplies
>
list
=
actSuppliesService
.
selectActSuppliesList
(
actSupplies
);
for
(
ActSupplies
s
:
list
)
{
String
ss
=
s
.
getStatus
();
if
(
"0"
.
equals
(
ss
)){
s
.
setStatus
(
"启用"
);
}
else
{
s
.
setStatus
(
"禁用"
);
}
}
ExcelUtil
<
ActSupplies
>
util
=
new
ExcelUtil
<
ActSupplies
>(
ActSupplies
.
class
);
return
util
.
exportExcel
(
list
,
"
物料总分类管理数据
"
);
return
util
.
exportExcel
(
list
,
"
用友物料
"
);
}
/**
...
...
@@ -106,7 +114,7 @@ public class ActSuppliesController extends BaseController
actSupplies
.
setCreateBy
(
user
.
getUserName
());
/*return toAjax(actSuppliesService.insertActSupplies(actSupplies));*/
int
i
=
actSuppliesService
.
insertActSupplies
(
actSupplies
);
if
(
i
==
0
){
if
(
i
==
0
){
return
AjaxResult
.
error
(
"添加名称失败,名称已被占用"
);
}
return
AjaxResult
.
success
(
"添加成功"
);
...
...
@@ -135,7 +143,7 @@ public class ActSuppliesController extends BaseController
*/
@PreAuthorize
(
"@ss.hasPermi('Actsupplies:Actsupplies:remove')"
)
@Log
(
title
=
"物料总分类管理"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{ids}"
)
@DeleteMapping
(
"/{ids}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
ids
)
{
...
...
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesDetailsController.java
View file @
71096709
...
...
@@ -67,7 +67,7 @@ public class ActSuppliesDetailsController extends BaseController
{
List
<
ActSuppliesDetails
>
list
=
actSuppliesDetailsService
.
selectActSuppliesDetailsList
(
actSuppliesDetails
);
ExcelUtil
<
ActSuppliesDetails
>
util
=
new
ExcelUtil
<
ActSuppliesDetails
>(
ActSuppliesDetails
.
class
);
return
util
.
exportExcel
(
list
,
"
物料细分类管理数据
"
);
return
util
.
exportExcel
(
list
,
"
六矿物料
"
);
}
/**
...
...
ruoyi-supplies/src/main/java/com/ruoyi/system/domain/ActSupplies.java
View file @
71096709
...
...
@@ -21,7 +21,7 @@ public class ActSupplies extends BaseEntity
/** 父ID */
private
Long
pid
;
@Excel
(
name
=
"
上级分类
"
)
@Excel
(
name
=
"
大类名称
"
)
private
String
fname
;
/** 物料名称 */
...
...
@@ -33,7 +33,7 @@ public class ActSupplies extends BaseEntity
/** 状态 */
@Excel
(
name
=
"状态"
)
private
Integer
status
;
private
String
status
;
...
...
@@ -82,11 +82,11 @@ public class ActSupplies extends BaseEntity
return
orderNum
;
}
public
void
setStatus
(
Integer
status
)
{
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
Integer
getStatus
()
public
String
getStatus
()
{
return
status
;
}
...
...
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesServiceImpl.java
View file @
71096709
...
...
@@ -137,12 +137,12 @@ public class ActSuppliesServiceImpl implements IActSuppliesService
@Override
public
void
setEnable
(
Long
id
)
{
updateStatusById
(
id
,
0
);
updateStatusById
(
id
,
"0"
);
}
@Override
public
void
setDisable
(
Long
id
)
{
updateStatusById
(
id
,
1
);
updateStatusById
(
id
,
"1"
);
}
@Override
...
...
@@ -166,21 +166,22 @@ public class ActSuppliesServiceImpl implements IActSuppliesService
return
actSuppliesMapper
.
selectActSuppliesListOne
(
actSupplies
);
}
private
void
updateStatusById
(
Long
id
,
Integer
status
){
private
void
updateStatusById
(
Long
id
,
String
status
){
String
[]
statusText
={
"禁用"
,
"启用"
};
//判断查询结果是否为空
ActSupplies
queryResult
=
actSuppliesMapper
.
selectActSuppliesById
(
id
);
if
(
queryResult
==
null
)
{
String
message
=
statusText
[
status
]
+
"物料总分类管理失败,尝试访问的数据不存在"
;
String
message
=
statusText
[
Integer
.
parseInt
(
status
)
]
+
"物料总分类管理失败,尝试访问的数据不存在"
;
System
.
out
.
println
(
message
);
throw
new
RuntimeException
(
message
);
}
//判断以上查询结果中的status是否与参数status相同
if
(
queryResult
.
getStatus
().
equals
(
status
)){
String
message
=
statusText
[
status
]
+
"物料总分类管理失败,当前物料总分类管理已经处理"
+
statusText
[
status
]
+
"状态!"
;
String
message
=
statusText
[
Integer
.
parseInt
(
status
)]
+
"物料总分类管理失败,当前物料总分类管理已经处理"
+
statusText
[
Integer
.
parseInt
(
status
)
]
+
"状态!"
;
System
.
out
.
println
(
message
);
throw
new
RuntimeException
(
message
);
}
...
...
@@ -192,7 +193,7 @@ public class ActSuppliesServiceImpl implements IActSuppliesService
int
rows
=
actSuppliesMapper
.
updateActSupplies
(
actSupplies
);
if
(
rows
!=
1
)
{
String
message
=
statusText
[
status
]
+
"物料总分类管理失败,服务器忙请再次重试"
;
String
message
=
statusText
[
Integer
.
parseInt
(
status
)
]
+
"物料总分类管理失败,服务器忙请再次重试"
;
System
.
out
.
println
(
message
);
throw
new
RuntimeException
(
message
);
}
...
...
ruoyi-ui/src/views/system/ActSuppliesDetails/ActSuppliesDetails/index.vue
View file @
71096709
...
...
@@ -20,6 +20,7 @@
clearable
size=
"small"
@
keyup.enter.native=
"handleQuery"
maxlength=
"15"
/>
</el-form-item>
<el-form-item
label=
"所属系统"
prop=
"sysclassify"
>
...
...
@@ -29,6 +30,7 @@
clearable
size=
"small"
@
keyup.enter.native=
"handleQuery"
maxlength=
"15"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
...
...
@@ -149,7 +151,7 @@
<el-dialog
:title=
"title"
:visible.sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"所属分类"
prop=
"sid"
>
<el-select
v-model=
"form.sid"
filterable
placeholder=
"请选择所属分类"
>
<el-select
v-model=
"form.sid"
filterable
placeholder=
"请选择所属分类"
style=
"width:380px"
>
<el-option
v-for=
"option in options2"
:key=
"option.suppliesName"
...
...
@@ -159,13 +161,13 @@
</el-select>
</el-form-item>
<el-form-item
label=
"物料名称"
prop=
"detailsName"
>
<el-input
v-model=
"form.detailsName"
placeholder=
"请输入物料名称"
/>
<el-input
v-model=
"form.detailsName"
placeholder=
"请输入物料名称"
maxlength=
"15"
/>
</el-form-item>
<el-form-item
label=
"所属系统"
prop=
"sysclassify"
>
<el-input
v-model=
"form.sysclassify"
placeholder=
"请输入所属系统"
/>
<el-input
v-model=
"form.sysclassify"
placeholder=
"请输入所属系统"
maxlength=
"15"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"
"
>
<el-select
v-model=
"form.status"
placeholder=
"请选择状态"
>
<el-form-item
label=
"状态"
prop=
"
status"
>
<el-select
v-model=
"form.status"
placeholder=
"请选择状态"
style=
"width:380px"
>
<el-option
label=
"启用"
:value=
"0"
></el-option>
<el-option
label=
"禁用"
:value=
"1"
></el-option>
</el-select>
...
...
ruoyi-ui/src/views/system/Actsupplies/Actsupplies/index.vue
View file @
71096709
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"一级分类名称"
prop=
"pid"
label-width=
"100px"
>
<el-select
v-model=
"queryParams.pid"
filterable
clearable
placeholder=
"请输入一级分类分类名称"
>
<el-option
v-for=
"option in options"
:key=
"option.suppliesName"
:label=
"option.suppliesName"
:value=
"option.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"物料名称"
prop=
"suppliesName"
>
<el-input
v-model=
"queryParams.suppliesName"
placeholder=
"请输入物料名称"
clearable
size=
"small"
@
keyup.enter.native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-select
v-model=
"queryParams.status"
placeholder=
"请选择状态"
clearable
@
keyup.enter.native=
"handleQuery"
>
<el-option
label=
"启用"
:value=
"0"
></el-option>
<el-option
label=
"禁用"
:value=
"1"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"一级分类名称"
prop=
"pid"
label-width=
"100px"
>
<el-select
v-model=
"queryParams.pid"
filterable
clearable
placeholder=
"请输入一级分类分类名称"
>
<el-option
v-for=
"option in options"
:key=
"option.suppliesName"
:label=
"option.suppliesName"
:value=
"option.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"物料名称"
prop=
"suppliesName"
>
<el-input
v-model=
"queryParams.suppliesName"
placeholder=
"请输入物料名称"
clearable
size=
"small"
@
keyup.enter.native=
"handleQuery"
maxlength=
"15"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-select
v-model=
"queryParams.status"
placeholder=
"请选择状态"
clearable
@
keyup.enter.native=
"handleQuery"
>
<el-option
label=
"启用"
:value=
"0"
></el-option>
<el-option
label=
"禁用"
:value=
"1"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['supplies:supplies:add']"
>
新增二级分类
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"single"
@
click=
"handleUpdate"
v-hasPermi=
"['supplies:supplies:edit']"
>
修改
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['supplies:supplies:remove']"
>
删除
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
v-hasPermi=
"['supplies:supplies:export']"
>
导出
</el-button>
</el-col>
<right-toolbar
:showSearch.sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['supplies:supplies:add']"
>
新增二级分类
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"single"
@
click=
"handleUpdate"
v-hasPermi=
"['supplies:supplies:edit']"
>
修改
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['supplies:supplies:remove']"
>
删除
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
v-hasPermi=
"['supplies:supplies:export']"
>
导出
</el-button>
</el-col>
<right-toolbar
:showSearch.sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"suppliesList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<!--
<el-table-column
label=
"ID"
align=
"center"
prop=
"id"
/>
-->
<el-table-column
type=
"index"
width=
"80"
align=
"center"
label=
"序号"
:index=
"indexMethod"
/>
<el-table-column
label=
"一级分类名称"
align=
"center"
>
<template
slot-scope=
"scope"
>
<div>
<template>
{{
scope
.
row
.
fname
}}
</
template
>
</div>
</template>
</el-table-column>
<el-table-column
label=
"二级分类名称"
align=
"center"
prop=
"suppliesName"
/>
<el-table-column
label=
"状态"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div>
<el-switch
@
change=
"toggleEnable(scope.row)"
v-model=
"scope.row.status"
:active-value=
"0"
:inactive-value=
"1"
active-color=
"#13ce66"
inactive-color=
"#cccccc"
>
</el-switch>
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['supplies:supplies:edit']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['supplies:supplies:remove']"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total>0"
:total=
"total"
:page.sync=
"queryParams.pageNum"
:limit.sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 添加或修改物料总分类管理对话框 -->
<el-dialog
:title=
"title"
:visible.sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"所属一级分类"
prop=
"pid"
>
<el-select
v-model=
"form.pid"
filterable
placeholder=
"请输入所属一级分类"
>
<el-option
v-for=
"option in options"
:key=
"option.suppliesName"
:label=
"option.suppliesName"
:value=
"option.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"物料名称"
prop=
"suppliesName"
>
<el-input
v-model=
"form.suppliesName"
placeholder=
"请输入二级分类名称"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-select
v-model=
"form.status"
placeholder=
"请选择状态"
>
<el-option
label=
"启用"
:value=
"0"
></el-option>
<el-option
label=
"禁用"
:value=
"1"
></el-option>
</el-select>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
<el-table
v-loading=
"loading"
:data=
"suppliesList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<!--
<el-table-column
label=
"ID"
align=
"center"
prop=
"id"
/>
-->
<el-table-column
type=
"index"
width=
"80"
align=
"center"
label=
"序号"
:index=
"indexMethod"
/>
<el-table-column
label=
"一级分类名称"
align=
"center"
>
<template
slot-scope=
"scope"
>
<div>
<template>
{{
scope
.
row
.
fname
}}
</
template
>
</div>
</template>
</el-table-column>
<el-table-column
label=
"二级分类名称"
align=
"center"
prop=
"suppliesName"
/>
<el-table-column
label=
"状态"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div>
<el-switch
@
change=
"toggleEnable(scope.row)"
v-model=
"scope.row.status"
:active-value=
"0"
:inactive-value=
"1"
active-color=
"#13ce66"
inactive-color=
"#cccccc"
>
</el-switch>
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['supplies:supplies:edit']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['supplies:supplies:remove']"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total>0"
:total=
"total"
:page.sync=
"queryParams.pageNum"
:limit.sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 添加或修改物料总分类管理对话框 -->
<el-dialog
:title=
"title"
:visible.sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"所属一级分类"
prop=
"pid"
>
<el-select
v-model=
"form.pid"
filterable
placeholder=
"请输入所属一级分类"
>
<el-option
v-for=
"option in options"
:key=
"option.suppliesName"
:label=
"option.suppliesName"
:value=
"option.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"物料名称"
prop=
"suppliesName"
>
<el-input
v-model=
"form.suppliesName"
placeholder=
"请输入二级分类名称"
maxlength=
"15"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-select
v-model=
"form.status"
placeholder=
"请选择状态"
>
<el-option
label=
"启用"
:value=
"0"
></el-option>
<el-option
label=
"禁用"
:value=
"1"
></el-option>
</el-select>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<
script
>
import
{
listSupplies
,
toggleEnable
,
toggleDisable
,
getSupplies
,
delSupplies
,
addSupplies
,
updateSupplies
,
exportSupplies
,
getPid
}
from
"
@/api/Actsupplies/Actsupplies
"
;
export
default
{
name
:
"
Supplies
"
,
components
:
{
},
data
()
{
let
checkId
=
(
rule
,
value
,
callback
)
=>
{
};
return
{
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 物料总分类管理表格数据
suppliesList
:
[],
options
:
[],
// 初始化空数组
selectedOption
:
''
,
// 选中的选项
name
:
"
Supplies
"
,
components
:
{
},
data
()
{
let
checkId
=
(
rule
,
value
,
callback
)
=>
{
};
return
{
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 物料总分类管理表格数据
suppliesList
:
[],
options
:
[],
// 初始化空数组
selectedOption
:
''
,
// 选中的选项
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
opentwo
:
false
,
// 查询参数
queryParams
:
{
id
:
null
,
pageNum
:
1
,
pageSize
:
10
,
pid
:
null
,
fname
:
null
,
suppliesName
:
null
,
orderNum
:
null
,
status
:
0
,
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{
pid
:
[
{
required
:
true
,
message
:
"
关联id不能为空
"
,
trigger
:
"
change
"
},
],
suppliesName
:[
{
required
:
true
,
message
:
"
物料名称不能为空
"
,
trigger
:
"
blur
"
}
],
},
idRules
:[
{
pattern
:
/^
\d
+$/
,
message
:
'
ID只能输入数字
'
,
trigger
:
'
blur
'
}
]
};
},
created
()
{
this
.
getList
();
},
mounted
()
{
this
.
fetchOptions
();
},
methods
:
{
// 弹出层标题
title
:
""
,
/**显示序号*/
indexMethod
(
index
){
// const pageSize = this.queryParams.pageSize;
// const pageNumber = this.queryParams.pageNum || 1;
return
index
+
1
;
// 是否显示弹出层
open
:
false
,
opentwo
:
false
,
// 查询参数
queryParams
:
{
id
:
null
,
pageNum
:
1
,
pageSize
:
10
,
pid
:
null
,
fname
:
null
,
suppliesName
:
null
,
orderNum
:
null
,
status
:
0
,
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{
pid
:
[
{
required
:
true
,
message
:
"
关联id不能为空
"
,
trigger
:
"
change
"
},
],
suppliesName
:[
{
required
:
true
,
message
:
"
物料名称不能为空
"
,
trigger
:
"
blur
"
}
],
},
idRules
:[
{
pattern
:
/^
\d
+$/
,
message
:
'
ID只能输入数字
'
,
trigger
:
'
blur
'
}
]
};
},
/**启用 */
toggleEnable
(
actSupplies
){
console
.
log
(
'
你点击了【
'
+
actSupplies
.
suppliesName
+
'
】的开关控件,当前开关值:
'
+
actSupplies
.
status
);
let
enableText
=
[
'
启用
'
,
'
禁用
'
];
if
(
actSupplies
.
status
===
0
)
{
toggleEnable
(
actSupplies
.
id
).
then
((
response
)
=>
{
if
(
response
.
code
===
200
){
let
message
=
'
操作成功,已经将【
'
+
actSupplies
.
suppliesName
+
'
】的状态改为【
'
+
enableText
[
actSupplies
.
status
]
+
'
】 !
'
;
this
.
$message
({
message
:
message
,
type
:
'
success
'
});
}
else
{
this
.
$message
.
error
(
response
.
message
);
}
});
}
else
{
toggleDisable
(
actSupplies
.
id
).
then
((
response
)
=>
{
if
(
response
.
msg
===
"
200
"
){
let
message
=
'
操作成功,已经将【
'
+
actSupplies
.
suppliesName
+
'
】的状态改为【
'
+
enableText
[
actSupplies
.
status
]
+
'
】 !
'
;
this
.
$message
({
message
:
message
,
type
:
'
error
'
});
}
else
{
this
.
getList
();
this
.
$message
.
error
(
response
.
msg
);
}
});
}
created
()
{
this
.
getList
();
},
mounted
()
{
this
.
fetchOptions
();
},
methods
:
{
/**显示序号*/
indexMethod
(
index
){
// const pageSize = this.queryParams.pageSize;
// const pageNumber = this.queryParams.pageNum || 1;
return
index
+
1
;
},
/**启用 */
toggleEnable
(
actSupplies
){
console
.
log
(
'
你点击了【
'
+
actSupplies
.
suppliesName
+
'
】的开关控件,当前开关值:
'
+
actSupplies
.
status
);
let
enableText
=
[
'
启用
'
,
'
禁用
'
];
if
(
actSupplies
.
status
===
0
)
{
toggleEnable
(
actSupplies
.
id
).
then
((
response
)
=>
{
if
(
response
.
code
===
200
){
let
message
=
'
操作成功,已经将【
'
+
actSupplies
.
suppliesName
+
'
】的状态改为【
'
+
enableText
[
actSupplies
.
status
]
+
'
】 !
'
;
this
.
$message
({
message
:
message
,
type
:
'
success
'
});
}
else
{
this
.
$message
.
error
(
response
.
message
);
}
/** 查询上级关联关系*/
fetchOptions
()
{
getPid
().
then
(
response
=>
{
this
.
options
=
response
.
rows
;
});
},
});
}
else
{
toggleDisable
(
actSupplies
.
id
).
then
((
response
)
=>
{
if
(
response
.
msg
===
"
200
"
){
let
message
=
'
操作成功,已经将【
'
+
actSupplies
.
suppliesName
+
'
】的状态改为【
'
+
enableText
[
actSupplies
.
status
]
+
'
】 !
'
;
this
.
$message
({
message
:
message
,
type
:
'
error
'
});
}
else
{
this
.
getList
();
this
.
$message
.
error
(
response
.
msg
);
}
/** 查询物料总分类管理列表 */
getList
()
{
this
.
indexMethod
(
0
);
this
.
loading
=
true
;
listSupplies
(
this
.
queryParams
).
then
(
response
=>
{
this
.
suppliesList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
opentwo
=
false
;
this
.
reset
();
},
// 表单重置
reset
()
{
this
.
form
=
{
id
:
null
,
pid
:
null
,
fname
:
null
,
suppliesName
:
null
,
orderNum
:
null
,
status
:
0
,
createBy
:
null
,
createTime
:
null
,
updateBy
:
null
,
updateTime
:
null
};
this
.
resetForm
(
"
form
"
);
},
/** 搜索按钮操作 */
handleQuery
()
{
});
}
},
/** 查询上级关联关系*/
fetchOptions
()
{
getPid
().
then
(
response
=>
{
this
.
options
=
response
.
rows
;
});
},
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
/** 查询物料总分类管理列表 */
getList
()
{
this
.
indexMethod
(
0
);
this
.
loading
=
true
;
listSupplies
(
this
.
queryParams
).
then
(
response
=>
{
for
(
let
i
=
0
;
i
<
response
.
rows
.
length
;
i
++
)
{
response
.
rows
[
i
].
status
=
parseInt
(
response
.
rows
[
i
].
status
);
}
this
.
suppliesList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
opentwo
=
false
;
this
.
reset
();
},
// 表单重置
reset
()
{
this
.
form
=
{
id
:
null
,
pid
:
null
,
fname
:
null
,
suppliesName
:
null
,
orderNum
:
null
,
status
:
0
,
createBy
:
null
,
createTime
:
null
,
updateBy
:
null
,
updateTime
:
null
};
this
.
resetForm
(
"
form
"
);
},
/** 搜索按钮操作 */
handleQuery
()
{
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"
queryForm
"
);
this
.
handleQuery
();
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
id
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"
新增二级分类
"
;
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
getSupplies
(
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"
修改物料总分类管理
"
;
});
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"
form
"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
id
!=
null
)
{
updateSupplies
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
"
修改成功
"
);
this
.
open
=
false
;
this
.
opentwo
=
false
;
this
.
getList
();
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"
queryForm
"
);
this
.
handleQuery
();
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
id
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"
新增二级分类
"
;
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
getSupplies
(
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"
修改物料总分类管理
"
;
});
}
else
{
addSupplies
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
"
新增成功
"
);
this
.
open
=
false
;
this
.
opentwo
=
false
;
this
.
getList
();
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"
form
"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
id
!=
null
)
{
updateSupplies
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
"
修改成功
"
);
this
.
open
=
false
;
this
.
opentwo
=
false
;
this
.
getList
();
});
}
else
{
addSupplies
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
"
新增成功
"
);
this
.
open
=
false
;
this
.
opentwo
=
false
;
this
.
getList
();
});
}
}
});
}
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
ids
=
row
.
id
||
this
.
ids
;
this
.
$confirm
(
'
是否确认删除物料总分类管理编号为"
'
+
row
.
suppliesName
+
'
"的数据项?
'
,
"
警告
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
}).
then
(
function
()
{
return
delSupplies
(
ids
);
}).
then
((
result
)
=>
{
if
(
result
.
data
===
"
操作失败
"
){
this
.
getList
();
this
.
msgError
(
"
删除失败,存在关联关系
"
);
}
else
{
this
.
getList
();
this
.
msgSuccess
(
"
删除成功
"
);
}
}).
catch
(()
=>
{
})
},
/** 导出按钮操作 */
handleExport
()
{
const
queryParams
=
this
.
queryParams
;
this
.
$confirm
(
'
是否确认导出所有物料总分类管理数据项?
'
,
"
警告
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
}).
then
(
function
()
{
return
exportSupplies
(
queryParams
);
}).
then
(
response
=>
{
this
.
download
(
response
.
msg
);
})
}
});
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
ids
=
row
.
id
||
this
.
ids
;
this
.
$confirm
(
'
是否确认删除物料总分类管理编号为"
'
+
row
.
suppliesName
+
'
"的数据项?
'
,
"
警告
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
}).
then
(
function
()
{
return
delSupplies
(
ids
);
}).
then
((
result
)
=>
{
if
(
result
.
data
===
"
操作失败
"
){
this
.
getList
();
this
.
msgError
(
"
删除失败,存在关联关系
"
);
}
else
{
this
.
getList
();
this
.
msgSuccess
(
"
删除成功
"
);
}
}).
catch
(()
=>
{
})
},
/** 导出按钮操作 */
handleExport
()
{
const
queryParams
=
this
.
queryParams
;
this
.
$confirm
(
'
是否确认导出所有物料总分类管理数据项?
'
,
"
警告
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
}).
then
(
function
()
{
return
exportSupplies
(
queryParams
);
}).
then
(
response
=>
{
this
.
download
(
response
.
msg
);
})
}
}
};
</
script
>
ruoyi-ui/src/views/system/Actsupplies/Actsupplies/indexone.vue
View file @
71096709
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<!--
<el-form-item
label=
"一级分类名称"
prop=
"pid"
label-width=
"100px"
>
-->
<!--
<el-select
v-model=
"queryParams.pid"
filterable
clearable
placeholder=
"请输入一级分类分类名称"
>
-->
<!--
<el-option-->
<!-- v-for="option in options"-->
<!-- :key="option.suppliesName"-->
<!-- :label="option.suppliesName"-->
<!-- :value="option.id"-->
<!-- >
</el-option>
-->
<!--
<el-option
label=
"无"
value=
"0"
></el-option>
-->
<!--
</el-select>
-->
<!--
</el-form-item>
-->
<!--
<el-form-item
label=
"一级分类名称"
prop=
"pid"
label-width=
"100px"
>
-->
<!--
<el-select
v-model=
"queryParams.pid"
filterable
clearable
placeholder=
"请输入一级分类分类名称"
>
-->
<!--
<el-option-->
<!-- v-for="option in options"-->
<!-- :key="option.suppliesName"-->
<!-- :label="option.suppliesName"-->
<!-- :value="option.id"-->
<!-- >
</el-option>
-->
<!--
<el-option
label=
"无"
value=
"0"
></el-option>
-->
<!--
</el-select>
-->
<!--
</el-form-item>
-->
<el-form-item
label=
"一级分类名称"
prop=
"suppliesName"
label-width=
"100px"
>
<el-input
v-model=
"queryParams.suppliesName"
...
...
@@ -127,8 +127,8 @@
<!-- 添加或修改物料总分类管理对话框 -->
<el-dialog
:title=
"title"
:visible.sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"一级分类名称"
prop=
"suppliesName"
>
<el-input
v-model=
"form.suppliesName"
placeholder=
"请输入一级分类名称"
/>
<el-form-item
label=
"一级分类名称"
prop=
"suppliesName"
>
<el-input
v-model=
"form.suppliesName"
placeholder=
"请输入一级分类名称"
maxlength=
"15"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-select
v-model=
"form.status"
placeholder=
"请选择状态"
>
...
...
ruoyi-ui/src/views/system/supplies/index.vue
View file @
71096709
...
...
@@ -357,6 +357,7 @@ export default {
break
;
case
6
:
{
let
cost
=
[
'
安全费用
'
,
'
国债费用
'
,
'
办公费用
'
,
'
其它费用
'
,
'
原煤基本生产
'
,
'
洗煤费用
'
,
'
制造费用
'
,
'
其他业务成本
'
];
let
department
=
[
'
二掘区
'
,
'
后勤服务二科
'
,
'
后勤服务一科
'
,
'
机电科
'
,
'
井运区
'
,
'
救护队
'
,
'
开拓区
'
,
'
开运区
'
,
'
通风区
'
,
'
通讯管理科
'
,
'
物资管理科
'
,
'
巷修区
'
,
'
一掘区
'
,
'
准备区
'
,
'
综二区
'
,
'
综一区
'
,
'
钻探区
'
];
//加个费用循环
for
(
let
j
=
0
;
j
<
department
.
length
;
j
++
){
...
...
ruoyi-ui/src/views/system/supplies/index_template.vue
View file @
71096709
...
...
@@ -7,6 +7,7 @@
placeholder=
"请输入模板名称"
clearable
@
keyup.enter.native=
"handleQuery"
maxlength=
"15"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
...
...
ruoyi-ui/src/views/system/suppliesrole/index.vue
View file @
71096709
...
...
@@ -26,6 +26,7 @@
clearable
size=
"small"
@
keyup.enter.native=
"handleQuery"
maxlength=
"15"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
...
...
@@ -137,7 +138,7 @@
<el-dialog
:title=
"title"
:visible.sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"所属模板"
prop=
"tempId"
>
<el-select
v-model=
"form.tempId"
filterable
placeholder=
"请选择关联项"
>
<el-select
v-model=
"form.tempId"
filterable
placeholder=
"请选择关联项"
style=
"width:380px"
>
<el-option
v-for=
"option in options"
:key=
"option.templateName"
...
...
@@ -147,10 +148,10 @@
</el-select>
</el-form-item>
<el-form-item
label=
"规则名称"
prop=
"roleName"
>
<el-input
v-model=
"form.roleName"
placeholder=
"请输入规则名称"
/>
<el-input
v-model=
"form.roleName"
placeholder=
"请输入规则名称"
maxlength=
"15"
/>
</el-form-item>
<el-form-item
label=
"状态"
>
<el-select
v-model=
"form.status"
>
<el-select
v-model=
"form.status"
style=
"width:380px"
>
<el-option
label=
"启用"
:value=
"0"
></el-option>
<el-option
label=
"禁用"
:value=
"1"
></el-option>
</el-select>
...
...
ruoyi-ui/src/views/system/suppliesroledetail/index.vue
View file @
71096709
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"上级规则"
prop=
"roleId"
>
<el-select
v-model=
"queryParams.roleId"
filterable
clearable
placeholder=
"请选择关联项"
>
<el-option
v-for=
"option in options1"
:key=
"option.roleName"
:label=
"option.roleName"
:value=
"option.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"规则名称"
prop=
"detailName"
>
<el-input
v-model=
"queryParams.detailName"
placeholder=
"请输入规则名称"
clearable
size=
"small"
@
keyup.enter.native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-select
v-model=
"queryParams.status"
placeholder=
"请选择状态"
>
<el-option
label=
"启用"
:value=
"0"
></el-option>
<el-option
label=
"禁用"
:value=
"1"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"运算规则"
prop=
"convertStatus"
>
<el-select
v-model=
"queryParams.convertStatus"
clearable
filterable
placeholder=
"请运算规则"
>
<el-option
v-for=
"option in options2"
:key=
"option.operationName"
:label=
"option.operationName"
:value=
"option.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['system:suppliesroledetail:add']"
>
新增
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"single"
@
click=
"handleUpdate"
v-hasPermi=
"['system:suppliesroledetail:edit']"
>
修改
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['system:suppliesroledetail:remove']"
>
删除
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
v-hasPermi=
"['system:suppliesroledetail:export']"
>
导出
</el-button>
</el-col>
<right-toolbar
:showSearch.sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"suppliesroledetailList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
type=
"index"
width=
"80"
align=
"center"
label=
"序号"
:index=
"indexMethod"
/>
<el-table-column
label=
"上级规则"
align=
"center"
prop=
"roleName"
/>
<el-table-column
label=
"规则名称"
align=
"center"
prop=
"detailName"
/>
<el-table-column
label=
"规则内容"
align=
"center"
prop=
"detailContent"
/>
<el-table-column
label=
"运算规则"
align=
"center"
>
<template
slot-scope=
"scope"
>
<div>
<template
v-if=
"scope.row.convertStatus === 0"
>
无
</
template
>
<
template
v-else-if=
"scope.row.convertStatus === 1"
>
物料转换
</
template
>
<
template
v-else-if=
"scope.row.convertStatus === 2"
>
加法运算
</
template
>
<
template
v-else-if=
"scope.row.convertStatus === 3"
>
减法运算
</
template
>
<
template
v-else-if=
"scope.row.convertStatus === 4"
>
乘法运算
</
template
>
<
template
v-else-if=
"scope.row.convertStatus === 5"
>
除法运算
</
template
>
</div>
</template>
</el-table-column>
<el-table-column
label=
"状态"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div>
<el-switch
@
change=
"toggleEnable(scope.row)"
v-model=
"scope.row.status"
:active-value=
"0"
:inactive-value=
"1"
active-color=
"#13ce66"
inactive-color=
"#cccccc"
>
</el-switch>
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['system:suppliesroledetail:edit']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['system:suppliesroledetail:remove']"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total>0"
:total=
"total"
:page.sync=
"queryParams.pageNum"
:limit.sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 添加或修改规则详情对话框 -->
<el-dialog
:title=
"title"
:visible.sync=
"open"
width=
"1300px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"上级规则"
prop=
"roleId"
>
<el-select
v-model=
"form.roleId"
filterable
placeholder=
"请选择关联项"
>
<el-option
v-for=
"option in options1"
:key=
"option.roleName"
:label=
"option.roleName"
:value=
"option.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"规则名称"
prop=
"detailName"
>
<el-input
v-model=
"form.detailName"
placeholder=
"请输入规则名称"
maxlength=
"10"
show-word-limit
/>
</el-form-item>
<el-form-item
label=
"运算方法"
prop=
"convertStatus"
>
<el-select
v-model=
"form.convertStatus"
filterable
placeholder=
"请选择运算方法"
>
<el-option
v-for=
"option in options2"
:key=
"option.operationName"
:label=
"option.operationName"
:value=
"option.id"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="转换类型" prop="detailYS" v-if="form.convertStatus!==null">-->
<!-- <el-radio-group v-model="form.detailYS">-->
<!-- <el-radio :label="1" >单元格转换</el-radio>-->
<!-- <el-radio :label="2" >行转换</el-radio>-->
<!-- <el-radio :label="3" >列转换</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- <el-form-item v-if="form.detailYS!==null">-->
<!-- <el-button type="primary" @click="addInputs">添加规则</el-button>-->
<!-- </el-form-item>-->
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"转换类型"
prop=
"detailYS"
>
<el-radio-group
v-model=
"form.detailYS"
>
<el-radio
label=
"1"
>
单元格转换
</el-radio>
<el-radio
label=
"2"
>
行转换
</el-radio>
<el-radio
label=
"3"
>
列转换
</el-radio>
</el-radio-group>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"上级规则"
prop=
"roleId"
>
<el-select
v-model=
"queryParams.roleId"
filterable
clearable
placeholder=
"请选择关联项"
>
<el-option
v-for=
"option in options1"
:key=
"option.roleName"
:label=
"option.roleName"
:value=
"option.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"规则名称"
prop=
"detailName"
>
<el-input
v-model=
"queryParams.detailName"
placeholder=
"请输入规则名称"
clearable
size=
"small"
@
keyup.enter.native=
"handleQuery"
maxlength=
"15"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-select
v-model=
"queryParams.status"
placeholder=
"请选择状态"
>
<el-option
label=
"启用"
:value=
"0"
></el-option>
<el-option
label=
"禁用"
:value=
"1"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"运算规则"
prop=
"convertStatus"
>
<el-select
v-model=
"queryParams.convertStatus"
clearable
filterable
placeholder=
"请运算规则"
>
<el-option
v-for=
"option in options2"
:key=
"option.operationName"
:label=
"option.operationName"
:value=
"option.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"16"
>
<el-form-item
v-if=
"form.detailYS!==null"
>
<el-button
type=
"primary"
@
click=
"addInputs"
>
添加规则
</el-button>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-col>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['system:suppliesroledetail:add']"
>
新增
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"single"
@
click=
"handleUpdate"
v-hasPermi=
"['system:suppliesroledetail:edit']"
>
修改
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['system:suppliesroledetail:remove']"
>
删除
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
v-hasPermi=
"['system:suppliesroledetail:export']"
>
导出
</el-button>
</el-col>
<right-toolbar
:showSearch.sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<!-- 生成输入框 -->
<div
v-for=
"index in instea"
:key=
"index"
v-if=
""
>
<el-form-item
label=
"模板表行坐标"
prop=
"detailMH"
class=
"form-item-inline"
>
<el-input-number
size=
"medium"
v-model=
"detailMH[index-1]"
:min=
"1"
:step=
"1"
>
1
</el-input-number>
</el-form-item>
<el-form-item
label=
"模板表列坐标"
prop=
"detailML"
class=
"form-item-inline"
>
<el-input-number
size=
"medium"
v-model=
"detailML[index-1]"
:min=
"1"
:step=
"1"
>
1
</el-input-number>
</el-form-item>
<el-form-item
label=
"导入表行坐标"
prop=
"detailYH"
class=
"form-item-inline"
>
<el-input-number
size=
"medium"
v-model=
"detailYH[index-1]"
:min=
"1"
:step=
"1"
>
1
</el-input-number>
</el-form-item>
<el-form-item
label=
"导入表列坐标"
prop=
"detailYL"
class=
"form-item-inline"
>
<el-input-number
size=
"medium"
v-model=
"detailYL[index-1]"
:min=
"1"
:step=
"1"
>
1
</el-input-number>
</el-form-item>
<el-form-item
style=
"display: inline-block;"
>
<el-button
type=
"danger"
icon=
"el-icon-delete"
size=
"small"
@
click=
"removeInputs(index)"
>
删除
</el-button>
</el-form-item>
</div>
<!-- <el-form-item label="模板表行坐标" prop="detailMH" v-if="showTemplate" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailMH" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="模板表列坐标" prop="detailML" v-if="showTemplate" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailML" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="导入表行坐标" prop="detailYH" v-if="showTemplate" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailYH" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="导入表列坐标" prop="detailYL" v-if="showTemplate" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailYL" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="模板表行坐标" prop="detailMH" v-if="showImport" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailMH" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="模板表列坐标" prop="detailML" v-if="showImport" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailML" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="导入表行坐标" prop="detailYH" v-if="showImport" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailYH" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="导入表列坐标" prop="detailYL" v-if="showImport" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailYL" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item v-if="showLie" label="模板表行坐标" prop="detailMH" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailMH" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item v-if="showLie" label="模板表列坐标" prop="detailML" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailML" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item v-if="showLie" label="导入表行坐标" prop="detailYH" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailYH" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item v-if="showLie" label="导入表列坐标" prop="detailYL" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailYL" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<el-form-item
label=
"状态"
>
<el-select
v-model=
"form.status"
>
<el-option
label=
"启用"
:value=
"0"
></el-option>
<el-option
label=
"禁用"
:value=
"1"
></el-option>
</el-select>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
</div>
<el-table
v-loading=
"loading"
:data=
"suppliesroledetailList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
type=
"index"
width=
"80"
align=
"center"
label=
"序号"
:index=
"indexMethod"
/>
<el-table-column
label=
"上级规则"
align=
"center"
prop=
"roleName"
/>
<el-table-column
label=
"规则名称"
align=
"center"
prop=
"detailName"
/>
<el-table-column
label=
"规则内容"
align=
"center"
prop=
"detailContent"
/>
<el-table-column
label=
"运算规则"
align=
"center"
>
<template
slot-scope=
"scope"
>
<div>
<template
v-if=
"scope.row.convertStatus === 0"
>
无
</
template
>
<
template
v-else-if=
"scope.row.convertStatus === 1"
>
物料转换
</
template
>
<
template
v-else-if=
"scope.row.convertStatus === 2"
>
加法运算
</
template
>
<
template
v-else-if=
"scope.row.convertStatus === 3"
>
减法运算
</
template
>
<
template
v-else-if=
"scope.row.convertStatus === 4"
>
乘法运算
</
template
>
<
template
v-else-if=
"scope.row.convertStatus === 5"
>
除法运算
</
template
>
</div>
</template>
</el-table-column>
<el-table-column
label=
"状态"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div>
<el-switch
@
change=
"toggleEnable(scope.row)"
v-model=
"scope.row.status"
:active-value=
"0"
:inactive-value=
"1"
active-color=
"#13ce66"
inactive-color=
"#cccccc"
>
</el-switch>
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['system:suppliesroledetail:edit']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['system:suppliesroledetail:remove']"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total>0"
:total=
"total"
:page.sync=
"queryParams.pageNum"
:limit.sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 添加或修改规则详情对话框 -->
<el-dialog
:title=
"title"
:visible.sync=
"open"
width=
"1300px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"上级规则"
prop=
"roleId"
>
<el-select
v-model=
"form.roleId"
filterable
placeholder=
"请选择关联项"
>
<el-option
v-for=
"option in options1"
:key=
"option.roleName"
:label=
"option.roleName"
:value=
"option.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"规则名称"
prop=
"detailName"
>
<el-input
v-model=
"form.detailName"
placeholder=
"请输入规则名称"
maxlength=
"15"
show-word-limit
/>
</el-form-item>
<el-form-item
label=
"运算方法"
prop=
"convertStatus"
>
<el-select
v-model=
"form.convertStatus"
filterable
placeholder=
"请选择运算方法"
>
<el-option
v-for=
"option in options2"
:key=
"option.operationName"
:label=
"option.operationName"
:value=
"option.id"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="转换类型" prop="detailYS" v-if="form.convertStatus!==null">-->
<!-- <el-radio-group v-model="form.detailYS">-->
<!-- <el-radio :label="1" >单元格转换</el-radio>-->
<!-- <el-radio :label="2" >行转换</el-radio>-->
<!-- <el-radio :label="3" >列转换</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- <el-form-item v-if="form.detailYS!==null">-->
<!-- <el-button type="primary" @click="addInputs">添加规则</el-button>-->
<!-- </el-form-item>-->
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"转换类型"
prop=
"detailYS"
>
<el-radio-group
v-model=
"form.detailYS"
>
<el-radio
label=
"1"
>
单元格转换
</el-radio>
<el-radio
label=
"2"
>
行转换
</el-radio>
<el-radio
label=
"3"
>
列转换
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col
:span=
"16"
>
<el-form-item
v-if=
"form.detailYS!==null"
>
<el-button
type=
"primary"
@
click=
"addInputs"
>
添加规则
</el-button>
</el-form-item>
</el-col>
</el-row>
<!-- 生成输入框 -->
<div
v-for=
"index in instea"
:key=
"index"
v-if=
""
>
<el-form-item
label=
"模板表行坐标"
prop=
"detailMH"
class=
"form-item-inline"
>
<el-input-number
size=
"medium"
v-model=
"detailMH[index-1]"
:min=
"1"
:step=
"1"
>
1
</el-input-number>
</el-form-item>
<el-form-item
label=
"模板表列坐标"
prop=
"detailML"
class=
"form-item-inline"
>
<el-input-number
size=
"medium"
v-model=
"detailML[index-1]"
:min=
"1"
:step=
"1"
>
1
</el-input-number>
</el-form-item>
<el-form-item
label=
"导入表行坐标"
prop=
"detailYH"
class=
"form-item-inline"
>
<el-input-number
size=
"medium"
v-model=
"detailYH[index-1]"
:min=
"1"
:step=
"1"
>
1
</el-input-number>
</el-form-item>
<el-form-item
label=
"导入表列坐标"
prop=
"detailYL"
class=
"form-item-inline"
>
<el-input-number
size=
"medium"
v-model=
"detailYL[index-1]"
:min=
"1"
:step=
"1"
>
1
</el-input-number>
</el-form-item>
<el-form-item
style=
"display: inline-block;"
>
<el-button
type=
"danger"
icon=
"el-icon-delete"
size=
"small"
@
click=
"removeInputs(index)"
>
删除
</el-button>
</el-form-item>
</div>
<!-- <el-form-item label="模板表行坐标" prop="detailMH" v-if="showTemplate" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailMH" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="模板表列坐标" prop="detailML" v-if="showTemplate" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailML" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="导入表行坐标" prop="detailYH" v-if="showTemplate" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailYH" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="导入表列坐标" prop="detailYL" v-if="showTemplate" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailYL" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="模板表行坐标" prop="detailMH" v-if="showImport" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailMH" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="模板表列坐标" prop="detailML" v-if="showImport" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailML" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="导入表行坐标" prop="detailYH" v-if="showImport" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailYH" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="导入表列坐标" prop="detailYL" v-if="showImport" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailYL" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item v-if="showLie" label="模板表行坐标" prop="detailMH" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailMH" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item v-if="showLie" label="模板表列坐标" prop="detailML" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailML" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item v-if="showLie" label="导入表行坐标" prop="detailYH" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailYH" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item v-if="showLie" label="导入表列坐标" prop="detailYL" class="form-item-inline">-->
<!-- <el-input-number size="medium" v-model="form.detailYL" :min="1" :step="1">1</el-input-number>-->
<!-- </el-form-item>-->
<el-form-item
label=
"状态"
>
<el-select
v-model=
"form.status"
>
<el-option
label=
"启用"
:value=
"0"
></el-option>
<el-option
label=
"禁用"
:value=
"1"
></el-option>
</el-select>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
</div>
</template>
<
style
>
.form-item-inline
{
display
:
inline-block
;
margin-right
:
20px
;
display
:
inline-block
;
margin-right
:
20px
;
}
</
style
>
<
script
>
import
{
listSuppliesroledetail
,
getSuppliesroledetail
,
delSuppliesroledetail
,
addSuppliesroledetail
,
updateSuppliesroledetail
,
exportSuppliesroledetail
,
saveSid
,
toggleEnable
,
toggleDisable
,
saveOperation
,
listSuppliesroledetail
,
getSuppliesroledetail
,
delSuppliesroledetail
,
addSuppliesroledetail
,
updateSuppliesroledetail
,
exportSuppliesroledetail
,
saveSid
,
toggleEnable
,
toggleDisable
,
saveOperation
,
}
from
"
@/api/system/suppliesroledetail
"
;
import
Editor
from
'
@/components/Editor
'
;
export
default
{
name
:
"
Suppliesroledetail
"
,
components
:
{
Editor
,
},
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 规则详情表格数据
suppliesroledetailList
:
[],
options1
:[],
//上级ID
options2
:[{
id
:
0
,
operationName
:
"
无
"
},{
id
:
1
,
operationName
:
"
物料转换
"
},{
id
:
2
,
operationName
:
"
加法运算
"
},{
id
:
3
,
operationName
:
"
减法运算
"
},{
id
:
4
,
operationName
:
"
乘法运算
"
},{
id
:
5
,
operationName
:
"
除法运算
"
}],
//上级ID
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
inputCount
:
0
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
roleId
:
null
,
detailName
:
null
,
detailContent
:
null
,
status
:
0
,
converStatus
:
null
,
},
// 表单参数
form
:
{
},
detailMH
:
[],
detailML
:
[],
detailYH
:
[],
detailYL
:
[],
instea
:
0
,
showTemplate
:
false
,
// 控制单元格的显示与隐藏
showImport
:
false
,
// 控制行转换的显示与隐藏
showLie
:
false
,
// 控制列转换的显示与隐藏
// 表单校验
rules
:
{
roleId
:[
{
required
:
true
,
message
:
'
关联id不能为空
'
,
trigger
:
'
change
'
},
],
// detailMH:[
// {required: true, message: '模板表行坐标不能为空', trigger: 'change'},
// ],
// detailML:[
// {required: true, message: '模板表列坐标不能为空', trigger: 'change'},
// ],
// detailYH:[
// {required: true, message: '导入表行坐标不能为空', trigger: 'change'},
// ],
// detailYL:[
// {required: true, message: '导入表列坐标不能为空', trigger: 'change'},
// ],
convertStatus
:[
{
required
:
true
,
message
:
'
运算规则不能为空
'
,
trigger
:
'
change
'
},
],
detailName
:[
{
required
:
true
,
message
:
'
规则名称不能为空
'
,
trigger
:
'
change
'
},
]
}
};
},
created
()
{
this
.
getList
();
this
.
getnameid
();
},
methods
:
{
removeInputs
(
index
){
this
.
detailMH
.
splice
(
index
-
1
,
1
);
this
.
detailML
.
splice
(
index
-
1
,
1
);
this
.
detailYH
.
splice
(
index
-
1
,
1
);
this
.
detailYL
.
splice
(
index
-
1
,
1
);
this
.
instea
=
this
.
instea
-
1
;
},
addInputs
()
{
this
.
instea
+=
1
;
this
.
detailMH
[
this
.
instea
-
1
]
=
1
;
this
.
detailML
[
this
.
instea
-
1
]
=
1
;
this
.
detailYH
[
this
.
instea
-
1
]
=
1
;
this
.
detailYL
[
this
.
instea
-
1
]
=
1
;
},
toggleEnable
(
suppliesRoleDetail
){
console
.
log
(
'
你点击了【
'
+
suppliesRoleDetail
.
s
+
'
】的开关控件,当前开关值:
'
+
suppliesRoleDetail
.
status
);
let
enableText
=
[
'
启用
'
,
'
禁用
'
];
if
(
suppliesRoleDetail
.
status
===
0
)
{
toggleEnable
(
suppliesRoleDetail
.
id
).
then
((
response
)
=>
{
if
(
response
.
code
===
200
){
let
message
=
'
操作成功,已经将【
'
+
suppliesRoleDetail
.
roleName
+
'
】的状态改为【
'
+
enableText
[
suppliesRoleDetail
.
status
]
+
'
】 !
'
;
this
.
$message
({
message
:
message
,
type
:
'
success
'
});
}
else
{
this
.
$message
.
error
(
response
.
message
);
}
});
}
else
{
toggleDisable
(
suppliesRoleDetail
.
id
).
then
((
response
)
=>
{
if
(
response
.
code
===
200
){
let
message
=
'
操作成功,已经将【
'
+
suppliesRoleDetail
.
roleName
+
'
】的状态改为【
'
+
enableText
[
suppliesRoleDetail
.
status
]
+
'
】 !
'
;
this
.
$message
({
message
:
message
,
type
:
'
success
'
});
}
else
{
this
.
$message
.
error
(
response
.
message
);
}
});
}
name
:
"
Suppliesroledetail
"
,
components
:
{
Editor
,
},
/**显示序号*/
indexMethod
(
index
){
return
index
+
1
;
},
/**获取关联表内容*/
getnameid
(){
//上级规则
saveSid
().
then
(
response
=>
{
this
.
options1
=
response
.
rows
;
})
// //运算规则
// saveOperation().then(response =>{
// this.options2 = response.rows;
// console.log(this.options2)
// })
},
/** 查询规则详情列表 */
getList
()
{
this
.
indexMethod
(
0
);
this
.
loading
=
true
;
listSuppliesroledetail
(
this
.
queryParams
).
then
(
response
=>
{
this
.
suppliesroledetailList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
},
// 表单重置
reset
()
{
this
.
form
=
{
id
:
null
,
roleId
:
null
,
detailName
:
null
,
detailYS
:
null
,
detailContent
:
null
,
status
:
0
,
convertStatus
:
null
,
createBy
:
null
,
createTime
:
null
,
updateBy
:
null
,
updateTime
:
null
};
this
.
resetForm
(
"
form
"
);
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 规则详情表格数据
suppliesroledetailList
:
[],
options1
:[],
//上级ID
options2
:[{
id
:
0
,
operationName
:
"
无
"
},{
id
:
1
,
operationName
:
"
物料转换
"
},{
id
:
2
,
operationName
:
"
加法运算
"
},{
id
:
3
,
operationName
:
"
减法运算
"
},{
id
:
4
,
operationName
:
"
乘法运算
"
},{
id
:
5
,
operationName
:
"
除法运算
"
}],
//上级ID
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
inputCount
:
0
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
roleId
:
null
,
detailName
:
null
,
detailContent
:
null
,
status
:
0
,
converStatus
:
null
,
},
// 表单参数
form
:
{
},
detailMH
:
[],
detailML
:
[],
detailYH
:
[],
detailYL
:
[],
instea
:
0
,
showTemplate
:
false
,
// 控制单元格的显示与隐藏
showImport
:
false
,
// 控制行转换的显示与隐藏
showLie
:
false
,
// 控制列转换的显示与隐藏
// 表单校验
rules
:
{
roleId
:[
{
required
:
true
,
message
:
'
关联id不能为空
'
,
trigger
:
'
change
'
},
],
// detailMH:[
// {required: true, message: '模板表行坐标不能为空', trigger: 'change'},
// ],
// detailML:[
// {required: true, message: '模板表列坐标不能为空', trigger: 'change'},
// ],
// detailYH:[
// {required: true, message: '导入表行坐标不能为空', trigger: 'change'},
// ],
// detailYL:[
// {required: true, message: '导入表列坐标不能为空', trigger: 'change'},
// ],
convertStatus
:[
{
required
:
true
,
message
:
'
运算规则不能为空
'
,
trigger
:
'
change
'
},
],
detailName
:[
{
required
:
true
,
message
:
'
规则名称不能为空
'
,
trigger
:
'
change
'
},
]
}
};
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
created
()
{
this
.
getList
();
this
.
getnameid
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"
queryForm
"
);
this
.
handleQuery
();
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
id
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
instea
=
0
;
this
.
getnameid
();
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"
添加规则详情
"
;
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
getSuppliesroledetail
(
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
const
detailContent
=
response
.
data
.
detailContent
;
const
parse
=
JSON
.
parse
(
detailContent
);
this
.
detailMH
=
parse
.
map
(
obj
=>
parseInt
(
obj
.
rt
)
+
1
);
this
.
detailML
=
parse
.
map
(
obj
=>
parseInt
(
obj
.
ct
)
+
1
);
this
.
detailYH
=
parse
.
map
(
obj
=>
parseInt
(
obj
.
re
)
+
1
);
this
.
detailYL
=
parse
.
map
(
obj
=>
parseInt
(
obj
.
ce
)
+
1
);
this
.
instea
=
this
.
detailMH
.
length
;
this
.
open
=
true
;
this
.
title
=
"
修改规则详情
"
;
});
},
/** 提交按钮 */
submitForm
()
{
this
.
form
.
detailMH
=
this
.
detailMH
;
this
.
form
.
detailML
=
this
.
detailML
;
this
.
form
.
detailYH
=
this
.
detailYH
;
this
.
form
.
detailYL
=
this
.
detailYL
;
this
.
$refs
[
"
form
"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
id
!=
null
)
{
updateSuppliesroledetail
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
"
修改成功
"
);
this
.
open
=
false
;
this
.
getList
();
methods
:
{
removeInputs
(
index
){
this
.
detailMH
.
splice
(
index
-
1
,
1
);
this
.
detailML
.
splice
(
index
-
1
,
1
);
this
.
detailYH
.
splice
(
index
-
1
,
1
);
this
.
detailYL
.
splice
(
index
-
1
,
1
);
this
.
instea
=
this
.
instea
-
1
;
},
addInputs
()
{
this
.
instea
+=
1
;
this
.
detailMH
[
this
.
instea
-
1
]
=
1
;
this
.
detailML
[
this
.
instea
-
1
]
=
1
;
this
.
detailYH
[
this
.
instea
-
1
]
=
1
;
this
.
detailYL
[
this
.
instea
-
1
]
=
1
;
},
toggleEnable
(
suppliesRoleDetail
){
console
.
log
(
'
你点击了【
'
+
suppliesRoleDetail
.
s
+
'
】的开关控件,当前开关值:
'
+
suppliesRoleDetail
.
status
);
let
enableText
=
[
'
启用
'
,
'
禁用
'
];
if
(
suppliesRoleDetail
.
status
===
0
)
{
toggleEnable
(
suppliesRoleDetail
.
id
).
then
((
response
)
=>
{
if
(
response
.
code
===
200
){
let
message
=
'
操作成功,已经将【
'
+
suppliesRoleDetail
.
roleName
+
'
】的状态改为【
'
+
enableText
[
suppliesRoleDetail
.
status
]
+
'
】 !
'
;
this
.
$message
({
message
:
message
,
type
:
'
success
'
});
}
else
{
this
.
$message
.
error
(
response
.
message
);
}
});
}
else
{
toggleDisable
(
suppliesRoleDetail
.
id
).
then
((
response
)
=>
{
if
(
response
.
code
===
200
){
let
message
=
'
操作成功,已经将【
'
+
suppliesRoleDetail
.
roleName
+
'
】的状态改为【
'
+
enableText
[
suppliesRoleDetail
.
status
]
+
'
】 !
'
;
this
.
$message
({
message
:
message
,
type
:
'
success
'
});
}
else
{
this
.
$message
.
error
(
response
.
message
);
}
});
}
},
/**显示序号*/
indexMethod
(
index
){
return
index
+
1
;
},
/**获取关联表内容*/
getnameid
(){
//上级规则
saveSid
().
then
(
response
=>
{
this
.
options1
=
response
.
rows
;
})
// //运算规则
// saveOperation().then(response =>{
// this.options2 = response.rows;
// console.log(this.options2)
// })
},
/** 查询规则详情列表 */
getList
()
{
this
.
indexMethod
(
0
);
this
.
loading
=
true
;
listSuppliesroledetail
(
this
.
queryParams
).
then
(
response
=>
{
this
.
suppliesroledetailList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
}
else
{
addSuppliesroledetail
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
"
新增成功
"
);
this
.
open
=
false
;
this
.
getList
();
},
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
},
// 表单重置
reset
()
{
this
.
form
=
{
id
:
null
,
roleId
:
null
,
detailName
:
null
,
detailYS
:
null
,
detailContent
:
null
,
status
:
0
,
convertStatus
:
null
,
createBy
:
null
,
createTime
:
null
,
updateBy
:
null
,
updateTime
:
null
};
this
.
resetForm
(
"
form
"
);
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"
queryForm
"
);
this
.
handleQuery
();
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
id
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
instea
=
0
;
this
.
getnameid
();
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"
添加规则详情
"
;
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
getSuppliesroledetail
(
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
const
detailContent
=
response
.
data
.
detailContent
;
const
parse
=
JSON
.
parse
(
detailContent
);
this
.
detailMH
=
parse
.
map
(
obj
=>
parseInt
(
obj
.
rt
)
+
1
);
this
.
detailML
=
parse
.
map
(
obj
=>
parseInt
(
obj
.
ct
)
+
1
);
this
.
detailYH
=
parse
.
map
(
obj
=>
parseInt
(
obj
.
re
)
+
1
);
this
.
detailYL
=
parse
.
map
(
obj
=>
parseInt
(
obj
.
ce
)
+
1
);
this
.
instea
=
this
.
detailMH
.
length
;
this
.
open
=
true
;
this
.
title
=
"
修改规则详情
"
;
});
}
},
/** 提交按钮 */
submitForm
()
{
this
.
form
.
detailMH
=
this
.
detailMH
;
this
.
form
.
detailML
=
this
.
detailML
;
this
.
form
.
detailYH
=
this
.
detailYH
;
this
.
form
.
detailYL
=
this
.
detailYL
;
this
.
$refs
[
"
form
"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
id
!=
null
)
{
updateSuppliesroledetail
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
"
修改成功
"
);
this
.
open
=
false
;
this
.
getList
();
});
}
else
{
addSuppliesroledetail
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
"
新增成功
"
);
this
.
open
=
false
;
this
.
getList
();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
ids
=
row
.
id
||
this
.
ids
;
this
.
$confirm
(
'
是否确认删除规则详情编号为"
'
+
row
.
detailName
+
'
"的数据项?
'
,
"
警告
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
}).
then
(
function
()
{
return
delSuppliesroledetail
(
ids
);
}).
then
(()
=>
{
this
.
getList
();
this
.
msgSuccess
(
"
删除成功
"
);
})
},
/** 导出按钮操作 */
handleExport
()
{
const
queryParams
=
this
.
queryParams
;
this
.
$confirm
(
'
是否确认导出所有规则详情数据项?
'
,
"
警告
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
}).
then
(
function
()
{
return
exportSuppliesroledetail
(
queryParams
);
}).
then
(
response
=>
{
this
.
download
(
response
.
msg
);
})
}
});
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
ids
=
row
.
id
||
this
.
ids
;
this
.
$confirm
(
'
是否确认删除规则详情编号为"
'
+
row
.
detailName
+
'
"的数据项?
'
,
"
警告
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
}).
then
(
function
()
{
return
delSuppliesroledetail
(
ids
);
}).
then
(()
=>
{
this
.
getList
();
this
.
msgSuccess
(
"
删除成功
"
);
})
},
/** 导出按钮操作 */
handleExport
()
{
const
queryParams
=
this
.
queryParams
;
this
.
$confirm
(
'
是否确认导出所有规则详情数据项?
'
,
"
警告
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
}).
then
(
function
()
{
return
exportSuppliesroledetail
(
queryParams
);
}).
then
(
response
=>
{
this
.
download
(
response
.
msg
);
})
}
}
};
</
script
>
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