Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zghywpc-vue
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李苏
zghywpc-vue
Commits
cecf4337
Commit
cecf4337
authored
Jan 09, 2025
by
李苏
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整
parent
3fc633a0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
113 additions
and
34 deletions
+113
-34
edit.vue
src/views/ywxxgl/jdlcdxgsjs/edit.vue
+113
-34
No files found.
src/views/ywxxgl/jdlcdxgsjs/edit.vue
View file @
cecf4337
...
@@ -3,12 +3,23 @@
...
@@ -3,12 +3,23 @@
* @Author: lisu lisu@gavelinfo.com
* @Author: lisu lisu@gavelinfo.com
* @Date: 2024-09-19 10:47:46
* @Date: 2024-09-19 10:47:46
* @LastEditors: lisu lisu@gavelinfo.com
* @LastEditors: lisu lisu@gavelinfo.com
* @LastEditTime: 202
4-10-29 10:16:41
* @LastEditTime: 202
5-01-09 14:44:50
* @FilePath: /zghywpc-vue/src/views/ywxxgl/jdlcdxgsjs/edit.vue
* @FilePath: /zghywpc-vue/src/views/ywxxgl/jdlcdxgsjs/edit.vue
-->
-->
<
template
>
<
template
>
<!-- prop 穿透赋值 -->
<!-- prop 穿透赋值 -->
<BaseEdit
v-bind=
"$attrs"
:config=
'editConfig'
>
<BaseEdit
ref=
'baseEdit'
@
getForm=
'getForm'
:attachments=
'attachments'
v-bind=
"$attrs"
:config=
'editConfig'
>
<template
#
form=
"ctx"
>
<!-- 嵌入默认页面额外弹框的插槽 ctx.editPage来操作默认页面 -->
<el-form-item
label=
"上传附件"
>
<UploadTmp
@
getUploadFile=
'getUploadFile'
@
getList=
'uploadGetList'
/>
</el-form-item>
<el-form-item
label=
"附件列表"
>
<AttachmentList
:canDelete=
'ctx.baseEdit.type=="view"?false:true'
url=
'ywxxgl/ujdlcdxgsjs/attachment'
:params=
'attachmentListParams'
ref=
"attachmentList"
@
getList=
'attachmentListGetList'
/>
</el-form-item>
</
template
>
<
template
#
dialog=
"ctx"
>
<
template
#
dialog=
"ctx"
>
<!-- 嵌入默认页面额外弹框的插槽 ctx.editPage来操作默认页面 -->
<!-- 嵌入默认页面额外弹框的插槽 ctx.editPage来操作默认页面 -->
</
template
>
</
template
>
...
@@ -24,9 +35,21 @@
...
@@ -24,9 +35,21 @@
</template>
</template>
<
script
>
<
script
>
import
*
as
XLSX
from
'xlsx'
;
export
default
{
export
default
{
computed
:
{
attachments
()
{
return
[...
this
.
uploadAttachments
,
...
this
.
attachmentListAttachments
]
}
},
data
()
{
data
()
{
return
{
return
{
uploadAttachments
:
[],
attachmentListAttachments
:
[],
attachmentListParams
:
{
groupid
:
''
},
editConfig
:
{
editConfig
:
{
/* 生成form表单 */
/* 生成form表单 */
editColItemList
:
[{
editColItemList
:
[{
...
@@ -34,7 +57,7 @@
...
@@ -34,7 +57,7 @@
"prop"
:
"year"
,
"prop"
:
"year"
,
"span"
:
12
,
"span"
:
12
,
"type"
:
"year"
,
// 对于整型字段,一般使用input类型
"type"
:
"year"
,
// 对于整型字段,一般使用input类型
value
:
new
Date
().
getFullYear
(),
value
:
new
Date
().
getFullYear
(),
"required"
:
true
,
"required"
:
true
,
},
},
{
{
...
@@ -45,8 +68,7 @@
...
@@ -45,8 +68,7 @@
"value"
:
""
,
"value"
:
""
,
"required"
:
true
,
"required"
:
true
,
"typeConfig"
:
{
"typeConfig"
:
{
optionsData
:[
optionsData
:
[{
{
id
:
1
,
id
:
1
,
name
:
'第一季度'
name
:
'第一季度'
},
},
...
@@ -68,7 +90,7 @@
...
@@ -68,7 +90,7 @@
"label"
:
"name"
"label"
:
"name"
}
}
},
},
value
:
this
.
getQuarterFromTimestamp
(
new
Date
().
getTime
())
value
:
this
.
getQuarterFromTimestamp
(
new
Date
().
getTime
())
},
},
{
{
"label"
:
"大修"
,
"label"
:
"大修"
,
...
@@ -106,10 +128,17 @@
...
@@ -106,10 +128,17 @@
"value"
:
""
// 默认值,如果需要可以移除或修改
"value"
:
""
// 默认值,如果需要可以移除或修改
},
},
{
"label"
:
"人员"
,
"prop"
:
"ryName"
,
"span"
:
12
,
"type"
:
"input"
,
// 未标明特殊类型或ftString类型默认为input
"value"
:
""
// 默认值,如果需要可以移除或修改
},
{
{
"label"
:
"合计"
,
"label"
:
"合计"
,
"prop"
:
"hj"
,
"prop"
:
"hj"
,
"span"
:
24
,
"span"
:
12
,
"type"
:
"input"
,
// 未标明特殊类型或ftString类型默认为input
"type"
:
"input"
,
// 未标明特殊类型或ftString类型默认为input
"value"
:
""
// 默认值,如果需要可以移除或修改
"value"
:
""
// 默认值,如果需要可以移除或修改
},
},
...
@@ -150,7 +179,57 @@
...
@@ -150,7 +179,57 @@
}
}
}
}
},
},
methods
:
{
methods
:
{
readExcelFile
(
file
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
reader
=
new
FileReader
();
reader
.
onload
=
(
e
)
=>
{
const
data
=
new
Uint8Array
(
e
.
target
.
result
);
const
workbook
=
XLSX
.
read
(
data
,
{
type
:
'array'
});
const
worksheet
=
workbook
.
Sheets
[
workbook
.
SheetNames
[
0
]];
const
jsonData
=
XLSX
.
utils
.
sheet_to_json
(
worksheet
,
{
header
:
1
});
resolve
(
jsonData
);
};
reader
.
onerror
=
(
e
)
=>
{
reject
(
e
);
};
reader
.
readAsArrayBuffer
(
file
);
})
},
getUploadFile
(
file
)
{
const
name
=
file
.
name
/* 根据文件名判定是否是excel文件*/
if
(
name
.
includes
(
'xlsx'
))
{
this
.
readExcelFile
(
file
.
raw
).
then
(
data
=>
{
console
.
log
(
data
[
16
],
data
)
this
.
$refs
.
baseEdit
.
form
.
ryName
=
data
[
16
][
1
]
this
.
$refs
.
baseEdit
.
form
.
hj
=
data
[
17
][
1
]
})
}
},
getForm
(
e
)
{
this
.
attachmentListParams
.
groupid
=
e
.
id
this
.
$nextTick
(()
=>
{
this
.
$refs
.
attachmentList
.
init
()
})
},
uploadGetList
(
e
)
{
this
.
uploadAttachments
=
e
},
attachmentListGetList
(
e
)
{
this
.
attachmentListAttachments
=
e
},
getQuarterFromTimestamp
(
timestamp
)
{
getQuarterFromTimestamp
(
timestamp
)
{
const
date
=
new
Date
(
timestamp
);
const
date
=
new
Date
(
timestamp
);
const
month
=
date
.
getMonth
();
// 月份从0开始,0表示1月,11表示12月
const
month
=
date
.
getMonth
();
// 月份从0开始,0表示1月,11表示12月
...
...
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