| | |
| | | <div slot="title" class="tac drawerHeader">{{ editRow.title }}</div> |
| | | <div class="dialog-content-box"> |
| | | <el-form class="form-box" ref="form" :rules="rules" :model="form" label-width="120px" label-position="right"> |
| | | <el-form-item label="工种名称:" prop="id"> |
| | | <el-input v-model="form.id" placeholder="请输入"></el-input> |
| | | <el-form-item label="工种名称:" prop="workName"> |
| | | <el-input v-model="form.workName" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="不达标保底:" prop="isCore"> |
| | | <el-form-item label="不达标保底:" prop="isGuaranteed"> |
| | | <el-switch |
| | | v-model="form.isCore" |
| | | v-model="form.isGuaranteed" |
| | | active-color="#409EFF" |
| | | inactive-color="#C0CCDA" |
| | | > |
| | | </el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="保底工资:" prop="produceAheadDay"> |
| | | <el-form-item label="保底工资:" prop="guaranteedWages" |
| | | :rules="[ |
| | | { |
| | | required:form.isGuaranteed?true: false, |
| | | message: '请输入', |
| | | trigger: 'blur', |
| | | }, |
| | | { |
| | | validator: this.validatorNum, |
| | | trigger: 'blur', |
| | | }, |
| | | ]"> |
| | | <el-input |
| | | v-model.number="form.produceAheadDay" |
| | | v-model.number="form.guaranteedWages" |
| | | maxlength="20" |
| | | style="width: calc(100% - 40px)" |
| | | clearable |
| | |
| | | ></el-input> |
| | | <span class="float_right">元/天</span> |
| | | </el-form-item> |
| | | <el-form-item label="薪资方案:" prop="name"> |
| | | 挡车工生产工资方案+满勤方案+工龄补贴方案 |
| | | <el-form-item label="薪资方案:" prop="salaryPlansName"> |
| | | {{ form.salaryPlansName }} |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getDeleteFollowRecord } from "@/api/employeeManage/employeeInfo.js" |
| | | import { saveWorkTypeInfo } from "@/api/employeeManage/employeeInfo.js" |
| | | export default { |
| | | props: { |
| | | editRow: { |
| | |
| | | return { |
| | | islook: false, |
| | | form: { |
| | | id: '', |
| | | isCore: '', |
| | | phoneNum: '', |
| | | workName: '', |
| | | isGuaranteed: true, |
| | | guaranteedWages: null, |
| | | salaryPlansName:'', |
| | | }, |
| | | rules: { |
| | | id: [ |
| | | workName: [ |
| | | { |
| | | required: true, |
| | | message: "请输入人员姓名", |
| | | trigger: ["blur", "change"], |
| | | }, |
| | | ], |
| | | name: [ |
| | | { |
| | | required: true, |
| | | message: "请输入员工编码", |
| | | trigger: ["blur", "change"], |
| | | }, |
| | | ], |
| | | produceAheadDay: [ |
| | | { |
| | | required: false, |
| | | message: "请输入", |
| | | trigger: "blur", |
| | | }, |
| | | { |
| | | validator: this.validatorNum, |
| | | trigger: "blur", |
| | | trigger: ["blur", "change"], |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | formInfo() { |
| | | if (this.islook) { |
| | | this.form = { |
| | | isCore: "", |
| | | id: "", |
| | | workName: '', |
| | | isGuaranteed: true, |
| | | guaranteedWages: null, |
| | | salaryPlansName:'', |
| | | }; |
| | | this.$nextTick(()=>{ |
| | | this.$refs["form"].resetFields(); |
| | | if (this.editRow.id) { |
| | | if (this.editRow.type=='edit') { |
| | | this.form = JSON.parse(JSON.stringify(this.editRow)); |
| | | } |
| | | }) |
| | |
| | | callback(); |
| | | } |
| | | }, |
| | | cancelMethod() { |
| | | cancelMethod(val) { |
| | | this.$refs["form"].resetFields(); |
| | | this.islook = false; |
| | | if(val){ |
| | | this.$emit('refresh') |
| | | } |
| | | }, |
| | | submitForm(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | let form = JSON.parse(JSON.stringify(this.form)); |
| | | if (this.editRow.type == "add") { |
| | | getDeleteFollowRecord(form).then((res) => { |
| | | form.guaranteedWages=form.guaranteedWages?form.guaranteedWages:0 |
| | | saveWorkTypeInfo(form).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | message: "添加成功!", |
| | | message: this.editRow.type == "add"?"添加成功!":"编辑成功!", |
| | | type: "success", |
| | | }); |
| | | this.cancelMethod(); |
| | | this.cancelMethod(true); |
| | | } |
| | | }); |
| | | } else { |
| | | getDeleteFollowRecord(form).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | message: "编辑成功!", |
| | | type: "success", |
| | | }); |
| | | this.cancelMethod(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } else { |
| | | console.log('error submit!!'); |
| | | return false; |