from testcase.test_scene4.scene4_mainflow import *


def test_scene4_mainflow1():

    print('\n流程四：调拨出库-入库流程开始！！！')
    # step1 = LoginSys()
    step2_1 = TransferOut()
    step2_2 = PurchaseOrder()
    step3 = Outstore()
    step4 = TransferIn()
    step5 = Instore1()
    step6 = TransferOffSetting()
    # step1.loginsys(SIT_URL, usr2, pwd2)
    step2_2.switch_loggin(usr2, pwd2)
    step2_1.data_add_allocate()  # 填写主表数据
    sttorder = step2_1.return_sttorder()
    step2_2.button_click1()  # 提交
    step2_2.switch_loggin(usr1, pwd1)
    step2_2.query_click('调拨出库单', sttorder, 'vxe-body--column col_19 col--left col--ellipsis dw-click-cell',
                        qrcond='调拨出库单号')
    step2_2.button_click2(msg1='发送成功')  # 审核
    step3.switch_loggin(usr4, pwd4)
    step3.deliver_goods(sttorder)  # 仓库发货
    step3.picking_goods(sttorder)  # 仓库拣货
    step3.switch_loggin(usr5, pwd5)
    step3.outbound_review(sttorder, type=3)  # 出库复核
    step3.switch_loggin(usr1, pwd1)
    step4.transfer_in(sttorder)  # 检查自动审配订单状态
    ottorder = step4.return_ottorder()  # 获取调拨入库单号
    step5.switch_loggin(usr4, pwd4)
    step5.take_over_goods(ottorder)  # 仓库收货：1为收货单据撤回，2为提交，其余为保存
    step5.switch_loggin(usr5, pwd5)
    step5.goods_check(ottorder,type=3)  # 仓库验收：1为保存，否则为提交
    step5.switch_loggin(usr4, pwd4)
    step5.goods_grounding(ottorder)  # 仓库上架：1为保存，否则为提交
    print('流程四：调拨出库-入库流程结束！！！')



