| | |
| | | <el-divider /> |
| | | <div style="margin-left: 10px;display: flex"> |
| | | <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button> |
| | | <el-button type="primary" icon="el-icon-menu" @click="workingTramClick">生产班组</el-button> |
| | | <el-button type="primary" icon="el-icon-upload2" @click="upload">导入</el-button> |
| | | </div> |
| | | <el-divider /> |
| | |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="group_name" |
| | | label="生产班组" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="wagetype" |
| | | label="所属组织" |
| | | label="工资类型" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | |
| | | <el-dialog |
| | | :title="operation==='add'?'新增':'编辑'" |
| | | :visible.sync="dialogVisible" |
| | | width="65%" |
| | | width="800px" |
| | | :close-on-click-modal="false" |
| | | top="15vh" |
| | | @closed="handleClose" |
| | |
| | | <el-dialog |
| | | title="关联角色" |
| | | :visible.sync="dialogVisibleRoles" |
| | | width="65%" |
| | | width="800px" |
| | | top="15vh" |
| | | :fullscreen="isFullscreen" |
| | | :close-on-click-modal="false" |
| | |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 产组按钮对话框--> |
| | | <el-dialog |
| | | title="生产班组" |
| | | :visible.sync="workingDialogVisible" |
| | | width="800px" |
| | | top="15vh" |
| | | :close-on-click-modal="false" |
| | | class="workingDialogVisible" |
| | | @close="handleCloseWorking" |
| | | > |
| | | <div style="margin-bottom: 20px;display: flex"> |
| | | <el-button type="primary" icon="el-icon-circle-plus-outline" @click="addWorking">新增</el-button> |
| | | <!-- <el-button type="primary" icon="el-icon-delete" @click="delSetting">删除</el-button>--> |
| | | </div> |
| | | <el-table |
| | | :data="workingTableData" |
| | | border |
| | | height="300" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="sortChangeOfWorking" |
| | | > |
| | | <!-- :style="{width: 100+'%',height:tableHeight-300+'px'}"--> |
| | | |
| | | <!-- <el-table-column--> |
| | | <!-- type="selection"--> |
| | | <!-- width="50"--> |
| | | <!-- />--> |
| | | <el-table-column |
| | | width="50" |
| | | label="序号" |
| | | prop="RowNum" |
| | | /> |
| | | <el-table-column |
| | | prop="group_code" |
| | | label="班组编码" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input v-if="row.isVisible===1" v-model="row.group_code" placeholder="请输入" /> |
| | | <div v-else> {{ row.group_code }}</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="group_name" |
| | | label="班组名称" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input v-if="row.isVisible===1" v-model="row.group_name" placeholder="请输入" /> |
| | | <div v-else> {{ row.group_name }}</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="description" |
| | | label="班组描述" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input v-if="row.isVisible===1" v-model="row.description" placeholder="请输入" /> |
| | | <div v-else> {{ row.description }}</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作"> |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-button v-if="row.isVisible===0" type="text" @click="delWorking(row)">删除</el-button> |
| | | <el-button v-if="row.isVisible===1" type="text" @click="saveWorking(row)">保存</el-button> |
| | | <el-button v-if="row.isVisible===1" type="text" @click="cancelWorking(row)">取消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!--分页--> |
| | | <pagination |
| | | v-show="workingTableDataLength>0" |
| | | :total="workingTableDataLength" |
| | | :page.sync="formWorking.page" |
| | | :limit.sync="formWorking.rows" |
| | | align="right" |
| | | layout="prev, pager, next,sizes" |
| | | popper-class="select_bottom" |
| | | @pagination="getUserGroupSearch" |
| | | /> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button @click="WorkingDialogVisibleCancel">返回</el-button> |
| | | <!-- <el-button type="primary" @click="settingDialogVisibleConfirm">确 定</el-button>--> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import Pagination from '@/components/Pagination' |
| | | import { |
| | | AddUpdateUser, |
| | | DeleteUser, SaveUserAssoctRole, UserAssociationRole, |
| | | DeleteUser, |
| | | RoleTypeAdd, |
| | | RoleTypeDelete, |
| | | SaveUserAssoctRole, |
| | | UserAssociationRole, |
| | | UserGroupAdd, |
| | | UserGroupDelete, |
| | | UserGroupSearch, |
| | | UserOrganization, |
| | | UserSearch |
| | | } from '@/api/jcsz' |
| | |
| | | value: 'code', |
| | | label: 'name', |
| | | children: 'children' |
| | | }, |
| | | workingDialogVisible: false, |
| | | workingTableData: [], |
| | | workingTableDataLength: 0, |
| | | formWorking: { |
| | | rows: 10, |
| | | page: 1, |
| | | prop: 'group_code', |
| | | order: 'desc' |
| | | } |
| | | |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | // }) |
| | | console.log(this.dialogFormRoles.rolesArrSelectedArr, 6666) |
| | | console.log(this.dialogFormRoles.roleTreeSelectedArr, 6777) |
| | | } |
| | | }, |
| | | |
| | | /* |
| | | 生产班组模块 |
| | | */ |
| | | // 生产班组按钮点击 |
| | | workingTramClick() { |
| | | this.workingDialogVisible = true |
| | | this.getUserGroupSearch() |
| | | }, |
| | | // 生产班组对话框关闭事件 |
| | | handleCloseWorking() { |
| | | this.workingTableData.forEach((item, index) => { |
| | | if (item.isVisible === 1) { |
| | | this.workingTableData.splice(index, 1) |
| | | } |
| | | }) |
| | | // this.getUserGroupSearch() |
| | | }, |
| | | // 生产班组排序 |
| | | sortChangeOfWorking({ column, prop, order }) { |
| | | if (order === 'descending') { |
| | | order = 'desc' |
| | | } else if (order === 'ascending') { |
| | | order = 'asc' |
| | | } else { |
| | | order = 'desc' |
| | | } |
| | | this.form.order = order |
| | | this.form.prop = prop |
| | | this.getUserGroupSearch() |
| | | }, |
| | | // 获取生产班组列表 |
| | | async getUserGroupSearch() { |
| | | const res = await UserGroupSearch(this.formWorking) |
| | | this.workingTableData = res.data |
| | | this.workingTableDataLength = res.count |
| | | this.workingTableData.forEach(item => { |
| | | item.isVisible = 0 |
| | | }) |
| | | }, |
| | | // 新增 |
| | | addWorking() { |
| | | let number = Math.random() * Math.random()// 作为删除时的标识符 |
| | | number = number === 0 ? (10 + Math.random()) : number |
| | | const data = { group_code: '', group_name: '', description: '', isVisible: 1, number: number } |
| | | this.workingTableData.unshift(data) |
| | | }, |
| | | // 删除 |
| | | delWorking(row) { |
| | | this.$confirm('是否确认删除?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | UserGroupDelete({ UserGrupCode: row.group_code }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('删除成功!') |
| | | this.getUserGroupSearch() |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message.info('已取消删除') |
| | | }) |
| | | }, |
| | | // 保存 |
| | | async saveWorking(row) { |
| | | if (row.group_code.trim().length < 1) { |
| | | return this.$message.info('班组编码不能为空!') |
| | | } |
| | | if (row.group_name.trim().length < 1) { |
| | | return this.$message.info('班组名称不能为空!') |
| | | } |
| | | if (row.description.trim().length < 1) { |
| | | return this.$message.info('班组描述不能为空!') |
| | | } |
| | | const data = { |
| | | code: row.group_code, |
| | | name: row.group_name, |
| | | flag: row.description |
| | | } |
| | | const res = await UserGroupAdd([data]) |
| | | if (res.code === '200') { |
| | | this.$message.success('保存成功!') |
| | | await this.getUserGroupSearch() |
| | | } |
| | | }, |
| | | // 取消 |
| | | cancelWorking(row) { |
| | | this.workingTableData.forEach((item, index) => { |
| | | if (item.isVisible === 1 && item.number === row.number) { |
| | | this.workingTableData.splice(index, 1) |
| | | } |
| | | }) |
| | | }, |
| | | // 生产班组返回按钮 |
| | | WorkingDialogVisibleCancel() { |
| | | this.workingDialogVisible = false |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | color: #606266; |
| | | } |
| | | |
| | | //::v-deep .el-dialog__body { |
| | | // padding: 20px 100px !important; |
| | | //} |
| | | ::v-deep .el-dialog__body { |
| | | padding: 20px 100px !important; |
| | | } |
| | | |
| | | .workingDialogVisible ::v-deep .el-dialog__body{ |
| | | padding: 20px 20px !important; |
| | | } |
| | | |
| | | ::v-deep .el-radio__input.is-checked .el-radio__inner { |
| | | background-color: $main_color; |