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

/***/ "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":"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/BatchApprovalDialog.vue?vue&type=template&id=6f8b046a
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,"pager-count":5},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(),(_vm.showUserDialog)?_c('SelectDeptUser',{attrs:{"visible":_vm.showUserDialog,"flowName":_vm.flowName,"nodeName":_vm.nodeName},on:{"update:visible":function($event){_vm.showUserDialog=$event},"selectSuccess":_vm.selectSuccess}}):_vm._e()],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./src/modules/contractor-management-sm/components/BatchApprovalDialog.vue?vue&type=template&id=6f8b046a

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

// EXTERNAL MODULE: ./src/modules/contractor-management-sm/components/SelectDeptUser.vue + 4 modules
var SelectDeptUser = __webpack_require__("2288");

// 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'
    },
    isSelectUser: {
      type: Boolean,
      default: false
    },
    // 是否有人员选择功能
    flowName: {
      type: String,
      default: ''
    },
    // 流程名称
    nodeName: {
      type: String,
      default: ''
    } // 需要获取人员的节点名称
  },
  components: {
    SelectDeptUser: SelectDeptUser["a" /* default */]
  },
  data: function data() {
    return {
      page: {
        pageNo: 1,
        pageSize: 15,
        total: 0
      },
      tableData: [],
      personnelCategoryList: [],
      flowList: [],
      loading: false,
      selection: [],
      approvalLoading: false,
      showUserDialog: 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(regenerator["a" /* default */])().m(function _callee() {
        var params, method, instance, token, _res, _yield$contractorPers, _yield$contractorPers2, 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 // 跳过多少条
              };
              method = 'submitPagedListQuery';
              if (_this.type !== 'submit') {
                method = 'todoPagedListQuery';
                params.workflowStatus = 1;
              }
              if (!window.__POWERED_BY_QIANKUN__) {
                _context.n = 2;
                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.n = 1;
              return instance.get("/api/contractor-management/contractor-personnels/todo-paged-list-query?".concat(lib_default.a.stringify(params)));
            case 1:
              _res = _context.v;
              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.a(2);
            case 2:
              _context.n = 3;
              return contractorPersonnelApi[method](params);
            case 3:
              _yield$contractorPers = _context.v;
              _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 4:
              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$contractorPers3, _yield$contractorPers4, 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 contractorPersonnelApi.entryApprove_0({
                body: body
              });
            case 2:
              _yield$contractorPers3 = _context2.v;
              _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 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$contractorPers5, _yield$contractorPers6, 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:
              if (!_this3.isSelectUser) {
                _context3.n = 2;
                break;
              }
              _this3.showUserDialog = true;
              return _context3.a(2);
            case 2:
              _this3.approvalLoading = true;
              _context3.n = 3;
              return contractorPersonnelApi.entryBatchSubmit({
                body: Object(external_["map"])(_this3.selection, 'id')
              });
            case 3:
              _yield$contractorPers5 = _context3.v;
              _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 4:
              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;
      }
    },
    /**
     * @description 选择人员完成
     * @param {Array} userIds 人员id
     */
    selectSuccess: function selectSuccess(userIds) {
      var _this4 = this;
      return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regenerator["a" /* default */])().m(function _callee4() {
        var _yield$contractorPers7, _yield$contractorPers8, err, res;
        return Object(regenerator["a" /* default */])().w(function (_context4) {
          while (1) switch (_context4.n) {
            case 0:
              _this4.approvalLoading = true;
              _context4.n = 1;
              return contractorPersonnelApi.entryBatchSubmit({
                body: Object(external_["map"])(_this4.selection, function (item) {
                  return {
                    personId: item.id,
                    receiverIds: userIds
                  };
                })
              });
            case 1:
              _yield$contractorPers7 = _context4.v;
              _yield$contractorPers8 = Object(slicedToArray["a" /* default */])(_yield$contractorPers7, 2);
              err = _yield$contractorPers8[0];
              res = _yield$contractorPers8[1];
              _this4.approvalLoading = false;
              if (!err) {
                _this4.$message.success("\u63D0\u4EA4\u5B8C\u6210\uFF0C\u6210\u529F\uFF1A".concat(res.length, "\u6761 \u5931\u8D25\uFF1A").concat(_this4.selection.length - res.length, "\u6761"));
                _this4.closeDialog();
                _this4.$emit('finished');
              }
            case 2:
              return _context4.a(2);
          }
        }, _callee4);
      }))();
    }
  },
  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.55.js.map