| | |
| | | > |
| | | <div class="elForm"> |
| | | <el-form-item label="车间名称" style=" display: flex;"> |
| | | <el-input v-model="form.postcode" placeholder="请输入" style="width: 200px" /> |
| | | <el-select |
| | | v-model="form.wkshop_code" |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in wkshopArr" |
| | | :key="item.torg_code" |
| | | :label="item.torg_name" |
| | | :value="item.torg_code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="参加人员" style=" display: flex;"> |
| | | <el-input v-model="form.postname" placeholder="请输入" style="width: 200px" /> |
| | | <el-form-item label="创建人员" style=" display: flex;"> |
| | | <el-select |
| | | v-model="form.creatuser" |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in creatuserArr" |
| | | :key="item.usercode" |
| | | :label="item.username" |
| | | :value="item.usercode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="创建时间" style=" display: flex;"> |
| | | <el-input v-model="form.postname" placeholder="请输入" style="width: 200px" /> |
| | | <el-date-picker |
| | | v-model="form.creatdate" |
| | | type="daterange" |
| | | range-separator="~" |
| | | class="timeMini" |
| | | size="mini" |
| | | style="width: 200px;display: flex;line-height: 34px;height: 34px;" |
| | | :clearable="false" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | /> |
| | | </el-form-item> |
| | | </div> |
| | | <div |
| | | class="bodySearchReset" |
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}" |
| | | > |
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="getPostData">查询</el-button> |
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="getAttendanceSettSearch">查询</el-button> |
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">重置</el-button> |
| | | </div> |
| | | </el-form> |
| | |
| | | label="序号" |
| | | /> |
| | | <el-table-column |
| | | prop="postcode" |
| | | label="岗位编码" |
| | | prop="wkshop_name" |
| | | label="所属车间" |
| | | width="110" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="postname" |
| | | label="岗位名称" |
| | | prop="workhouse" |
| | | label="上班时间" |
| | | width="110" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="status" |
| | | label="状态" |
| | | prop="uphouse" |
| | | label="上班打卡后置时间(分钟)" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-tag v-if="row.status==='Y'" size="small" type="success">正常</el-tag> |
| | | <el-tag v-if="row.status==='N'" size="small" type="danger">停用</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | /> |
| | | <el-table-column |
| | | prop="description" |
| | | label="描述" |
| | | prop="closehouse" |
| | | label="下班时间" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.description ? row.description : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | /> |
| | | <el-table-column |
| | | prop="downhouse" |
| | | label="下班打卡前置时间(分钟)" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="workprice" |
| | | label="上班工价/小时" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="overprice" |
| | | label="加班工价/小时" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="username" |
| | | label="创建人员" |
| | | sortable="custom" |
| | | width="110" |
| | | /> |
| | | <el-table-column |
| | | prop="lm_date" |
| | |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes,jumper" |
| | | popper-class="select_bottom" |
| | | @pagination="getPostData" |
| | | @pagination="getAttendanceSettSearch" |
| | | /> |
| | | </div> |
| | | |
| | |
| | | v-el-drag-dialog |
| | | :title="operation==='add'?'新增':'编辑'" |
| | | :visible.sync="dialogVisible" |
| | | width="800px" |
| | | width="900px" |
| | | :close-on-click-modal="false" |
| | | top="15vh" |
| | | @closed="handleClose" |
| | | @close="handleClose" |
| | | > |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px"> |
| | | <el-form-item label="岗位编码" prop="postcode"> |
| | | <el-input v-model="dialogForm.postcode" :disabled="operation!=='add'" style="width: 200px" /> |
| | | <el-form |
| | | ref="dialogForm" |
| | | inline |
| | | :rules="dialogFormRules" |
| | | :model="dialogForm" |
| | | label-width="140px" |
| | | > |
| | | <el-form-item label="车间名称" prop="wkshop_code"> |
| | | <el-select |
| | | v-model="dialogForm.wkshop_code" |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | :disabled="operation==='edit'" |
| | | > |
| | | <el-option |
| | | v-for="item in wkshopArr" |
| | | :key="item.torg_code" |
| | | :label="item.torg_name" |
| | | :value="item.torg_code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="岗位名称" prop="postname"> |
| | | <el-input v-model="dialogForm.postname" style="width: 200px" /> |
| | | <el-form-item label="车间名称" style="opacity: 0"> |
| | | <!-- <el-select--> |
| | | <!-- v-model="dialogForm.wkshop_code"--> |
| | | <!-- style="width: 200px"--> |
| | | <!-- placeholder="请选择"--> |
| | | <!-- >--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in wkshopArr"--> |
| | | <!-- :key="item.torg_code"--> |
| | | <!-- :label="item.torg_name"--> |
| | | <!-- :value="item.torg_code"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | </el-form-item> |
| | | <el-form-item label="描述"> |
| | | <el-form-item label="上班时间" prop="workhouse"> |
| | | <el-time-select |
| | | v-model="dialogForm.workhouse" |
| | | placeholder="上班时间" |
| | | style="width: 200px" |
| | | :picker-options="{ |
| | | start: '06:30', |
| | | step: '00:15', |
| | | end: '18:30' |
| | | }" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="下班时间" prop="closehouse"> |
| | | <el-time-select |
| | | v-model="dialogForm.closehouse" |
| | | placeholder="下班时间" |
| | | style="width: 200px" |
| | | :picker-options="{ |
| | | start: '06:30', |
| | | step: '00:15', |
| | | end: '18:30', |
| | | minTime: dialogForm.workhouse |
| | | }" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="上班后置(分钟)" prop="uphouse"> |
| | | <el-input |
| | | v-model="dialogForm.description" |
| | | type="textarea" |
| | | v-model="dialogForm.uphouse" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | style="width: 200px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item required label="岗位状态"> |
| | | <el-radio-group v-model="dialogForm.status"> |
| | | <el-radio label="Y">正常</el-radio> |
| | | <el-radio label="N">停用</el-radio> |
| | | </el-radio-group> |
| | | <el-form-item label="下班前置(分钟)" prop="downhouse"> |
| | | <el-input |
| | | v-model="dialogForm.downhouse" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | style="width: 200px" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="上班工价(元/小时)" prop="workprice"> |
| | | <el-input |
| | | v-model="dialogForm.workprice" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | style="width: 200px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="加班工价(元/小时)" prop="overprice"> |
| | | <el-input |
| | | v-model="dialogForm.overprice" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | style="width: 200px" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | import { AddUpdatePost, DeletePost, PostData } from '@/api/basicSettings' |
| | | import { validateCode } from '@/utils/global' |
| | | import { handleDatetime } from '@/utils/global' |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | | import waves from '@/directive/waves' |
| | | import { PersonPermissions, PrentOrganizationNoCompany } from '@/api/GeneralBasicData' |
| | | import { AttendanceSettAddUpdate, AttendanceSettDelete, AttendanceSettSearch } from '@/api/attendanceModule' |
| | | |
| | | export default { |
| | | name: 'AttendanceSettings', |
| | |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | form: { |
| | | postcode: '', // 组织架构编码 |
| | | postname: '', // 组织架构名称 |
| | | wkshop_code: '', |
| | | creatuser: '', |
| | | creatdate: '', |
| | | prop: 'lm_date', // 排序字段 |
| | | order: 'desc', // 排序字段 |
| | | page: 1, // 第几页 |
| | |
| | | }, |
| | | total: 10, |
| | | tableData: [], |
| | | |
| | | wkshopArr: [], |
| | | creatuserArr: [], |
| | | |
| | | dialogVisible: false, |
| | | dialogForm: { |
| | | postcode: '', // 组织编码 |
| | | postname: '', // 组织名称 |
| | | description: '', // 描述 |
| | | status: 'Y'// 状态 |
| | | 'wkshop_code': '', |
| | | 'workhouse': '', |
| | | 'closehouse': '', |
| | | 'workprice': '', |
| | | 'overprice': '', |
| | | 'uphouse': '', |
| | | 'downhouse': '' |
| | | }, |
| | | operation: '', |
| | | dialogFormRules: { |
| | | postcode: [ |
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] } |
| | | wkshop_code: [ |
| | | { required: true, message: '请选择所属车间', trigger: ['blur', 'change'] } |
| | | ], |
| | | postname: [ |
| | | { required: true, message: '请输入岗位名称', trigger: ['blur', 'change'] } |
| | | workhouse: [ |
| | | { required: true, message: '请选择上班时间', trigger: ['blur', 'change'] } |
| | | ], |
| | | closehouse: [ |
| | | { required: true, message: '请选择下班时间', trigger: ['blur', 'change'] } |
| | | ], |
| | | uphouse: [ |
| | | { required: true, message: '请输入上班后置', trigger: ['blur', 'change'] } |
| | | ], |
| | | downhouse: [ |
| | | { required: true, message: '请输入下班后置', trigger: ['blur', 'change'] } |
| | | ], |
| | | workprice: [ |
| | | { required: true, message: '请输入上班工价', trigger: ['blur', 'change'] } |
| | | ], |
| | | overprice: [ |
| | | { required: true, message: '请输入加班工价', trigger: ['blur', 'change'] } |
| | | ] |
| | | } |
| | | |
| | | } |
| | | }, |
| | | created() { |
| | | this.getPostData() |
| | | }, |
| | | mounted() { |
| | | activated() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | created() { |
| | | this.getAttendanceSettSearch() |
| | | }, |
| | | async mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | await this.getPrentOrganizationNoCompany() |
| | | await this.getPersonPermissions() |
| | | }, |
| | | methods: { |
| | | // 组织架构大列表查询 |
| | | async getPostData() { |
| | | const res = await PostData(this.form) |
| | | async getPrentOrganizationNoCompany() { |
| | | const { data: res } = await PrentOrganizationNoCompany() |
| | | this.wkshopArr = res |
| | | }, |
| | | async getPersonPermissions() { |
| | | const { data: res } = await PersonPermissions() |
| | | this.creatuserArr = res |
| | | }, |
| | | |
| | | async getAttendanceSettSearch() { |
| | | let tempDate = this.form.creatdate |
| | | if (tempDate.length > 0) { |
| | | tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1]) |
| | | } |
| | | const data = { |
| | | wkshop_code: this.form.wkshop_code, |
| | | creatuser: this.form.creatuser, |
| | | creatdate: tempDate, |
| | | prop: this.form.prop, |
| | | order: this.form.order, |
| | | page: this.form.page, |
| | | rows: this.form.rows |
| | | } |
| | | const res = await AttendanceSettSearch(data) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | }, |
| | |
| | | } |
| | | this.form.order = order |
| | | this.form.prop = prop |
| | | this.getPostData() |
| | | this.getAttendanceSettSearch() |
| | | }, |
| | | // 重置 |
| | | reset() { |
| | | this.form.postcode = '' |
| | | this.form.postname = '' |
| | | this.getPostData() |
| | | this.form.wkshop_code = '' |
| | | this.form.creatuser = '' |
| | | this.form.creatdate = '' |
| | | this.getAttendanceSettSearch() |
| | | }, |
| | | // 新增按钮 |
| | | add(operation) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | this.dialogForm.OperType = 'Add' |
| | | }, |
| | | // 修改按钮 |
| | | async edit(operation, row) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | this.dialogForm.OperType = 'Update' |
| | | |
| | | this.$nextTick(() => { |
| | | this.dialogForm.postcode = row.postcode |
| | | this.dialogForm.postname = row.postname |
| | | this.dialogForm.description = row.description |
| | | this.dialogForm.status = row.status |
| | | this.dialogForm.wkshop_code = row.wkshop_code |
| | | this.dialogForm.workhouse = row.workhouse |
| | | this.dialogForm.closehouse = row.closehouse |
| | | this.dialogForm.workprice = row.workprice |
| | | this.dialogForm.overprice = row.overprice |
| | | this.dialogForm.uphouse = row.uphouse |
| | | this.dialogForm.downhouse = row.downhouse |
| | | }) |
| | | }, |
| | | // 删除按钮 |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | DeletePost({ postcode: row.postcode }).then(res => { |
| | | const data = { |
| | | 'wkshop_code': row.wkshop_code, |
| | | 'workhouse': row.workhouse, |
| | | 'closehouse': row.closehouse, |
| | | 'workprice': row.workprice, |
| | | 'overprice': row.overprice, |
| | | 'uphouse': row.uphouse, |
| | | 'downhouse': row.downhouse |
| | | } |
| | | AttendanceSettDelete(data).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success('删除成功!') |
| | | if (this.form.page > 1 && this.tableData.length === 1) { |
| | | this.form.page-- |
| | | } |
| | | this.getPostData() |
| | | this.getAttendanceSettSearch() |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | |
| | | }, |
| | | // 对话框关闭事件 |
| | | handleClose() { |
| | | this.dialogForm.postcode = '' |
| | | this.dialogForm.postname = '' |
| | | this.dialogForm.status = 'Y' |
| | | this.dialogForm.description = '' |
| | | this.dialogForm.wkshop_code = '' |
| | | this.dialogForm.workhouse = '' |
| | | this.dialogForm.closehouse = '' |
| | | this.dialogForm.workprice = '' |
| | | this.dialogForm.overprice = '' |
| | | this.dialogForm.uphouse = '' |
| | | this.dialogForm.downhouse = '' |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |
| | | // 对话框取消 |
| | |
| | | this.$refs.dialogForm.validate(valid => { |
| | | if (valid) { |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | AddUpdatePost(this.dialogForm).then(res => { |
| | | AttendanceSettAddUpdate(this.dialogForm, this.operation === 'add' ? 'Add' : 'Update').then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success(this.operation === 'add' ? '添加成功!' : '修改成功!') |
| | | this.dialogVisible = false |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.getPostData() |
| | | this.getAttendanceSettSearch() |
| | | } else { |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.$notify.error(this.operation === 'add' ? '添加失败!' : '修改失败!') |
| | |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | ::v-deep .el-select__caret { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | ::v-deep .el-range__icon { |
| | | line-height: 28px !important; |
| | | } |
| | | |
| | | ::v-deep .el-range-separator { |
| | | line-height: 28px !important; |
| | | } |
| | | |
| | | ::v-deep .el-range-input { |
| | | font-size: 14px; |
| | | } |
| | | |
| | | ::v-deep .el-range-separator { |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | } |
| | | |
| | | ::v-deep .el-progress-bar__innerText { |
| | | display: none !important; |
| | | } |
| | | |
| | | //.custom-table-class { |
| | | // ::v-deep .el-table__row { |
| | | // height: 80px; |
| | | // line-height:80px; |
| | | // } |
| | | //} |
| | | |
| | | </style> |