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

/***/ "5d16":
/***/ (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__("7c05");
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("60dc7f44", content, true, {"sourceMap":false,"shadowMode":false});

/***/ }),

/***/ "7c05":
/***/ (function(module, exports, __webpack_require__) {

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


// module
exports.push([module.i, "[data-v-26e5f136] .el-card__body{height:100%}.bg_custom[data-v-26e5f136]{background:rgba(237,240,249,.5)}.img_dialog[data-v-26e5f136]  .el-dialog__body{padding-top:0}.required-text--color[data-v-26e5f136]{color:#ff3a30}.down-file--color[data-v-26e5f136]{color:#acdbff}", ""]);

// exports


/***/ }),

/***/ "88e7":
/***/ (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_ContractorStartGuidelines_vue_vue_type_style_index_0_id_26e5f136_prod_scoped_true_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("5d16");
/* 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_ContractorStartGuidelines_vue_vue_type_style_index_0_id_26e5f136_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_ContractorStartGuidelines_vue_vue_type_style_index_0_id_26e5f136_prod_scoped_true_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
/* unused harmony reexport * */


/***/ }),

/***/ "a454":
/***/ (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/views/ContractorStartGuidelines.vue?vue&type=template&id=26e5f136&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 relative"},[_c('div',{staticClass:"h-full"},[_c('div',{staticClass:"h-full flex flex-col"},[_c('div',{staticClass:"flex-1 overflow-y-auto bg_custom"},_vm._l((_vm.sortAptitudeList),function(typeItem,index){return _c('div',{key:index,staticClass:"overflow-hidden"},[_c('h3',{staticClass:"text-center my-15px font-bold"},[_vm._v(_vm._s(typeItem.directoryName))]),_vm._l((typeItem.child),function(item,ind){return _c('div',{key:ind,staticClass:"flex mb-10px rounded bg-color-main m-15px p-10px"},[_c('div',{staticClass:"flex-1"},[_c('h5',{staticClass:"font-bold text-15px mb-5px"},[_c('span',{directives:[{name:"show",rawName:"v-show",value:(!!item.isProvided),expression:"!!item.isProvided"}],staticClass:"required-text--color"},[_vm._v("*")]),_vm._v(_vm._s(((ind + 1) + "." + (item.title)))+"\n              ")]),_c('div',{staticClass:"text-14px text-warmGray-400"},[_vm._v(_vm._s(item.titleContent))])]),_c('span',{staticClass:"down-file--color mr-15px ml-30px text-right mr-20px cursor-pointer",on:{"click":function($event){return _vm.viewFile(item)}}},[_vm._v("\n              查看示例\n            ")]),_c('span',{staticClass:"down-file--color text-right mr-20px cursor-pointer",on:{"click":function($event){return _vm.downLoadFile(item)}}},[_vm._v("\n              下载示例\n            ")])])})],2)}),0),_c('div',{staticClass:"pt-18px pb-60px font-bold text-14px text-justify"},[_vm._v("\n        为了方便资料收集，您可以点击"),_c('span',{staticClass:"text-color-primary"},[_vm._v("下载人员入厂申报指引模板")]),_vm._v("收集数据，若您收集完用户数据后请按照以下要求导入模板数据，具体要求如下：将"),_c('span',{staticClass:"text-color-primary"},[_vm._v("人员入厂指引模板")]),_vm._v("文件放到PDF中，在【人员入厂申报】模块中进行导入。\n      ")]),_c('div',{staticClass:"text-center"},[_c('el-button',{attrs:{"size":"small","type":"primary"},on:{"click":function($event){return _vm.createApi()}}},[_vm._v("已准备好")]),_c('el-button',{attrs:{"size":"small"},on:{"click":_vm.refreshList}},[_vm._v("返回准备")])],1)]),(_vm.showOperateApiDialog)?_c('operate-api-dialog',{ref:"operateApiDialog",attrs:{"contractorId":_vm.contractorId,"templateId":_vm.templateId,"operateApiProps":_vm.operateApiProps},on:{"refreshList":_vm.refreshList,"cancel":function($event){_vm.showOperateApiDialog = false}}}):_vm._e(),_c('el-dialog',{staticClass:"img_dialog",attrs:{"visible":_vm.dialogVisible,"append-to-body":""},on:{"update:visible":function($event){_vm.dialogVisible=$event}}},[_c('img',{staticClass:"w-full",attrs:{"src":_vm.imgContent,"alt":""}})])],1)])}
var staticRenderFns = []


// CONCATENATED MODULE: ./src/modules/contractor-management-sm/views/ContractorStartGuidelines.vue?vue&type=template&id=26e5f136&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/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.push.js
var es_array_push = __webpack_require__("14d9");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js
var es_function_name = __webpack_require__("b0c0");

// 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.reduce.js
var es_iterator_reduce = __webpack_require__("9485");

// 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.iterator.js
var web_dom_collections_iterator = __webpack_require__("ddb0");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url.js
var web_url = __webpack_require__("2b3d");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url.to-json.js
var web_url_to_json = __webpack_require__("bf19");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.js
var web_url_search_params = __webpack_require__("9861");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.delete.js
var web_url_search_params_delete = __webpack_require__("88a7");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.has.js
var web_url_search_params_has = __webpack_require__("271a");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.size.js
var web_url_search_params_size = __webpack_require__("5494");

// 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/file-management/lib/file-management.umd.js
var file_management_umd = __webpack_require__("3c33");

// 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/views/ContractorStartGuidelines.vue?vue&type=script&lang=js




















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



var fileApi = new file_management_umd["FileApi"]();
var workPermitApi = new contractor_management_umd["WorkPermitApi"]();
var profileTemplateGuidanceConfigurationApi = new contractor_management_umd["ProfileTemplateGuidanceConfigurationApi"]();
var OperateApiDialog = function OperateApiDialog() {
  return Promise.all(/* import() */[__webpack_require__.e(6), __webpack_require__.e(9)]).then(__webpack_require__.bind(null, "8c63"));
};
/* harmony default export */ var ContractorStartGuidelinesvue_type_script_lang_js = ({
  name: 'contractor-start-guidelines',
  components: {
    OperateApiDialog: OperateApiDialog
  },
  props: ['contractorId', 'profileTemplateId'],
  data: function data() {
    return {
      permitsId: '',
      showOperateApiDialog: false,
      operateApiProps: {
        title: '开工许可申请',
        editType: 'create',
        visible: true
      },
      aptitudeList: [],
      // 图片预览信息
      imgContent: null,
      // 预览弹窗
      dialogVisible: false
    };
  },
  computed: {
    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({
            directoryName: item.directoryName,
            child: [item]
          });
        } else {
          child.child.push(item);
        }
        return pre;
      }, []);
      return list;
    }
  },
  methods: {
    // 附件，下载
    downLoadFile: function downLoadFile(file) {
      var _this = this;
      return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regenerator["a" /* default */])().m(function _callee() {
        var _yield$fileApi$get, _yield$fileApi$get2, errFile, resFile, _yield$fileApi$downlo, _yield$fileApi$downlo2, err, res;
        return Object(regenerator["a" /* default */])().w(function (_context) {
          while (1) switch (_context.n) {
            case 0:
              _context.n = 1;
              return fileApi.get(file.fileId);
            case 1:
              _yield$fileApi$get = _context.v;
              _yield$fileApi$get2 = Object(slicedToArray["a" /* default */])(_yield$fileApi$get, 2);
              errFile = _yield$fileApi$get2[0];
              resFile = _yield$fileApi$get2[1];
              if (errFile) {
                _context.n = 3;
                break;
              }
              _context.n = 2;
              return fileApi.download(file.fileId, {
                returnType: 'Blob'
              });
            case 2:
              _yield$fileApi$downlo = _context.v;
              _yield$fileApi$downlo2 = Object(slicedToArray["a" /* default */])(_yield$fileApi$downlo, 2);
              err = _yield$fileApi$downlo2[0];
              res = _yield$fileApi$downlo2[1];
              if (!err) {
                _this.exportFile(res, resFile.name);
              }
            case 3:
              return _context.a(2);
          }
        }, _callee);
      }))();
    },
    viewFile: function viewFile(file) {
      var _this2 = this;
      return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regenerator["a" /* default */])().m(function _callee2() {
        var _yield$fileApi$get3, _yield$fileApi$get4, errFile, resFile, _yield$fileApi$downlo3, _yield$fileApi$downlo4, err, res, strList, type, typeMap, imageList, _yield$fileApi$getFil, _yield$fileApi$getFil2, error, result, blob, blobUrl, templink;
        return Object(regenerator["a" /* default */])().w(function (_context2) {
          while (1) switch (_context2.n) {
            case 0:
              _context2.n = 1;
              return fileApi.get(file.fileId);
            case 1:
              _yield$fileApi$get3 = _context2.v;
              _yield$fileApi$get4 = Object(slicedToArray["a" /* default */])(_yield$fileApi$get3, 2);
              errFile = _yield$fileApi$get4[0];
              resFile = _yield$fileApi$get4[1];
              if (errFile) {
                _context2.n = 6;
                break;
              }
              _context2.n = 2;
              return fileApi.download(file.fileId, {
                returnType: 'Blob'
              });
            case 2:
              _yield$fileApi$downlo3 = _context2.v;
              _yield$fileApi$downlo4 = Object(slicedToArray["a" /* default */])(_yield$fileApi$downlo3, 2);
              err = _yield$fileApi$downlo4[0];
              res = _yield$fileApi$downlo4[1];
              strList = resFile.name.split('.');
              type = strList[strList.length - 1].toLowerCase();
              typeMap = {
                pdf: 'application/pdf'
              };
              imageList = ['jpg', 'png', 'jpg', 'jpeg', 'gif', 'psd', 'bmp', 'tiff'];
              if (!(!typeMap[type] && !(imageList.indexOf(type) > -1))) {
                _context2.n = 3;
                break;
              }
              _this2.$message.warning({
                showClose: true,
                message: '只支持pdf和图片预览'
              });
              return _context2.a(2);
            case 3:
              if (!(imageList.indexOf(type) > -1)) {
                _context2.n = 5;
                break;
              }
              _context2.n = 4;
              return fileApi.getFileContent(file.fileId);
            case 4:
              _yield$fileApi$getFil = _context2.v;
              _yield$fileApi$getFil2 = Object(slicedToArray["a" /* default */])(_yield$fileApi$getFil, 2);
              error = _yield$fileApi$getFil2[0];
              result = _yield$fileApi$getFil2[1];
              if (!error) {
                _this2.imgContent = "data:image/jpg;base64,".concat(result.content);
              }
              _this2.dialogVisible = true;
              return _context2.a(2);
            case 5:
              if (!err) {
                // this.exportFile(res, file.name)
                blob = new Blob([res], {
                  type: typeMap[type] || "image/".concat(type, "}")
                });
                blobUrl = window.URL.createObjectURL(blob);
                templink = document.createElement('a');
                templink.style.display = 'none';
                templink.href = blobUrl;
                templink.setAttribute('target', '_blank');
                document.body.appendChild(templink);
                templink.click();
                document.body.removeChild(templink);
                window.URL.revokeObjectURL(blobUrl);
              }
            case 6:
              return _context2.a(2);
          }
        }, _callee2);
      }))();
    },
    // 下载文件
    exportFile: function exportFile(data, name) {
      var blob = new Blob([data], {
        type: 'application/pdf'
      });
      var blobUrl = window.URL.createObjectURL(blob);
      var templink = document.createElement('a');
      templink.style.display = 'none';
      templink.href = blobUrl;
      templink.setAttribute('download', "".concat(name));
      document.body.appendChild(templink);
      templink.click();
      document.body.removeChild(templink);
      window.URL.revokeObjectURL(blobUrl);
      this.$message({
        type: 'success',
        showClose: true,
        message: '下载成功!'
      });
    },
    refreshList: function refreshList() {
      this.$emit('back');
    },
    createApi: function createApi() {
      var _this3 = this;
      return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regenerator["a" /* default */])().m(function _callee3() {
        return Object(regenerator["a" /* default */])().w(function (_context3) {
          while (1) switch (_context3.n) {
            case 0:
              _this3.showOperateApiDialog = true;
            case 1:
              return _context3.a(2);
          }
        }, _callee3);
      }))();
    },
    getConfig: function getConfig() {
      var _this4 = this;
      return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regenerator["a" /* default */])().m(function _callee4() {
        var _yield$profileTemplat, _yield$profileTemplat2, err, res;
        return Object(regenerator["a" /* default */])().w(function (_context4) {
          while (1) switch (_context4.n) {
            case 0:
              _this4.templateId = _this4.profileTemplateId;
              _context4.n = 1;
              return profileTemplateGuidanceConfigurationApi.profileTemplateGuidanceConfigurationDetailContentDto({
                // 目前没有商户id 直接从列表查询模板id
                templateId: _this4.profileTemplateId
              });
            case 1:
              _yield$profileTemplat = _context4.v;
              _yield$profileTemplat2 = Object(slicedToArray["a" /* default */])(_yield$profileTemplat, 2);
              err = _yield$profileTemplat2[0];
              res = _yield$profileTemplat2[1];
              if (!err) {
                _this4.aptitudeList = res;
              }
            case 2:
              return _context4.a(2);
          }
        }, _callee4);
      }))();
    }
  },
  mounted: function mounted() {
    this.getConfig();
  }
});
// CONCATENATED MODULE: ./src/modules/contractor-management-sm/views/ContractorStartGuidelines.vue?vue&type=script&lang=js
 /* harmony default export */ var views_ContractorStartGuidelinesvue_type_script_lang_js = (ContractorStartGuidelinesvue_type_script_lang_js); 
// EXTERNAL MODULE: ./src/modules/contractor-management-sm/views/ContractorStartGuidelines.vue?vue&type=style&index=0&id=26e5f136&prod&scoped=true&lang=scss
var ContractorStartGuidelinesvue_type_style_index_0_id_26e5f136_prod_scoped_true_lang_scss = __webpack_require__("88e7");

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

// CONCATENATED MODULE: ./src/modules/contractor-management-sm/views/ContractorStartGuidelines.vue






/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  views_ContractorStartGuidelinesvue_type_script_lang_js,
  render,
  staticRenderFns,
  false,
  null,
  "26e5f136",
  null
  
)

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

/***/ })

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