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

/***/ "c5ab":
/***/ (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":"44521ab8-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/BatchApprovalDialog.vue?vue&type=template&id=584eb88f
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":"contractorName","show-overflow-tooltip":""}}),_c('el-table-column',{attrs:{"label":"联系电话","prop":"phoneNumber","show-overflow-tooltip":""}}),_c('el-table-column',{attrs:{"label":"人员类别","prop":"personnelCategoryName","show-overflow-tooltip":""}}),_c('el-table-column',{attrs:{"label":"是否特种人员","prop":"isSpecialOperationCertificatePersonnel","show-overflow-tooltip":""}}),_c('el-table-column',{attrs:{"label":"流程状态","prop":"workflowStatus","width":"80"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [_c('el-tag',{attrs:{"size":"mini","type":_vm.workFlowStatusTypes(scope.row.workflowStatus)}},[_vm._v(_vm._s(scope.row.workflowStatusName))])]}}])})],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/BatchApprovalDialog.vue?vue&type=template&id=584eb88f

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

// 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/objectSpread2.js
var objectSpread2 = __webpack_require__("5530");

// 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: ./src/components/safety/enumField/utils.js
var utils = __webpack_require__("2ab8");

// EXTERNAL MODULE: ./src/components/safety/enumField/enumTypeMethods.js
var enumTypeMethods = __webpack_require__("21d8");

// 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");

// EXTERNAL MODULE: ./node_modules/qs/lib/index.js
var lib = __webpack_require__("4328");
var lib_default = /*#__PURE__*/__webpack_require__.n(lib);

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





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






var contractorPersonnelApi = new contractor_management_umd["ContractorPersonnelApi"]();
/* harmony default export */ var BatchApprovalDialogvue_type_script_lang_js = ({
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    type: {
      type: String,
      default: 'submit'
    }
  },
  data: function data() {
    return {
      page: {
        pageNo: 1,
        pageSize: 15,
        total: 0
      },
      tableData: [],
      personnelCategoryList: [],
      flowList: [],
      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) {
        return Object(enumTypeMethods["d" /* workFlowStatusTypes */])(val);
      };
    }
  },
  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(regeneratorRuntime["a" /* default */])().mark(function _callee() {
        var params, method, instance, token, _res, _yield$contractorPers, _yield$contractorPers2, err, res;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              _this.loading = true;
              params = {
                maxResultCount: _this.page.pageSize,
                // 每页多少条
                skipCount: (_this.page.pageNo - 1) * _this.page.pageSize // 跳过多少条
              };
              method = 'submitPagedListQuery';
              if (_this.type !== 'submit') {
                method = 'todoPagedListQuery';
                params.workflowStatus = 1;
              }
              if (!window.__POWERED_BY_QIANKUN__) {
                _context.next = 15;
                break;
              }
              // 低代码
              instance = axios.create();
              instance.defaults.baseURL = Wiz.globalSettings.api.endpoints.default;
              token = localStorage.getItem('authorization');
              instance.defaults.headers.common.Authorization = "Bearer ".concat(token);
              _context.next = 11;
              return instance.get("/api/contractor-management/contractor-personnels/todo-paged-list-query?".concat(lib_default.a.stringify(params)));
            case 11:
              _res = _context.sent;
              if (_res.status === 200 && _res.data) {
                _this.tableData = Object(external_["map"])(_res.data.items, function (item) {
                  var _find, _find2;
                  return Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, item), {}, {
                    personnelCategoryName: ((_find = Object(external_["find"])(_this.personnelCategoryList, {
                      code: String(item.personnelCategory)
                    })) === null || _find === void 0 ? void 0 : _find.displayName) || '',
                    workflowStatusName: ((_find2 = Object(external_["find"])(_this.flowList, {
                      code: String(item.workflowStatus)
                    })) === null || _find2 === void 0 ? void 0 : _find2.displayName) || '',
                    isSpecialOperationCertificatePersonnel: item.isSpecialOperationCertificatePersonnel ? '是' : '否'
                  });
                });
                _this.page.total = _res.data.totalCount;
              }
              _this.loading = false;
              return _context.abrupt("return");
            case 15:
              _context.next = 17;
              return contractorPersonnelApi[method](params);
            case 17:
              _yield$contractorPers = _context.sent;
              _yield$contractorPers2 = Object(slicedToArray["a" /* default */])(_yield$contractorPers, 2);
              err = _yield$contractorPers2[0];
              res = _yield$contractorPers2[1];
              if (!err) {
                _this.tableData = Object(external_["map"])(res.items, function (item) {
                  var _find3, _find4;
                  return Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, item), {}, {
                    personnelCategoryName: ((_find3 = Object(external_["find"])(_this.personnelCategoryList, {
                      code: String(item.personnelCategory)
                    })) === null || _find3 === void 0 ? void 0 : _find3.displayName) || '',
                    workflowStatusName: ((_find4 = Object(external_["find"])(_this.flowList, {
                      code: String(item.workflowStatus)
                    })) === null || _find4 === void 0 ? void 0 : _find4.displayName) || '',
                    isSpecialOperationCertificatePersonnel: item.isSpecialOperationCertificatePersonnel ? '是' : '否'
                  });
                });
                _this.page.total = res.totalCount;
              }
              _this.loading = false;
            case 23:
            case "end":
              return _context.stop();
          }
        }, _callee);
      }))();
    },
    handleSelectionChange: function handleSelectionChange(selection) {
      this.selection = selection;
    },
    approval: function approval(type) {
      var _this2 = this;
      return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee2() {
        var body, _yield$contractorPers3, _yield$contractorPers4, err, res;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee2$(_context2) {
          while (1) switch (_context2.prev = _context2.next) {
            case 0:
              if (!(_this2.selection.length === 0)) {
                _context2.next = 3;
                break;
              }
              _this2.$message.warning('请勾选审批数据!');
              return _context2.abrupt("return");
            case 3:
              _this2.approvalLoading = true;
              body = Object(external_["map"])(_this2.selection, function (item) {
                return {
                  isPass: type === 1,
                  approve: '',
                  id: item.id,
                  taskId: item.taskId
                };
              });
              _context2.next = 7;
              return contractorPersonnelApi.entryApprove_0({
                body: body
              });
            case 7:
              _yield$contractorPers3 = _context2.sent;
              _yield$contractorPers4 = Object(slicedToArray["a" /* default */])(_yield$contractorPers3, 2);
              err = _yield$contractorPers4[0];
              res = _yield$contractorPers4[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 13:
            case "end":
              return _context2.stop();
          }
        }, _callee2);
      }))();
    },
    submit: function submit() {
      var _this3 = this;
      return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee3() {
        var _yield$contractorPers5, _yield$contractorPers6, err, res;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee3$(_context3) {
          while (1) switch (_context3.prev = _context3.next) {
            case 0:
              if (!(_this3.selection.length === 0)) {
                _context3.next = 3;
                break;
              }
              _this3.$message.warning('请勾选审批数据!');
              return _context3.abrupt("return");
            case 3:
              _this3.approvalLoading = true;
              _context3.next = 6;
              return contractorPersonnelApi.entryBatchSubmit({
                body: Object(external_["map"])(_this3.selection, 'id')
              });
            case 6:
              _yield$contractorPers5 = _context3.sent;
              _yield$contractorPers6 = Object(slicedToArray["a" /* default */])(_yield$contractorPers5, 2);
              err = _yield$contractorPers6[0];
              res = _yield$contractorPers6[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 12:
            case "end":
              return _context3.stop();
          }
        }, _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() {
    utils["a" /* default */].getDataCategory(['ContractorManagement.DataCategory.PersonnelCategory', 'ContractorManagement.DataCategory.WorkflowStatus'], ['personnelCategoryList', 'flowList'], this);
  }
});
// CONCATENATED MODULE: ./src/modules/contractor-management-sm/components/BatchApprovalDialog.vue?vue&type=script&lang=js
 /* harmony default export */ var components_BatchApprovalDialogvue_type_script_lang_js = (BatchApprovalDialogvue_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/BatchApprovalDialog.vue





/* normalize component */

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

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

/***/ })

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