((typeof self !== 'undefined' ? self : this)["webpackJsonpvehicle_management_sm"] = (typeof self !== 'undefined' ? self : this)["webpackJsonpvehicle_management_sm"] || []).push([[10],{

/***/ "4a77":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"27800716-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/windicss-webpack-plugin/dist/loaders/windicss-template.cjs!./src/modules/vehicle-management-sm/components/AddCar.vue?vue&type=template&id=7a53987d&scoped=true
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-dialog',{directives:[{name:"dialogDrag",rawName:"v-dialogDrag"}],staticClass:"large-dialog",attrs:{"title":_vm.operateType === 'update' ? '编辑车辆' : '新增车辆',"visible":_vm.dialogVisible,"close-on-click-modal":false,"width":"1200px"},on:{"update:visible":function($event){_vm.dialogVisible=$event}}},[_c('BasicCom',{ref:"basicForm",attrs:{"deviceList":_vm.deviceList},on:{"finallySub":_vm.finallySub}}),_c('div',{staticClass:"text-center",attrs:{"slot":"footer"},slot:"footer"},[_c('el-button',{attrs:{"type":"primary","size":"small","loading":_vm.optionLoad},on:{"click":_vm.subData}},[_vm._v(_vm._s(_vm.$t('保存')))]),_c('el-button',{attrs:{"size":"small"},on:{"click":function($event){_vm.dialogVisible = false}}},[_vm._v(_vm._s(_vm.$t('取消')))])],1)],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./src/modules/vehicle-management-sm/components/AddCar.vue?vue&type=template&id=7a53987d&scoped=true

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 5 modules
var slicedToArray = __webpack_require__("3835");

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__("c7eb");

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
var asyncToGenerator = __webpack_require__("1da1");

// EXTERNAL MODULE: ./node_modules/@wiz-api/personnel-safety-management/lib/personnel-safety-management.umd.js
var personnel_safety_management_umd = __webpack_require__("f10f");

// EXTERNAL MODULE: ./src/modules/vehicle-management-sm/components/BasicInfo.vue + 5 modules
var BasicInfo = __webpack_require__("94af");

// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib??ref--12-1!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/windicss-webpack-plugin/dist/loaders/windicss-template.cjs!./src/modules/vehicle-management-sm/components/AddCar.vue?vue&type=script&lang=js



//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//



var carApi = new personnel_safety_management_umd["CarApi"]();
/* harmony default export */ var AddCarvue_type_script_lang_js = ({
  name: 'add-car',
  components: {
    BasicCom: BasicInfo["a" /* default */]
  },
  props: {
    visible: {
      default: false,
      type: Boolean
    },
    operateData: {
      type: Object,
      default: function _default() {}
    },
    operateType: {
      type: String,
      default: ''
    },
    deviceList: {
      type: Array,
      default: function _default() {
        return [];
      }
    }
  },
  computed: {
    dialogVisible: {
      get: function get() {
        return this.visible;
      },
      set: function set(val) {
        this.$emit('update:visible', val);
      }
    }
  },
  data: function data() {
    return {
      optionLoad: false
    };
  },
  mounted: function mounted() {
    var _this = this;
    if (this.operateType === 'update') {
      this.$nextTick(function () {
        _this.$refs.basicForm.detailShow(_this.operateData);
      });
    }
  },
  methods: {
    subData: function subData() {
      var _this2 = this;
      return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee() {
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              _this2.$refs.basicForm.submitData();
            case 1:
            case "end":
              return _context.stop();
          }
        }, _callee);
      }))();
    },
    finallySub: function finallySub(data) {
      var _this3 = this;
      return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee2() {
        var _ref, _ref2, err, res;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee2$(_context2) {
          while (1) switch (_context2.prev = _context2.next) {
            case 0:
              _this3.optionLoad = true;
              if (_this3.operateType === 'update') {
                data.id = _this3.operateData.id;
              }
              if (!(_this3.operateType === 'update')) {
                _context2.next = 8;
                break;
              }
              _context2.next = 5;
              return carApi.update({
                body: data
              });
            case 5:
              _context2.t0 = _context2.sent;
              _context2.next = 11;
              break;
            case 8:
              _context2.next = 10;
              return carApi.insert({
                body: data
              });
            case 10:
              _context2.t0 = _context2.sent;
            case 11:
              _ref = _context2.t0;
              _ref2 = Object(slicedToArray["a" /* default */])(_ref, 2);
              err = _ref2[0];
              res = _ref2[1];
              _this3.optionLoad = false;
              if (!err) {
                _this3.$message.success('提交成功');
                _this3.dialogVisible = false;
                _this3.$emit('success');
              }
            case 17:
            case "end":
              return _context2.stop();
          }
        }, _callee2);
      }))();
    }
  }
});
// CONCATENATED MODULE: ./src/modules/vehicle-management-sm/components/AddCar.vue?vue&type=script&lang=js
 /* harmony default export */ var components_AddCarvue_type_script_lang_js = (AddCarvue_type_script_lang_js); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("2877");

// CONCATENATED MODULE: ./src/modules/vehicle-management-sm/components/AddCar.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  components_AddCarvue_type_script_lang_js,
  render,
  staticRenderFns,
  false,
  null,
  "7a53987d",
  null
  
)

/* harmony default export */ var AddCar = __webpack_exports__["default"] = (component.exports);

/***/ })

}]);
//# sourceMappingURL=vehicle-management-sm.umd.10.js.map