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

/***/ "81ba":
/***/ (function(module, exports, __webpack_require__) {

// style-loader: Adds some css to the DOM by adding a <style> tag

// load the styles
var content = __webpack_require__("926e");
if(content.__esModule) content = content.default;
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var add = __webpack_require__("499e").default
var update = add("e696ef64", content, true, {"sourceMap":false,"shadowMode":false});

/***/ }),

/***/ "8c63":
/***/ (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":"28eb61d9-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/contractor-management-sm/components/OperateApiDialog.vue?vue&type=template&id=a728b18a&scoped=true
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-card',{staticClass:"h-full absolute inset-0 z-10"},[_c('div',{staticClass:"h-full flex flex-col"},[_c('div',{staticClass:"flex justify-between items-center"},[(['update', 'create', 'approve'].includes(_vm.operateApiProps.editType))?_c('span',{staticClass:"border-l-3 border-color-primary pl-10px text-18px"},[_vm._v(_vm._s(_vm.operateApiProps.title))]):_c('div',[_c('el-page-header',{attrs:{"content":_vm.operateApiProps.title},on:{"back":function($event){return _vm.$emit('cancel')}}})],1),(_vm.$hasAccess('readFlow') && _vm.flowTaskId)?_c('el-button',{on:{"click":_vm.viewFlow}},[_vm._v("查看流程")]):_vm._e()],1),_c('div',{staticClass:"flex-1 overflow-y-auto mt-20px"},[_c('el-form',{directives:[{name:"loading",rawName:"v-loading",value:(_vm.parentFormLoading),expression:"parentFormLoading"}],ref:"parentForm",attrs:{"size":"mini","label-width":"150px","rules":_vm.parentApiRules,"model":_vm.parentApiForm}},[_c('el-row',{staticClass:"px-20px"},[_c('div',{staticClass:"flex items-center ml-10px mb-5px"},[_c('span',{staticClass:"border-l-3 border-color-primary pl-10px text-18px"},[_vm._v("基本信息")])]),_c('el-col',{attrs:{"span":8}},[_c('el-form-item',{attrs:{"label":"单位名称","prop":"orgName"}},[_c('el-input',{staticClass:"w-full",attrs:{"readonly":_vm.operateApiProps.editType === 'edit',"placeholder":"请输入单位名称","size":"small","clearable":"","disabled":""},model:{value:(_vm.parentApiForm.orgName),callback:function ($$v) {_vm.$set(_vm.parentApiForm, "orgName", $$v)},expression:"parentApiForm.orgName"}})],1)],1),_c('el-col',{attrs:{"span":8}},[_c('el-form-item',{attrs:{"label":"单位简称","prop":"orgShortName"}},[_c('el-input',{staticClass:"!w-full",attrs:{"placeholder":"请输入单位简称","size":"small","clearable":"","disabled":""},model:{value:(_vm.parentApiForm.orgShortName),callback:function ($$v) {_vm.$set(_vm.parentApiForm, "orgShortName", $$v)},expression:"parentApiForm.orgShortName"}})],1)],1),_c('el-col',{attrs:{"span":8}},[_c('el-form-item',{attrs:{"label":"联系人电话","prop":"phoneNumber"}},[_c('el-input',{staticClass:"!w-full",attrs:{"placeholder":"请输入联系人电话","size":"small","clearable":"","disabled":""},model:{value:(_vm.parentApiForm.phoneNumber),callback:function ($$v) {_vm.$set(_vm.parentApiForm, "phoneNumber", $$v)},expression:"parentApiForm.phoneNumber"}})],1)],1),_c('el-col',{attrs:{"span":8}},[_c('el-form-item',{attrs:{"label":"单位负责人","prop":"orgLeader"}},[_c('el-input',{staticClass:"!w-full",attrs:{"placeholder":"请输入单位负责人","size":"small","clearable":"","disabled":""},model:{value:(_vm.parentApiForm.orgLeader),callback:function ($$v) {_vm.$set(_vm.parentApiForm, "orgLeader", $$v)},expression:"parentApiForm.orgLeader"}})],1)],1),_c('el-col',{attrs:{"span":8}},[_c('el-form-item',{attrs:{"label":"邮箱","prop":"email"}},[_c('el-input',{staticClass:"!w-full",attrs:{"placeholder":"请输入邮箱","size":"small","clearable":"","disabled":""},model:{value:(_vm.parentApiForm.email),callback:function ($$v) {_vm.$set(_vm.parentApiForm, "email", $$v)},expression:"parentApiForm.email"}})],1)],1),_c('el-col',{attrs:{"span":8}},[_c('el-form-item',{attrs:{"label":"所属专业","prop":"ownerdSpecialtyId"}},[_c('el-select',{staticClass:"w-full",attrs:{"filterable":"","placeholder":"请选择所属专业","clearable":"","disabled":""},model:{value:(_vm.parentApiForm.ownerdSpecialtyId),callback:function ($$v) {_vm.$set(_vm.parentApiForm, "ownerdSpecialtyId", $$v)},expression:"parentApiForm.ownerdSpecialtyId"}},_vm._l((_vm.specialtyList),function(item){return _c('el-option',{key:item.id,attrs:{"label":item.name,"value":item.id}})}),1)],1)],1)],1)],1),_c('div',{staticClass:"px-20px"},[_c('el-form',{directives:[{name:"loading",rawName:"v-loading",value:(_vm.formLoading),expression:"formLoading"}],ref:"apiForm",attrs:{"disabled":['read', 'approve'].includes(_vm.operateApiProps.editType),"size":"mini","label-width":"80px","rules":_vm.apiRules,"model":_vm.apiForm,"label-position":"left"}},_vm._l((_vm.sortAptitudeList),function(typeItems,index){return _c('div',{key:index},[_c('div',{staticClass:"flex items-center ml-10px mb-5px"},[_c('span',{staticClass:"border-l-3 border-color-primary pl-10px text-18px"},[_vm._v(_vm._s(typeItems.directoryName))])]),_c('el-row',{staticClass:"px-20px flex flex-wrap"},_vm._l((typeItems.child),function(item,ind){return _c('el-col',{key:ind,staticClass:" pr-20px mb-20px ",attrs:{"span":8}},[_c('div',{staticClass:"mb-10px"},[_c('span',{directives:[{name:"show",rawName:"v-show",value:(!!item.isRequired),expression:"!!item.isRequired"}],staticClass:"text-red-600"},[_vm._v("*")]),_vm._v(_vm._s(((ind + 1) + "." + (item.title)))+"\n                ")]),_c('div',{staticClass:"mb-10px"},[_vm._v(_vm._s(item.titleContent))]),_c('el-form-item',{attrs:{"label":"是否提供","prop":item.configurationId}},[_c('el-radio-group',{on:{"input":function (e) { return _vm.handleIsSupply(e, item); }},model:{value:(_vm.apiForm[item.configurationId]),callback:function ($$v) {_vm.$set(_vm.apiForm, item.configurationId, $$v)},expression:"apiForm[item.configurationId]"}},[_c('el-radio',{attrs:{"label":true}},[_vm._v("是")]),_c('el-radio',{attrs:{"label":false}},[_vm._v("否")])],1)],1),(_vm.apiForm[item.configurationId])?_c('el-form-item',{ref:("" + (item.id)),refInFor:true,class:{
                    'flex flex-col':
                      !['read', 'approve', 'edit', 'create'].includes(_vm.operateApiProps.editType) &&
                      _vm.apiForm[("" + (item.id))],
                  },attrs:{"label-width":"80px","label":"文件上传","prop":("" + (item.id))}},[_c('FormUpload',{attrs:{"disabled":['read', 'approve'].includes(_vm.operateApiProps.editType),"accept":['pdf', 'jpg', 'png', 'zip']},on:{"change":function($event){return _vm.fileIdChange(("" + (item.id)))}},model:{value:(_vm.apiForm[("" + (item.id))]),callback:function ($$v) {_vm.$set(_vm.apiForm, ("" + (item.id)), $$v)},expression:"apiForm[`${item.id}`]"}})],1):_vm._e(),(!_vm.apiForm[item.configurationId])?_c('el-form-item',{attrs:{"prop":((item.configurationId) + "explain"),"label":"说明","rules":[{ required: true, message: '说明不能为空', trigger: 'blur' }]}},[_c('el-input',{attrs:{"show-word-limit":"","maxlength":"50","placeholder":"请输入说明"},model:{value:(_vm.apiForm[((item.configurationId) + "explain")]),callback:function ($$v) {_vm.$set(_vm.apiForm, ((item.configurationId) + "explain"), $$v)},expression:"apiForm[`${item.configurationId}explain`]"}})],1):_vm._e(),_c('el-form-item',{attrs:{"label":"资质类别","prop":((item.configurationId) + "directoryId")}},[_c('el-select',{staticClass:"w-full",attrs:{"size":"small","filterable":"","clearable":"","placeholder":"请选择资质类别"},model:{value:(_vm.apiForm[((item.configurationId) + "directoryId")]),callback:function ($$v) {_vm.$set(_vm.apiForm, ((item.configurationId) + "directoryId"), $$v)},expression:"apiForm[`${item.configurationId}directoryId`]"}},_vm._l((_vm.workPermitCategoryList),function(typeItem){return _c('el-option',{key:Number(typeItem.code),attrs:{"label":typeItem.displayName,"value":Number(typeItem.code)}})}),1)],1),_c('el-form-item',{attrs:{"label":"有效期","prop":((item.configurationId) + "date")}},[_c('el-date-picker',{staticClass:"!w-full",attrs:{"type":"daterange","size":"small","range-separator":"-","start-placeholder":"开始时间","end-placeholder":"结束时间","value-format":"yyyy-MM-dd"},model:{value:(_vm.apiForm[((item.configurationId) + "date")]),callback:function ($$v) {_vm.$set(_vm.apiForm, ((item.configurationId) + "date"), $$v)},expression:"apiForm[`${item.configurationId}date`]"}})],1),_c('el-form-item',{attrs:{"label":"证书编号","prop":((item.configurationId) + "number")}},[_c('el-input',{attrs:{"size":"small","placeholder":"请输入证书编号","clearable":""},model:{value:(_vm.apiForm[((item.configurationId) + "number")]),callback:function ($$v) {_vm.$set(_vm.apiForm, ((item.configurationId) + "number"), $$v)},expression:"apiForm[`${item.configurationId}number`]"}})],1)],1)}),1)],1)}),0)],1)],1),(_vm.operateApiProps.editType !== 'read')?_c('div',{staticClass:"flex justify-center mt-20px"},[(_vm.operateApiProps.editType === 'edit' || _vm.operateApiProps.editType === 'create')?_c('el-button',{attrs:{"size":"small","type":"primary"},on:{"click":function($event){return _vm.save()}}},[_vm._v("保存")]):_vm._e(),(_vm.operateApiProps.editType === 'approve')?_c('el-button',{attrs:{"type":"primary","size":"small"},on:{"click":_vm.openApproveDailog}},[_vm._v("审批")]):_vm._e(),_c('el-button',{staticClass:"iconfont icon-close",attrs:{"size":"small"},on:{"click":_vm.cancel}},[_vm._v("取消")])],1):_vm._e(),(!(_vm.operateApiProps.editType === 'read'))?_c('div',{staticClass:"dialog-footer flex justify-center items-center",attrs:{"slot":"footer"},slot:"footer"}):_vm._e()]),(_vm.visible)?_c('el-dialog',{directives:[{name:"dialogDrag",rawName:"v-dialogDrag"}],staticClass:"small-dialog",attrs:{"close-on-click-modal":false,"title":"审批","visible":_vm.visible,"append-to-body":""},on:{"update:visible":function($event){_vm.visible=$event}}},[_c('el-form',{ref:"checkResultForm",attrs:{"label-width":"150px","model":_vm.checkResultForm}},[_c('el-form-item',{attrs:{"label":"审批结果","prop":"isPass","rules":[{ required: true, message: '请选择审批结果', trigger: 'blur' }]}},[_c('el-radio-group',{model:{value:(_vm.checkResultForm.isPass),callback:function ($$v) {_vm.$set(_vm.checkResultForm, "isPass", $$v)},expression:"checkResultForm.isPass"}},[_c('el-radio',{attrs:{"label":true}},[_vm._v("审批通过")]),_c('el-radio',{attrs:{"label":false}},[_vm._v("不通过")])],1)],1),_c('el-form-item',{attrs:{"label":"审批意见","prop":"approve","rules":[{ required: true, message: '请输入审批意见', trigger: 'blur' }]}},[_c('el-input',{attrs:{"type":"textarea","rows":4,"maxlength":"500","show-word-limit":""},model:{value:(_vm.checkResultForm.approve),callback:function ($$v) {_vm.$set(_vm.checkResultForm, "approve", $$v)},expression:"checkResultForm.approve"}})],1)],1),_c('div',{staticClass:"flex justify-center",attrs:{"slot":"footer"},slot:"footer"},[_c('el-button',{attrs:{"size":"small","type":"primary","loading":_vm.cardLoading},on:{"click":_vm.handleSaveResult}},[_vm._v("保存")]),_c('el-button',{attrs:{"size":"small"},on:{"click":_vm.cancelResult}},[_vm._v("取消")])],1)],1):_vm._e(),(_vm.approvalFlowDialog)?_c('ApprovalFlowDialog',{attrs:{"visible":_vm.approvalFlowDialog,"id":_vm.flowTaskId},on:{"update:visible":function($event){_vm.approvalFlowDialog=$event},"cancel":function($event){_vm.approvalFlowDialog = false}}}):_vm._e()],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./src/modules/contractor-management-sm/components/OperateApiDialog.vue?vue&type=template&id=a728b18a&scoped=true

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/regenerator.js + 1 modules
var regenerator = __webpack_require__("c14f");

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

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

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

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.js
var es_symbol = __webpack_require__("a4d3");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.description.js
var es_symbol_description = __webpack_require__("e01a");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.find.js
var es_array_find = __webpack_require__("7db0");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.iterator.js
var es_array_iterator = __webpack_require__("e260");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.map.js
var es_array_map = __webpack_require__("d81d");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
var es_array_push = __webpack_require__("14d9");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.constructor.js
var es_iterator_constructor = __webpack_require__("e9f5");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.find.js
var es_iterator_find = __webpack_require__("f665");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.for-each.js
var es_iterator_for_each = __webpack_require__("7d54");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.map.js
var es_iterator_map = __webpack_require__("ab43");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.reduce.js
var es_iterator_reduce = __webpack_require__("9485");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.constructor.js
var es_number_constructor = __webpack_require__("a9e3");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
var es_object_to_string = __webpack_require__("d3b7");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.js
var es_promise = __webpack_require__("e6cf");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.iterator.js
var es_string_iterator = __webpack_require__("3ca3");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.for-each.js
var web_dom_collections_for_each = __webpack_require__("159b");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.iterator.js
var web_dom_collections_iterator = __webpack_require__("ddb0");

// EXTERNAL MODULE: ./src/components/safety/enumField/utils.js
var utils = __webpack_require__("2ab8");

// EXTERNAL MODULE: ./node_modules/@wiz-api/contractor-management/lib/contractor-management.umd.js
var contractor_management_umd = __webpack_require__("77b0");

// EXTERNAL MODULE: ./node_modules/@wiz-api/team-management/lib/team-management.umd.js
var team_management_umd = __webpack_require__("88c7");

// EXTERNAL MODULE: ./node_modules/dayjs/dayjs.min.js
var dayjs_min = __webpack_require__("5a0c");
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);

// EXTERNAL MODULE: ./src/components/safety/ApprovalFlow/ApprovalFlowDialog.vue + 4 modules
var ApprovalFlowDialog = __webpack_require__("dfed");

// 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/contractor-management-sm/components/OperateApiDialog.vue?vue&type=script&lang=js





















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






var contractorApi = new contractor_management_umd["ContractorApi"]();
var workPermitApi = new contractor_management_umd["WorkPermitApi"]();
var workPermitGuidanceFileApi = new contractor_management_umd["WorkPermitGuidanceFileApi"]();
var workPermitGuidanceConfigurationDirectoryApi = new contractor_management_umd["WorkPermitGuidanceConfigurationDirectoryApi"]();
var profileTemplateGuidanceConfigurationApi = new contractor_management_umd["ProfileTemplateGuidanceConfigurationApi"]();
var specialtyApi = new team_management_umd["SpecialtyApi"]();
var FormUpload = function FormUpload() {
  return Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(2), __webpack_require__.e(35)]).then(__webpack_require__.bind(null, "324b"));
};
/* harmony default export */ var OperateApiDialogvue_type_script_lang_js = ({
  name: 'operate-api-dialog',
  props: {
    FormData: {
      type: Object,
      default: function _default() {}
    },
    operateApiProps: {
      type: Object,
      default: function _default() {
        return {
          title: '新增api',
          editType: 'create',
          visible: false
        };
      }
    },
    templateId: {
      default: null
    },
    permitsId: {
      default: null
    },
    contractorId: {
      default: null
    },
    flowTaskId: {
      type: [String, Number],
      default: null
    }
  },
  components: {
    FormUpload: FormUpload,
    ApprovalFlowDialog: ApprovalFlowDialog["default"]
  },
  watch: {
    // visible(val) {
    //   if (!val) {
    //     this.$emit('cancel')
    //   }
    // },
    contractorId: {
      handler: function handler(val) {
        this.getContractorInfo();
      },
      immediate: true
    },
    apiForm: {
      deep: true,
      handler: function handler(val) {},
      immediate: true
    }
  },
  data: function data() {
    return {
      workPermitCategoryList: [],
      specialtyList: [],
      approvalFlowDialog: false,
      checkResultForm: {
        isPass: true,
        approve: ''
      },
      visible: false,
      cardLoading: false,
      aptitudeList: [],
      apiForm: {},
      formLoading: false,
      parentApiForm: {},
      parentFormLoading: false,
      claimTypes: [],
      // 声明集
      initClaimTypes: [],
      parentApiRules: {},
      fileDtoMap: {}
    };
  },
  computed: {
    apiRules: function apiRules() {
      var strList = ['orgName', 'orgShortName', 'orgLeader', 'email', 'phoneNumber'];
      var formRules = strList.reduce(function (pre, item) {
        pre[item] = [{
          required: true,
          message: '请输入',
          trigger: ['blur', 'change']
        }];
        return pre;
      }, {});
      return Object(objectSpread2["a" /* default */])({}, this.aptitudeList.reduce(function (pre, item) {
        pre[item.filed] = [{
          required: !!item.a4,
          message: '请输入名称',
          trigger: 'blur'
        }];
        return pre;
      }, {
        name: [{
          required: true,
          message: '请输入名称',
          trigger: 'blur'
        }]
      }));
    },
    sortAptitudeList: function sortAptitudeList() {
      var list = this.aptitudeList.reduce(function (pre, item) {
        var child = pre.find(function (i) {
          return i.directoryName === item.directoryName;
        });
        if (!child || child === -1) {
          pre.push({
            id: item.id,
            configurationDirectoryId: item.directoryId || item.configurationDirectoryId,
            directoryName: item.directoryName,
            child: [item]
          });
        } else {
          child.child.push(item);
        }
        return pre;
      }, []);
      return list;
    }
  },
  methods: {
    viewFlow: function viewFlow() {
      if (window.__POWERED_BY_QIANKUN__) {
        window.wiz.OpenWorkFlowDesignByFlowId(this.flowTaskId);
      } else {
        this.approvalFlowDialog = true;
      }
    },
    getSpecialtyList: function getSpecialtyList() {
      var _this = this;
      return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regenerator["a" /* default */])().m(function _callee() {
        var _yield$specialtyApi$g, _yield$specialtyApi$g2, err, res;
        return Object(regenerator["a" /* default */])().w(function (_context) {
          while (1) switch (_context.n) {
            case 0:
              _context.n = 1;
              return specialtyApi.getSpecialtyDropDown();
            case 1:
              _yield$specialtyApi$g = _context.v;
              _yield$specialtyApi$g2 = Object(slicedToArray["a" /* default */])(_yield$specialtyApi$g, 2);
              err = _yield$specialtyApi$g2[0];
              res = _yield$specialtyApi$g2[1];
              if (!err) {
                _this.specialtyList = res;
                _this.specialtyList.unshift({
                  id: '00000000-0000-0000-0000-000000000000',
                  name: '无专业'
                });
              }
            case 2:
              return _context.a(2);
          }
        }, _callee);
      }))();
    },
    // 打开审批
    openApproveDailog: function openApproveDailog() {
      this.checkResultForm = this.$options.data().checkResultForm;
      this.visible = true;
    },
    // 取消审批
    cancelResult: function cancelResult() {
      this.visible = false;
    },
    // 审批
    handleSaveResult: function handleSaveResult() {
      var _this2 = this;
      this.$refs.checkResultForm.validate(/*#__PURE__*/function () {
        var _ref = Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regenerator["a" /* default */])().m(function _callee2(valid) {
          var _yield$workPermitApi$, _yield$workPermitApi$2, err, res;
          return Object(regenerator["a" /* default */])().w(function (_context2) {
            while (1) switch (_context2.n) {
              case 0:
                if (!valid) {
                  _context2.n = 2;
                  break;
                }
                _this2.cardLoading = true;
                _context2.n = 1;
                return workPermitApi.approve({
                  body: Object(objectSpread2["a" /* default */])({
                    id: _this2.permitsId,
                    taskId: _this2.FormData.taskId
                  }, _this2.checkResultForm)
                });
              case 1:
                _yield$workPermitApi$ = _context2.v;
                _yield$workPermitApi$2 = Object(slicedToArray["a" /* default */])(_yield$workPermitApi$, 2);
                err = _yield$workPermitApi$2[0];
                res = _yield$workPermitApi$2[1];
                if (!err) {
                  _this2.$message({
                    showClose: true,
                    message: '审批成功',
                    type: 'success'
                  });
                  _this2.visible = false;
                  _this2.$emit('refreshList');
                }
                _this2.cardLoading = true;
              case 2:
                return _context2.a(2);
            }
          }, _callee2);
        }));
        return function (_x) {
          return _ref.apply(this, arguments);
        };
      }());
    },
    fileIdChange: function fileIdChange(key) {
      this.$refs[key][0].$emit('el.form.change');
    },
    ridioInput: function ridioInput(value, configurationId) {
      if (value) {
        this.apiForm["".concat(configurationId, "explain")] = '';
      }
    },
    cancel: function cancel() {
      this.$emit('cancel');
      // this.operateApiProps.visible = false
    },
    save: function save() {
      var _this3 = this;
      return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regenerator["a" /* default */])().m(function _callee4() {
        return Object(regenerator["a" /* default */])().w(function (_context4) {
          while (1) switch (_context4.n) {
            case 0:
              _this3.$refs.apiForm.validate(/*#__PURE__*/function () {
                var _ref2 = Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regenerator["a" /* default */])().m(function _callee3(valid) {
                  var _yield$workPermitApi$3, _yield$workPermitApi$4, _err, _res, _yield$workPermitGuid, _yield$workPermitGuid2, errList, resList, _yield$workPermitGuid3, _yield$workPermitGuid4, err, res;
                  return Object(regenerator["a" /* default */])().w(function (_context3) {
                    while (1) switch (_context3.n) {
                      case 0:
                        if (!valid) {
                          _context3.n = 6;
                          break;
                        }
                        if (!(_this3.operateApiProps.editType === 'create')) {
                          _context3.n = 4;
                          break;
                        }
                        _context3.n = 1;
                        return workPermitApi.create({
                          body: {
                            contractorId: _this3.contractorId,
                            applyTime: dayjs_min_default()().format('YYYY-MM-DD HH:mm:ss')
                          }
                        });
                      case 1:
                        _yield$workPermitApi$3 = _context3.v;
                        _yield$workPermitApi$4 = Object(slicedToArray["a" /* default */])(_yield$workPermitApi$3, 2);
                        _err = _yield$workPermitApi$4[0];
                        _res = _yield$workPermitApi$4[1];
                        if (_err) {
                          _context3.n = 3;
                          break;
                        }
                        _context3.n = 2;
                        return workPermitGuidanceConfigurationDirectoryApi.insertMany({
                          body: _this3.dealForm(_res.id)
                        });
                      case 2:
                        _yield$workPermitGuid = _context3.v;
                        _yield$workPermitGuid2 = Object(slicedToArray["a" /* default */])(_yield$workPermitGuid, 2);
                        errList = _yield$workPermitGuid2[0];
                        resList = _yield$workPermitGuid2[1];
                        if (!errList) {
                          _this3.$message.success({
                            showClose: true,
                            message: '新增成功'
                          });
                          _this3.operateApiProps.visible = false;
                          _this3.$emit('refreshList');
                        }
                      case 3:
                        return _context3.a(2);
                      case 4:
                        _context3.n = 5;
                        return workPermitGuidanceConfigurationDirectoryApi.updateMany({
                          body: _this3.dealForm()
                        });
                      case 5:
                        _yield$workPermitGuid3 = _context3.v;
                        _yield$workPermitGuid4 = Object(slicedToArray["a" /* default */])(_yield$workPermitGuid3, 2);
                        err = _yield$workPermitGuid4[0];
                        res = _yield$workPermitGuid4[1];
                        if (!err) {
                          _this3.$message.success({
                            showClose: true,
                            message: '修改成功'
                          });
                          _this3.operateApiProps.visible = false;
                          _this3.$emit('refreshList');
                        }
                      case 6:
                        return _context3.a(2);
                    }
                  }, _callee3);
                }));
                return function (_x2) {
                  return _ref2.apply(this, arguments);
                };
              }());
            case 1:
              return _context4.a(2);
          }
        }, _callee4);
      }))();
    },
    dealForm: function dealForm(id) {
      var _this4 = this;
      return this.aptitudeList.map(function (item) {
        // const contractorId = id  // 承包商id

        var configurationDirectoryId = item.directoryId; // 目录id
        var isProvided = _this4.apiForm[item.configurationId];
        var description = _this4.apiForm["".concat(item.configurationId, "explain")];
        var workPermitId = id || _this4.permitsId; // 承包商许可id
        return Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({
          workPermitId: workPermitId,
          configurationDirectoryId: configurationDirectoryId
        }, item), {}, {
          categoryCode: _this4.apiForm["".concat(item.configurationId, "directoryId")] || 0,
          description: description,
          isProvided: isProvided,
          fileId: _this4.apiForm[item.id] === '' ? null : _this4.apiForm[item.id],
          number: _this4.apiForm["".concat(item.configurationId, "number")],
          validDateBegin: _this4.apiForm["".concat(item.configurationId, "date")] && _this4.apiForm["".concat(item.configurationId, "date")].length && dayjs_min_default()(_this4.apiForm["".concat(item.configurationId, "date")][0]).format('YYYY-MM-DD HH:mm:ss') || null,
          validDateEnd: _this4.apiForm["".concat(item.configurationId, "date")] && _this4.apiForm["".concat(item.configurationId, "date")].length && dayjs_min_default()(_this4.apiForm["".concat(item.configurationId, "date")][1]).format('YYYY-MM-DD HH:mm:ss') || null
        });
      });
    },
    handleIsSupply: function handleIsSupply(e, item) {
      // this.ridioInput(e, `${item.configurationId}`)
      if (e) {
        this.apiForm["".concat(item.configurationId, "explain")] = '';
      } else {
        this.apiForm["".concat(item.id)] = '';
      }
      this.$refs.apiForm.clearValidate(["".concat(item.configurationId, "explain")]);
      this.$refs.apiForm.clearValidate(["".concat(item.id)]);
    },
    setValue: function setValue(result) {
      var _this5 = this;
      var form = {};
      result.forEach(function (item) {
        // 新增默认所有都有
        form[item.configurationId] = _this5.operateApiProps.editType === 'create' ? true : !!item.isProvided;
        form["".concat(item.configurationId, "explain")] = item.description;
        form["".concat(item.configurationId, "number")] = item._number;
        form["".concat(item.configurationId, "directoryId")] = item.categoryCode === 0 ? '' : item.categoryCode;
        form["".concat(item.configurationId, "date")] = item.validDateBegin ? [dayjs_min_default()(item.validDateBegin).format('YYYY-MM-DD'), dayjs_min_default()(item.validDateEnd).format('YYYY-MM-DD')] : [];
        form[item.id] = item.fileId;
      });
      this.apiForm = form;
    },
    getFilesInfo: function getFilesInfo() {
      var _this6 = this;
      return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regenerator["a" /* default */])().m(function _callee5() {
        var _yield$workPermitGuid5, _yield$workPermitGuid6, err, res, form;
        return Object(regenerator["a" /* default */])().w(function (_context5) {
          while (1) switch (_context5.n) {
            case 0:
              _context5.n = 1;
              return workPermitGuidanceFileApi.getWorkPermitGuidanceFileDto({
                workPermitId: _this6.permitsId
              });
            case 1:
              _yield$workPermitGuid5 = _context5.v;
              _yield$workPermitGuid6 = Object(slicedToArray["a" /* default */])(_yield$workPermitGuid5, 2);
              err = _yield$workPermitGuid6[0];
              res = _yield$workPermitGuid6[1];
              form = {};
              if (!err) {
                _this6.fileDtoMap = res.reduce(function (pre, item) {
                  pre[item.configurationDirectoryId] = item;
                  return pre;
                }, {});
                res.forEach(function (item) {
                  if (item.fileId) {
                    form[item.configurationDirectoryId] = item.fileId;
                  }
                });
              }
              _this6.apiForm = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, _this6.apiForm), form);
            case 2:
              return _context5.a(2);
          }
        }, _callee5);
      }))();
    },
    getConfig: function getConfig() {
      var _this7 = this;
      return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regenerator["a" /* default */])().m(function _callee6() {
        var result, _yield$profileTemplat, _yield$profileTemplat2, err, res, _yield$workPermitGuid7, _yield$workPermitGuid8, _err2, _res2;
        return Object(regenerator["a" /* default */])().w(function (_context6) {
          while (1) switch (_context6.n) {
            case 0:
              if (!(_this7.operateApiProps.editType === 'create')) {
                _context6.n = 2;
                break;
              }
              _context6.n = 1;
              return profileTemplateGuidanceConfigurationApi.profileTemplateGuidanceConfigurationList({
                templateId: _this7.templateId
              });
            case 1:
              _yield$profileTemplat = _context6.v;
              _yield$profileTemplat2 = Object(slicedToArray["a" /* default */])(_yield$profileTemplat, 2);
              err = _yield$profileTemplat2[0];
              res = _yield$profileTemplat2[1];
              result = res;
              _context6.n = 4;
              break;
            case 2:
              _context6.n = 3;
              return workPermitGuidanceConfigurationDirectoryApi.profileWorkPermitGuidanceConfigurationDirectory({
                workPermitId: _this7.permitsId
              });
            case 3:
              _yield$workPermitGuid7 = _context6.v;
              _yield$workPermitGuid8 = Object(slicedToArray["a" /* default */])(_yield$workPermitGuid7, 2);
              _err2 = _yield$workPermitGuid8[0];
              _res2 = _yield$workPermitGuid8[1];
              result = _res2;
              // const hasFileId = _.filter(res, (item) => {
              //   return item.fileId
              // })
              // const hasNullFileId = _.filter(res, (item) => {
              //   return !item.fileId
              // })
              // result = [...hasFileId, ...hasNullFileId]
            case 4:
              _this7.setValue(result);
              _this7.aptitudeList = result;
              _this7.getFilesInfo();
            case 5:
              return _context6.a(2);
          }
        }, _callee6);
      }))();
    },
    getContractorInfo: function getContractorInfo() {
      var _this8 = this;
      return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regenerator["a" /* default */])().m(function _callee7() {
        var _yield$contractorApi$, _yield$contractorApi$2, err, res;
        return Object(regenerator["a" /* default */])().w(function (_context7) {
          while (1) switch (_context7.n) {
            case 0:
              if (_this8.contractorId) {
                _context7.n = 1;
                break;
              }
              return _context7.a(2);
            case 1:
              _this8.parentFormLoading = true;
              _context7.n = 2;
              return contractorApi.get(_this8.contractorId);
            case 2:
              _yield$contractorApi$ = _context7.v;
              _yield$contractorApi$2 = Object(slicedToArray["a" /* default */])(_yield$contractorApi$, 2);
              err = _yield$contractorApi$2[0];
              res = _yield$contractorApi$2[1];
              _this8.parentFormLoading = false;
              _this8.parentApiForm = res;
            case 3:
              return _context7.a(2);
          }
        }, _callee7);
      }))();
    }
  },
  created: function created() {
    var _this9 = this;
    return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regenerator["a" /* default */])().m(function _callee8() {
      return Object(regenerator["a" /* default */])().w(function (_context8) {
        while (1) switch (_context8.n) {
          case 0:
            _context8.n = 1;
            return utils["a" /* default */].getDataCategory(['ContractorManagement.DataCategory.WorkPermitCategory'], ['workPermitCategoryList'], _this9);
          case 1:
            _this9.getConfig();
            _this9.getSpecialtyList();
          case 2:
            return _context8.a(2);
        }
      }, _callee8);
    }))();
  }
});
// CONCATENATED MODULE: ./src/modules/contractor-management-sm/components/OperateApiDialog.vue?vue&type=script&lang=js
 /* harmony default export */ var components_OperateApiDialogvue_type_script_lang_js = (OperateApiDialogvue_type_script_lang_js); 
// EXTERNAL MODULE: ./src/modules/contractor-management-sm/components/OperateApiDialog.vue?vue&type=style&index=0&id=a728b18a&prod&scoped=true&lang=scss
var OperateApiDialogvue_type_style_index_0_id_a728b18a_prod_scoped_true_lang_scss = __webpack_require__("a339");

// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("2877");

// CONCATENATED MODULE: ./src/modules/contractor-management-sm/components/OperateApiDialog.vue






/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  components_OperateApiDialogvue_type_script_lang_js,
  render,
  staticRenderFns,
  false,
  null,
  "a728b18a",
  null
  
)

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

/***/ }),

/***/ "926e":
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__("2350")(false);
// imports


// module
exports.push([module.i, "[data-v-a728b18a] .el-card__body{height:100%}", ""]);

// exports


/***/ }),

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

"use strict";
/* harmony import */ var _node_modules_windicss_webpack_plugin_dist_loaders_windicss_style_pitcher_cjs_node_modules_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_windicss_webpack_plugin_dist_loaders_windicss_template_cjs_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_OperateApiDialog_vue_vue_type_style_index_0_id_a728b18a_prod_scoped_true_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("81ba");
/* harmony import */ var _node_modules_windicss_webpack_plugin_dist_loaders_windicss_style_pitcher_cjs_node_modules_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_windicss_webpack_plugin_dist_loaders_windicss_template_cjs_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_OperateApiDialog_vue_vue_type_style_index_0_id_a728b18a_prod_scoped_true_lang_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_windicss_webpack_plugin_dist_loaders_windicss_style_pitcher_cjs_node_modules_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_windicss_webpack_plugin_dist_loaders_windicss_template_cjs_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_OperateApiDialog_vue_vue_type_style_index_0_id_a728b18a_prod_scoped_true_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
/* unused harmony reexport * */


/***/ })

}]);
//# sourceMappingURL=contractor-management-sm.umd.9.js.map