from testcase.test_scene6.scene6_mainflow import *

def test_scene6_mainflow1():

    print('\n流程六：手术请领-手术还回流程开始！！！')
    # step1 = LoginSys()
    step2_1 = SurgicalOrder()
    step2_2 = PurchaseOrder()
    step3 = SurgicalDispensing()
    step4 = SurgicalLending()
    step5_1 = Outstore()
    step5_2 = Outstore1()
    step6 = SurgicalReturn()
    step7_1 = Instore1()
    step7_2 = Instore()
    step8 = SurgicalLendingSale()
    # step1.loginsys(SIT_URL, usr2, pwd2)
    step2_2.switch_loggin(usr2,pwd2)
    step2_1.data_add_surgical()
    step2_2.button_click1()
    qltorder = step2_1.return_qltorder()
    step3.dispensing(qltorder)
    step4.lending(qltorder)
    step4.switch_loggin(usr1,pwd1)
    step4.query_click(menu_name='手术借出单', orderno=qltorder,
                                  el='vxe-body--column col_19 col--center col--ellipsis dw-click-cell',
                                  qrcond='请领单号')
    jctorder = step4.return_jctorder()
    step4.button_click2()
    step4.switch_loggin(usr4, pwd4)
    step5_1.deliver_goods(jctorder)  # 仓库发货
    step5_1.picking_goods(jctorder)  # 仓库拣货
    step5_1.switch_loggin(usr5, pwd5)
    step5_2.outbound_review1(jctorder,type=3)  # 出库复核
    step5_1.switch_loggin(usr2, pwd2)
    step6.data_add_surgicalreturn(jctorder)#新增手术还回收货
    hhshtorder = step6.return_hhshtorder()
    step7_1.switch_loggin(usr5,pwd5)
    step7_1.goods_check(hhshtorder,type=3)#仓库验收
    hhtorderno = step7_1.return_hhtorderno()
    step7_1.switch_loggin(usr4,pwd4)
    step7_2.goods_grounding(hhtorderno)#仓库上架
    # step8.data_add_surgicallendingsale(jctorder)#新建销售单
    # xstorderno = step8.return_xstorderno()#返回销售单号
    # step8.switch_loggin(usr3,pwd3)
    # step8.query_click(menu_name='手术借出转销售', orderno=xstorderno,
    #                               el='vxe-body--column col_19 col--center col--ellipsis dw-click-cell',
    #                               qrcond='销售订单号')#进入表单视图
    # step8.button_click2()#审核订单
    print('流程六：手术请领-手术还回流程结束！！！')

