'''
@Project ：test_guke 
@File    ：transfer_out_red.py
@IDE     ：PyCharm 
@Author  ：何凯
@Date    ：2023/3/25 14:38
@desc   :调拨出库红冲单
'''

import logging
import time
from random import randint
import allure
from time import sleep
from component.GuKeYiTiHua import iframe, menu, list_page, button, order_detail_main, order_detail_table, \
    modal
from component.GuKeYiTiHua.Transfer import first_menu
from unit.public.YamlUtil import UtilYaml
log = logging.getLogger(__name__)


class TransferOutRed(object):
    third_menu = '调拨出库红冲单'
    def __init__(self):
        self.iframe = iframe
        self.menu = menu
        self.list_page = list_page
        self.button = button
        self.order_detail_main = order_detail_main
        self.order_detail_table = order_detail_table
        self.modal = modal

    @allure.step('打开菜单：{}'.format(third_menu))
    def open_menu_transfer_out_red(self):
        self.iframe.out_frame()
        self.menu.open_menu(first_menu, self.third_menu)

    # @allure.step('查询：{}'.format(third_menu))
    # def transfer_in_search(self, tap_name='待办视图', order_code=None, count=1):
    #     self.list_page.order_search(self.third_menu, tap_name, '调拨出库单号', order_code, count)

    @allure.step('新建：{}'.format(third_menu))
    def transfer_out_red_code_create(self, order_code=None):
        log.info('创建调拨出库红冲单')
        self.iframe.to_main_iframe()
        self.button.red_flush()
        self.list_page.checked_order(0)
        self.button.click_button(button_name='整单红冲')




