"use strict";
require("../../common/libraries/request.js");
const common_store_useWeAppAuthStore = require("../../common/store/useWeAppAuthStore.js");
require("../../common/store/useWorkStore.js");
const WORKORDER_update_work_time_model = require("./model.js");
const gen_Apis = require("../../gen/Apis.js");
const common_libraries_apiLoading = require("../../common/libraries/apiLoading.js");
const common_libraries_naviHelper = require("../../common/libraries/naviHelper.js");
common_store_useWeAppAuthStore.useWeAppAuthStore();
const method = {
  init(data) {
    WORKORDER_update_work_time_model.useModel.formData.value = data;
  },
  handleSubmit() {
    var _a, _b;
    let data = (_b = (_a = WORKORDER_update_work_time_model.useModel) == null ? void 0 : _a.formData) == null ? void 0 : _b.value;
    if (!(data == null ? void 0 : data.expect_start_time)) {
      return common_libraries_naviHelper.showToast("请选择新时间！");
    }
    if ((data == null ? void 0 : data.day) === `${data == null ? void 0 : data.expect_start_time}:00`) {
      return common_libraries_naviHelper.showToast("与原时间相同！");
    }
    common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.WorkOrder.HouseWorkOrders.ChangeExpectTime, data).then((res) => {
      common_libraries_naviHelper.showToastBack("提交成功！", 1, true);
      console.log(res);
    });
  }
};
exports.method = method;
