Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
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
hujun
tl_estate
Commits
d48b93fa
Commit
d48b93fa
authored
Apr 03, 2019
by
agping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资料图片上传
parent
32226a42
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
103 additions
and
4 deletions
+103
-4
daily_details.html
application/index/view/finance/daily_details.html
+16
-2
financial_manager_daily_list.js
public/resource/js/financial_manager_daily_list.js
+87
-2
No files found.
application/index/view/finance/daily_details.html
View file @
d48b93fa
...
...
@@ -237,7 +237,7 @@
.active
{
color
:
dodgerblue
;
}
#file_input_pic
{
#file_input_pic
{
opacity
:
0
;
position
:
absolute
;
top
:
0
;
...
...
@@ -245,7 +245,15 @@
height
:
35px
;
width
:
80px
;
}
#file_input_pic_xi
{
opacity
:
0
;
position
:
absolute
;
top
:
0
;
left
:
0
;
height
:
35px
;
width
:
80px
;
}
.hide
{
display
:
none
!important
;
}
...
...
@@ -845,14 +853,20 @@
<div
class=
"form-group full-width-100 full-pic-area"
>
<!--input上传图片-->
<div
id=
"container_body"
>
<button
type=
"button btn2"
class=
"btn btn-default"
>
上传图片
</button>
<input
type=
"file"
id=
"file_input_pic_xi"
/>
<div
id=
"container_body_img_area"
></div>
</div>
</div>
</li>
</ul>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button btn2"
class=
"btn btn-primary"
id=
"saveBtnLiu"
data-dismiss=
"modal"
>
保存
</button>
</div>
</div>
<!-- /.modal-content -->
...
...
public/resource/js/financial_manager_daily_list.js
View file @
d48b93fa
...
...
@@ -194,13 +194,54 @@ define(['doT', 'text!temp/financial_manager_daily_list_template_tpl.html', 'css!
}
});
});
//图片上传相关(资料)
$
(
'#file_input_pic_xi'
).
on
(
'change'
,
function
(){
var
_this
=
$
(
this
);
var
formData
=
new
FormData
();
formData
.
append
(
'type'
,
'chat'
);
formData
.
append
(
'image'
,
_this
[
0
].
files
[
0
]);
$
.
ajax
({
type
:
'post'
,
url
:
ServerHostImageLiu
+
'/index/uploadImg'
,
data
:
formData
,
dataType
:
'json'
,
contentType
:
false
,
cache
:
false
,
processData
:
false
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
_data
.
code
==
200
)
{
$
(
'#container_body_img_area'
).
append
(
'<div class="result-du-l"><img data-imgname="{0}" src="{1}" alt=""/> <span class="span-del-du-l">删除</span></div>'
.
stringFormatObj
({
'0'
:
_data
.
data
.
img_path
,
'1'
:
_data
.
data
.
internet_img_name
?
urlDeal
(
_data
.
data
.
internet_img_name
):
_data
.
data
.
internet_img_name
}));
}
else
{
alert
(
_data
.
msg
);
};
},
error
:
function
()
{
alert
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
)
{
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
alert
(
'请求超时,请重试'
);
};
}
});
});
//图片删除事件
_doc
.
on
(
'click'
,
'.span-del-du'
,
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
$
(
this
).
parent
().
remove
();
});
//图片删除事件
_doc
.
on
(
'click'
,
'.span-del-du-l'
,
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
$
(
this
).
parent
().
remove
();
});
//图片删除,已有的则调用接口删除
_doc
.
on
(
'click'
,
'.span-del2-du'
,
function
(
e
)
{
var
_this
=
$
(
this
);
...
...
@@ -275,7 +316,51 @@ define(['doT', 'text!temp/financial_manager_daily_list_template_tpl.html', 'css!
});
});
//收款详情页面
//保存上传的图片(资料)
_doc
.
on
(
'click'
,
'#saveBtnLiu'
,
function
(
e
)
{
var
_this
=
$
(
this
);
e
.
preventDefault
();
e
.
stopPropagation
();
var
imgname
=
[];
for
(
var
i
=
0
;
i
<
$
(
'.result-du-l'
).
length
;
i
++
)
{
imgname
[
i
]
=
$
(
'.result-du-l>img'
).
eq
(
i
).
attr
(
'data-imgname'
);
};
var
id_pic
=
bargain
.
house_fatherid
;
var
_data
=
{
img_id
:
bargain
.
recordid
,
};
//无新的图片上传 不调用接口
if
(
imgname
.
join
(
','
))
{
_data
[
'img_name'
]
=
imgname
.
join
(
','
);
}
else
{
return
};
$
.
ajax
({
type
:
'GET'
,
url
:
'/index/addReceiptImg'
,
data
:
_data
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
alert
(
'保存成功'
);
$
(
'#container_body_img_area'
).
html
(
""
);
bargain
.
getList
();
}
else
{
alert
(
'数据错误'
);
};
},
error
:
function
()
{
alert
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
)
{
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
alert
(
'请求超时,请重试'
);
};
}
});
});
//店长提交日报
_doc
.
on
(
'click'
,
'.is-submit'
,
function
(
e
)
{
e
.
preventDefault
();
...
...
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