Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
G
GangShi-un2
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
黄旭新
GangShi-un2
Commits
ad9fb874
提交
ad9fb874
authored
5月 26, 2021
作者:
彭涛
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
三期项目搭建
上级
26b26452
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
3 行增加
和
2 行删除
+3
-2
LssueContracts.vue
pagesA/Contracts/LssueContracts/LssueContracts.vue
+2
-1
LssueContracts.js
...-weixin/pagesA/Contracts/LssueContracts/LssueContracts.js
+1
-1
没有找到文件。
pagesA/Contracts/LssueContracts/LssueContracts.vue
浏览文件 @
ad9fb874
...
@@ -288,7 +288,7 @@
...
@@ -288,7 +288,7 @@
},
},
//选择合同结束时间
//选择合同结束时间
bindDeadlineChange
(
e
)
{
bindDeadlineChange
(
e
)
{
if
(
this
.
contractStartTime
&&
this
.
contractEndTime
)
{
if
(
this
.
contractStartTime
&&
this
.
contractEndTime
)
{
this
.
deadline
=
e
.
detail
.
value
+
'/12/31'
this
.
deadline
=
e
.
detail
.
value
+
'/12/31'
}
else
{
}
else
{
uni
.
showToast
({
uni
.
showToast
({
...
@@ -371,6 +371,7 @@
...
@@ -371,6 +371,7 @@
shareRatio
:
this
.
shareRatio
,
shareRatio
:
this
.
shareRatio
,
contractStartTime
:
this
.
contractStartTime
,
contractStartTime
:
this
.
contractStartTime
,
contractEndTime
:
this
.
contractEndTime
,
contractEndTime
:
this
.
contractEndTime
,
fixedSpreadTime
:
this
.
deadline
,
electricId
:
this
.
electricId
electricId
:
this
.
electricId
}
}
get
(
api
.
previewContract
,
params
).
then
(
res
=>
{
get
(
api
.
previewContract
,
params
).
then
(
res
=>
{
...
...
unpackage/dist/build/mp-weixin/pagesA/Contracts/LssueContracts/LssueContracts.js
浏览文件 @
ad9fb874
(
global
[
"webpackJsonp"
]
=
global
[
"webpackJsonp"
]
||
[]).
push
([[
"pagesA/Contracts/LssueContracts/LssueContracts"
],{
"32a4"
:
function
(
t
,
e
,
n
){
"use strict"
;
n
.
r
(
e
);
var
a
=
n
(
"5c14"
),
i
=
n
.
n
(
a
);
for
(
var
c
in
a
)
"default"
!==
c
&&
function
(
t
){
n
.
d
(
e
,
t
,(
function
(){
return
a
[
t
]}))}(
c
);
e
[
"default"
]
=
i
.
a
},
"41f9"
:
function
(
t
,
e
,
n
){
"use strict"
;
var
a
;
n
.
d
(
e
,
"b"
,(
function
(){
return
i
})),
n
.
d
(
e
,
"c"
,(
function
(){
return
c
})),
n
.
d
(
e
,
"a"
,(
function
(){
return
a
}));
var
i
=
function
(){
var
t
=
this
,
e
=
t
.
$createElement
;
t
.
_self
.
_c
;
t
.
_isMounted
||
(
t
.
e0
=
function
(
e
){
t
.
dialogShow
=!
1
})},
c
=
[]},
"5c14"
:
function
(
t
,
e
,
n
){
"use strict"
;(
function
(
t
){
Object
.
defineProperty
(
e
,
"__esModule"
,{
value
:
!
0
}),
e
.
default
=
void
0
;
var
a
=
c
(
n
(
"7363"
)),
i
=
n
(
"a000"
);
function
c
(
t
){
return
t
&&
t
.
__esModule
?
t
:{
default
:
t
}}
var
o
=
{
created
:
function
(){
this
.
electricId
=
t
.
getStorageSync
(
"user"
).
electricId
,
this
.
getElectricitySalesCompaniesList
()},
onLoad
:
function
(
e
){
var
n
=
this
;
n
.
contractId
=
e
.
id
,
e
.
template
&&
(
n
.
onTemplate
=!
1
,
t
.
setNavigationBarTitle
({
title
:
"开具合同"
}))},
onShow
:
function
(){
this
.
getUserMessage
(),
this
.
dialogShow
=!
1
},
data
:
function
(){
return
{
contractId
:
""
,
contractType
:
""
,
contractA
:
""
,
userId
:
null
,
electricity
:
""
,
fixedSpread
:
""
,
shareRatio
:
""
,
contractStartTime
:
""
,
contractEndTime
:
""
,
deadline
:
""
,
electricId
:
""
,
typeValue
:
""
,
typeOptions
:[
"固定价差"
,
"月竞分成"
],
companyValue
:
""
,
companys
:
""
,
companyOptions
:[],
pdFurl
:
""
,
imgList
:[],
onUpload
:
!
0
,
onTemplate
:
!
0
,
onSubmint
:
!
1
,
isAuthenticate
:
0
,
dialogShow
:
!
1
}},
computed
:{
startDate
:
function
(){
var
t
=
null
,
e
=
null
,
n
=
(
new
Date
).
getDay
();
return
this
.
onTemplate
?(
t
=
(
new
Date
).
getFullYear
()
-
5
,
e
=
1
):(
t
=
(
new
Date
).
getFullYear
(),
e
=
(
new
Date
).
getMonth
()
+
1
),
13
==
e
&&
(
t
+=
1
,
e
=
1
),
e
=
e
>
9
?
e
:
"0"
+
e
,
n
=
n
>
9
?
n
:
"0"
+
n
,
console
.
log
(
t
+
"-"
+
e
+
"-"
+
n
),
t
+
"-"
+
e
+
"-"
+
n
},
endDate
:
function
(){
var
t
=
(
new
Date
).
getFullYear
()
+
10
;
return
t
+
"-12-31"
}},
methods
:{
callkf
:
function
(){
t
.
makePhoneCall
({
phoneNumber
:
"15360101191"
})},
getUserMessage
:
function
(){
var
t
=
this
;(
0
,
i
.
get
)(
a
.
default
.
getUserInformation
,{
type
:
2
,
userId
:
this
.
electricId
}).
then
((
function
(
e
){
200
==
e
.
code
&&
(
t
.
isAuthenticate
=
e
.
data
.
isAuthenticate
)}))},
getElectricitySalesCompaniesList
:
function
(){
var
t
=
this
;(
0
,
i
.
get
)(
a
.
default
.
electricitySalesCompaniesList
).
then
((
function
(
e
){
200
==
e
.
code
&&
(
console
.
log
(
"获取售电公司列表"
),
t
.
companys
=
e
.
data
,
t
.
companyOptions
=
e
.
data
.
map
((
function
(
t
){
return
t
.
eName
})),
t
.
contractId
&&
t
.
datashow
())}))},
datashow
:
function
(){
var
t
=
this
;(
0
,
i
.
get
)(
a
.
default
.
contractDetail
,{
contractId
:
t
.
contractId
}).
then
((
function
(
e
){
if
(
console
.
log
(
"获取合同信息"
),
200
==
e
.
code
){
t
.
contractA
=
e
.
data
.
contractA
,
t
.
companyValue
=
e
.
data
.
ename
;
var
n
=
t
.
companys
.
filter
((
function
(
e
){
return
e
.
eName
==
t
.
companyValue
}));
t
.
userId
=
n
[
0
].
userId
,
t
.
electricity
=
e
.
data
.
electricity
,
t
.
contractStartTime
=
e
.
data
.
contractStartTime
.
replace
(
new
RegExp
(
"-"
,
"g"
),
"/"
),
t
.
contractEndTime
=
e
.
data
.
contractEndTime
.
replace
(
new
RegExp
(
"-"
,
"g"
),
"/"
),
t
.
contractType
=
e
.
data
.
contractType
,
1
==
t
.
contractType
?(
t
.
typeValue
=
"固定价差"
,
t
.
fixedSpread
=
e
.
data
.
fixedSpread
):(
t
.
typeValue
=
"月竞分成"
,
t
.
shareRatio
=
e
.
data
.
shareRatio
);
var
a
=
JSON
.
parse
(
e
.
data
.
contractAnnex
);
a
.
map
((
function
(
e
){
e
.
lastIndexOf
(
".pdf"
)
>-
1
?
t
.
pdFurl
=
e
:
t
.
imgList
=
a
}))}}))},
bindTypeChange
:
function
(
t
){
var
e
=
t
.
detail
.
value
;
switch
(
this
.
typeValue
=
this
.
typeOptions
[
e
],
this
.
typeValue
){
case
"固定价差"
:
this
.
contractType
=
1
;
break
;
case
"月竞分成"
:
this
.
contractType
=
3
;
break
}},
bindCompanyChange
:
function
(
t
){
var
e
=
this
,
n
=
t
.
detail
.
value
;
this
.
companyValue
=
this
.
companyOptions
[
n
];
var
a
=
this
.
companys
.
filter
((
function
(
t
){
if
(
t
.
eName
==
e
.
companyValue
)
return
t
.
userId
}));
this
.
userId
=
a
[
0
].
userId
},
bindStartDateChange
:
function
(
t
){
var
e
=
t
.
detail
.
value
.
replace
(
"-"
,
"/"
);
this
.
contractStartTime
=
e
+
"/01"
},
bindEndDateChange
:
function
(
e
){
this
.
contractStartTime
.
split
(
"/"
)[
0
]
>
e
.
detail
.
value
?
t
.
showToast
({
title
:
"合同开始时间不能大于合同结束时间"
,
icon
:
"none"
}):
this
.
contractEndTime
=
e
.
detail
.
value
+
"/12/31"
},
bindDeadlineChange
:
function
(
e
){
this
.
contractStartTime
&&
this
.
contractEndTime
?
this
.
deadline
=
e
.
detail
.
value
+
"/12/31"
:
t
.
showToast
({
title
:
"请选择合同时间"
,
icon
:
"none"
})},
linktoCertification
:
function
(){
t
.
navigateTo
({
url
:
"/pages/Certification/Certification"
})},
slectImage
:
function
(
e
){
var
n
=
this
;
wx
.
chooseMessageFile
({
count
:
1
,
type
:
"all"
,
success
:
function
(
i
){
t
.
showLoading
({
title
:
"上传中"
});
var
c
=
i
.
tempFiles
[
0
].
path
;
c
.
lastIndexOf
(
".jpg"
)
>-
1
||
c
.
lastIndexOf
(
".png"
)
>-
1
||
c
.
lastIndexOf
(
".pdf"
)
>-
1
||
c
.
lastIndexOf
(
".jpeg"
)
>-
1
?
t
.
uploadFile
({
url
:
a
.
default
.
uploadFile
,
filePath
:
c
,
name
:
"file"
,
success
:
function
(
a
){
var
i
=
JSON
.
parse
(
a
.
data
).
url
;
i
.
lastIndexOf
(
".pdf"
)
>-
1
?(
n
.
imgList
=
[],
n
.
onUpload
=!
1
,
n
.
pdFurl
=
i
):(
n
.
onUpload
=!
0
,
n
.
pdFurl
=
""
,
n
.
imgList
[
e
]
=
i
,
n
.
imgList
.
length
>
5
&&
(
n
.
onUpload
=!
1
),
n
.
$forceUpdate
()),
t
.
hideLoading
()}}):
t
.
showToast
({
title
:
"不支持此文件格式,请重新选择"
,
icon
:
"none"
})}})},
openContract
:
function
(){
if
(
2
==
this
.
isAuthenticate
){
console
.
log
(
"下载合同"
);
var
e
=
this
.
checkout
();
if
(
e
)
t
.
showToast
({
title
:
e
,
icon
:
"none"
});
else
{
var
n
=
{
contractType
:
this
.
contractType
,
contractA
:
this
.
contractA
,
userId
:
this
.
userId
,
electricity
:
this
.
electricity
,
fixedSpread
:
this
.
fixedSpread
,
shareRatio
:
this
.
shareRatio
,
contractStartTime
:
this
.
contractStartTime
,
contractEndTime
:
this
.
contractEndTime
,
electricId
:
this
.
electricId
};(
0
,
i
.
get
)(
a
.
default
.
previewContract
,
n
).
then
((
function
(
e
){
if
(
console
.
log
(
e
),
200
==
e
.
code
){
var
n
=
e
.
msg
.
replace
(
/http:/g
,
"https:"
);
t
.
downloadFile
({
url
:
n
,
filePath
:
wx
.
env
.
USER_DATA_PATH
+
"/购售电交易合同.docx"
,
success
:
function
(
e
){
console
.
log
(
e
),
200
==
e
.
statusCode
&&
t
.
openDocument
({
filePath
:
e
.
filePath
,
showMenu
:
!
0
,
success
:
function
(){
console
.
log
(
"打开文档成功"
)}})},
fail
:
function
(
e
){
t
.
showToast
({
title
:
"打开文档失败,请联系管理员"
,
icon
:
"none"
})}})}
else
t
.
showToast
({
title
:
"该售电公司没有合同模板"
,
icon
:
"none"
})}))}}
else
this
.
dialogShow
=!
0
},
submit
:
function
(){
var
e
=
this
;
if
(
2
==
this
.
isAuthenticate
){
console
.
log
(
"上传合同"
);
var
n
=
this
.
contractStartTime
.
replace
(
new
RegExp
(
"/"
,
"g"
),
"-"
),
c
=
this
.
contractEndTime
.
replace
(
/
\/
/g
,
"-"
),
o
=
this
.
checkout
();
if
(
o
)
t
.
showToast
({
title
:
o
,
icon
:
"none"
});
else
{
var
r
=
null
;
r
=
this
.
pdFurl
?
this
.
pdFurl
:
this
.
imgList
.
join
(
","
),
this
.
onSubmint
=!
0
,(
0
,
i
.
post
)(
a
.
default
.
uploadContract
,{
id
:
this
.
contractId
,
contractType
:
this
.
contractType
,
contractA
:
this
.
contractA
,
userId
:
this
.
userId
,
electricity
:
this
.
electricity
,
fixedSpread
:
this
.
fixedSpread
,
shareRatio
:
this
.
shareRatio
,
contractStartTime
:
n
,
contractEndTime
:
c
,
electricId
:
this
.
electricId
,
contractAnnex
:
r
}).
then
((
function
(
n
){
200
==
n
.
code
?(
t
.
showToast
({
title
:
"保存成功"
}),
setTimeout
((
function
(){
t
.
redirectTo
({
url
:
"/pagesA/Contracts/EnterpriseContract/EnterpriseContract?tabIndex=2"
})}),
500
)):(
t
.
showToast
({
title
:
n
.
msg
,
icon
:
"none"
}),
setTimeout
((
function
(){
e
.
onSubmint
=!
1
}),
1
e3
))}))}}
else
this
.
dialogShow
=!
0
},
checkout
:
function
(){
return
""
==
this
.
contractType
?
"请选择合同类型"
:
""
==
this
.
contractA
?
"请输入合同的甲方"
:
null
==
this
.
userId
?
"请选择合同的乙方"
:
""
==
this
.
electricity
||
isNaN
(
this
.
electricity
)?
"请输入合同的电量"
:
1
==
this
.
contractType
&&
""
==
this
.
fixedSpread
?
"请输入固定的价差"
:
3
==
this
.
contractType
&&
""
==
this
.
shareRatio
?
"请输入分成的比例"
:
""
==
this
.
contractStartTime
?
"请选择合同的开始时间"
:
""
==
this
.
contractEndTime
?
"请选择合同的结束时间"
:
!
(
!
this
.
onTemplate
||
""
!=
this
.
pdFurl
||
0
!=
this
.
imgList
.
length
)
&&
"请上传合同附件"
}}};
e
.
default
=
o
}).
call
(
this
,
n
(
"543d"
)[
"default"
])},
6007
:
function
(
t
,
e
,
n
){
"use strict"
;
var
a
=
n
(
"91a0"
),
i
=
n
.
n
(
a
);
i
.
a
},
"91a0"
:
function
(
t
,
e
,
n
){},
"9fec"
:
function
(
t
,
e
,
n
){
"use strict"
;
n
.
r
(
e
);
var
a
=
n
(
"41f9"
),
i
=
n
(
"32a4"
);
for
(
var
c
in
i
)
"default"
!==
c
&&
function
(
t
){
n
.
d
(
e
,
t
,(
function
(){
return
i
[
t
]}))}(
c
);
n
(
"6007"
);
var
o
,
r
=
n
(
"f0c5"
),
s
=
Object
(
r
[
"a"
])(
i
[
"default"
],
a
[
"b"
],
a
[
"c"
],
!
1
,
null
,
null
,
null
,
!
1
,
a
[
"a"
],
o
);
e
[
"default"
]
=
s
.
exports
},
b434
:
function
(
t
,
e
,
n
){
"use strict"
;(
function
(
t
){
n
(
"0cf7"
);
a
(
n
(
"66fd"
));
var
e
=
a
(
n
(
"9fec"
));
function
a
(
t
){
return
t
&&
t
.
__esModule
?
t
:{
default
:
t
}}
t
(
e
.
default
)}).
call
(
this
,
n
(
"543d"
)[
"createPage"
])}},[[
"b434"
,
"common/runtime"
,
"common/vendor"
]]]);
(
global
[
"webpackJsonp"
]
=
global
[
"webpackJsonp"
]
||
[]).
push
([[
"pagesA/Contracts/LssueContracts/LssueContracts"
],{
"32a4"
:
function
(
t
,
e
,
a
){
"use strict"
;
a
.
r
(
e
);
var
n
=
a
(
"5c14"
),
i
=
a
.
n
(
n
);
for
(
var
c
in
n
)
"default"
!==
c
&&
function
(
t
){
a
.
d
(
e
,
t
,(
function
(){
return
n
[
t
]}))}(
c
);
e
[
"default"
]
=
i
.
a
},
"5c14"
:
function
(
t
,
e
,
a
){
"use strict"
;(
function
(
t
){
Object
.
defineProperty
(
e
,
"__esModule"
,{
value
:
!
0
}),
e
.
default
=
void
0
;
var
n
=
c
(
a
(
"7363"
)),
i
=
a
(
"a000"
);
function
c
(
t
){
return
t
&&
t
.
__esModule
?
t
:{
default
:
t
}}
var
o
=
{
created
:
function
(){
this
.
electricId
=
t
.
getStorageSync
(
"user"
).
electricId
,
this
.
getElectricitySalesCompaniesList
()},
onLoad
:
function
(
e
){
var
a
=
this
;
a
.
contractId
=
e
.
id
,
e
.
template
&&
(
a
.
onTemplate
=!
1
,
t
.
setNavigationBarTitle
({
title
:
"开具合同"
}))},
onShow
:
function
(){
this
.
getUserMessage
(),
this
.
dialogShow
=!
1
},
data
:
function
(){
return
{
contractId
:
""
,
contractType
:
""
,
contractA
:
""
,
userId
:
null
,
electricity
:
""
,
fixedSpread
:
""
,
shareRatio
:
""
,
contractStartTime
:
""
,
contractEndTime
:
""
,
deadline
:
""
,
electricId
:
""
,
typeValue
:
""
,
typeOptions
:[
"固定价差"
,
"月竞分成"
],
companyValue
:
""
,
companys
:
""
,
companyOptions
:[],
pdFurl
:
""
,
imgList
:[],
onUpload
:
!
0
,
onTemplate
:
!
0
,
onSubmint
:
!
1
,
isAuthenticate
:
0
,
dialogShow
:
!
1
}},
computed
:{
startDate
:
function
(){
var
t
=
null
,
e
=
null
,
a
=
(
new
Date
).
getDay
();
return
this
.
onTemplate
?(
t
=
(
new
Date
).
getFullYear
()
-
5
,
e
=
1
):(
t
=
(
new
Date
).
getFullYear
(),
e
=
(
new
Date
).
getMonth
()
+
1
),
13
==
e
&&
(
t
+=
1
,
e
=
1
),
e
=
e
>
9
?
e
:
"0"
+
e
,
a
=
a
>
9
?
a
:
"0"
+
a
,
console
.
log
(
t
+
"-"
+
e
+
"-"
+
a
),
t
+
"-"
+
e
+
"-"
+
a
},
endDate
:
function
(){
var
t
=
(
new
Date
).
getFullYear
()
+
10
;
return
t
+
"-12-31"
}},
methods
:{
callkf
:
function
(){
t
.
makePhoneCall
({
phoneNumber
:
"15360101191"
})},
getUserMessage
:
function
(){
var
t
=
this
;(
0
,
i
.
get
)(
n
.
default
.
getUserInformation
,{
type
:
2
,
userId
:
this
.
electricId
}).
then
((
function
(
e
){
200
==
e
.
code
&&
(
t
.
isAuthenticate
=
e
.
data
.
isAuthenticate
)}))},
getElectricitySalesCompaniesList
:
function
(){
var
t
=
this
;(
0
,
i
.
get
)(
n
.
default
.
electricitySalesCompaniesList
).
then
((
function
(
e
){
200
==
e
.
code
&&
(
console
.
log
(
"获取售电公司列表"
),
t
.
companys
=
e
.
data
,
t
.
companyOptions
=
e
.
data
.
map
((
function
(
t
){
return
t
.
eName
})),
t
.
contractId
&&
t
.
datashow
())}))},
datashow
:
function
(){
var
t
=
this
;(
0
,
i
.
get
)(
n
.
default
.
contractDetail
,{
contractId
:
t
.
contractId
}).
then
((
function
(
e
){
if
(
console
.
log
(
"获取合同信息"
),
200
==
e
.
code
){
t
.
contractA
=
e
.
data
.
contractA
,
t
.
companyValue
=
e
.
data
.
ename
;
var
a
=
t
.
companys
.
filter
((
function
(
e
){
return
e
.
eName
==
t
.
companyValue
}));
t
.
userId
=
a
[
0
].
userId
,
t
.
electricity
=
e
.
data
.
electricity
,
t
.
contractStartTime
=
e
.
data
.
contractStartTime
.
replace
(
new
RegExp
(
"-"
,
"g"
),
"/"
),
t
.
contractEndTime
=
e
.
data
.
contractEndTime
.
replace
(
new
RegExp
(
"-"
,
"g"
),
"/"
),
t
.
contractType
=
e
.
data
.
contractType
,
1
==
t
.
contractType
?(
t
.
typeValue
=
"固定价差"
,
t
.
fixedSpread
=
e
.
data
.
fixedSpread
):(
t
.
typeValue
=
"月竞分成"
,
t
.
shareRatio
=
e
.
data
.
shareRatio
);
var
n
=
JSON
.
parse
(
e
.
data
.
contractAnnex
);
n
.
map
((
function
(
e
){
e
.
lastIndexOf
(
".pdf"
)
>-
1
?
t
.
pdFurl
=
e
:
t
.
imgList
=
n
}))}}))},
bindTypeChange
:
function
(
t
){
var
e
=
t
.
detail
.
value
;
switch
(
this
.
typeValue
=
this
.
typeOptions
[
e
],
this
.
typeValue
){
case
"固定价差"
:
this
.
contractType
=
1
;
break
;
case
"月竞分成"
:
this
.
contractType
=
3
;
break
}},
bindCompanyChange
:
function
(
t
){
var
e
=
this
,
a
=
t
.
detail
.
value
;
this
.
companyValue
=
this
.
companyOptions
[
a
];
var
n
=
this
.
companys
.
filter
((
function
(
t
){
if
(
t
.
eName
==
e
.
companyValue
)
return
t
.
userId
}));
this
.
userId
=
n
[
0
].
userId
},
bindStartDateChange
:
function
(
t
){
var
e
=
t
.
detail
.
value
.
replace
(
"-"
,
"/"
);
this
.
contractStartTime
=
e
+
"/01"
},
bindEndDateChange
:
function
(
e
){
this
.
contractStartTime
.
split
(
"/"
)[
0
]
>
e
.
detail
.
value
?
t
.
showToast
({
title
:
"合同开始时间不能大于合同结束时间"
,
icon
:
"none"
}):
this
.
contractEndTime
=
e
.
detail
.
value
+
"/12/31"
},
bindDeadlineChange
:
function
(
e
){
this
.
contractStartTime
&&
this
.
contractEndTime
?
this
.
deadline
=
e
.
detail
.
value
+
"/12/31"
:
t
.
showToast
({
title
:
"请选择合同时间"
,
icon
:
"none"
})},
linktoCertification
:
function
(){
t
.
navigateTo
({
url
:
"/pages/Certification/Certification"
})},
slectImage
:
function
(
e
){
var
a
=
this
;
wx
.
chooseMessageFile
({
count
:
1
,
type
:
"all"
,
success
:
function
(
i
){
t
.
showLoading
({
title
:
"上传中"
});
var
c
=
i
.
tempFiles
[
0
].
path
;
c
.
lastIndexOf
(
".jpg"
)
>-
1
||
c
.
lastIndexOf
(
".png"
)
>-
1
||
c
.
lastIndexOf
(
".pdf"
)
>-
1
||
c
.
lastIndexOf
(
".jpeg"
)
>-
1
?
t
.
uploadFile
({
url
:
n
.
default
.
uploadFile
,
filePath
:
c
,
name
:
"file"
,
success
:
function
(
n
){
var
i
=
JSON
.
parse
(
n
.
data
).
url
;
i
.
lastIndexOf
(
".pdf"
)
>-
1
?(
a
.
imgList
=
[],
a
.
onUpload
=!
1
,
a
.
pdFurl
=
i
):(
a
.
onUpload
=!
0
,
a
.
pdFurl
=
""
,
a
.
imgList
[
e
]
=
i
,
a
.
imgList
.
length
>
5
&&
(
a
.
onUpload
=!
1
),
a
.
$forceUpdate
()),
t
.
hideLoading
()}}):
t
.
showToast
({
title
:
"不支持此文件格式,请重新选择"
,
icon
:
"none"
})}})},
openContract
:
function
(){
if
(
2
==
this
.
isAuthenticate
){
console
.
log
(
"下载合同"
);
var
e
=
this
.
checkout
();
if
(
e
)
t
.
showToast
({
title
:
e
,
icon
:
"none"
});
else
{
var
a
=
{
contractType
:
this
.
contractType
,
contractA
:
this
.
contractA
,
userId
:
this
.
userId
,
electricity
:
this
.
electricity
,
fixedSpread
:
this
.
fixedSpread
,
shareRatio
:
this
.
shareRatio
,
contractStartTime
:
this
.
contractStartTime
,
contractEndTime
:
this
.
contractEndTime
,
fixedSpreadTime
:
this
.
deadline
,
electricId
:
this
.
electricId
};(
0
,
i
.
get
)(
n
.
default
.
previewContract
,
a
).
then
((
function
(
e
){
if
(
console
.
log
(
e
),
200
==
e
.
code
){
var
a
=
e
.
msg
.
replace
(
/http:/g
,
"https:"
);
t
.
downloadFile
({
url
:
a
,
filePath
:
wx
.
env
.
USER_DATA_PATH
+
"/购售电交易合同.docx"
,
success
:
function
(
e
){
console
.
log
(
e
),
200
==
e
.
statusCode
&&
t
.
openDocument
({
filePath
:
e
.
filePath
,
showMenu
:
!
0
,
success
:
function
(){
console
.
log
(
"打开文档成功"
)}})},
fail
:
function
(
e
){
t
.
showToast
({
title
:
"打开文档失败,请联系管理员"
,
icon
:
"none"
})}})}
else
t
.
showToast
({
title
:
"该售电公司没有合同模板"
,
icon
:
"none"
})}))}}
else
this
.
dialogShow
=!
0
},
submit
:
function
(){
var
e
=
this
;
if
(
2
==
this
.
isAuthenticate
){
console
.
log
(
"上传合同"
);
var
a
=
this
.
contractStartTime
.
replace
(
new
RegExp
(
"/"
,
"g"
),
"-"
),
c
=
this
.
contractEndTime
.
replace
(
/
\/
/g
,
"-"
),
o
=
this
.
checkout
();
if
(
o
)
t
.
showToast
({
title
:
o
,
icon
:
"none"
});
else
{
var
r
=
null
;
r
=
this
.
pdFurl
?
this
.
pdFurl
:
this
.
imgList
.
join
(
","
),
this
.
onSubmint
=!
0
,(
0
,
i
.
post
)(
n
.
default
.
uploadContract
,{
id
:
this
.
contractId
,
contractType
:
this
.
contractType
,
contractA
:
this
.
contractA
,
userId
:
this
.
userId
,
electricity
:
this
.
electricity
,
fixedSpread
:
this
.
fixedSpread
,
shareRatio
:
this
.
shareRatio
,
contractStartTime
:
a
,
contractEndTime
:
c
,
electricId
:
this
.
electricId
,
contractAnnex
:
r
}).
then
((
function
(
a
){
200
==
a
.
code
?(
t
.
showToast
({
title
:
"保存成功"
}),
setTimeout
((
function
(){
t
.
redirectTo
({
url
:
"/pagesA/Contracts/EnterpriseContract/EnterpriseContract?tabIndex=2"
})}),
500
)):(
t
.
showToast
({
title
:
a
.
msg
,
icon
:
"none"
}),
setTimeout
((
function
(){
e
.
onSubmint
=!
1
}),
1
e3
))}))}}
else
this
.
dialogShow
=!
0
},
checkout
:
function
(){
return
""
==
this
.
contractType
?
"请选择合同类型"
:
""
==
this
.
contractA
?
"请输入合同的甲方"
:
null
==
this
.
userId
?
"请选择合同的乙方"
:
""
==
this
.
electricity
||
isNaN
(
this
.
electricity
)?
"请输入合同的电量"
:
1
==
this
.
contractType
&&
""
==
this
.
fixedSpread
?
"请输入固定的价差"
:
3
==
this
.
contractType
&&
""
==
this
.
shareRatio
?
"请输入分成的比例"
:
""
==
this
.
contractStartTime
?
"请选择合同的开始时间"
:
""
==
this
.
contractEndTime
?
"请选择合同的结束时间"
:
!
(
!
this
.
onTemplate
||
""
!=
this
.
pdFurl
||
0
!=
this
.
imgList
.
length
)
&&
"请上传合同附件"
}}};
e
.
default
=
o
}).
call
(
this
,
a
(
"543d"
)[
"default"
])},
6007
:
function
(
t
,
e
,
a
){
"use strict"
;
var
n
=
a
(
"91a0"
),
i
=
a
.
n
(
n
);
i
.
a
},
"7a9a"
:
function
(
t
,
e
,
a
){
"use strict"
;
var
n
;
a
.
d
(
e
,
"b"
,(
function
(){
return
i
})),
a
.
d
(
e
,
"c"
,(
function
(){
return
c
})),
a
.
d
(
e
,
"a"
,(
function
(){
return
n
}));
var
i
=
function
(){
var
t
=
this
,
e
=
t
.
$createElement
;
t
.
_self
.
_c
;
t
.
_isMounted
||
(
t
.
e0
=
function
(
e
){
t
.
dialogShow
=!
1
})},
c
=
[]},
"91a0"
:
function
(
t
,
e
,
a
){},
"9fec"
:
function
(
t
,
e
,
a
){
"use strict"
;
a
.
r
(
e
);
var
n
=
a
(
"7a9a"
),
i
=
a
(
"32a4"
);
for
(
var
c
in
i
)
"default"
!==
c
&&
function
(
t
){
a
.
d
(
e
,
t
,(
function
(){
return
i
[
t
]}))}(
c
);
a
(
"6007"
);
var
o
,
r
=
a
(
"f0c5"
),
s
=
Object
(
r
[
"a"
])(
i
[
"default"
],
n
[
"b"
],
n
[
"c"
],
!
1
,
null
,
null
,
null
,
!
1
,
n
[
"a"
],
o
);
e
[
"default"
]
=
s
.
exports
},
b434
:
function
(
t
,
e
,
a
){
"use strict"
;(
function
(
t
){
a
(
"0cf7"
);
n
(
a
(
"66fd"
));
var
e
=
n
(
a
(
"9fec"
));
function
n
(
t
){
return
t
&&
t
.
__esModule
?
t
:{
default
:
t
}}
t
(
e
.
default
)}).
call
(
this
,
a
(
"543d"
)[
"createPage"
])}},[[
"b434"
,
"common/runtime"
,
"common/vendor"
]]]);
\ No newline at end of file
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论