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
852b30d4
Commit
852b30d4
authored
1 year ago
by
lenovo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物资模板模块添加发布功能添加导入时的加载遮罩层,规则模块发布功能,历史数据模块后端保存接口,
parent
d9814bae
Changes
25
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
784 additions
and
257 deletions
+784
-257
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesConvertController.java
...ruoyi/system/controller/ActSuppliesConvertController.java
+7
-1
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesHistorydataController.java
...i/system/controller/ActSuppliesHistorydataController.java
+19
-1
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesRoleController.java
...om/ruoyi/system/controller/ActSuppliesRoleController.java
+34
-5
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesTemplateController.java
...uoyi/system/controller/ActSuppliesTemplateController.java
+5
-4
ruoyi-supplies/src/main/java/com/ruoyi/system/domain/ActSuppliesHTRImport.java
...in/java/com/ruoyi/system/domain/ActSuppliesHTRImport.java
+15
-0
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesHistorydataMapper.java
...com/ruoyi/system/mapper/ActSuppliesHistorydataMapper.java
+9
-0
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesRoleDetailMapper.java
.../com/ruoyi/system/mapper/ActSuppliesRoleDetailMapper.java
+2
-0
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesRoleMapper.java
...n/java/com/ruoyi/system/mapper/ActSuppliesRoleMapper.java
+12
-1
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesTemplateMapper.java
...va/com/ruoyi/system/mapper/ActSuppliesTemplateMapper.java
+5
-1
ruoyi-supplies/src/main/java/com/ruoyi/system/service/ActSuppliesTemplateService.java
.../com/ruoyi/system/service/ActSuppliesTemplateService.java
+1
-3
ruoyi-supplies/src/main/java/com/ruoyi/system/service/IActSuppliesHistorydataService.java
.../ruoyi/system/service/IActSuppliesHistorydataService.java
+3
-1
ruoyi-supplies/src/main/java/com/ruoyi/system/service/IActSuppliesRoleService.java
...ava/com/ruoyi/system/service/IActSuppliesRoleService.java
+4
-1
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesHistorydataServiceImpl.java
...ystem/service/impl/ActSuppliesHistorydataServiceImpl.java
+55
-4
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesRoleServiceImpl.java
...ruoyi/system/service/impl/ActSuppliesRoleServiceImpl.java
+145
-2
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesTemplateServiceImpl.java
...i/system/service/impl/ActSuppliesTemplateServiceImpl.java
+29
-22
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesHistorydataMapper.xml
.../resources/mapper/system/ActSuppliesHistorydataMapper.xml
+27
-1
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesRoleDetailMapper.xml
...n/resources/mapper/system/ActSuppliesRoleDetailMapper.xml
+12
-24
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesRoleMapper.xml
...rc/main/resources/mapper/system/ActSuppliesRoleMapper.xml
+26
-0
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesTemplateMapper.xml
...ain/resources/mapper/system/ActSuppliesTemplateMapper.xml
+12
-5
ruoyi-ui/public/exportExcel.js
ruoyi-ui/public/exportExcel.js
+7
-5
ruoyi-ui/src/api/system/historydata.js
ruoyi-ui/src/api/system/historydata.js
+10
-1
ruoyi-ui/src/api/system/suppliesrole.js
ruoyi-ui/src/api/system/suppliesrole.js
+17
-0
ruoyi-ui/src/views/system/supplies/index_template.vue
ruoyi-ui/src/views/system/supplies/index_template.vue
+103
-41
ruoyi-ui/src/views/system/suppliesrole/index.vue
ruoyi-ui/src/views/system/suppliesrole/index.vue
+148
-36
ruoyi-ui/src/views/system/suppliesroledetail/index.vue
ruoyi-ui/src/views/system/suppliesroledetail/index.vue
+77
-98
No files found.
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesConvertController.java
View file @
852b30d4
...
...
@@ -86,7 +86,9 @@ public class ActSuppliesConvertController extends BaseController{
}
/**
* 物料转换
* */
@PreAuthorize
(
"@ss.hasPermi('ActSuppliesConvert:ActSuppliesConvert:converSupplies')"
)
@PostMapping
(
"/converSupplies"
)
public
TableDataInfo
convertSupplies
(
@RequestBody
String
[]
names
){
...
...
@@ -112,5 +114,9 @@ public class ActSuppliesConvertController extends BaseController{
}
/**
*
* */
}
This diff is collapsed.
Click to expand it.
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesHistorydataController.java
View file @
852b30d4
package
com.ruoyi.system.controller
;
import
java.util.List
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -74,7 +75,7 @@ public class ActSuppliesHistorydataController extends BaseController
@PreAuthorize
(
"@ss.hasPermi('system:historydata:add')"
)
@Log
(
title
=
" 历史数据"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
ActSuppliesHistorydata
actSuppliesHistorydata
)
public
AjaxResult
add
(
@RequestBody
List
<
ActSuppliesHistorydata
>
actSuppliesHistorydata
)
{
return
toAjax
(
actSuppliesHistorydataService
.
insertActSuppliesHistorydata
(
actSuppliesHistorydata
));
}
...
...
@@ -100,4 +101,21 @@ public class ActSuppliesHistorydataController extends BaseController
{
return
toAjax
(
actSuppliesHistorydataService
.
deleteActSuppliesHistorydataByIds
(
ids
));
}
/**
* 添加 历史数据
*/
@PreAuthorize
(
"@ss.hasPermi('system:historydata:addInsert')"
)
@Log
(
title
=
" 历史数据"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
(
"/addInsert"
)
public
AjaxResult
addInsert
(
@RequestBody
List
<
ActSuppliesHistorydata
>
actSuppliesHistorydata
)
{
actSuppliesHistorydataService
.
addInsertActSuppliesHistorydata
(
actSuppliesHistorydata
);
return
toAjax
(
1
);
}
}
This diff is collapsed.
Click to expand it.
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesRoleController.java
View file @
852b30d4
package
com.ruoyi.system.controller
;
import
java.lang.reflect.Array
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
...
...
@@ -162,13 +163,12 @@ public class ActSuppliesRoleController extends BaseController
@PreAuthorize
(
"@ss.hasPermi('system:suppliesrole:remove')"
)
@Log
(
title
=
"导入规则"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{ids}"
)
public
AjaxResult
remove
(
@PathVariable
Integer
[]
ids
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
ids
)
{
if
(
actSuppliesRoleService
.
findall
(
ids
).
size
()>
0
){
return
AjaxResult
.
error
(
"该规则下存在关联规则,请先删除关联规则!!!"
,
"操作失败"
);
}
// if (actSuppliesRoleService.findall(ids).size()>0){
// return AjaxResult.error("该规则下存在关联规则,请先删除关联规则!!!","操作失败");
// }
return
toAjax
(
actSuppliesRoleService
.
deleteActSuppliesRoleByIds
(
ids
));
}
...
...
@@ -201,4 +201,33 @@ public class ActSuppliesRoleController extends BaseController
return
AjaxResult
.
success
(
"200"
,
"修改成功"
);
}
/**
* 发布Excel模板
*/
@PreAuthorize
(
"@ss.hasPermi('system:suppliesrole:releaseRS')"
)
@Log
(
title
=
"Excel模板"
,
businessType
=
BusinessType
.
UPDATE
)
@GetMapping
(
"/releaseRS/{ids}/{tempids}"
)
public
AjaxResult
releaseRS
(
@PathVariable
(
"ids"
)
Long
[]
ids
,
@PathVariable
(
"tempids"
)
Long
[]
tempids
)
{
List
<
String
>
longs
=
actSuppliesRoleService
.
releaseRS
(
ids
,
tempids
);
String
s
=
longs
.
toString
();
if
(
longs
.
size
()>
0
){
return
AjaxResult
.
success
(
"312"
,
s
);
}
else
{
return
AjaxResult
.
success
(
200
);
}
}
/**
* 下架Excel模板
*/
@PreAuthorize
(
"@ss.hasPermi('system:suppliesrole:offShelfRS')"
)
@Log
(
title
=
"Excel模板"
,
businessType
=
BusinessType
.
UPDATE
)
@GetMapping
(
"/offShelfRS/{ids}"
)
public
AjaxResult
offShelfRS
(
@PathVariable
(
"ids"
)
Long
[]
ids
)
{
return
toAjax
(
actSuppliesRoleService
.
offShelfRS
(
ids
));
}
}
This diff is collapsed.
Click to expand it.
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesTemplateController.java
View file @
852b30d4
...
...
@@ -136,13 +136,14 @@ public class ActSuppliesTemplateController extends BaseController {
@DeleteMapping
(
"/{ids}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
ids
)
{
List
<
String
>
list
=
actSuppliesTemplateService
.
deleteSuppliesTemplateByIds
(
ids
);
if
(
list
.
size
()>
0
){
return
AjaxResult
.
success
(
"312"
,
list
.
toArray
());
}
// if (actSuppliesTemplateService.findall(ids).size()>0){
// return AjaxResult.error("该模板下存在关联规则,请先删除关联规则!!!","操作失败");
// }
return
toAjax
(
1
);
return
toAjax
(
actSuppliesTemplateService
.
deleteSuppliesTemplateByIds
(
ids
));
}
/**
...
...
This diff is collapsed.
Click to expand it.
ruoyi-supplies/src/main/java/com/ruoyi/system/domain/ActSuppliesHTRImport.java
0 → 100644
View file @
852b30d4
package
com.ruoyi.system.domain
;
public
class
ActSuppliesHTRImport
{
private
Long
uuid
;
private
Long
roleId
;
private
Long
tempId
;
private
String
HistoryContentImport
;
private
Long
identCode
;
}
This diff is collapsed.
Click to expand it.
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesHistorydataMapper.java
View file @
852b30d4
...
...
@@ -58,4 +58,13 @@ public interface ActSuppliesHistorydataMapper
* @return 结果
*/
public
int
deleteActSuppliesHistorydataByIds
(
Long
[]
ids
);
Long
[]
selectActSuppliesRole
(
Long
templateId
);
Long
selectActSuppliesHistorydatauuid
(
String
exportUuid
);
void
insertActSuppliesHistorydatas
(
ActSuppliesHistorydata
actSuppliesHistorydata1
);
void
updateActSuppliesHistorydatas
(
ActSuppliesHistorydata
actSuppliesHistorydata
);
}
This diff is collapsed.
Click to expand it.
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesRoleDetailMapper.java
View file @
852b30d4
...
...
@@ -66,5 +66,7 @@ public interface ActSuppliesRoleDetailMapper
List
<
ActSuppliesRole
>
saveSid
();
void
updateRoleDetailStatus
(
ActSuppliesRoleDetail
actSuppliesRoleDetail
);
// List<ActOperation> saveOperation();
}
This diff is collapsed.
Click to expand it.
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesRoleMapper.java
View file @
852b30d4
...
...
@@ -81,7 +81,7 @@ public interface ActSuppliesRoleMapper
* @param ids 需要删除的数据ID
* @return 结果
*/
public
int
deleteActSuppliesRoleByIds
(
Integer
[]
ids
);
public
int
deleteActSuppliesRoleByIds
(
Long
[]
ids
);
List
<
ActSuppliesTemplate
>
saveSid
();
...
...
@@ -91,6 +91,17 @@ public interface ActSuppliesRoleMapper
public
int
countByRoleName
(
ActSuppliesRole
actSuppliesRole
);
Integer
saveTemp
(
Long
tempids
);
void
updateRelease
(
ActSuppliesRole
actSuppliesRole
);
String
saveRoleName
(
Long
id
);
int
saveHistory
(
Long
id
);
void
updateReleaseoff
(
Long
id
);
void
updateReleaseoffone
(
Long
id
);
void
saveStatus
(
Integer
[]
ids
);
}
This diff is collapsed.
Click to expand it.
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesTemplateMapper.java
View file @
852b30d4
...
...
@@ -27,13 +27,15 @@ public interface ActSuppliesTemplateMapper
int
updateSuppliesTemplate
(
ActSuppliesTemplate
sysSupplies
);
int
deleteSuppliesTemplateById
(
Long
ids
);
int
deleteSuppliesTemplateByIds
(
Long
[]
ids
);
int
updateSuppliesTemplateByIds
(
Long
[]
ids
);
List
<
ActSuppliesTemplate
>
saveTemplate
(
Long
id
);
L
ist
<
Integer
>
findall
(
Long
[]
ids
);
L
ong
findall
(
Long
ids
);
List
<
Integer
>
find
(
Long
id
);
...
...
@@ -42,4 +44,6 @@ public interface ActSuppliesTemplateMapper
List
<
ActSuppliesTemplate
>
saveTemplateStatus
(
Long
[]
ids
);
int
selectHistory
(
Long
id
);
void
updateRelease
(
ActSuppliesTemplate
actSuppliesTemplate
);
}
This diff is collapsed.
Click to expand it.
ruoyi-supplies/src/main/java/com/ruoyi/system/service/ActSuppliesTemplateService.java
View file @
852b30d4
...
...
@@ -22,12 +22,10 @@ public interface ActSuppliesTemplateService
int
updateSuppliesTemplate
(
ActSuppliesTemplate
sysSupplies
);
int
deleteSuppliesTemplateByIds
(
Long
[]
ids
);
List
<
String
>
deleteSuppliesTemplateByIds
(
Long
[]
ids
);
List
<
ActSuppliesTemplate
>
saveTemplate
(
Long
id
);
List
<
Integer
>
findall
(
Long
[]
ids
);
List
<
Integer
>
find
(
Long
id
);
/**
* 启用物料细分类管理
...
...
This diff is collapsed.
Click to expand it.
ruoyi-supplies/src/main/java/com/ruoyi/system/service/IActSuppliesHistorydataService.java
View file @
852b30d4
...
...
@@ -33,7 +33,7 @@ public interface IActSuppliesHistorydataService
* @param actSuppliesHistorydata 历史数据
* @return 结果
*/
public
int
insertActSuppliesHistorydata
(
ActSuppliesHistorydata
actSuppliesHistorydata
);
public
int
insertActSuppliesHistorydata
(
List
<
ActSuppliesHistorydata
>
actSuppliesHistorydata
);
/**
* 修改 历史数据
...
...
@@ -58,4 +58,6 @@ public interface IActSuppliesHistorydataService
* @return 结果
*/
public
int
deleteActSuppliesHistorydataById
(
Long
id
);
int
addInsertActSuppliesHistorydata
(
List
<
ActSuppliesHistorydata
>
actSuppliesHistorydata
);
}
This diff is collapsed.
Click to expand it.
ruoyi-supplies/src/main/java/com/ruoyi/system/service/IActSuppliesRoleService.java
View file @
852b30d4
...
...
@@ -71,7 +71,7 @@ public interface IActSuppliesRoleService
* @param ids 需要删除的导入规则ID
* @return 结果
*/
public
int
deleteActSuppliesRoleByIds
(
Integer
[]
ids
);
public
int
deleteActSuppliesRoleByIds
(
Long
[]
ids
);
/**
* 删除导入规则信息
...
...
@@ -100,4 +100,7 @@ public interface IActSuppliesRoleService
List
<
Integer
>
findall
(
Integer
[]
ids
);
List
<
Integer
>
find
(
Integer
id
);
List
<
String
>
releaseRS
(
Long
[]
ids
,
Long
[]
tempids
);
int
offShelfRS
(
Long
[]
ids
);
}
This diff is collapsed.
Click to expand it.
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesHistorydataServiceImpl.java
View file @
852b30d4
package
com.ruoyi.system.service.impl
;
import
java.util.List
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.ruoyi.system.mapper.ActSuppliesHistorydataMapper
;
...
...
@@ -51,10 +54,15 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
* @return 结果
*/
@Override
public
int
insertActSuppliesHistorydata
(
ActSuppliesHistorydata
actSuppliesHistorydata
)
public
int
insertActSuppliesHistorydata
(
List
<
ActSuppliesHistorydata
>
actSuppliesHistorydata
)
{
actSuppliesHistorydata
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
actSuppliesHistorydataMapper
.
insertActSuppliesHistorydata
(
actSuppliesHistorydata
);
for
(
int
i
=
0
;
i
<
actSuppliesHistorydata
.
size
();
i
++){
Long
status
=
actSuppliesHistorydata
.
get
(
i
).
getStatus
();
}
return
actSuppliesHistorydataMapper
.
insertActSuppliesHistorydata
(
actSuppliesHistorydata
.
get
(
0
));
}
/**
...
...
@@ -92,4 +100,47 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
{
return
actSuppliesHistorydataMapper
.
deleteActSuppliesHistorydataById
(
id
);
}
@Override
public
int
addInsertActSuppliesHistorydata
(
List
<
ActSuppliesHistorydata
>
actSuppliesHistorydata
)
{
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
ActSuppliesHistorydata
actSuppliesHistorydata1
=
new
ActSuppliesHistorydata
();
Long
s
=
actSuppliesHistorydataMapper
.
selectActSuppliesHistorydatauuid
(
actSuppliesHistorydata
.
get
(
0
).
getExportUuid
());
if
(
s
>
0
){
}
else
{
Long
[]
longs
=
actSuppliesHistorydataMapper
.
selectActSuppliesRole
(
actSuppliesHistorydata
.
get
(
0
).
getTemplateId
());
for
(
int
i
=
0
;
i
<
longs
.
length
;
i
++){
actSuppliesHistorydata1
.
setImportUuid
(
actSuppliesHistorydata
.
get
(
0
).
getImportUuid
());
actSuppliesHistorydata1
.
setTemplateId
(
actSuppliesHistorydata
.
get
(
0
).
getTemplateId
());
actSuppliesHistorydata1
.
setRoleId
(
longs
[
i
]);
actSuppliesHistorydata1
.
setStatus
(
1L
);
actSuppliesHistorydataMapper
.
insertActSuppliesHistorydata
(
actSuppliesHistorydata1
);
}
actSuppliesHistorydata1
.
setImportUuid
(
actSuppliesHistorydata
.
get
(
0
).
getImportUuid
());
actSuppliesHistorydata1
.
setTemplateId
(
actSuppliesHistorydata
.
get
(
0
).
getTemplateId
());
actSuppliesHistorydata1
.
setStatus
(
1L
);
actSuppliesHistorydataMapper
.
insertActSuppliesHistorydatas
(
actSuppliesHistorydata1
);
for
(
int
i
=
0
;
i
<
actSuppliesHistorydata
.
size
();
i
++){
actSuppliesHistorydata
.
get
(
i
).
setCreateBy
(
user
.
getUserName
());
actSuppliesHistorydata
.
get
(
i
).
setCreateTime
(
DateUtils
.
getNowDate
());
actSuppliesHistorydataMapper
.
updateActSuppliesHistorydatas
(
actSuppliesHistorydata
.
get
(
i
));
}
}
return
0
;
}
}
This diff is collapsed.
Click to expand it.
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesRoleServiceImpl.java
View file @
852b30d4
...
...
@@ -8,6 +8,7 @@ import com.ruoyi.common.utils.DateUtils;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.system.domain.*
;
import
com.ruoyi.system.ex.ServiceException
;
import
com.ruoyi.system.mapper.ActSuppliesRoleDetailMapper
;
import
com.ruoyi.system.web.ServiceCode
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -27,6 +28,9 @@ public class ActSuppliesRoleServiceImpl implements IActSuppliesRoleService
@Autowired
private
ActSuppliesRoleMapper
actSuppliesRoleMapper
;
@Autowired
private
ActSuppliesRoleDetailMapper
actSuppliesRoleDetailMapper
;
/**
* 查询导入规则
*
...
...
@@ -149,9 +153,52 @@ public class ActSuppliesRoleServiceImpl implements IActSuppliesRoleService
* @return 结果
*/
@Override
public
int
deleteActSuppliesRoleByIds
(
Integer
[]
ids
)
public
int
deleteActSuppliesRoleByIds
(
Long
[]
ids
)
{
return
actSuppliesRoleMapper
.
deleteActSuppliesRoleByIds
(
ids
);
ActSuppliesRole
actSuppliesRole
=
new
ActSuppliesRole
();
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
ActSuppliesRoleDetail
actSuppliesRoleDetail
=
new
ActSuppliesRoleDetail
();
for
(
int
i
=
0
;
i
<
ids
.
length
;
i
++){
int
i1
=
actSuppliesRoleMapper
.
saveHistory
(
ids
[
0
]);
if
(
i1
>
0
){
actSuppliesRole
.
setId
(
ids
[
i
]);
actSuppliesRole
.
setStatus
(
2
);
actSuppliesRole
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRole
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleMapper
.
updateRelease
(
actSuppliesRole
);
actSuppliesRoleDetail
.
setRoleId
(
ids
[
i
].
intValue
());
actSuppliesRoleDetail
.
setStatus
(
2
);
actSuppliesRoleDetail
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRoleDetail
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleDetailMapper
.
updateRoleDetailStatus
(
actSuppliesRoleDetail
);
}
else
{
ActSuppliesRole
actSuppliesRole1
=
actSuppliesRoleMapper
.
selectActSuppliesRoleById
(
ids
[
i
].
intValue
());
if
(
actSuppliesRole1
.
getStatus
()
==
0
){
actSuppliesRole
.
setId
(
ids
[
i
]);
actSuppliesRole
.
setStatus
(
1
);
actSuppliesRole
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRole
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleMapper
.
updateRelease
(
actSuppliesRole
);
actSuppliesRoleDetail
.
setRoleId
(
ids
[
i
].
intValue
());
actSuppliesRoleDetail
.
setStatus
(
1
);
actSuppliesRoleDetail
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRoleDetail
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleDetailMapper
.
updateRoleDetailStatus
(
actSuppliesRoleDetail
);
}
else
{
actSuppliesRoleMapper
.
deleteActSuppliesRoleById
(
ids
[
i
].
intValue
());
actSuppliesRoleDetailMapper
.
deleteActSuppliesRoleDetailById
(
ids
[
i
].
intValue
());
}
}
}
return
1
;
}
/**
...
...
@@ -191,6 +238,102 @@ public class ActSuppliesRoleServiceImpl implements IActSuppliesRoleService
return
actSuppliesRoleMapper
.
find
(
id
);
}
/**
* 发布规则
*
* @param ids,tempids 导入规则ID
* @return 结果
*/
@Override
public
List
<
String
>
releaseRS
(
Long
[]
ids
,
Long
[]
tempids
)
{
List
<
String
>
releER
=
new
ArrayList
<>();
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
ActSuppliesRole
actSuppliesRole
=
new
ActSuppliesRole
();
ActSuppliesRoleDetail
actSuppliesRoleDetail
=
new
ActSuppliesRoleDetail
();
for
(
int
i
=
0
;
i
<
ids
.
length
;
i
++){
//查询所属模板是否发布
Integer
integer
=
actSuppliesRoleMapper
.
saveTemp
(
tempids
[
i
]);
if
(
integer
!=
null
&&
integer
>
0
){
actSuppliesRole
.
setId
(
ids
[
i
]);
actSuppliesRole
.
setStatus
(
0
);
actSuppliesRole
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRole
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleMapper
.
updateRelease
(
actSuppliesRole
);
actSuppliesRoleDetail
.
setRoleId
(
ids
[
i
].
intValue
());
actSuppliesRoleDetail
.
setStatus
(
0
);
actSuppliesRoleDetail
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRoleDetail
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleDetailMapper
.
updateRoleDetailStatus
(
actSuppliesRoleDetail
);
}
else
{
String
name
=
actSuppliesRoleMapper
.
saveRoleName
(
ids
[
i
]);
releER
.
add
(
name
);
}
}
return
releER
;
}
/**
* 下架规则
*
* @param ids 导入规则ID
* @return 结果
*/
@Override
public
int
offShelfRS
(
Long
[]
ids
)
{
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
ActSuppliesRole
actSuppliesRole
=
new
ActSuppliesRole
();
ActSuppliesRoleDetail
actSuppliesRoleDetail
=
new
ActSuppliesRoleDetail
();
for
(
int
i
=
0
;
i
<
ids
.
length
;
i
++){
//查询历史数据是否引用
int
count
=
actSuppliesRoleMapper
.
saveHistory
(
ids
[
i
]);
if
(
count
>
0
){
actSuppliesRole
.
setId
(
ids
[
i
]);
actSuppliesRole
.
setStatus
(
2
);
actSuppliesRole
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRole
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleMapper
.
updateRelease
(
actSuppliesRole
);
actSuppliesRoleDetail
.
setRoleId
(
ids
[
i
].
intValue
());
actSuppliesRoleDetail
.
setStatus
(
2
);
actSuppliesRoleDetail
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRoleDetail
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleDetailMapper
.
updateRoleDetailStatus
(
actSuppliesRoleDetail
);
}
else
{
actSuppliesRole
.
setId
(
ids
[
i
]);
actSuppliesRole
.
setStatus
(
1
);
actSuppliesRole
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRole
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleMapper
.
updateRelease
(
actSuppliesRole
);
actSuppliesRoleDetail
.
setRoleId
(
ids
[
i
].
intValue
());
actSuppliesRoleDetail
.
setStatus
(
1
);
actSuppliesRoleDetail
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRoleDetail
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleDetailMapper
.
updateRoleDetailStatus
(
actSuppliesRoleDetail
);
}
}
return
1
;
}
private
void
updateStatusById
(
Long
id
,
Integer
status
){
String
[]
statusText
={
"禁用"
,
"启用"
};
...
...
This diff is collapsed.
Click to expand it.
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesTemplateServiceImpl.java
View file @
852b30d4
package
com.ruoyi.system.service.impl
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
...
...
@@ -9,6 +10,7 @@ import com.ruoyi.system.service.ActSuppliesTemplateService;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.LinkedList
;
import
java.util.List
;
...
...
@@ -57,37 +59,45 @@ public class ActSuppliesTemplateServiceImpl implements ActSuppliesTemplateServic
}
@Override
public
int
deleteSuppliesTemplateByIds
(
Long
[]
ids
)
{
public
List
<
String
>
deleteSuppliesTemplateByIds
(
Long
[]
ids
)
{
List
<
ActSuppliesTemplate
>
actSuppliesTemplate
=
actSuppliesTemplateMapper
.
saveTemplateStatus
(
ids
);
List
<
Long
>
idsd
=
new
LinkedList
<>();
List
<
Long
>
idsu
=
new
LinkedList
<>();
List
<
String
>
releER
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
actSuppliesTemplate
.
size
();
i
++)
{
if
(
actSuppliesTemplate
.
get
(
i
).
getStatus
()==
1
)
{
idsd
.
add
(
actSuppliesTemplate
.
get
(
i
).
getId
());
}
else
{
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
if
(
actSuppliesTemplate
.
get
(
i
).
getStatus
()==
0
)
{
int
count
=
actSuppliesTemplateMapper
.
selectHistory
(
actSuppliesTemplate
.
get
(
i
).
getId
());
if
(
count
>
0
){
idsu
.
add
(
actSuppliesTemplate
.
get
(
i
).
getId
());
actSuppliesTemplate
.
get
(
i
).
setStatus
(
2
);
actSuppliesTemplate
.
get
(
i
).
setUpdateBy
(
user
.
getUserName
());
actSuppliesTemplate
.
get
(
i
).
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesTemplateMapper
.
updateRelease
(
actSuppliesTemplate
.
get
(
i
));
}
else
{
idsd
.
add
(
actSuppliesTemplate
.
get
(
i
).
getId
());
}
actSuppliesTemplate
.
get
(
i
).
setStatus
(
1
);
actSuppliesTemplate
.
get
(
i
).
setUpdateBy
(
user
.
getUserName
());
actSuppliesTemplate
.
get
(
i
).
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesTemplateMapper
.
updateRelease
(
actSuppliesTemplate
.
get
(
i
));
}
}
else
if
(
actSuppliesTemplate
.
get
(
i
).
getStatus
()==
1
)
{
Long
findall
=
actSuppliesTemplateMapper
.
findall
(
actSuppliesTemplate
.
get
(
i
).
getId
());
if
(
findall
>
0
){
releER
.
add
(
actSuppliesTemplate
.
get
(
i
).
getTemplateName
());
}
actSuppliesTemplateMapper
.
deleteSuppliesTemplateById
(
actSuppliesTemplate
.
get
(
i
).
getId
());
if
(
idsd
.
size
()>
0
){
actSuppliesTemplateMapper
.
deleteSuppliesTemplateByIds
(
idsd
.
toArray
(
idsd
.
toArray
(
new
Long
[
0
])));
}
else
if
(
idsu
.
size
()>
0
){
actSuppliesTemplateMapper
.
updateSuppliesTemplateByIds
(
idsu
.
toArray
(
idsu
.
toArray
(
new
Long
[
0
])));
}
}
return
1
;
return
releER
;
}
...
...
@@ -96,10 +106,6 @@ public class ActSuppliesTemplateServiceImpl implements ActSuppliesTemplateServic
return
actSuppliesTemplateMapper
.
saveTemplate
(
id
);
}
@Override
public
List
<
Integer
>
findall
(
Long
[]
ids
)
{
return
actSuppliesTemplateMapper
.
findall
(
ids
);
}
@Override
public
List
<
Integer
>
find
(
Long
id
)
{
...
...
@@ -121,6 +127,7 @@ public class ActSuppliesTemplateServiceImpl implements ActSuppliesTemplateServic
return
actSuppliesTemplateMapper
.
findName
();
}
@Override
public
int
releaseStatus
(
Long
[]
ids
)
{
...
...
This diff is collapsed.
Click to expand it.
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesHistorydataMapper.xml
View file @
852b30d4
...
...
@@ -96,4 +96,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select
id=
"selectActSuppliesHistorydatauuid"
parameterType=
"String"
resultType=
"Long"
>
select count(*) from act_supplies_historydata where import_uuid = #{importUuid}
</select>
<select
id=
"selectActSuppliesRole"
parameterType=
"Long"
resultType=
"Long"
>
select temp_id from act_supplies_role where temp_id = #{templateId}
</select>
<update
id=
"updateActSuppliesHistorydatas"
parameterType=
"ActSuppliesHistorydata"
>
update act_supplies_historydata
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"historyName != null"
>
history_name = #{historyName},
</if>
<if
test=
"historyContent != null"
>
history_content = #{historyContent},
</if>
<if
test=
"identifyingCode != null"
>
identifying_code = #{identifyingCode},
</if>
<if
test=
"status != null"
>
status = #{status},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
</trim>
where import_uuid = #{importUuid}
</update>
</mapper>
This diff is collapsed.
Click to expand it.
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesRoleDetailMapper.xml
View file @
852b30d4
...
...
@@ -47,7 +47,7 @@
</sql>
<select
id=
"saveSid"
parameterType=
"com.ruoyi.system.domain.ActSuppliesRole"
resultMap=
"ActSuppliesRoleResult"
>
select id, temp_id, role_name from act_supplies_role where status =
0
select id, temp_id, role_name from act_supplies_role where status =
1
</select>
<!-- <select id="saveOperation" parameterType="ActOperation" resultMap="ActOperationResult">-->
...
...
@@ -77,17 +77,9 @@
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"roleId != null"
>
role_id,
</if>
<if
test=
"detailName != null"
>
detail_name,
</if>
<!-- <if test="detailMH != null">detail_m_h,</if>-->
<!-- <if test="detailML != null">detail_m_l,</if>-->
<!-- <if test="detailYH != null">detail_y_h,</if>-->
<!-- <if test="detailYL != null">detail_y_l,</if>-->
<if
test=
"detailYS != null"
>
detail_y_s,
</if>
<if
test=
"detailContent != null"
>
detail_content,
</if>
<if
test=
"convertStatus != null"
>
convert_status,
</if>
<if
test=
"status != null"
>
status,
</if>
<if
test=
"createBy != null"
>
create_by,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
...
...
@@ -97,17 +89,9 @@
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"roleId != null"
>
#{roleId},
</if>
<if
test=
"detailName != null"
>
#{detailName},
</if>
<!-- <if test="detailMH != null">#{detailMH},</if>-->
<!-- <if test="detailML != null">#{detailML},</if>-->
<!-- <if test="detailYH != null">#{detailYH},</if>-->
<!-- <if test="detailYL != null">#{detailYL},</if>-->
<if
test=
"detailYS != null"
>
#{detailYS},
</if>
<if
test=
"detailContent != null"
>
#{detailContent},
</if>
<if
test=
"convertStatus != null"
>
#{convertStatus},
</if>
<if
test=
"status != null"
>
#{status},
</if>
<if
test=
"createBy != null"
>
#{createBy},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
...
...
@@ -123,13 +107,7 @@
<if
test=
"detailName != null"
>
detail_name = #{detailName},
</if>
<if
test=
"detailContent != null"
>
detail_content = #{detailContent},
</if>
<if
test=
"convertStatus != null"
>
convert_status = #{convertStatus},
</if>
<!-- <if test="detailMH != null">detail_m_h = #{detailMH},</if>-->
<!-- <if test="detailML != null">detail_m_l = #{detailML},</if>-->
<!-- <if test="detailYH != null">detail_y_h = #{detailYH},</if>-->
<!-- <if test="detailYL != null">detail_y_l = #{detailYL},</if>-->
<if
test=
"detailYS != null"
>
detail_y_s = #{detailYS},
</if>
<if
test=
"status != null"
>
status = #{status},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
...
...
@@ -139,8 +117,18 @@
where id = #{id}
</update>
<update
id=
"updateRoleDetailStatus"
parameterType=
"ActSuppliesRoleDetail"
>
update act_supplies_role_detail
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"status != null"
>
status = #{status},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
</trim>
where role_id = #{roleId}
</update>
<delete
id=
"deleteActSuppliesRoleDetailById"
parameterType=
"Integer"
>
delete from act_supplies_role_detail where id = #{id}
delete from act_supplies_role_detail where
role_
id = #{id}
</delete>
<delete
id=
"deleteActSuppliesRoleDetailByIds"
parameterType=
"String"
>
...
...
This diff is collapsed.
Click to expand it.
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesRoleMapper.xml
View file @
852b30d4
...
...
@@ -78,10 +78,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select id, role_id, detail_name, detail_m_h, detail_m_l, detail_y_h, detail_y_l,detail_y_s, detail_content,convert_status, status, create_by, create_time, update_by, update_time from act_supplies_role_detail
</sql>
<select
id=
"saveRoleName"
parameterType=
"Long"
resultType=
"String"
>
select role_name from act_supplies_role where id = #{id}
</select>
<select
id=
"saveSid"
parameterType=
"com.ruoyi.system.domain.ActSuppliesTemplate"
resultMap=
"SuppliesTemplateResult"
>
select id, det_id, template_name from act_supplies_template where status = 0
</select>
<select
id=
"saveTemp"
parameterType=
"Long"
resultType=
"Integer"
>
select id from act_supplies_template where id = #{id} and status =0
</select>
<select
id=
"saveHistory"
parameterType=
"Long"
resultType=
"Integer"
>
SELECT COUNT(role_id) FROM act_supplies_historydata where role_id = #{id}
</select>
<select
id=
"saveStatus"
parameterType=
"Long"
resultType=
"Integer"
>
select id from act_supplies_template where id = #{id} and status = 0
</select>
<update
id=
"updateRelease"
parameterType=
"ActSuppliesRole"
>
update act_supplies_role
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"status != null"
>
status = #{status},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
</trim>
where id = #{id}
</update>
<select
id=
"selectActSuppliesRoleList"
parameterType=
"ActSuppliesRole"
resultMap=
"ActSuppliesRoleResult"
>
select a.id,a.temp_id,a.role_name,a.status,b.template_name from act_supplies_role a,act_supplies_template b
<where>
...
...
This diff is collapsed.
Click to expand it.
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesTemplateMapper.xml
View file @
852b30d4
...
...
@@ -25,11 +25,8 @@
select temp_id from act_supplies_role where temp_id=#{id}
</select>
<select
id=
"findall"
parameterType=
"String"
resultType=
"Integer"
>
select temp_id from act_supplies_role where temp_id in
<foreach
collection=
"array"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
<select
id=
"findall"
parameterType=
"Long"
resultType=
"Long"
>
select count(*) from act_supplies_role where temp_id = #{id}
</select>
...
...
@@ -64,6 +61,16 @@
SELECT COUNT(template_id) FROM act_supplies_historydata where template_id = #{id}
</select>
<update
id=
"updateRelease"
parameterType=
"ActSuppliesTemplate"
>
update act_supplies_template
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"status != null"
>
status = #{status},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
</trim>
where id = #{id}
</update>
<insert
id=
"insertSuppliesTemplate"
parameterType=
"ActSuppliesTemplate"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into act_supplies_template
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
This diff is collapsed.
Click to expand it.
ruoyi-ui/public/exportExcel.js
View file @
852b30d4
...
...
@@ -102,7 +102,8 @@ var setStyleAndValue = function(cellArr, worksheet) {
cell
.
it
,
cell
.
fs
,
cell
.
cl
,
cell
.
ul
cell
.
ul
,
cell
.
ps
);
let
alignment
=
alignmentConvert
(
cell
.
vt
,
cell
.
ht
,
cell
.
tb
,
cell
.
tr
);
let
value
=
''
;
...
...
@@ -155,7 +156,7 @@ var fontConvert = function(
it
=
0
,
fs
=
10
,
cl
=
0
,
ul
=
0
ul
=
0
,
)
{
// luckysheet:ff(样式), fc(颜色), bl(粗体), it(斜体), fs(大小), cl(删除线), ul(下划线)
const
luckyToExcel
=
{
...
...
@@ -186,7 +187,7 @@ var fontConvert = function(
bold
:
luckyToExcel
.
num2bl
(
bl
),
italic
:
luckyToExcel
.
num2bl
(
it
),
underline
:
luckyToExcel
.
num2bl
(
ul
),
strike
:
luckyToExcel
.
num2bl
(
cl
)
strike
:
luckyToExcel
.
num2bl
(
cl
)
,
};
return
font
;
...
...
@@ -196,7 +197,7 @@ var alignmentConvert = function(
vt
=
'
default
'
,
ht
=
'
default
'
,
tb
=
'
default
'
,
tr
=
'
default
'
tr
=
'
default
'
,
)
{
// luckysheet:vt(垂直), ht(水平), tb(换行), tr(旋转)
const
luckyToExcel
=
{
...
...
@@ -233,7 +234,8 @@ var alignmentConvert = function(
vertical
:
luckyToExcel
.
vertical
[
vt
],
horizontal
:
luckyToExcel
.
horizontal
[
ht
],
wrapText
:
luckyToExcel
.
wrapText
[
tb
],
textRotation
:
luckyToExcel
.
textRotation
[
tr
]
textRotation
:
luckyToExcel
.
textRotation
[
tr
],
};
return
alignment
;
};
...
...
This diff is collapsed.
Click to expand it.
ruoyi-ui/src/api/system/historydata.js
View file @
852b30d4
...
...
@@ -51,3 +51,12 @@ export function exportHistorydata(query) {
params
:
query
})
}
// 新增 历史数据
export
function
addInsert
(
data
)
{
return
request
({
url
:
'
/system/historydata/addInsert
'
,
method
:
'
post
'
,
data
:
data
})
}
This diff is collapsed.
Click to expand it.
ruoyi-ui/src/api/system/suppliesrole.js
View file @
852b30d4
...
...
@@ -100,3 +100,20 @@ export function toggleDisable(id) {
})
}
//发布
export
function
releaseRoleStatus
(
ids
,
tempids
)
{
return
request
({
url
:
'
/system/suppliesrole/releaseRS/
'
+
ids
+
'
/
'
+
tempids
,
method
:
'
get
'
,
})
}
//下架
export
function
offShelfRoleStatus
(
ids
)
{
return
request
({
url
:
'
/system/suppliesrole/offShelfRS/
'
+
ids
,
method
:
'
get
'
,
})
}
This diff is collapsed.
Click to expand it.
ruoyi-ui/src/views/system/supplies/index_template.vue
View file @
852b30d4
...
...
@@ -35,18 +35,18 @@
>
新增
</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=
"['SuppliesTemplate:SuppliesTemplate:edit']"
>
修改
</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="['SuppliesTemplate:SuppliesTemplate:edit']"-->
<!-- >修改-->
<!--
</el-button>
--
>
<!--
</el-col>
--
>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
...
...
@@ -71,7 +71,6 @@
>
发布
</el-button>
</el-col>
<right-toolbar
:showSearch.sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
...
...
@@ -79,23 +78,41 @@
<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=
"templateName"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
>
<!--
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
>
-->
<!--
<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"-->
<!-- active-text="已发布"-->
<!-- inactive-text="未发布"-->
<!-- disabled = "true">-->
<!--
</el-switch>
-->
<!--
</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"
active-text=
"已发布"
inactive-text=
"未发布"
>
</el-switch>
<template
v-if=
"scope.row.status === 0"
>
<span
style=
"color: #0cc030;"
>
已发布
</span>
</
template
>
<
template
v-else-if=
"scope.row.status === 1"
>
<span
style=
"color: #0077ff;"
>
未发布
</span>
</
template
>
<
template
v-else-if=
"scope.row.status === 2"
>
<span
style=
"color: #ff0000;"
>
未发布
</span>
</
template
>
</div>
</template>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
prop=
"status"
>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
...
...
@@ -200,11 +217,44 @@
<div
id=
"luckysheet"
:style=
"{ position: positionValue, top: '0', left: '0', right: '0', bottom: '0' }"
></div>
<!-- 遮罩层组件 -->
<div
v-if=
"uploading"
class=
"overlay"
>
<div
class=
"loader"
></div>
</div>
</div>
</template>
<
style
>
.overlay
{
position
:
fixed
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
background-color
:
rgba
(
0
,
0
,
0
,
0.5
);
z-index
:
9999
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
.loader
{
border
:
16px
solid
#f3f3f3
;
/* 转圈圈的颜色 */
border-top
:
16px
solid
#3498db
;
/* 转圈圈的主题颜色 */
border-radius
:
50%
;
width
:
120px
;
height
:
120px
;
animation
:
spin
2s
linear
infinite
;
}
@keyframes
spin
{
0
%
{
transform
:
rotate
(
0deg
);
}
100
%
{
transform
:
rotate
(
360deg
);
}
}
</
style
>
<
style
>
#luckysheet_info_detail_title
{
display
:
none
;
...
...
@@ -237,6 +287,7 @@ import {
import
$
from
'
jquery
'
;
import
XLSX
from
'
xlsx
'
;
import
LuckyExcel
from
'
luckyexcel
'
;
import
{
Loading
}
from
'
element-ui
'
;
export
default
{
name
:
"
SuppliesTemplate
"
,
...
...
@@ -304,6 +355,7 @@ export default {
},
methods
:
{
/**启用 */
toggleEnable
(
SuppliesTemplate
)
{
console
.
log
(
'
你点击了【
'
+
SuppliesTemplate
.
s
+
'
】的开关控件,当前开关值:
'
+
SuppliesTemplate
.
status
);
...
...
@@ -351,7 +403,7 @@ export default {
},
/**上传事件 */
beforeUpload
(
file
)
{
async
beforeUpload
(
file
)
{
//存在重复
findName
(
file
.
name
).
then
(
result
=>
{
console
.
log
(
result
.
data
)
...
...
@@ -368,12 +420,14 @@ export default {
if
(
!
isJpgOrPng
)
{
this
.
$message
.
error
(
'
只能上传xlsx文件
'
);
}
LuckyExcel
.
transformExcelToLucky
(
file
,
(
exportJson
,
lucksheetfile
)
=>
{
this
.
uploading
=
true
;
await
LuckyExcel
.
transformExcelToLucky
(
file
,
(
exportJson
,
lucksheetfile
)
=>
{
this
.
form
.
templateName
=
file
.
name
;
this
.
form
.
templateContent
=
JSON
.
stringify
(
exportJson
.
sheets
);
});
this
.
uploading
=
false
;
return
isJpgOrPng
;
},
// handleFileChange(event){
...
...
@@ -442,6 +496,7 @@ export default {
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
if
(
row
.
status
===
1
)
{
this
.
fileListName
=
[];
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
...
...
@@ -451,6 +506,9 @@ export default {
this
.
open
=
true
;
this
.
title
=
"
修改Excel模板
"
;
});
}
else
{
this
.
msgError
(
"
文件文件已发布无法修改!!!
"
)
}
},
/** 提交按钮 */
submitForm
()
{
...
...
@@ -528,16 +586,20 @@ export default {
handleDelete
(
row
)
{
const
ids
=
row
.
id
||
this
.
ids
;
const
name
=
row
.
templateName
||
this
.
name
;
this
.
$confirm
(
'
是否确认删除
Excel模板编号
为"
'
+
name
+
'
"的数据项?
'
,
"
警告
"
,
{
this
.
$confirm
(
'
是否确认删除
模板名称
为"
'
+
name
+
'
"的数据项?
'
,
"
警告
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
}).
then
(
function
()
{
return
delSuppliesTemplate
(
ids
);
}).
then
((
result
)
=>
{
if
(
result
.
data
===
"
操作失败
"
)
{
if
(
result
.
msg
===
"
312
"
)
{
this
.
getList
();
this
.
msgError
(
"
该模板下存在关联规则,请先删除关联规则!!!
"
);
this
.
$confirm
(
'
模板名称为"
'
+
result
.
data
+
'
"的数据项下存在关联规则,请先删除关联规则在删除模板
'
,
"
警告
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
}).
then
(()
=>
{
this
.
getList
();})
}
else
{
this
.
getList
();
this
.
msgSuccess
(
"
删除成功
"
);
...
...
This diff is collapsed.
Click to expand it.
ruoyi-ui/src/views/system/suppliesrole/index.vue
View file @
852b30d4
This diff is collapsed.
Click to expand it.
ruoyi-ui/src/views/system/suppliesroledetail/index.vue
View file @
852b30d4
This diff is collapsed.
Click to expand it.
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