1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
webpackJsonp([138],{"2/rq":function(e,t){},"2Ymc":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("u5fS"),o={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"sys-box plan-box"},[a("div",{staticClass:"sys-operate"},[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.back()}}},[e._v(e._s(e.config.cancelText))]),e._v(" "),a("el-button",{attrs:{type:"primary",disabled:e.isDisabled},on:{click:function(t){return e.save("form")}}},[e._v("保存")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.clear("form")}}},[e._v("新增")])],1),e._v(" "),a("div",{staticClass:"sys-form"},[a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"form",attrs:{"label-width":"120px","inline-message":!0,model:e.formData,rules:e.ruleForm}},[a("div",{staticClass:"flex"},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"合同分类",prop:"contractCategory"}},[a("el-select",{attrs:{placeholder:"请选择",clearable:""},model:{value:e.formData.contractCategory,callback:function(t){e.$set(e.formData,"contractCategory",t)},expression:"formData.contractCategory"}},e._l(e.contractCategoryTypeList,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1),e._v(" "),a("div",{staticClass:"divType",on:{click:function(t){return e.goManagement()}}},[e._v("分类管理")])],1),e._v(" "),a("div",{staticClass:"flex"},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"档案编号",prop:"recordNo"}},[a("el-input",{model:{value:e.formData.recordNo,callback:function(t){e.$set(e.formData,"recordNo",t)},expression:"formData.recordNo"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"合同编号",prop:"contractCode"}},[a("el-input",{model:{value:e.formData.contractCode,callback:function(t){e.$set(e.formData,"contractCode",t)},expression:"formData.contractCode"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"合同期限(年)",prop:"contractTerm"}},[a("el-input-number",{staticStyle:{width:"100%"},attrs:{label:"描述文字",size:"small",min:0},model:{value:e.formData.contractTerm,callback:function(t){e.$set(e.formData,"contractTerm",t)},expression:"formData.contractTerm"}})],1)],1),e._v(" "),a("div",{staticClass:"flex"},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"员工姓名",prop:"employeeName"}},[a("btn-input",{attrs:{valueText:e.formData.employeeName,valueId:e.formData.employeeId,chooseVisible:e.chooseUserVisible},on:{"update:valueText":function(t){return e.$set(e.formData,"employeeName",t)},"update:value-text":function(t){return e.$set(e.formData,"employeeName",t)},"update:valueId":function(t){return e.$set(e.formData,"employeeId",t)},"update:value-id":function(t){return e.$set(e.formData,"employeeId",t)},"update:chooseVisible":function(t){e.chooseUserVisible=t},"update:choose-visible":function(t){e.chooseUserVisible=t}}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"员工工号"}},[a("el-input",{attrs:{readonly:""},model:{value:e.formData.employeeCode,callback:function(t){e.$set(e.formData,"employeeCode",t)},expression:"formData.employeeCode"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"签订单位",prop:"signingDept"}},[a("el-cascader",{ref:"cascaderAddr",attrs:{clearable:"",options:e.depOptions,"change-on-select":"",props:{expandTrigger:"hover",label:"text",value:"id",checkStrictly:!0}},on:{change:e.handleChange},model:{value:e.selectDeptId,callback:function(t){e.selectDeptId=t},expression:"selectDeptId"}})],1)],1),e._v(" "),a("div",{staticClass:"flex"},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"签订日期",prop:"signingDate"}},[a("el-date-picker",{attrs:{type:"date",format:"yyyy-MM-dd","range-separator":"—",placeholder:"选择日期","value-format":"yyyy-MM-dd HH:mm:ss",clearable:""},model:{value:e.formData.signingDate,callback:function(t){e.$set(e.formData,"signingDate",t)},expression:"formData.signingDate"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"终止日期",prop:"stopDate"}},[a("el-date-picker",{attrs:{type:"date",format:"yyyy-MM-dd","range-separator":"—",placeholder:"选择日期","value-format":"yyyy-MM-dd HH:mm:ss",clearable:""},model:{value:e.formData.stopDate,callback:function(t){e.$set(e.formData,"stopDate",t)},expression:"formData.stopDate"}})],1)],1),e._v(" "),a("el-form-item",{attrs:{label:"档案说明"}},[a("el-input",{staticStyle:{width:"100%"},attrs:{type:"textarea",autosize:{minRows:4},clearable:""},model:{value:e.formData.recordDescription,callback:function(t){e.$set(e.formData,"recordDescription",t)},expression:"formData.recordDescription"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"摘要信息"}},[a("el-input",{staticStyle:{width:"100%"},attrs:{type:"textarea",autosize:{minRows:4},clearable:""},model:{value:e.formData.description,callback:function(t){e.$set(e.formData,"description",t)},expression:"formData.description"}})],1),e._v(" "),a("el-form-item",{staticClass:"dialog-form-inline",attrs:{label:"选择附件"}},[e.advanceQueryDialogVisible?a("upload",{attrs:{title:"",label_width:"0",attachment:e.uploadAttachment},on:{"update:attachment":function(t){e.uploadAttachment=t}}}):e._e()],1)],1)],1),e._v(" "),a("dialogChooseSingleEmployee",{attrs:{visible:e.chooseUserVisible},on:{"update:visible":function(t){e.chooseUserVisible=t},change:e.getUser}})],1)},staticRenderFns:[]};var i=function(e){a("aoCs"),a("2/rq")},n=a("VU/8")(r.a,o,!1,i,"data-v-00d76888",null);t.default=n.exports},aoCs:function(e,t){},u5fS:function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_get_iterator__=__webpack_require__("BO1k"),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_get_iterator___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_get_iterator__),__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_json_stringify__=__webpack_require__("mvHQ"),__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_json_stringify___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_json_stringify__),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends__=__webpack_require__("Dd8w"),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends__),__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_defineProperty__=__webpack_require__("bOdI"),__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_defineProperty___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_defineProperty__),__WEBPACK_IMPORTED_MODULE_4_vuex__=__webpack_require__("NYxO"),__WEBPACK_IMPORTED_MODULE_5__components_System_upload__=__webpack_require__("veZ4"),__WEBPACK_IMPORTED_MODULE_6__components_System_dialogChooseSingleEmployee__=__webpack_require__("znTt"),__WEBPACK_IMPORTED_MODULE_7__utils_config_js__=__webpack_require__("bzuE"),__WEBPACK_IMPORTED_MODULE_8__components_btnInput_vue__=__webpack_require__("ysqt");__webpack_exports__.a={components:{dialogChooseSingleEmployee:__WEBPACK_IMPORTED_MODULE_6__components_System_dialogChooseSingleEmployee__.a,btnInput:__WEBPACK_IMPORTED_MODULE_8__components_btnInput_vue__.a,upload:__WEBPACK_IMPORTED_MODULE_5__components_System_upload__.a},data:function(){return{formData:{contractType:0,employeeName:"",employeeId:"",signingDept:"",signingDeptName:""},selectDeptId:"",depOptions:[],contractCategoryTypeList:[],contentAssocList:[],config:__WEBPACK_IMPORTED_MODULE_7__utils_config_js__.a,itemIds:[],typeList:[],btnDelDisabled:!1,chooseClientrVisible:!1,chooseUserVisible:!1,ChooseSalesOutStockVisible:!1,loading:!1,isDisabled:!1,salesBillId:"",advanceQueryDialogVisible:!0,uploadAttachment:[],ruleForm:__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_defineProperty___default()({contractCategory:[{required:!0,message:"请选择合同分类",trigger:"change"}],recordNo:[{required:!0,message:"请输入档案编号",trigger:"change"}],contractCode:[{required:!0,message:"请输入合同编号",trigger:"change"}],signingDate:[{required:!0,message:"请输入签订年份",trigger:"change"}],employeeName:[{required:!0,message:"请选择员工姓名",trigger:"change"}],signingDept:[{required:!0,message:"请选择签订单位",trigger:"blur"}],stopDate:[{required:!0,message:"请选择终止日期",trigger:"change"}]},"signingDept",[{required:!0,message:"请选择签订单位",trigger:"change"}])}},mounted:function(){this.initData(),this.$route.query.id&&(this.formData.id=this.$route.query.id,this.getDetail())},watch:{},methods:__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends___default()({},Object(__WEBPACK_IMPORTED_MODULE_4_vuex__.d)({removeTagNav:"tagNav/removeTagNav"}),{initData:function(){var e=this;this.$api.dictAPI.getDictsByType("labor_contract_type").then(function(t){e.contractCategoryTypeList=t.datas}),this.$api.commonAPI.getDeptsTree().then(function(t){console.log(t),0===t.code&&(e.depOptions=t.data.children,e.setDeptList(e.depOptions))}).catch(function(e){console.log(e)})},setDefaultDept:function(){if(this.depOptions.length>0&&this.formData.signingDept){var e=__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_json_stringify___default()(this.formData.signingDept),t=this.treeFindPath(this.depOptions,function(t){return t.id===e});this.selectDeptId=JSON.parse(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_json_stringify___default()(t))}},handleChange:function(e){this.formData.signingDept=e[e.length-1],this.formData.signingDeptName=this.$refs.cascaderAddr.getCheckedNodes()[0].label,console.log(this.formData.signingDept),this.selectDeptId=e},treeFindPath:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!e)return[];var r=!0,o=!1,i=void 0;try{for(var n,_=__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_get_iterator___default()(e);!(r=(n=_.next()).done);r=!0){var s=n.value;if(a.push(s.id),t(s))return a;if(s.children){var l=this.treeFindPath(s.children,t,a);if(l.length)return l}a.pop()}}catch(e){o=!0,i=e}finally{try{!r&&_.return&&_.return()}finally{if(o)throw i}}return[]},setDeptList:function(e){var t=!0,a=!1,r=void 0;try{for(var o,i=__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_get_iterator___default()(e);!(t=(o=i.next()).done);t=!0){var n=o.value;n.hasChildren?this.setDeptList(n.children):n.children=void 0}}catch(e){a=!0,r=e}finally{try{!t&&i.return&&i.return()}finally{if(a)throw r}}},clear:function(){var e=this;this.advanceQueryDialogVisible=!1,this.$nextTick(function(){e.$refs.form.resetFields(),e.formData={contractType:0,employeeName:"",employeeId:"",signingDept:"",signingDeptName:""},e.uploadAttachment=[],e.contentAssocList=[],e.selectDeptId="",e.advanceQueryDialogVisible=!0;new Date;e.formData.contractType=0})},getDetail:function(){var e=this;this.$api.staffContractAPI.detail(this.formData.id).then(function(t){0==t.code&&(console.log(t.data),e.formData=t.data.contractInfoDO,e.uploadAttachment=t.data.contentAssocList,e.selectDeptId=t.data.contractInfoDO.signingDept,e.setDefaultDept())}).catch(function(e){console.log(e)})},back:function(){this.$router.push({path:"/staffContract/laborContract",query:{t:Date.now()}})},getUser:function(e){e&&(this.formData.employeeName=e.name,this.formData.employeeId=e.id,this.formData.employeeCode=e.employeeCode)},goManagement:function(){this.$router.push({path:"/staffContract/laborContract_laborManagement",query:{t:Date.now()}})},save:function(e){var t=this;this.$refs[e].validate(function(e){if(!e)return!1;if(null!=t.uploadAttachment&&t.uploadAttachment.length>0){var a=[];t.uploadAttachment.forEach(function(e){var t={fileName:e.fileName,filePath:e.filePath};a.push(t)}),t.contentAssocList=a}t.isDisabled||(t.isDisabled=!0,t.$api.staffContractAPI.save({contractInfoDO:t.formData,contentAssocList:t.contentAssocList}).then(function(e){t.isDisabled=!1,0===e.code?(t.$message({message:e.msg,type:"success"}),window.location.href=t.changeURLArg("id",e.id)):t.$message({message:e.msg,type:"error"})}))})},changeURLArg:function changeURLArg(arg,arg_val){var url=window.location.href;console.log(arg),console.log(arg_val),console.log(url);var pattern=arg+"=([^&]*)",replaceText=arg+"="+arg_val;if(url.match(pattern)){var tmp="/("+arg+"=)([^&]*)/gi";return tmp=url.replace(eval(tmp),replaceText),tmp}return url.match("[?]")?url+"&"+replaceText:url+"?"+replaceText}})}}}); |