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
c6cf5960
Commit
c6cf5960
authored
Mar 11, 2024
by
hehongwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
前端转换修改;后端清洗修改
parent
10e24885
Changes
26
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
2692 additions
and
2036 deletions
+2692
-2036
ruoyi-admin/src/main/resources/application.yml
ruoyi-admin/src/main/resources/application.yml
+1
-0
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesCleaningRuleController.java
.../system/controller/ActSuppliesCleaningRuleController.java
+3
-3
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesHistorydataController.java
...i/system/controller/ActSuppliesHistorydataController.java
+1
-0
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesHistorydataMapper.java
...com/ruoyi/system/mapper/ActSuppliesHistorydataMapper.java
+1
-1
ruoyi-supplies/src/main/java/com/ruoyi/system/service/IActSuppliesHistorydataService.java
.../ruoyi/system/service/IActSuppliesHistorydataService.java
+1
-1
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesHistorydataServiceImpl.java
...ystem/service/impl/ActSuppliesHistorydataServiceImpl.java
+8
-2
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesHistorydataMapper.xml
.../resources/mapper/system/ActSuppliesHistorydataMapper.xml
+2
-2
ruoyi-ui/package.json
ruoyi-ui/package.json
+3
-2
ruoyi-ui/public/exportExcel.js
ruoyi-ui/public/exportExcel.js
+1
-4
ruoyi-ui/src/api/Actsupplies/cleaning_rule.js
ruoyi-ui/src/api/Actsupplies/cleaning_rule.js
+3
-2
ruoyi-ui/src/conversion/DonghuantuoMine.js
ruoyi-ui/src/conversion/DonghuantuoMine.js
+32
-8
ruoyi-ui/src/conversion/LinxiMine.js
ruoyi-ui/src/conversion/LinxiMine.js
+13
-5
ruoyi-ui/src/conversion/MoneyMine.js
ruoyi-ui/src/conversion/MoneyMine.js
+243
-0
ruoyi-ui/src/conversion/TangshanMine copy.js
ruoyi-ui/src/conversion/TangshanMine copy.js
+166
-0
ruoyi-ui/src/conversion/conversion.js
ruoyi-ui/src/conversion/conversion.js
+133
-112
ruoyi-ui/src/conversion/danhouMine.js
ruoyi-ui/src/conversion/danhouMine.js
+43
-30
ruoyi-ui/src/conversion/fanMine.js
ruoyi-ui/src/conversion/fanMine.js
+9
-6
ruoyi-ui/src/conversion/hongMine.js
ruoyi-ui/src/conversion/hongMine.js
+28
-15
ruoyi-ui/src/conversion/lvMine.js
ruoyi-ui/src/conversion/lvMine.js
+22
-18
ruoyi-ui/src/main.js
ruoyi-ui/src/main.js
+0
-1
ruoyi-ui/src/views/system/ActsupplesAll/MoneyMine.vue
ruoyi-ui/src/views/system/ActsupplesAll/MoneyMine.vue
+57
-0
ruoyi-ui/src/views/system/ActsupplesAll/fanMine.vue
ruoyi-ui/src/views/system/ActsupplesAll/fanMine.vue
+1
-0
ruoyi-ui/src/views/system/historydata/index.vue
ruoyi-ui/src/views/system/historydata/index.vue
+0
-4
ruoyi-ui/src/views/system/supplies/index_vue.vue
ruoyi-ui/src/views/system/supplies/index_vue.vue
+1823
-1594
ruoyi-ui/src/views/system/user/index.vue
ruoyi-ui/src/views/system/user/index.vue
+95
-223
ruoyi-ui/vue.config.js
ruoyi-ui/vue.config.js
+3
-3
No files found.
ruoyi-admin/src/main/resources/application.yml
View file @
c6cf5960
...
@@ -95,6 +95,7 @@ spring:
...
@@ -95,6 +95,7 @@ spring:
time-zone
:
GMT+8
time-zone
:
GMT+8
serialization
:
serialization
:
write-dates-as-timestamps
:
false
write-dates-as-timestamps
:
false
# token配置
# token配置
token
:
token
:
# 令牌自定义标识
# 令牌自定义标识
...
...
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesCleaningRuleController.java
View file @
c6cf5960
...
@@ -42,11 +42,11 @@ public class ActSuppliesCleaningRuleController extends BaseController
...
@@ -42,11 +42,11 @@ public class ActSuppliesCleaningRuleController extends BaseController
* 获取所有历史数据
* 获取所有历史数据
*/
*/
@PreAuthorize
(
"@ss.hasPermi('system:cleaningrule:queryAllAcc')"
)
@PreAuthorize
(
"@ss.hasPermi('system:cleaningrule:queryAllAcc')"
)
@
GetMapping
(
"/queryAllAcc/{tylkStatus}
"
)
@
PutMapping
(
"/queryAllAcc
"
)
public
AjaxResult
selectActSuppliesHistorydataAcc
(
@
PathVariable
(
"tylkStatus"
)
Integer
tylkStatus
)
public
AjaxResult
selectActSuppliesHistorydataAcc
(
@
RequestBody
ActSuppliesHistorydata
actSuppliesHistorydata
)
{
{
List
<
ActSuppliesHistorydata
>
s
=
actSuppliesHistorydataService
.
selectActSuppliesHistorydataAcc
(
tylkStatus
);
List
<
ActSuppliesHistorydata
>
s
=
actSuppliesHistorydataService
.
selectActSuppliesHistorydataAcc
(
actSuppliesHistorydata
);
return
AjaxResult
.
success
(
s
);
return
AjaxResult
.
success
(
s
);
}
}
...
...
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesHistorydataController.java
View file @
c6cf5960
...
@@ -123,6 +123,7 @@ public class ActSuppliesHistorydataController extends BaseController
...
@@ -123,6 +123,7 @@ public class ActSuppliesHistorydataController extends BaseController
@PostMapping
(
"/addInsertAccount"
)
@PostMapping
(
"/addInsertAccount"
)
public
AjaxResult
addInsertAccount
(
@RequestBody
List
<
ActSuppliesHistorydata
>
actSuppliesHistorydata
)
public
AjaxResult
addInsertAccount
(
@RequestBody
List
<
ActSuppliesHistorydata
>
actSuppliesHistorydata
)
{
{
System
.
out
.
println
(
actSuppliesHistorydata
);
actSuppliesHistorydataService
.
addInsertActSuppliesHistorydataAcc
(
actSuppliesHistorydata
);
actSuppliesHistorydataService
.
addInsertActSuppliesHistorydataAcc
(
actSuppliesHistorydata
);
return
toAjax
(
1
);
return
toAjax
(
1
);
}
}
...
...
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesHistorydataMapper.java
View file @
c6cf5960
...
@@ -96,7 +96,7 @@ public interface ActSuppliesHistorydataMapper
...
@@ -96,7 +96,7 @@ public interface ActSuppliesHistorydataMapper
void
updateActSuppliesHistorydataStatusByIdAcc
(
Long
gethId
);
void
updateActSuppliesHistorydataStatusByIdAcc
(
Long
gethId
);
List
<
ActSuppliesHistorydata
>
selectActSuppliesHistorydataAcc
(
Integer
tylkStatus
);
List
<
ActSuppliesHistorydata
>
selectActSuppliesHistorydataAcc
(
ActSuppliesHistorydata
actSuppliesHistorydata
);
List
<
ActSuppliesHistorydata
>
selectActSuppliesHistorydataCopyList
(
ActSuppliesHistorydata
actSuppliesHistorydata
);
List
<
ActSuppliesHistorydata
>
selectActSuppliesHistorydataCopyList
(
ActSuppliesHistorydata
actSuppliesHistorydata
);
...
...
ruoyi-supplies/src/main/java/com/ruoyi/system/service/IActSuppliesHistorydataService.java
View file @
c6cf5960
...
@@ -90,7 +90,7 @@ public interface IActSuppliesHistorydataService
...
@@ -90,7 +90,7 @@ public interface IActSuppliesHistorydataService
void
addInsertActSuppliesHistorydataAcc
(
List
<
ActSuppliesHistorydata
>
actSuppliesHistorydata
);
void
addInsertActSuppliesHistorydataAcc
(
List
<
ActSuppliesHistorydata
>
actSuppliesHistorydata
);
List
<
ActSuppliesHistorydata
>
selectActSuppliesHistorydataAcc
(
Integer
tylkStatus
);
List
<
ActSuppliesHistorydata
>
selectActSuppliesHistorydataAcc
(
ActSuppliesHistorydata
actSuppliesHistorydata
);
List
<
ActSuppliesImportCleaningAcc
>
selectActSuppliesCleaningCopyAcc
(
Long
id
);
List
<
ActSuppliesImportCleaningAcc
>
selectActSuppliesCleaningCopyAcc
(
Long
id
);
}
}
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesHistorydataServiceImpl.java
View file @
c6cf5960
...
@@ -627,6 +627,12 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -627,6 +627,12 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
@Transactional
@Transactional
public
void
addInsertImportssAccounts
(
List
<
ActOperation1
>
actOperation2s
)
{
public
void
addInsertImportssAccounts
(
List
<
ActOperation1
>
actOperation2s
)
{
Thread
thread1
=
new
Thread
(()->{
System
.
out
.
println
(
"sssss"
);
});
Thread
thread
=
new
Thread
()
{
Thread
thread
=
new
Thread
()
{
public
void
run
()
{
public
void
run
()
{
...
@@ -838,9 +844,9 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
...
@@ -838,9 +844,9 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
}
}
@Override
@Override
public
List
<
ActSuppliesHistorydata
>
selectActSuppliesHistorydataAcc
(
Integer
tylkStatus
)
{
public
List
<
ActSuppliesHistorydata
>
selectActSuppliesHistorydataAcc
(
ActSuppliesHistorydata
actSuppliesHistorydata
)
{
return
actSuppliesHistorydataMapper
.
selectActSuppliesHistorydataAcc
(
tylkStatus
);
return
actSuppliesHistorydataMapper
.
selectActSuppliesHistorydataAcc
(
actSuppliesHistorydata
);
}
}
...
...
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesHistorydataMapper.xml
View file @
c6cf5960
...
@@ -257,11 +257,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -257,11 +257,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where t1.clean_status = 0 and t1.tylk_status =#{tylkStatus}
where t1.clean_status = 0 and t1.tylk_status =#{tylkStatus}
</select>
</select>
<select
id=
"selectActSuppliesHistorydataAcc"
parameterType=
"
java.lang.Integer
"
resultMap=
"ActSuppliesHistorydataResult"
>
<select
id=
"selectActSuppliesHistorydataAcc"
parameterType=
"
ActSuppliesHistorydata
"
resultMap=
"ActSuppliesHistorydataResult"
>
SELECT t1.id,t1.import_uuid, t1.template_id, t1.export_uuid, t1.role_id, t1.history_name, t1.history_role,t1.conven_role,t2.history_content, t1.identifying_code, t1.status, t1.create_by, t1.create_time,t1.date,t1.ssk_id
SELECT t1.id,t1.import_uuid, t1.template_id, t1.export_uuid, t1.role_id, t1.history_name, t1.history_role,t1.conven_role,t2.history_content, t1.identifying_code, t1.status, t1.create_by, t1.create_time,t1.date,t1.ssk_id
FROM act_supplies_historydata_copy1 t1
FROM act_supplies_historydata_copy1 t1
LEFT JOIN act_supplies_historycontent_copy1 t2 ON t1.import_uuid = t2.hid
LEFT JOIN act_supplies_historycontent_copy1 t2 ON t1.import_uuid = t2.hid
where t1.clean_status = 0 and t1.tylk_status =#{tylkStatus}
where t1.clean_status = 0 and t1.tylk_status =#{tylkStatus}
and t1.ssk_id = #{mining}
</select>
</select>
<update
id=
"updateActSuppliesHistorydataStatusById"
parameterType=
"java.lang.Long"
>
<update
id=
"updateActSuppliesHistorydataStatusById"
parameterType=
"java.lang.Long"
>
...
...
ruoyi-ui/package.json
View file @
c6cf5960
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
"af-table-column"
:
"^1.0.3"
,
"af-table-column"
:
"^1.0.3"
,
"axios"
:
"0.21.0"
,
"axios"
:
"0.21.0"
,
"babel-eslint"
:
"10.1.0"
,
"babel-eslint"
:
"10.1.0"
,
"bigdecimal"
:
"^0.6.1"
,
"chalk"
:
"4.1.0"
,
"chalk"
:
"4.1.0"
,
"clipboard"
:
"2.0.6"
,
"clipboard"
:
"2.0.6"
,
"connect"
:
"3.6.6"
,
"connect"
:
"3.6.6"
,
...
@@ -61,6 +62,7 @@
...
@@ -61,6 +62,7 @@
"jsencrypt"
:
"3.0.0-rc.1"
,
"jsencrypt"
:
"3.0.0-rc.1"
,
"lint-staged"
:
"10.5.3"
,
"lint-staged"
:
"10.5.3"
,
"luckyexcel"
:
"^1.0.1"
,
"luckyexcel"
:
"^1.0.1"
,
"mathjs"
:
"^12.4.0"
,
"moment"
:
"^2.30.1"
,
"moment"
:
"^2.30.1"
,
"nprogress"
:
"0.2.0"
,
"nprogress"
:
"0.2.0"
,
"quill"
:
"1.3.7"
,
"quill"
:
"1.3.7"
,
...
@@ -72,7 +74,6 @@
...
@@ -72,7 +74,6 @@
"scriptjs"
:
"^2.5.9"
,
"scriptjs"
:
"^2.5.9"
,
"svg-sprite-loader"
:
"5.1.1"
,
"svg-sprite-loader"
:
"5.1.1"
,
"uuid"
:
"^9.0.0"
,
"uuid"
:
"^9.0.0"
,
"vue"
:
"2.6.12"
,
"vue-append"
:
"^2.2.0"
,
"vue-append"
:
"^2.2.0"
,
"vue-count-to"
:
"1.0.13"
,
"vue-count-to"
:
"1.0.13"
,
"vue-cropper"
:
"0.5.5"
,
"vue-cropper"
:
"0.5.5"
,
...
@@ -118,7 +119,7 @@
...
@@ -118,7 +119,7 @@
"scriptjs"
:
"^2.5.9"
,
"scriptjs"
:
"^2.5.9"
,
"sortablejs"
:
"^1.10.2"
,
"sortablejs"
:
"^1.10.2"
,
"svg-sprite-loader"
:
"5.1.1"
,
"svg-sprite-loader"
:
"5.1.1"
,
"vue"
:
"2.6.12"
,
"vue"
:
"
^
2.6.12"
,
"vue-append"
:
"^2.2.0"
,
"vue-append"
:
"^2.2.0"
,
"vue-count-to"
:
"1.0.13"
,
"vue-count-to"
:
"1.0.13"
,
"vue-cropper"
:
"0.5.5"
,
"vue-cropper"
:
"0.5.5"
,
...
...
ruoyi-ui/public/exportExcel.js
View file @
c6cf5960
...
@@ -4,6 +4,7 @@ import Excel from 'exceljs';
...
@@ -4,6 +4,7 @@ import Excel from 'exceljs';
import
FileSaver
from
'
file-saver
'
;
import
FileSaver
from
'
file-saver
'
;
const
exportExcel
=
function
(
luckysheet
,
value
,
contrast
,
id
)
{
const
exportExcel
=
function
(
luckysheet
,
value
,
contrast
,
id
)
{
// 函数体
// 函数体
// 参数为luckysheet.getluckysheetfile()获取的对象
// 参数为luckysheet.getluckysheetfile()获取的对象
// 1.创建工作簿,可以为工作簿添加属性
// 1.创建工作簿,可以为工作簿添加属性
...
@@ -23,8 +24,6 @@ const exportExcel = function (luckysheet, value, contrast, id) {
...
@@ -23,8 +24,6 @@ const exportExcel = function (luckysheet, value, contrast, id) {
setMerge
(
merge
,
worksheet
);
setMerge
(
merge
,
worksheet
);
setBorder
(
borderInfo
,
worksheet
);
setBorder
(
borderInfo
,
worksheet
);
if
(
id
===
1248
)
{
if
(
id
===
1248
)
{
worksheet
.
getRow
(
2
).
hidden
=
true
;
worksheet
.
getRow
(
2
).
hidden
=
true
;
worksheet
.
getRow
(
3
).
hidden
=
true
;
worksheet
.
getRow
(
3
).
hidden
=
true
;
worksheet
.
getRow
(
4
).
hidden
=
true
;
worksheet
.
getRow
(
4
).
hidden
=
true
;
...
@@ -131,14 +130,12 @@ var setStyleAndValue = function (cellArr, worksheet, contrast) {
...
@@ -131,14 +130,12 @@ var setStyleAndValue = function (cellArr, worksheet, contrast) {
// style 填入到_value中可以实现填充色
// style 填入到_value中可以实现填充色
let
letter
=
createCellPos
(
columnid
);
let
letter
=
createCellPos
(
columnid
);
let
target
=
worksheet
.
getCell
(
letter
+
(
rowid
+
1
));
let
target
=
worksheet
.
getCell
(
letter
+
(
rowid
+
1
));
if
(
contrast
)
{
if
(
contrast
)
{
const
column
=
worksheet
.
getColumn
(
1
);
const
column
=
worksheet
.
getColumn
(
1
);
const
column2
=
worksheet
.
getColumn
(
2
);
const
column2
=
worksheet
.
getColumn
(
2
);
column
.
hidden
=
true
;
column
.
hidden
=
true
;
column2
.
hidden
=
true
;
column2
.
hidden
=
true
;
}
}
// console.log('1233', letter + (rowid + 1))
for
(
const
key
in
fill
)
{
for
(
const
key
in
fill
)
{
target
.
fill
=
fill
;
target
.
fill
=
fill
;
break
;
break
;
...
...
ruoyi-ui/src/api/Actsupplies/cleaning_rule.js
View file @
c6cf5960
...
@@ -11,8 +11,9 @@ export function selectActSuppliesHistorydata(tylkStatus) {
...
@@ -11,8 +11,9 @@ export function selectActSuppliesHistorydata(tylkStatus) {
//查询通用凭证单表数据
//查询通用凭证单表数据
export
function
selectActSuppliesHistorydataAcc
(
tylkStatus
)
{
export
function
selectActSuppliesHistorydataAcc
(
tylkStatus
)
{
return
request
({
return
request
({
url
:
'
/system/cleaningrule/queryAllAcc/
'
+
tylkStatus
,
url
:
'
/system/cleaningrule/queryAllAcc
'
,
method
:
'
get
'
method
:
'
put
'
,
data
:
tylkStatus
})
})
}
}
...
...
ruoyi-ui/src/conversion/DonghuantuoMine.js
View file @
c6cf5960
export
function
DongMine
(
money
,
code
,
codess
,
CompositeTable
,
Department
,
classify
,
duplicateData
)
{
export
function
DongMine
(
money
,
code
,
codess
,
CompositeTable
,
Department
,
classify
,
duplicateData
)
{
let
result
=
[
'
运输业务
'
]
let
results
=
[
'
10:应付职工薪酬
'
,
'
福利费
'
,
'
自建食堂支付
'
]
//先把运输业务插入到成本材料表中
let
inserts
=
CompositeTable
[
0
].
celldata
.
filter
(
obj
=>
obj
.
v
.
v
==
'
5.其他业务成本
'
)[
0
].
r
;
let
insert
=
CompositeTable
[
0
].
celldata
.
filter
(
obj
=>
obj
.
v
.
v
==
'
9.专项储备
'
)[
0
].
r
for
(
let
i
=
0
,
k
=
0
;
i
<
CompositeTable
[
0
].
celldata
.
length
&&
k
<
results
.
length
;
i
++
)
{
if
(
CompositeTable
[
0
].
celldata
[
i
]?.
r
>=
insert
+
1
&&
CompositeTable
[
0
].
celldata
[
i
]?.
r
<
insert
+
4
&&
CompositeTable
[
0
].
celldata
[
i
]?.
c
==
0
)
{
CompositeTable
[
0
].
celldata
[
i
].
v
=
{
v
:
results
[
k
],
m
:
results
[
k
]
};
k
++
;
}
}
for
(
let
i
=
0
,
k
=
0
;
i
<
CompositeTable
[
0
].
celldata
.
length
&&
k
<
result
.
length
;
i
++
)
{
if
(
CompositeTable
[
0
].
celldata
[
i
]?.
r
>=
inserts
+
1
&&
CompositeTable
[
0
].
celldata
[
i
]?.
r
<
inserts
+
2
&&
CompositeTable
[
0
].
celldata
[
i
]?.
c
==
0
)
{
CompositeTable
[
0
].
celldata
[
i
].
v
=
{
v
:
result
[
k
],
m
:
result
[
k
]
};
k
++
;
}
}
//东欢坨矿转换方法
//东欢坨矿转换方法
//如果部门为旧品和设备 并且他们的材料为支护用品和大型材料就把他们放到基本生产里
//如果部门为旧品和设备 并且他们的材料为支护用品和大型材料就把他们放到基本生产里
//材料编码,金额,部门
//材料编码,金额,部门
...
@@ -9,7 +26,6 @@ export function DongMine(money, code, codess, CompositeTable, Department, classi
...
@@ -9,7 +26,6 @@ export function DongMine(money, code, codess, CompositeTable, Department, classi
item
.
v
.
v
=
item
.
v
.
v
.
replace
(
/单项卡/g
,
''
);
item
.
v
.
v
=
item
.
v
.
v
.
replace
(
/单项卡/g
,
''
);
}
}
});
});
money
.
forEach
((
item
)
=>
{
money
.
forEach
((
item
)
=>
{
item
.
remark
=
''
;
item
.
remark
=
''
;
item
.
code
=
''
;
item
.
code
=
''
;
...
@@ -101,9 +117,11 @@ export function DongMine(money, code, codess, CompositeTable, Department, classi
...
@@ -101,9 +117,11 @@ export function DongMine(money, code, codess, CompositeTable, Department, classi
case
'
选煤
'
:
case
'
选煤
'
:
item
.
r
=
DepartColumns
.
r
+
3
;
item
.
r
=
DepartColumns
.
r
+
3
;
break
;
break
;
case
'
厂区服
务
'
:
case
'
运输业
务
'
:
item
.
r
=
DepartColumns
.
r
+
1
;
item
.
r
=
DepartColumns
.
r
+
1
;
break
;
break
;
case
'
福利费-自建食堂支持
'
:
item
.
r
=
DepartColumns
.
r
+
2
default
:
default
:
// 默认情况
// 默认情况
}
}
...
@@ -112,12 +130,18 @@ export function DongMine(money, code, codess, CompositeTable, Department, classi
...
@@ -112,12 +130,18 @@ export function DongMine(money, code, codess, CompositeTable, Department, classi
}
}
}
}
});
});
// && item.r !==9 && item.c!==8
// 更新金额列
//
//
更新金额列
for
(
let
item
of
money
)
{
for
(
let
item
of
money
)
{
if
(
item
.
r
>
8
&&
item
.
c
<
10
)
{
if
(
item
.
r
>
8
&&
item
.
c
<
10
)
{
item
.
c
=
10
;
item
.
c
=
10
;
}
}
if
(
item
.
cc
==
6
&&
item
.
r
>=
8
&&
item
.
r
<=
11
){
item
.
c
=
item
.
cc
}
if
(
item
.
c
==
9
){
item
.
c
=
10
}
}
}
// 合并重复单元格数据
// 合并重复单元格数据
...
@@ -155,9 +179,9 @@ export function DongMine(money, code, codess, CompositeTable, Department, classi
...
@@ -155,9 +179,9 @@ export function DongMine(money, code, codess, CompositeTable, Department, classi
}
}
}
}
}
}
let
duplicateDatas
=
{
let
duplicateDatas
=
{
duplicateData
:
duplicateData
,
duplicateData
:
duplicateData
,
CompositeTable
:
CompositeTable
CompositeTable
:
CompositeTable
}
}
return
duplicateDatas
return
duplicateDatas
}
}
\ No newline at end of file
ruoyi-ui/src/conversion/LinxiMine.js
View file @
c6cf5960
export
function
Linxi
(
names
,
name
,
Department
,
money
,
code
,
duplicateData
,
CompositeTable
,
codess
,
classify
,
DepartmentColumns
,
codecolumn
)
{
export
function
Linxi
(
names
,
Department
,
money
,
code
,
duplicateData
,
CompositeTable
,
codess
,
classify
,
DepartmentColumns
,
codecolumn
)
{
let
nameColums
=
name
nameColums
=
nameColums
.
flat
().
filter
(
obj
=>
obj
.
v
.
hasOwnProperty
(
'
v
'
));
let
results
=
[
'
加工修理
'
]
let
insert
=
CompositeTable
[
0
].
celldata
.
filter
(
obj
=>
obj
.
v
.
v
==
'
5.其他业务成本
'
)[
0
].
r
for
(
let
i
=
0
,
k
=
0
;
i
<
CompositeTable
[
0
].
celldata
.
length
&&
k
<
results
.
length
;
i
++
)
{
if
(
CompositeTable
[
0
].
celldata
[
i
]
&&
CompositeTable
[
0
].
celldata
[
i
].
r
&&
CompositeTable
[
0
].
celldata
[
i
].
r
>=
insert
+
2
&&
CompositeTable
[
0
].
celldata
[
i
].
r
<
insert
+
4
&&
CompositeTable
[
0
].
celldata
[
i
].
c
==
0
)
{
CompositeTable
[
0
].
celldata
[
i
].
v
.
v
=
results
[
k
];
CompositeTable
[
0
].
celldata
[
i
].
v
.
m
=
results
[
k
];
k
++
;
}
}
let
name1
=
Department
let
name1
=
Department
// code 编码 name1部门名称 money金额 name1 部门名称
// code 编码 name1部门名称 money金额 name1 部门名称
// 清空属性
// 清空属性
...
@@ -12,7 +20,7 @@ export function Linxi(names,name, Department, money,code, duplicateData, Composi
...
@@ -12,7 +20,7 @@ export function Linxi(names,name, Department, money,code, duplicateData, Composi
entry
.
index
=
entry
.
r
entry
.
index
=
entry
.
r
});
});
// 合并数组
// 合并数组
let
newobj
=
[...
name1
,
...
nameColums
,
...
code
];
let
newobj
=
[...
name1
,
...
code
];
// 匹配赋值
// 匹配赋值
money
.
forEach
(
m
=>
{
money
.
forEach
(
m
=>
{
newobj
.
forEach
(
a
=>
{
newobj
.
forEach
(
a
=>
{
...
@@ -115,7 +123,7 @@ export function Linxi(names,name, Department, money,code, duplicateData, Composi
...
@@ -115,7 +123,7 @@ export function Linxi(names,name, Department, money,code, duplicateData, Composi
item
.
r
=
DepartColumns
.
r
+
1
;
item
.
r
=
DepartColumns
.
r
+
1
;
break
;
break
;
case
'
加工修理
'
:
case
'
加工修理
'
:
item
.
r
=
DepartColumns
.
r
+
4
;
item
.
r
=
DepartColumns
.
r
+
2
;
break
;
break
;
default
:
default
:
// 默认情况
// 默认情况
...
...
ruoyi-ui/src/conversion/MoneyMine.js
0 → 100644
View file @
c6cf5960
export
function
MoneyMine
(
money
,
DepartmentColumns
,
name
,
materianame
,
c
,
CompositeTable
,
headRow
)
{
let
results
=
[
'
运输业务
'
]
//先把安全费用 研发什么的插入到成本材料表中
let
insert
=
CompositeTable
[
0
].
celldata
.
filter
(
obj
=>
obj
.
v
.
v
==
'
5.其他业务成本
'
)[
0
].
r
for
(
let
i
=
0
,
k
=
0
;
i
<
CompositeTable
[
0
].
celldata
.
length
&&
k
<
results
.
length
;
i
++
)
{
if
(
CompositeTable
[
0
].
celldata
[
i
]
&&
CompositeTable
[
0
].
celldata
[
i
].
r
&&
CompositeTable
[
0
].
celldata
[
i
].
r
>=
insert
+
2
&&
CompositeTable
[
0
].
celldata
[
i
].
r
<
insert
+
4
&&
CompositeTable
[
0
].
celldata
[
i
].
c
==
0
)
{
CompositeTable
[
0
].
celldata
[
i
].
v
.
v
=
results
[
k
];
CompositeTable
[
0
].
celldata
[
i
].
v
.
m
=
results
[
k
];
k
++
;
}
}
//部门 因为部门再第0列 所以条件 obj.c不满足 需要单独写出来
let
Department
=
c
.
flat
().
filter
(
obj
=>
obj
.
c
!==
undefined
&&
obj
.
c
==
DepartmentColumns
&&
obj
.
r
>
headRow
)
//表头行数据
let
remarkColumns
=
c
.
flat
().
filter
(
obj
=>
obj
.
r
!==
undefined
&&
obj
.
r
==
headRow
)
//最后一列
let
remark
=
c
.
flat
().
filter
(
obj
=>
obj
.
c
&&
obj
.
c
==
remarkColumns
.
length
&&
obj
.
r
>
headRow
)
money
.
forEach
(
item
=>
{
item
.
v
.
name
=
''
item
.
index
=
item
.
r
,
item
.
v
.
remark
=
''
,
item
.
materianame
=
''
item
.
Department
=
''
item
.
matching
=
false
});
for
(
let
i
=
0
;
i
<
money
.
length
;
i
++
)
{
if
(
money
[
i
].
r
==
Department
[
i
].
r
)
{
money
[
i
].
Department
=
Department
[
i
].
v
.
v
;
}
if
(
money
[
i
].
r
==
name
[
i
].
r
)
{
money
[
i
].
v
.
name
=
name
[
i
].
v
.
v
;
}
if
(
money
[
i
].
r
==
materianame
[
i
].
r
)
{
money
[
i
].
materianame
=
materianame
[
i
].
v
.
v
;
}
if
(
money
[
i
].
r
==
remark
[
i
].
r
)
{
money
[
i
].
v
.
remark
=
remark
[
i
].
v
.
v
;
}
}
let
classify
=
[
{
remark
:
'
坑木
'
,
name
:
'
支-生产-大型材料,支-生产-一般材料
'
,
r
:
5
,
c
:
1
},
{
remark
:
'
坑代
'
,
name
:
'
支-生产-大型材料,支-生产-一般材料
'
,
r
:
5
,
c
:
2
},
{
remark
:
'
国配,综配
'
,
name
:
'
支-生产-大型材料,支-生产-一般材料
'
,
r
:
5
,
c
:
3
},
{
remark
:
'
工具
'
,
name
:
'
支-生产-大型材料,支-生产-一般材料
'
,
r
:
5
,
c
:
4
},
{
remark
:
'
劳保
'
,
name
:
'
支-生产-大型材料,支-生产-一般材料
'
,
r
:
5
,
c
:
6
},
{
remark
:
'
建材
'
,
name
:
'
支-生产-大型材料,支-生产-一般材料
'
,
r
:
5
,
c
:
7
},
{
remark
:
'
化工
'
,
name
:
'
支-生产-大型材料,支-生产-一般材料
'
,
r
:
5
,
c
:
8
},
]
let
SectorPlant
=
[{
Department
:
'
洗煤厂
'
,
remark
:
'
国配,综配
'
,
r
:
6
,
c
:
4
},
{
Department
:
'
洗煤厂
'
,
remark
:
'
化工
'
,
r
:
6
,
c
:
8
},]
let
organ
=
[
{
Department
:
'
机关
'
,
r
:
12
,
c
:
10
},
{
materianame
:
'
钢丝绳,轻轨,电缆,运输带,钢管
'
,
r
:
5
,
c
:
3
},
{
Department
:
'
煤制科
'
,
materianame
:
'
柴油,汽油
'
,
r
:
16
,
c
:
10
},
]
let
coal
=
[{
Department
:
'
洗煤厂
'
,
remark
:
'
国配,综配,化工
'
,
r
:
6
,
c
:
10
}]
money
.
forEach
(
item
=>
{
item
.
v
.
v
=
Math
.
abs
(
item
.
v
.
v
);
item
.
v
.
m
=
Math
.
abs
(
item
.
v
.
v
);
classify
.
forEach
(
obj
=>
{
const
classifyNames
=
obj
.
name
.
includes
(
'
,
'
)
?
obj
.
name
.
split
(
'
,
'
).
map
(
value
=>
value
.
trim
())
:
[
obj
.
name
.
trim
()];
// 含有逗号时分割,不含逗号时直接 trim
const
classifyRemarks
=
obj
.
remark
.
trim
().
includes
(
'
,
'
)
?
obj
.
remark
.
split
(
'
,
'
).
map
(
value
=>
value
.
trim
())
:
[
obj
.
remark
.
trim
()];
if
(
classifyNames
.
some
(
nameValue
=>
{
const
itemNames
=
item
.
v
.
name
.
includes
(
'
,
'
)
?
item
.
v
.
name
.
split
(
'
,
'
).
map
(
value
=>
value
.
trim
())
:
[
item
.
v
.
name
.
trim
()]
return
itemNames
.
includes
(
nameValue
);
})
&&
classifyRemarks
.
some
(
remarkValue
=>
{
const
itemRemarks
=
item
.
v
.
remark
.
trim
().
includes
(
'
,
'
)
?
item
.
v
.
remark
.
split
(
'
,
'
).
map
(
value
=>
value
.
trim
())
:
[
item
.
v
.
remark
.
trim
()];
return
itemRemarks
.
includes
(
remarkValue
)
}))
{
item
.
r
=
obj
.
r
;
item
.
c
=
obj
.
c
;
item
.
matching
=
true
}
});
SectorPlant
.
forEach
(
obj
=>
{
const
classifyNames
=
obj
.
Department
.
includes
(
'
,
'
)
?
obj
.
Department
.
split
(
'
,
'
).
map
(
value
=>
value
.
trim
())
:
[
obj
.
Department
.
trim
()];
// 含有逗号时分割,不含逗号时直接 trim
const
classifyRemarks
=
obj
.
remark
.
trim
().
includes
(
'
,
'
)
?
obj
.
remark
.
split
(
'
,
'
).
map
(
value
=>
value
.
trim
())
:
[
obj
.
remark
.
trim
()];
if
(
classifyNames
.
some
(
nameValue
=>
{
const
itemNames
=
item
.
Department
.
includes
(
'
,
'
)
?
item
.
Department
.
split
(
'
,
'
).
map
(
value
=>
value
.
trim
())
:
[
item
.
Department
.
trim
()]
return
itemNames
.
includes
(
nameValue
);
})
&&
classifyRemarks
.
some
(
remarkValue
=>
{
const
itemRemarks
=
item
.
v
.
remark
.
trim
().
includes
(
'
,
'
)
?
item
.
v
.
remark
.
split
(
'
,
'
).
map
(
value
=>
value
.
trim
())
:
[
item
.
v
.
remark
.
trim
()];
return
itemRemarks
.
includes
(
remarkValue
)
}))
{
item
.
r
=
obj
.
r
;
item
.
c
=
obj
.
c
;
item
.
matching
=
true
}
});
organ
.
forEach
(
obj
=>
{
const
checkDepartment
=
obj
.
Department
&&
(
obj
.
Department
.
includes
(
'
,
'
)
?
obj
.
Department
.
split
(
'
,
'
).
map
(
value
=>
value
.
trim
())
:
[
obj
.
Department
.
trim
()]);
const
checkMaterianame
=
obj
.
materianame
&&
(
obj
.
materianame
.
includes
(
'
,
'
)
?
obj
.
materianame
.
split
(
'
,
'
).
map
(
value
=>
value
.
trim
())
:
[
obj
.
materianame
.
trim
()]);
if
((
checkDepartment
&&
checkDepartment
.
some
(
nameValue
=>
item
.
Department
.
includes
(
nameValue
)))
||
(
checkMaterianame
&&
checkMaterianame
.
some
(
remarkValue
=>
item
.
materianame
.
includes
(
remarkValue
))))
{
item
.
r
=
obj
.
r
;
item
.
c
=
obj
.
c
;
item
.
matching
=
true
}
});
coal
.
forEach
(
obj
=>
{
const
classifyNames
=
obj
.
Department
.
includes
(
'
,
'
)
?
obj
.
Department
.
split
(
'
,
'
).
map
(
value
=>
value
.
trim
())
:
[
obj
.
Department
.
trim
()];
// 含有逗号时分割,不含逗号时直接 trim
const
classifyRemarks
=
obj
.
remark
.
trim
().
includes
(
'
,
'
)
?
obj
.
remark
.
split
(
'
,
'
).
map
(
value
=>
value
.
trim
())
:
[
obj
.
remark
.
trim
()];
if
(
classifyNames
.
some
(
nameValue
=>
{
const
itemNames
=
item
.
Department
.
includes
(
'
,
'
)
?
item
.
Department
.
split
(
'
,
'
).
map
(
value
=>
value
.
trim
())
:
[
item
.
Department
.
trim
()]
return
itemNames
.
includes
(
nameValue
);
})
&&
classifyRemarks
.
every
(
remarkValue
=>
{
const
itemRemarks
=
item
.
v
.
remark
.
trim
().
includes
(
'
,
'
)
?
item
.
v
.
remark
.
split
(
'
,
'
).
map
(
value
=>
value
.
trim
())
:
[
item
.
v
.
remark
.
trim
()];
return
itemRemarks
.
every
(
itemRemark
=>
itemRemark
!==
remarkValue
);
}))
{
item
.
r
=
obj
.
r
;
item
.
c
=
obj
.
c
;
item
.
matching
=
true
}
});
if
(
!
item
.
matching
)
{
item
.
r
=
5
item
.
c
=
10
}
});
let
duplicateData
=
[];
let
seen
=
new
Map
();
// 根据行列信息合并重复数据并记录索引
for
(
let
obj
of
money
)
{
let
key
=
obj
.
r
+
'
,
'
+
obj
.
c
;
if
(
seen
.
has
(
key
))
{
let
existingObj
=
seen
.
get
(
key
);
existingObj
.
v
.
v
+=
obj
.
v
.
v
;
existingObj
.
v
.
m
=
(
parseInt
(
existingObj
.
v
.
m
)
+
parseInt
(
obj
.
v
.
m
)).
toString
();
existingObj
.
index
.
push
(
obj
.
index
);
}
else
{
obj
.
index
=
[
obj
.
index
];
seen
.
set
(
key
,
obj
);
}
}
// 将合并后的数据放入 duplicateData 数组
for
(
let
obj
of
seen
.
values
())
{
if
(
obj
.
v
.
v
>
0
||
parseInt
(
obj
.
v
.
m
)
>
0
)
{
duplicateData
.
push
(
obj
);
}
}
duplicateData
=
duplicateData
.
map
(
item
=>
{
return
{
...
item
,
v
:
{
...
item
.
v
,
v
:
isNaN
(
item
.
v
.
v
)
?
item
.
v
.
v
:
Number
(
item
.
v
.
v
).
toFixed
(
2
)
}
};
});
// 替换金额所在列和行相同的模板表中的数据
//金额所在列和行,去模板表中查找,如果行列一致则替换
for
(
let
i
=
0
;
i
<
duplicateData
.
length
;
i
++
)
{
// // 对比 c 和 r 是否与 CompositeTable[0]["celldata"] 中相应对象相同
for
(
let
k
=
0
;
k
<
CompositeTable
[
0
][
"
celldata
"
].
length
;
k
++
)
{
if
(
duplicateData
[
i
].
r
===
CompositeTable
[
0
][
"
celldata
"
][
k
].
r
&&
duplicateData
[
i
].
c
===
CompositeTable
[
0
][
"
celldata
"
][
k
].
c
)
{
// 如果相同,则进行替换
CompositeTable
[
0
][
"
celldata
"
][
k
]
=
duplicateData
[
i
];
}
}
}
let
duplic
=
{
duplicateData
:
duplicateData
,
CompositeTable
:
CompositeTable
}
return
duplic
}
\ No newline at end of file
ruoyi-ui/src/conversion/TangshanMine copy.js
0 → 100644
View file @
c6cf5960
export
function
Tangshan
(
money
,
c
,
name
,
CompositeTable
,
headRow
)
{
//money 总金额 c导入表所有数据,name 来源类别,CompositeTable 材料汇总表数据, headRow 数据行
let
results
=
[
'
金属厂
'
]
let
insert
=
CompositeTable
[
0
].
celldata
.
filter
(
obj
=>
obj
.
v
.
v
==
'
7.代付单位(XXX单位)
'
)[
0
].
r
for
(
let
i
=
0
,
k
=
0
;
i
<
CompositeTable
[
0
].
celldata
.
length
&&
k
<
results
.
length
;
i
++
)
{
if
(
CompositeTable
[
0
].
celldata
[
i
]
&&
CompositeTable
[
0
].
celldata
[
i
].
r
&&
CompositeTable
[
0
].
celldata
[
i
].
r
>=
insert
+
1
&&
CompositeTable
[
0
].
celldata
[
i
].
r
<
insert
+
4
&&
CompositeTable
[
0
].
celldata
[
i
].
c
==
0
)
{
CompositeTable
[
0
].
celldata
[
i
].
v
.
v
=
results
[
k
];
CompositeTable
[
0
].
celldata
[
i
].
v
.
m
=
results
[
k
];
k
++
;
}
}
function
findValueInArray
(
arr
,
value
)
{
for
(
let
obj
of
arr
)
{
if
(
JSON
.
stringify
(
obj
).
includes
(
value
))
{
return
obj
;
}
}
return
null
;
}
let
targetValue
=
"
器材大类
"
;
let
resultObject
=
findValueInArray
(
c
,
targetValue
);
let
material
=
c
.
flat
().
filter
(
obj
=>
obj
.
c
&&
obj
.
c
==
resultObject
.
c
&&
obj
.
r
>
headRow
)
money
.
forEach
(
entry
=>
{
entry
.
department
=
''
;
entry
.
v
.
name
=
''
;
entry
.
v
.
material
=
''
;
entry
.
index
=
entry
.
r
});
// 匹配赋值
for
(
let
i
=
0
;
i
<
money
.
length
;
i
++
)
{
if
(
money
[
i
].
r
==
name
[
i
].
r
)
{
money
[
i
].
v
.
name
=
name
[
i
].
v
.
v
;
}
if
(
money
[
i
].
r
==
material
[
i
].
r
)
{
money
[
i
].
v
.
material
=
material
[
i
].
v
.
v
;
}
}
//对费用来源列和材料分类列进行处理
money
.
forEach
(
obj
=>
{
if
(
!
obj
.
v
.
material
)
{
obj
.
v
.
material
=
'
其他材料
'
}
if
(
obj
.
v
.
name
==
'
基本生产
'
||
obj
.
v
.
name
==
'
制造费用
'
)
{
obj
.
v
.
name
+=
'
-原煤
'
}
if
(
obj
.
v
.
name
.
includes
(
'
洗煤
'
))
{
obj
.
v
.
name
=
'
基本生产-洗煤
'
}
if
(
obj
.
v
.
name
==
'
其他业务成本
'
)
{
obj
.
v
.
name
+=
'
-厂区服务
'
}
if
(
obj
.
v
.
name
==
'
其他费用
'
)
{
obj
.
v
.
name
=
'
代付单位(XXX单位)-金属厂
'
}
// 如果不包含连字符,就在末尾添加一个连字符
if
(
obj
.
v
.
name
.
indexOf
(
'
-
'
)
===
-
1
)
{
obj
.
v
.
name
+=
'
-
'
;
}
})
//材料分类列和汇总列数值一样的话,列数就一样
money
.
forEach
(
obj
=>
{
CompositeTable
[
0
].
celldata
.
forEach
(
cell
=>
{
if
(
obj
.
v
.
material
==
cell
.
v
.
v
)
{
obj
.
c
=
cell
.
c
}
})
})
money
.
forEach
(
item
=>
{
if
(
item
.
v
.
name
!==
undefined
)
{
let
index
=
item
.
v
.
name
.
indexOf
(
"
-
"
);
if
(
index
!==
-
1
)
{
let
substrBeforeDash
=
item
.
v
.
name
.
slice
(
0
,
index
);
let
DepartColumns
=
CompositeTable
[
0
][
"
celldata
"
].
flat
().
filter
(
obj
=>
{
if
(
obj
.
v
&&
obj
.
v
.
v
&&
typeof
obj
.
v
.
v
===
'
string
'
)
{
return
obj
.
v
.
v
.
includes
(
item
.
v
.
name
.
slice
(
0
,
index
));
}
return
false
;
})[
0
];
if
(
DepartColumns
&&
DepartColumns
.
r
)
{
let
index
=
item
.
v
.
name
.
indexOf
(
"
-
"
);
if
(
index
!==
-
1
)
{
let
substrAfterDash
=
item
.
v
.
name
.
slice
(
index
+
1
);
switch
(
substrAfterDash
)
{
case
''
:
item
.
r
=
DepartColumns
.
r
;
break
;
case
'
原煤
'
:
item
.
r
=
DepartColumns
.
r
+
1
;
break
;
case
'
洗煤
'
:
item
.
r
=
DepartColumns
.
r
+
2
;
break
;
case
'
选煤
'
:
item
.
r
=
DepartColumns
.
r
+
3
;
break
;
case
'
厂区服务
'
:
item
.
r
=
DepartColumns
.
r
+
1
;
break
;
case
'
加工修理
'
:
item
.
r
=
DepartColumns
.
r
+
4
;
break
;
case
'
金属厂
'
:
item
.
r
=
DepartColumns
.
r
+
1
default
:
// 默认情况
}
}
}
}
}
});
// 同一个单元格,金额相加
let
seen
=
new
Map
();
let
duplicateData
=
[]
money
.
forEach
((
obj
)
=>
{
let
key
=
obj
.
r
+
'
,
'
+
obj
.
c
;
if
(
seen
.
has
(
key
))
{
let
existingObj
=
seen
.
get
(
key
);
existingObj
.
v
.
v
=
Number
(
existingObj
.
v
.
v
)
+
Number
(
obj
.
v
.
v
);
existingObj
.
v
.
m
=
existingObj
.
v
.
v
.
toString
();
existingObj
.
index
.
push
(
obj
.
index
);
}
else
{
obj
.
index
=
[
obj
.
index
];
seen
.
set
(
key
,
obj
);
}
});
seen
.
forEach
(
obj
=>
{
if
(
obj
.
v
.
v
>
0
||
parseInt
(
obj
.
v
.
m
)
>
0
)
{
duplicateData
.
push
(
obj
);
}
});
duplicateData
=
duplicateData
.
map
(
item
=>
{
return
{
...
item
,
v
:
{
...
item
.
v
,
v
:
isNaN
(
item
.
v
.
v
)
?
item
.
v
.
v
:
Number
(
item
.
v
.
v
).
toFixed
(
2
),
m
:
Number
(
item
.
v
.
m
).
toFixed
(
2
)
}
};
});
for
(
let
i
=
0
;
i
<
duplicateData
.
length
;
i
++
)
{
// // 对比 c 和 r 是否与 CompositeTable[0]["celldata"] 中相应对象相同
for
(
let
k
=
0
;
k
<
CompositeTable
[
0
][
"
celldata
"
].
length
;
k
++
)
{
if
(
duplicateData
[
i
].
r
===
CompositeTable
[
0
][
"
celldata
"
][
k
].
r
&&
duplicateData
[
i
].
c
===
CompositeTable
[
0
][
"
celldata
"
][
k
].
c
)
{
// 如果相同,则进行替换
CompositeTable
[
0
][
"
celldata
"
][
k
]
=
duplicateData
[
i
];
}
}
}
duplicateData
.
forEach
(
obj
=>
{
if
(
obj
.
r
>
8
){
obj
.
c
=
10
}
})
let
duplicateDatas
=
{
duplicateData
:
duplicateData
,
CompositeTable
:
CompositeTable
}
return
duplicateDatas
}
\ No newline at end of file
ruoyi-ui/src/conversion/conversion.js
View file @
c6cf5960
import
{
selectActSuppliesHistorydataAcc
}
from
"
@/api/Actsupplies/cleaning_rule
"
;
import
{
selectActSuppliesHistorydataAcc
}
from
"
@/api/Actsupplies/cleaning_rule
"
;
import
{
Tangshan
}
from
"
@/conversion/TangshanMine
"
;
// import { Tangshan } from "@/conversion/TangshanMine";
import
{
Tangshan
}
from
"
@/conversion/TangshanMine copy
"
;
import
{
Linxi
}
from
"
@/conversion/LinxiMine
"
;
import
{
Linxi
}
from
"
@/conversion/LinxiMine
"
;
import
{
lvMine
}
from
"
@/conversion/lvMine
"
;
import
{
lvMine
}
from
"
@/conversion/lvMine
"
;
import
{
fanMine
}
from
"
@/conversion/fanMine
"
;
import
{
fanMine
}
from
"
@/conversion/fanMine
"
;
import
{
DongMine
}
from
"
@/conversion/DonghuantuoMine
"
;
import
{
DongMine
}
from
"
@/conversion/DonghuantuoMine
"
;
import
{
danMine
}
from
"
@/conversion/danhouMine
"
;
import
{
danMine
}
from
"
@/conversion/danhouMine
"
;
import
{
hongMine
}
from
"
@/conversion/hongMine
"
;
import
{
hongMine
}
from
"
@/conversion/hongMine
"
;
import
{
MoneyMine
}
from
"
@/conversion/MoneyMine
"
;
import
{
getSuppliesTemplate
,
listSuppliesTemplate
,
roleList
,
materialListPZ
,
accountingcode
,
department
,
roleListid
,
}
from
"
@/api/ruoyi-myLuckyexcel/myluckyexcel
"
;
import
{
getSuppliesTemplate
,
listSuppliesTemplate
,
roleList
,
materialListPZ
,
accountingcode
,
department
,
roleListid
,
}
from
"
@/api/ruoyi-myLuckyexcel/myluckyexcel
"
;
import
{
addInsert
,
addInsertAccount1
,
addInsertAccount2
}
from
"
@/api/system/historydata
"
import
{
addInsert
,
addInsertAccount1
,
addInsertAccount2
}
from
"
@/api/system/historydata
"
/*import luckysheet from 'luckysheet'*/
/*import luckysheet from 'luckysheet'*/
...
@@ -14,6 +16,7 @@ import LuckyExcel from 'luckyexcel'
...
@@ -14,6 +16,7 @@ import LuckyExcel from 'luckyexcel'
/*import {materialList} from "@/api/ruoyi-myLuckyexcel/myluckyexcel";*/
/*import {materialList} from "@/api/ruoyi-myLuckyexcel/myluckyexcel";*/
import
{
exportExcel
}
from
'
../../public/exportExcel
'
;
import
{
exportExcel
}
from
'
../../public/exportExcel
'
;
import
{
v4
as
uuidv4
}
from
'
uuid
'
;
import
{
v4
as
uuidv4
}
from
'
uuid
'
;
import
{
min
}
from
"
moment/moment
"
;
var
fileName
=
"
新建XLSX工作表
"
;
//定义表名
var
fileName
=
"
新建XLSX工作表
"
;
//定义表名
var
rule
=
[];
var
rule
=
[];
var
tempId
;
var
tempId
;
...
@@ -273,7 +276,7 @@ export default {
...
@@ -273,7 +276,7 @@ export default {
});
});
},
},
open4
()
{
open4
()
{
this
.
$message
.
error
(
'
找不到部门名称或者结算金额和材料编码列,请改为正确名称
'
);
this
.
$message
.
error
(
'
请仔细检查所导入表
'
);
},
},
/** 规则下拉选 调佣后端的方法*/
/** 规则下拉选 调佣后端的方法*/
handleRuleChange
(
value
)
{
handleRuleChange
(
value
)
{
...
@@ -482,6 +485,9 @@ export default {
...
@@ -482,6 +485,9 @@ export default {
//类别名称
//类别名称
let
names
=
this
.
cleaning
[
0
].
sourceColoumn
?
this
.
cleaning
[
0
].
sourceColoumn
-
1
:
null
;
let
names
=
this
.
cleaning
[
0
].
sourceColoumn
?
this
.
cleaning
[
0
].
sourceColoumn
-
1
:
null
;
let
name
=
names
?
c
.
flat
().
filter
(
obj
=>
obj
.
c
&&
obj
.
c
===
names
&&
obj
.
r
>
headRow
)
:
null
;
let
name
=
names
?
c
.
flat
().
filter
(
obj
=>
obj
.
c
&&
obj
.
c
===
names
&&
obj
.
r
>
headRow
)
:
null
;
//材料名称所在列
let
materias
=
this
.
cleaning
[
0
].
NameColumn
-
1
let
materianame
=
c
.
flat
().
filter
(
obj
=>
obj
.
c
&&
obj
.
c
===
materias
&&
obj
.
r
>
headRow
)
//数量所在列
//数量所在列
let
numbercolumn
=
this
.
cleaning
[
0
].
NumberColumn
-
1
let
numbercolumn
=
this
.
cleaning
[
0
].
NumberColumn
-
1
let
number
=
c
.
flat
().
filter
(
obj
=>
obj
.
c
&&
obj
.
c
===
numbercolumn
&&
obj
.
r
>
headRow
)
let
number
=
c
.
flat
().
filter
(
obj
=>
obj
.
c
&&
obj
.
c
===
numbercolumn
&&
obj
.
r
>
headRow
)
...
@@ -489,25 +495,24 @@ export default {
...
@@ -489,25 +495,24 @@ export default {
let
MoneyColumn
=
this
.
cleaning
[
0
].
MoneyColumn
-
1
let
MoneyColumn
=
this
.
cleaning
[
0
].
MoneyColumn
-
1
let
moneys
=
c
.
flat
().
filter
(
obj
=>
obj
.
c
&&
obj
.
c
===
MoneyColumn
&&
obj
.
r
>
headRow
)
let
moneys
=
c
.
flat
().
filter
(
obj
=>
obj
.
c
&&
obj
.
c
===
MoneyColumn
&&
obj
.
r
>
headRow
)
//算总额
//算总额
let
money
=
[]
let
money
=
[];
number
.
forEach
((
n
,
index
)
=>
{
number
.
forEach
((
n
,
index
)
=>
{
if
(
n
.
r
===
moneys
[
index
].
r
)
{
if
(
n
.
r
===
moneys
[
index
].
r
)
{
moneys
[
index
].
v
.
v
=
(
moneys
[
index
].
v
.
v
*
n
.
v
.
v
).
toFixed
(
2
)
moneys
[
index
].
v
.
v
=
(
moneys
[
index
].
v
.
v
*
n
.
v
.
v
).
toFixed
(
2
)
money
.
push
(
moneys
[
index
])
money
.
push
(
moneys
[
index
])
}
}
})
})
// 唐山矿转换方法
// 唐山矿转换方法
//没任何规则
//没任何规则
let
duplicateData
=
[]
let
duplicateData
=
[]
if
(
this
.
mining
==
'
010101
'
)
{
if
(
this
.
mining
==
'
010101
'
)
{
// Tangshan(money, code, codess, CompositeTable, Department, classify, headRow, duplicateData)
const
duplicateDatas
=
Tangshan
(
money
,
c
,
name
,
CompositeTable
,
headRow
)
const
duplicateDatas
=
Tangshan
(
money
,
code
,
codess
,
CompositeTable
,
Department
,
classify
,
headRow
)
duplicateData
=
duplicateDatas
.
duplicateData
duplicateData
=
duplicateDatas
.
duplicateData
CompositeTable
=
duplicateDatas
.
CompositeTable
CompositeTable
=
duplicateDatas
.
CompositeTable
}
}
if
(
this
.
mining
==
'
011704
'
)
{
if
(
this
.
mining
==
'
011704
'
)
{
const
duplicateDatas
=
Linxi
(
names
,
name
,
Department
,
money
,
code
,
duplicateData
,
CompositeTable
,
codess
,
classify
,
DepartmentColumns
,
codecolumn
)
const
duplicateDatas
=
Linxi
(
names
,
Department
,
money
,
code
,
duplicateData
,
CompositeTable
,
codess
,
classify
,
DepartmentColumns
,
codecolumn
)
duplicateData
=
duplicateDatas
.
duplicateData
duplicateData
=
duplicateDatas
.
duplicateData
CompositeTable
=
duplicateDatas
.
CompositeTable
CompositeTable
=
duplicateDatas
.
CompositeTable
}
}
...
@@ -517,9 +522,10 @@ export default {
...
@@ -517,9 +522,10 @@ export default {
CompositeTable
=
duplicateDatas
.
CompositeTable
CompositeTable
=
duplicateDatas
.
CompositeTable
}
}
if
(
this
.
mining
==
'
011204
'
)
{
if
(
this
.
mining
==
'
011204
'
)
{
const
duplicateDatas
=
danMine
(
this
.
newArray
,
c
,
Department
,
money
,
code
,
classify
,
codess
)
const
duplicateDatas
=
danMine
(
this
.
newArray
,
c
,
Department
,
money
,
code
,
classify
,
codess
,
name
,
headRow
)
duplicateData
=
duplicateDatas
.
duplicateData
duplicateData
=
duplicateDatas
.
duplicateData
CompositeTable
=
duplicateDatas
.
CompositeTable
CompositeTable
=
duplicateDatas
.
CompositeTable
}
}
if
(
this
.
mining
==
'
011702
'
)
{
if
(
this
.
mining
==
'
011702
'
)
{
const
duplicateDatas
=
lvMine
(
CompositeTable
,
cjson
,
codess
)
const
duplicateDatas
=
lvMine
(
CompositeTable
,
cjson
,
codess
)
...
@@ -532,10 +538,17 @@ export default {
...
@@ -532,10 +538,17 @@ export default {
CompositeTable
=
duplicateDatas
.
CompositeTable
CompositeTable
=
duplicateDatas
.
CompositeTable
}
}
if
(
this
.
mining
==
'
011502
'
)
{
if
(
this
.
mining
==
'
011502
'
)
{
let
MoneyColumn
=
c
.
filter
(
item
=>
item
.
v
&&
(
typeof
item
.
v
.
v
===
'
string
'
&&
item
.
v
.
v
.
includes
(
'
金额
'
)
||
typeof
item
.
v
.
m
===
'
string
'
&&
item
.
v
.
m
.
includes
(
'
金额
'
)))[
0
].
c
;
let
money
=
c
.
flat
().
filter
(
obj
=>
obj
.
c
&&
obj
.
c
===
MoneyColumn
&&
obj
.
r
>
headRow
)
const
duplicateDatas
=
hongMine
(
money
,
Department
,
code
,
name
,
codess
,
this
.
newArrayhong
)
const
duplicateDatas
=
hongMine
(
money
,
Department
,
code
,
name
,
codess
,
this
.
newArrayhong
)
duplicateData
=
duplicateDatas
.
duplicateData
duplicateData
=
duplicateDatas
.
duplicateData
CompositeTable
=
duplicateDatas
.
CompositeTable
CompositeTable
=
duplicateDatas
.
CompositeTable
}
}
if
(
this
.
mining
==
'
010105
'
)
{
const
duplicateDatas
=
MoneyMine
(
money
,
DepartmentColumns
,
name
,
materianame
,
c
,
CompositeTable
,
headRow
)
duplicateData
=
duplicateDatas
.
duplicateData
CompositeTable
=
duplicateDatas
.
CompositeTable
}
// celldata => data 生成表格所需二维数组
// celldata => data 生成表格所需二维数组
CompositeTable
[
0
].
data
=
luckysheet
.
transToData
(
CompositeTable
[
0
][
"
celldata
"
])
CompositeTable
[
0
].
data
=
luckysheet
.
transToData
(
CompositeTable
[
0
][
"
celldata
"
])
if
(
!
(
this
.
value
.
includes
(
'
凭证
'
)))
{
if
(
!
(
this
.
value
.
includes
(
'
凭证
'
)))
{
...
@@ -554,10 +567,10 @@ export default {
...
@@ -554,10 +567,10 @@ export default {
this
.
generate
.
historyContent
=
JSON
.
stringify
(
CompositeTable
)
this
.
generate
.
historyContent
=
JSON
.
stringify
(
CompositeTable
)
//往后台传科目编码相关的东西
//往后台传科目编码相关的东西
let
matchedItems
=
CompositeTable
[
0
][
"
celldata
"
].
filter
(
item
=>
item
.
v
&&
(
typeof
item
.
v
.
v
===
'
string
'
&&
item
.
v
.
v
.
includes
(
'
其他材料
'
)
||
typeof
item
.
v
.
m
===
'
string
'
&&
item
.
v
.
m
.
includes
(
'
其他材料
'
)))[
0
].
r
;
let
matchedItems
=
CompositeTable
[
0
][
"
celldata
"
].
filter
(
item
=>
item
.
v
&&
(
typeof
item
.
v
.
v
===
'
string
'
&&
item
.
v
.
v
.
includes
(
'
其他材料
'
)
||
typeof
item
.
v
.
m
===
'
string
'
&&
item
.
v
.
m
.
includes
(
'
其他材料
'
)))[
0
].
r
;
let
material
=
CompositeTable
[
0
][
"
celldata
"
].
flat
().
filter
(
obj
=>
obj
.
r
&&
obj
.
r
===
matchedItems
)
let
material
=
CompositeTable
[
0
][
"
celldata
"
].
flat
().
filter
(
obj
=>
obj
.
r
&&
obj
.
r
===
matchedItems
)
duplicateData
.
forEach
(
obj
=>
{
duplicateData
.
forEach
(
obj
=>
{
material
.
forEach
(
cell
=>
{
material
.
forEach
(
cell
=>
{
if
(
obj
.
c
===
cell
.
c
)
{
if
(
obj
.
c
===
cell
.
c
)
{
obj
.
v
.
material
=
cell
.
v
.
v
;
obj
.
v
.
material
=
cell
.
v
.
v
;
}
}
});
});
...
@@ -595,6 +608,7 @@ export default {
...
@@ -595,6 +608,7 @@ export default {
sum
.
forEach
(
item
=>
{
sum
.
forEach
(
item
=>
{
item
.
v
=
Number
(
item
.
v
).
toFixed
(
2
);
item
.
v
=
Number
(
item
.
v
).
toFixed
(
2
);
});
});
sum
=
sum
.
filter
(
item
=>
item
.
v
!==
"
0.00
"
);
const
VoucherForm
=
JSON
.
parse
(
this
.
VoucherForm
);
const
VoucherForm
=
JSON
.
parse
(
this
.
VoucherForm
);
const
filteredData
=
VoucherForm
[
0
].
celldata
.
filter
(
obj
=>
obj
.
r
===
5
);
const
filteredData
=
VoucherForm
[
0
].
celldata
.
filter
(
obj
=>
obj
.
r
===
5
);
...
@@ -706,6 +720,9 @@ export default {
...
@@ -706,6 +720,9 @@ export default {
.
filter
(([
key
,
value
])
=>
value
!==
null
)
.
filter
(([
key
,
value
])
=>
value
!==
null
)
.
reduce
((
acc
,
[
key
,
value
])
=>
({
...
acc
,
[
key
]:
value
}),
{})
.
reduce
((
acc
,
[
key
,
value
])
=>
({
...
acc
,
[
key
]:
value
}),
{})
);
);
if
(
sum
.
length
==
1
)
{
filteredArr
.
pop
()
}
this
.
ImportTables
.
historyRole
=
filteredArr
.
map
(
item
=>
{
this
.
ImportTables
.
historyRole
=
filteredArr
.
map
(
item
=>
{
let
extractedItem
=
{};
let
extractedItem
=
{};
if
(
item
.
accountingCode
)
{
if
(
item
.
accountingCode
)
{
...
@@ -954,7 +971,11 @@ export default {
...
@@ -954,7 +971,11 @@ export default {
exportExcel
(
luckysheet
.
getAllSheets
(),
fileName
,
trueORfalse
,
this
.
value
);
exportExcel
(
luckysheet
.
getAllSheets
(),
fileName
,
trueORfalse
,
this
.
value
);
// 清洗数据
// 清洗数据
selectActSuppliesHistorydataAcc
(
3
).
then
(
response
=>
{
let
mine
=
{
tylkStatus
:
3
,
mining
:
this
.
mining
,
}
selectActSuppliesHistorydataAcc
(
mine
).
then
(
response
=>
{
var
data
=
response
.
data
;
var
data
=
response
.
data
;
let
list
=
[];
let
list
=
[];
let
list1
=
[];
let
list1
=
[];
...
...
ruoyi-ui/src/conversion/danhouMine.js
View file @
c6cf5960
export
function
danMine
(
newArray
,
c
,
Department
,
money
,
code
,
classify
,
codess
)
{
export
function
danMine
(
newArray
,
c
,
Department
,
money
,
code
,
classify
,
codess
,
name
,
headRow
)
{
//单侯矿转换方法&& this.selectname.includes('单侯')
//单侯矿转换方法&& this.selectname.includes('单侯')
//特定规则 制造费用可能放也可能不放,制造费用后期可能会晒出来
let
headRows
=
newArray
[
0
].
celldata
.
flat
().
filter
(
obj
=>
obj
.
v
&&
obj
.
v
.
v
===
"
火工品
"
)[
0
]?.
r
//费用来源
//费用来源
let
fylyColumn
=
c
.
flat
().
filter
(
obj
=>
obj
.
v
&&
obj
.
v
.
v
===
"
费用来源
"
)[
0
]?.
c
let
headRows
=
newArray
[
0
].
celldata
.
flat
().
filter
(
obj
=>
obj
.
r
&&
obj
.
r
===
headRow
&&
obj
.
c
>
0
)
let
headRow
=
newArray
[
0
].
celldata
.
flat
().
filter
(
obj
=>
obj
.
r
&&
obj
.
r
===
headRows
&&
obj
.
c
>
0
)
let
fyly
=
c
.
flat
().
filter
(
obj
=>
obj
.
c
&&
obj
.
c
===
fylyColumn
&&
obj
.
r
>
0
)
// 清空money数组中的属性
// 清空money数组中的属性
money
.
forEach
(
item
=>
{
money
.
forEach
(
item
=>
{
item
.
Department
=
''
;
item
.
Department
=
''
;
...
@@ -27,7 +23,7 @@ export function danMine(newArray,c,Department,money,code,classify,codess) {
...
@@ -27,7 +23,7 @@ export function danMine(newArray,c,Department,money,code,classify,codess) {
item
.
Department
=
matchingRemark
.
v
.
v
;
item
.
Department
=
matchingRemark
.
v
.
v
;
}
}
let
matchingFyly
=
fyly
.
find
(
f
=>
f
.
r
===
item
.
r
);
let
matchingFyly
=
name
.
find
(
f
=>
f
.
r
===
item
.
r
);
if
(
matchingFyly
)
{
if
(
matchingFyly
)
{
item
.
fyly
=
matchingFyly
.
v
.
v
;
item
.
fyly
=
matchingFyly
.
v
.
v
;
}
}
...
@@ -45,6 +41,9 @@ export function danMine(newArray,c,Department,money,code,classify,codess) {
...
@@ -45,6 +41,9 @@ export function danMine(newArray,c,Department,money,code,classify,codess) {
if
(
item
.
Department
.
includes
(
'
生活
'
))
{
if
(
item
.
Department
.
includes
(
'
生活
'
))
{
item
.
Department
=
'
生活科
'
item
.
Department
=
'
生活科
'
}
}
if
(
item
.
fyly
!==
'
生产成本
'
){
item
.
Department
=
item
.
fyly
}
});
});
money
=
money
.
map
(
obj
=>
{
money
=
money
.
map
(
obj
=>
{
let
v
=
obj
.
Department
;
let
v
=
obj
.
Department
;
...
@@ -87,7 +86,9 @@ export function danMine(newArray,c,Department,money,code,classify,codess) {
...
@@ -87,7 +86,9 @@ export function danMine(newArray,c,Department,money,code,classify,codess) {
}
}
if
(
!
money
[
i
].
cc
)
{
if
(
!
money
[
i
].
cc
)
{
money
[
i
].
c
=
10
money
[
i
].
c
=
10
}
if
(
!
money
[
i
].
rr
)
{
money
[
i
].
r
=
''
}
}
}
}
let
seen
=
new
Map
();
let
seen
=
new
Map
();
...
@@ -110,6 +111,10 @@ export function danMine(newArray,c,Department,money,code,classify,codess) {
...
@@ -110,6 +111,10 @@ export function danMine(newArray,c,Department,money,code,classify,codess) {
duplicateData
.
push
(
obj
);
duplicateData
.
push
(
obj
);
}
}
}
}
duplicateData
.
forEach
(
obj
=>
{
obj
.
v
.
v
=
Number
(
obj
.
v
.
v
).
toFixed
(
2
);
obj
.
v
.
m
=
Number
(
obj
.
v
.
v
).
toFixed
(
2
);
})
for
(
let
i
=
0
;
i
<
duplicateData
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
duplicateData
.
length
;
i
++
)
{
// // 对比 c 和 r 是否与 he[0]["celldata"] 中相应对象相同
// // 对比 c 和 r 是否与 he[0]["celldata"] 中相应对象相同
for
(
let
k
=
0
;
k
<
synthesis
[
0
][
"
celldata
"
].
length
;
k
++
)
{
for
(
let
k
=
0
;
k
<
synthesis
[
0
][
"
celldata
"
].
length
;
k
++
)
{
...
@@ -119,53 +124,55 @@ export function danMine(newArray,c,Department,money,code,classify,codess) {
...
@@ -119,53 +124,55 @@ export function danMine(newArray,c,Department,money,code,classify,codess) {
}
}
}
}
}
}
duplicateData
.
forEach
(
item
=>
{
let
duplicateJSON
=
JSON
.
stringify
(
duplicateData
)
const
matchedHeadRow
=
headRow
.
find
(
headItem
=>
headItem
.
c
===
item
.
c
);
duplicateJSON
=
JSON
.
parse
(
duplicateJSON
)
duplicateJSON
.
forEach
(
item
=>
{
const
matchedHeadRow
=
headRows
.
find
(
headItem
=>
headItem
.
c
===
item
.
c
);
if
(
matchedHeadRow
)
{
if
(
matchedHeadRow
)
{
item
.
v
.
material
=
matchedHeadRow
.
v
.
v
;
item
.
v
.
material
=
matchedHeadRow
.
v
.
v
;
}
}
});
});
for
(
let
i
=
0
;
i
<
duplicate
Data
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
duplicate
JSON
.
length
;
i
++
)
{
if
(
duplicate
Data
[
i
].
r
>
4
&&
duplicateData
[
i
].
r
<
16
)
{
if
(
duplicate
JSON
[
i
].
r
>
4
&&
duplicateJSON
[
i
].
r
<
16
)
{
//管理费用
//管理费用
duplicate
Data
[
i
].
r
=
6
duplicate
JSON
[
i
].
r
=
6
duplicate
Data
[
i
].
c
=
12
duplicate
JSON
[
i
].
c
=
12
}
}
if
(
duplicate
Data
[
i
].
r
>
16
&&
duplicateData
[
i
].
r
<
27
)
{
if
(
duplicate
JSON
[
i
].
r
>
16
&&
duplicateJSON
[
i
].
r
<
27
)
{
//制造费用
//制造费用
duplicate
Data
[
i
].
r
=
7
duplicate
JSON
[
i
].
r
=
7
duplicate
Data
[
i
].
c
=
10
duplicate
JSON
[
i
].
c
=
10
}
}
if
(
duplicate
Data
[
i
].
r
>
28
&&
duplicateData
[
i
].
r
<
43
)
{
if
(
duplicate
JSON
[
i
].
r
>
28
&&
duplicateJSON
[
i
].
r
<
43
)
{
//基本费用
//基本费用
duplicate
Data
[
i
].
r
=
8
duplicate
JSON
[
i
].
r
=
8
}
}
if
(
duplicate
Data
[
i
].
r
>
43
&&
duplicateData
[
i
].
r
<
46
)
{
if
(
duplicate
JSON
[
i
].
r
>
43
&&
duplicateJSON
[
i
].
r
<
46
)
{
//销售费用
//销售费用
duplicate
Data
[
i
].
r
=
9
duplicate
JSON
[
i
].
r
=
9
duplicate
Data
[
i
].
c
=
10
duplicate
JSON
[
i
].
c
=
10
}
}
if
(
duplicate
Data
[
i
].
r
>
46
&&
duplicateData
[
i
].
r
<
48
)
{
if
(
duplicate
JSON
[
i
].
r
>
46
&&
duplicateJSON
[
i
].
r
<
48
||
(
!
duplicateJSON
[
i
].
r
)
)
{
//其他业务
//其他业务
duplicate
Data
[
i
].
r
=
10
duplicate
JSON
[
i
].
r
=
10
duplicate
Data
[
i
].
c
=
10
duplicate
JSON
[
i
].
c
=
10
}
}
if
(
duplicate
Data
[
i
].
r
>
49
&&
duplicateData
[
i
].
r
<
51
)
{
if
(
duplicate
JSON
[
i
].
r
>
49
&&
duplicateJSON
[
i
].
r
<
51
)
{
//安全费用
//安全费用
duplicate
Data
[
i
].
r
=
11
duplicate
JSON
[
i
].
r
=
11
duplicate
Data
[
i
].
c
=
10
duplicate
JSON
[
i
].
c
=
10
}
}
}
}
let
seens
=
new
Map
();
let
seens
=
new
Map
();
let
duplicateDatas
=
[];
let
duplicateDatas
=
[];
for
(
let
obj
of
duplicate
Data
)
{
for
(
let
obj
of
duplicate
JSON
)
{
let
key
=
obj
.
r
+
'
,
'
+
obj
.
c
;
let
key
=
obj
.
r
+
'
,
'
+
obj
.
c
;
if
(
seens
.
has
(
key
))
{
if
(
seens
.
has
(
key
))
{
let
existingObj
=
seens
.
get
(
key
);
let
existingObj
=
seens
.
get
(
key
);
...
@@ -182,8 +189,14 @@ export function danMine(newArray,c,Department,money,code,classify,codess) {
...
@@ -182,8 +189,14 @@ export function danMine(newArray,c,Department,money,code,classify,codess) {
duplicateDatas
.
push
(
obj
);
duplicateDatas
.
push
(
obj
);
}
}
}
}
duplicateJSON
=
duplicateJSON
.
filter
(
item
=>
item
.
v
&&
item
.
v
.
name
);
duplicateJSON
.
forEach
(
items
=>
{
items
.
v
.
v
=
Number
(
items
.
v
.
v
).
toFixed
(
2
);
items
.
v
.
m
=
items
.
v
.
v
.
toString
();
items
.
v
.
m
=
Number
(
items
.
v
.
m
).
toFixed
(
2
);
})
let
duplic
=
{
let
duplic
=
{
duplicateData
:
duplicate
Datas
,
duplicateData
:
duplicate
JSON
,
CompositeTable
:
synthesis
CompositeTable
:
synthesis
}
}
return
duplic
return
duplic
...
...
ruoyi-ui/src/conversion/fanMine.js
View file @
c6cf5960
...
@@ -5,6 +5,7 @@ export function fanMine(money, codess, code, CompositeTable, name) {
...
@@ -5,6 +5,7 @@ export function fanMine(money, codess, code, CompositeTable, name) {
entry
.
v
.
name
=
''
;
entry
.
v
.
name
=
''
;
//编码
//编码
entry
.
code
=
''
;
entry
.
code
=
''
;
entry
.
row
=
''
//对比编码之后的列数
//对比编码之后的列数
entry
.
coloumn
=
''
entry
.
coloumn
=
''
//所在行
//所在行
...
@@ -56,22 +57,22 @@ export function fanMine(money, codess, code, CompositeTable, name) {
...
@@ -56,22 +57,22 @@ export function fanMine(money, codess, code, CompositeTable, name) {
let
substrAfterDash
=
item
.
v
.
name
.
slice
(
index
+
1
);
let
substrAfterDash
=
item
.
v
.
name
.
slice
(
index
+
1
);
switch
(
substrAfterDash
)
{
switch
(
substrAfterDash
)
{
case
''
:
case
''
:
item
.
r
=
DepartColumns
.
r
;
item
.
r
ow
=
DepartColumns
.
r
;
break
;
break
;
case
'
原煤
'
:
case
'
原煤
'
:
item
.
r
=
DepartColumns
.
r
+
1
;
item
.
r
ow
=
DepartColumns
.
r
+
1
;
break
;
break
;
case
'
洗煤
'
:
case
'
洗煤
'
:
item
.
r
=
DepartColumns
.
r
+
2
;
item
.
r
ow
=
DepartColumns
.
r
+
2
;
break
;
break
;
case
'
选煤
'
:
case
'
选煤
'
:
item
.
r
=
DepartColumns
.
r
+
3
;
item
.
r
ow
=
DepartColumns
.
r
+
3
;
break
;
break
;
case
'
厂区服务
'
:
case
'
厂区服务
'
:
item
.
r
=
DepartColumns
.
r
+
1
;
item
.
r
ow
=
DepartColumns
.
r
+
1
;
break
;
break
;
case
'
加工修理
'
:
case
'
加工修理
'
:
item
.
r
=
DepartColumns
.
r
+
4
;
item
.
r
ow
=
DepartColumns
.
r
+
4
;
break
;
break
;
default
:
default
:
// 默认情况
// 默认情况
...
@@ -83,6 +84,7 @@ export function fanMine(money, codess, code, CompositeTable, name) {
...
@@ -83,6 +84,7 @@ export function fanMine(money, codess, code, CompositeTable, name) {
});
});
money
.
forEach
((
item
)
=>
{
money
.
forEach
((
item
)
=>
{
item
.
c
=
item
.
coloumn
?
item
.
coloumn
*
1
:
10
;
item
.
c
=
item
.
coloumn
?
item
.
coloumn
*
1
:
10
;
item
.
r
=
item
.
row
?
item
.
row
*
1
:
''
;
});
});
// 同一个单元格,金额相加
// 同一个单元格,金额相加
let
seen
=
new
Map
();
let
seen
=
new
Map
();
...
@@ -126,6 +128,7 @@ export function fanMine(money, codess, code, CompositeTable, name) {
...
@@ -126,6 +128,7 @@ export function fanMine(money, codess, code, CompositeTable, name) {
}
}
}
}
}
}
duplicateData
=
duplicateData
.
filter
(
obj
=>
obj
.
row
!==
''
)
let
duplicateDatas
=
{
let
duplicateDatas
=
{
duplicateData
:
duplicateData
,
duplicateData
:
duplicateData
,
CompositeTable
:
CompositeTable
CompositeTable
:
CompositeTable
...
...
ruoyi-ui/src/conversion/hongMine.js
View file @
c6cf5960
...
@@ -11,8 +11,10 @@ export function hongMine(money, Department, code, name, codess, newArrayhong) {
...
@@ -11,8 +11,10 @@ export function hongMine(money, Department, code, name, codess, newArrayhong) {
element
.
row
=
''
element
.
row
=
''
element
.
index
=
element
.
r
element
.
index
=
element
.
r
});
});
for
(
let
i
=
0
;
i
<
money
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
money
.
length
;
i
++
)
{
//编码列
//编码列
if
(
money
[
i
].
r
==
code
[
i
].
r
)
{
if
(
money
[
i
].
r
==
code
[
i
].
r
)
{
money
[
i
].
code
=
code
[
i
].
v
.
v
;
money
[
i
].
code
=
code
[
i
].
v
.
v
;
}
}
...
@@ -46,13 +48,10 @@ export function hongMine(money, Department, code, name, codess, newArrayhong) {
...
@@ -46,13 +48,10 @@ export function hongMine(money, Department, code, name, codess, newArrayhong) {
}
}
money
[
k
].
coloumn
=
codess
[
i
].
oneLevel
*
1
money
[
k
].
coloumn
=
codess
[
i
].
oneLevel
*
1
}
}
let
Officeexpenses
=
columnIdString
.
substring
(
0
,
4
)
if
(
Officeexpenses
==
'
6601
'
)
{
money
[
k
].
coloumn
=
9
}
}
}
}
}
money
.
forEach
(
obj
=>
{
money
.
forEach
(
obj
=>
{
let
matchedItems
=
newArrayhong
[
0
][
"
celldata
"
].
filter
(
item
=>
item
.
v
&&
item
.
v
.
v
&&
item
.
v
.
v
.
includes
(
obj
.
v
.
Department
));
let
matchedItems
=
newArrayhong
[
0
][
"
celldata
"
].
filter
(
item
=>
item
.
v
&&
item
.
v
.
v
&&
item
.
v
.
v
.
includes
(
obj
.
v
.
Department
));
if
(
matchedItems
.
length
>
0
)
{
if
(
matchedItems
.
length
>
0
)
{
...
@@ -61,7 +60,15 @@ export function hongMine(money, Department, code, name, codess, newArrayhong) {
...
@@ -61,7 +60,15 @@ export function hongMine(money, Department, code, name, codess, newArrayhong) {
obj
.
row
=
''
;
obj
.
row
=
''
;
}
}
});
});
for
(
let
k
=
0
;
k
<
money
.
length
;
k
++
)
{
let
columnIdString
=
String
(
money
[
k
].
code
);
let
Officeexpenses
=
columnIdString
.
substring
(
0
,
4
)
if
(
Officeexpenses
==
'
6601
'
&&
money
[
k
].
row
<
17
)
{
money
[
k
].
coloumn
=
9
}
}
money
.
forEach
((
item
)
=>
{
money
.
forEach
((
item
)
=>
{
item
.
c
=
item
.
coloumn
?
item
.
coloumn
*
1
:
10
;
item
.
c
=
item
.
coloumn
?
item
.
coloumn
*
1
:
10
;
item
.
r
=
item
.
row
?
item
.
row
*
1
:
''
item
.
r
=
item
.
row
?
item
.
row
*
1
:
''
});
});
...
@@ -107,18 +114,24 @@ export function hongMine(money, Department, code, name, codess, newArrayhong) {
...
@@ -107,18 +114,24 @@ export function hongMine(money, Department, code, name, codess, newArrayhong) {
}
}
}
}
}
}
let
matchedItems
=
newArrayhong
[
0
][
"
celldata
"
].
filter
(
item
=>
item
.
v
&&
(
typeof
item
.
v
.
v
===
'
string
'
&&
item
.
v
.
v
.
includes
(
'
办公费用
'
)
||
typeof
item
.
v
.
m
===
'
string
'
&&
item
.
v
.
m
.
includes
(
'
办公费用
'
)))[
0
].
r
;
let
matchedItems
=
newArrayhong
[
0
][
"
celldata
"
].
filter
(
item
=>
item
.
v
&&
(
typeof
item
.
v
.
v
===
'
string
'
&&
item
.
v
.
v
.
includes
(
'
办公费用
'
)
||
typeof
item
.
v
.
m
===
'
string
'
&&
item
.
v
.
m
.
includes
(
'
办公费用
'
)))[
0
].
c
;
duplicateData
.
forEach
(
obj
=>
{
if
(
obj
.
c
===
matchedItems
)
{
let
other
=
newArrayhong
[
0
][
"
celldata
"
].
filter
(
item
=>
item
.
v
&&
(
typeof
item
.
v
.
v
===
'
string
'
&&
item
.
v
.
v
==
'
其他材料
'
||
typeof
item
.
v
.
m
===
'
string
'
&&
item
.
v
.
m
==
'
其他材料
'
))[
0
].
c
;
let
duplicateJSON
=
JSON
.
stringify
(
duplicateData
)
duplicateJSON
=
JSON
.
parse
(
duplicateJSON
)
duplicateJSON
.
forEach
(
obj
=>
{
if
(
obj
.
c
===
matchedItems
)
{
obj
.
v
.
name
=
'
管理费用-
'
;
obj
.
v
.
name
=
'
管理费用-
'
;
}
else
if
(
obj
.
Department
==
'
洗煤厂
'
){
obj
.
c
=
other
;
obj
.
v
.
name
=
'
制造费用—选混煤
'
}
else
if
(
obj
.
v
.
Department
===
'
洗煤厂
'
)
{
}
else
{
obj
.
v
.
name
=
'
制造费用-选混煤
'
;
obj
.
v
.
name
=
'
基本生产-原煤
'
obj
.
c
=
other
}
else
{
obj
.
v
.
name
=
'
基本生产-原煤
'
;
}
}
});
});
let
duplicateDatas
=
{
let
duplicateDatas
=
{
duplicateData
:
duplicate
Data
,
duplicateData
:
duplicate
JSON
,
CompositeTable
:
newArrayhong
CompositeTable
:
newArrayhong
}
}
return
duplicateDatas
return
duplicateDatas
...
...
ruoyi-ui/src/conversion/lvMine.js
View file @
c6cf5960
export
function
lvMine
(
CompositeTable
,
cjson
,
codess
)
{
export
function
lvMine
(
CompositeTable
,
cjson
,
codess
)
{
let
results
=
[
'
10.安全费用
'
,
'
11.研究费用
'
,
'
12.维简及井巷费
'
]
let
results
=
[
'
10.安全费用
'
,
'
11.研究费用
'
,
'
12.维简及井巷费
'
]
//先把安全费用 研发什么的插入到成本材料表中
//先把安全费用 研发什么的插入到成本材料表中
let
insert
=
CompositeTable
[
0
].
celldata
.
filter
(
obj
=>
obj
.
v
.
v
==
'
9.专项储备
'
)[
0
].
r
for
(
let
i
=
0
,
k
=
0
;
i
<
CompositeTable
[
0
].
celldata
.
length
&&
k
<
results
.
length
;
i
++
)
{
for
(
let
i
=
0
,
k
=
0
;
i
<
CompositeTable
[
0
].
celldata
.
length
&&
k
<
results
.
length
;
i
++
)
{
if
(
CompositeTable
[
0
].
celldata
[
i
]
&&
CompositeTable
[
0
].
celldata
[
i
].
r
&&
CompositeTable
[
0
].
celldata
[
i
].
r
>=
23
&&
CompositeTable
[
0
].
celldata
[
i
].
r
<
26
&&
CompositeTable
[
0
].
celldata
[
i
].
c
==
0
)
{
if
(
CompositeTable
[
0
].
celldata
[
i
]
&&
CompositeTable
[
0
].
celldata
[
i
].
r
&&
CompositeTable
[
0
].
celldata
[
i
].
r
>=
insert
+
1
&&
CompositeTable
[
0
].
celldata
[
i
].
r
<
insert
+
4
&&
CompositeTable
[
0
].
celldata
[
i
].
c
==
0
)
{
CompositeTable
[
0
].
celldata
[
i
].
v
.
v
=
results
[
k
];
CompositeTable
[
0
].
celldata
[
i
].
v
.
v
=
results
[
k
];
CompositeTable
[
0
].
celldata
[
i
].
v
.
m
=
results
[
k
];
CompositeTable
[
0
].
celldata
[
i
].
v
.
m
=
results
[
k
];
k
++
;
k
++
;
...
@@ -54,7 +55,7 @@ export function lvMine(CompositeTable,cjson,codess) {
...
@@ -54,7 +55,7 @@ export function lvMine(CompositeTable,cjson,codess) {
max
.
forEach
(
obj
=>
{
max
.
forEach
(
obj
=>
{
if
(
obj
.
r
>
0
&&
obj
.
c
>=
min
)
{
if
(
obj
.
r
>
0
&&
obj
.
c
>=
min
)
{
let
coulumn
=
obj
.
c
;
let
coulumn
=
obj
.
c
;
obj
.
v
.
name
=
max
.
find
(
c
=>
c
.
c
===
coulumn
&&
c
.
r
===
0
).
v
.
v
;
obj
.
v
.
name
=
max
.
find
(
c
=>
c
.
c
===
coulumn
&&
c
.
r
===
0
)
?
.
v
.
v
;
obj
.
category
=
max
.
find
(
c
=>
c
.
c
===
coulumn
&&
c
.
r
===
1
)?.
v
.
v
;
obj
.
category
=
max
.
find
(
c
=>
c
.
c
===
coulumn
&&
c
.
r
===
1
)?.
v
.
v
;
}
}
});
});
...
@@ -70,19 +71,18 @@ export function lvMine(CompositeTable,cjson,codess) {
...
@@ -70,19 +71,18 @@ export function lvMine(CompositeTable,cjson,codess) {
});
});
const
money
=
moneycolumn
.
filter
(
obj
=>
(
obj
.
category
.
includes
(
'
单价
'
)
||
obj
.
category
.
includes
(
'
数量
'
)));
const
money
=
moneycolumn
.
filter
(
obj
=>
(
obj
.
category
.
includes
(
'
单价
'
)
||
obj
.
category
.
includes
(
'
数量
'
)));
// 计算总金额
// 计算总金额
const
result
=
[];
const
moneys
=
money
.
filter
(
obj
=>
obj
.
category
==
'
出库单价
'
)
const
map
=
new
Map
();
moneys
.
forEach
(
item
=>
{
money
.
forEach
(
item
=>
{
item
.
v
.
quantity
=
money
.
filter
(
obj
=>
obj
.
r
==
item
.
r
&&
obj
.
c
==
item
.
c
-
1
)[
0
].
v
.
v
if
(
map
.
has
(
item
.
r
))
{
if
(
item
.
v
.
v
&&
item
.
v
.
quantity
){
const
existingItem
=
map
.
get
(
item
.
r
);
item
.
v
.
v
=
item
.
v
.
v
*
item
.
v
.
quantity
existingItem
.
v
.
v
*=
parseFloat
(
item
.
v
.
v
);
item
.
v
.
m
=
item
.
v
.
v
}
else
{
}
else
{
map
.
set
(
item
.
r
,
{
...
item
,
v
:
{
...
item
.
v
,
v
:
parseFloat
(
item
.
v
.
v
)
},
category
:
"
总金额
"
});
this
.
$message
.
error
(
'
请仔细检查所导入表
'
);
}
}
});
})
map
.
forEach
(
value
=>
result
.
push
(
value
));
// 对 部门分类 进行处理
// 对 部门分类 进行处理
const
duplicateDatas
=
result
.
map
(
item
=>
{
moneys
.
forEach
(
item
=>
{
let
categories
=
item
.
v
.
name
;
let
categories
=
item
.
v
.
name
;
if
(
categories
.
includes
(
'
--
'
)
||
categories
.
includes
(
'
-
'
))
{
if
(
categories
.
includes
(
'
--
'
)
||
categories
.
includes
(
'
-
'
))
{
categories
=
categories
.
replace
(
/--/g
,
'
-
'
);
categories
=
categories
.
replace
(
/--/g
,
'
-
'
);
...
@@ -92,7 +92,7 @@ export function lvMine(CompositeTable,cjson,codess) {
...
@@ -92,7 +92,7 @@ export function lvMine(CompositeTable,cjson,codess) {
item
.
v
.
name
=
categories
;
item
.
v
.
name
=
categories
;
return
item
;
return
item
;
});
});
duplicateData
s
.
forEach
(
item
=>
{
money
s
.
forEach
(
item
=>
{
item
.
index
=
item
.
r
item
.
index
=
item
.
r
if
(
item
.
v
.
name
!==
undefined
)
{
if
(
item
.
v
.
name
!==
undefined
)
{
let
index
=
item
.
v
.
name
.
indexOf
(
"
-
"
);
let
index
=
item
.
v
.
name
.
indexOf
(
"
-
"
);
...
@@ -136,19 +136,22 @@ export function lvMine(CompositeTable,cjson,codess) {
...
@@ -136,19 +136,22 @@ export function lvMine(CompositeTable,cjson,codess) {
codess
.
forEach
(
codeItem
=>
{
codess
.
forEach
(
codeItem
=>
{
let
codeLength
=
String
(
codeItem
.
code
).
length
;
let
codeLength
=
String
(
codeItem
.
code
).
length
;
let
codeToCompare
=
String
(
codeItem
.
code
).
substring
(
0
,
codeLength
);
let
codeToCompare
=
String
(
codeItem
.
code
).
substring
(
0
,
codeLength
);
let
matchingItem
=
duplicateData
s
.
find
(
duplicateItem
=>
String
(
duplicateItem
.
code
).
startsWith
(
codeToCompare
));
let
matchingItem
=
money
s
.
find
(
duplicateItem
=>
String
(
duplicateItem
.
code
).
startsWith
(
codeToCompare
));
if
(
matchingItem
)
{
if
(
matchingItem
)
{
matchingItem
.
cc
=
codeItem
.
oneLevel
*
1
;
matchingItem
.
cc
=
codeItem
.
oneLevel
*
1
;
}
}
});
});
duplicateData
s
.
forEach
((
item
)
=>
{
money
s
.
forEach
((
item
)
=>
{
item
.
c
=
item
.
cc
?
item
.
cc
*
1
:
10
;
item
.
c
=
item
.
cc
?
item
.
cc
*
1
:
10
;
if
(
item
.
r
>
8
){
item
.
c
=
10
}
});
});
//同一个单元格的数据 金额相加。
//同一个单元格的数据 金额相加。
let
duplicateData
=
[];
let
duplicateData
=
[];
let
seen
=
new
Map
();
let
seen
=
new
Map
();
// 根据行列信息合并重复数据并记录索引
// 根据行列信息合并重复数据并记录索引
for
(
let
obj
of
duplicateData
s
)
{
for
(
let
obj
of
money
s
)
{
let
key
=
obj
.
r
+
'
,
'
+
obj
.
c
;
let
key
=
obj
.
r
+
'
,
'
+
obj
.
c
;
if
(
seen
.
has
(
key
))
{
if
(
seen
.
has
(
key
))
{
let
existingObj
=
seen
.
get
(
key
);
let
existingObj
=
seen
.
get
(
key
);
...
@@ -186,6 +189,7 @@ export function lvMine(CompositeTable,cjson,codess) {
...
@@ -186,6 +189,7 @@ export function lvMine(CompositeTable,cjson,codess) {
}
}
}
}
}
}
duplicateData
=
duplicateData
.
filter
(
item
=>
!
item
.
v
.
name
.
includes
(
'
研发费用
'
)
&&!
item
.
v
.
name
.
includes
(
'
安全费用
'
)
&&!
item
.
v
.
name
.
includes
(
'
维简及井巷费
'
));
let
duplic
=
{
let
duplic
=
{
duplicateData
:
duplicateData
,
duplicateData
:
duplicateData
,
CompositeTable
:
CompositeTable
CompositeTable
:
CompositeTable
...
...
ruoyi-ui/src/main.js
View file @
c6cf5960
...
@@ -11,7 +11,6 @@ import App from './App'
...
@@ -11,7 +11,6 @@ import App from './App'
import
store
from
'
./store
'
import
store
from
'
./store
'
import
router
from
'
./router
'
import
router
from
'
./router
'
import
permission
from
'
./directive/permission
'
import
permission
from
'
./directive/permission
'
import
'
./assets/icons
'
// icon
import
'
./assets/icons
'
// icon
import
'
./permission
'
// permission control
import
'
./permission
'
// permission control
import
{
getDicts
}
from
"
@/api/system/dict/data
"
;
import
{
getDicts
}
from
"
@/api/system/dict/data
"
;
...
...
ruoyi-ui/src/views/system/ActsupplesAll/MoneyMine.vue
0 → 100644
View file @
c6cf5960
<
template
>
<div
class=
"app-container"
>
<el-form
ref=
"queryForm"
size=
"small"
:inline=
"true"
label-width=
"68px"
>
<el-form-item
label=
"模板"
prop=
"name"
>
<el-select
v-model=
"selectedOption"
ref=
"mySelect"
size=
"mini"
@
change=
"handleOptionChange($event,
{
name: '钱家营',
id: '010105'
}, '010105')" filterable
placeholder="请选择您要查看的模板">
<el-option
v-for=
"item in depss"
:key=
"item.id"
:label=
"item.templateName"
:value=
"item.id"
:disabled=
"item.disabled"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"清洗规则"
prop=
"roleid"
>
<el-select
v-model=
"selectedRule"
ref=
"mySelect"
size=
"mini"
@
change=
"handleRuleChange"
filterable
placeholder=
"请选择您要查看的规则"
>
<el-option
v-for=
"iem in luckyrule"
:key=
"iem.id"
:label=
"iem.roleName"
:value=
"iem.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"时间"
prop=
"date"
>
<el-date-picker
@
change=
"handledateChange"
v-model=
"date"
type=
"month"
placeholder=
"选择月"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<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=
"warning"
plain
icon=
"el-icon-upload2"
size=
"mini"
@
click=
"handleExport"
>
导出
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-upload
type=
"file"
name=
"file"
ref=
"upload"
:before-upload=
"handleFileChange"
action=
''
accept=
'.xlsx'
:limit=
"1"
:file-list=
"fileList"
:disabled=
"disableNextButton"
:show-file-list=
false
>
<el-button
plain
size=
"mini"
icon=
"el-icon-download"
type=
"primary"
:disabled=
"disableNextButton"
@
click=
"rulesdate"
>
导入
</el-button>
</el-upload>
<el-button
:plain=
"true"
style=
"display: none;"
@
click=
"open4"
>
错误
</el-button>
</el-col>
</el-row>
<!-- luckysheet容器 -->
<div
id=
"luckysheet"
style=
"margin: 0px; padding: 0px; position: absolute; width: 100%; height:80vh; z-index: 0"
>
</div>
<div
v-if=
"showMask"
class=
"mask"
>
<div
class=
"loading-spinner"
></div>
</div>
</div>
</
template
>
<
script
src=
"@/conversion/conversion"
></
script
>
<
style
scoped
src=
"./actsuppMine.css"
></
style
>
ruoyi-ui/src/views/system/ActsupplesAll/fanMine.vue
View file @
c6cf5960
...
@@ -54,4 +54,5 @@
...
@@ -54,4 +54,5 @@
</div>
</div>
</
template
>
</
template
>
<
script
src=
"@/conversion/conversion"
></
script
>
<
script
src=
"@/conversion/conversion"
></
script
>
<
style
scoped
src=
"./actsuppMine.css"
></
style
>
<
style
scoped
src=
"./actsuppMine.css"
></
style
>
ruoyi-ui/src/views/system/historydata/index.vue
View file @
c6cf5960
...
@@ -107,10 +107,6 @@ export default {
...
@@ -107,10 +107,6 @@ export default {
name
:
'
东欢坨矿
'
,
name
:
'
东欢坨矿
'
,
id
:
'
010102
'
id
:
'
010102
'
},
},
{
name
:
'
范矿
'
,
id
:
2
},
{
{
name
:
'
范各庄
'
,
name
:
'
范各庄
'
,
id
:
'
011701
'
id
:
'
011701
'
...
...
ruoyi-ui/src/views/system/supplies/index_vue.vue
View file @
c6cf5960
...
@@ -5,7 +5,8 @@
...
@@ -5,7 +5,8 @@
<el-form-item
label=
"模板"
prop=
"name"
>
<el-form-item
label=
"模板"
prop=
"name"
>
<el-select
v-model=
"selectedOption"
ref=
"mySelect"
size=
"mini"
@
change=
"handleOptionChange"
filterable
<el-select
v-model=
"selectedOption"
ref=
"mySelect"
size=
"mini"
@
change=
"handleOptionChange"
filterable
placeholder=
"请选择您要查看的模板"
>
placeholder=
"请选择您要查看的模板"
>
<el-option
v-for=
"item in depss"
:key=
"item.id"
:label=
"item.templateName"
:value=
"item.id"
>
<el-option
v-for=
"item in depss"
:key=
"item.id"
:label=
"item.templateName"
:value=
"item.id"
:disabled=
"item.disabled"
>
</el-option>
</el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
...
@@ -71,25 +72,25 @@
...
@@ -71,25 +72,25 @@
<
script
>
<
script
>
import
{
selectActSuppliesHistorydata
,
selectActSuppliesHistorydataAcc
}
from
"
@/api/Actsupplies/cleaning_rule
"
;
import
{
selectActSuppliesHistorydata
,
selectActSuppliesHistorydataAcc
}
from
"
@/api/Actsupplies/cleaning_rule
"
;
import
{
getSuppliesTemplate
,
listSuppliesTemplate
,
roleList
,
materialConvert
,
materialListPZ
,
accountingcode
,
department
,
roleListid
,
materialList
}
from
"
@/api/ruoyi-myLuckyexcel/myluckyexcel
"
;
import
{
getSuppliesTemplate
,
listSuppliesTemplate
,
roleList
,
materialConvert
,
materialListPZ
,
accountingcode
,
department
,
roleListid
,
materialList
}
from
"
@/api/ruoyi-myLuckyexcel/myluckyexcel
"
;
import
{
addInsert
,
addInsert1
,
addInsert2
,
addInsertAccount1
,
addInsertAccount2
}
from
"
@/api/system/historydata
"
import
{
addInsert
,
addInsert1
,
addInsert2
,
addInsertAccount1
,
addInsertAccount2
}
from
"
@/api/system/historydata
"
/*import luckysheet from 'luckysheet'*/
/*import luckysheet from 'luckysheet'*/
import
LuckyExcel
from
'
luckyexcel
'
import
LuckyExcel
from
'
luckyexcel
'
//导入库export.js 这个文件是es6的,不能在普通的HTML文件直接引入js文件(虽然都是js文件,但是有区别,具体请百度es6与es5)!需要把es6转es5才可以直接引入使用!
//导入库export.js 这个文件是es6的,不能在普通的HTML文件直接引入js文件(虽然都是js文件,但是有区别,具体请百度es6与es5)!需要把es6转es5才可以直接引入使用!
/*import {materialList} from "@/api/ruoyi-myLuckyexcel/myluckyexcel";*/
/*import {materialList} from "@/api/ruoyi-myLuckyexcel/myluckyexcel";*/
import
{
exportExcel
}
from
'
../../../../public/exportExcel
'
;
import
{
exportExcel
}
from
'
../../../../public/exportExcel
'
;
import
{
v4
as
uuidv4
}
from
'
uuid
'
;
import
{
v4
as
uuidv4
}
from
'
uuid
'
;
import
{
getInfo
}
from
"
@/api/login
"
;
import
{
getInfo
}
from
"
@/api/login
"
;
import
{
listSuppliesexpense
}
from
"
../../../api/ActClassification/ActClassification
"
;
import
{
listSuppliesexpense
}
from
"
../../../api/ActClassification/ActClassification
"
;
var
fileName
=
"
新建XLSX工作表
"
;
//定义表名
var
fileName
=
"
新建XLSX工作表
"
;
//定义表名
var
rule
=
[];
var
rule
=
[];
var
tempId
;
var
tempId
;
var
roleId
;
var
roleId
;
var
uuid1
;
var
uuid1
;
var
trueORfalse
=
false
;
var
trueORfalse
=
false
;
var
modify
=
false
;
var
modify
=
false
;
export
default
{
export
default
{
name
:
"
Mymodule
"
,
name
:
"
Mymodule
"
,
data
()
{
data
()
{
return
{
return
{
...
@@ -123,6 +124,10 @@
...
@@ -123,6 +124,10 @@
{
{
name
:
'
单侯矿
'
,
name
:
'
单侯矿
'
,
id
:
'
011204
'
id
:
'
011204
'
},
{
name
:
'
吕矿
'
,
id
:
'
011702
'
}
}
],
],
...
@@ -204,11 +209,7 @@
...
@@ -204,11 +209,7 @@
materialListPZ
().
then
(
response
=>
{
materialListPZ
().
then
(
response
=>
{
this
.
codess
=
response
.
rows
this
.
codess
=
response
.
rows
})
})
//查用户名称
//查用户名称
getInfo
().
then
(
response
=>
{
getInfo
().
then
(
response
=>
{
this
.
userName
=
response
.
user
.
nickName
this
.
userName
=
response
.
user
.
nickName
})
})
...
@@ -261,7 +262,7 @@
...
@@ -261,7 +262,7 @@
const
minvalue
=
this
.
miningValue
.
find
(
obj
=>
obj
.
id
===
this
.
mining
)
const
minvalue
=
this
.
miningValue
.
find
(
obj
=>
obj
.
id
===
this
.
mining
)
const
Luckysheetlabel
=
this
.
luckyrule
.
find
(
obj
=>
obj
.
id
===
this
.
selectedRule
);
const
Luckysheetlabel
=
this
.
luckyrule
.
find
(
obj
=>
obj
.
id
===
this
.
selectedRule
);
console
.
log
(
this
.
cleaning
,
this
.
mining
)
if
(
this
.
date
==
''
||
this
.
date
==
null
)
{
if
(
this
.
date
==
''
||
this
.
date
==
null
)
{
this
.
disableNextButton
=
true
;
this
.
disableNextButton
=
true
;
this
.
$message
.
error
(
'
请选择时间日期!
'
);
this
.
$message
.
error
(
'
请选择时间日期!
'
);
...
@@ -270,7 +271,11 @@
...
@@ -270,7 +271,11 @@
this
.
$message
.
error
(
'
请选择所属矿区!
'
);
this
.
$message
.
error
(
'
请选择所属矿区!
'
);
}
else
if
(
this
.
cleaning
==
''
)
{
}
else
if
(
this
.
cleaning
==
''
)
{
this
.
disableNextButton
=
true
;
this
.
disableNextButton
=
true
;
this
.
$message
.
error
(
'
请选则清洗规则!
'
);
this
.
$message
.
error
(
'
请选择清洗规则!
'
);
}
else
if
(
!
this
.
selectname
.
includes
(
this
.
mine
))
{
console
.
log
(
'
2222
'
)
this
.
disableNextButton
=
true
;
this
.
$message
.
error
(
'
清洗规则和所属矿区必须一致!
'
);
}
}
},
},
handledateChange
(
value
)
{
handledateChange
(
value
)
{
...
@@ -310,6 +315,11 @@
...
@@ -310,6 +315,11 @@
/** 页面刷新时展示的数据*/
/** 页面刷新时展示的数据*/
getList
()
{
getList
()
{
listSuppliesTemplate
(
this
.
queryParams
).
then
(
response
=>
{
listSuppliesTemplate
(
this
.
queryParams
).
then
(
response
=>
{
response
.
rows
.
forEach
(
row
=>
{
if
(
row
.
templateName
.
includes
(
'
六矿
'
))
{
row
.
disabled
=
true
;
}
});
this
.
depss
=
response
.
rows
;
this
.
depss
=
response
.
rows
;
});
});
...
@@ -318,7 +328,9 @@
...
@@ -318,7 +328,9 @@
handleOptionChange
(
value
)
{
handleOptionChange
(
value
)
{
this
.
date
=
''
this
.
date
=
''
this
.
mining
=
''
this
.
mining
=
''
this
.
value
=
value
this
.
ImportTables
.
templateId
=
value
this
.
generate
.
templateId
=
value
this
.
selectedRule
=
''
;
this
.
selectedRule
=
''
;
this
.
disableNextButton
=
this
.
selectedRule
===
''
;
this
.
disableNextButton
=
this
.
selectedRule
===
''
;
//根据选中的下拉选项值获取相应的信息
//根据选中的下拉选项值获取相应的信息
...
@@ -348,9 +360,11 @@
...
@@ -348,9 +360,11 @@
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
fileName
,
// Excel 文件名
title
:
fileName
,
// Excel 文件名
data
:
json_data
,
// Excel 数据
data
:
json_data
,
// Excel 数据
showinfobar
:
false
,
//是否显示顶部名称栏
showinfobar
:
false
,
allowEdit
:
false
,
//是否显示顶部名称栏
lang
:
'
zh
'
,
lang
:
'
zh
'
,
});
});
this
.
value
=
fileName
}).
catch
(()
=>
{
}).
catch
(()
=>
{
// 处理错误逻辑,这里是一个空的错误处理函数
// 处理错误逻辑,这里是一个空的错误处理函数
this
.
$message
.
error
(
'
查询失败,发生未知错误!
'
);
this
.
$message
.
error
(
'
查询失败,发生未知错误!
'
);
...
@@ -561,9 +575,12 @@
...
@@ -561,9 +575,12 @@
}
}
});
});
let
c
=
cc
.
sheets
[
0
].
celldata
let
c
=
cc
.
sheets
[
0
].
celldata
let
cjson
=
JSON
.
stringify
(
c
)
let
config
=
cc
.
sheets
[
0
].
config
//表头所在行
//表头所在行
let
headRow
=
this
.
cleaning
[
0
].
HeaderRow
-
1
let
headRow
=
this
.
cleaning
[
0
].
HeaderRow
-
2
//部门名称列
//部门名称列
let
DepartmentColumns
=
this
.
cleaning
[
0
].
DepartmentColumn
-
1
let
DepartmentColumns
=
this
.
cleaning
[
0
].
DepartmentColumn
-
1
let
Department
=
c
.
flat
().
filter
(
obj
=>
obj
.
c
&&
obj
.
c
===
DepartmentColumns
&&
obj
.
r
>
headRow
)
let
Department
=
c
.
flat
().
filter
(
obj
=>
obj
.
c
&&
obj
.
c
===
DepartmentColumns
&&
obj
.
r
>
headRow
)
//编码所在列
//编码所在列
...
@@ -692,9 +709,10 @@
...
@@ -692,9 +709,10 @@
}
}
});
});
//同一个单元格的数据 金额相加。
//同一个单元格的数据 金额相加。
let
i
=
-
1
let
i
=
headRow
-
1
let
duplicateData
=
[];
let
duplicateData
=
[];
let
seen
=
new
Map
();
let
seen
=
new
Map
();
// 根据行列信息合并重复数据并记录索引
// 根据行列信息合并重复数据并记录索引
for
(
let
obj
of
newobj
[
2
])
{
for
(
let
obj
of
newobj
[
2
])
{
i
+=
1
;
i
+=
1
;
...
@@ -728,16 +746,16 @@
...
@@ -728,16 +746,16 @@
//金额所在列和行,去模板表中查找,如果行列一致则替换
//金额所在列和行,去模板表中查找,如果行列一致则替换
for
(
let
i
=
0
;
i
<
duplicateData
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
duplicateData
.
length
;
i
++
)
{
// // 对比 c 和 r 是否与 CompositeTable[0]["celldata"] 中相应对象相同
// // 对比 c 和 r 是否与 CompositeTable[0]["celldata"] 中相应对象相同
for
(
let
ii
=
0
;
ii
<
CompositeTable
[
0
][
"
celldata
"
].
length
;
ii
++
)
{
for
(
let
k
=
0
;
k
<
CompositeTable
[
0
][
"
celldata
"
].
length
;
k
++
)
{
if
(
duplicateData
[
i
].
r
===
CompositeTable
[
0
][
"
celldata
"
][
ii
].
r
&&
duplicateData
[
i
].
c
===
CompositeTable
[
0
][
"
celldata
"
][
ii
].
c
)
{
if
(
duplicateData
[
i
].
r
===
CompositeTable
[
0
][
"
celldata
"
][
k
].
r
&&
duplicateData
[
i
].
c
===
CompositeTable
[
0
][
"
celldata
"
][
k
].
c
)
{
// 如果相同,则进行替换
// 如果相同,则进行替换
CompositeTable
[
0
][
"
celldata
"
][
ii
]
=
duplicateData
[
i
];
CompositeTable
[
0
][
"
celldata
"
][
k
]
=
duplicateData
[
i
];
}
}
}
}
}
}
// celldata => data 生成表格所需二维数组
// celldata => data 生成表格所需二维数组
CompositeTable
[
0
].
data
=
luckysheet
.
transToData
(
CompositeTable
[
0
][
"
celldata
"
])
CompositeTable
[
0
].
data
=
luckysheet
.
transToData
(
CompositeTable
[
0
][
"
celldata
"
])
if
(
this
.
value
===
1257
)
{
if
(
!
(
this
.
value
.
includes
(
'
凭证
'
))
)
{
luckysheet
.
create
({
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
fileName
,
// Excel 文件名
title
:
fileName
,
// Excel 文件名
...
@@ -747,7 +765,6 @@
...
@@ -747,7 +765,6 @@
});
});
modify
=
true
modify
=
true
this
.
showMask
=
false
;
this
.
showMask
=
false
;
}
}
//this.from 往后台村的数据
//this.from 往后台村的数据
this
.
ImportTables
.
historyContent
=
resultJSON
this
.
ImportTables
.
historyContent
=
resultJSON
...
@@ -769,7 +786,7 @@
...
@@ -769,7 +786,7 @@
}
}
//林西矿转换方法
//林西矿转换方法
//机电制造费用现在是筛选出来了,。没有放到里面,如果想放进去也可以放进去,但是具体划分就不明细了
//机电制造费用现在是筛选出来了,。没有放到里面,如果想放进去也可以放进去,但是具体划分就不明细了
if
(
this
.
mine
.
includes
(
'
林西
'
)
&&
this
.
selectname
.
includes
(
'
林西
'
)
&&
name
)
{
if
(
this
.
mine
.
includes
(
'
林西
'
)
&&
this
.
selectname
.
includes
(
'
林西
'
)
)
{
//类别名称,部门名称,不含税金额,存货编码
//类别名称,部门名称,不含税金额,存货编码
if
(
name
&&
Department
&&
money
&&
code
)
{
if
(
name
&&
Department
&&
money
&&
code
)
{
let
nameColums
=
name
let
nameColums
=
name
...
@@ -782,6 +799,7 @@
...
@@ -782,6 +799,7 @@
entry
.
remark
=
''
;
entry
.
remark
=
''
;
entry
.
classify
=
''
;
entry
.
classify
=
''
;
entry
.
code
=
''
;
entry
.
code
=
''
;
entry
.
index
=
entry
.
r
});
});
// 合并数组
// 合并数组
...
@@ -910,15 +928,15 @@
...
@@ -910,15 +928,15 @@
let
seen
=
new
Map
();
let
seen
=
new
Map
();
let
duplicateData
=
[];
let
duplicateData
=
[];
money
.
forEach
((
obj
,
i
)
=>
{
money
.
forEach
((
obj
)
=>
{
let
key
=
obj
.
r
+
'
,
'
+
obj
.
c
;
let
key
=
obj
.
r
+
'
,
'
+
obj
.
c
;
if
(
seen
.
has
(
key
))
{
if
(
seen
.
has
(
key
))
{
let
existingObj
=
seen
.
get
(
key
);
let
existingObj
=
seen
.
get
(
key
);
existingObj
.
v
.
v
=
Number
(
existingObj
.
v
.
v
)
+
Number
(
obj
.
v
.
v
);
existingObj
.
v
.
v
=
Number
(
existingObj
.
v
.
v
)
+
Number
(
obj
.
v
.
v
);
existingObj
.
v
.
m
=
existingObj
.
v
.
v
.
toString
();
existingObj
.
v
.
m
=
existingObj
.
v
.
v
.
toString
();
existingObj
.
index
.
push
(
i
);
existingObj
.
index
.
push
(
obj
.
index
);
}
else
{
}
else
{
obj
.
index
=
[
i
];
obj
.
index
=
[
obj
.
index
];
seen
.
set
(
key
,
obj
);
seen
.
set
(
key
,
obj
);
}
}
});
});
...
@@ -940,15 +958,15 @@
...
@@ -940,15 +958,15 @@
//金额所在列和行,去模板表中查找,如果行列一致则替换
//金额所在列和行,去模板表中查找,如果行列一致则替换
for
(
let
i
=
0
;
i
<
duplicateData
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
duplicateData
.
length
;
i
++
)
{
// // 对比 c 和 r 是否与 CompositeTable[0]["celldata"] 中相应对象相同
// // 对比 c 和 r 是否与 CompositeTable[0]["celldata"] 中相应对象相同
for
(
let
ii
=
0
;
ii
<
CompositeTable
[
0
][
"
celldata
"
].
length
;
ii
++
)
{
for
(
let
k
=
0
;
k
<
CompositeTable
[
0
][
"
celldata
"
].
length
;
k
++
)
{
if
(
duplicateData
[
i
].
r
===
CompositeTable
[
0
][
"
celldata
"
][
ii
].
r
&&
duplicateData
[
i
].
c
===
CompositeTable
[
0
][
"
celldata
"
][
ii
].
c
)
{
if
(
duplicateData
[
i
].
r
===
CompositeTable
[
0
][
"
celldata
"
][
k
].
r
&&
duplicateData
[
i
].
c
===
CompositeTable
[
0
][
"
celldata
"
][
k
].
c
)
{
// 如果相同,则进行替换
// 如果相同,则进行替换
CompositeTable
[
0
][
"
celldata
"
][
ii
]
=
duplicateData
[
i
];
CompositeTable
[
0
][
"
celldata
"
][
k
]
=
duplicateData
[
i
];
}
}
}
}
}
}
CompositeTable
[
0
].
data
=
luckysheet
.
transToData
(
CompositeTable
[
0
][
"
celldata
"
])
CompositeTable
[
0
].
data
=
luckysheet
.
transToData
(
CompositeTable
[
0
][
"
celldata
"
])
if
(
this
.
value
===
1257
)
{
if
(
!
(
this
.
value
.
includes
(
'
凭证
'
))
)
{
luckysheet
.
create
({
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
fileName
,
// Excel 文件名
title
:
fileName
,
// Excel 文件名
...
@@ -997,6 +1015,7 @@
...
@@ -997,6 +1015,7 @@
item
.
code
=
''
;
item
.
code
=
''
;
item
.
cc
=
''
;
item
.
cc
=
''
;
item
.
v
.
name
=
''
;
item
.
v
.
name
=
''
;
item
.
index
=
item
.
r
});
});
for
(
let
i
=
0
;
i
<
money
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
money
.
length
;
i
++
)
{
...
@@ -1109,9 +1128,9 @@
...
@@ -1109,9 +1128,9 @@
let
existingItem
=
cellMap
.
get
(
key
);
let
existingItem
=
cellMap
.
get
(
key
);
existingItem
.
v
.
v
=
Number
(
existingItem
.
v
.
v
)
+
Number
(
money
[
i
].
v
.
v
);
existingItem
.
v
.
v
=
Number
(
existingItem
.
v
.
v
)
+
Number
(
money
[
i
].
v
.
v
);
existingItem
.
v
.
m
=
existingItem
.
v
.
v
.
toString
();
existingItem
.
v
.
m
=
existingItem
.
v
.
v
.
toString
();
existingItem
.
index
.
push
(
i
);
existingItem
.
index
.
push
(
money
[
i
].
index
);
}
else
{
}
else
{
money
[
i
].
index
=
[
i
];
money
[
i
].
index
=
[
money
[
i
].
index
];
cellMap
.
set
(
key
,
money
[
i
]);
cellMap
.
set
(
key
,
money
[
i
]);
}
}
}
}
...
@@ -1129,15 +1148,15 @@
...
@@ -1129,15 +1148,15 @@
//金额所在列和行,去模板表中查找,如果行列一致则替换
//金额所在列和行,去模板表中查找,如果行列一致则替换
for
(
let
i
=
0
;
i
<
duplicateData
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
duplicateData
.
length
;
i
++
)
{
// // 对比 c 和 r 是否与 CompositeTable[0]["celldata"] 中相应对象相同
// // 对比 c 和 r 是否与 CompositeTable[0]["celldata"] 中相应对象相同
for
(
let
ii
=
0
;
ii
<
CompositeTable
[
0
][
"
celldata
"
].
length
;
ii
++
)
{
for
(
let
k
=
0
;
k
<
CompositeTable
[
0
][
"
celldata
"
].
length
;
k
++
)
{
if
(
duplicateData
[
i
].
r
===
CompositeTable
[
0
][
"
celldata
"
][
ii
].
r
&&
duplicateData
[
i
].
c
===
CompositeTable
[
0
][
"
celldata
"
][
ii
].
c
)
{
if
(
duplicateData
[
i
].
r
===
CompositeTable
[
0
][
"
celldata
"
][
k
].
r
&&
duplicateData
[
i
].
c
===
CompositeTable
[
0
][
"
celldata
"
][
k
].
c
)
{
// 如果相同,则进行替换
// 如果相同,则进行替换
CompositeTable
[
0
][
"
celldata
"
][
ii
]
=
duplicateData
[
i
];
CompositeTable
[
0
][
"
celldata
"
][
k
]
=
duplicateData
[
i
];
}
}
}
}
}
}
CompositeTable
[
0
].
data
=
luckysheet
.
transToData
(
CompositeTable
[
0
][
"
celldata
"
])
CompositeTable
[
0
].
data
=
luckysheet
.
transToData
(
CompositeTable
[
0
][
"
celldata
"
])
if
(
this
.
value
!==
1248
)
{
if
(
!
(
this
.
value
.
includes
(
'
凭证
'
))
)
{
luckysheet
.
create
({
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
fileName
,
// Excel 文件名
title
:
fileName
,
// Excel 文件名
...
@@ -1169,30 +1188,20 @@
...
@@ -1169,30 +1188,20 @@
//单侯矿转换方法&& this.selectname.includes('单侯')
//单侯矿转换方法&& this.selectname.includes('单侯')
//特定规则 制造费用可能放也可能不放,制造费用后期可能会晒出来
//特定规则 制造费用可能放也可能不放,制造费用后期可能会晒出来
if
(
this
.
mine
.
includes
(
'
单侯
'
))
{
if
(
this
.
mine
.
includes
(
'
单侯
'
))
{
//部门名称所在列
let
DepartmentColumn
=
c
.
flat
().
filter
(
obj
=>
obj
.
v
&&
obj
.
v
.
v
===
"
创建部门
"
)[
0
]?.
c
;
//结算金额所在列
let
ExpenseColumn
=
c
.
flat
().
filter
(
obj
=>
obj
.
v
&&
obj
.
v
.
v
===
"
实际金额
"
)[
0
]?.
c
;
//材料编码
let
codeColumn
=
c
.
flat
().
filter
(
obj
=>
obj
.
v
&&
obj
.
v
.
v
===
"
材料编码
"
)[
0
]?.
c
let
headRows
=
this
.
newArray
[
0
].
celldata
.
flat
().
filter
(
obj
=>
obj
.
v
&&
obj
.
v
.
v
===
"
火工品
"
)[
0
]?.
r
let
headRows
=
this
.
newArray
[
0
].
celldata
.
flat
().
filter
(
obj
=>
obj
.
v
&&
obj
.
v
.
v
===
"
火工品
"
)[
0
]?.
r
//费用来源
//费用来源
let
fylyColumn
=
c
.
flat
().
filter
(
obj
=>
obj
.
v
&&
obj
.
v
.
v
===
"
费用来源
"
)[
0
]?.
c
let
fylyColumn
=
c
.
flat
().
filter
(
obj
=>
obj
.
v
&&
obj
.
v
.
v
===
"
费用来源
"
)[
0
]?.
c
if
(
DepartmentColumn
&&
ExpenseColumn
&&
codeColumn
&&
fylyColumn
)
{
if
(
Department
&&
money
&&
code
)
{
let
code
=
c
.
flat
().
filter
(
obj
=>
obj
.
c
&&
obj
.
c
===
codeColumn
&&
obj
.
r
>
0
)
let
headRow
=
this
.
newArray
[
0
].
celldata
.
flat
().
filter
(
obj
=>
obj
.
r
&&
obj
.
r
===
headRows
&&
obj
.
c
>
0
)
let
headRow
=
this
.
newArray
[
0
].
celldata
.
flat
().
filter
(
obj
=>
obj
.
r
&&
obj
.
r
===
headRows
&&
obj
.
c
>
0
)
let
money
=
c
.
flat
().
filter
(
obj
=>
obj
.
c
&&
obj
.
c
===
ExpenseColumn
&&
obj
.
r
>
0
)
let
remark
=
c
.
flat
().
filter
(
obj
=>
obj
.
c
&&
obj
.
c
===
DepartmentColumn
&&
obj
.
r
>
0
)
let
fyly
=
c
.
flat
().
filter
(
obj
=>
obj
.
c
&&
obj
.
c
===
fylyColumn
&&
obj
.
r
>
0
)
let
fyly
=
c
.
flat
().
filter
(
obj
=>
obj
.
c
&&
obj
.
c
===
fylyColumn
&&
obj
.
r
>
0
)
// 清空money数组中的属性
// 清空money数组中的属性
money
.
forEach
(
item
=>
{
money
.
forEach
(
item
=>
{
item
.
remark
=
''
;
item
.
Department
=
''
;
item
.
code
=
''
;
item
.
code
=
''
;
item
.
cc
=
''
;
item
.
cc
=
''
;
item
.
fyly
=
''
;
item
.
fyly
=
''
;
item
.
rr
=
''
;
item
.
rr
=
''
;
item
.
index
=
item
.
r
});
});
// 更新money数组中的属性
// 更新money数组中的属性
money
=
money
.
filter
(
item
=>
{
money
=
money
.
filter
(
item
=>
{
...
@@ -1201,9 +1210,9 @@
...
@@ -1201,9 +1210,9 @@
item
.
code
=
matchingCode
.
v
.
v
;
item
.
code
=
matchingCode
.
v
.
v
;
}
}
let
matchingRemark
=
remark
.
find
(
r
=>
r
.
r
===
item
.
r
);
let
matchingRemark
=
Department
.
find
(
r
=>
r
.
r
===
item
.
r
);
if
(
matchingRemark
)
{
if
(
matchingRemark
)
{
item
.
remark
=
matchingRemark
.
v
.
v
;
item
.
Department
=
matchingRemark
.
v
.
v
;
}
}
let
matchingFyly
=
fyly
.
find
(
f
=>
f
.
r
===
item
.
r
);
let
matchingFyly
=
fyly
.
find
(
f
=>
f
.
r
===
item
.
r
);
...
@@ -1215,18 +1224,18 @@
...
@@ -1215,18 +1224,18 @@
});
});
money
.
forEach
((
item
)
=>
{
money
.
forEach
((
item
)
=>
{
if
(
item
.
remark
.
startsWith
(
'
物管科
'
))
{
if
(
item
.
Department
.
startsWith
(
'
物管科
'
))
{
item
.
remark
=
'
物管科
'
;
item
.
Department
=
'
物管科
'
;
}
}
if
(
item
.
remark
.
endsWith
(
'
储运科
'
))
{
if
(
item
.
Department
.
endsWith
(
'
储运科
'
))
{
item
.
remark
=
'
储运科
'
;
item
.
Department
=
'
储运科
'
;
}
}
if
(
item
.
remark
.
includes
(
'
生活
'
))
{
if
(
item
.
Department
.
includes
(
'
生活
'
))
{
item
.
remark
=
'
生活科
'
item
.
Department
=
'
生活科
'
}
}
});
});
money
=
money
.
map
(
obj
=>
{
money
=
money
.
map
(
obj
=>
{
let
v
=
obj
.
remark
;
let
v
=
obj
.
Department
;
for
(
let
key
in
classify
)
{
for
(
let
key
in
classify
)
{
if
(
classify
[
key
].
includes
(
v
))
{
if
(
classify
[
key
].
includes
(
v
))
{
obj
.
v
.
name
=
key
;
obj
.
v
.
name
=
key
;
...
@@ -1239,11 +1248,11 @@
...
@@ -1239,11 +1248,11 @@
for
(
let
i
=
0
;
i
<
codess
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
codess
.
length
;
i
++
)
{
let
codeLength
=
String
(
codess
[
i
].
code
).
length
;
let
codeLength
=
String
(
codess
[
i
].
code
).
length
;
let
codeToCompare
=
String
(
codess
[
i
].
code
).
substring
(
0
,
codeLength
);
let
codeToCompare
=
String
(
codess
[
i
].
code
).
substring
(
0
,
codeLength
);
for
(
let
ii
=
0
;
ii
<
money
.
length
;
ii
++
)
{
for
(
let
k
=
0
;
k
<
money
.
length
;
k
++
)
{
let
columnIdString
=
String
(
money
[
ii
].
code
);
let
columnIdString
=
String
(
money
[
k
].
code
);
let
idToMatch
=
columnIdString
.
substring
(
0
,
codeLength
);
let
idToMatch
=
columnIdString
.
substring
(
0
,
codeLength
);
if
(
idToMatch
===
codeToCompare
)
{
if
(
idToMatch
===
codeToCompare
)
{
money
[
ii
].
cc
=
codess
[
i
].
oneLevel
*
1
money
[
k
].
cc
=
codess
[
i
].
oneLevel
*
1
}
}
}
}
}
}
...
@@ -1252,7 +1261,7 @@
...
@@ -1252,7 +1261,7 @@
head
.
forEach
(
itemA
=>
{
head
.
forEach
(
itemA
=>
{
let
targetRemark
=
itemA
.
v
.
v
;
// 需要匹配的目标值,这里是 a 属性中的 v.v
let
targetRemark
=
itemA
.
v
.
v
;
// 需要匹配的目标值,这里是 a 属性中的 v.v
money
.
forEach
(
itemB
=>
{
money
.
forEach
(
itemB
=>
{
if
(
itemB
.
remark
.
includes
(
targetRemark
))
{
// 使用 include 方法进行模糊匹配
if
(
itemB
.
Department
.
includes
(
targetRemark
))
{
// 使用 include 方法进行模糊匹配
itemB
.
rr
=
itemA
.
r
;
// 如果匹配到,则将 a 属性中的 r 的值赋给 b 属性中的 rr
itemB
.
rr
=
itemA
.
r
;
// 如果匹配到,则将 a 属性中的 r 的值赋给 b 属性中的 rr
}
}
});
});
...
@@ -1271,17 +1280,15 @@
...
@@ -1271,17 +1280,15 @@
}
}
let
seen
=
new
Map
();
let
seen
=
new
Map
();
let
duplicateData
=
[];
let
duplicateData
=
[];
let
i
=
-
1
for
(
let
obj
of
money
)
{
for
(
let
obj
of
money
)
{
let
key
=
obj
.
r
+
'
,
'
+
obj
.
c
;
let
key
=
obj
.
r
+
'
,
'
+
obj
.
c
;
i
+=
1
if
(
seen
.
has
(
key
))
{
if
(
seen
.
has
(
key
))
{
let
existingObj
=
seen
.
get
(
key
);
let
existingObj
=
seen
.
get
(
key
);
existingObj
.
v
.
v
=
Number
(
existingObj
.
v
.
v
)
+
Number
(
obj
.
v
.
v
);
existingObj
.
v
.
v
=
Number
(
existingObj
.
v
.
v
)
+
Number
(
obj
.
v
.
v
);
existingObj
.
v
.
m
=
existingObj
.
v
.
v
.
toString
();
existingObj
.
v
.
m
=
existingObj
.
v
.
v
.
toString
();
existingObj
.
index
.
push
(
i
)
existingObj
.
index
.
push
(
obj
.
index
)
}
else
{
}
else
{
obj
.
index
=
[
i
]
obj
.
index
=
[
obj
.
index
]
seen
.
set
(
key
,
obj
);
seen
.
set
(
key
,
obj
);
}
}
}
}
...
@@ -1292,15 +1299,15 @@
...
@@ -1292,15 +1299,15 @@
}
}
for
(
let
i
=
0
;
i
<
duplicateData
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
duplicateData
.
length
;
i
++
)
{
// // 对比 c 和 r 是否与 he[0]["celldata"] 中相应对象相同
// // 对比 c 和 r 是否与 he[0]["celldata"] 中相应对象相同
for
(
let
ii
=
0
;
ii
<
synthesis
[
0
][
"
celldata
"
].
length
;
ii
++
)
{
for
(
let
k
=
0
;
k
<
synthesis
[
0
][
"
celldata
"
].
length
;
k
++
)
{
if
(
duplicateData
[
i
].
r
===
synthesis
[
0
][
"
celldata
"
][
ii
].
r
&&
duplicateData
[
i
].
c
===
synthesis
[
0
][
"
celldata
"
][
ii
].
c
)
{
if
(
duplicateData
[
i
].
r
===
synthesis
[
0
][
"
celldata
"
][
k
].
r
&&
duplicateData
[
i
].
c
===
synthesis
[
0
][
"
celldata
"
][
k
].
c
)
{
// 如果相同,则进行替换
// 如果相同,则进行替换
synthesis
[
0
][
"
celldata
"
][
ii
]
=
duplicateData
[
i
];
synthesis
[
0
][
"
celldata
"
][
k
]
=
duplicateData
[
i
];
}
}
}
}
}
}
synthesis
[
0
].
data
=
luckysheet
.
transToData
(
synthesis
[
0
][
"
celldata
"
])
synthesis
[
0
].
data
=
luckysheet
.
transToData
(
synthesis
[
0
][
"
celldata
"
])
if
(
this
.
value
!==
1248
)
{
if
(
!
(
this
.
value
.
includes
(
'
凭证
'
))
)
{
luckysheet
.
create
({
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
fileName
,
// Excel 文件名
title
:
fileName
,
// Excel 文件名
...
@@ -1364,6 +1371,7 @@
...
@@ -1364,6 +1371,7 @@
existingObj
.
v
.
v
=
Number
(
existingObj
.
v
.
v
)
+
Number
(
obj
.
v
.
v
);
existingObj
.
v
.
v
=
Number
(
existingObj
.
v
.
v
)
+
Number
(
obj
.
v
.
v
);
existingObj
.
v
.
m
=
existingObj
.
v
.
v
.
toString
();
existingObj
.
v
.
m
=
existingObj
.
v
.
v
.
toString
();
}
else
{
}
else
{
seens
.
set
(
key
,
obj
);
seens
.
set
(
key
,
obj
);
}
}
}
}
...
@@ -1378,11 +1386,230 @@
...
@@ -1378,11 +1386,230 @@
this
.
showMask
=
false
;
this
.
showMask
=
false
;
}
}
}
}
//吕矿转换,
//吕矿规则,他自己带成本费用,只需要找到部门列 然后合并行
if
(
this
.
mine
.
includes
(
'
吕矿
'
))
{
let
results
=
[
'
10.安全费用
'
,
'
11.研究费用
'
,
'
12.维简及井巷费
'
]
//先把安全费用 研发什么的插入到成本材料表中
for
(
let
i
=
0
,
k
=
0
;
i
<
CompositeTable
[
0
].
celldata
.
length
&&
k
<
results
.
length
;
i
++
)
{
if
(
CompositeTable
[
0
].
celldata
[
i
]
&&
CompositeTable
[
0
].
celldata
[
i
].
r
&&
CompositeTable
[
0
].
celldata
[
i
].
r
>=
23
&&
CompositeTable
[
0
].
celldata
[
i
].
r
<
26
&&
CompositeTable
[
0
].
celldata
[
i
].
c
==
0
)
{
CompositeTable
[
0
].
celldata
[
i
].
v
.
v
=
results
[
k
];
CompositeTable
[
0
].
celldata
[
i
].
v
.
m
=
results
[
k
];
k
++
;
}
}
let
c
=
JSON
.
parse
(
cjson
)
// 使用 filter 方法筛选 r 值为 1 的对象,得到贷款信息
const
loan
=
c
.
filter
(
obj
=>
obj
.
r
===
1
);
// 使用 filter 方法筛选 r 值为 0 的对象,得到表头信息
const
head
=
c
.
filter
(
obj
=>
obj
.
r
===
0
);
// 找出空白列
const
mincolumn
=
head
.
filter
(
obj
=>
!
obj
.
v
.
v
);
// 获取最大列
const
maxcolumn
=
loan
[
loan
.
length
-
1
].
c
;
// 遍历空白列,根据表头信息进行填充
for
(
let
k
=
0
;
k
<
mincolumn
.
length
;
k
++
)
{
let
i
=
1
;
while
(
true
)
{
const
targetHead
=
head
.
find
(
obj
=>
obj
.
c
===
mincolumn
[
k
].
c
-
i
);
if
(
targetHead
&&
targetHead
.
v
.
v
!==
undefined
)
{
mincolumn
[
k
].
v
.
v
=
targetHead
.
v
.
v
;
break
;
}
i
++
;
}
}
// 更新表格中的空白列数据
mincolumn
.
forEach
(
min
=>
{
const
matchingCell
=
c
.
find
(
cell
=>
cell
.
r
===
min
.
r
&&
cell
.
c
===
min
.
c
);
if
(
matchingCell
)
{
matchingCell
.
v
.
v
=
min
.
v
.
v
;
}
});
// 获取最小列
const
min
=
mincolumn
[
0
].
c
-
1
;
// 使用 filter 方法筛选包含有效值的对象
const
max
=
c
.
filter
(
obj
=>
obj
.
v
.
v
);
for
(
let
i
=
max
.
length
-
1
;
i
>=
0
;
i
--
)
{
const
item
=
max
[
i
];
if
(
item
.
v
.
v
===
"
NaN
"
)
{
max
.
splice
(
i
,
1
);
}
}
// 获取编码列的索引
const
codecolumn
=
max
.
find
(
obj
=>
obj
.
c
===
2
).
c
;
// 获取表头合并所需的信息
const
head1
=
max
.
filter
(
obj
=>
obj
.
r
>=
2
&&
obj
.
c
===
codecolumn
);
// 遍历表格,为每一项添加类别信息和金额信息
max
.
forEach
(
obj
=>
{
if
(
obj
.
r
>
0
&&
obj
.
c
>=
min
)
{
let
coulumn
=
obj
.
c
;
obj
.
v
.
name
=
max
.
find
(
c
=>
c
.
c
===
coulumn
&&
c
.
r
===
0
).
v
.
v
;
obj
.
category
=
max
.
find
(
c
=>
c
.
c
===
coulumn
&&
c
.
r
===
1
)?.
v
.
v
;
}
});
// 输出整理后的表格数据
const
code
=
max
.
filter
(
obj
=>
obj
.
r
>=
2
&&
obj
.
c
==
2
);
// 获取金额列
const
moneycolumn
=
max
.
filter
(
obj
=>
obj
.
r
>=
2
&&
obj
.
c
>=
min
);
moneycolumn
.
forEach
(
money
=>
{
const
matchingCode
=
code
.
find
(
code
=>
code
.
r
===
money
.
r
);
if
(
matchingCode
)
{
money
.
code
=
matchingCode
.
v
.
v
;
}
});
const
money
=
moneycolumn
.
filter
(
obj
=>
(
obj
.
category
.
includes
(
'
单价
'
)
||
obj
.
category
.
includes
(
'
数量
'
)));
// 计算总金额
const
result
=
[];
const
map
=
new
Map
();
money
.
forEach
(
item
=>
{
if
(
map
.
has
(
item
.
r
))
{
const
existingItem
=
map
.
get
(
item
.
r
);
existingItem
.
v
.
v
*=
parseFloat
(
item
.
v
.
v
);
}
else
{
map
.
set
(
item
.
r
,
{
...
item
,
v
:
{
...
item
.
v
,
v
:
parseFloat
(
item
.
v
.
v
)
},
category
:
"
总金额
"
});
}
});
map
.
forEach
(
value
=>
result
.
push
(
value
));
// 对 部门分类 进行处理
const
duplicateDatas
=
result
.
map
(
item
=>
{
let
categories
=
item
.
v
.
name
;
if
(
categories
.
includes
(
'
--
'
)
||
categories
.
includes
(
'
-
'
))
{
categories
=
categories
.
replace
(
/--/g
,
'
-
'
);
}
else
{
categories
+=
'
-
'
;
}
item
.
v
.
name
=
categories
;
return
item
;
});
duplicateDatas
.
forEach
(
item
=>
{
item
.
index
=
item
.
r
if
(
item
.
v
.
name
!==
undefined
)
{
let
index
=
item
.
v
.
name
.
indexOf
(
"
-
"
);
if
(
index
!==
-
1
)
{
let
substrBeforeDash
=
item
.
v
.
name
.
slice
(
0
,
index
);
let
DepartColumns
=
CompositeTable
[
0
][
"
celldata
"
].
flat
().
filter
(
obj
=>
{
if
(
obj
.
v
&&
obj
.
v
.
v
&&
typeof
obj
.
v
.
v
===
'
string
'
)
{
return
obj
.
v
.
v
.
includes
(
item
.
v
.
name
.
slice
(
0
,
index
));
}
return
false
;
})[
0
];
if
(
DepartColumns
&&
DepartColumns
.
r
)
{
let
index
=
item
.
v
.
name
.
indexOf
(
"
-
"
);
if
(
index
!==
-
1
)
{
let
substrAfterDash
=
item
.
v
.
name
.
slice
(
index
+
1
);
switch
(
substrAfterDash
)
{
case
''
:
item
.
r
=
DepartColumns
.
r
;
break
;
case
'
原煤
'
:
item
.
r
=
DepartColumns
.
r
+
1
;
break
;
case
'
洗煤
'
:
item
.
r
=
DepartColumns
.
r
+
2
;
break
;
case
'
选煤
'
:
item
.
r
=
DepartColumns
.
r
+
3
;
break
;
case
'
厂区服务
'
:
item
.
r
=
DepartColumns
.
r
+
1
;
break
;
default
:
// 默认情况
}
}
}
}
}
});
codess
.
forEach
(
codeItem
=>
{
let
codeLength
=
String
(
codeItem
.
code
).
length
;
let
codeToCompare
=
String
(
codeItem
.
code
).
substring
(
0
,
codeLength
);
let
matchingItem
=
duplicateDatas
.
find
(
duplicateItem
=>
String
(
duplicateItem
.
code
).
startsWith
(
codeToCompare
));
if
(
matchingItem
)
{
matchingItem
.
cc
=
codeItem
.
oneLevel
*
1
;
}
});
duplicateDatas
.
forEach
((
item
)
=>
{
item
.
c
=
item
.
cc
?
item
.
cc
*
1
:
10
;
});
//同一个单元格的数据 金额相加。
let
duplicateData
=
[];
let
seen
=
new
Map
();
// 根据行列信息合并重复数据并记录索引
for
(
let
obj
of
duplicateDatas
)
{
let
key
=
obj
.
r
+
'
,
'
+
obj
.
c
;
if
(
seen
.
has
(
key
))
{
let
existingObj
=
seen
.
get
(
key
);
existingObj
.
v
.
v
+=
obj
.
v
.
v
;
existingObj
.
v
.
m
=
(
parseInt
(
existingObj
.
v
.
m
)
+
parseInt
(
obj
.
v
.
m
)).
toString
();
existingObj
.
index
.
push
(
obj
.
index
);
}
else
{
obj
.
index
=
[
obj
.
index
];
seen
.
set
(
key
,
obj
);
}
}
// 将合并后的数据放入 duplicateData 数组
for
(
let
obj
of
seen
.
values
())
{
if
(
obj
.
v
.
v
>
0
||
parseInt
(
obj
.
v
.
m
)
>
0
)
{
duplicateData
.
push
(
obj
);
}
}
duplicateData
=
duplicateData
.
map
(
item
=>
{
return
{
...
item
,
v
:
{
...
item
.
v
,
v
:
isNaN
(
item
.
v
.
v
)
?
item
.
v
.
v
:
Number
(
item
.
v
.
v
).
toFixed
(
2
)
}
};
});
// 替换金额所在列和行相同的模板表中的数据
//金额所在列和行,去模板表中查找,如果行列一致则替换
for
(
let
i
=
0
;
i
<
duplicateData
.
length
;
i
++
)
{
// // 对比 c 和 r 是否与 CompositeTable[0]["celldata"] 中相应对象相同
for
(
let
k
=
0
;
k
<
CompositeTable
[
0
][
"
celldata
"
].
length
;
k
++
)
{
if
(
duplicateData
[
i
].
r
===
CompositeTable
[
0
][
"
celldata
"
][
k
].
r
&&
duplicateData
[
i
].
c
===
CompositeTable
[
0
][
"
celldata
"
][
k
].
c
)
{
// 如果相同,则进行替换
CompositeTable
[
0
][
"
celldata
"
][
k
]
=
duplicateData
[
i
];
}
}
}
// celldata => data 生成表格所需二维数组
CompositeTable
[
0
].
data
=
luckysheet
.
transToData
(
CompositeTable
[
0
][
"
celldata
"
])
if
(
!
(
this
.
value
.
includes
(
'
凭证
'
)))
{
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
fileName
,
// Excel 文件名
data
:
CompositeTable
,
// Excel 数据
showinfobar
:
false
,
//是否显示顶部名称栏
lang
:
'
zh
'
,
});
modify
=
true
this
.
showMask
=
false
;
}
//this.from 往后台村的数据
this
.
ImportTables
.
historyContent
=
resultJSON
this
.
generate
.
historyContent
=
JSON
.
stringify
(
CompositeTable
)
//往后台传科目编码相关的东西
duplicateData
.
forEach
(
obj
=>
{
CompositeTable
[
0
].
celldata
.
forEach
(
cell
=>
{
if
(
obj
.
c
===
cell
.
c
&&
cell
.
r
===
3
)
{
obj
.
v
.
material
=
cell
.
v
.
v
;
}
});
});
this
.
middle
=
CompositeTable
this
.
Vouchers
(
duplicateData
)
}
});
});
},
},
//成本表往凭证但转
//成本表往凭证但转
Vouchers
(
duplicateData
)
{
Vouchers
(
duplicateData
)
{
console
.
log
(
duplicateData
)
this
.
detail
=
duplicateData
.
map
(
item
=>
{
this
.
detail
=
duplicateData
.
map
(
item
=>
{
if
(
typeof
item
.
v
.
v
===
'
number
'
)
{
if
(
typeof
item
.
v
.
v
===
'
number
'
)
{
item
.
v
.
v
=
Number
(
item
.
v
.
v
.
toFixed
(
2
));
// 如果是数字,则进行处理
item
.
v
.
v
=
Number
(
item
.
v
.
v
.
toFixed
(
2
));
// 如果是数字,则进行处理
...
@@ -1513,8 +1740,7 @@
...
@@ -1513,8 +1740,7 @@
// this.ImportTables.exportUuid = 1;
// this.ImportTables.exportUuid = 1;
this
.
ImportTables
.
mining
=
this
.
select
this
.
ImportTables
.
mining
=
this
.
select
this
.
ImportTables
.
tylkStatus
=
3
this
.
ImportTables
.
tylkStatus
=
3
this
.
ImportTables
.
templateId
=
this
.
value
this
.
generate
.
templateId
=
this
.
value
this
.
generate
.
tylkStatus
=
3
this
.
generate
.
tylkStatus
=
3
// this.generate.exportUuid = 1;
// this.generate.exportUuid = 1;
this
.
generate
.
identifyingCode
=
1
;
this
.
generate
.
identifyingCode
=
1
;
...
@@ -1538,17 +1764,18 @@
...
@@ -1538,17 +1764,18 @@
if
(
Array
.
isArray
(
item
.
indexRow
))
{
if
(
Array
.
isArray
(
item
.
indexRow
))
{
extractedItem
.
indexRow
=
item
.
indexRow
.
join
(
'
,
'
);
extractedItem
.
indexRow
=
item
.
indexRow
.
join
(
'
,
'
);
}
}
if
(
item
.
name
)
{
extractedItem
.
name
=
item
.
name
;
}
return
extractedItem
;
return
extractedItem
;
});
});
let
historyContent
=
[];
let
historyContent
=
[];
for
(
let
i
=
0
;
i
<
this
.
ImportTables
.
historyRole
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
ImportTables
.
historyRole
.
length
;
i
++
)
{
if
(
this
.
ImportTables
.
historyRole
[
i
].
indexRow
&&
this
.
ImportTables
.
historyRole
[
i
].
accountingCode
)
{
if
(
this
.
ImportTables
.
historyRole
[
i
].
indexRow
&&
this
.
ImportTables
.
historyRole
[
i
].
accountingCode
)
{
const
indexRowArray
=
this
.
ImportTables
.
historyRole
[
i
].
indexRow
.
split
(
'
,
'
);
const
indexRowArray
=
this
.
ImportTables
.
historyRole
[
i
].
indexRow
.
split
(
'
,
'
);
for
(
let
j
=
0
;
j
<
indexRowArray
.
length
;
j
++
)
{
for
(
let
j
=
0
;
j
<
indexRowArray
.
length
;
j
++
)
{
let
historyRole
=
{
let
historyRole
=
{
value
:
this
.
ImportTables
.
historyRole
[
i
].
accountingCode
,
value
:
`
${
this
.
ImportTables
.
historyRole
[
i
].
accountingCode
}
,
${
this
.
ImportTables
.
historyRole
[
i
].
name
}
`
,
key
:
String
(
indexRowArray
[
j
])
key
:
String
(
indexRowArray
[
j
])
};
};
...
@@ -1556,6 +1783,8 @@
...
@@ -1556,6 +1783,8 @@
}
}
}
}
}
}
console
.
log
(
this
.
ImportTables
.
historyRole
)
console
.
log
(
historyContent
)
this
.
ImportTables
.
historyRole
=
JSON
.
stringify
(
historyContent
)
this
.
ImportTables
.
historyRole
=
JSON
.
stringify
(
historyContent
)
for
(
let
i
=
0
;
i
<
sum
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
sum
.
length
;
i
++
)
{
for
(
let
j
=
0
;
j
<
filteredArr
.
length
;
j
++
)
{
for
(
let
j
=
0
;
j
<
filteredArr
.
length
;
j
++
)
{
...
@@ -1734,7 +1963,7 @@
...
@@ -1734,7 +1963,7 @@
isArray
.
push
(
newRow
,
newRow1
);
isArray
.
push
(
newRow
,
newRow1
);
}
}
VoucherForm
[
0
].
celldata
.
push
(...
isArray
)
VoucherForm
[
0
].
celldata
.
push
(...
isArray
)
if
(
this
.
value
===
1248
)
{
if
(
this
.
value
.
includes
(
'
凭证
'
)
)
{
luckysheet
.
create
({
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
...
@@ -1748,13 +1977,13 @@
...
@@ -1748,13 +1977,13 @@
modify
=
true
modify
=
true
this
.
showMask
=
false
;
this
.
showMask
=
false
;
}
}
//
addInsert(list).then(response => {
addInsert
(
list
).
then
(
response
=>
{
//
if (response.code == 200) {
if
(
response
.
code
==
200
)
{
//
this.$message({
this
.
$message
({
//
message: '保存成功', type: 'success'
message
:
'
保存成功
'
,
type
:
'
success
'
//
})
})
//
}
}
//
});
});
VoucherForm
[
0
].
celldata
=
[]
VoucherForm
[
0
].
celldata
=
[]
})
})
...
@@ -1852,12 +2081,12 @@
...
@@ -1852,12 +2081,12 @@
},
500
),
// 设置延迟时间,单位为毫秒
},
500
),
// 设置延迟时间,单位为毫秒
}
}
// 配置项111
// 配置项111
};
};
// debounce函数定义
// debounce函数定义
function
debounce
(
func
,
delay
)
{
function
debounce
(
func
,
delay
)
{
let
timer
;
let
timer
;
return
function
()
{
return
function
()
{
const
context
=
this
;
const
context
=
this
;
...
@@ -1867,8 +2096,8 @@
...
@@ -1867,8 +2096,8 @@
func
.
apply
(
context
,
args
);
func
.
apply
(
context
,
args
);
},
delay
);
},
delay
);
};
};
}
}
function
getKeyByValue
(
map
,
value
)
{
function
getKeyByValue
(
map
,
value
)
{
for
(
let
[
key
,
val
]
of
map
)
{
for
(
let
[
key
,
val
]
of
map
)
{
if
(
val
===
value
)
{
if
(
val
===
value
)
{
return
key
;
return
key
;
...
@@ -1877,15 +2106,15 @@
...
@@ -1877,15 +2106,15 @@
return
key
;
return
key
;
}
}
}
}
}
}
function
generateUUID
()
{
function
generateUUID
()
{
let
array
=
new
Uint32Array
(
4
);
let
array
=
new
Uint32Array
(
4
);
window
.
crypto
.
getRandomValues
(
array
);
window
.
crypto
.
getRandomValues
(
array
);
return
array
.
join
(
"
-
"
);
return
array
.
join
(
"
-
"
);
}
}
</
script
>
</
script
>
<
style
>
<
style
>
.mask
{
.mask
{
position
:
fixed
;
position
:
fixed
;
top
:
0
;
top
:
0
;
left
:
0
;
left
:
0
;
...
@@ -1895,9 +2124,9 @@
...
@@ -1895,9 +2124,9 @@
display
:
flex
;
display
:
flex
;
justify-content
:
center
;
justify-content
:
center
;
align-items
:
center
;
align-items
:
center
;
}
}
.loading-spinner
{
.loading-spinner
{
/* 添加你的加载动画样式 */
/* 添加你的加载动画样式 */
width
:
40px
;
width
:
40px
;
height
:
40px
;
height
:
40px
;
...
@@ -1905,9 +2134,9 @@
...
@@ -1905,9 +2134,9 @@
border
:
4px
solid
#f3f3f3
;
border
:
4px
solid
#f3f3f3
;
border-top
:
4px
solid
#3498db
;
border-top
:
4px
solid
#3498db
;
animation
:
spin
1s
linear
infinite
;
animation
:
spin
1s
linear
infinite
;
}
}
@keyframes
spin
{
@keyframes
spin
{
0
%
{
0
%
{
transform
:
rotate
(
0deg
);
transform
:
rotate
(
0deg
);
}
}
...
@@ -1915,5 +2144,5 @@
...
@@ -1915,5 +2144,5 @@
100
%
{
100
%
{
transform
:
rotate
(
360deg
);
transform
:
rotate
(
360deg
);
}
}
}
}
</
style
>
</
style
>
ruoyi-ui/src/views/system/user/index.vue
View file @
c6cf5960
...
@@ -4,78 +4,35 @@
...
@@ -4,78 +4,35 @@
<!--部门数据-->
<!--部门数据-->
<el-col
:span=
"4"
:xs=
"24"
>
<el-col
:span=
"4"
:xs=
"24"
>
<div
class=
"head-container"
>
<div
class=
"head-container"
>
<el-input
<el-input
v-model=
"deptName"
placeholder=
"请输入部门名称"
clearable
size=
"small"
prefix-icon=
"el-icon-search"
v-model=
"deptName"
style=
"margin-bottom: 20px"
/>
placeholder=
"请输入部门名称"
clearable
size=
"small"
prefix-icon=
"el-icon-search"
style=
"margin-bottom: 20px"
/>
</div>
</div>
<div
class=
"head-container"
>
<div
class=
"head-container"
>
<el-tree
<el-tree
:data=
"deptOptions"
:props=
"defaultProps"
:expand-on-click-node=
"false"
:data=
"deptOptions"
:filter-node-method=
"filterNode"
:render-content=
"renderContent"
ref=
"tree"
default-expand-all
:props=
"defaultProps"
@
node-click=
"handleNodeClick"
/>
:expand-on-click-node=
"false"
:filter-node-method=
"filterNode"
:render-content=
"renderContent"
ref=
"tree"
default-expand-all
@
node-click=
"handleNodeClick"
/>
</div>
</div>
</el-col>
</el-col>
<!--用户数据-->
<!--用户数据-->
<el-col
:span=
"20"
:xs=
"24"
>
<el-col
:span=
"20"
:xs=
"24"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"用户名称"
prop=
"userName"
>
<el-form-item
label=
"用户名称"
prop=
"userName"
>
<el-input
<el-input
v-model=
"queryParams.userName"
placeholder=
"请输入用户名称"
clearable
size=
"small"
style=
"width: 240px"
v-model=
"queryParams.userName"
@
keyup.enter.native=
"handleQuery"
/>
placeholder=
"请输入用户名称"
clearable
size=
"small"
style=
"width: 240px"
@
keyup.enter.native=
"handleQuery"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"手机号码"
prop=
"phonenumber"
>
<el-form-item
label=
"手机号码"
prop=
"phonenumber"
>
<el-input
<el-input
v-model=
"queryParams.phonenumber"
placeholder=
"请输入手机号码"
clearable
size=
"small"
style=
"width: 240px"
v-model=
"queryParams.phonenumber"
@
keyup.enter.native=
"handleQuery"
/>
placeholder=
"请输入手机号码"
clearable
size=
"small"
style=
"width: 240px"
@
keyup.enter.native=
"handleQuery"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-select
<el-select
v-model=
"queryParams.status"
placeholder=
"用户状态"
clearable
size=
"small"
style=
"width: 240px"
>
v-model=
"queryParams.status"
<el-option
v-for=
"dict in statusOptions"
:key=
"dict.dictValue"
:label=
"dict.dictLabel"
placeholder=
"用户状态"
:value=
"dict.dictValue"
/>
clearable
size=
"small"
style=
"width: 240px"
>
<el-option
v-for=
"dict in statusOptions"
:key=
"dict.dictValue"
:label=
"dict.dictLabel"
:value=
"dict.dictValue"
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"创建时间"
>
<el-form-item
label=
"创建时间"
>
<el-date-picker
<el-date-picker
v-model=
"dateRange"
size=
"small"
style=
"width: 240px"
value-format=
"yyyy-MM-dd"
v-model=
"dateRange"
type=
"daterange"
range-separator=
"-"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
></el-date-picker>
size=
"small"
style=
"width: 240px"
value-format=
"yyyy-MM-dd"
type=
"daterange"
range-separator=
"-"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
></el-date-picker>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
...
@@ -85,57 +42,24 @@
...
@@ -85,57 +42,24 @@
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
<el-button
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
type=
"primary"
v-hasPermi=
"['system:user:add']"
>
新增
</el-button>
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['system:user:add']"
>
新增
</el-button>
</el-col>
</el-col>
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
<el-button
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"single"
@
click=
"handleUpdate"
type=
"success"
v-hasPermi=
"['system:user:edit']"
>
修改
</el-button>
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"single"
@
click=
"handleUpdate"
v-hasPermi=
"['system:user:edit']"
>
修改
</el-button>
</el-col>
</el-col>
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
<el-button
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
type=
"danger"
v-hasPermi=
"['system:user:remove']"
>
删除
</el-button>
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['system:user:remove']"
>
删除
</el-button>
</el-col>
</el-col>
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
<el-button
<el-button
type=
"info"
plain
icon=
"el-icon-upload2"
size=
"mini"
@
click=
"handleImport"
type=
"info"
v-hasPermi=
"['system:user:import']"
>
导入
</el-button>
plain
icon=
"el-icon-upload2"
size=
"mini"
@
click=
"handleImport"
v-hasPermi=
"['system:user:import']"
>
导入
</el-button>
</el-col>
</el-col>
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
<el-button
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
:loading=
"exportLoading"
type=
"warning"
@
click=
"handleExport"
v-hasPermi=
"['system:user:export']"
>
导出
</el-button>
plain
icon=
"el-icon-download"
size=
"mini"
:loading=
"exportLoading"
@
click=
"handleExport"
v-hasPermi=
"['system:user:export']"
>
导出
</el-button>
</el-col>
</el-col>
<right-toolbar
:showSearch.sync=
"showSearch"
@
queryTable=
"getList"
:columns=
"columns"
></right-toolbar>
<right-toolbar
:showSearch.sync=
"showSearch"
@
queryTable=
"getList"
:columns=
"columns"
></right-toolbar>
</el-row>
</el-row>
...
@@ -143,18 +67,18 @@
...
@@ -143,18 +67,18 @@
<el-table
v-loading=
"loading"
:data=
"userList"
@
selection-change=
"handleSelectionChange"
>
<el-table
v-loading=
"loading"
:data=
"userList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"50"
align=
"center"
/>
<el-table-column
type=
"selection"
width=
"50"
align=
"center"
/>
<el-table-column
label=
"用户编号"
align=
"center"
key=
"userId"
prop=
"userId"
v-if=
"columns[0].visible"
/>
<el-table-column
label=
"用户编号"
align=
"center"
key=
"userId"
prop=
"userId"
v-if=
"columns[0].visible"
/>
<el-table-column
label=
"用户名称"
align=
"center"
key=
"userName"
prop=
"userName"
v-if=
"columns[1].visible"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"用户名称"
align=
"center"
key=
"userName"
prop=
"userName"
v-if=
"columns[1].visible"
<el-table-column
label=
"用户昵称"
align=
"center"
key=
"nickName"
prop=
"nickName"
v-if=
"columns[2].visible"
:show-overflow-tooltip=
"true"
/>
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"部门"
align=
"center"
key=
"deptName"
prop=
"dept.deptName"
v-if=
"columns[3].visible"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"用户昵称"
align=
"center"
key=
"nickName"
prop=
"nickName"
v-if=
"columns[2].visible"
<el-table-column
label=
"手机号码"
align=
"center"
key=
"phonenumber"
prop=
"phonenumber"
v-if=
"columns[4].visible"
width=
"120"
/>
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"部门"
align=
"center"
key=
"deptName"
prop=
"dept.deptName"
v-if=
"columns[3].visible"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"手机号码"
align=
"center"
key=
"phonenumber"
prop=
"phonenumber"
v-if=
"columns[4].visible"
width=
"120"
/>
<el-table-column
label=
"状态"
align=
"center"
key=
"status"
v-if=
"columns[5].visible"
>
<el-table-column
label=
"状态"
align=
"center"
key=
"status"
v-if=
"columns[5].visible"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<el-switch
<el-switch
v-model=
"scope.row.status"
active-value=
"0"
inactive-value=
"1"
v-model=
"scope.row.status"
@
change=
"handleStatusChange(scope.row)"
></el-switch>
active-value=
"0"
inactive-value=
"1"
@
change=
"handleStatusChange(scope.row)"
></el-switch>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"createTime"
v-if=
"columns[6].visible"
width=
"160"
>
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"createTime"
v-if=
"columns[6].visible"
width=
"160"
>
...
@@ -162,46 +86,20 @@
...
@@ -162,46 +86,20 @@
<span>
{{
parseTime
(
scope
.
row
.
createTime
)
}}
</span>
<span>
{{
parseTime
(
scope
.
row
.
createTime
)
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"操作"
align=
"center"
width=
"160"
class-name=
"small-padding fixed-width"
>
label=
"操作"
align=
"center"
width=
"160"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
size=
"mini"
v-hasPermi=
"['system:user:edit']"
>
修改
</el-button>
type=
"text"
<el-button
v-if=
"scope.row.userId !== 1"
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
icon=
"el-icon-edit"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['system:user:remove']"
>
删除
</el-button>
@
click=
"handleUpdate(scope.row)"
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-key"
@
click=
"handleResetPwd(scope.row)"
v-hasPermi=
"['system:user:edit']"
v-hasPermi=
"['system:user:resetPwd']"
>
重置
</el-button>
>
修改
</el-button>
<el-button
v-if=
"scope.row.userId !== 1"
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['system:user:remove']"
>
删除
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-key"
@
click=
"handleResetPwd(scope.row)"
v-hasPermi=
"['system:user:resetPwd']"
>
重置
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<pagination
<pagination
v-show=
"total > 0"
:total=
"total"
:page.sync=
"queryParams.pageNum"
:limit.sync=
"queryParams.pageSize"
v-show=
"total>0"
@
pagination=
"getList"
/>
:total=
"total"
:page.sync=
"queryParams.pageNum"
:limit.sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -248,23 +146,16 @@
...
@@ -248,23 +146,16 @@
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"用户性别"
>
<el-form-item
label=
"用户性别"
>
<el-select
v-model=
"form.sex"
placeholder=
"请选择"
>
<el-select
v-model=
"form.sex"
placeholder=
"请选择"
>
<el-option
<el-option
v-for=
"dict in sexOptions"
:key=
"dict.dictValue"
:label=
"dict.dictLabel"
v-for=
"dict in sexOptions"
:value=
"dict.dictValue"
></el-option>
:key=
"dict.dictValue"
:label=
"dict.dictLabel"
:value=
"dict.dictValue"
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"状态"
>
<el-form-item
label=
"状态"
>
<el-radio-group
v-model=
"form.status"
>
<el-radio-group
v-model=
"form.status"
>
<el-radio
<el-radio
v-for=
"dict in statusOptions"
:key=
"dict.dictValue"
v-for=
"dict in statusOptions"
:label=
"dict.dictValue"
>
{{ dict.dictLabel }}
</el-radio>
:key=
"dict.dictValue"
:label=
"dict.dictValue"
>
{{dict.dictLabel}}
</el-radio>
</el-radio-group>
</el-radio-group>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
...
@@ -273,26 +164,16 @@
...
@@ -273,26 +164,16 @@
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"岗位"
>
<el-form-item
label=
"岗位"
>
<el-select
v-model=
"form.postIds"
multiple
placeholder=
"请选择"
>
<el-select
v-model=
"form.postIds"
multiple
placeholder=
"请选择"
>
<el-option
<el-option
v-for=
"item in postOptions"
:key=
"item.postId"
:label=
"item.postName"
:value=
"item.postId"
v-for=
"item in postOptions"
:disabled=
"item.status == 1"
></el-option>
:key=
"item.postId"
:label=
"item.postName"
:value=
"item.postId"
:disabled=
"item.status == 1"
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"角色"
>
<el-form-item
label=
"角色"
>
<el-select
v-model=
"form.roleIds"
multiple
placeholder=
"请选择"
>
<el-select
v-model=
"form.roleIds"
multiple
placeholder=
"请选择"
>
<el-option
<el-option
v-for=
"item in roleOptions"
:key=
"item.roleId"
:label=
"item.roleName"
:value=
"item.roleId"
v-for=
"item in roleOptions"
:disabled=
"item.status == 1"
></el-option>
:key=
"item.roleId"
:label=
"item.roleName"
:value=
"item.roleId"
:disabled=
"item.status == 1"
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
...
@@ -313,18 +194,9 @@
...
@@ -313,18 +194,9 @@
<!-- 用户导入对话框 -->
<!-- 用户导入对话框 -->
<el-dialog
:title=
"upload.title"
:visible.sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-dialog
:title=
"upload.title"
:visible.sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-upload
<el-upload
ref=
"upload"
:limit=
"1"
accept=
".xlsx, .xls"
:headers=
"upload.headers"
ref=
"upload"
:action=
"upload.url + '?updateSupport=' + upload.updateSupport"
:disabled=
"upload.isUploading"
:limit=
"1"
:on-progress=
"handleFileUploadProgress"
:on-success=
"handleFileSuccess"
:auto-upload=
"false"
drag
>
accept=
".xlsx, .xls"
:headers=
"upload.headers"
:action=
"upload.url + '?updateSupport=' + upload.updateSupport"
:disabled=
"upload.isUploading"
:on-progress=
"handleFileUploadProgress"
:on-success=
"handleFileSuccess"
:auto-upload=
"false"
drag
>
<i
class=
"el-icon-upload"
></i>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
将文件拖到此处,或
...
@@ -434,6 +306,7 @@ export default {
...
@@ -434,6 +306,7 @@ export default {
],
],
// 表单校验
// 表单校验
rules
:
{
rules
:
{
deptId
:
[{
required
:
true
,
message
:
"
部门不能为空
"
,
trigger
:
"
blur
"
}],
userName
:
[
userName
:
[
{
required
:
true
,
message
:
"
用户名称不能为空
"
,
trigger
:
"
blur
"
}
{
required
:
true
,
message
:
"
用户名称不能为空
"
,
trigger
:
"
blur
"
}
],
],
...
@@ -507,7 +380,6 @@ export default {
...
@@ -507,7 +380,6 @@ export default {
this
.
getList
();
this
.
getList
();
},
},
renderContent
(
h
,
{
node
,
data
,
store
})
{
renderContent
(
h
,
{
node
,
data
,
store
})
{
console
.
log
(
data
);
return
(
return
(
<
span
class
=
"
custom-tree-node
"
>
<
span
class
=
"
custom-tree-node
"
>
<
span
title
=
{
data
.
title
}
>
{
node
.
label
}
<
/span
>
<
span
title
=
{
data
.
title
}
>
{
node
.
label
}
<
/span
>
...
@@ -520,11 +392,11 @@ export default {
...
@@ -520,11 +392,11 @@ export default {
confirmButtonText
:
"
确定
"
,
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
type
:
"
warning
"
}).
then
(
function
()
{
}).
then
(
function
()
{
return
changeUserStatus
(
row
.
userId
,
row
.
status
);
return
changeUserStatus
(
row
.
userId
,
row
.
status
);
}).
then
(()
=>
{
}).
then
(()
=>
{
this
.
msgSuccess
(
text
+
"
成功
"
);
this
.
msgSuccess
(
text
+
"
成功
"
);
}).
catch
(
function
()
{
}).
catch
(
function
()
{
row
.
status
=
row
.
status
===
"
0
"
?
"
1
"
:
"
0
"
;
row
.
status
=
row
.
status
===
"
0
"
?
"
1
"
:
"
0
"
;
});
});
},
},
...
@@ -605,10 +477,10 @@ export default {
...
@@ -605,10 +477,10 @@ export default {
resetUserPwd
(
row
.
userId
,
value
).
then
(
response
=>
{
resetUserPwd
(
row
.
userId
,
value
).
then
(
response
=>
{
this
.
msgSuccess
(
"
修改成功,新密码是:
"
+
value
);
this
.
msgSuccess
(
"
修改成功,新密码是:
"
+
value
);
});
});
}).
catch
(()
=>
{
});
}).
catch
(()
=>
{
});
},
},
/** 提交按钮 */
/** 提交按钮 */
submitForm
:
function
()
{
submitForm
:
function
()
{
this
.
$refs
[
"
form
"
].
validate
(
valid
=>
{
this
.
$refs
[
"
form
"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
if
(
this
.
form
.
userId
!=
undefined
)
{
if
(
this
.
form
.
userId
!=
undefined
)
{
...
@@ -634,7 +506,7 @@ export default {
...
@@ -634,7 +506,7 @@ export default {
confirmButtonText
:
"
确定
"
,
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
type
:
"
warning
"
}).
then
(
function
()
{
}).
then
(
function
()
{
return
delUser
(
userIds
);
return
delUser
(
userIds
);
}).
then
(()
=>
{
}).
then
(()
=>
{
this
.
getList
();
this
.
getList
();
...
@@ -676,7 +548,7 @@ export default {
...
@@ -676,7 +548,7 @@ export default {
this
.
upload
.
open
=
false
;
this
.
upload
.
open
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
$refs
.
upload
.
clearFiles
();
this
.
$refs
.
upload
.
clearFiles
();
this
.
$alert
(
"
<div style='width:100%;height:400px;OVERFLOW-Y: auto; OVERFLOW-X:hidden;'>
"
+
response
.
msg
+
"
</div>
"
,
"
导入结果
"
,
{
dangerouslyUseHTMLString
:
true
});
this
.
$alert
(
"
<div style='width:100%;height:400px;OVERFLOW-Y: auto; OVERFLOW-X:hidden;'>
"
+
response
.
msg
+
"
</div>
"
,
"
导入结果
"
,
{
dangerouslyUseHTMLString
:
true
});
this
.
getList
();
this
.
getList
();
},
},
// 提交上传文件
// 提交上传文件
...
...
ruoyi-ui/vue.config.js
View file @
c6cf5960
...
@@ -27,15 +27,15 @@ module.exports = {
...
@@ -27,15 +27,15 @@ module.exports = {
productionSourceMap
:
false
,
productionSourceMap
:
false
,
// webpack-dev-server 相关配置
// webpack-dev-server 相关配置
devServer
:
{
devServer
:
{
// host: '
0.0.0.0
',
// host: '
localhost
',
port
:
port
,
port
:
port
,
open
:
true
,
open
:
true
,
proxy
:
{
proxy
:
{
// detail: https://cli.vuejs.org/config/#devserver-proxy
// detail: https://cli.vuejs.org/config/#devserver-proxy
[
process
.
env
.
VUE_APP_BASE_API
]:
{
[
process
.
env
.
VUE_APP_BASE_API
]:
{
// target: `http://192.168.0.111
:8080`,
target
:
`http://192.168.0.88
:8080`
,
// target: `http://localhost:5001`,
// target: `http://localhost:5001`,
target
:
`http://localhost
:8080`
,
// target: `http://192.168.111.228
:8080`,
changeOrigin
:
true
,
changeOrigin
:
true
,
pathRewrite
:
{
pathRewrite
:
{
...
...
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