New file |
| | |
| | | import request from "@/common/untils/request.js" |
| | | |
| | | // 薪资方案列表 |
| | | export function getSalaryPlanList(data) { |
| | | return request({ |
| | | url: "/api-jl/v1/salary/getSalaryPlanList", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 删除薪资方案 |
| | | export function deleteSalaryPlanInfo(data) { |
| | | return request({ |
| | | url: "/api-jl/v1/salary/deleteSalaryPlanInfo/"+data.id, |
| | | method: "delete", |
| | | data |
| | | }) |
| | | } |
| | | //获取薪资类型 |
| | | export function getSalaryTypeList(data) { |
| | | return request({ |
| | | url: "/api-jl/v1/salary/getSalaryTypeList/"+data.number, |
| | | method: "get", |
| | | data |
| | | }) |
| | | } |
| | | // 保存薪资类型 |
| | | export function saveSalaryType(data) { |
| | | return request({ |
| | | url: "/api-jl/v1/salary/saveSalaryType", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 保存薪资方案 |
| | | export function saveSalaryPlan(data) { |
| | | return request({ |
| | | url: "/api-jl/v1/salary/saveSalaryPlan", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | |
| | | <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="id" > |
| | | <el-input v-model="form.id" placeholder="请输入" :disabled="editRow.title=='编辑'?true:false"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="人员姓名:" prop="name"> |
| | | <el-input v-model="form.name" placeholder="请输入"></el-input> |
| | |
| | | <el-option v-for="item in attendanceStatusList" :key="item.id" :label="item.value" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-button type="text" @click="submitEditOneClick('form')">确定</el-button> |
| | | <el-button type="text" :loading="isAddloadingOne" @click="submitEditOneClick('form')">确定</el-button> |
| | | <el-button type="text" @click="cancelEditClick('isEditOne')">取消</el-button> |
| | | </template> |
| | | </el-form-item> |
| | |
| | | placeholder="请输入" |
| | | class="margin_right_15px" |
| | | ></el-input> |
| | | <el-button type="text" @click="submitEditTwoClick('form')">确定</el-button> |
| | | <el-button type="text" :loading="isAddloadingTwo" @click="submitEditTwoClick('form')">确定</el-button> |
| | | <el-button type="text" @click="cancelEditClick('isEditTwo')">取消</el-button> |
| | | </template> |
| | | </el-form-item> |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | isAddloadingOne:false, |
| | | isAddloadingTwo:false, |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | this.isEditOne=true |
| | | }, |
| | | submitEditOneClick(){ |
| | | this.submitForm('form','isEditOne') |
| | | this.submitForm('form','isEditOne','isAddloadingOne') |
| | | }, |
| | | editTwoClick(){ |
| | | this.isEditTwo=true |
| | | }, |
| | | submitEditTwoClick(){ |
| | | this.submitForm('form','isEditTwo') |
| | | this.submitForm('form','isEditTwo','isAddloadingTwo') |
| | | }, |
| | | formInfo() { |
| | | if (this.islook) { |
| | |
| | | this.islook = false; |
| | | this.$emit('shutdown') |
| | | }, |
| | | submitForm(formName,name) { |
| | | submitForm(formName,name,loading) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | let form = JSON.parse(JSON.stringify(this.form)); |
| | |
| | | workTypeId:form.workTypeId, |
| | | workerName:form.workerName, |
| | | } |
| | | this[loading]=true |
| | | updateAttendance(params).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | |
| | | this[name]=false |
| | | this.cancelMethod(); |
| | | } |
| | | }); |
| | | this[loading]=false |
| | | }).catch(() => { |
| | | setTimeout(() => { |
| | | this[loading]=false |
| | | }, 2000); |
| | | }); |
| | | } else { |
| | | console.log('error submit!!'); |
| | | return false; |
| | |
| | | <template> |
| | | <div class="add_wordshop"> |
| | | <el-dialog :title="editConfig.dialogTitle + '车间管理'" :visible.sync="editConfig.visible" width="30%" |
| | | <el-dialog :title="form.title + '薪资方案'" :visible.sync="islook" width="30%" |
| | | :before-close="handleClose"> |
| | | <el-form :inline="true" label-width="20%" style="width: 100%;" :model="editConfig.infomitton" :rules="rules" |
| | | ref="ruleForm"> |
| | | <el-form label-width="120px" style="width: 100%;" :model="form" :rules="rules" |
| | | ref="form"> |
| | | <el-form-item label="方案名称" style="width: 100%;" prop="groupNumber"> |
| | | <el-input v-model="editConfig.infomitton.workshop" placeholder="请输入内容"></el-input> |
| | | <el-input v-model="form.workshop" placeholder="请输入内容"></el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="workshop" label="工种" style="width: 100%;" > |
| | | <el-select |
| | | :disabled="this.editConfig.dialogTitle==='查看'" v-model="editConfig.infomitton.workshop" value-key="name" placeholder="请选择车间"> |
| | | v-model="form.workshop" value-key="name" placeholder="请选择车间"> |
| | | <el-option |
| | | v-for="item in workshopList" |
| | | :key="item.ID" |
| | |
| | | </el-form-item> |
| | | <el-form-item prop="workshop" label="薪资类型" style="width: 100%;" > |
| | | <el-select |
| | | :disabled="this.editConfig.dialogTitle==='查看'" v-model="editConfig.infomitton.groupNumber" value-key="name" placeholder="请选择车间"> |
| | | v-model="form.groupNumber" value-key="name" placeholder="请选择车间"> |
| | | <el-option |
| | | v-for="item in workshopList" |
| | | :key="item.ID" |
| | |
| | | type="textarea" |
| | | :autosize="{ minRows: 2, maxRows: 4}" |
| | | placeholder="请输入内容" |
| | | v-model="editConfig.infomitton.workshop"> |
| | | v-model="form.workshop"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="editConfig.visible = false">取 消</el-button> |
| | | <el-button type="primary" @click="commitForm('ruleForm')">确 定</el-button> |
| | | <el-button type="cancel" @click="cancelMethod()">取消</el-button> |
| | | <el-button type="primary" @click="commitForm('form')">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | // import {} from "@/api/systemSetting/workshopManage" |
| | | export default { |
| | | props: { |
| | | editDiaConfig: { |
| | | editRow: { |
| | | type: Object, |
| | | default: () => { |
| | | return { |
| | | visible: false, |
| | | dialogTitle: "添加", |
| | | isReadonly: true, |
| | | infomitton: { |
| | | }, |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | editConfig: this.editDiaConfig, |
| | | form: {}, |
| | | workshopList: [], |
| | | carFlagList: [ |
| | | ], |
| | | rules: { |
| | | workshopNumber: [ |
| | | { required: true, message: '请选择车间', trigger: 'change' } |
| | |
| | | |
| | | }, |
| | | methods: { |
| | | handleClose(done) { |
| | | done(); |
| | | }, |
| | | setParams() { |
| | | let params = { |
| | | workshopNumber: this.editConfig.infomitton.workshopNumber + '', |
| | | groupNumber: Number(this.editConfig.infomitton.groupNumber), |
| | | startCarNumber: Number(this.editConfig.infomitton.startCarNumber), |
| | | endCarNumber: Number(this.editConfig.infomitton.endCarNumber), |
| | | carFlag: Number(this.editConfig.infomitton.carFlag), |
| | | notes: this.editConfig.infomitton.notes, |
| | | // id:Number(this.editConfig.infomitton.workshopId), |
| | | } |
| | | return params |
| | | }, |
| | | |
| | | async commitForm(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | |
| | | |
| | | |
| | | } |
| | | }, |
| | | components: { |
| | | |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | <template slot="tableButton"> |
| | | <el-table-column label="操作" width="180"> |
| | | <template slot-scope="scope"> |
| | | <el-button @click.stop="handleClick(scope.row, '查看')" type="text" size="small">查看</el-button> |
| | | <el-button @click.stop="handleClick(scope.row, '修改')" type="text" size="small">修改</el-button> |
| | | <el-button @click.stop="handleClick(scope.row, '删除')" type="text" size="small">删除</el-button> |
| | | <el-button @click.stop="handleClick(scope.row)" type="text" size="small">修改</el-button> |
| | | <el-button @click.stop="delClick(scope.row)" type="text" size="small">删除</el-button> |
| | | |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </TableCommonView> |
| | | </div> |
| | | <AddDialog |
| | | :editDiaConfig="editConfig" |
| | | ref="add" :editRow="editRow" @refresh="refresh" |
| | | /> |
| | | <div class="btn-pager"> |
| | | <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> |
| | |
| | | <script> |
| | | import AddDialog from "@/views/employeeSalary/salaryPlan/components/addDialog.vue" |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import { getSalaryPlanList, deleteSalaryPlanInfo } from "@/api/employeeSalary/salaryPlan.js" |
| | | export default { |
| | | name: "salaryPlan", |
| | | props: {}, |
| | |
| | | { label: "工种", prop: "groupNumber",min:100 }, |
| | | { label: "薪资类型", prop: "startCarNumber",min:110 }, |
| | | { label: "计费周期", prop: "endCarNumber",min:110 }, |
| | | { label: "计费公式定义", prop: "carFlag", }, |
| | | { label: "计费公式定义", prop: "carFlag",min:140 }, |
| | | { label: "添加时间", prop: "notes",min:130 }, |
| | | { label: "添加人", prop: "notes",min:110 }, |
| | | ], |
| | | editConfig:{ |
| | | visible:false, |
| | | infomitton:{ |
| | | TabsIndex:0, |
| | | workshopId:null, |
| | | } |
| | | }, |
| | | getDataParams: { |
| | | keyWord: '', |
| | | }, |
| | | keyword: '', |
| | | editRow:{}, |
| | | } |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | this.getData(this.keyword) |
| | | }, |
| | | methods: { |
| | | setTable() { |
| | |
| | | this.showcol = val |
| | | this.tableList.tableColumn = this.setColumnVisible(val, this.tableColumn) |
| | | }, |
| | | // 请求数据 |
| | | async getData() { |
| | | this.loading = true |
| | | await getSalaryPlanList({ |
| | | keyword: this.keyword, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }) |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | if (res.data) { |
| | | const list = res.data |
| | | this.tableList.tableInfomation = list || [] |
| | | this.pagerOptions.totalCount = res.total |
| | | } else { |
| | | this.tableList.tableInfomation = [] |
| | | } |
| | | } else { |
| | | this.tableList.tableInfomation = [] |
| | | } |
| | | this.loading = false |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err) |
| | | this.tableList.tableInfomation = [] |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | // 新增 |
| | | addBtnClick() { |
| | | this.editConfig.infomitton={} |
| | |
| | | }, |
| | | // 搜索 |
| | | onFilterSearch(searchText) { |
| | | this.getDataParams.keyWord = searchText, |
| | | this.getData() |
| | | this.keyword= searchText, |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData() |
| | | }, |
| | | refresh(){ |
| | | this.getData() |
| | | }, |
| | | // 表格行点击 |
| | | tableRowClick(row) { |
| | | console.log(row, "row") |
| | | }, |
| | | // 编辑 |
| | | handleClick(row) { |
| | | let config=JSON.parse(JSON.stringify(row)); |
| | | this.editRow = { ...config, |
| | | title:'编辑', |
| | | type:'edit', |
| | | shopNameObj:{ |
| | | value:config.shopId, |
| | | label:config.shopName, |
| | | }, |
| | | workTypeObj:{ |
| | | value:config.workTypeId, |
| | | label:config.workType, |
| | | } |
| | | } |
| | | this.$refs.add.islook = true; |
| | | }, |
| | | // 删除 |
| | | delClick(row) { |
| | | this.$confirm("是否确认删除?", "警告", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | deleteSalaryPlanInfo({ id: row.id }).then((response) => { |
| | | if (response.code === 200) { |
| | | this.$message.success("删除成功") |
| | | this.getData() |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |