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
88b0dcd5
Commit
88b0dcd5
authored
Sep 02, 2024
by
Fuzy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修正
parent
98e02c8f
Changes
42
Hide whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
2087 additions
and
784 deletions
+2087
-784
ruoyi-ui/build/index.js
ruoyi-ui/build/index.js
+0
-2
ruoyi-ui/package.json
ruoyi-ui/package.json
+1
-0
ruoyi-ui/public/exportExcel.js
ruoyi-ui/public/exportExcel.js
+1
-12
ruoyi-ui/src/Wages/convers.js
ruoyi-ui/src/Wages/convers.js
+59
-93
ruoyi-ui/src/Wages/conversTsk.js
ruoyi-ui/src/Wages/conversTsk.js
+0
-1
ruoyi-ui/src/api/ruoyi-myLuckyexcel/myluckyexcel.js
ruoyi-ui/src/api/ruoyi-myLuckyexcel/myluckyexcel.js
+40
-2
ruoyi-ui/src/assets/js/power/convers.js
ruoyi-ui/src/assets/js/power/convers.js
+0
-1
ruoyi-ui/src/components/Activiti/ApplyBefore/index.vue
ruoyi-ui/src/components/Activiti/ApplyBefore/index.vue
+0
-1
ruoyi-ui/src/components/Activiti/ViewApprove/index.vue
ruoyi-ui/src/components/Activiti/ViewApprove/index.vue
+0
-1
ruoyi-ui/src/conversion/conversion.js
ruoyi-ui/src/conversion/conversion.js
+17
-42
ruoyi-ui/src/conversion/lvMine.js
ruoyi-ui/src/conversion/lvMine.js
+6
-2
ruoyi-ui/src/router/index.js
ruoyi-ui/src/router/index.js
+30
-0
ruoyi-ui/src/utils/dialogDrag.js
ruoyi-ui/src/utils/dialogDrag.js
+0
-3
ruoyi-ui/src/utils/request.js
ruoyi-ui/src/utils/request.js
+0
-1
ruoyi-ui/src/utils/tzc.js
ruoyi-ui/src/utils/tzc.js
+97
-49
ruoyi-ui/src/views/ActSuppliesConvert/convert/indexConvert.vue
...-ui/src/views/ActSuppliesConvert/convert/indexConvert.vue
+1
-4
ruoyi-ui/src/views/system/ActClassification/index.vue
ruoyi-ui/src/views/system/ActClassification/index.vue
+0
-2
ruoyi-ui/src/views/system/ActSuppliesDetails/ActSuppliesDetails/index.vue
...ws/system/ActSuppliesDetails/ActSuppliesDetails/index.vue
+0
-1
ruoyi-ui/src/views/system/ActsupplesAll/fanMine.vue
ruoyi-ui/src/views/system/ActsupplesAll/fanMine.vue
+0
-3
ruoyi-ui/src/views/system/Actsupplies/Actsupplies/index.vue
ruoyi-ui/src/views/system/Actsupplies/Actsupplies/index.vue
+0
-1
ruoyi-ui/src/views/system/Wages/LinXiWages.vue
ruoyi-ui/src/views/system/Wages/LinXiWages.vue
+414
-8
ruoyi-ui/src/views/system/Wages/TangshanWages.vue
ruoyi-ui/src/views/system/Wages/TangshanWages.vue
+437
-8
ruoyi-ui/src/views/system/Wages/contrast.vue
ruoyi-ui/src/views/system/Wages/contrast.vue
+0
-4
ruoyi-ui/src/views/system/power/ass.js
ruoyi-ui/src/views/system/power/ass.js
+0
-1
ruoyi-ui/src/views/system/power/index.vue
ruoyi-ui/src/views/system/power/index.vue
+3
-3
ruoyi-ui/src/views/system/power/linxi.vue
ruoyi-ui/src/views/system/power/linxi.vue
+160
-11
ruoyi-ui/src/views/system/run_of_coal/index.vue
ruoyi-ui/src/views/system/run_of_coal/index.vue
+0
-1
ruoyi-ui/src/views/system/supplies/index.vue
ruoyi-ui/src/views/system/supplies/index.vue
+0
-14
ruoyi-ui/src/views/system/supplies/index_template.vue
ruoyi-ui/src/views/system/supplies/index_template.vue
+55
-156
ruoyi-ui/src/views/system/supplies/index_vue.vue
ruoyi-ui/src/views/system/supplies/index_vue.vue
+2
-6
ruoyi-ui/src/views/system/supplies/indexupload.vue
ruoyi-ui/src/views/system/supplies/indexupload.vue
+0
-1
ruoyi-ui/src/views/system/supplies/materialDetailTemplateTable/index.js
...iews/system/supplies/materialDetailTemplateTable/index.js
+205
-8
ruoyi-ui/src/views/system/supplies/materialDetailTemplateTable/index.vue
...ews/system/supplies/materialDetailTemplateTable/index.vue
+251
-210
ruoyi-ui/src/views/system/supplies/salarySummary/index.vue
ruoyi-ui/src/views/system/supplies/salarySummary/index.vue
+3
-7
ruoyi-ui/src/views/system/supplies/salarySummaryintermediateTabl/index.vue
...s/system/supplies/salarySummaryintermediateTabl/index.vue
+189
-104
ruoyi-ui/src/views/system/supplies/viewuploads.vue
ruoyi-ui/src/views/system/supplies/viewuploads.vue
+0
-1
ruoyi-ui/src/views/system/suppliesrole/index.vue
ruoyi-ui/src/views/system/suppliesrole/index.vue
+0
-4
ruoyi-ui/src/views/system/suppliesroledetail/index.vue
ruoyi-ui/src/views/system/suppliesroledetail/index.vue
+0
-1
ruoyi-ui/vue.config.js
ruoyi-ui/vue.config.js
+2
-2
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/PowerDisplayServiceImpl.java
...om/ruoyi/system/service/impl/PowerDisplayServiceImpl.java
+60
-13
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/saveOnTheLargeScreenPower/DongHuanTuo.java
...m/service/impl/saveOnTheLargeScreenPower/DongHuanTuo.java
+28
-0
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/saveOnTheLargeScreenPower/QianJiaYing.java
...m/service/impl/saveOnTheLargeScreenPower/QianJiaYing.java
+26
-0
No files found.
ruoyi-ui/build/index.js
View file @
88b0dcd5
...
...
@@ -24,9 +24,7 @@ if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
)
app
.
listen
(
port
,
function
()
{
console
.
log
(
chalk
.
green
(
`> Preview at http://localhost:
${
port
}${
publicPath
}
`
))
if
(
report
)
{
console
.
log
(
chalk
.
green
(
`> Report at http://localhost:
${
port
}${
publicPath
}
report.html`
))
}
})
...
...
ruoyi-ui/package.json
View file @
88b0dcd5
...
...
@@ -48,6 +48,7 @@
"clipboard"
:
"2.0.6"
,
"connect"
:
"3.6.6"
,
"core-js"
:
"3.8.1"
,
"decimal"
:
"^0.0.2"
,
"echarts"
:
"4.9.0"
,
"element-ui"
:
"2.15.0"
,
"eslint"
:
"7.15.0"
,
...
...
ruoyi-ui/public/exportExcel.js
View file @
88b0dcd5
...
...
@@ -4,7 +4,6 @@ import Excel from 'exceljs';
import
FileSaver
from
'
file-saver
'
;
const
exportExcel
=
function
(
luckysheet
,
value
,
contrast
,
id
)
{
// 函数体
// 参数为luckysheet.getluckysheetfile()获取的对象
// 1.创建工作簿,可以为工作簿添加属性
...
...
@@ -14,7 +13,7 @@ const exportExcel = function (luckysheet, value, contrast, id) {
luckysheet
=
[
luckysheet
];
}
luckysheet
.
forEach
(
function
(
table
)
{
if
(
table
.
data
.
length
===
0
)
{
return
true
;
}
// ws.getCell('B2').fill = fills.
const
worksheet
=
workbook
.
addWorksheet
(
table
.
name
);
...
...
@@ -36,11 +35,9 @@ const exportExcel = function (luckysheet, value, contrast, id) {
// return
// 4.写入 buffer
const
buffer
=
workbook
.
xlsx
.
writeBuffer
().
then
(
data
=>
{
// console.log('data', data)
const
blob
=
new
Blob
([
data
],
{
type
:
'
application/vnd.ms-excel;charset=utf-8
'
});
console
.
log
(
'
导出成功!
'
);
FileSaver
.
saveAs
(
blob
,
`
${
value
}
.xlsx`
);
});
return
buffer
;
...
...
@@ -62,14 +59,11 @@ var setMerge = function (luckyMerge = {}, worksheet) {
var
setBorder
=
function
(
luckyBorderInfo
,
worksheet
)
{
if
(
!
Array
.
isArray
(
luckyBorderInfo
))
{
return
;
}
// console.log('luckyBorderInfo', luckyBorderInfo)
luckyBorderInfo
.
forEach
(
function
(
elem
)
{
// 现在只兼容到borderType 为range的情况
// console.log('ele', elem)
if
(
elem
.
rangeType
===
'
range
'
)
{
let
border
=
borderConvert
(
elem
.
borderType
,
elem
.
style
,
elem
.
color
);
let
rang
=
elem
.
range
[
0
];
// console.log('range', rang)
let
row
=
rang
.
row
;
let
column
=
rang
.
column
;
for
(
let
i
=
row
[
0
]
+
1
;
i
<
row
[
1
]
+
2
;
i
++
)
{
...
...
@@ -90,10 +84,8 @@ var setBorder = function (luckyBorderInfo, worksheet) {
delete
borderData
.
col_index
;
delete
borderData
.
row_index
;
let
border
=
addborderToCell
(
borderData
,
row_index
,
col_index
);
// console.log('bordre', border, borderData)
worksheet
.
getCell
(
row_index
+
1
,
col_index
+
1
).
border
=
border
;
}
// console.log(rang.column_focus + 1, rang.row_focus + 1)
// worksheet.getCell(rang.row_focus + 1, rang.column_focus + 1).border = border
});
};
...
...
@@ -297,7 +289,6 @@ var borderConvert = function (borderType, style = 1, color = '#000') {
}
else
{
border
[
luckyToExcel
.
type
[
borderType
]]
=
template
;
}
// console.log('border', border)
return
border
;
};
...
...
@@ -327,9 +318,7 @@ function addborderToCell(borders, row_index, col_index) {
13
:
'
thick
'
}
};
// console.log('borders', borders)
for
(
const
bor
in
borders
)
{
// console.log(bor)
if
(
borders
[
bor
].
color
.
indexOf
(
'
rgb
'
)
===
-
1
)
{
border
[
luckyExcel
.
type
[
bor
]]
=
{
style
:
luckyExcel
.
style
[
borders
[
bor
].
style
],
...
...
ruoyi-ui/src/Wages/convers.js
View file @
88b0dcd5
import
{
getSuppliesTemplate
,
listSuppliesTemplate
,
roleList
,
listMyluckyexcel
,
getyy
,
}
from
"
@/api/ruoyi-myLuckyexcel/myluckyexcel
"
;
import
{
conversionSave
,
surface
,
...
...
@@ -15,23 +12,11 @@ import {
}
from
"
@/api/conversion/index
"
;
// import luckysheet from 'luckysheet'
import
LuckyExcel
from
"
luckyexcel
"
;
//导入库export.js 这个文件是es6的,不能在普通的HTML文件直接引入js文件(虽然都是js文件,但是有区别,具体请百度es6与es5)!需要把es6转es5才可以直接引入使用!
/*import {materialList} from "@/api/ruoyi-myLuckyexcel/myluckyexcel";*/
import
{
v4
as
uuidv4
}
from
"
uuid
"
;
import
{
exportExcel
}
from
"
../../public/exportExcel
"
;
import
{
TableColumn
}
from
"
element-ui
"
;
import
{
watch
}
from
"
vue
"
;
import
{
machGzdata
}
from
"
@/Wages/conversTsk.js
"
;
import
{
machLxGzdata
}
from
"
@/Wages/conversLxk.js
"
;
import
{
data
}
from
"
jquery
"
;
import
{
transformJson
,
tzcCreateData
,
newGettransformJson
}
from
"
@/utils/tzc
"
// import { config } from "vue/types/umd";
import
{
transformJson
,
tzcCreateData
,
newGettransformJson
,
collect
}
from
"
@/utils/tzc
"
var
fileName
=
"
新建XLSX工作表
"
;
//定义表名
var
rule
=
[];
var
tempId
;
var
uuid1
;
var
modify
=
false
;
var
that
;
export
default
{
...
...
@@ -41,6 +26,7 @@ export default {
wageMonth
:
""
,
//详细信息
phone
:
""
,
//moban
//未导入成本材料表模板所有数据
jsondata
:
""
,
//编码数据
...
...
@@ -60,11 +46,11 @@ export default {
queryParams
:
{
status
:
0
,
},
mineId
:
''
,
//矿ID
mineId
:
''
,
//矿ID
};
},
created
()
{
that
=
this
;
that
=
this
;
//刷新页面时进行的操作
this
.
getList
();
},
...
...
@@ -109,6 +95,7 @@ export default {
});
this
.
depss
=
response
.
rows
;
});
getSuppliesTemplate
(
1248
).
then
((
response
)
=>
{
const
sysSupplies
=
response
.
rows
;
this
.
luckysheetDatas
=
JSON
.
parse
(
...
...
@@ -116,10 +103,10 @@ export default {
);
});
},
open4
()
{
this
.
$message
.
error
(
"
请仔细检查所导入表
"
);
},
/** Luckyexcel文档 */
init
()
{
let
options
=
{
container
:
"
luckysheet
"
,
//luckysheet为容器id
...
...
@@ -155,16 +142,7 @@ export default {
},
handleSuccess
(
response
,
file
,
fileList
)
{
//文件数量改变
// debugger
// console.log('file2222',file);
// var param = new FormData();
// param.append("file", file.raw);
// listMyluckyexcel(param).then(res=>{
// console.log('11111',res)
// })
},
//工资数据后台导入成功后,数据展示到前台
loadTableData
(
evt
)
{
this
.
sum
.
push
(
evt
);
...
...
@@ -200,8 +178,8 @@ export default {
modify
=
false
;
this
.
open
(
this
.
sum
);
})
.
then
(
async
()
=>
{})
.
catch
(()
=>
{});
.
then
(
async
()
=>
{
})
.
catch
(()
=>
{
});
})
.
catch
(()
=>
{
// 用户点击了取消按钮
...
...
@@ -216,7 +194,7 @@ export default {
LuckyExcel
(
evt
,
(
exportJson
)
=>
{
//获取导入表格所有数据exportJson
this
.
open
(
exportJson
)
.
then
(
async
()
=>
{})
.
then
(
async
()
=>
{
})
.
catch
((
error
)
=>
{
this
.
$message
({
message
:
error
.
message
,
...
...
@@ -235,7 +213,6 @@ export default {
if
(
this
.
value
.
includes
(
"
凭证
"
))
{
this
.
loadTableData
(
evt
);
}
else
if
(
this
.
value
.
includes
(
"
林西
"
))
{
//组装后台接口数据
var
param
=
new
FormData
();
param
.
append
(
"
file
"
,
evt
);
...
...
@@ -268,8 +245,8 @@ export default {
}
//前台加载数据
},
handleOptionChange
(
value
,
mine_id
)
{
that
.
mineId
=
mine_id
.
id
handleOptionChange
(
value
,
mine_id
)
{
that
.
mineId
=
mine_id
.
id
let
lod
=
this
.
$loading
({
lock
:
true
,
text
:
"
加载中
"
,
...
...
@@ -280,16 +257,10 @@ export default {
.
then
((
response
)
=>
{
lod
.
close
();
modify
=
false
;
tempId
=
this
.
selectedOption
;
uuid1
=
this
.
uuid
=
uuidv4
().
substring
(
0
,
8
);
const
sysSupplies
=
response
.
rows
;
this
.
luckysheetData
=
sysSupplies
[
0
].
templateContent
;
var
json_data
=
JSON
.
parse
(
sysSupplies
[
0
].
templateContent
);
this
.
jsondata
=
json_data
;
roleList
(
value
).
then
((
response
)
=>
{
this
.
luckyrule
=
response
.
rows
;
});
let
suffixArr
=
sysSupplies
[
0
].
templateName
.
split
(
"
.
"
);
fileName
=
suffixArr
[
0
];
//luckysheet.destroy()
...
...
@@ -304,21 +275,21 @@ export default {
status
:
"
1
"
,
//激活状态
});
this
.
value
=
fileName
;
if
(
!
fileName
.
includes
(
"
凭证
"
))
{
var
excel_r
=
0
;
//读取行
var
excel_c
=
0
;
//读取起始列
var
excel_r
=
0
;
//读取行
var
excel_c
=
0
;
//读取起始列
if
(
fileName
.
includes
(
"
唐山
"
))
{
excel_r
=
2
;
}
else
if
(
fileName
.
includes
(
"
林西
"
))
{
excel_r
=
3
;
excel_r
=
2
;
}
else
if
(
fileName
.
includes
(
"
林西
"
))
{
excel_r
=
3
;
}
let
head
=
this
.
jsondata
[
0
].
celldata
.
filter
(
(
item
)
=>
item
.
r
&&
item
.
r
==
excel_r
&&
item
.
c
>
excel_c
);
this
.
jsonhead
=
[];
this
.
jsonhead
=
[];
head
.
forEach
((
item
)
=>
{
let
funct
=
{
label
:
item
.
v
.
v
+
"
=
"
,
...
...
@@ -332,7 +303,7 @@ export default {
getRecentFormulas
(
that
.
mineId
).
then
((
response
)
=>
{
if
(
response
.
code
==
200
)
{
var
data
=
response
.
data
;
if
(
data
)
{
var
json
=
JSON
.
parse
(
data
);
...
...
@@ -368,7 +339,7 @@ export default {
const
postData
=
this
.
jsonhead
.
filter
(
(
item
)
=>
item
.
value
.
trim
()
!=
""
);
// 使用 localStorage 存储
//localStorage.setItem('myData', jsonString);
this
.
dialogTableVisible
=
false
;
...
...
@@ -378,7 +349,7 @@ export default {
date
:
this
.
wageMonth
,
data
:
postData
,
};
//林西矿
if
(
this
.
selectedOption
==
1280
)
{
//林西矿工资汇总
...
...
@@ -389,13 +360,13 @@ export default {
data
,
CompositeTable
);
this
.
setLuckysheetData
(
CompositeTable
,
myCompositeTable
);
this
.
setLuckysheetData
(
CompositeTable
,
myCompositeTable
);
}
else
{
}
});
}
else
{
//唐山工资汇总
surface
(
putJson
).
then
((
response
)
=>
{
if
(
response
.
code
==
200
)
{
...
...
@@ -405,9 +376,9 @@ export default {
CompositeTable
);
this
.
setLuckysheetData
(
CompositeTable
,
myCompositeTable
);
this
.
setLuckysheetData
(
CompositeTable
,
myCompositeTable
);
}
else
{
}
});
...
...
@@ -418,9 +389,8 @@ export default {
this
.
showMask
=
false
;
}
},
//工资数据后台汇总完后,回显到前台
setLuckysheetData
(
CompositeTable
,
myCompositeTable
)
{
setLuckysheetData
(
CompositeTable
,
myCompositeTable
)
{
CompositeTable
[
0
].
data
=
luckysheet
.
transToData
(
myCompositeTable
[
0
].
celldata
);
...
...
@@ -452,15 +422,15 @@ export default {
yearMonth
:
this
.
wageMonth
,
jsonData
:
JSON
.
stringify
(
CompositeTable
),
value
:
jsonString
,
mineId
:
that
.
mineId
mineId
:
that
.
mineId
,
};
modify
=
true
;
that
.
showMask
=
false
;
conversionSave
(
obj
).
then
((
response
)
=>
{});
conversionSave
(
obj
).
then
((
response
)
=>
{
});
},
//转换方法
zhuan
()
{
const
promises
=
this
.
sum
.
map
((
item
)
=>
{
...
...
@@ -483,43 +453,39 @@ export default {
this
.
dialogTableVisible
=
true
;
}
});
// .catch(error => {
// console.error("An error occurred while transforming Excel files:", error);
// // 处理错误情况
// });
},
//公式窗口关闭回调
handleClose
(){
handleClose
()
{
that
.
dialogTableVisible
=
false
;
that
.
showMask
=
false
;
that
.
showMask
=
false
;
},
async
VoucherForms
(
sum
)
{
//
try {
let
objks
=
await
newGettransformJson
(
sum
,
that
.
mineId
)
let
createData
=
tzcCreateData
(
this
.
luckysheetDatas
[
0
]
,
transformJson
(
objks
.
data
),
luckysheet
,
this
.
phone
,
this
.
wageMonth
);
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
fileName
,
// Excel 文件名
allowEdit
:
false
,
//作用:是否允许前台编辑
data
:
createData
,
// Excel 数据
showinfobar
:
false
,
//是否显示顶部名称栏
lang
:
"
zh
"
,
});
modify
=
true
;
this
.
showMask
=
false
;
try
{
let
objks
=
await
newGettransformJson
(
sum
,
that
.
mineId
)
let
createData
=
tzcCreateData
(
this
.
luckysheetDatas
,
transformJson
(
objks
.
data
),
luckysheet
,
this
.
phone
,
this
.
wageMonth
);
createData
=
collect
(
createData
)
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
fileName
,
// Excel 文件名
allowEdit
:
false
,
//作用:是否允许前台编辑
data
:
createData
,
// Excel 数据
showinfobar
:
false
,
//是否显示顶部名称栏
lang
:
"
zh
"
,
});
modify
=
true
;
this
.
showMask
=
false
;
//
} catch {
//
modify = true;
//
this.showMask = false;
//
this.open4();
//
}
}
catch
{
modify
=
true
;
this
.
showMask
=
false
;
this
.
open4
();
}
},
handleExport
:
debounce
(
function
()
{
// handleExport
...
...
ruoyi-ui/src/Wages/conversTsk.js
View file @
88b0dcd5
...
...
@@ -90,7 +90,6 @@ export function machGzdata(list,jsonData) {
}
});
console
.
log
(
"
123
"
,
list
);
// 对比 c 和 r 是否与 CompositeTable[0]["celldata"] 中相应对象相同
for
(
let
k
=
0
;
k
<
CompositeTable
[
0
][
"
celldata
"
].
length
;
k
++
)
{
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
...
...
ruoyi-ui/src/api/ruoyi-myLuckyexcel/myluckyexcel.js
View file @
88b0dcd5
...
...
@@ -63,6 +63,22 @@ export function getyy(newData) {
data
:
newData
,
});
}
// 林西的电力汇总生成凭证
export
function
inquireAboutSubjectAssistance
(
newData
)
{
return
request
({
url
:
`powerVoucherConversion/inquireAboutSubjectAssistance`
,
method
:
"
post
"
,
data
:
newData
,
});
}
// 单侯的电力汇总生成凭证
export
function
axiosShanHouVoucherConversion
(
newData
)
{
return
request
({
url
:
`powerVoucherConversion/shanHouVoucherConversion`
,
method
:
"
post
"
,
data
:
newData
,
});
}
//展示excel模板
export
function
listSuppliesTemplateId
(
id
)
{
return
request
({
...
...
@@ -78,6 +94,13 @@ export function getSuppliesTemplate(id) {
method
:
"
get
"
,
});
}
export
function
axiosPowerDisplayPeek
(
data
)
{
return
request
({
url
:
"
/powerDisplay/peek/
"
,
method
:
"
post
"
,
data
});
}
// 修改导入规则
export
function
updateSuppliesrole
(
id
)
{
...
...
@@ -325,7 +348,7 @@ export function listMyluckyexcel(query) {
// params: query
// })
// }
//通过code和矿ID查询一二级分类
export
function
asiccData
(
data
)
{
return
request
({
url
:
'
asicc/getData
'
,
...
...
@@ -333,7 +356,7 @@ export function asiccData(data) {
data
,
});
}
// 保存通用材料模版的数据
export
function
asmInfoSave
(
data
)
{
return
request
({
url
:
'
asmInfo/save
'
,
...
...
@@ -341,3 +364,18 @@ export function asmInfoSave(data) {
data
,
});
}
export
function
axiosPowerLx
(
arr
)
{
return
request
({
url
:
'
power/lxPower
'
,
method
:
"
post
"
,
data
:{
lxPowers
:
arr
}
});
}
export
function
axiosHistorySave
(
data
)
{
return
request
({
url
:
'
history/save
'
,
method
:
"
post
"
,
data
});
}
ruoyi-ui/src/assets/js/power/convers.js
View file @
88b0dcd5
...
...
@@ -360,7 +360,6 @@ export default {
});
// .catch(error => {
// console.error("An error occurred while transforming Excel files:", error);
// // 处理错误情况
// });
},
...
...
ruoyi-ui/src/components/Activiti/ApplyBefore/index.vue
View file @
88b0dcd5
...
...
@@ -45,7 +45,6 @@
handleApply
:
function
()
{
const
id
=
this
.
row
.
id
;
const
requestMapping
=
this
.
requestMapping
;
console
.
log
(
"
requestMapping:
"
,
requestMapping
);
this
.
$confirm
(
'
是否提交ID为"
'
+
id
+
'
"的申请单据?
'
,
"
警告
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
...
...
ruoyi-ui/src/components/Activiti/ViewApprove/index.vue
View file @
88b0dcd5
...
...
@@ -119,7 +119,6 @@
},
handleApprove
(){
console
.
log
(
'
this.row.processKey
'
,
this
.
$refs
);
this
.
open
=
true
;
},
...
...
ruoyi-ui/src/conversion/conversion.js
View file @
88b0dcd5
...
...
@@ -14,7 +14,6 @@ import {
getSuppliesTemplate
,
listSuppliesTemplate
,
roleList
,
materialListPZ
,
accountingcode
,
department
,
roleListid
,
...
...
@@ -22,8 +21,6 @@ import {
}
from
"
@/api/ruoyi-myLuckyexcel/myluckyexcel
"
;
import
{
addInsert
,
addInsertAccount1
,
addInsertAccount2
,
datahistoryContentCopy
}
from
"
@/api/system/historydata
"
;
/*import luckysheet from 'luckysheet'*/
...
...
@@ -130,10 +127,8 @@ export default {
mounted
()
{
this
.
init
();
fileName
=
"
新建XLSX工作表
"
;
// this.list()
},
methods
:
{
delect
()
{
this
.
mine
=
""
;
this
.
selectname
=
""
;
...
...
@@ -284,6 +279,10 @@ export default {
let
suffixArr
=
sysSupplies
[
0
].
templateName
.
split
(
"
.
"
);
fileName
=
suffixArr
[
0
];
//luckysheet.destroy()
console
.
log
(
a
)
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
fileName
,
// Excel 文件名
...
...
@@ -407,6 +406,7 @@ export default {
luckysheet
.
create
(
options
);
},
async
handleFileChange
(
evt
)
{
if
(
modify
)
{
this
.
$confirm
(
"
再次导入将会清空表内数据,是否继续操作?
"
,
...
...
@@ -472,7 +472,7 @@ export default {
//转换方法
transformPromises
()
{
//
try {
//
try {
let
result
=
this
.
result
this
.
dialogTableVisible
=
false
let
cc
=
result
;
...
...
@@ -555,7 +555,7 @@ export default {
let
names
=
this
.
cleaning
[
0
].
sourceColoumn
?
this
.
cleaning
[
0
].
sourceColoumn
-
1
:
null
;
let
name
=
names
?
c
.
flat
()
...
...
@@ -566,7 +566,7 @@ export default {
obj
.
r
>
headRow
)
:
null
;
//材料名称所在列
let
materias
=
this
.
cleaning
[
0
].
NameColumn
-
1
;
let
materianame
=
c
...
...
@@ -752,7 +752,6 @@ export default {
let
material
=
CompositeTable
[
0
][
"
celldata
"
]
.
flat
()
.
filter
((
obj
)
=>
obj
.
r
&&
obj
.
r
===
matchedItems
);
console
.
log
(
material
)
duplicateData
.
forEach
((
obj
)
=>
{
obj
.
v
.
material
=
''
material
.
forEach
((
cell
)
=>
{
...
...
@@ -761,7 +760,6 @@ export default {
}
});
});
console
.
log
(
duplicateData
,
'
2222222222
'
)
var
cellList
=
[];
var
newHistoryContent
=
JSON
.
parse
(
this
.
ImportTables
.
historyContent
...
...
@@ -817,10 +815,10 @@ export default {
this
.
middle
=
CompositeTable
;
this
.
duplicateData
.
push
(...
duplicateData
);
this
.
Vouchers
(
this
.
duplicateData
);
// } catch (error) {
//
} catch (error) {
// this.open4();
// this.showMask = false;
// }
//
}
},
zhuan
(
file
)
{
let
cc
=
''
;
...
...
@@ -879,7 +877,7 @@ export default {
"
*核算账簿
"
,
"
*单据日期
"
,
"
*凭证类型
"
,
"
*
制单人
"
,
"
制单人
"
,
"
*分录摘要
"
,
"
*币种
"
,
"
本币汇率类型
"
,
...
...
@@ -997,8 +995,6 @@ export default {
this
.
generate
.
identifyingCode
=
1
;
this
.
generate
.
date
=
this
.
date
;
this
.
generate
.
mining
=
this
.
select
;
// , this.generate
let
list
=
[
this
.
ImportTables
];
let
filteredArr
;
accountingcode
(
newData
).
then
((
response
)
=>
{
// 合并起来的每行的值转换成一行一个编码 知道哪行合并了起来
...
...
@@ -1018,6 +1014,9 @@ export default {
if
(
item
.
accountingCode
)
{
extractedItem
.
accountingCode
=
item
.
accountingCode
;
}
if
(
item
.
department
)
{
extractedItem
.
department
=
item
.
department
}
if
(
item
.
indexcoloumn
)
{
extractedItem
.
indexcoloumn
=
item
.
indexcoloumn
;
}
...
...
@@ -1031,7 +1030,6 @@ export default {
});
let
historyContent
=
[];
for
(
let
i
=
0
;
i
<
this
.
ImportTables
.
historyRole
.
length
;
i
++
)
{
// && this.ImportTables.historyRole[i].accountingCode
if
(
this
.
ImportTables
.
historyRole
[
i
].
indexRow
)
{
const
indexRowArray
=
this
.
ImportTables
.
historyRole
[
i
].
indexRow
.
split
(
...
...
@@ -1041,7 +1039,7 @@ export default {
this
.
ImportTables
.
historyRole
[
i
].
indexcoloumn
;
for
(
let
j
=
0
;
j
<
indexRowArray
.
length
;
j
++
)
{
let
historyRole
=
{
value
:
`
${
this
.
ImportTables
.
historyRole
[
i
].
accountingCode
}
,
${
this
.
ImportTables
.
historyRole
[
i
].
name
}
`
,
value
:
`
${
this
.
ImportTables
.
historyRole
[
i
].
accountingCode
}
,
${
this
.
ImportTables
.
historyRole
[
i
].
name
}
-
${
this
.
ImportTables
.
historyRole
[
i
].
department
}
`
,
key
:
String
(
indexRowArray
[
j
]),
coloumn
:
String
(
indexcoloumn
),
};
...
...
@@ -1127,7 +1125,6 @@ export default {
}
isArray
.
push
(
newRow1
,
newRow2
);
}
for
(
let
i
=
0
;
i
<
filteredArr
.
length
;
i
++
)
{
const
codeValue
=
filteredArr
[
i
]?.
accountingCode
;
if
(
codeValue
)
{
...
...
@@ -1240,10 +1237,7 @@ export default {
};
isArray
.
push
(
newRow
,
newRow1
);
}
VoucherForm
[
0
].
celldata
.
push
(...
isArray
);
if
(
this
.
value
.
includes
(
"
凭证
"
))
{
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
...
...
@@ -1257,7 +1251,7 @@ export default {
modify
=
true
;
this
.
showMask
=
false
;
}
console
.
log
(
list
,
'
11111111111
'
)
let
list
=
[
this
.
ImportTables
];
addInsert
(
list
).
then
((
response
)
=>
{
if
(
response
.
code
==
200
)
{
this
.
$message
({
...
...
@@ -1267,7 +1261,6 @@ export default {
}
});
if
(
this
.
mining
!==
"
011701
"
)
{
this
.
historyContent
=
[];
this
.
duplicateData
=
[];
}
...
...
@@ -1285,7 +1278,6 @@ export default {
},
};
// 配置项111
function
getss
(
data
)
{
let
setXColumnObj
=
setXColumn
(
data
,
2
,
''
,
0
,
9
)
let
arrkses
=
Object
.
keys
(
setXColumnObj
)
...
...
@@ -1351,9 +1343,7 @@ function workbookCreateAfter(operate, mining) {
})
return
neearray
}
// debounce函数定义
function
debounce
(
func
,
delay
)
{
let
timer
;
return
function
()
{
...
...
@@ -1364,19 +1354,4 @@ function debounce(func, delay) {
func
.
apply
(
context
,
args
);
},
delay
);
};
}
function
getKeyByValue
(
map
,
value
)
{
for
(
let
[
key
,
val
]
of
map
)
{
if
(
val
===
value
)
{
return
key
;
}
if
(
Array
.
isArray
(
val
)
&&
val
.
includes
(
value
))
{
return
key
;
}
}
}
function
generateUUID
()
{
let
array
=
new
Uint32Array
(
4
);
window
.
crypto
.
getRandomValues
(
array
);
return
array
.
join
(
"
-
"
);
}
}
\ No newline at end of file
ruoyi-ui/src/conversion/lvMine.js
View file @
88b0dcd5
...
...
@@ -41,9 +41,13 @@ export function lvMine(CompositeTable,cjson,codess,code) {
});
}
else
{
mincolumn
=
head
.
filter
(
item
=>
item
.
c
>=
12
)
}
}
let
min
=
''
// 获取最小列
const
min
=
mincolumn
[
0
].
c
-
1
;
if
(
mincolumn
&&
mincolumn
[
0
]
&&
mincolumn
[
0
].
c
)
{
min
=
mincolumn
[
0
].
c
-
1
;
}
// 使用 filter 方法筛选包含有效值的对象
const
max
=
c
.
filter
(
obj
=>
obj
.
v
.
v
);
for
(
let
i
=
max
.
length
-
1
;
i
>=
0
;
i
--
)
{
...
...
ruoyi-ui/src/router/index.js
View file @
88b0dcd5
...
...
@@ -124,6 +124,36 @@ export const constantRoutes = [
meta
:
{
title
:
'
修改生成配置
'
}
}
]
},
{
path
:
'
/rules
'
,
component
:
Layout
,
hidden
:
true
,
// 隐藏在侧边栏和顶部栏
children
:
[
{
path
:
''
,
component
:
(
resolve
)
=>
require
([
'
@/views/system/rules/rules
'
],
resolve
),
name
:
'
RulesPage
'
,
meta
:
{
title
:
'
规则页面
'
,
icon
:
'
rules
'
,
breadcrumb
:
false
}
}
]
},
{
path
:
'
/rulescopy
'
,
component
:
Layout
,
hidden
:
true
,
// 隐藏在侧边栏和顶部栏
children
:
[
{
path
:
''
,
component
:
(
resolve
)
=>
require
([
'
@/views/system/rules/rulesCopy
'
],
resolve
),
name
:
'
RulesPage
'
,
meta
:
{
title
:
'
数据库规则页面
'
,
icon
:
'
rulesCopy
'
,
breadcrumb
:
false
}
}
]
}
]
...
...
ruoyi-ui/src/utils/dialogDrag.js
View file @
88b0dcd5
...
...
@@ -15,10 +15,8 @@ Vue.directive('dialogDrag', {
// 鼠标按下,计算当前元素距离可视区的距离
const
disX
=
e
.
clientX
-
headerElement
.
offsetLeft
const
disY
=
e
.
clientY
-
headerElement
.
offsetTop
console
.
log
(
e
.
clientX
,
headerElement
.
offsetLeft
)
// 获取到的值带px 正则匹配替换
let
styL
,
styT
console
.
log
(
sty
.
left
)
// 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
if
(
sty
.
left
.
includes
(
'
%
'
))
{
...
...
@@ -33,7 +31,6 @@ Vue.directive('dialogDrag', {
// 通过事件委托,计算移动的距离
const
l
=
e
.
clientX
-
disX
const
t
=
e
.
clientY
-
disY
console
.
log
(
disX
)
// 移动当前元素
dragDialog
.
style
.
left
=
`
${
l
+
styL
}
px`
dragDialog
.
style
.
top
=
`
${
t
+
styT
}
px`
...
...
ruoyi-ui/src/utils/request.js
View file @
88b0dcd5
...
...
@@ -43,7 +43,6 @@ service.interceptors.request.use(config => {
}
return
config
},
error
=>
{
console
.
log
(
error
)
Promise
.
reject
(
error
)
})
...
...
ruoyi-ui/src/utils/tzc.js
View file @
88b0dcd5
...
...
@@ -13,9 +13,9 @@
import
{
v4
as
uuidv4
}
from
"
uuid
"
;
import
{
getyy
}
from
"
@/api/ruoyi-myLuckyexcel/myluckyexcel
"
import
{
getMineProofConfig
,
kNameID
}
from
"
@/utils/MineProofConfig
"
import
{
getMineProofConfig
,
kNameID
}
from
"
@/utils/MineProofConfig
"
export
class
CreateNewCellData
{
constructor
(
cellData
){
constructor
(
cellData
)
{
this
.
data
=
cellData
;
this
.
lasti
=
0
;
// 缓存 值对应的 行和列
...
...
@@ -23,39 +23,40 @@ export class CreateNewCellData {
// 缓存 行和列 值对应的
this
.
cacheRC
=
{}
}
buildcache
(
fn
,
...
args
)
{
if
(
this
.
lasti
>=
this
.
data
.
length
)
{
return
fn
(...
args
)
}
for
(
this
.
lasti
;
this
.
lasti
<
this
.
data
.
length
;
this
.
lasti
++
){
buildcache
(
fn
,
...
args
)
{
if
(
this
.
lasti
>=
this
.
data
.
length
)
{
return
fn
(...
args
)
}
for
(
this
.
lasti
;
this
.
lasti
<
this
.
data
.
length
;
this
.
lasti
++
)
{
let
cell
=
this
.
data
[
this
.
lasti
];
if
(
cell
&&
cell
.
v
&&
cell
.
v
.
v
)
{
let
cacheKey
=
String
(
cell
.
v
.
v
).
replaceAll
(
'
'
,
''
);
let
obj
=
{
r
:
cell
.
r
,
c
:
cell
.
c
,
v
:
cell
.
v
.
v
}
if
(
cell
&&
cell
.
v
&&
cell
.
v
.
v
)
{
let
cacheKey
=
String
(
cell
.
v
.
v
).
replaceAll
(
'
'
,
''
);
let
obj
=
{
r
:
cell
.
r
,
c
:
cell
.
c
,
v
:
cell
.
v
.
v
}
this
.
cacheRC
[
`
${
cell
.
r
}
,
${
cell
.
c
}
`
]
=
cell
.
v
.
v
;
if
(
this
.
cacheV
[
cacheKey
]){
this
.
cacheV
[
cacheKey
].
push
(
obj
)
}
else
{
this
.
cacheV
[
cacheKey
]
=
[
obj
]}
if
(
fn
(...
args
)){
if
(
this
.
cacheV
[
cacheKey
])
{
this
.
cacheV
[
cacheKey
].
push
(
obj
)
}
else
{
this
.
cacheV
[
cacheKey
]
=
[
obj
]
}
if
(
fn
(...
args
))
{
return
fn
(...
args
)
}
}
}
console
.
log
(
'
没有找到
'
,
fn
,...
args
)
}
getCellV
(
v
,
n
=
0
){
v
=
String
(
v
).
replaceAll
(
'
'
,
''
);
if
([
'
undefined
'
,
'
null
'
,
''
].
includes
(
v
)){
return
;}
let
fn
=
(
v
,
n
)
=>
this
.
cacheV
[
v
]
&&
this
.
cacheV
[
v
][
n
]
if
(
fn
(
v
,
n
)){
return
fn
(
v
,
n
)}
else
{
return
this
.
buildcache
(
fn
,
v
,
n
)
// n匹配的第几个, all 是否为强制匹配默认是true
getCellV
(
v
,
n
=
0
)
{
v
=
String
(
v
).
replaceAll
(
'
'
,
''
);
if
([
'
undefined
'
,
'
null
'
,
''
].
includes
(
v
))
{
return
;
}
let
fn
=
(
v
,
n
)
=>
this
.
cacheV
[
v
]
&&
this
.
cacheV
[
v
][
n
]
if
(
fn
(
v
,
n
))
{
return
fn
(
v
,
n
)
}
else
{
return
this
.
buildcache
(
fn
,
v
,
n
)
}
}
// key 值 (r,c)
getCellRC
(
key
){
getCellRC
(
key
)
{
let
fn
=
(
key
)
=>
this
.
cacheRC
[
key
]
if
(
fn
(
key
))
{
if
(
fn
(
key
))
{
return
fn
(
key
)
}
else
if
(
this
.
buildcache
(
fn
,
key
))
{
return
this
.
buildcache
(
fn
,
key
)
}
else
if
(
this
.
buildcache
(
fn
,
key
))
{
return
this
.
buildcache
(
fn
,
key
)
}
}
}
...
...
@@ -75,7 +76,7 @@ export function setXRow(arr, c = 0, chong = '--干部') {
return
obj
;
}
// 获取列 r是低几行
export
function
setXColumn
(
arr
,
r
=
0
,
chong
=
'
--干部
'
,
sc
=
0
,
se
=
9999
)
{
export
function
setXColumn
(
arr
,
r
=
0
,
chong
=
'
--干部
'
,
sc
=
0
,
se
=
9999
)
{
let
obj
=
{}
arr
[
r
].
forEach
((
item
,
column
)
=>
{
if
(
item
&&
item
.
v
&&
column
>=
sc
&&
column
<=
se
)
{
...
...
@@ -97,25 +98,23 @@ export function transformJson(json) {
})
return
obj
}
export
function
getyyData
(
sum
,
kid
=
''
){
console
.
log
(
kNameID
[
kid
],
2222
)
export
function
getyyData
(
sum
,
kid
=
''
)
{
let
conFigList
=
getMineProofConfig
(
kNameID
[
kid
]
||
'
tsk
'
)
let
allAll
=
[]
let
err
=
[]
conFigList
.
forEach
(
cong
=>
{
let
sheets
=
sum
.
find
(
item
=>
item
.
name
.
includes
(
cong
.
sheetsName
))
if
(
!
sheets
||
!
cong
.
sheetsName
)
{
if
(
!
sheets
||
!
cong
.
sheetsName
)
{
err
.
push
(
cong
)
return
;
}
let
cellData
=
sheets
&&
sheets
.
celldata
||
[];
let
newCellData
=
new
CreateNewCellData
(
cellData
)
let
data
=
sheets
&&
sheets
.
data
||
luckysheet
.
transToData
(
cellData
)
let
data
=
sheets
&&
sheets
.
data
||
luckysheet
.
transToData
(
cellData
)
let
columnCell
=
newCellData
.
getCellV
(
cong
.
oldColumnName
);
//获取列单元格
let
endList
=
newCellData
.
getCellV
(
'
合计
'
,
cong
.
jishuhang
||
0
);
//获取 “v是合计的” 单元格数组
let
itemCellColumn
=
newCellData
.
getCellV
(
cong
.
itemName
||
'
项目
'
);
if
(
!
columnCell
||
!
endList
||
!
itemCellColumn
){
console
.
error
(
cong
.
oldColumnName
,
newCellData
,
columnCell
,
endList
);
let
endList
=
newCellData
.
getCellV
(
'
合计
'
,
cong
.
jishuhang
||
0
);
//获取 “v是合计的” 单元格数组
let
itemCellColumn
=
newCellData
.
getCellV
(
cong
.
itemName
||
'
项目
'
);
if
(
!
columnCell
||
!
endList
||
!
itemCellColumn
)
{
return
}
//获取项目的单元格的列数
...
...
@@ -125,15 +124,15 @@ export function getyyData(sum,kid = ''){
// 开始行是那一行
let
startRowIndex
=
columnCell
.
r
;
// 结束行是那一行
let
endRowIndex
=
endList
.
r
;
for
(
let
currentRowIndex
in
data
)
{
if
(
currentRowIndex
>=
endRowIndex
)
{
break
;
}
let
endRowIndex
=
endList
.
r
;
for
(
let
currentRowIndex
in
data
)
{
if
(
currentRowIndex
>=
endRowIndex
)
{
break
;
}
let
rowList
=
data
[
currentRowIndex
];
if
(
currentRowIndex
>
startRowIndex
)
{
if
(
currentRowIndex
>
startRowIndex
)
{
let
name
=
rowList
[
itemCellColumnIndex
]
&&
rowList
[
itemCellColumnIndex
].
v
let
money
=
rowList
[
columnIndex
]
&&
rowList
[
columnIndex
].
m
||
rowList
[
columnIndex
].
v
let
isFilterStartsWith
=
cong
.
isFilterStartsWith
!==
false
&&
/^
\d
/
.
test
(
name
&&
name
.
replace
&&
name
.
replace
(
/
\s
+/g
,
''
))
if
(
Number
(
money
)
>
0
&&
!
isFilterStartsWith
)
{
if
(
Number
(
money
)
>
0
&&
!
isFilterStartsWith
)
{
allAll
.
push
({
classary
:
cong
.
classary
,
money
,
...
...
@@ -143,30 +142,29 @@ export function getyyData(sum,kid = ''){
}
}
})
if
(
err
.
length
){
console
.
log
(
err
)
if
(
err
.
length
)
{
}
return
allAll
}
// 生成凭证第二步调取后端数据
export
function
newGettransformJson
(
sum
,
kid
)
{
let
schoolLunchValues
=
getyyData
(
sum
,
kid
)
export
function
newGettransformJson
(
sum
,
kid
)
{
let
schoolLunchValues
=
getyyData
(
sum
,
kid
)
let
borrow
=
[];
//借方
let
analyzedBorrow
=
[];
//借方待分析
let
loan
=
[];
//贷方
let
analyzedLoan
=
[];
//贷方待分析
schoolLunchValues
.
forEach
(
item
=>
{
if
(
!
item
.
name
.
includes
(
'
研发
'
))
{
if
(
!
item
.
name
.
includes
(
'
研发
'
))
{
let
obj
=
{
...
item
,
is_debit
:
0
,
mining
:
'
010101
'
}
borrow
.
push
(
obj
)
let
analyzedBorrowObj
=
{
...
obj
}
let
analyzedBorrowObj
=
{
...
obj
}
analyzedBorrowObj
.
classary
=
analyzedBorrowObj
.
classary
.
replace
(
'
提取
'
,
'
待分析
'
);
analyzedBorrow
.
push
(
analyzedBorrowObj
)
}
if
(
!
item
.
name
.
includes
(
'
(
'
)
||
!
item
.
name
.
includes
(
'
(
'
))
{
if
(
!
item
.
name
.
includes
(
'
(
'
)
||
!
item
.
name
.
includes
(
'
(
'
))
{
let
obj1
=
{
...
item
,
is_debit
:
1
,
mining
:
'
010101
'
}
loan
.
push
(
obj1
);
let
analyzedLoanObj
=
{
...
obj1
}
let
analyzedLoanObj
=
{
...
obj1
}
analyzedLoanObj
.
classary
=
analyzedLoanObj
.
classary
.
replace
(
'
提取
'
,
'
待分析
'
);
analyzedLoan
.
push
(
analyzedLoanObj
)
}
...
...
@@ -175,7 +173,13 @@ export function newGettransformJson(sum,kid) {
return
getyy
(
JSON
.
stringify
(
objJson
))
}
// 生成凭证第三步生成凭证luckysheet.create.Data的数据
export
function
tzcCreateData
(
old
,
json
,
luckysheet
,
mobile
,
ywrq
)
{
export
function
tzcCreateData
(
old2
,
json
,
luckysheet
,
mobile
,
ywrq
)
{
let
sum
=
0
let
old
=
old2
[
0
]
old2
[
1
].
index
=
99
;
old2
[
1
].
order
=
99
;
old2
[
2
].
index
=
100
;
old2
[
2
].
order
=
100
;
return
Object
.
entries
(
json
).
map
(([
key
,
json
],
index
)
=>
{
let
obj
=
JSON
.
parse
(
JSON
.
stringify
(
old
));
let
toData
=
luckysheet
.
transToData
(
obj
.
celldata
)
...
...
@@ -204,8 +208,9 @@ export function tzcCreateData(old, json, luckysheet, mobile, ywrq) {
toData
[
rowIndex
+
9
][
columnObj
[
'
*分录摘要
'
]]
=
vule
(
item
.
classary
);
toData
[
rowIndex
+
9
][
columnObj
[
'
*凭证类型
'
]]
=
'
转
'
;
toData
[
rowIndex
+
9
][
columnObj
[
'
*单据日期
'
]]
=
vule
(
ywrq
)
toData
[
rowIndex
+
9
][
columnObj
[
item
.
is_debit
===
0
?
'
本币借方金额
'
:
'
本币贷方金额
'
]]
=
vule
(
item
.
money
);
toData
[
rowIndex
+
9
][
columnObj
[
item
.
is_debit
===
0
?
'
原币借方金额
'
:
'
原币贷方金额
'
]]
=
vule
(
item
.
money
);
let
money
=
String
(
item
.
money
).
replace
(
'
'
,
''
);
toData
[
rowIndex
+
9
][
columnObj
[
item
.
is_debit
===
0
?
'
本币借方金额
'
:
'
本币贷方金额
'
]]
=
vule
(
money
);
toData
[
rowIndex
+
9
][
columnObj
[
item
.
is_debit
===
0
?
'
原币借方金额
'
:
'
原币贷方金额
'
]]
=
vule
(
money
);
toData
[
rowIndex
+
9
][
columnObj
[
'
*科目编码
'
]]
=
vule
(
item
.
account_code
||
''
);
[
'
auxiliary_item_a
'
,
'
auxiliary_item_b
'
].
forEach
(
itemKey
=>
{
if
(
item
[
itemKey
])
{
...
...
@@ -226,5 +231,48 @@ export function tzcCreateData(old, json, luckysheet, mobile, ywrq) {
})
obj
.
celldata
=
luckysheet
.
transToCellData
(
toData
)
return
obj
;
})
}).
concat
(
old2
.
slice
(
1
))
}
export
function
getDataValue
(
data
,
m
)
{
let
value
=
data
&&
data
.
v
||
''
;
if
(
m
){
value
=
data
&&
data
.
m
||
''
;
}
if
(
data
&&
data
.
ct
&&
data
.
ct
.
s
&&
data
.
ct
.
s
.
length
)
{
value
=
data
.
ct
.
s
.
map
(
e
=>
{
let
as
=
e
.
v
||
''
if
(
m
){
as
=
e
.
m
}
return
as
}).
join
(
''
);
}
return
value
;
}
export
function
collect
(
data
)
{
data
.
forEach
(
item
=>
item
.
data
=
luckysheet
.
transToData
(
item
.
celldata
)
)
let
collects
=
JSON
.
parse
(
JSON
.
stringify
(
data
[
0
]))
collects
.
name
=
'
汇总
'
collects
.
index
=
data
.
length
+
10
collects
.
order
=
98
for
(
let
i
=
1
;
i
<
data
.
length
;
i
++
)
{
data
[
i
].
data
.
forEach
((
item
,
index
)
=>
{
if
(
index
>
8
)
{
collects
.
data
.
push
(
item
)
}
})
}
function
removeEmptyArrays
(
arr
)
{
return
arr
.
filter
(
subArr
=>
{
// 检查每个子数组是否完全为空
return
subArr
.
some
(
item
=>
item
!==
null
);
});
}
collects
.
data
=
removeEmptyArrays
(
collects
.
data
)
collects
.
celldata
=
luckysheet
.
transToCellData
(
collects
.
data
)
data
.
push
(
collects
)
return
data
}
ruoyi-ui/src/views/ActSuppliesConvert/convert/indexConvert.vue
View file @
88b0dcd5
...
...
@@ -131,7 +131,6 @@ export default {
//根据选中的下拉选项值获取相应的信息
getSuppliesTemplate
(
this
.
selectedOption
).
then
(
response
=>
{
tempId
=
this
.
selectedOption
;
console
.
log
(
this
.
uuid
);
const
sysSupplies
=
response
.
rows
;
this
.
luckysheetData
=
sysSupplies
[
0
].
templateContent
;
//将接收到的json存到json_data中
...
...
@@ -239,14 +238,12 @@ export default {
const
exportJson
=
await
cons
;
await
this
.
summary
(
exportJson
);
this
.
submit
(
exportJson
);
//console.log('summary 执行完毕');
}
catch
(
Error
)
{
this
.
$message
({
message
:
Error
.
message
,
type
:
"
error
"
});
console
.
log
(
Error
.
message
);
console
.
log
(
"
这里是最外面的地方
"
);
}
finally
{
// 导入完成后关闭遮罩层
this
.
showMask
=
false
;
...
...
ruoyi-ui/src/views/system/ActClassification/index.vue
View file @
88b0dcd5
...
...
@@ -230,7 +230,6 @@ export default {
},
/**启用 */
toggleEnable
(
ActClassification
)
{
console
.
log
(
'
你点击了【
'
+
ActClassification
.
name
+
'
】的开关控件,当前开关值:
'
+
ActClassification
.
status
);
let
enableText
=
[
'
启用
'
,
'
禁用
'
];
if
(
ActClassification
.
status
===
0
)
{
toggleEnable
(
ActClassification
.
id
).
then
((
response
)
=>
{
...
...
@@ -331,7 +330,6 @@ export default {
},
/** 提交按钮 */
submitForm
()
{
console
.
log
(
this
.
form
)
this
.
$refs
[
"
form
"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
id
!=
null
)
{
...
...
ruoyi-ui/src/views/system/ActSuppliesDetails/ActSuppliesDetails/index.vue
View file @
88b0dcd5
...
...
@@ -364,7 +364,6 @@ export default {
/**启用 */
toggleEnable
(
actSuppliesDetails
){
console
.
log
(
'
你点击了【
'
+
actSuppliesDetails
.
detailsName
+
'
】的开关控件,当前开关值:
'
+
actSuppliesDetails
.
status
);
let
enableText
=
[
'
启用
'
,
'
禁用
'
];
if
(
actSuppliesDetails
.
status
===
0
)
{
toggleEnable
(
actSuppliesDetails
.
id
).
then
((
response
)
=>
{
...
...
ruoyi-ui/src/views/system/ActsupplesAll/fanMine.vue
View file @
88b0dcd5
...
...
@@ -42,8 +42,6 @@
</el-col>
</el-row>
<!-- luckysheet容器 -->
<div
id=
"luckysheet"
style=
"margin: 0px; padding: 0px; position: absolute; width: 100%; height:80vh; z-index: 0"
>
</div>
...
...
@@ -54,5 +52,4 @@
</div>
</
template
>
<
script
src=
"@/conversion/conversion"
></
script
>
<
style
scoped
src=
"./actsuppMine.css"
></
style
>
ruoyi-ui/src/views/system/Actsupplies/Actsupplies/index.vue
View file @
88b0dcd5
...
...
@@ -377,7 +377,6 @@ export default {
/**启用 */
toggleEnable
(
actSupplies
){
console
.
log
(
'
你点击了【
'
+
actSupplies
.
suppliesName
+
'
】的开关控件,当前开关值:
'
+
actSupplies
.
status
);
let
enableText
=
[
'
启用
'
,
'
禁用
'
];
if
(
actSupplies
.
status
===
0
)
{
toggleEnable
(
actSupplies
.
id
).
then
((
response
)
=>
{
...
...
ruoyi-ui/src/views/system/Wages/LinXiWages.vue
View file @
88b0dcd5
...
...
@@ -7,8 +7,8 @@
name: '林西矿',
id: '011704'
})">
<el-option
v-for=
"item in depss.filter(item => [12
48,1280].includes(item.id))"
:key=
"item.id"
:label=
"item.templateName"
:value
=
"item.id"
:disabled=
"item.disabled"
>
<el-option
v-for=
"item in depss.filter(item => [12
80].includes(item.id))"
:key
=
"item.id"
:
label=
"item.templateName"
:value=
"item.id"
:
disabled=
"item.disabled"
>
</el-option>
</el-select>
</el-form-item>
...
...
@@ -25,20 +25,21 @@
<el-upload
type=
"file"
name=
"file"
ref=
"upload"
:headers=
"
{ 'Content-Type': 'multipart/form-data' }"
:before-upload="handleFileChange" action='' accept='.xlsx' :limit="3" multiple :file-list="fileList"
:show-file-list="false" :on-success="handleSuccess">
<el-button
plain
:disabled=
"!wageMonth || !jsondata"
size=
"mini"
icon=
"el-icon-download"
type=
"primary"
>
导入
</el-button>
</el-upload>
<el-button
plain
:disabled=
"!wageMonth || !jsondata"
size=
"mini"
icon=
"el-icon-download"
type=
"primary"
>
导入
</el-button>
</el-upload>
<el-button
:plain=
"true"
style=
"display: none;"
@
click=
"open4"
>
错误
</el-button>
</el-col>
</el-row>
<el-dialog
title=
"取数规则"
:visible.sync=
"dialogTableVisible"
:close-on-click-modal=
"false"
:show-close=
"false"
>
<el-form
label-width=
"120px"
>
<el-form
label-width=
"120px"
>
<el-form-item
v-for=
"(item, index) in jsonhead"
:key=
"index"
:label=
"`$
{item.label}`">
<el-input
v-model=
"item.value"
></el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"handleClose()"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"initData()"
>
确 定
</el-button>
...
...
@@ -53,5 +54,410 @@
</div>
</div>
</
template
>
<
script
src=
"@/Wages/convers"
></
script
>
<
script
>
import
{
listSuppliesTemplate
,
getSuppliesTemplate
,
listMyluckyexcel
}
from
"
@/api/ruoyi-myLuckyexcel/myluckyexcel
"
;
import
{
conversionSave
,
importLxWagesExcel
,
lxSummary
}
from
"
@/api/conversion/index
"
;
import
LuckyExcel
from
"
luckyexcel
"
;
import
{
exportExcel
}
from
"
../../../../public/exportExcel
"
;
import
{
machLxGzdata
}
from
"
@/Wages/conversLxk.js
"
;
import
{
transformJson
,
tzcCreateData
,
newGettransformJson
,
collect
}
from
"
@/utils/tzc
"
var
fileName
=
"
新建XLSX工作表
"
;
//定义表名
var
modify
=
false
;
var
that
;
export
default
{
name
:
"
Mymodule
"
,
data
()
{
return
{
wageMonth
:
""
,
//详细信息
phone
:
""
,
//moban
//未导入成本材料表模板所有数据
jsondata
:
""
,
//编码数据
showMask
:
false
,
uuid
:
""
,
selectedOption
:
""
,
luckysheetData
:
""
,
luckysheetDatas
:
""
,
fileList
:
[],
depss
:
[],
VoucherForm
:
""
,
dialogTableVisible
:
false
,
all
:
""
,
jsonhead
:
[],
sum
:
[],
// 查询参数
queryParams
:
{
status
:
0
,
},
mineId
:
''
,
//矿ID
};
},
created
()
{
that
=
this
;
//刷新页面时进行的操作
},
mounted
()
{
this
.
init
();
fileName
=
"
新建XLSX工作表
"
;
this
.
getList
()
},
methods
:
{
getList
()
{
listSuppliesTemplate
(
this
.
queryParams
).
then
((
response
)
=>
{
response
.
rows
.
forEach
((
row
)
=>
{
if
(
row
.
templateName
.
includes
(
"
六矿
"
))
{
row
.
disabled
=
true
;
}
});
this
.
depss
=
response
.
rows
;
});
getSuppliesTemplate
(
1248
).
then
((
response
)
=>
{
const
sysSupplies
=
response
.
rows
;
console
.
log
(
response
,
'
222222222
'
)
this
.
luckysheetDatas
=
JSON
.
parse
(
sysSupplies
[
0
].
templateContent
);
});
},
//手机号
open
()
{
this
.
$prompt
(
"
请输入用友系统的用户名
"
,
"
提示
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
inputPattern
:
/^
(?:\+?
86
)?
1
[
3-9
]\d{9}
$/
,
inputErrorMessage
:
"
手机号格式不正确
"
,
})
.
then
(({
value
})
=>
{
this
.
$message
({
type
:
"
success
"
,
message
:
"
你的用户名是:
"
+
value
,
});
this
.
phone
=
value
;
this
.
zhuan
();
})
.
catch
(()
=>
{
this
.
$message
({
type
:
"
info
"
,
message
:
"
取消输入
"
,
});
this
.
showMask
=
false
;
});
},
open4
()
{
this
.
$message
.
error
(
"
请仔细检查所导入表
"
);
},
init
()
{
let
options
=
{
container
:
"
luckysheet
"
,
//luckysheet为容器id
title
:
""
,
lang
:
"
zh
"
,
showinfobar
:
false
,
data
:
[
{
name
:
"
sheet1
"
,
//工作表名称
color
:
""
,
//工作表颜色
index
:
0
,
//工作表索引
status
:
1
,
//激活状态
order
:
0
,
//工作表的下标
hide
:
0
,
//是否隐藏
row
:
50
,
//行数
column
:
20
,
//列数
defaultRowHeight
:
19
,
//自定义行高
defaultColWidth
:
73
,
//自定义列宽
celldata
:
[],
//初始化使用的单元格数据
config
:
{
merge
:
{},
//合并单元格
rowlen
:
{},
//表格行高
columnlen
:
{},
//表格列宽
rowhidden
:
{},
//隐藏行
colhidden
:
{},
//隐藏列
borderInfo
:
{},
//边框
authority
:
{},
//工作表保护
},
},
],
};
luckysheet
.
create
(
options
);
},
handleSuccess
(
response
,
file
,
fileList
)
{
},
//工资数据后台导入成功后,数据展示到前台
loadTableData
(
evt
)
{
this
.
sum
.
push
(
evt
);
if
(
modify
)
{
this
.
$confirm
(
"
再次导入将会清空表内数据,是否继续操作?
"
,
"
注意!!!
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
,
}
)
.
then
(
async
()
=>
{
// 确认继续后刷新页面返回模板
getSuppliesTemplate
(
this
.
selectedOption
)
.
then
((
response
)
=>
{
const
sysSupplies
=
response
.
rows
;
this
.
luckysheetData
=
sysSupplies
[
0
].
templateContent
;
let
json_data
=
JSON
.
parse
(
sysSupplies
[
0
].
templateContent
);
luckysheet
.
destroy
();
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
fileName
,
// Excel 文件名
data
:
json_data
,
// Excel 数据
allowEdit
:
false
,
//作用:是否允许前台编辑
showinfobar
:
false
,
//是否显示顶部名称栏
lang
:
"
zh
"
,
});
modify
=
false
;
this
.
open
(
this
.
sum
);
})
.
then
(
async
()
=>
{
})
.
catch
(()
=>
{
});
})
.
catch
(()
=>
{
// 用户点击了取消按钮
this
.
$message
({
type
:
"
info
"
,
message
:
"
操作已取消
"
,
});
});
}
else
{
this
.
open
(
evt
);
this
.
showMask
=
true
;
LuckyExcel
(
evt
,
(
exportJson
)
=>
{
//获取导入表格所有数据exportJson
this
.
open
(
exportJson
)
.
then
(
async
()
=>
{
})
.
catch
((
error
)
=>
{
this
.
$message
({
message
:
error
.
message
,
type
:
"
error
"
,
});
})
.
finally
(()
=>
{
// 导入完成后关闭遮罩层
this
.
showMask
=
false
;
});
});
}
},
async
handleFileChange
(
evt
)
{
if
(
this
.
value
.
includes
(
"
凭证
"
))
{
this
.
loadTableData
(
evt
);
}
var
param
=
new
FormData
();
param
.
append
(
"
file
"
,
evt
);
param
.
append
(
"
date
"
,
this
.
wageMonth
);
param
.
append
(
"
mineId
"
,
this
.
mineId
);
param
.
append
(
"
identification
"
,
"
0
"
);
importLxWagesExcel
(
param
).
then
((
res
)
=>
{
//导入成功
if
(
res
.
code
==
200
)
{
this
.
loadTableData
(
evt
);
}
else
{
this
.
$message
.
error
(
"
后台数据导入失败!
"
);
}
});
},
handleOptionChange
(
mine_id
)
{
that
.
mineId
=
mine_id
.
id
let
lod
=
this
.
$loading
({
lock
:
true
,
text
:
"
加载中
"
,
background
:
"
rgba(0, 0, 0, 0.7)
"
,
});
//根据选中的下拉选项值获取相应的信息
getSuppliesTemplate
(
this
.
selectedOption
)
.
then
((
response
)
=>
{
lod
.
close
();
modify
=
false
;
const
sysSupplies
=
response
.
rows
;
this
.
luckysheetData
=
sysSupplies
[
0
].
templateContent
;
var
json_data
=
JSON
.
parse
(
sysSupplies
[
0
].
templateContent
);
this
.
jsondata
=
json_data
;
let
suffixArr
=
sysSupplies
[
0
].
templateName
.
split
(
"
.
"
);
fileName
=
suffixArr
[
0
];
//luckysheet.destroy()
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
fileName
,
// Excel 文件名
data
:
json_data
,
// Excel 数据
showinfobar
:
false
,
allowEdit
:
false
,
//是否显示顶部名称栏
lang
:
"
zh
"
,
index
:
"
0
"
,
//工作表索引
status
:
"
1
"
,
//激活状态
});
this
.
value
=
fileName
;
})
.
catch
(()
=>
{
lod
.
close
();
this
.
$message
.
error
(
"
查询失败,发生未知错误!
"
);
});
},
initData
()
{
try
{
// 将 this.jsonhead 转换为 JSON 字符串
const
postData
=
this
.
jsonhead
.
filter
(
(
item
)
=>
item
.
value
.
trim
()
!=
""
);
this
.
dialogTableVisible
=
false
;
const
CompositeTable
=
this
.
jsondata
;
var
putJson
=
{
date
:
this
.
wageMonth
,
data
:
postData
,
};
lxSummary
(
putJson
).
then
((
response
)
=>
{
if
(
response
.
code
==
200
)
{
var
data
=
response
.
data
;
let
myCompositeTable
=
machLxGzdata
(
data
,
CompositeTable
);
this
.
setLuckysheetData
(
CompositeTable
,
myCompositeTable
);
}
else
{
}
});
}
catch
{
this
.
open4
();
modify
=
true
;
this
.
showMask
=
false
;
}
},
//工资数据后台汇总完后,回显到前台
setLuckysheetData
(
CompositeTable
,
myCompositeTable
)
{
CompositeTable
[
0
].
data
=
luckysheet
.
transToData
(
myCompositeTable
[
0
].
celldata
);
CompositeTable
[
0
].
calcChain
=
[];
let
as
=
CompositeTable
[
0
].
celldata
.
filter
(
(
item
)
=>
item
.
v
.
f
);
as
.
forEach
((
item
)
=>
{
let
sum
=
{
index
:
CompositeTable
[
0
].
index
,
r
:
item
.
r
,
c
:
item
.
c
,
};
CompositeTable
[
0
].
calcChain
.
push
(
sum
);
});
CompositeTable
[
0
].
celldata
[
0
].
status
=
1
;
luckysheet
.
create
({
forceCalculation
:
true
,
container
:
"
luckysheet
"
,
title
:
fileName
,
data
:
CompositeTable
,
showinfobar
:
false
,
lang
:
"
zh
"
,
});
var
jsonString
=
JSON
.
stringify
(
this
.
jsonhead
);
let
obj
=
{
yearMonth
:
this
.
wageMonth
,
jsonData
:
JSON
.
stringify
(
CompositeTable
),
value
:
jsonString
,
mineId
:
that
.
mineId
,
};
modify
=
true
;
that
.
showMask
=
false
;
conversionSave
(
obj
).
then
((
response
)
=>
{
});
},
//转换方法
zhuan
()
{
const
promises
=
this
.
sum
.
map
((
item
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
LuckyExcel
.
transformExcelToLucky
(
item
,
(
lucksheetfile
)
=>
{
resolve
(
lucksheetfile
);
});
});
});
Promise
.
all
(
promises
).
then
((
results
)
=>
{
let
sum
=
[];
//计算全部单位工资总和
results
.
forEach
((
item
)
=>
{
sum
.
push
(...
item
.
sheets
);
});
if
(
this
.
value
.
includes
(
"
凭证
"
))
{
this
.
VoucherForms
(
sum
);
}
else
{
this
.
all
=
sum
;
this
.
dialogTableVisible
=
true
;
}
});
},
//公式窗口关闭回调
handleClose
()
{
that
.
dialogTableVisible
=
false
;
that
.
showMask
=
false
;
},
async
VoucherForms
(
sum
)
{
try
{
let
objks
=
await
newGettransformJson
(
sum
,
that
.
mineId
)
let
createData
=
tzcCreateData
(
this
.
luckysheetDatas
,
transformJson
(
objks
.
data
),
luckysheet
,
this
.
phone
,
this
.
wageMonth
);
createData
=
collect
(
createData
)
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
fileName
,
// Excel 文件名
allowEdit
:
false
,
//作用:是否允许前台编辑
data
:
createData
,
// Excel 数据
showinfobar
:
false
,
//是否显示顶部名称栏
lang
:
"
zh
"
,
});
modify
=
true
;
this
.
showMask
=
false
;
}
catch
{
modify
=
true
;
this
.
showMask
=
false
;
this
.
open4
();
}
},
handleExport
:
debounce
(
function
()
{
// handleExport
exportExcel
(
luckysheet
.
getAllSheets
(),
fileName
);
},
500
),
},
};
// debounce函数定义
function
debounce
(
func
,
delay
)
{
let
timer
;
return
function
()
{
const
context
=
this
;
const
args
=
arguments
;
clearTimeout
(
timer
);
timer
=
setTimeout
(
function
()
{
func
.
apply
(
context
,
args
);
},
delay
);
};
}
</
script
>
<
style
scoped
src=
"./Wages.css"
></
style
>
ruoyi-ui/src/views/system/Wages/TangshanWages.vue
View file @
88b0dcd5
...
...
@@ -7,8 +7,8 @@
name: '唐山矿',
id: '010101'
})">
<el-option
v-for=
"item in depss.filter(item => [1270
,1248].includes(item.id))"
:key=
"item.id"
:label=
"item.templateName"
:value
=
"item.id"
:disabled=
"item.disabled"
>
<el-option
v-for=
"item in depss.filter(item => [1270
].includes(item.id))"
:key
=
"item.id"
:
label=
"item.templateName"
:value=
"item.id"
:
disabled=
"item.disabled"
>
</el-option>
</el-select>
</el-form-item>
...
...
@@ -25,20 +25,21 @@
<el-upload
type=
"file"
name=
"file"
ref=
"upload"
:headers=
"
{ 'Content-Type': 'multipart/form-data' }"
:before-upload="handleFileChange" action='' accept='.xlsx' :limit="3" multiple :file-list="fileList"
:show-file-list="false" :on-success="handleSuccess">
<el-button
plain
:disabled=
"!wageMonth || !jsondata"
size=
"mini"
icon=
"el-icon-download"
type=
"primary"
>
导入
</el-button>
</el-upload>
<el-button
plain
:disabled=
"!wageMonth || !jsondata"
size=
"mini"
icon=
"el-icon-download"
type=
"primary"
>
导入
</el-button>
</el-upload>
<el-button
:plain=
"true"
style=
"display: none;"
@
click=
"open4"
>
错误
</el-button>
</el-col>
</el-row>
<el-dialog
title=
"取数规则"
:visible.sync=
"dialogTableVisible"
:close-on-click-modal=
"false"
:show-close=
"false"
>
<el-form
label-width=
"120px"
>
<el-form
label-width=
"120px"
>
<el-form-item
v-for=
"(item, index) in jsonhead"
:key=
"index"
:label=
"`$
{item.label}`">
<el-input
v-model=
"item.value"
></el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"handleClose()"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"initData()"
>
确 定
</el-button>
...
...
@@ -53,5 +54,433 @@
</div>
</div>
</
template
>
<
script
src=
"@/Wages/convers"
></
script
>
<
style
scoped
src=
"./Wages.css"
></
style
>
<
script
>
import
{
getSuppliesTemplate
,
listSuppliesTemplate
,
listMyluckyexcel
,
}
from
"
@/api/ruoyi-myLuckyexcel/myluckyexcel
"
;
import
{
conversionSave
,
surface
,
getRecentFormulas
,
}
from
"
@/api/conversion/index
"
;
import
LuckyExcel
from
"
luckyexcel
"
;
import
{
exportExcel
}
from
"
../../../../public/exportExcel
"
;
import
{
machGzdata
}
from
"
@/Wages/conversTsk.js
"
;
import
{
transformJson
,
tzcCreateData
,
newGettransformJson
,
collect
}
from
"
@/utils/tzc
"
var
fileName
=
"
新建XLSX工作表
"
;
//定义表名
var
modify
=
false
;
var
that
;
export
default
{
name
:
"
Mymodule
"
,
data
()
{
return
{
wageMonth
:
""
,
//详细信息
phone
:
""
,
//moban
//未导入成本材料表模板所有数据
jsondata
:
""
,
//编码数据
showMask
:
false
,
uuid
:
""
,
selectedOption
:
""
,
luckysheetData
:
""
,
luckysheetDatas
:
""
,
depss
:
[],
fileList
:
[],
VoucherForm
:
""
,
dialogTableVisible
:
false
,
all
:
""
,
jsonhead
:
[],
sum
:
[],
// 查询参数
queryParams
:
{
status
:
0
,
},
mineId
:
''
,
//矿ID
};
},
created
()
{
that
=
this
;
},
mounted
()
{
this
.
init
();
fileName
=
"
新建XLSX工作表
"
;
this
.
getList
()
},
methods
:
{
getList
()
{
listSuppliesTemplate
(
this
.
queryParams
).
then
((
response
)
=>
{
response
.
rows
.
forEach
((
row
)
=>
{
if
(
row
.
templateName
.
includes
(
"
六矿
"
))
{
row
.
disabled
=
true
;
}
});
this
.
depss
=
response
.
rows
;
});
getSuppliesTemplate
(
1248
).
then
((
response
)
=>
{
const
sysSupplies
=
response
.
rows
;
console
.
log
(
response
,
'
222222222
'
)
this
.
luckysheetDatas
=
JSON
.
parse
(
sysSupplies
[
0
].
templateContent
);
});
},
//查询材料编码
//手机号
open
()
{
this
.
$prompt
(
"
请输入用友系统的用户名
"
,
"
提示
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
inputPattern
:
/^
(?:\+?
86
)?
1
[
3-9
]\d{9}
$/
,
inputErrorMessage
:
"
手机号格式不正确
"
,
})
.
then
(({
value
})
=>
{
this
.
$message
({
type
:
"
success
"
,
message
:
"
你的用户名是:
"
+
value
,
});
this
.
phone
=
value
;
this
.
zhuan
();
})
.
catch
(()
=>
{
this
.
$message
({
type
:
"
info
"
,
message
:
"
取消输入
"
,
});
this
.
showMask
=
false
;
});
},
open4
()
{
this
.
$message
.
error
(
"
请仔细检查所导入表
"
);
},
init
()
{
let
options
=
{
container
:
"
luckysheet
"
,
//luckysheet为容器id
title
:
""
,
lang
:
"
zh
"
,
showinfobar
:
false
,
data
:
[
{
name
:
"
sheet1
"
,
//工作表名称
color
:
""
,
//工作表颜色
index
:
0
,
//工作表索引
status
:
1
,
//激活状态
order
:
0
,
//工作表的下标
hide
:
0
,
//是否隐藏
row
:
50
,
//行数
column
:
20
,
//列数
defaultRowHeight
:
19
,
//自定义行高
defaultColWidth
:
73
,
//自定义列宽
celldata
:
[],
//初始化使用的单元格数据
config
:
{
merge
:
{},
//合并单元格
rowlen
:
{},
//表格行高
columnlen
:
{},
//表格列宽
rowhidden
:
{},
//隐藏行
colhidden
:
{},
//隐藏列
borderInfo
:
{},
//边框
authority
:
{},
//工作表保护
},
},
],
};
luckysheet
.
create
(
options
);
},
handleSuccess
(
response
,
file
,
fileList
)
{
},
//工资数据后台导入成功后,数据展示到前台
loadTableData
(
evt
)
{
this
.
sum
.
push
(
evt
);
if
(
modify
)
{
this
.
$confirm
(
"
再次导入将会清空表内数据,是否继续操作?
"
,
"
注意!!!
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
,
}
)
.
then
(
async
()
=>
{
// 确认继续后刷新页面返回模板
getSuppliesTemplate
(
this
.
selectedOption
)
.
then
((
response
)
=>
{
const
sysSupplies
=
response
.
rows
;
this
.
luckysheetData
=
sysSupplies
[
0
].
templateContent
;
let
json_data
=
JSON
.
parse
(
sysSupplies
[
0
].
templateContent
);
luckysheet
.
destroy
();
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
fileName
,
// Excel 文件名
data
:
json_data
,
// Excel 数据
allowEdit
:
false
,
//作用:是否允许前台编辑
showinfobar
:
false
,
//是否显示顶部名称栏
lang
:
"
zh
"
,
});
modify
=
false
;
this
.
open
(
this
.
sum
);
})
.
then
(
async
()
=>
{
})
.
catch
(()
=>
{
});
})
.
catch
(()
=>
{
// 用户点击了取消按钮
this
.
$message
({
type
:
"
info
"
,
message
:
"
操作已取消
"
,
});
});
}
else
{
this
.
open
(
evt
);
this
.
showMask
=
true
;
LuckyExcel
(
evt
,
(
exportJson
)
=>
{
//获取导入表格所有数据exportJson
this
.
open
(
exportJson
)
.
then
(
async
()
=>
{
})
.
catch
((
error
)
=>
{
this
.
$message
({
message
:
error
.
message
,
type
:
"
error
"
,
});
})
.
finally
(()
=>
{
// 导入完成后关闭遮罩层
this
.
showMask
=
false
;
});
});
}
},
async
handleFileChange
(
evt
)
{
if
(
this
.
value
.
includes
(
"
凭证
"
))
{
this
.
loadTableData
(
evt
);
}
else
{
//组装后台接口数据
var
param
=
new
FormData
();
param
.
append
(
"
file
"
,
evt
);
param
.
append
(
"
date
"
,
this
.
wageMonth
);
listMyluckyexcel
(
param
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
loadTableData
(
evt
);
}
else
{
this
.
$message
.
error
(
"
后台数据导入失败!
"
);
}
});
}
},
handleOptionChange
(
mine_id
)
{
that
.
mineId
=
mine_id
.
id
let
lod
=
this
.
$loading
({
lock
:
true
,
text
:
"
加载中
"
,
background
:
"
rgba(0, 0, 0, 0.7)
"
,
});
//根据选中的下拉选项值获取相应的信息
getSuppliesTemplate
(
this
.
selectedOption
)
.
then
((
response
)
=>
{
lod
.
close
();
modify
=
false
;
const
sysSupplies
=
response
.
rows
;
this
.
luckysheetData
=
sysSupplies
[
0
].
templateContent
;
var
json_data
=
JSON
.
parse
(
sysSupplies
[
0
].
templateContent
);
this
.
jsondata
=
json_data
;
let
suffixArr
=
sysSupplies
[
0
].
templateName
.
split
(
"
.
"
);
fileName
=
suffixArr
[
0
];
//luckysheet.destroy()
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
fileName
,
// Excel 文件名
data
:
json_data
,
// Excel 数据
showinfobar
:
false
,
allowEdit
:
false
,
//是否显示顶部名称栏
lang
:
"
zh
"
,
index
:
"
0
"
,
//工作表索引
status
:
"
1
"
,
//激活状态
});
this
.
value
=
fileName
;
if
(
!
fileName
.
includes
(
"
凭证
"
))
{
var
excel_r
=
0
;
//读取行
var
excel_c
=
0
;
//读取起始列
excel_r
=
2
;
let
head
=
this
.
jsondata
[
0
].
celldata
.
filter
(
(
item
)
=>
item
.
r
&&
item
.
r
==
excel_r
&&
item
.
c
>
excel_c
);
this
.
jsonhead
=
[];
head
.
forEach
((
item
)
=>
{
let
funct
=
{
label
:
item
.
v
.
v
+
"
=
"
,
c
:
item
.
c
,
value
:
""
,
};
this
.
jsonhead
.
push
(
funct
);
});
}
})
.
catch
(()
=>
{
lod
.
close
();
// 处理错误逻辑,这里是一个空的错误处理函数
this
.
$message
.
error
(
"
查询失败,发生未知错误!
"
);
});
},
initData
()
{
try
{
const
postData
=
this
.
jsonhead
.
filter
(
(
item
)
=>
item
.
value
.
trim
()
!=
""
);
this
.
dialogTableVisible
=
false
;
const
CompositeTable
=
this
.
jsondata
;
var
putJson
=
{
date
:
this
.
wageMonth
,
data
:
postData
,
};
//唐山工资汇总
surface
(
putJson
).
then
((
response
)
=>
{
if
(
response
.
code
==
200
)
{
var
data
=
response
.
data
;
let
myCompositeTable
=
machGzdata
(
data
,
CompositeTable
);
this
.
setLuckysheetData
(
CompositeTable
,
myCompositeTable
);
}
else
{
}
});
}
catch
{
this
.
open4
();
modify
=
true
;
this
.
showMask
=
false
;
}
},
//工资数据后台汇总完后,回显到前台
setLuckysheetData
(
CompositeTable
,
myCompositeTable
)
{
CompositeTable
[
0
].
data
=
luckysheet
.
transToData
(
myCompositeTable
[
0
].
celldata
);
CompositeTable
[
0
].
calcChain
=
[];
let
as
=
CompositeTable
[
0
].
celldata
.
filter
(
(
item
)
=>
item
.
v
.
f
);
as
.
forEach
((
item
)
=>
{
let
sum
=
{
index
:
CompositeTable
[
0
].
index
,
r
:
item
.
r
,
c
:
item
.
c
,
};
CompositeTable
[
0
].
calcChain
.
push
(
sum
);
});
CompositeTable
[
0
].
celldata
[
0
].
status
=
1
;
luckysheet
.
create
({
forceCalculation
:
true
,
container
:
"
luckysheet
"
,
title
:
fileName
,
data
:
CompositeTable
,
showinfobar
:
false
,
lang
:
"
zh
"
,
});
var
jsonString
=
JSON
.
stringify
(
this
.
jsonhead
);
let
obj
=
{
yearMonth
:
this
.
wageMonth
,
jsonData
:
JSON
.
stringify
(
CompositeTable
),
value
:
jsonString
,
mineId
:
that
.
mineId
,
};
modify
=
true
;
that
.
showMask
=
false
;
conversionSave
(
obj
).
then
((
response
)
=>
{
});
},
//转换方法
zhuan
()
{
const
promises
=
this
.
sum
.
map
((
item
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
LuckyExcel
.
transformExcelToLucky
(
item
,
(
lucksheetfile
)
=>
{
resolve
(
lucksheetfile
);
});
});
});
Promise
.
all
(
promises
).
then
((
results
)
=>
{
let
sum
=
[];
//计算全部单位工资总和
results
.
forEach
((
item
)
=>
{
sum
.
push
(...
item
.
sheets
);
});
if
(
this
.
value
.
includes
(
"
凭证
"
))
{
this
.
VoucherForms
(
sum
);
}
else
{
this
.
all
=
sum
;
this
.
dialogTableVisible
=
true
;
}
});
},
//公式窗口关闭回调
handleClose
()
{
that
.
dialogTableVisible
=
false
;
that
.
showMask
=
false
;
},
async
VoucherForms
(
sum
)
{
try
{
let
objks
=
await
newGettransformJson
(
sum
,
that
.
mineId
)
let
createData
=
tzcCreateData
(
this
.
luckysheetDatas
,
transformJson
(
objks
.
data
),
luckysheet
,
this
.
phone
,
this
.
wageMonth
);
createData
=
collect
(
createData
)
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
fileName
,
// Excel 文件名
allowEdit
:
false
,
//作用:是否允许前台编辑
data
:
createData
,
// Excel 数据
showinfobar
:
false
,
//是否显示顶部名称栏
lang
:
"
zh
"
,
});
modify
=
true
;
this
.
showMask
=
false
;
}
catch
{
modify
=
true
;
this
.
showMask
=
false
;
this
.
open4
();
}
},
handleExport
:
debounce
(
function
()
{
// handleExport
exportExcel
(
luckysheet
.
getAllSheets
(),
fileName
);
},
500
),
},
};
// debounce函数定义
function
debounce
(
func
,
delay
)
{
let
timer
;
return
function
()
{
const
context
=
this
;
const
args
=
arguments
;
clearTimeout
(
timer
);
timer
=
setTimeout
(
function
()
{
func
.
apply
(
context
,
args
);
},
delay
);
};
}
</
script
>
ruoyi-ui/src/views/system/Wages/contrast.vue
View file @
88b0dcd5
...
...
@@ -26,10 +26,6 @@
<el-button
plain
size=
"mini"
icon=
"el-icon-download"
type=
"primary"
>
导入
</el-button>
</el-upload>
</el-col>
</el-row>
<div
v-if=
"showMask"
class=
"mask"
>
<div
class=
"loading-spinner"
></div>
</div>
<el-table
v-loading=
"loading"
:data=
"comList"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"单位"
prop=
"mineId"
:formatter=
"deptFormat"
width=
"150"
>
...
...
ruoyi-ui/src/views/system/power/ass.js
View file @
88b0dcd5
...
...
@@ -31,7 +31,6 @@ function setDataV(itemName, CName, data, CConfig, itemConfig) {
let
funV
=
null
;
if
(
data
[
item
])
{
if
(
item
===
'
合计
'
){
console
.
log
(
data
[
item
],
1111
)
}
funV
=
getValue
(
data
[
item
],
CConfig
[
CName
])
}
else
{
...
...
ruoyi-ui/src/views/system/power/index.vue
View file @
88b0dcd5
...
...
@@ -88,7 +88,6 @@ export default {
},
methods
:
{
huizi
(){
console
.
log
(
this
.
shuju
)
this
.
views
=
'
汇总
'
;
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
...
...
@@ -375,12 +374,13 @@ export default {
// 第三步 生成凭证
let
template
=
await
getSuppliesTemplate
(
1248
)
let
createData
=
tzcCreateData
(
JSON
.
parse
(
template
.
rows
[
0
].
templateContent
)
[
0
]
,
JSON
.
parse
(
template
.
rows
[
0
].
templateContent
),
transformJson
(
res
.
data
),
luckysheet
,
this
.
phone
,
this
.
phone
,
this
.
wageMonth
);
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
'
凭证
'
,
// Excel 文件名
...
...
ruoyi-ui/src/views/system/power/linxi.vue
View file @
88b0dcd5
<
template
>
<testComponent
:kobj =
'
{ name: "林西矿", id: "011704" }'
:depssfilter = '[1282]'
>
</testComponent>
</
template
>
<
script
>
//1.先使用import导入你要在该组件中使用的子组件
import
testComponent
from
'
./index.vue
'
export
default
{
//2.然后,在components中写入子组件
components
:
{
testComponent
},
function
debounce
(
func
,
delay
)
{
let
timer
;
return
function
()
{
const
context
=
this
;
const
args
=
arguments
;
clearTimeout
(
timer
);
timer
=
setTimeout
(
function
()
{
func
.
apply
(
context
,
args
);
},
delay
);
};
}
import
{
choose
,
migrateCellDatas
}
from
'
@/utils/YLW
'
import
{
getSuppliesTemplate
,
}
from
'
@/api/ruoyi-myLuckyexcel/myluckyexcel
'
import
LuckyExcel
from
"
luckyexcel
"
;
import
{
listSuppliesTemplate
,
}
from
"
@/api/ruoyi-myLuckyexcel/myluckyexcel
"
;
import
{
exportExcel
}
from
'
/public/exportExcel
'
import
{
ruleselect
}
from
'
@/api/system/rules
'
;
export
default
{
data
()
{
return
{
views
:
'
a
'
,
selectedOption
:
""
,
wageMonth
:
""
,
templateList
:
[],
// 凭证模版
pzTemplate
:
null
,
// 汇总模版
huiZongTemplate
:
null
,
oldhuz
:
null
,
rulesshow
:
''
,
rulessql
:
''
};
},
mounted
()
{
this
.
initialize
()
},
methods
:
{
handleOptionChange
(
e
)
{
ruleselect
(
e
).
then
(
res
=>
{
let
rules
=
res
.
data
this
.
rulesshow
=
rules
.
filter
(
item
=>
item
.
type
==
0
)
this
.
rulessql
=
rules
.
filter
(
item
=>
item
.
type
==
1
)
})
getSuppliesTemplate
(
e
).
then
((
response
)
=>
{
let
json_data
=
JSON
.
parse
(
response
.
rows
[
0
].
templateContent
);
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
'
11111111
'
,
// Excel 文件名
data
:
json_data
,
// Excel 数据
allowEdit
:
false
,
//作用:是否允许前台编辑
showinfobar
:
false
,
//是否显示顶部名称栏
lang
:
"
zh
"
,
});
});
},
initialize
()
{
listSuppliesTemplate
(
this
.
queryParams
).
then
((
response
)
=>
{
this
.
templateList
=
response
.
rows
});
// getSuppliesTemplate(1248).then((response) => {
// // this.pzTemplate = JSON.parse(response.rows[0].templateContent);
// });
},
async
handleFileChange
(
evt
)
{
const
transformPromise
=
new
Promise
((
resolve
,
reject
)
=>
{
LuckyExcel
.
transformExcelToLucky
(
evt
,
(
lucksheetfile
)
=>
{
resolve
(
lucksheetfile
);
});
});
transformPromise
.
then
((
result
)
=>
{
result
=
result
.
sheets
let
newdata
=
choose
(
this
.
rulesshow
,
result
,
luckysheet
.
getAllSheets
())
newdata
.
forEach
(
item
=>
{
item
.
data
=
luckysheet
.
transToData
(
item
.
celldata
)
item
.
celldata
=
luckysheet
.
transToCellData
(
item
.
data
)
})
console
.
log
(
newdata
)
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
'
11111111
'
,
// Excel 文件名
data
:
newdata
,
// Excel 数据
allowEdit
:
false
,
//作用:是否允许前台编辑
showinfobar
:
false
,
//是否显示顶部名称栏
lang
:
"
zh
"
,
});
// let luckydata = []
// this.rulessql.forEach(item => {
// if (item.firstRule == 1) {
// item.rules.forEach(obj => {
// if (obj.secondRule == 1) {
// let data = migrateCellDatas(obj, result)
// luckydata.push(...data)
// } else {
// let data = migrateCellDatas(obj, luckysheet.getAllSheets())
// luckydata.push(...data)
// }
// })
// }
// })
// console.log(luckydata)
});
},
handleExport
:
debounce
(
function
()
{
exportExcel
(
luckysheet
.
getAllSheets
(),
'
林西
'
);
},
500
),
importData
(
e
)
{
},
},
};
</
script
>
<
template
>
<div
class=
"app-container"
>
<el-form
ref=
"queryForm"
size=
"small"
:inline=
"true"
label-width=
"68px"
>
<el-form-item
label=
"模板"
prop=
"name"
>
<el-select
@
change=
"handleOptionChange"
v-model=
"selectedOption"
size=
"mini"
filterable
placeholder=
"请选择您要查看的模板"
>
<el-option
v-for=
"item in templateList"
:key=
"item.id"
:label=
"item.templateName"
:value=
"item.id"
:disabled=
"item.disabled"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"时间"
prop=
"wageMonth"
>
<el-date-picker
v-model=
"wageMonth"
value-format=
"yyyy-MM"
type=
"month"
placeholder=
"选择月"
>
</el-date-picker>
</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"
@
click=
"handleExport"
size=
"mini"
>
导出
</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"
:show-file-list=
false
>
<el-button
plain
:disabled=
"!wageMonth || !selectedOption"
size=
"mini"
icon=
"el-icon-download"
type=
"primary"
>
导入
</el-button>
</el-upload>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
plain
icon=
"el-icon-upload2"
@
click=
"scpz"
v-if=
"views === 'b'"
size=
"mini"
>
生成凭证
</el-button>
<el-button
plain
icon=
"el-icon-upload2"
@
click=
"fhhz"
v-if=
"views === 'c'"
size=
"mini"
>
返回汇总
</el-button>
</el-col>
</el-row>
<div
id=
"luckysheet"
style=
"margin: 0px; padding: 0px; position: absolute; width: 100%; height:80vh; z-index: 0"
>
</div>
</div>
</
template
>
<
style
scoped
src=
"@/assets/css/power/index.css"
></
style
>
ruoyi-ui/src/views/system/run_of_coal/index.vue
View file @
88b0dcd5
...
...
@@ -113,7 +113,6 @@ export default {
luckysheet
.
create
(
options
);
},
handleSelectChange
()
{
console
.
log
(
this
.
date
,
this
.
mine
)
},
handleExport
:
debounce
(
function
()
{
// 导出
...
...
ruoyi-ui/src/views/system/supplies/index.vue
View file @
88b0dcd5
...
...
@@ -232,7 +232,6 @@ export default {
const
sysSupplies
=
response
.
rows
;
this
.
luckysheetData
=
sysSupplies
[
0
].
templateContent
;
console
.
log
(
sysSupplies
)
var
json_data
=
JSON
.
parse
(
sysSupplies
[
0
].
templateContent
);
roleList
(
this
.
selectedOption
).
then
(
response
=>
{
...
...
@@ -1479,18 +1478,6 @@ export default {
type
:
"
warning
"
});
}
// 记录结束时间
const
endTime
=
new
Date
().
getTime
();
// 计算执行时间(以毫秒为单位)
const
executionTime
=
endTime
-
startTime
;
const
executionTime1
=
endTime1
-
startTime1
;
const
executionTime2
=
endTime2
-
startTime2
;
const
executionTime3
=
endTime3
-
startTime3
;
// 输出执行时间
console
.
log
(
`代码执行时间:
${
executionTime
}
毫秒`
);
console
.
log
(
`转换编码执行时间:
${
executionTime1
}
毫秒`
);
console
.
log
(
`map汇总执行时间:
${
executionTime2
}
毫秒`
);
console
.
log
(
`页面渲染执行时间:
${
executionTime3
}
毫秒`
);
resolve
(
response
.
rows
);
innerResolve
();
// 标记当前异步任务完成
}).
catch
(
Error
=>
{
...
...
@@ -1505,7 +1492,6 @@ export default {
}
//切换到想要的sheet
luckysheet
.
setSheetActive
(
0
);
console
.
log
(
luckysheet
.
getConfig
(
0
))
Promise
.
all
(
asyncTasks
)
.
then
(()
=>
{
resolve
();
// 所有异步请求执行完成
...
...
ruoyi-ui/src/views/system/supplies/index_template.vue
View file @
88b0dcd5
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
label-width=
"68px"
>
<el-form-item
label=
"模板名称"
prop=
"templateName"
label-width=
"100px"
>
<el-input
v-model=
"queryParams.templateName"
placeholder=
"请输入模板名称"
clearable
@
keyup.enter.native=
"handleQuery"
maxlength=
"15"
/>
<el-input
v-model=
"queryParams.templateName"
placeholder=
"请输入模板名称"
clearable
@
keyup.enter.native=
"handleQuery"
maxlength=
"15"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-select
v-model=
"queryParams.status"
placeholder=
"请选择状态"
clearable
@
keyup.enter.native=
"handleQuery"
>
...
...
@@ -25,14 +20,8 @@
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['SuppliesTemplate:SuppliesTemplate:add']"
>
新增
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['SuppliesTemplate:SuppliesTemplate:add']"
>
新增
</el-button>
</el-col>
<!--
<el-col
:span=
"1.5"
>
...
...
@@ -48,27 +37,13 @@
</el-button>
</el-col>
-->
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['SuppliesTemplate:SuppliesTemplate:remove']"
>
删除
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['SuppliesTemplate:SuppliesTemplate:remove']"
>
删除
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"multiple"
@
click=
"releaseStatus"
v-hasPermi=
"['SuppliesTemplate:SuppliesTemplate:releaseStatus']"
>
发布
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"multiple"
@
click=
"releaseStatus"
v-hasPermi=
"['SuppliesTemplate:SuppliesTemplate:releaseStatus']"
>
发布
</el-button>
</el-col>
...
...
@@ -76,9 +51,9 @@
</el-row>
<el-table
v-loading=
"loading"
:data=
"SuppliesTemplateList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
type=
"index"
width=
"80"
align=
"center"
label=
"序号"
:index=
"indexMethod"
/>
<el-table-column
label=
"模板名称"
align=
"center"
prop=
"templateName"
/>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
type=
"index"
width=
"80"
align=
"center"
label=
"序号"
:index=
"indexMethod"
/>
<el-table-column
label=
"模板名称"
align=
"center"
prop=
"templateName"
/>
<!--
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
>
<template
slot-scope=
"scope"
>
<div>
...
...
@@ -111,83 +86,47 @@
</template>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"releaseStatus(scope.row)"
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"releaseStatus(scope.row)"
v-hasPermi=
"['SuppliesTemplate:SuppliesTemplate:status']"
:style=
"
{display : scope.row.status>0?'':'none'}"
>发布
:style=
"
{display : scope.row.status>0?'':'none'}">发布
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"offShelfStatus(scope.row)"
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"offShelfStatus(scope.row)"
v-hasPermi=
"['SuppliesTemplate:SuppliesTemplate:status']"
:style=
"
{display : scope.row.status===0?'':'none'}"
>下架
:style=
"
{display : scope.row.status===0?'':'none'}">下架
</el-button>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleSave(scope.row)"
v-hasPermi=
"['SuppliesTemplate:SuppliesTemplate']"
>
详情
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleSave(scope.row)"
v-hasPermi=
"['SuppliesTemplate:SuppliesTemplate']"
>
详情
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleCopy(scope.row)"
v-hasPermi=
"['SuppliesTemplate:SuppliesTemplate:edit']"
>
复制
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleCopy(scope.row)"
v-hasPermi=
"['SuppliesTemplate:SuppliesTemplate:edit']"
>
复制
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['SuppliesTemplate:SuppliesTemplate:edit']"
:style=
"
{display : scope.row.status===1?'':'none'}"
>修改
:style=
"
{display : scope.row.status===1?'':'none'}">修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['SuppliesTemplate:SuppliesTemplate:remove']"
>
删除
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['SuppliesTemplate:SuppliesTemplate:remove']"
>
删除
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-detailUpdate"
@
click=
"detailUpdate(scope.row)"
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-detailUpdate"
@
click=
"detailUpdate(scope.row)"
v-hasPermi=
"['SuppliesTemplate:SuppliesTemplate:detailUpdate']"
:style=
"
{display : scope.row.status===1?'':'none'}"
>修改导入规则
:style=
"
{ display: scope.row.status === 1 ? '' : 'none' }">修改导入规则
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-plus"
@
click=
"handleAddRule(scope.row)"
>
配置导入规则
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-plus"
@
click=
"handleAddRuleCopy(scope.row)"
>
配置数据库存储规则
</el-button>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total>0"
:total=
"total"
:page.sync=
"queryParams.pageNum"
:limit.sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<pagination
v-show=
"total>0"
:total=
"total"
:page.sync=
"queryParams.pageNum"
:limit.sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 添加或修改Excel模板对话框 -->
<el-dialog
:title=
"title"
:visible.sync=
"open"
width=
"500px"
append-to-body
>
...
...
@@ -199,15 +138,8 @@
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-upload
ref=
"uploadRef"
class=
"upload-demo"
drag
action=
""
:before-upload=
"beforeUpload"
:on-change=
"handleChange"
:file-list=
"fileListName"
>
<el-upload
ref=
"uploadRef"
class=
"upload-demo"
drag
action=
""
:before-upload=
"beforeUpload"
:on-change=
"handleChange"
:file-list=
"fileListName"
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
只能上传xlsx文件
</div>
...
...
@@ -227,17 +159,14 @@
<el-dialog
:title=
"title"
:visible.sync=
"optionRole"
width=
"500px"
append-to-body
>
<el-form
ref=
"forms"
:model=
"forms"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"导入规则"
prop=
"roleId"
>
<el-select
v-model=
"selectedOption"
filterable
placeholder=
"请选择关联项"
style=
"width:380px"
@
change=
"handleOptionChange(selectedOption)"
>
<el-option
v-for=
"option in options1"
:key=
"option.roleName"
:label=
"option.roleName"
:value=
"option.id"
></el-option>
<el-select
v-model=
"selectedOption"
filterable
placeholder=
"请选择关联项"
style=
"width:380px"
@
change=
"handleOptionChange(selectedOption)"
>
<el-option
v-for=
"option in options1"
:key=
"option.roleName"
:label=
"option.roleName"
:value=
"option.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"规则名称"
prop=
"roleName"
>
<el-input
v-model=
"forms.roleName"
placeholder=
"请输入规则名称"
maxlength=
"36"
/>
<el-input
v-model=
"forms.roleName"
placeholder=
"请输入规则名称"
maxlength=
"36"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
...
...
@@ -397,39 +326,21 @@ export default {
},
methods
:
{
/* /!**启用 *!/
toggleEnable(SuppliesTemplate) {
console.log('你点击了【' + SuppliesTemplate.s + '】的开关控件,当前开关值:' + SuppliesTemplate.status);
let enableText = ['已发布', '未发布'];
if (SuppliesTemplate.status === 0) {
toggleEnable(SuppliesTemplate.id).then((response) => {
if (response.code === 200) {
let message = '操作成功,已经将【' + SuppliesTemplate.templateName + '】的状态改为【' + enableText[SuppliesTemplate.status] + '】 !';
this.$message({
message: message,
type: 'success'
});
} else {
this.$message.error(response.message);
}
});
} else {
toggleDisable(SuppliesTemplate.id).then((response) => {
if (response.msg === "200") {
let message = '操作成功,已经将【' + SuppliesTemplate.templateName + '】的状态改为【' + enableText[SuppliesTemplate.status] + '】 !';
this.$message({
message: message,
type: 'error'
});
} else {
this.getList();
this.$message.error(response.msg);
}
});
}
},*/
handleAddRule
(
row
)
{
// 假设 row 对象包含一个 id 属性
const
id
=
row
.
id
;
// 使用 Vue Router 进行跳转
this
.
$router
.
push
({
path
:
'
/rules
'
,
query
:
{
id
:
id
}
});
},
handleAddRuleCopy
(
row
)
{
// 假设 row 对象包含一个 id 属性
const
id
=
row
.
id
;
// 使用 Vue Router 进行跳转
this
.
$router
.
push
({
path
:
'
/rulescopy
'
,
query
:
{
id
:
id
}
});
},
/**显示序号*/
indexMethod
(
index
)
{
return
index
+
1
;
...
...
@@ -445,7 +356,6 @@ export default {
/**上传事件 */
async
beforeUpload
(
file
)
{
console
.
log
(
file
)
//存在重复
findName
(
file
.
name
).
then
(
result
=>
{
if
(
result
.
data
===
"
存在重复
"
)
{
...
...
@@ -463,7 +373,6 @@ export default {
}
this
.
uploading
=
true
;
await
LuckyExcel
.
transformExcelToLucky
(
file
,
(
exportJson
,
lucksheetfile
)
=>
{
console
.
log
(
exportJson
,
lucksheetfile
)
this
.
form
.
templateName
=
file
.
name
;
this
.
form
.
templateContent
=
JSON
.
stringify
(
exportJson
.
sheets
);
});
...
...
@@ -471,16 +380,7 @@ export default {
return
isJpgOrPng
;
},
// handleFileChange(event){
// var file = event.target.files[0];
// var fileName = file.name;
// fileName = fileName + "";
// LuckyExcel.transformExcelToLucky(file ,(exportJson,lucksheetfile)=>{
// this.form.templateName = fileName;
// this.form.templateContent = JSON.stringify(exportJson.sheets);
// });
// },
/** 查询Excel模板列表 */
getList
()
{
this
.
indexMethod
(
0
);
...
...
@@ -543,7 +443,6 @@ export default {
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
getSuppliesTemplate
(
id
).
then
(
response
=>
{
console
.
log
(
response
.
rows
[
0
])
this
.
form
=
response
.
rows
[
0
];
this
.
open
=
true
;
this
.
title
=
"
修改Excel模板
"
;
...
...
ruoyi-ui/src/views/system/supplies/index_vue.vue
View file @
88b0dcd5
...
...
@@ -262,7 +262,6 @@ export default {
const
minvalue
=
this
.
miningValue
.
find
(
obj
=>
obj
.
id
===
this
.
mining
)
const
Luckysheetlabel
=
this
.
luckyrule
.
find
(
obj
=>
obj
.
id
===
this
.
selectedRule
);
console
.
log
(
this
.
cleaning
,
this
.
mining
)
if
(
this
.
date
==
''
||
this
.
date
==
null
)
{
this
.
disableNextButton
=
true
;
this
.
$message
.
error
(
'
请选择时间日期!
'
);
...
...
@@ -273,7 +272,6 @@ export default {
this
.
disableNextButton
=
true
;
this
.
$message
.
error
(
'
请选择清洗规则!
'
);
}
else
if
(
!
this
.
selectname
.
includes
(
this
.
mine
))
{
console
.
log
(
'
2222
'
)
this
.
disableNextButton
=
true
;
this
.
$message
.
error
(
'
清洗规则和所属矿区必须一致!
'
);
}
...
...
@@ -1609,7 +1607,6 @@ export default {
},
//成本表往凭证但转
Vouchers
(
duplicateData
)
{
console
.
log
(
duplicateData
)
this
.
detail
=
duplicateData
.
map
(
item
=>
{
if
(
typeof
item
.
v
.
v
===
'
number
'
)
{
item
.
v
.
v
=
Number
(
item
.
v
.
v
.
toFixed
(
2
));
// 如果是数字,则进行处理
...
...
@@ -1650,7 +1647,7 @@ export default {
"
*核算账簿
"
,
"
*单据日期
"
,
"
*凭证类型
"
,
"
*
制单人
"
,
"
制单人
"
,
"
*分录摘要
"
,
"
*币种
"
,
"
本币汇率类型
"
,
...
...
@@ -1783,8 +1780,7 @@ export default {
}
}
}
console
.
log
(
this
.
ImportTables
.
historyRole
)
console
.
log
(
historyContent
)
this
.
ImportTables
.
historyRole
=
JSON
.
stringify
(
historyContent
)
for
(
let
i
=
0
;
i
<
sum
.
length
;
i
++
)
{
for
(
let
j
=
0
;
j
<
filteredArr
.
length
;
j
++
)
{
...
...
ruoyi-ui/src/views/system/supplies/indexupload.vue
View file @
88b0dcd5
...
...
@@ -230,7 +230,6 @@ export default {
data
:
exportJson
.
sheets
,
userInfo
:
exportJson
.
info
.
name
.
creator
})
console
.
log
(
exportJson
.
sheets
,
'
2222222222222
'
)
data1
=
exportJson
.
sheets
[
0
];
name1
=
exportJson
.
sheets
[
0
].
name
;
let
suffixArr
=
exportJson
.
info
.
name
.
split
(
'
.
'
);
...
...
ruoyi-ui/src/views/system/supplies/materialDetailTemplateTable/index.js
View file @
88b0dcd5
export
function
ex
(
luckysheet
)
{
import
{
setXColumn
,
tzcCreateData
,
transformJson
}
from
'
@/utils/tzc
'
import
Decimal
from
'
decimal.js
'
;
import
{
getyy
,
getSuppliesTemplate
}
from
'
@/api/ruoyi-myLuckyexcel/myluckyexcel
'
import
source
from
'
echarts/src/data/Source
'
export
function
ex
(
luckysheetdata
,
roleObj
)
{
let
list
=
[]
for
(
let
index
=
1
;
index
<
luckysheet
.
length
;
index
++
)
{
for
(
let
index
=
1
;
index
<
luckysheet
data
.
length
;
index
++
)
{
let
funct
=
{}
luckysheet
[
index
].
forEach
((
item
,
e
)
=>
{
if
(
item
&&
item
.
v
&&
(
e
==
5
||
e
==
9
||
e
==
10
))
{
let
name
=
luckysheet
[
0
][
e
].
v
;
funct
[
name
]
=
item
.
v
;
luckysheet
data
[
index
].
forEach
((
item
,
e
)
=>
{
if
(
item
&&
item
.
v
&&
(
e
==
5
||
e
==
9
||
e
==
10
))
{
let
name
=
luckysheet
data
[
0
][
e
].
v
;
funct
[
name
]
=
item
.
v
;
}
});
list
.
push
(
funct
);
list
.
push
(
funct
);
}
console
.
log
(
list
)
let
result
=
list
.
reduce
((
acc
,
curr
)
=>
{
let
existing
=
acc
.
find
(
item
=>
item
.
费用来源
===
curr
.
费用来源
&&
item
.
一级材料类别
===
curr
.
一级材料类别
);
if
(
existing
)
{
existing
.
总额
=
new
Decimal
(
existing
.
总额
).
plus
(
curr
.
总额
).
toString
();
}
else
{
acc
.
push
({
...
curr
});
}
return
acc
;
},
[]);
let
newdata
=
luckysheet
.
transToData
(
roleObj
[
0
].
celldata
);
let
headers
=
setXColumn
(
newdata
,
3
)
let
obj
=
{
}
result
.
forEach
(
item
=>
{
if
(
obj
[
item
[
'
费用来源
'
]])
{
obj
[
item
[
'
费用来源
'
]].
push
(
item
)
}
else
{
obj
[
item
[
'
费用来源
'
]]
=
[
item
]
}
})
Object
.
entries
(
obj
).
forEach
(([
source
,
value
],
rowI
)
=>
{
let
row
=
newdata
[
rowI
+
4
]
// item.费用来源 === curr.费用来源 && item.一级材料类别
row
[
0
]
=
{
ct
:
{
fa
:
'
@
'
,
t
:
'
s
'
},
fc
:
"
#000000
"
,
ff
:
"
宋体
"
,
v
:
source
}
value
.
forEach
(
item
=>
{
let
ci
=
headers
[
item
[
'
一级材料类别
'
]]
if
(
ci
>
-
1
)
{
row
[
ci
]
=
{
ct
:
{
fa
:
'
@
'
,
t
:
'
s
'
},
fc
:
"
#000000
"
,
ff
:
"
宋体
"
,
v
:
item
[
'
总额
'
]
}
}
})
})
roleObj
[
0
].
celldata
=
luckysheet
.
transToCellData
(
newdata
)
roleObj
[
0
].
calcChain
=
[];
let
as
=
roleObj
[
0
].
celldata
.
filter
(
(
item
)
=>
item
.
v
.
f
);
as
.
forEach
((
item
)
=>
{
let
sum
=
{
index
:
roleObj
[
0
].
index
,
r
:
item
.
r
,
c
:
item
.
c
,
};
roleObj
[
0
].
calcChain
.
push
(
sum
);
});
luckysheet
.
destroy
();
luckysheet
.
create
({
forceCalculation
:
true
,
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
lang
:
'
zh
'
,
title
:
'
汇总模板
'
,
data
:
roleObj
});
return
true
}
export
async
function
Certificate_method
(
celldatas
,
mining_id
,
date
,
phone
)
{
let
selectedOption
=
[
{
value
:
'
待分析材料分配
'
,
id
:
'
010102
'
,
noIn
:
'
基本生产原煤-火工品
'
},
{
value
:
'
材料分配
'
,
id
:
'
011701
'
,
noIn
:
''
,
},
{
value
:
'
材料分配
'
,
id
:
'
011704
'
,
noIn
:
'
基本生产原煤-木材
'
},
{
value
:
'
本月材料分析
'
,
id
:
'
011702
'
,
noIn
:
''
},
{
value
:
'
转本月材料分配
'
,
id
:
'
010101
'
,
noIn
:
'
基本生产原煤-火工品
'
},
{
value
:
'
转本月材料分配
'
,
id
:
'
011204
'
,
noIn
:
''
},
{
value
:
'
原材料分配
'
,
id
:
'
010105
'
,
noIn
:
'
基本生产原煤-火工品
'
},
{
value
:
'
宏丰
'
,
id
:
'
011502
'
,
noIn
:
''
},
{
value
:
'
云飞
'
,
id
:
'
011504
'
,
noIn
:
''
},
{
value
:
'
中润
'
,
id
:
'
011706
'
,
noIn
:
''
},
]
let
result
=
selectedOption
.
find
(
item
=>
item
.
id
==
mining_id
);
let
merge
=
[]
let
disposition
=
{
endcolumn
:
'
12
'
,
//结束列
startcolumn
:
'
1
'
,
//开始列
endrow
:
'
28
'
,
//结束行
startrow
:
'
4
'
,
//开始行
headcolumn
:
'
0
'
,
//表头列
headrow
:
'
3
'
,
//表头行
}
celldatas
.
forEach
(
item
=>
{
if
(
item
.
v
&&
item
.
v
.
v
)
{
let
funct
=
{
r
:
item
.
r
,
c
:
item
.
c
,
v
:
item
.
v
.
v
}
merge
.
push
(
funct
)
}
}
)
let
head
=
merge
.
filter
(
item
=>
item
.
r
==
disposition
.
headrow
&&
item
.
c
<=
disposition
.
endcolumn
&&
item
.
c
>
disposition
.
headcolumn
);
let
classary
=
merge
.
filter
(
item
=>
item
.
c
==
disposition
.
headcolumn
&&
item
.
r
>
disposition
.
headrow
&&
item
.
r
<
disposition
.
endrow
);
// 筛选数据
let
data
=
merge
.
filter
(
item
=>
item
.
r
>=
disposition
.
startrow
&&
item
.
r
<=
disposition
.
endrow
&&
item
.
c
>=
disposition
.
startcolumn
&&
item
.
c
<=
disposition
.
endcolumn
)
data
.
forEach
(
item
=>
{
classary
.
forEach
(
obj
=>
{
if
(
item
.
r
==
obj
.
r
)
{
item
.
r
=
obj
.
v
}
})
head
.
forEach
(
obj
=>
{
if
(
item
.
c
==
obj
.
c
)
{
item
.
c
=
obj
.
v
}
})
})
const
borrow
=
data
.
map
(
item
=>
{
const
newR
=
item
.
r
.
replace
(
/-/g
,
''
);
const
newKey
=
`
${
newR
}
-
${
item
.
c
}
`
;
return
{
"
name
"
:
newKey
,
"
money
"
:
item
.
v
,
'
mining
'
:
result
.
id
,
'
is_debit
'
:
0
,
'
classary
'
:
result
.
value
};
});
let
funct
=
{
name
:
'
其他应付款_待分析
'
,
money
:
new
Decimal
(
0
),
is_debit
:
1
,
classary
:
result
.
value
,
mining
:
result
.
id
}
let
loan
=
[]
borrow
.
forEach
(
item
=>
{
if
(
item
.
name
!==
result
.
noIn
)
{
funct
.
money
=
funct
.
money
.
plus
(
new
Decimal
(
item
.
money
));
}
else
{
const
newItem
=
{
...
item
};
newItem
.
is_debit
=
1
}
})
loan
.
push
(
funct
)
let
res
=
await
getyy
(
JSON
.
stringify
({
borrow
,
loan
}))
let
template
=
await
getSuppliesTemplate
(
1248
)
console
.
log
(
template
)
let
createData
=
tzcCreateData
(
JSON
.
parse
(
template
.
rows
[
0
].
templateContent
),
transformJson
(
res
.
data
),
luckysheet
,
date
,
phone
);
console
.
log
(
createData
)
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
'
凭证
'
,
// Excel 文件名
allowEdit
:
false
,
//作用:是否允许前台编辑
data
:
createData
,
// Excel 数据
showinfobar
:
false
,
//是否显示顶部名称栏
lang
:
"
zh
"
,
});
}
\ No newline at end of file
ruoyi-ui/src/views/system/supplies/materialDetailTemplateTable/index.vue
View file @
88b0dcd5
...
...
@@ -8,10 +8,15 @@
<el-date-picker
v-model=
"DateColumn"
size=
"large"
style=
"margin-left: 10px"
value-format=
"yyyy-MM"
type=
"month"
placeholder=
"选择月"
></el-date-picker>
</div>
<el-dialog
:visible.sync=
"nds"
title=
"功能演示"
width=
"30%"
>
<video
class=
"vide1"
src=
"/plugins/images/960_1721636387.mp4"
controls
></video>
</el-dialog>
<div
style=
"display: flex"
>
<el-button
size=
"mini"
@
click=
"creathz"
style=
"margin-right: 10px"
>
生成
{{
state
}}
</el-button>
<el-button
size=
"mini"
@
click=
"nds = true"
style=
"margin-right: 10px"
>
功能演示
</el-button>
<el-button
size=
"mini"
@
click=
"creathz"
style=
"margin-right: 10px"
>
生成
{{
state
}}
</el-button>
<el-button
size=
"mini"
style=
"margin-right: 10px"
@
click=
"handleExport"
>
导出
</el-button>
<el-upload
type=
"file"
action=
"#"
:before-upload=
"uploadFile"
:show-file-list=
"false"
>
<el-button
size=
"mini"
:disabled=
"!rule || !DateColumn"
>
导入
</el-button>
...
...
@@ -26,12 +31,59 @@
</
template
>
<
script
>
let
math
=
require
(
'
mathjs
'
);
//网上查询得来
//todo 吕家坨 和 钱家营规则和其他不一样
import
{
setXColumn
}
from
'
@/utils/tzc
'
import
{
setXColumn
,
getDataValue
}
from
'
@/utils/tzc
'
import
{
debounce
}
from
'
@/utils
'
import
{
ex
}
from
'
./index
'
import
{
ex
,
Certificate_method
}
from
'
./index
'
import
{
getSuppliesTemplate
}
from
"
@/api/ruoyi-myLuckyexcel/myluckyexcel
"
;
const
Qjy
=
[
{
a23
:
'
洗煤厂
'
,
km
:
'
国配,综配,化工
'
,
in
:
false
,
'
费用来源
'
:
'
基本生产洗煤
'
,
'
一级材料类别
'
:
'
其他材料
'
,
},
{
a23
:
'
洗煤厂
'
,
km
:
'
国配,综配
'
,
'
费用来源
'
:
'
基本生产洗煤
'
,
'
一级材料类别
'
:
'
配件
'
,
},
{
a23
:
'
洗煤厂
'
,
km
:
'
化工
'
,
'
费用来源
'
:
'
基本生产洗煤
'
,
'
一级材料类别
'
:
'
油脂及乳化液
'
,
},
{
a23
:
'
机关
'
,
'
费用来源
'
:
'
管理费用
'
,
'
一级材料类别
'
:
'
其他材料
'
,
},
{
a23
:
'
煤质科
'
,
a2
:
'
柴油,乙醇汽油
'
,
'
费用来源
'
:
'
其他业务成本运输业务
'
,
'
一级材料类别
'
:
'
其他材料
'
,
},
{
a23
:
'
水暖科
'
,
a2
:
'
醇基锅炉燃料(变性甲醇)
'
,
'
费用来源
'
:
'
基本生产原煤
'
,
'
一级材料类别
'
:
'
燃料
'
,
},
{
a23
:
'
煤质科
'
,
'
费用来源
'
:
'
制造费用原煤
'
,
'
一级材料类别
'
:
'
其他材料
'
,
},
{
a23
:
'
水暖科
'
,
'
费用来源
'
:
'
制造费用原煤
'
,
'
一级材料类别
'
:
'
其他材料
'
,
},
{
km
:
'
坑木
'
,
a24
:
'
支-生产-大型材料,支-生产-一般材料
'
,
...
...
@@ -55,7 +107,7 @@ const Qjy = [
a24
:
'
支-生产-大型材料,支-生产-一般材料
'
,
'
费用来源
'
:
'
基本生产原煤
'
,
'
一级材料类别
'
:
'
专用工具
'
,
},{
},
{
km
:
'
劳保
'
,
a24
:
'
支-生产-大型材料,支-生产-一般材料
'
,
'
费用来源
'
:
'
基本生产原煤
'
,
...
...
@@ -78,71 +130,17 @@ const Qjy = [
a24
:
'
支-生产-大型材料,支-生产-一般材料
'
,
'
费用来源
'
:
'
基本生产原煤
'
,
'
一级材料类别
'
:
'
大型材料
'
,
},
{
a23
:
'
机关
'
,
'
费用来源
'
:
'
管理费用
'
,
'
一级材料类别
'
:
'
其他材料
'
,
},
{
a23
:
'
洗煤厂
'
,
km
:
'
国配,综配,化工
'
,
in
:
false
,
'
费用来源
'
:
'
基本生产-洗煤
'
,
'
一级材料类别
'
:
'
其他材料
'
,
},
{
a23
:
'
洗煤厂
'
,
km
:
'
国配,综配
'
,
'
费用来源
'
:
'
基本生产-洗煤
'
,
'
一级材料类别
'
:
'
配件
'
,
},
{
a23
:
'
洗煤厂
'
,
km
:
'
化工
'
,
'
费用来源
'
:
'
基本生产-洗煤
'
,
'
一级材料类别
'
:
'
油脂及乳化液
'
,
},
{
a23
:
'
煤质科
'
,
a2
:
'
柴油,乙醇汽油
'
,
'
费用来源
'
:
'
其他业务成本-运输业务
'
,
'
一级材料类别
'
:
'
其他材料
'
,
},
{
a23
:
'
水暖科
'
,
a2
:
'
醇基锅炉燃料(变性甲醇)
'
,
'
费用来源
'
:
'
基本生产原煤
'
,
'
一级材料类别
'
:
'
燃料
'
,
},
{
a23
:
'
煤质科
'
,
'
费用来源
'
:
'
制造费用-原煤
'
,
'
一级材料类别
'
:
'
其他材料
'
,
},
{
a23
:
'
水暖科
'
,
'
费用来源
'
:
'
制造费用-原煤
'
,
'
一级材料类别
'
:
'
其他材料
'
,
},
}
]
let
getQjy
=
(
obj
)
=>
{
return
Qjy
.
find
(
item
=>
{
let
ina2
=
item
.
a2
&&
item
.
a2
.
includes
(
obj
.
a2
);
let
ina23
=
item
.
a23
&&
item
.
a23
.
includes
(
obj
.
a23
);
let
inkm
=
item
.
km
&&
item
.
km
.
includes
(
obj
.
km
);
let
ina24
=
item
.
a24
&&
item
.
a24
.
includes
(
obj
.
a24
);
if
(
item
.
a23
&&
item
.
a2
){
return
ina2
&&
ina23
;
}
else
if
(
item
.
a23
&&
item
.
km
&&
item
.
in
===
false
){
return
!
inkm
&&
ina23
}
else
if
(
item
.
a23
&&
item
.
km
){
return
ina23
&&
inkm
}
else
if
(
item
.
a24
&&
item
.
km
){
return
ina24
&&
inkm
}
else
if
(
item
.
a23
){
return
ina23
return
Qjy
.
find
(
item
=>
{
if
(
item
.
in
===
false
)
{
return
item
.
a23
.
includes
(
obj
.
a23
)
&&
!
item
.
km
.
includes
(
obj
.
km
)
}
else
{
let
keys
=
Object
.
keys
(
item
).
filter
(
key
=>
!
[
'
费用来源
'
,
'
一级材料类别
'
].
includes
(
key
))
return
keys
.
every
(
key
=>
{
return
item
[
key
].
includes
(
obj
[
key
]);
})
}
})
}
...
...
@@ -194,7 +192,8 @@ let selectedOption = [
}
]
import
{
asiccData
,
asmInfoSave
,
asiccData
,
asmInfoSave
,
department
,
listSuppliesTemplateId
,
roleList
,
...
...
@@ -206,117 +205,133 @@ export default {
name
:
'
index
'
,
data
()
{
return
{
state
:
'
初始
'
,
DateColumn
:
''
,
nds
:
false
,
state
:
'
汇总
'
,
DateColumn
:
''
,
loading
:
false
,
listId
:
1283
,
rules
:[],
rule
:
''
,
roleObj
:{},
listId
:
1283
,
rules
:
[],
rule
:
''
,
roleObj
:
{},
// 根据部门确定来源
classification
:{},
classification
:
{},
// 当前选的规则
excelid
:
null
,
codeduiyi
:[],
transformJson
:[],
excelid
:
null
,
codeduiyi
:
[],
transformJson
:
[],
cltemplate
:
null
,
showMask
:
true
,
}
},
methods
:
{
creathz
(){
this
.
state
=
'
凭证
'
ex
(
luckysheet
.
getAllSheets
()[
0
].
data
)
},
getCodeRule
:
function
(
codes
,
guze
)
{
let
vm
=
this
;
let
obj
=
{
}
let
newgets
=
(
str
)
=>
{
let
code
=
String
(
str
)
if
([
'
011502
'
,
'
011504
'
].
includes
(
this
.
excelid
.
id
)
&&
code
.
startsWith
(
'
6601
'
)){
return
[
'
办公费用
'
,
''
]
}
for
(
let
item
of
guze
){
let
[
minCode
,
maxCode
]
=
item
;
if
(
minCode
===
maxCode
){
if
(
code
.
startsWith
(
minCode
)){
return
[
item
.
oneLevel
,
item
.
twoLevel
]
}
}
else
{
let
miml
=
String
(
minCode
).
length
let
maxl
=
String
(
maxCode
).
length
let
cumin
=
code
.
slice
(
0
,
miml
)
let
cumax
=
code
.
slice
(
0
,
maxl
)
if
(
minCode
>=
cumin
&&
cumax
<=
maxCode
){
if
(
minCode
[
0
]
===
'
0
'
||
maxCode
[
0
]
===
'
0
'
){
if
(
code
[
0
]
===
'
0
'
){
return
[
item
.
oneLevel
,
item
.
twoLevel
]
}
}
else
{
return
[
item
.
oneLevel
,
item
.
twoLevel
]
}
}
creathz
()
{
if
(
this
.
state
==
'
汇总
'
)
{
getSuppliesTemplate
(
'
1286
'
).
then
(
res
=>
{
let
luckysheetData
=
JSON
.
parse
(
res
.
rows
[
0
].
templateContent
);
let
ruls
=
ex
(
luckysheet
.
getAllSheets
()[
0
].
data
,
luckysheetData
)
if
(
ruls
)
{
this
.
state
=
'
凭证
'
}
}
})
}
else
{
}
if
(
this
.
state
==
'
凭证
'
)
{
this
.
$prompt
(
"
请输入用友系统的用户名
"
,
"
提示
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
inputPattern
:
/^
(?:\+?
86
)?
1
[
3-9
]\d{9}
$/
,
inputErrorMessage
:
"
手机号格式不正确
"
,
})
.
then
(({
value
})
=>
{
this
.
$message
({
type
:
"
success
"
,
message
:
"
你的用户名是:
"
+
value
,
});
Certificate_method
(
luckysheet
.
getAllSheets
()[
0
].
celldata
,
this
.
excelid
.
id
,
value
,
this
.
DateColumn
)
})
.
catch
(()
=>
{
this
.
$message
({
type
:
"
info
"
,
message
:
"
取消输入
"
,
});
this
.
showMask
=
false
;
});
}
codes
.
forEach
(
code
=>
{
if
(
!
obj
[
code
]){
let
va
=
newgets
(
code
);
obj
[
code
]
=
va
||
[
''
,
''
]
}
})
return
obj
;
},
handleExport
:
debounce
(
function
()
{
// handleExport
exportExcel
(
luckysheet
.
getAllSheets
(),
'
asd
'
);
},
500
),
getqushuguze
(
data
){
getqushuguze
(
data
)
{
let
vm
=
this
;
let
qushuguze
=
[]
if
(
vm
.
rule
*
1
===
85
)
{
for
(
let
i
=
vm
.
roleObj
.
NumberColumn
-
1
;
i
<
data
[
0
].
length
;
i
=
i
+
5
)
{
if
(
vm
.
rule
*
1
===
85
)
{
for
(
let
i
=
vm
.
roleObj
.
NumberColumn
-
1
;
i
<
data
[
0
].
length
;
i
=
i
+
5
)
{
let
zhi
=
data
&&
data
[
0
]
&&
data
[
0
][
i
]
&&
data
[
0
][
i
].
v
if
(
zhi
)
{
if
(
zhi
)
{
qushuguze
.
push
({
...
vm
.
roleObj
,
sourceColoumn
:
zhi
&&
zhi
.
replace
&&
zhi
.
replace
(
'
--
'
,
"
-
"
)
||
zhi
,
NumberColumn
:
i
+
1
,
MoneyColumn
:
i
+
2
,
money
:
i
+
3
,
sourceColoumn
:
zhi
&&
zhi
.
replace
&&
zhi
.
replace
(
'
--
'
,
"
-
"
)
||
zhi
,
NumberColumn
:
i
+
1
,
MoneyColumn
:
i
+
2
,
money
:
i
+
3
,
})
}
else
{
}
else
{
break
;
}
}
}
else
{
}
else
{
qushuguze
=
[
this
.
roleObj
]
}
return
qushuguze
},
handleChange
(
e
){
handleChange
(
e
)
{
let
vm
=
this
;
if
(
e
)
{
if
(
e
)
{
roleListid
(
this
.
rule
).
then
(
res
=>
{
this
.
roleObj
=
JSON
.
parse
(
res
.
rows
[
0
].
detailContent
)[
0
]
})
let
excelid
=
selectedOption
.
find
(
item
=>
item
.
roleId
===
e
)
if
(
excelid
)
{
if
(
excelid
)
{
this
.
excelid
=
excelid
this
.
classification
=
{}
department
(
excelid
.
id
).
then
(
res
=>
{
if
(
Array
.
isArray
(
res
))
{
this
.
classification
=
Object
.
fromEntries
(
res
.
map
(
item
=>
[
item
.
name
,
item
.
nameType
]))
this
.
classification
=
Object
.
fromEntries
(
res
.
map
(
item
=>
{
let
str
=
item
&&
item
.
nameType
||
''
;
if
(
str
&&
str
.
endsWith
(
'
-
'
))
{
str
=
str
.
substring
(
0
,
str
.
length
-
1
)
}
return
[
item
.
name
,
str
]
}))
}
});
}
}
},
// 更改obj的来源
getsourceColoumn
(
obj
,
row
){
getsourceColoumn
(
obj
,
row
)
{
// 范各庄
if
(
this
.
excelid
&&
this
.
excelid
.
id
===
'
011701
'
)
{
if
([
'
基本生产-洗煤
'
,
'
基本生产洗煤
'
].
includes
(
obj
.
sourceColoumn
)
&&
[
'
64
'
,
'
65
'
].
includes
(
String
(
obj
.
CodeColumn
).
slice
(
0
,
2
)))
{
obj
.
sourceColoumn
=
'
制造费用-洗煤
'
}
}
// 东欢坨
if
(
this
.
excelid
&&
this
.
excelid
.
id
===
'
010102
'
)
{
obj
.
sourceColoumn
=
this
.
classification
[
obj
.
DepartmentColumn
]
if
(
obj
.
spare
&&
obj
.
spare
.
includes
(
'
研发
'
))
{
obj
.
sourceColoumn
=
'
研发费用
'
}
else
if
(
obj
.
spare
&&
obj
.
spare
.
includes
(
'
安全费用
'
))
{
obj
.
sourceColoumn
=
'
安全费用
'
}
if
(
obj
.
oneLevel
&&
[
'
大型材料
'
,
'
木材
'
,
'
支护用品
'
].
includes
(
obj
.
oneLevel
)
&&
obj
.
sourceColoumn
===
'
制造费用-原煤
'
)
{
obj
.
sourceColoumn
=
'
基本生产-原煤
'
}
}
// 唐山矿
if
(
this
.
excelid
&&
this
.
excelid
.
id
===
'
010101
'
)
{
if
(
this
.
excelid
&&
this
.
excelid
.
id
===
'
010101
'
)
{
const
enumS
=
{
'
基本生产
'
:
'
基本生产-原煤
'
,
'
制造费用
'
:
'
制造费用-原煤
'
,
...
...
@@ -326,149 +341,172 @@ export default {
enumS
[
obj
.
sourceColoumn
]
&&
(
obj
.
sourceColoumn
=
enumS
[
obj
.
sourceColoumn
])
}
// 林西矿
if
(
this
.
excelid
&&
this
.
excelid
.
id
===
'
011704
'
)
{
if
(
this
.
excelid
&&
this
.
excelid
.
id
===
'
011704
'
)
{
// 林西矿
// 类别名称 === ‘研发费用’ && 来源 = ‘研发费用’
// 类别名称 === ‘安全费用’ && 来源 = ‘安全费用’
// 其他的根据部门规则
let
lbName
=
row
&&
row
[
3
]
&&
row
[
3
].
v
if
(
lbName
===
'
研发费用
'
){
obj
.
sourceColoumn
=
'
研发费用
'
}
else
if
(
lbName
===
'
安全费用
'
){
obj
.
sourceColoumn
=
'
安全费用
'
}
else
{
let
lbName
=
getDataValue
(
row
&&
row
[
3
])
if
([
'
研发费用
'
,
'
安全费用
'
,
'
基金
'
].
includes
(
lbName
))
{
obj
.
sourceColoumn
=
lbName
}
else
{
obj
.
sourceColoumn
=
this
.
classification
[
obj
.
DepartmentColumn
]
}
}
// 单侯
if
(
this
.
excelid
&&
this
.
excelid
.
id
===
'
011204
'
)
{
if
(
this
.
excelid
&&
this
.
excelid
.
id
===
'
011204
'
)
{
// 费用来源是生产成本按照部门划分
// 反之直接取费用来源列
if
(
obj
.
sourceColoumn
===
'
生产成本
'
)
{
if
(
obj
.
sourceColoumn
===
'
生产成本
'
)
{
obj
.
sourceColoumn
=
this
.
classification
[
obj
.
DepartmentColumn
]
}
}
//宏丰\云飞
// 费用来源 === 成本费用的取部门
// 反之直接取费用来源列
if
(
this
.
excelid
&&
[
'
011502
'
,
'
011504
'
].
includes
(
this
.
excelid
.
id
))
{
if
(
obj
.
sourceColoumn
===
'
成本费用
'
)
{
if
(
this
.
excelid
&&
[
'
011502
'
,
'
011504
'
].
includes
(
this
.
excelid
.
id
))
{
if
(
obj
.
sourceColoumn
===
'
成本费用
'
)
{
obj
.
sourceColoumn
=
this
.
classification
[
obj
.
DepartmentColumn
]
}
}
},
chuli
(
transformJson
,
olddata
,
obj
)
{
olddata
[
transformJson
.
length
]
=
[];
let
arr
=
[
{
c
:
0
,
label
:
'
物料名称
'
,
value
:
'
NameColumn
'
},
{
c
:
1
,
label
:
'
材料编码
'
,
value
:
'
CodeColumn
'
},
{
c
:
2
,
label
:
'
部门
'
,
value
:
'
DepartmentColumn
'
},
{
c
:
3
,
label
:
'
数量
'
,
value
:
'
NumberColumn
'
},
{
c
:
4
,
label
:
'
单价
'
,
value
:
'
MoneyColumn
'
},
{
c
:
5
,
label
:
'
总额
'
,
value
:
'
money
'
},
{
c
:
6
,
label
:
'
计量单位
'
,
value
:
'
unit
'
},
{
c
:
7
,
label
:
'
型号
'
,
value
:
'
model
'
},
{
c
:
8
,
label
:
'
所属矿
'
,
value
:
'
mineName
'
},
{
c
:
9
,
label
:
'
费用来源
'
,
value
:
'
sourceColoumn
'
},
{
c
:
10
,
label
:
'
一级材料类别
'
,
value
:
'
oneLevel
'
},
{
c
:
11
,
label
:
'
二级材料类别
'
,
value
:
'
twoLevel
'
},
{
c
:
12
,
label
:
'
日期
'
,
value
:
'
DateColumn
'
},
]
chuli
(
transformJson
,
olddata
,
obj
)
{
olddata
[
transformJson
.
length
]
=
[];
let
arr
=
[
{
c
:
0
,
label
:
'
物料名称
'
,
value
:
'
NameColumn
'
},
{
c
:
1
,
label
:
'
材料编码
'
,
value
:
'
CodeColumn
'
},
{
c
:
2
,
label
:
'
部门
'
,
value
:
'
DepartmentColumn
'
},
{
c
:
3
,
label
:
'
数量
'
,
value
:
'
NumberColumn
'
},
{
c
:
4
,
label
:
'
单价
'
,
value
:
'
MoneyColumn
'
},
{
c
:
5
,
label
:
'
总额
'
,
value
:
'
money
'
},
{
c
:
6
,
label
:
'
计量单位
'
,
value
:
'
unit
'
},
{
c
:
7
,
label
:
'
型号
'
,
value
:
'
model
'
},
{
c
:
8
,
label
:
'
所属矿
'
,
value
:
'
mineName
'
},
{
c
:
9
,
label
:
'
费用来源
'
,
value
:
'
sourceColoumn
'
},
{
c
:
10
,
label
:
'
一级材料类别
'
,
value
:
'
oneLevel
'
},
{
c
:
11
,
label
:
'
二级材料类别
'
,
value
:
'
twoLevel
'
},
{
c
:
12
,
label
:
'
日期
'
,
value
:
'
DateColumn
'
},
]
arr
.
forEach
((
item
)
=>
{
if
(
obj
[
item
.
value
])
{
olddata
[
transformJson
.
length
][
item
.
c
]
=
{
ct
:
{
fa
:
'
@
'
,
t
:
'
s
'
},
fc
:
"
#000000
"
,
ff
:
"
宋体
"
,
v
:
obj
[
item
.
value
]
}
}
});
arr
.
forEach
((
item
)
=>
{
if
(
obj
[
item
.
value
])
{
olddata
[
transformJson
.
length
][
item
.
c
]
=
{
ct
:
{
fa
:
'
@
'
,
t
:
'
s
'
},
fc
:
"
#000000
"
,
ff
:
"
宋体
"
,
v
:
obj
[
item
.
value
]
}
}
});
},
// 导入
uploadFile
(
file
)
{
let
vm
=
this
;
vm
.
loading
=
true
;
LuckyExcel
.
transformExcelToLucky
(
file
,
async
function
(
exportJson
)
{
let
celldata
=
exportJson
&&
exportJson
.
sheets
&&
exportJson
.
sheets
[
0
]
&&
exportJson
.
sheets
[
0
].
celldata
;
if
(
celldata
){
if
(
celldata
)
{
let
data
=
luckysheet
.
transToData
(
celldata
);
console
.
log
(
data
)
let
transformJson
=
[];
let
updataSheetdata
=
luckysheet
.
getAllSheets
();
let
olddata
=
updataSheetdata
[
0
].
data
;
let
updataSheetdata
=
JSON
.
parse
(
vm
.
cltemplate
)
let
olddata
=
luckysheet
.
transToData
(
updataSheetdata
[
0
].
celldata
)
;
let
codeObj
=
{};
// 钱家营的单独设置,来源和一级分类,没有二级分类
if
(
vm
.
excelid
.
id
!==
'
010105
'
){
let
codeIndex
=
vm
.
roleObj
&&
vm
.
roleObj
.
CodeColumn
&&
(
vm
.
roleObj
.
CodeColumn
-
1
)
// 唐山矿直接取excel表里的
if
(
!
[
'
010101
'
,
'
010105
'
].
includes
(
vm
.
excelid
.
id
))
{
let
codeIndex
=
vm
.
roleObj
&&
vm
.
roleObj
.
CodeColumn
&&
(
vm
.
roleObj
.
CodeColumn
-
1
)
let
codes
=
[]
if
(
codeIndex
>
-
1
)
{
codes
=
data
.
slice
(
vm
.
roleObj
.
HeaderRow
-
1
).
map
(
row
=>
{
let
codev
=
row
&&
row
[
codeIndex
]
&&
(
row
[
codeIndex
].
v
+
''
)
return
codev
||
''
;
if
(
codeIndex
>
-
1
)
{
codes
=
data
.
slice
(
vm
.
roleObj
.
HeaderRow
-
1
).
map
(
row
=>
{
let
codev
=
row
&&
row
[
codeIndex
]
&&
(
row
[
codeIndex
].
v
+
''
)
return
codev
||
''
;
}).
filter
(
item
=>
item
);
}
// codeObj = vm.getCodeRule(codes)
codes
=
Array
.
from
(
new
Set
(
codes
))
if
(
codes
.
length
){
if
(
codes
.
length
)
{
let
rescodeObj
=
await
asiccData
({
codes
:
Array
.
from
(
new
Set
(
codes
)),
mineId
:
vm
.
excelid
.
id
codes
:
Array
.
from
(
new
Set
(
codes
)),
mineId
:
vm
.
excelid
.
id
})
if
(
rescodeObj
.
code
===
200
)
{
if
(
rescodeObj
.
code
===
200
)
{
codeObj
=
rescodeObj
.
data
}
else
{
}
else
{
vm
.
loading
=
false
;
}
}
}
// 钱家营
let
headers
=
setXColumn
(
data
)
data
.
slice
(
vm
.
roleObj
.
HeaderRow
-
1
).
map
((
row
,
rowIndex
)
=>
{
data
.
slice
(
vm
.
roleObj
.
HeaderRow
-
1
).
map
((
row
,
rowIndex
)
=>
{
vm
.
getqushuguze
(
data
).
forEach
(
item
=>
{
let
obj
=
{}
// 通用规则设置obj
obj
.
mineName
=
vm
.
excelid
.
name
;
obj
.
mineId
=
vm
.
excelid
.
id
;
Object
.
entries
(
item
).
forEach
(([
key
,
v
])
=>
{
if
(
vm
.
excelid
.
id
===
'
011702
'
&&
key
===
'
sourceColoumn
'
)
{
Object
.
entries
(
item
).
forEach
(([
key
,
v
])
=>
{
if
(
vm
.
excelid
.
id
===
'
011702
'
&&
key
===
'
sourceColoumn
'
)
{
obj
[
key
]
=
v
}
else
if
(
v
&&
row
[
v
-
1
]
&&
row
[
v
-
1
].
v
&&
key
!==
'
HeaderRow
'
)
{
obj
[
key
]
=
row
[
v
-
1
].
v
}
else
if
(
v
&&
row
[
v
-
1
]
&&
getDataValue
(
row
[
v
-
1
])
&&
key
!==
'
HeaderRow
'
)
{
obj
[
key
]
=
getDataValue
(
row
[
v
-
1
])
}
})
if
(
vm
.
excelid
.
name
===
'
单侯
'
&&
obj
.
DepartmentColumn
&&
obj
.
DepartmentColumn
.
includes
(
'
物管科
'
))
{
obj
.
DepartmentColumn
=
'
物管科
'
;
}
obj
.
DateColumn
=
vm
.
DateColumn
;
// 设置obj.sourceColoumn来源
vm
.
getsourceColoumn
(
obj
,
row
)
// todo 设置一二级分类
// 钱家营单独修改来源和一级分类
if
(
vm
.
excelid
.
name
===
'
钱家营
'
){
let
etQ
=
getQjy
({
if
(
vm
.
excelid
.
name
===
'
钱家营
'
)
{
// { c: 3, label: '数量', value: 'NumberColumn' },
// { c: 4, label: '单价', value: 'MoneyColumn' },
// { c: 5, label: '总额', value: 'money' },
obj
.
money
=
math
.
format
(
math
.
multiply
(
math
.
bignumber
(
obj
.
NumberColumn
),
math
.
bignumber
(
obj
.
MoneyColumn
)))
let
sss
=
{
a23
:
row
[
headers
.
a23
].
v
,
a2
:
row
[
headers
.
a2
].
v
,
km
:
row
[
headers
.
km
].
v
,
a24
:
row
[
headers
.
a24
].
v
,
})
}
let
etQ
=
getQjy
(
sss
)
obj
.
oneLevel
=
etQ
&&
etQ
[
'
一级材料类别
'
]
||
'
其他材料
'
;
obj
.
sourceColoumn
=
etQ
&&
etQ
[
'
费用来源
'
]
||
'
基本生产原煤
'
;
}
else
if
(
codeObj
&&
codeObj
[
obj
.
CodeColumn
])
{
else
if
(
vm
.
excelid
.
name
===
'
唐山矿
'
)
{
obj
.
oneLevel
=
obj
.
spare
||
'
其他材料
'
;
if
(
obj
.
spare
===
'
坑木
'
)
{
obj
.
oneLevel
=
'
木材
'
}
}
else
if
(
codeObj
&&
codeObj
[
obj
.
CodeColumn
]
&&
obj
.
sourceColoumn
)
{
let
codess
=
codeObj
[
obj
.
CodeColumn
];
obj
.
oneLevel
=
(
codess
[
'
一级分类
'
]
&&
codess
[
'
一级分类
'
]
!==
'
null
'
)
?
codess
[
'
一级分类
'
]
:
''
obj
.
twoLevel
=
(
codess
[
'
二级分类
'
]
&&
codess
[
'
二级分类
'
]
!==
'
null
'
)
?
codess
[
'
二级分类
'
]
:
''
let
sourceColoumn
=
obj
.
sourceColoumn
.
replaceAll
(
'
-
'
,
''
)
let
levelObj
=
codess
[
sourceColoumn
]
||
codess
[
'
其他费用来源
'
];
if
(
levelObj
)
{
obj
.
oneLevel
=
(
levelObj
[
'
一级分类
'
]
&&
levelObj
[
'
一级分类
'
]
!==
'
null
'
)
?
levelObj
[
'
一级分类
'
]
:
''
obj
.
twoLevel
=
(
levelObj
[
'
二级分类
'
]
&&
levelObj
[
'
二级分类
'
]
!==
'
null
'
)
?
levelObj
[
'
二级分类
'
]
:
''
}
}
// 东欢坨特殊 .会根据返回的一级类别再改来源
if
(
vm
.
excelid
.
name
===
'
东欢坨
'
)
{
vm
.
getsourceColoumn
(
obj
,
row
)
}
// 设置obj.sourceColoumn来源
vm
.
getsourceColoumn
(
obj
,
row
)
// 生成 transformJson、olddata
if
(
obj
&&
obj
.
CodeColumn
&&
Math
.
abs
(
obj
.
money
)
>
0
)
{
if
(
obj
&&
obj
.
CodeColumn
&&
Math
.
abs
(
obj
.
money
)
>
0
)
{
transformJson
.
push
(
obj
)
vm
.
chuli
(
transformJson
,
olddata
,
obj
)
vm
.
chuli
(
transformJson
,
olddata
,
obj
)
}
})
})
vm
.
loading
=
false
;
updataSheetdata
[
0
].
celldata
=
luckysheet
.
transToCellData
(
olddata
);
luckysheet
.
destroy
();
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
lang
:
'
zh
'
,
title
:
'
材料明细模版表
'
,
title
:
'
材料明细模版表
'
,
data
:
updataSheetdata
});
this
.
transformJson
=
transformJson
;
asmInfoSave
({
materials
:
transformJson
})
vm
.
transformJson
=
transformJson
;
asmInfoSave
({
materials
:
transformJson
})
}
});
},
...
...
@@ -476,10 +514,11 @@ export default {
mounted
()
{
listSuppliesTemplateId
(
this
.
listId
).
then
(
res
=>
{
luckysheet
.
destroy
();
this
.
cltemplate
=
res
.
rows
[
0
].
templateContent
;
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
lang
:
'
zh
'
,
title
:
'
材料明细模版表
'
,
title
:
'
材料明细模版表
'
,
data
:
JSON
.
parse
(
res
.
rows
[
0
].
templateContent
)
});
})
...
...
@@ -501,6 +540,8 @@ export default {
display
:
flex
;
flex-direction
:
column
;
}
.vide1
{
width
:
100%
;
height
:
100%
;
}
</
style
>
ruoyi-ui/src/views/system/supplies/salarySummary/index.vue
View file @
88b0dcd5
...
...
@@ -482,7 +482,6 @@ export default {
}
});
})
console
.
log
(
newData
)
let
self
=
this
;
let
luckyData
=
luckysheet
.
getAllSheets
();
let
data
=
luckyData
[
0
].
data
...
...
@@ -596,7 +595,7 @@ export default {
// 第三步 生成凭证
let
template
=
await
getSuppliesTemplate
(
1248
)
let
createData
=
tzcCreateData
(
JSON
.
parse
(
template
.
rows
[
0
].
templateContent
)
[
0
]
,
JSON
.
parse
(
template
.
rows
[
0
].
templateContent
),
transformJson
(
res
.
data
),
luckysheet
,
13112312312
,
...
...
@@ -636,7 +635,7 @@ export default {
// 第三步 生成凭证
let
template
=
await
getSuppliesTemplate
(
1248
)
let
createData
=
tzcCreateData
(
JSON
.
parse
(
template
.
rows
[
0
].
templateContent
)
[
0
]
,
JSON
.
parse
(
template
.
rows
[
0
].
templateContent
),
transformJson
(
res
.
data
),
luckysheet
,
13112312312
,
...
...
@@ -661,8 +660,6 @@ export default {
item
.
fj
=
/^
\d
/
.
test
(
newdata
[
i
-
1
].
name
)
?
newdata
[
i
-
1
].
name
:
newdata
[
i
-
1
].
fj
}
})
console
.
log
(
newdata
)
console
.
log
(
data
)
},
jxdfxt
()
{
let
data
=
luckysheet
.
getAllSheets
().
find
(
item
=>
{
...
...
@@ -752,8 +749,7 @@ export default {
return
[
transformedJSON
[
key
],
value
];
}))
})
console
.
log
(
transformedJSON
)
console
.
log
(
transformed
)
}
},
mounted
()
{
...
...
ruoyi-ui/src/views/system/supplies/salarySummaryintermediateTabl/index.vue
View file @
88b0dcd5
<!--todo
中间
工资汇总-->
<!--todo 工资汇总-->
<
template
>
<div
class=
"app-container"
:class=
"
{
'app-container1':views.luckysheet}"
v-loading="views.loading">
<div
class=
"app-container"
:class=
"
{
'app-container1': views.luckysheet }"
v-loading="views.loading">
<template
v-if=
"!views.luckysheet"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
label-width=
"68px"
@
submit
.
native
.
prevent
>
<el-form-item
label=
"年月"
prop=
"wageMonth"
>
<el-date-picker
v-model=
"queryParams.wageMonth"
size=
"mini"
value-format=
"yyyy-MM"
type=
"month"
placeholder=
"选择月"
></el-date-picker>
<el-date-picker
v-model=
"queryParams.wageMonth"
size=
"mini"
value-format=
"yyyy-MM"
type=
"month"
placeholder=
"选择月"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
...
...
@@ -14,46 +13,44 @@
</el-form-item>
</el-form>
<el-table
:data=
"historydataList"
v-loading=
"views.loading"
>
<el-table-column
label=
"id"
prop=
"id"
width=
"200"
/>
<el-table-column
label=
"创建时间"
prop=
"createTime"
/>
<el-table-column
label=
"操作时间"
prop=
"updateTime"
/>
<el-table-column
label=
"年月"
prop=
"yearMonth"
/>
<el-table-column
label=
"id"
prop=
"id"
width=
"200"
/>
<el-table-column
label=
"创建时间"
prop=
"createTime"
/>
<el-table-column
label=
"所属矿"
prop=
"mineId"
/>
<el-table-column
label=
"操作时间"
prop=
"updateTime"
/>
<el-table-column
label=
"年月"
prop=
"yearMonth"
/>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
width=
"200px"
>
<template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleDetails(scope.row,'look')"
>
查看
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleDetails(scope.row,
'look')"
>
查看
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleDetails(scope.row,'edit')"
>
修改
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleDetails(scope.row,
'edit')"
>
修改
</el-button>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"queryParams.total > 0"
:total=
"queryParams.total"
:page.sync=
"queryParams.pageNum"
:limit.sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<pagination
v-show=
"queryParams.total > 0"
:total=
"queryParams.total"
:page.sync=
"queryParams.pageNum"
:limit.sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
</template>
<
template
v-else
>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"24"
style=
"display: flex;justify-content: end;"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleReturnButtonClick"
>
返回
</el-button>
<el-button
type=
"primary"
size=
"mini"
style=
"margin-right: 10px"
@
click=
"handleReturnButtonClick"
>
返回
</el-button>
<el-button
type=
"primary"
size=
"mini"
style=
"margin-left: 0"
v-if=
"views.type === 'edit'"
@
click=
"handleExport1"
>
导出空模版
</el-button>
<el-button
onclick=
"document.getElementById('uploadsfz227f').click()"
style=
"margin: 0 10px"
type=
"primary"
size=
"mini"
v-if=
"views.type === 'edit'"
>
修改
</el-button>
<input
accept=
".xlsx"
@
change=
"upshaungc"
type=
"file"
id=
"uploadsfz227f"
style=
"display: none"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleExport"
>
导出
</el-button>
<el-button
type=
"primary"
:disabled=
"views.saveLoading"
:loading=
"views.saveLoading"
v-if=
"views.type === 'edit'"
size=
"mini"
@
click=
"save"
>
保存
<el-button
type=
"primary"
:disabled=
"views.saveLoading"
:loading=
"views.saveLoading"
v-if=
"views.type === 'edit'"
size=
"mini"
@
click=
"save"
>
保存
</el-button>
<el-button
type=
"primary"
size=
"mini"
v-if=
"views.type === 'look'"
@
click=
"btnGenerateCertificate"
>
生凭证
<el-button
type=
"primary"
size=
"mini"
v-if=
"views.type === 'look'"
@
click=
"btnGenerateCertificate"
>
生凭证
</el-button>
</el-col>
</el-row>
<div
id=
"luckysheet"
></div>
<div
id=
"luckysheet"
></div>
</
template
>
</div>
</template>
...
...
@@ -74,19 +71,20 @@
import
{
exportExcel
}
from
"
/public/exportExcel
"
import
{
debounce
}
from
'
@/utils
'
import
{
conversionGetWagesData
,
conversionUpdate
,
getWagesDataById
}
from
"
@/api/conversion
"
import
{
transformJson
,
tzcCreateData
,
newGettransformJson
}
from
"
@/utils/tzc
"
import
{
transformJson
,
tzcCreateData
,
newGettransformJson
,
collect
}
from
"
@/utils/tzc
"
import
{
getSuppliesTemplate
}
from
"
@/api/ruoyi-myLuckyexcel/myluckyexcel
"
import
LuckyExcel
from
'
luckyexcel
'
export
default
{
name
:
"
Historydata
"
,
data
()
{
data
()
{
return
{
// 查询参数
queryParams
:
{
total
:
0
,
pageNum
:
1
,
pageSize
:
10
,
wageMonth
:
null
,
wageMonth
:
null
,
},
views
:
{
//编辑还是查看 look 查看
...
...
@@ -102,13 +100,81 @@ export default {
// 点击查看详情当前行的数据
currentRow
:
{},
// 当前行的详情
jsonData
:{}
jsonData
:
{},
selectedOption
:
[
{
name
:
'
东欢坨矿
'
,
id
:
'
010102
'
},
{
name
:
'
范各庄
'
,
id
:
'
011701
'
},
{
name
:
'
林西矿
'
,
id
:
'
011704
'
},
{
name
:
'
吕矿
'
,
id
:
'
011702
'
},
{
name
:
'
唐山矿
'
,
id
:
'
010101
'
},
{
name
:
'
单侯煤矿
'
,
id
:
'
011204
'
},
{
name
:
'
钱家营矿
'
,
id
:
'
010105
'
},
{
name
:
'
宏丰
'
,
id
:
'
011502
'
},
{
name
:
'
云飞
'
,
id
:
'
011504
'
},
{
name
:
'
中润
'
,
id
:
'
011706
'
},
],
}
},
mounted
()
{
mounted
()
{
this
.
getList
()
},
methods
:
{
upshaungc
(
e
)
{
let
vm
=
this
;
let
file
=
e
.
srcElement
.
files
[
0
]
LuckyExcel
.
transformExcelToLucky
(
file
,
(
lucksheetfile
)
=>
{
let
getAll
=
luckysheet
.
getAllSheets
()
let
celldata
=
getAll
[
0
].
celldata
;
lucksheetfile
.
sheets
[
0
].
celldata
.
forEach
((
el
,
i
)
=>
{
let
old
=
celldata
[
i
]
if
(
el
.
v
.
v
>
0
&&
+
el
.
v
.
v
!==
+
old
.
v
.
v
)
{
old
.
v
.
bg
=
"
#e85f5f
"
old
.
v
.
v
=
el
.
v
.
v
}
})
vm
.
jsonData
=
JSON
.
stringify
(
getAll
)
luckysheet
.
destroy
({})
luckysheet
.
create
({
forceCalculation
:
true
,
showinfobar
:
false
,
//是否显示顶部信息栏
lang
:
"
zh
"
,
//语言
container
:
"
luckysheet
"
,
// 设定DOM容器的id
title
:
vm
.
currentRow
.
historyName
,
// 设定表格名称
data
:
getAll
,
})
});
},
btnGenerateCertificate
()
{
this
.
$prompt
(
"
请输入用友系统的用户名
"
,
"
提示
"
,
{
confirmButtonText
:
"
确定
"
,
...
...
@@ -121,30 +187,32 @@ export default {
})
},
// 调取生成凭证接口
async
voucherForms
(
value
){
this
.
views
.
type
=
'
PZ
'
this
.
views
.
loading
=
true
;
// 获取模版
let
template
=
await
getSuppliesTemplate
(
1248
)
let
optionsData
=
JSON
.
parse
(
template
.
rows
[
0
].
templateContent
);
// 获取数据
let
objks
=
await
newGettransformJson
(
luckysheet
.
getAllSheets
())
this
.
views
.
loading
=
false
;
//value 手机号
//this.currentRow.yearMonth 年月
// 构建新的数据 luckysheet.create.data数据
let
createData
=
tzcCreateData
(
optionsData
[
0
],
transformJson
(
objks
.
data
),
luckysheet
,
value
,
this
.
currentRow
.
yearMonth
)
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
'
凭证
'
,
// Excel 文件名
allowEdit
:
false
,
//作用:是否允许前台编辑
data
:
createData
,
// Excel 数据
showinfobar
:
false
,
//是否显示顶部名称栏
lang
:
"
zh
"
,
})
async
voucherForms
(
value
)
{
this
.
views
.
type
=
'
PZ
'
this
.
views
.
loading
=
true
;
// 获取模版
let
template
=
await
getSuppliesTemplate
(
1248
)
let
optionsData
=
JSON
.
parse
(
template
.
rows
[
0
].
templateContent
);
// 获取数据
let
objks
=
await
newGettransformJson
(
luckysheet
.
getAllSheets
())
this
.
views
.
loading
=
false
;
//value 手机号
//this.currentRow.yearMonth 年月
// 构建新的数据 luckysheet.create.data数据
let
createData
=
tzcCreateData
(
optionsData
,
transformJson
(
objks
.
data
),
luckysheet
,
value
,
this
.
currentRow
.
yearMonth
)
console
.
log
(
createData
)
createData
=
collect
(
createData
)
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
'
凭证
'
,
// Excel 文件名
allowEdit
:
false
,
//作用:是否允许前台编辑
data
:
createData
,
// Excel 数据
showinfobar
:
false
,
//是否显示顶部名称栏
lang
:
"
zh
"
,
})
},
// 修改保存
save
()
{
save
()
{
let
vm
=
this
if
(
!
this
.
views
.
saveLoading
)
{
this
.
views
.
saveLoading
=
true
...
...
@@ -163,77 +231,94 @@ export default {
},
// 导出
handleExport
:
debounce
(
function
()
{
console
.
log
(
1111
)
exportExcel
(
luckysheet
.
getAllSheets
(),
'
导出
'
)
},
500
),
handleExport1
()
{
getSuppliesTemplate
(
1270
).
then
((
response
)
=>
{
let
a
=
JSON
.
parse
(
response
.
rows
[
0
].
templateContent
)
a
=
a
[
0
]
a
.
data
=
luckysheet
.
transToData
(
a
.
celldata
)
a
=
[
a
]
exportExcel
(
a
,
'
修改
'
);
});
},
// 返回
handleReturnButtonClick
()
{
let
vm
=
this
if
(
this
.
views
.
type
===
'
PZ
'
)
{
vm
.
views
.
type
=
'
look
'
luckysheet
.
destroy
({})
luckysheet
.
create
({
forceCalculation
:
true
,
showinfobar
:
false
,
//是否显示顶部信息栏
lang
:
"
zh
"
,
//语言
container
:
"
luckysheet
"
,
// 设定DOM容器的id
title
:
vm
.
currentRow
.
historyName
,
// 设定表格名称
data
:
JSON
.
parse
(
vm
.
jsonData
),
})
return
;
}
this
.
currentRow
=
{}
handleReturnButtonClick
()
{
let
vm
=
this
if
(
this
.
views
.
type
===
'
PZ
'
)
{
vm
.
views
.
type
=
'
look
'
luckysheet
.
destroy
({})
luckysheet
.
create
({
forceCalculation
:
true
,
showinfobar
:
false
,
//是否显示顶部信息栏
lang
:
"
zh
"
,
//语言
container
:
"
luckysheet
"
,
// 设定DOM容器的id
title
:
vm
.
currentRow
.
historyName
,
// 设定表格名称
data
:
JSON
.
parse
(
vm
.
jsonData
),
})
return
;
}
this
.
currentRow
=
{}
luckysheet
.
destroy
()
this
.
views
.
luckysheet
=
false
this
.
views
.
loading
=
false
},
// 重置
resetQuery
()
{
resetQuery
()
{
this
.
resetForm
(
"
queryForm
"
)
this
.
handleQuery
()
},
// 查看修改
async
handleDetails
(
row
,
type
)
{
let
vm
=
this
;
async
handleDetails
(
row
,
type
)
{
let
vm
=
this
;
this
.
views
.
type
=
type
this
.
views
.
luckysheet
=
true
this
.
currentRow
=
row
this
.
views
.
loading
=
true
getWagesDataById
(
row
.
id
).
then
(
res
=>
{
this
.
views
.
loading
=
false
vm
.
jsonData
=
res
.
jsonData
||
res
.
data
.
jsonData
;
luckysheet
.
destroy
({})
luckysheet
.
create
({
forceCalculation
:
true
,
showinfobar
:
false
,
//是否显示顶部信息栏
lang
:
"
zh
"
,
//语言
container
:
"
luckysheet
"
,
// 设定DOM容器的id
title
:
row
.
historyName
,
// 设定表格名称
data
:
JSON
.
parse
(
vm
.
jsonData
),
hook
:
{
// 初始化表格
workbookCreateAfter
:
function
(
operate
)
{
console
.
info
(
'
workbookCreateAfter
'
,
operate
)
},
// 表格更新
updated
:
function
(
operate
)
{
console
.
info
(
'
updated
'
,
operate
)
},
},
})
getWagesDataById
(
row
.
id
).
then
(
res
=>
{
this
.
views
.
loading
=
false
vm
.
jsonData
=
res
.
jsonData
||
res
.
data
.
jsonData
;
luckysheet
.
destroy
({})
luckysheet
.
create
({
forceCalculation
:
true
,
showtoolbar
:
false
,
// 是否显示工具栏
showinfobar
:
false
,
//是否显示顶部信息栏
lang
:
"
zh
"
,
//语言
container
:
"
luckysheet
"
,
// 设定DOM容器的id
title
:
row
.
historyName
,
// 设定表格名称
allowEdit
:
false
,
// 是否允许前台编辑
data
:
JSON
.
parse
(
vm
.
jsonData
),
hook
:
{
// 初始化表格
workbookCreateAfter
:
function
(
operate
)
{
},
// 表格更新
updated
:
function
(
operate
)
{
},
},
})
})
},
// 列表查询
async
getList
()
{
this
.
views
.
loading
=
true
let
obj
=
{...
this
.
queryParams
};
delete
obj
.
total
;
async
getList
()
{
this
.
views
.
loading
=
true
let
obj
=
{
...
this
.
queryParams
};
delete
obj
.
total
;
let
asyncConversionGetWagesData
=
await
conversionGetWagesData
(
obj
)
console
.
log
(
asyncConversionGetWagesData
)
this
.
views
.
loading
=
false
this
.
historydataList
=
asyncConversionGetWagesData
?.
rows
||
0
console
.
log
(
this
.
historydataList
)
this
.
historydataList
=
this
.
historydataList
.
map
(
item
=>
{
const
selected
=
this
.
selectedOption
.
find
(
obj
=>
obj
.
id
===
item
.
mineId
);
if
(
selected
)
{
item
.
mineId
=
selected
.
name
;
}
return
item
;
});
this
.
queryParams
.
total
=
asyncConversionGetWagesData
?.
total
||
0
},
handleQuery
()
{
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
this
.
getList
()
},
...
...
ruoyi-ui/src/views/system/supplies/viewuploads.vue
View file @
88b0dcd5
...
...
@@ -395,7 +395,6 @@ export default {
}
else
{
name1
=
exportJson
.
sheets
[
0
].
name
;
}
//console.log(name1);
datast
=
exportJson
.
sheets
;
namest
=
exportJson
.
info
.
name
;
let
suffixArr
=
exportJson
.
info
.
name
.
split
(
'
.
'
);
...
...
ruoyi-ui/src/views/system/suppliesrole/index.vue
View file @
88b0dcd5
...
...
@@ -150,7 +150,6 @@
<!-- 生成输入框 -->
<div
v-for=
"index in instea"
:key=
"index"
>
<span
v-if=
"isTitle && index == 1"
style=
"color:red;"
>
<b>
物料编码
</b>
</span>
<span
v-if=
"isTitle && index == 2"
style=
"color:red;"
>
<b>
部门名称
</b>
</span>
<span
v-if=
"isTitle && index == 3"
style=
"color:red;"
>
<b>
计量单位
</b>
</span>
...
...
@@ -183,11 +182,9 @@
<el-form-item
label=
"物料编码所在列"
prop=
"cleanIng"
class=
"form-item-inline"
v-if=
"optionid === 6"
>
<el-input-number
size=
"medium"
v-model=
"cleanIng.CodeColumn"
:min=
"1"
:step=
"1"
>
1
</el-input-number>
</el-form-item>
<el-form-item
label=
"导入表行坐标"
prop=
"detailYH"
class=
"form-item-inline"
v-else
>
<el-input-number
size=
"medium"
v-model=
"detailYH[index - 1]"
:min=
"1"
:step=
"1"
>
1
</el-input-number>
</el-form-item>
<el-form-item
label=
"部门所在列"
prop=
"cleanIng"
class=
"form-item-inline"
v-if=
"optionid === 6"
>
<el-input-number
size=
"medium"
v-model=
"cleanIng.DepartmentColumn"
:min=
"1"
:step=
"1"
>
1
</el-input-number>
...
...
@@ -524,7 +521,6 @@ export default {
/**启用 */
toggleEnable
(
suppliesRole
)
{
console
.
log
(
'
你点击了【
'
+
suppliesRole
.
s
+
'
】的开关控件,当前开关值:
'
+
suppliesRole
.
status
);
let
enableText
=
[
'
启用
'
,
'
禁用
'
];
if
(
suppliesRole
.
status
===
0
)
{
toggleEnable
(
suppliesRole
.
id
).
then
((
response
)
=>
{
...
...
ruoyi-ui/src/views/system/suppliesroledetail/index.vue
View file @
88b0dcd5
...
...
@@ -497,7 +497,6 @@ export default {
},
toggleEnable
(
suppliesRoleDetail
)
{
console
.
log
(
'
你点击了【
'
+
suppliesRoleDetail
.
s
+
'
】的开关控件,当前开关值:
'
+
suppliesRoleDetail
.
status
);
let
enableText
=
[
'
启用
'
,
'
禁用
'
];
if
(
suppliesRoleDetail
.
status
===
0
)
{
toggleEnable
(
suppliesRoleDetail
.
id
).
then
((
response
)
=>
{
...
...
ruoyi-ui/vue.config.js
View file @
88b0dcd5
...
...
@@ -33,7 +33,7 @@ module.exports = {
proxy
:
{
// detail: https://cli.vuejs.org/config/#devserver-proxy
[
process
.
env
.
VUE_APP_BASE_API
]:
{
// target: `http://192.168.0.192:8080
`,
target
:
`http://192.168.0.59:8288
`
,
// target: `http://192.168.0.61:8080`,
// target: `http://192.168.111.228:8080`,
...
...
@@ -45,7 +45,7 @@ module.exports = {
//target: `http://192.168.3.247:8080`,
// target: `http://localhost:5001`,
target
:
`http://192.168.111.226:8080`
,
//
target: `http://192.168.111.226:8080`,
changeOrigin
:
true
,
pathRewrite
:
{
...
...
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/PowerDisplayServiceImpl.java
View file @
88b0dcd5
package
com.ruoyi.system.service.impl
;
import
com.ruoyi.system.mapper.PowerDisplayMapper
;
import
com.ruoyi.system.model.newrule.NewRuleRequestModel
;
import
com.ruoyi.system.model.power.dao.PowerClassificationQueryDao
;
import
com.ruoyi.system.model.power.dao.PowerControlDao
;
import
com.ruoyi.system.model.power.dto.ElectricityIntoTheParameterDto
;
import
com.ruoyi.system.model.power.dto.PowerDisplayDto
;
import
com.ruoyi.system.service.PowerDisplayService
;
import
com.ruoyi.system.service.impl.saveOnTheLargeScreenPower.*
;
import
org.springframework.stereotype.Service
;
import
java.lang.reflect.Method
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
java.util.stream.Collectors
;
...
...
@@ -22,15 +19,15 @@ import java.util.stream.Collectors;
*/
@Service
public
class
PowerDisplayServiceImpl
implements
PowerDisplayService
{
private
PowerDisplayMapper
powerDisplayMapper
;
private
final
PowerDisplayMapper
powerDisplayMapper
;
PowerDisplayServiceImpl
(
PowerDisplayMapper
powerDisplayMapper
)
{
this
.
powerDisplayMapper
=
powerDisplayMapper
;
}
@Override
public
void
peek
(
List
<
ElectricityIntoTheParameterDto
>
electricityIntoTheParameterDtoDtoList
)
{
String
mindId
=
electricityIntoTheParameterDtoDtoList
.
get
(
0
).
getMin
dI
d
().
replaceAll
(
" "
,
""
);
public
void
peek
(
List
<
NewRuleRequestModel
>
electricityIntoTheParameterDtoDtoList
)
{
String
mindId
=
electricityIntoTheParameterDtoDtoList
.
get
(
0
).
getMin
ei
d
().
replaceAll
(
" "
,
""
);
List
<
PowerControlDao
>
controlList
=
powerDisplayMapper
.
selControl
(
mindId
);
List
<
PowerDisplayDto
>
powerDisplayDtoList
=
new
ArrayList
<>();
Class
<
PowerDisplayDto
>
powerDisplayDtoClass
=
PowerDisplayDto
.
class
;
...
...
@@ -38,6 +35,8 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
electricityIntoTheParameterDtoDtoList
.
parallelStream
().
forEach
(
v
->
{
PowerDisplayDto
displayDto
;
if
(
mindId
.
equals
(
"011704"
)
&&
v
.
getRow
().
equals
(
"电价(含税)"
))
return
;
if
(
mindId
.
equals
(
"010105"
)
&&
(
v
.
getRow
().
contains
(
"(尖)"
)
||
v
.
getRow
().
contains
(
"(峰)"
)
||
v
.
getRow
().
contains
(
"(平)"
)
||
v
.
getRow
().
contains
(
"(谷)"
)
||
v
.
getColoumn
().
equals
(
"单价"
)))
return
;
if
(
powerDisplayDtoList
.
size
()
>
0
)
{
b
.
set
(
powerDisplayDtoList
.
parallelStream
().
anyMatch
(
a
->
a
.
getClassificationName
().
equals
(
v
.
getRow
())));
}
...
...
@@ -62,12 +61,13 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
});
List
<
PowerClassificationQueryDao
>
dao
=
powerDisplayMapper
.
selectClassificationToMid
(
mindId
);
SaveOnTheLargeScreenImpl
saveOnTheLargeScreen
=
null
;
List
<
String
>
linXi
=
Arrays
.
asList
(
"011704"
);
List
<
String
>
lvJiaTuo
=
Arrays
.
asList
(
"011702"
);
List
<
String
>
danHou
=
Arrays
.
asList
(
"011204"
);
List
<
String
>
dongHuanTuo
=
Arrays
.
asList
(
"010102"
);
List
<
String
>
linXi
=
Collections
.
singletonList
(
"011704"
);
List
<
String
>
lvJiaTuo
=
Collections
.
singletonList
(
"011702"
);
List
<
String
>
danHou
=
Collections
.
singletonList
(
"011204"
);
List
<
String
>
dongHuanTuo
=
Collections
.
singletonList
(
"010102"
);
List
<
String
>
qianJiaYing
=
Collections
.
singletonList
(
"010105"
);
if
(
linXi
.
contains
(
mindId
))
{
List
<
ElectricityIntoTheParameterDto
>
collect
=
electricityIntoTheParameterDtoDtoList
.
parallelStream
().
filter
(
v
->
v
.
getRow
().
equals
(
"电价(含税)"
)).
collect
(
Collectors
.
toList
());
List
<
NewRuleRequestModel
>
collect
=
electricityIntoTheParameterDtoDtoList
.
parallelStream
().
filter
(
v
->
v
.
getRow
().
equals
(
"电价(含税)"
)).
collect
(
Collectors
.
toList
());
if
(
collect
.
size
()
!=
0
)
{
collect
.
parallelStream
().
forEach
(
v
->
{
Optional
<
PowerControlDao
>
first
=
controlList
.
parallelStream
().
filter
(
a
->
a
.
getColumn
().
equals
(
v
.
getColoumn
())).
findFirst
();
...
...
@@ -91,9 +91,34 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
saveOnTheLargeScreen
=
new
SaveOnTheLargeScreenImpl
(
new
DanHou
());
}
else
if
(
dongHuanTuo
.
contains
(
mindId
))
{
saveOnTheLargeScreen
=
new
SaveOnTheLargeScreenImpl
(
new
DongHuanTuo
());
}
else
if
(
qianJiaYing
.
contains
(
mindId
))
{
List
<
NewRuleRequestModel
>
collect
=
electricityIntoTheParameterDtoDtoList
.
parallelStream
()
.
filter
(
v
->
v
.
getRow
().
contains
(
"(尖)"
)
||
v
.
getRow
().
contains
(
"(峰)"
)
||
v
.
getRow
().
contains
(
"(平)"
)
||
v
.
getRow
().
contains
(
"(谷)"
))
.
collect
(
Collectors
.
toList
());
if
(
collect
.
size
()
!=
0
)
{
PowerDisplayDto
displayDto
;
for
(
NewRuleRequestModel
dto
:
collect
)
{
String
[]
split
=
dto
.
getRow
().
split
(
"-"
);
Optional
<
PowerDisplayDto
>
first
=
powerDisplayDtoList
.
parallelStream
().
filter
(
v
->
v
.
getClassificationName
().
equals
(
split
[
0
])).
findFirst
();
if
(
first
.
isPresent
())
displayDto
=
first
.
get
();
else
{
displayDto
=
new
PowerDisplayDto
();
displayDto
.
setClassificationName
(
split
[
0
]);
}
try
{
Method
method
=
powerDisplayDtoClass
.
getMethod
(
"set"
+
dto
.
getColoumn
(),
String
.
class
);
method
.
invoke
(
displayDto
,
dto
.
getValue
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
saveOnTheLargeScreen
=
new
SaveOnTheLargeScreenImpl
(
new
QianJiaYing
());
}
if
(
saveOnTheLargeScreen
!=
null
)
{
List
<
PowerDisplayDto
>
list
=
saveOnTheLargeScreen
.
save
(
mindId
,
powerDisplayDtoList
,
dao
);
if
(
mindId
.
equals
(
"010105"
))
method
(
list
,
electricityIntoTheParameterDtoDtoList
);
list
.
parallelStream
().
forEach
(
v
->
{
if
(
v
.
getLevelOneClassification
()
==
null
||
""
.
equals
(
v
.
getLevelOneClassification
()))
v
.
setLevelOneClassification
(
"其他"
);
...
...
@@ -101,4 +126,26 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
powerDisplayMapper
.
insert
(
list
);
}
}
/**
* 010105电价的处理方法
*
* @param list
* @param electricityIntoTheParameterDtoDtoList
*/
private
void
method
(
List
<
PowerDisplayDto
>
list
,
List
<
NewRuleRequestModel
>
electricityIntoTheParameterDtoDtoList
)
{
for
(
PowerDisplayDto
dto
:
list
)
{
if
((
dto
.
getElectricityPriceFlat
()
==
null
||
dto
.
getElectricityPriceFlat
().
equals
(
""
))
&&
(
dto
.
getElectricityPricePeak
()
==
null
||
dto
.
getElectricityPricePeak
().
equals
(
""
))
&&
(
dto
.
getElectricityPriceTip
()
==
null
||
dto
.
getElectricityPriceTip
().
equals
(
""
))
&&
(
dto
.
getElectricityPriceValley
()
==
null
||
dto
.
getElectricityPriceValley
().
equals
(
""
)))
{
Optional
<
NewRuleRequestModel
>
first
=
electricityIntoTheParameterDtoDtoList
.
parallelStream
().
filter
(
v
->
(
v
.
getRow
().
equals
(
dto
.
getLevelOneClassification
())
||
v
.
getRow
().
equals
(
dto
.
getLevelTwoClassification
()))
&&
v
.
getColoumn
().
equals
(
"单价"
)).
findFirst
();
if
(
first
.
isPresent
())
{
NewRuleRequestModel
model
=
first
.
get
();
dto
.
setElectricityPriceValley
(
model
.
getValue
());
dto
.
setElectricityPriceFlat
(
model
.
getValue
());
dto
.
setElectricityPricePeak
(
model
.
getValue
());
dto
.
setElectricityPriceTip
(
model
.
getValue
());
}
}
}
}
}
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/saveOnTheLargeScreenPower/DongHuanTuo.java
0 → 100644
View file @
88b0dcd5
package
com.ruoyi.system.service.impl.saveOnTheLargeScreenPower
;
import
com.ruoyi.system.model.power.dao.PowerClassificationQueryDao
;
import
com.ruoyi.system.model.power.dao.PowerControlDao
;
import
com.ruoyi.system.model.power.dto.PowerDisplayDto
;
import
java.util.List
;
/**
* 2024/8/27
*/
public
class
DongHuanTuo
implements
SaveOnTheLargeScreen
{
@Override
public
List
<
PowerDisplayDto
>
save
(
String
mindId
,
List
<
PowerDisplayDto
>
powerDisplayDtoList
,
List
<
PowerClassificationQueryDao
>
dao
)
{
powerDisplayDtoList
.
parallelStream
().
forEach
(
v
->
{
for
(
PowerClassificationQueryDao
queryDao
:
dao
)
{
if
(
queryDao
.
getClassificationName
().
equals
(
v
.
getClassificationName
())){
v
.
setLevelOneClassification
(
queryDao
.
getLevelOneClassification
());
v
.
setLevelTwoClassification
(
queryDao
.
getLevelTwoClassification
());
v
.
setLevelThreeClassification
(
queryDao
.
getLevelThreeClassification
());
dao
.
remove
(
queryDao
);
break
;
}
}
});
return
powerDisplayDtoList
;
}
}
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/saveOnTheLargeScreenPower/QianJiaYing.java
0 → 100644
View file @
88b0dcd5
package
com.ruoyi.system.service.impl.saveOnTheLargeScreenPower
;
import
com.ruoyi.system.model.power.dao.PowerClassificationQueryDao
;
import
com.ruoyi.system.model.power.dto.PowerDisplayDto
;
import
java.util.List
;
/**
* 2024/8/28
*/
public
class
QianJiaYing
implements
SaveOnTheLargeScreen
{
@Override
public
List
<
PowerDisplayDto
>
save
(
String
mindId
,
List
<
PowerDisplayDto
>
powerDisplayDtoList
,
List
<
PowerClassificationQueryDao
>
dao
)
{
powerDisplayDtoList
.
parallelStream
().
forEach
(
v
->
{
for
(
PowerClassificationQueryDao
queryDao
:
dao
)
{
if
(
v
.
getClassificationName
()
!=
null
&&
v
.
getClassificationName
().
equals
(
queryDao
.
getClassificationName
()))
{
v
.
setLevelOneClassification
(
queryDao
.
getLevelOneClassification
());
v
.
setLevelTwoClassification
(
queryDao
.
getLevelTwoClassification
());
v
.
setLevelThreeClassification
(
queryDao
.
getLevelThreeClassification
());
break
;
}
}
});
return
null
;
}
}
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