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

/***/ "99af":
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $ = __webpack_require__("23e7");
var fails = __webpack_require__("d039");
var isArray = __webpack_require__("e8b5");
var isObject = __webpack_require__("861d");
var toObject = __webpack_require__("7b0b");
var lengthOfArrayLike = __webpack_require__("07fa");
var doesNotExceedSafeInteger = __webpack_require__("3511");
var createProperty = __webpack_require__("8418");
var arraySpeciesCreate = __webpack_require__("65f0");
var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
var wellKnownSymbol = __webpack_require__("b622");
var V8_VERSION = __webpack_require__("1212");

var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');

// We can't use this feature detection in V8 since it causes
// deoptimization and serious performance degradation
// https://github.com/zloirock/core-js/issues/679
var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
  var array = [];
  array[IS_CONCAT_SPREADABLE] = false;
  return array.concat()[0] !== array;
});

var isConcatSpreadable = function (O) {
  if (!isObject(O)) return false;
  var spreadable = O[IS_CONCAT_SPREADABLE];
  return spreadable !== undefined ? !!spreadable : isArray(O);
};

var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport('concat');

// `Array.prototype.concat` method
// https://tc39.es/ecma262/#sec-array.prototype.concat
// with adding support of @@isConcatSpreadable and @@species
$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
  // eslint-disable-next-line no-unused-vars -- required for `.length`
  concat: function concat(arg) {
    var O = toObject(this);
    var A = arraySpeciesCreate(O, 0);
    var n = 0;
    var i, k, length, len, E;
    for (i = -1, length = arguments.length; i < length; i++) {
      E = i === -1 ? O : arguments[i];
      if (isConcatSpreadable(E)) {
        len = lengthOfArrayLike(E);
        doesNotExceedSafeInteger(n + len);
        for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
      } else {
        doesNotExceedSafeInteger(n + 1);
        createProperty(A, n++, E);
      }
    }
    A.length = n;
    return A;
  }
});


/***/ }),

/***/ "bd62":
/***/ (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/ShortTermBatchApprovalDialog.vue?vue&type=template&id=51557ce7
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:"small-dialog approval-dialog",attrs:{"title":_vm.type === 'submit' ? '一键提交' : '一键审批',"visible":_vm.dialogVisible,"close-on-click-modal":false,"before-close":_vm.closeDialog},on:{"update:visible":function($event){_vm.dialogVisible=$event}}},[_c('div',{directives:[{name:"loading",rawName:"v-loading",value:(_vm.approvalLoading),expression:"approvalLoading"}],staticClass:"h-full",attrs:{"element-loading-text":"正在处理..."}},[_c('el-table',{directives:[{name:"loading",rawName:"v-loading",value:(_vm.loading),expression:"loading"}],ref:"table",attrs:{"height":"calc(100% - 50px)","stripe":"","border":"","data":_vm.tableData,"row-key":"id"},on:{"selection-change":_vm.handleSelectionChange}},[_c('el-table-column',{attrs:{"type":"selection","width":"50","align":"center","reserve-selection":""}}),_c('el-table-column',{attrs:{"label":"姓名","prop":"name","show-overflow-tooltip":"","width":"80"}}),_c('el-table-column',{attrs:{"label":"所属单位","prop":"department","show-overflow-tooltip":""}}),_c('el-table-column',{attrs:{"label":"联系电话","prop":"phoneNumber","show-overflow-tooltip":""}}),_c('el-table-column',{attrs:{"label":"人员类别","prop":"employeeTypeStr","show-overflow-tooltip":""}}),_c('el-table-column',{attrs:{"label":"是否特种人员","prop":"isSpecialJob","show-overflow-tooltip":""},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [_vm._v(_vm._s(scope.row.isSpecialJob ? _vm.$t('是') : _vm.$t('否')))]}}])}),_c('el-table-column',{attrs:{"label":"流程状态","prop":"approvalStatus","width":"80"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [_c('el-tag',{attrs:{"size":"mini","type":_vm.workFlowStatusTypes(scope.row.approvalStatus)}},[_vm._v(_vm._s(scope.row.approvalStatusStr))])]}}])})],1),_c('div',{staticClass:"text-right mt-20px"},[_c('el-pagination',{attrs:{"background":"","current-page":_vm.page.pageNo,"page-size":_vm.page.pageSize,"layout":"total, sizes, prev, pager, next, jumper","page-sizes":[15, 30, 45, 60, 75, 90],"total":_vm.page.total},on:{"size-change":_vm.searchList,"current-change":_vm.findList,"update:currentPage":function($event){return _vm.$set(_vm.page, "pageNo", $event)},"update:current-page":function($event){return _vm.$set(_vm.page, "pageNo", $event)},"update:pageSize":function($event){return _vm.$set(_vm.page, "pageSize", $event)},"update:page-size":function($event){return _vm.$set(_vm.page, "pageSize", $event)}}})],1)],1),(!_vm.approvalLoading)?_c('div',{attrs:{"slot":"footer"},slot:"footer"},[(_vm.type === 'submit')?[_c('el-button',{attrs:{"type":"primary","size":"small"},on:{"click":_vm.submit}},[_vm._v("提交")]),_c('el-button',{attrs:{"size":"small"},on:{"click":_vm.closeDialog}},[_vm._v("取消")])]:[_c('el-button',{attrs:{"type":"danger","size":"small"},on:{"click":function($event){return _vm.approval(0)}}},[_vm._v("批量驳回")]),_c('el-button',{attrs:{"type":"primary","size":"small"},on:{"click":function($event){return _vm.approval(1)}}},[_vm._v("批量通过")])]],2):_vm._e()])}
var staticRenderFns = []


// CONCATENATED MODULE: ./src/modules/contractor-management-sm/components/ShortTermBatchApprovalDialog.vue?vue&type=template&id=51557ce7

// 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.concat.js
var es_array_concat = __webpack_require__("99af");

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

// EXTERNAL MODULE: external "_"
var external_ = __webpack_require__("60bb");

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




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



var periodContractorPersonnelApi = new contractor_management_umd["PeriodContractorPersonnelApi"]();
/* harmony default export */ var ShortTermBatchApprovalDialogvue_type_script_lang_js = ({
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    type: {
      type: String,
      default: 'submit'
    },
    contractorId: {
      type: String,
      default: ''
    }
  },
  data: function data() {
    return {
      page: {
        pageNo: 1,
        pageSize: 15,
        total: 0
      },
      tableData: [],
      loading: false,
      selection: [],
      approvalLoading: false
    };
  },
  computed: {
    dialogVisible: {
      get: function get() {
        return this.visible;
      },
      set: function set(val) {
        this.$emit('update:visible', val);
      }
    },
    workFlowStatusTypes: function workFlowStatusTypes() {
      return function (val) {
        var type = '';
        switch (val) {
          case 0:
            type = 'primary';
            break;
          case 1:
            type = 'warning';
            break;
          case 9:
            type = 'success';
            break;
          default:
            type = 'danger';
            break;
        }
        return type;
      };
    }
  },
  watch: {
    dialogVisible: function dialogVisible(val) {
      if (val) {
        this.searchList();
      }
    }
  },
  methods: {
    searchList: function searchList() {
      this.page.pageNo = 1;
      this.findList();
    },
    findList: function findList() {
      var _this = this;
      return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regenerator["a" /* default */])().m(function _callee() {
        var params, method, _yield$periodContract, _yield$periodContract2, err, res;
        return Object(regenerator["a" /* default */])().w(function (_context) {
          while (1) switch (_context.n) {
            case 0:
              _this.loading = true;
              params = {
                maxResultCount: _this.page.pageSize,
                // 每页多少条
                skipCount: (_this.page.pageNo - 1) * _this.page.pageSize,
                // 跳过多少条
                contractorId: _this.contractorId
              };
              method = 'submitPageListQuery';
              if (_this.type !== 'submit') {
                method = 'approveListQuery';
              }
              _context.n = 1;
              return periodContractorPersonnelApi[method](params);
            case 1:
              _yield$periodContract = _context.v;
              _yield$periodContract2 = Object(slicedToArray["a" /* default */])(_yield$periodContract, 2);
              err = _yield$periodContract2[0];
              res = _yield$periodContract2[1];
              if (!err) {
                _this.tableData = res.items;
                _this.page.total = res.totalCount;
              }
              _this.loading = false;
            case 2:
              return _context.a(2);
          }
        }, _callee);
      }))();
    },
    handleSelectionChange: function handleSelectionChange(selection) {
      this.selection = selection;
    },
    approval: function approval(type) {
      var _this2 = this;
      return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regenerator["a" /* default */])().m(function _callee2() {
        var body, _yield$periodContract3, _yield$periodContract4, err, res;
        return Object(regenerator["a" /* default */])().w(function (_context2) {
          while (1) switch (_context2.n) {
            case 0:
              if (!(_this2.selection.length === 0)) {
                _context2.n = 1;
                break;
              }
              _this2.$message.warning('请勾选审批数据!');
              return _context2.a(2);
            case 1:
              _this2.approvalLoading = true;
              body = Object(external_["map"])(_this2.selection, function (item) {
                return {
                  isPass: type === 1,
                  approve: '',
                  id: item.id,
                  taskId: item.taskId
                };
              });
              _context2.n = 2;
              return periodContractorPersonnelApi.batchApprove({
                body: body
              });
            case 2:
              _yield$periodContract3 = _context2.v;
              _yield$periodContract4 = Object(slicedToArray["a" /* default */])(_yield$periodContract3, 2);
              err = _yield$periodContract4[0];
              res = _yield$periodContract4[1];
              _this2.approvalLoading = false;
              if (!err) {
                _this2.$message.success("\u5BA1\u6279\u5B8C\u6210\uFF0C\u6210\u529F\uFF1A".concat(res.length, "\u6761 \u5931\u8D25\uFF1A").concat(_this2.selection.length - res.length, "\u6761"));
                _this2.closeDialog();
                _this2.$emit('finished');
              }
            case 3:
              return _context2.a(2);
          }
        }, _callee2);
      }))();
    },
    submit: function submit() {
      var _this3 = this;
      return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regenerator["a" /* default */])().m(function _callee3() {
        var _yield$periodContract5, _yield$periodContract6, err, res;
        return Object(regenerator["a" /* default */])().w(function (_context3) {
          while (1) switch (_context3.n) {
            case 0:
              if (!(_this3.selection.length === 0)) {
                _context3.n = 1;
                break;
              }
              _this3.$message.warning('请勾选审批数据!');
              return _context3.a(2);
            case 1:
              _this3.approvalLoading = true;
              _context3.n = 2;
              return periodContractorPersonnelApi.batchSubmit({
                body: Object(external_["map"])(_this3.selection, 'id')
              });
            case 2:
              _yield$periodContract5 = _context3.v;
              _yield$periodContract6 = Object(slicedToArray["a" /* default */])(_yield$periodContract5, 2);
              err = _yield$periodContract6[0];
              res = _yield$periodContract6[1];
              _this3.approvalLoading = false;
              if (!err) {
                _this3.$message.success("\u63D0\u4EA4\u5B8C\u6210\uFF0C\u6210\u529F\uFF1A".concat(res.length, "\u6761 \u5931\u8D25\uFF1A").concat(_this3.selection.length - res.length, "\u6761"));
                _this3.closeDialog();
                _this3.$emit('finished');
              }
            case 3:
              return _context3.a(2);
          }
        }, _callee3);
      }))();
    },
    closeDialog: function closeDialog(done) {
      if (this.approvalLoading) {
        this.$message.warning('审批处理中，请稍等');
        return;
      }
      this.tableData = [];
      this.page = this.$options.data().page;
      this.selection = [];
      this.$refs.table.clearSelection();
      if (done) {
        done();
      } else {
        this.dialogVisible = false;
      }
    }
  },
  created: function created() {}
});
// CONCATENATED MODULE: ./src/modules/contractor-management-sm/components/ShortTermBatchApprovalDialog.vue?vue&type=script&lang=js
 /* harmony default export */ var components_ShortTermBatchApprovalDialogvue_type_script_lang_js = (ShortTermBatchApprovalDialogvue_type_script_lang_js); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("2877");

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





/* normalize component */

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

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

/***/ })

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