1
This commit is contained in:
@@ -196,7 +196,7 @@
|
||||
<button type="submit" name="redirect" value="/web/become" class="btn btn-link btn-sm btn-block">Log in as superuser</button>
|
||||
|
||||
</t>
|
||||
<div class="o_login_auth"></div>
|
||||
<!-- <div class="o_login_auth"></div>-->
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="redirect" t-att-value="redirect"/>
|
||||
@@ -242,7 +242,7 @@
|
||||
<t t-if="debug">
|
||||
<button type="submit" name="redirect" value="/web/become" class="btn btn-link btn-sm btn-block">Log in as superuser</button>
|
||||
</t>
|
||||
<div class="o_login_auth"></div>
|
||||
<!-- <div class="o_login_auth"></div>-->
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="redirect" t-att-value="redirect"/>
|
||||
@@ -299,7 +299,7 @@
|
||||
<t t-if="debug">
|
||||
<button type="submit" name="redirect" value="/web/become" class="btn btn-link btn-sm btn-block">Log in as superuser</button>
|
||||
</t>
|
||||
<div class="o_login_auth"></div>
|
||||
<!-- <div class="o_login_auth"></div>-->
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="redirect" t-att-value="redirect"/>
|
||||
@@ -361,7 +361,7 @@
|
||||
<button type="submit" name="redirect" value="/web/become" class="btn btn-link btn-sm btn-block">Log in as superuser</button>
|
||||
|
||||
</t>
|
||||
<div class="o_login_auth"></div>
|
||||
<!-- <div class="o_login_auth"></div>-->
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="redirect" t-att-value="redirect"/>
|
||||
@@ -403,7 +403,7 @@
|
||||
<t t-if="debug">
|
||||
<button type="submit" name="redirect" value="/web/become" class="btn btn-link btn-sm btn-block">Log in as superuser</button>
|
||||
</t>
|
||||
<div class="o_login_auth"/>
|
||||
<!-- <div class="o_login_auth"/>-->
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="redirect" t-att-value="redirect"/>
|
||||
|
||||
@@ -34,17 +34,28 @@ class YuThonPhone(http.Controller):
|
||||
# return json.dumps(return_data)
|
||||
user_id = request.env['res.users'].sudo().browse(uid)
|
||||
employee_id = user_id.with_company(user_id.company_id.id).employee_id
|
||||
applet_security_setting_ids = request.env['applet.security'].search([('employee_id', '=', employee_id.id)]).applet_security_setting_ids
|
||||
access_list = [access.name for access in applet_security_setting_ids]
|
||||
# data = {'name': employee_id.name, 'id': user_id.id, 'access': access_list, 'phone': employee_id.mobile_phone}
|
||||
data = {'name': employee_id.name, 'id': user_id.id,
|
||||
'access': ['OA', '抄表', '日程', '通知公告', '工作流', '薪资条', '考勤确认单', '物业账单', '报事报修', '用餐收集', '信息表收集', '财务表收集', '关于', '我的'],
|
||||
'phone': employee_id.mobile_phone}
|
||||
_logger.info(f"接口人{employee_id.name}权限{access_list}__用户id: {user_id}________")
|
||||
applet_security_setting_ids = request.env['applet.security'].search(
|
||||
[('employee_id', '=', employee_id.id)]).applet_security_setting_ids
|
||||
# access_list = [access.name for access in applet_security_setting_ids]
|
||||
access_list = ['OA', '抄表', '日程', '通知公告', '工作流', '薪资条', '考勤确认单', '物业账单', '报事报修',
|
||||
'用餐收集', '信息表收集', '财务表收集', '关于', '我的']
|
||||
company_list = []
|
||||
for company in user_id.company_ids:
|
||||
company_dict = {
|
||||
'state': 1,
|
||||
'company_id': company.id,
|
||||
'company_name': company.name,
|
||||
}
|
||||
company_list.append(company_dict)
|
||||
data = {
|
||||
'name': employee_id.name,
|
||||
'id': user_id.id,
|
||||
'access': access_list,
|
||||
'phone': employee_id.mobile_phone,
|
||||
'company_data': company_list,
|
||||
}
|
||||
return json.dumps({'data': data, 'code': 200, 'message': ''})
|
||||
|
||||
|
||||
|
||||
# 我的
|
||||
@http.route('/phone/myself', type='http', auth="none", csrf=False, cors='*')
|
||||
def phone_myself(self, **kw):
|
||||
@@ -65,3 +76,8 @@ class YuThonPhone(http.Controller):
|
||||
}
|
||||
return json.dumps({'data': data, 'code': 200, 'message': ''})
|
||||
|
||||
@http.route('/phone/base', type='http', auth="none", csrf=False, cors='*')
|
||||
def phone_base(self, **kw):
|
||||
company_id = kw.get('company_id')
|
||||
employee_id = request.env['hr.employee'].sudo().search([('user_id.id', '=', kw.get('user_id'))])
|
||||
|
||||
|
||||
@@ -67,9 +67,9 @@
|
||||
<a t-if="signup_enabled" t-attf-href="/web/signup?{{ keep_query() }}">还没有账户?</a>
|
||||
<a t-if="reset_password_enabled" t-attf-href="/web/reset_password?{{ keep_query() }}">重置密码</a>
|
||||
</div>
|
||||
<div class="o_login_auth">
|
||||
<t t-call="yuthon_tianhe.yuthon_providers"/>
|
||||
</div>
|
||||
<!-- <div class="o_login_auth">-->
|
||||
<!-- <t t-call="yuthon_tianhe.yuthon_providers"/>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="redirect" t-att-value="redirect"/>
|
||||
|
||||
@@ -68,9 +68,9 @@
|
||||
<a t-if="signup_enabled" t-attf-href="/web/signup?{{ keep_query() }}">还没有账户?</a>
|
||||
<a t-if="reset_password_enabled" t-attf-href="/web/reset_password?{{ keep_query() }}">重置密码</a>
|
||||
</div>
|
||||
<div class="o_login_auth">
|
||||
<t t-call="yuthon_tianhe.yuthon_providers"/>
|
||||
</div>
|
||||
<!-- <div class="o_login_auth">-->
|
||||
<!-- <t t-call="yuthon_tianhe.yuthon_providers"/>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="redirect" t-att-value="redirect"/>
|
||||
|
||||
@@ -134,3 +134,23 @@ class YuthonWillTask(http.Controller):
|
||||
'code': 200,
|
||||
'message': 'success'
|
||||
})
|
||||
|
||||
@http.route('/will/task/create', methods=['POST'], type='http', auth='public', csrf=False)
|
||||
def will_task_create(self, **kwargs):
|
||||
"""
|
||||
手机端创建日程接口
|
||||
"""
|
||||
request.env['yuthon.will.task'].sudo().create({
|
||||
'name': kwargs.get('name'),
|
||||
'employee_id': kwargs.get('id'),
|
||||
'employee_ids': kwargs.get('id'),
|
||||
'start_date': kwargs.get('id'),
|
||||
'request_hour_from': '',
|
||||
'request_hour_to': '',
|
||||
'remarks': kwargs.get('remarks'),
|
||||
'address': kwargs.get('address'),
|
||||
})
|
||||
return json.dumps({
|
||||
'code': 200,
|
||||
'message': '数据创建成功'
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user