feat(invoice): 增加发票备注和附件功能
- 新增发票备注和附件上传功能- 实现发票列表按验证时间筛选 - 优化发票列表展示,增加验证时间筛选和关键字搜索 - 修复附件上传相关接口
This commit is contained in:
@@ -134,7 +134,7 @@ class DataService:
|
||||
"WHERE id = ?",
|
||||
(datetime.now().strftime("%Y-%m-%d %H:%M:%S"), verify_status,inspectionAmount, invoice_id))
|
||||
conn.commit()
|
||||
def update_invoice_desc(self, invoice_id: int|str, desc: str, desc_file: str,status: str):
|
||||
def update_invoice_desc(self, invoice_id: int|str, desc: str, desc_file: str,status: str) -> str:
|
||||
conn = DBService().get_conn()
|
||||
cursor = conn.cursor()
|
||||
cursor.execute(
|
||||
@@ -145,6 +145,7 @@ class DataService:
|
||||
"WHERE id = ?",
|
||||
(desc, desc_file,status, invoice_id))
|
||||
conn.commit()
|
||||
return "success"
|
||||
# 查询验证记录
|
||||
def get_verify_log(self, file_path: str) -> dict[Any, Any]|None:
|
||||
conn = DBService().get_conn()
|
||||
@@ -205,9 +206,9 @@ class DataService:
|
||||
else:
|
||||
sql += " verify_status = '" + verify_status+"'"
|
||||
if start_date is not None:
|
||||
sql += " and verify_time >= '" + start_date.strftime("%Y-%m-%d") + "'"
|
||||
sql += " and verify_time >= '" + start_date + "'"
|
||||
if end_date is not None:
|
||||
sql += " and verify_time <= '" + end_date.strftime("%Y-%m-%d") + "'"
|
||||
sql += " and verify_time <= '" + end_date + "'"
|
||||
if value is not None and value != '':
|
||||
sql += " and ( "
|
||||
sql += "file_path like '%" + value + "%' or "
|
||||
@@ -243,7 +244,7 @@ class DataService:
|
||||
sql += "desc_files like '%" + value + "%' "
|
||||
sql += ")"
|
||||
sql += " order by verify_time desc"
|
||||
# print(sql)
|
||||
print(sql)
|
||||
cursor.execute(sql)
|
||||
rows = cursor.fetchall()
|
||||
datas = []
|
||||
|
||||
@@ -67,7 +67,13 @@ def reverify():
|
||||
def list_invoice():
|
||||
value = request.json.get('value')
|
||||
verify_status = request.json.get('verify_status')
|
||||
return dataservice.get_invoice_list(value=value,verify_status=verify_status)
|
||||
verify_time = request.json.get('verify_time')
|
||||
start_date = None
|
||||
end_date = None
|
||||
if verify_time is not None:
|
||||
start_date = verify_time[0].split(' ')[0]
|
||||
end_date = verify_time[1].split(' ')[0]
|
||||
return dataservice.get_invoice_list(value=value,verify_status=verify_status,start_date=start_date,end_date=end_date)
|
||||
@app.route('/listInvoiceTimeOut',methods=['POST'])
|
||||
def list_invoice_time_out():
|
||||
time_out = request.form.get('timeOut')
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user