import { useWeAppAuthStore } from '@/common'
import useModel from './model'
import { Apis } from '@/gen/Apis'
import { getApiLoading } from '@/common/libraries/apiLoading'
const auth = useWeAppAuthStore()
import { showToastBack, showToast } from '@/common/libraries/naviHelper'
export default {
  init(data: any) {
    useModel.formData.value = data
  },
  handleSubmit() {
    let data = useModel?.formData?.value
    if (!data?.rework_reason) {
      return showToast('请输入返工原因！')
    }
    getApiLoading(Apis.WorkOrder.HouseWorkOrders.Rework, data).then(res => {
      showToastBack('提交成功！', 1, true)
      console.log(res)
    })
  }
}
