| | |
| | | <template> |
| | | <div> |
| | | <div class="body" style="background-color: #ffffff; padding: 20px 10px 0 20px;"> |
| | | <!-- <div class="body" style="background-color: #ffffff; padding: 20px 10px 0 20px;" :style="{height:mainHeight+'px'}">--> |
| | | <div> |
| | | <div class="body" :style="{height:mainHeight+'px'}"> |
| | | <div style="padding: 10px 5px 0 0"> |
| | | <el-form |
| | | ref="form" |
| | | :model="form" |
| | |
| | | inline |
| | | style="display: flex;justify-content: space-between" |
| | | > |
| | | <div style="display: flex;justify-content: space-around;width: 85%"> |
| | | <div class="elForm"> |
| | | <el-form-item label="用户编码" style=" display: flex;"> |
| | | <el-input v-model="form.UserCode" placeholder="请输入" style="width: calc(100%-30px)" /> |
| | | <el-input v-model="form.UserCode" placeholder="请输入" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="用户名称" style=" display: flex;"> |
| | | <el-input v-model="form.UserName" placeholder="请输入" style="width: calc(100%-30px)" /> |
| | | <el-input v-model="form.UserName" placeholder="请输入" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="所属组织" style=" display: flex;"> |
| | | <el-cascader |
| | | ref="cascader" |
| | | filterable |
| | | popper-class="elCascader" |
| | | :options="StuOrgArr" |
| | | :props="defaultProps" |
| | | @change="cascaderChange" |
| | | /> |
| | | <!-- @focus="getUserOrganization"--> |
| | | |
| | | </el-form-item> |
| | | <el-form-item label="工资类型" style=" display: flex;"> |
| | | <el-select v-model="form.wagetype" style="width: calc(100%-30px)" placeholder="请选择"> |
| | | <el-select |
| | | v-model="form.wagetype" |
| | | :popper-append-to-body="false" |
| | | filterable |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in wagetypeArr" |
| | | :key="item.value" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="在职状态" style=" display: flex;"> |
| | | <el-select v-model="form.Enable" style="width: calc(100%-30px)" placeholder="请选择"> |
| | | <el-select |
| | | v-model="form.Enable" |
| | | :popper-append-to-body="false" |
| | | filterable |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in EnableArr" |
| | | :key="item.value" |
| | |
| | | </div> |
| | | </el-form> |
| | | </div> |
| | | <div style="margin-bottom: 20px;display: flex;z-index: 2"> |
| | | <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> |
| | | <!-- :style="{width: 100+'%',height:tableHeight+'px'}"--> |
| | | <div style="display: flex;border: 1px solid #eee"> |
| | | <el-divider /> |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | :data="tableData" |
| | | border |
| | | stripe |
| | | :height="tableHeight+'px'" |
| | | highlight-current-row |
| | | |
| | | :style="{width: 100+'%',height:tableHeight+'px'}" |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="sortChange" |
| | |
| | | prop="RowNum" |
| | | width="50" |
| | | label="序号" |
| | | fixed |
| | | /> |
| | | <el-table-column |
| | | prop="usercode" |
| | | label="用户编码" |
| | | min-width="110" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="username" |
| | | label="用户名称" |
| | | min-width="110" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="password" |
| | | label="用户密码" |
| | | min-width="110" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="org_name" |
| | | label="所属组织" |
| | | min-width="110" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="group_name" |
| | | label="生产班组" |
| | | min-width="110" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="wagetype" |
| | | label="所属组织" |
| | | label="工资类型" |
| | | sortable="custom" |
| | | width="110" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.wagetype==='1'">计时制</div> |
| | |
| | | <el-table-column |
| | | prop="mobile" |
| | | label="联系方式" |
| | | min-width="110" |
| | | sortable="custom" |
| | | /> |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.mobile===''">/</div> |
| | | <div v-else>{{ row.mobile }}</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="email" |
| | | label="电子邮箱" |
| | | sortable="custom" |
| | | /> |
| | | min-width="110" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.email===''">/</div> |
| | | <div v-else>{{ row.email }}</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="" |
| | | prop="enable" |
| | | label="在职状态" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | |
| | | <el-table-column |
| | | prop="lm_user" |
| | | label="创建人员" |
| | | width="110" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="lm_date" |
| | | label="创建时间" |
| | | width="200" |
| | | show-overflow-tooltip |
| | | width="160" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="is_role" |
| | | label="关联角色" |
| | | width="110" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <i class="el-icon-share" @click="roleClick({row})" /> |
| | | <i v-if="row.is_role==='Y'" class="el-icon-share" @click="roleClick({row})" /> |
| | | <i v-if="row.is_role==='N'" class="el-icon-share" style="color: rgb(180 ,181, 185)" @click="roleClick({row})" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="操作" |
| | | fixed="right" |
| | | width="120" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-button type="text" @click="edit('edit',row)">修改</el-button> |
| | | <el-button type="text" @click="edit('edit',row)">编辑</el-button> |
| | | <el-button type="text" @click="del(row.id)">删除</el-button> |
| | | </div> |
| | | </template> |
| | |
| | | /> |
| | | </div> |
| | | |
| | | <!-- 用户清单新增、修改--> |
| | | <!-- 用户清单新增、编辑--> |
| | | <el-dialog |
| | | :title="operation==='add'?'添加':'修改'" |
| | | :title="operation==='add'?'新增':'编辑'" |
| | | :visible.sync="dialogVisible" |
| | | width="50%" |
| | | width="800px" |
| | | :close-on-click-modal="false" |
| | | top="15vh" |
| | | @closed="handleClose" |
| | | @close="handleClose" |
| | | > |
| | | <el-form ref="dialogForm" :rules="dialogFormRules" inline :model="dialogForm" label-width="80px"> |
| | | <el-form-item label="用户编码" prop="UserCode"> |
| | | <el-input v-model="dialogForm.UserCode" :disabled="operation!=='add'" style="width: 220px" /> |
| | | <el-input v-model="dialogForm.UserCode" :disabled="operation!=='add'" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="用户名称" prop="UserName"> |
| | | <el-input v-model="dialogForm.UserName" style="width: 220px" /> |
| | | <el-input v-model="dialogForm.UserName" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="用户密码" prop="Password"> |
| | | <el-input v-model="dialogForm.Password" style="width: 220px" /> |
| | | <el-input v-model="dialogForm.Password" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="在职状态" prop="Enable"> |
| | | <el-select |
| | | v-model="dialogForm.Enable" |
| | | style="width: 220px" |
| | | :popper-append-to-body="false" |
| | | filterable |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <div style="display: flex"> |
| | | <el-form-item label="所属组织" prop="StuOrg" style="display: flex"> |
| | | <el-cascader |
| | | ref="dialogCascader" |
| | | key="cascaderKey" |
| | | :options="StuOrgArr" |
| | | :props="defaultProps" |
| | | style="width: 220px;" |
| | | @change="dialogCascaderChange" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="工资类型" prop="wagetype"> |
| | | <el-select |
| | | v-model="dialogForm.wagetype" |
| | | style="width: 220px" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in wagetypeArr" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div> |
| | | <el-form-item label="联系方式"> |
| | | <el-input v-model="dialogForm.Mobile" style="width: 220px" /> |
| | | <el-form-item label="所属组织" prop="StuOrg" style="display: flex;float: left"> |
| | | <el-cascader |
| | | ref="dialogCascader" |
| | | key="cascaderKey" |
| | | filterable |
| | | popper-class="elCascader" |
| | | :options="StuOrgArr2" |
| | | :props="defaultProps" |
| | | style="width: 200px;" |
| | | @change="dialogCascaderChange" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="电子邮箱"> |
| | | <el-input v-model="dialogForm.Email" style="width: 220px" /> |
| | | <el-form-item label="所属班组" prop="groupcode"> |
| | | <el-select |
| | | v-model="dialogForm.groupcode" |
| | | :popper-append-to-body="false" |
| | | filterable |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in usergroupArr" |
| | | :key="item.group_code" |
| | | :label="item.group_name" |
| | | :value="item.group_code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="工资类型" prop="wagetype"> |
| | | <el-select |
| | | v-model="dialogForm.wagetype" |
| | | :popper-append-to-body="false" |
| | | filterable |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in wagetypeArr" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="联系方式" prop="Mobile"> |
| | | <el-input v-model="dialogForm.Mobile" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="电子邮箱" prop="Email"> |
| | | <el-input v-model="dialogForm.Email" style="width: 200px" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | |
| | | <el-dialog |
| | | title="关联角色" |
| | | :visible.sync="dialogVisibleRoles" |
| | | width="50%" |
| | | top="15vh" |
| | | width="800px" |
| | | :top="isIpad?'3vh':'15vh'" |
| | | :fullscreen="isIpad" |
| | | :close-on-click-modal="false" |
| | | class="dialogVisibleRoles" |
| | | @closed="handleCloseRoles" |
| | | @close="handleCloseRoles" |
| | |
| | | show-checkbox |
| | | node-key="code" |
| | | default-expand-all |
| | | style="height: 300px" |
| | | :props="defaultPropsOfRoleTree" |
| | | @check="checkBoxClick" |
| | | /> |
| | |
| | | </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> |
| | | |
| | | <!--导入组件--> |
| | | <import-picker ref="importPickerFunc" :shows.sync="shows" :title="title_value" :colos="colos" :code="code" /> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | import ImportPicker from '@/components/ImportPicker' |
| | | |
| | | import { |
| | | AddUpdateUser, |
| | | DeleteUser, SaveUserAssoctRole, UserAssociationRole, |
| | | DeleteUser, |
| | | SaveUserAssoctRole, |
| | | UserAssociationRole, |
| | | UserGroupAdd, |
| | | UserGroupDelete, |
| | | UserGroupSearch, |
| | | UserOrganization, |
| | | UserSearch |
| | | } from '@/api/jcsz' |
| | | import { getCookie } from '@/utils/auth' |
| | | import $ from 'jquery' |
| | | import clearAllChildren from '@/utils/global' |
| | | import { MesOrderStepReportSelectUserGroup } from '@/api/scgl' |
| | | |
| | | const SER_HZ = /^[\u4e00-\u9fa5]+$/ |
| | | export default { |
| | | name: 'Zzjg', |
| | | name: 'YYQD', |
| | | components: { |
| | | Pagination |
| | | Pagination, ImportPicker |
| | | }, |
| | | data() { |
| | | const validateName = (rule, value, callback) => { |
| | |
| | | } |
| | | } |
| | | } |
| | | const validateMobile = (rule, value, callback) => { |
| | | if (!value) { |
| | | callback() |
| | | // return callback(new Error('请输入电话号码')) |
| | | } else { |
| | | const mobile = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/ // 长号 |
| | | const mobile2 = /^[0-9]{6}$/ // 短号 |
| | | if (mobile.test(value) || mobile2.test(value)) { |
| | | callback() |
| | | // return callback(new Error('电话号码不符合规则')) |
| | | } else { |
| | | return callback(new Error('电话号码不符合规则')) |
| | | // callback() |
| | | } |
| | | } |
| | | } |
| | | const validateEmail = (rule, value, callback) => { |
| | | if (!value) { |
| | | callback() |
| | | // return callback(new Error('请输入电子邮箱')) |
| | | } else { |
| | | const email = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(.[a-zA-Z0-9_-]+)+$/ |
| | | if (email.test(value)) { |
| | | callback() |
| | | } else { |
| | | return callback(new Error('电子邮箱不符合规则')) |
| | | } |
| | | } |
| | | } |
| | | |
| | | return { |
| | | isIpad: false, |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | form: { |
| | |
| | | prop: 'lm_date', // 排序字段 |
| | | order: 'desc', // 排序字段 |
| | | page: 1, // 第几页 |
| | | rows: 10 // 每页多少条 |
| | | rows: 20 // 每页多少条 |
| | | }, |
| | | StuOrgArr: [], // 所属组织数组 |
| | | StuOrgArr2: [], // 所属组织数组 对话框 |
| | | defaultProps: { |
| | | checkStrictly: true, |
| | | value: 'code', |
| | |
| | | UserCode: '', |
| | | UserName: '', |
| | | Password: '', |
| | | Enable: '', |
| | | Enable: 'Y', |
| | | StuOrg: '', |
| | | Mobile: '', |
| | | Email: '', |
| | | groupcode: '', |
| | | Operator: '', |
| | | OperType: '', |
| | | wagetype: '' |
| | | }, |
| | | usergroupArr: [], // 生产班组数组 |
| | | wagetypeArr: [ |
| | | { value: '1', label: '计件制' }, |
| | | { value: '2', label: '计时制' } |
| | | { value: '2', label: '计件制' }, |
| | | { value: '1', label: '计时制' } |
| | | ], |
| | | operation: '', |
| | | dialogFormRules: { |
| | |
| | | ], |
| | | wagetype: [ |
| | | { required: true, message: '请选择工资类型', trigger: ['blur', 'change'] } |
| | | ], |
| | | groupcode: [ |
| | | { required: true, message: '请选择所属班组', trigger: ['blur', 'change'] } |
| | | ], |
| | | Mobile: [ |
| | | { required: false, validator: validateMobile, trigger: ['blur', 'change'] } |
| | | ], |
| | | Email: [ |
| | | { required: false, validator: validateEmail, trigger: ['blur', 'change'] } |
| | | ] |
| | | |
| | | }, |
| | | dialogVisibleRoles: false, |
| | | dialogFormRoles: { |
| | |
| | | value: 'code', |
| | | label: 'name', |
| | | children: 'children' |
| | | } |
| | | }, |
| | | workingDialogVisible: false, |
| | | workingTableData: [], |
| | | workingTableDataLength: 0, |
| | | formWorking: { |
| | | rows: 10, |
| | | page: 1, |
| | | prop: 'group_code', |
| | | order: 'desc' |
| | | }, |
| | | |
| | | title_value: '数据导入 / 用户清单', |
| | | code: '2', |
| | | shows: false |
| | | } |
| | | }, |
| | | watch: { |
| | | shows() { |
| | | if (!this.shows) { |
| | | this.getUserSearch() |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.getUserSearch() |
| | | this.getUserOrganization() |
| | | this.handleRequest() |
| | | }, |
| | | |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | handleRequest() { |
| | | this.getUserSearch().then(res => { |
| | | if (res.code === '200') { |
| | | this.getUserOrganization() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 获取用户清单 |
| | | async getUserSearch() { |
| | | const res = await UserSearch(this.form) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | return { code: res.code } |
| | | }, |
| | | // 获取所属组织 |
| | | async getUserOrganization() { |
| | | const { data: res } = await UserOrganization() |
| | | this.StuOrgArr = res |
| | | this.StuOrgArr = clearAllChildren(res) |
| | | }, |
| | | // 获取所属组织对话框 |
| | | async getUserOrganization2() { |
| | | const { data: res } = await UserOrganization() |
| | | this.StuOrgArr2 = clearAllChildren(res) |
| | | }, |
| | | // 导入按钮 |
| | | upload() { |
| | | |
| | | this.shows = true |
| | | this.$refs.importPickerFunc.newDataFunc() |
| | | }, |
| | | colos() { |
| | | this.shows = false |
| | | }, |
| | | // 排序改变时 |
| | | sortChange({ column, prop, order }) { |
| | |
| | | this.form.UserCode = '' |
| | | this.form.UserName = '' |
| | | this.form.StuOrg = '' |
| | | this.form.Enable = '' |
| | | this.form.Enable = 'Y' |
| | | this.form.wagetype = '' |
| | | this.$refs.cascader.checkedValue = ''// 级联选择器的清空 |
| | | this.getUserSearch() |
| | |
| | | dialogCascaderChange(val) { |
| | | this.dialogForm.StuOrg = val[val.length - 1] |
| | | }, |
| | | // 获取下拉生产班组 |
| | | async getMesOrderStepReportSelectUserGroup() { |
| | | const { data: res } = await MesOrderStepReportSelectUserGroup() |
| | | this.usergroupArr = res |
| | | }, |
| | | // 新增按钮 |
| | | add(operation) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | this.getUserOrganization2() |
| | | this.getMesOrderStepReportSelectUserGroup() |
| | | }, |
| | | // 修改按钮 |
| | | edit(operation, row) { |
| | |
| | | this.dialogForm.UserCode = row.usercode |
| | | this.dialogForm.UserName = row.username |
| | | this.dialogForm.Password = row.password |
| | | this.dialogForm.groupcode = row.group_code |
| | | this.dialogForm.Enable = row.enable |
| | | this.dialogForm.StuOrg = row.stu_torgcode |
| | | this.$refs.dialogCascader.checkedValue = row.stu_torgcode |
| | |
| | | this.dialogForm.Email = row.email |
| | | this.dialogForm.wagetype = row.wagetype |
| | | }) |
| | | this.getMesOrderStepReportSelectUserGroup() |
| | | this.getUserOrganization2() |
| | | }, |
| | | // 删除按钮 |
| | | async del(id) { |
| | |
| | | this.dialogForm.UserCode = '' |
| | | this.dialogForm.UserName = '' |
| | | this.dialogForm.Password = '' |
| | | this.dialogForm.Enable = '' |
| | | this.dialogForm.Enable = 'Y' |
| | | this.$refs.dialogCascader.checkedValue = '' |
| | | this.dialogForm.StuOrg = '' |
| | | this.dialogForm.Mobile = '' |
| | | this.dialogForm.Email = '' |
| | | this.dialogForm.groupcode = '' |
| | | this.dialogForm.wagetype = '' |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |
| | |
| | | StuOrg: Array.isArray(this.$refs.dialogCascader.checkedValue) ? this.$refs.dialogCascader.checkedValue[this.$refs.dialogCascader.checkedValue.length - 1] : this.$refs.dialogCascader.checkedValue, |
| | | Mobile: this.dialogForm.Mobile, |
| | | Email: this.dialogForm.Email, |
| | | groupcode: this.dialogForm.groupcode, |
| | | wagetype: this.dialogForm.wagetype, |
| | | OperType: this.operation === 'add' ? 'Add' : 'Update', |
| | | Operator: getCookie('admin') |
| | |
| | | // 获取页面高度 |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 200 |
| | | this.tableHeight = this.mainHeight - 100 |
| | | this.mainHeight = window.innerHeight - 250 |
| | | this.tableHeight = this.mainHeight - 50 |
| | | if (window.innerHeight < 769) { |
| | | this.tableHeight = this.tableHeight - 50 |
| | | } |
| | | this.isIpad = window.innerHeight < 769 && window.innerWidth < 1367 |
| | | }) |
| | | }, |
| | | // 关联角色点击事件 |
| | |
| | | const res = await SaveUserAssoctRole(this.dialogFormRoles.roleTreeSelectedArr, this.dialogFormRoles.usercode) |
| | | if (res.code === '200') { |
| | | this.$message.success('保存成功!') |
| | | await this.getUserSearch() |
| | | this.dialogVisibleRoles = false |
| | | } |
| | | }, |
| | |
| | | if (i.Code === checkedFatherCode) { |
| | | this.dialogFormRoles.roleTreeSelectedArr[ind].Data.forEach((i1, ind2) => { |
| | | if (i1 === a[0]) { |
| | | this.dialogFormRoles.roleTreeSelectedArr[ind].Data.splice(ind2, 1)// 当子code与现在的code相同时执行 |
| | | // this.dialogFormRoles.roleTreeSelectedArr[ind].Data.splice(ind2, 1)// 当子code与现在的code相同时执行 |
| | | this.dialogFormRoles.roleTreeSelectedArr[ind].Data = this.dialogFormRoles.roleTreeSelectedArr[ind].Data.filter(i2 => i2 !== a[0]) |
| | | } else { |
| | | this.dialogFormRoles.roleTreeSelectedArr[ind].Data.push(a[0])// //当子code与现在的code不相同时执行 |
| | | } |
| | |
| | | this.dialogFormRoles.roleTreeSelectedArr.forEach((it, ind) => { |
| | | if (it.Code === checkedFatherCode) { |
| | | console.log(it.Code, 9) |
| | | console.log(this.dialogFormRoles.roleTreeSelectedArr.splice(ind, 1), 7) |
| | | this.dialogFormRoles.roleTreeSelectedArr.splice(ind, 1) |
| | | } |
| | | }) |
| | | this.dialogFormRoles.rolesArrSelectedArr.forEach((i, i1) => { |
| | | if (i === checkedFatherCode) { |
| | | console.log(this.dialogFormRoles.rolesArrSelectedArr.splice(i1, 1), 8) |
| | | this.dialogFormRoles.rolesArrSelectedArr.splice(i1, 1) |
| | | } |
| | | }) |
| | | } |
| | |
| | | } else { // 当父类由半叶变为全叶时 |
| | | this.dialogFormRoles.roleTreeSelectedArr.forEach((i1, ind) => { |
| | | if (i1.Code === checkedFatherCode) { // i1没找对 |
| | | console.log(i1, this.dialogFormRoles.roleTreeSelectedArr.splice(ind, 1), 8) |
| | | this.dialogFormRoles.roleTreeSelectedArr.splice(ind, 1) |
| | | temp.forEach(it => { |
| | | this.dialogFormRoles.roleTreeSelectedArr.push({ |
| | | Code: it.code, |
| | |
| | | console.log(this.dialogFormRoles.rolesArrSelectedArr, 78) |
| | | this.dialogFormRoles.rolesArrSelectedArr.forEach((i, i1) => { |
| | | if (i === it.code) { |
| | | console.log(this.dialogFormRoles.rolesArrSelectedArr.splice(i1, 1), 6664) |
| | | this.dialogFormRoles.rolesArrSelectedArr.splice(i1, 1) |
| | | } |
| | | }) |
| | | this.dialogFormRoles.roleTreeSelectedArr.forEach((i, i1) => { |
| | | if (i.Code === it.code) { |
| | | console.log(i1, this.dialogFormRoles.roleTreeSelectedArr.splice(i1, 1), 6665) |
| | | this.dialogFormRoles.roleTreeSelectedArr.splice(i1, 1) |
| | | } |
| | | }) |
| | | } |
| | |
| | | // }) |
| | | 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.getMesOrderStepReportSelectUserGroup() |
| | | }, |
| | | // 生产班组排序 |
| | | 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> |
| | |
| | | height: 30px; |
| | | display: flex; |
| | | align-items: center; |
| | | //border: 1px solid $main_color; |
| | | border: none; |
| | | padding: 0 20px; |
| | | } |
| | | |
| | | ::v-deep .el-button--primary:hover { |
| | | border: none; |
| | | } |
| | | |
| | | ::v-deep .el-button--info { |
| | |
| | | height: 30px; |
| | | display: flex; |
| | | align-items: center; |
| | | padding: 0 20px; |
| | | } |
| | | |
| | | ::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active { |
| | | background-color: $main_color !important; |
| | | } |
| | | |
| | | ::v-deep .el-dialog__footer { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | } |
| | | |
| | | .footerButton { |
| | |
| | | height: 30px; |
| | | display: flex; |
| | | align-items: center; |
| | | padding: 0 20px; |
| | | } |
| | | |
| | | ::v-deep .el-button--default:hover { |
| | |
| | | |
| | | ::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 { |
| | |
| | | |
| | | ::v-deep .el-input__inner { |
| | | height: 30px; |
| | | line-height:30px; |
| | | line-height: 30px; |
| | | } |
| | | |
| | | ::v-deep .el-table .caret-wrapper { |
| | | //float: right; |
| | | transform: scale(0.8); |
| | | } |
| | | |
| | |
| | | |
| | | ::v-deep .el-checkbox.is-bordered + .el-checkbox.is-bordered { |
| | | margin: 10px 30px 0px 0; |
| | | //cursor: default !important; |
| | | } |
| | | |
| | | ::v-deep .el-radio__input.is-checked + .el-radio__label { |
| | |
| | | } |
| | | |
| | | .dialogVisibleRoles { |
| | | //::v-deep .el-checkbox.is-bordered.el-checkbox--medium{ |
| | | // pointer-events: none; |
| | | //} |
| | | |
| | | //::v-deep .el-checkbox__label{ |
| | | // pointer-events: none !important; |
| | | // color: red; |
| | | //} |
| | | .myCheckboxGroup { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | |
| | | .myCheckbox { |
| | | //border: 1px solid $main_color; |
| | | border: 1px solid #eee; |
| | | display: flex; |
| | | min-width: 100px; |
| | |
| | | |
| | | } |
| | | |
| | | //.myCheckbox{ |
| | | // border: 1px solid $main_color; |
| | | //} |
| | | |
| | | input[type=checkbox] { |
| | | cursor: pointer; |
| | | position: relative; |
| | |
| | | input[type=checkbox]::after { |
| | | position: absolute; |
| | | top: 0; |
| | | //color: rgb(130, 35, 35); |
| | | color: $main_color; |
| | | width: 14px; |
| | | height: 14px; |
| | | display: inline-block; |
| | | visibility: visible; |
| | | padding-left: 0px; |
| | | padding-left: 0; |
| | | text-align: center; |
| | | content: ' '; |
| | | border-radius: 3px |
| | |
| | | background-color: $main_color; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .body ::v-deep .el-divider { |
| | | border: 1px solid #eee; |
| | | width: 99%; |
| | | margin: 10px auto; |
| | | } |
| | | |
| | | .body ::v-deep .el-form-item { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | ::v-deep .el-input__inner:focus { |
| | | border-color: $main_color; |
| | | } |
| | | |
| | | ::v-deep .el-select .el-input__inner:focus { |
| | | border-color: $main_color; |
| | | } |
| | | |
| | | ::v-deep .el-select-dropdown__item.selected { |
| | | color: $main_color; |
| | | } |
| | | |
| | | ::v-deep .el-input__inner:focus { |
| | | border-color: #42b983 !important; |
| | | } |
| | | |
| | | //::v-deep .el-cascader:not(.is-disabled):hover .el-input__inner:focus { |
| | | // border-color: #42b983 !important; |
| | | //} |
| | | </style> |
| | | <style lang="scss"> |
| | | .elCascader { |
| | | //.el-cascader-node.in-active-path, .el-cascader-node.is-active, .el-cascader-node.is-selectable.in-checked-path { |
| | | // color: #42b983 ; |
| | | //} |
| | | .el-cascader-node.is-selectable.in-checked-path { |
| | | color: #42b983; |
| | | } |
| | | |
| | | .el-radio__input.is-checked .el-radio__inner { |
| | | background-color: #42b983; |
| | | border-color: #42b983; |
| | | } |
| | | |
| | | .el-radio__input.is-checked .el-radio__inner:hover { |
| | | border-color: #42b983; |
| | | } |
| | | |
| | | .el-input__inner { |
| | | border-color: #42b983 !important; |
| | | } |
| | | |
| | | } |
| | | </style> |