| | |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // 通过选择的所属组织查询所属班组 |
| | | export function StorgGroupSelect(data) { |
| | | return request({ |
| | | url: 'BaseDate/StorgGroupSelect', |
| | | method: 'get', |
| | | params: data |
| | | }) |
| | | } |
| | |
| | | // 生成可访问的路由表 |
| | | await store.dispatch('permission/generateRoutes', menu) |
| | | |
| | | // eslint-disable-next-line require-atomic-updates |
| | | store.state.settings.orgType = getCookie('description') |
| | | |
| | | // 动态添加可访问路由表 |
| | | router.addRoutes(store.getters.addRouters) |
| | | |
| | |
| | | |
| | | leftBackgroundColorValue: true, // 左侧栏背景颜色 |
| | | |
| | | animationType: 'fade-transform'// 动画类型 初始类型:fade-transform |
| | | animationType: 'fade-transform', // 动画类型 初始类型:fade-transform |
| | | |
| | | orgType: ''// 组织类型 D 部门 W 车间 '' 管理员 |
| | | |
| | | } |
| | |
| | | setCookie('userid', res.data.userid) |
| | | setCookie('rediskey', res.data.rediskey) |
| | | setCookie('guid', res.data.guid) |
| | | setCookie('stu_torgcode', res.data.stu_torgcode) |
| | | setCookie('description', res.data.description) |
| | | // } |
| | | // console.log(res.code === '302', 8989) |
| | | // if (res.code === '302') { |
| | |
| | | const username = getCookie('admin') |
| | | const usertype = getCookie('usertype') |
| | | const userid = getCookie('userid') |
| | | const stu_torgcode = getCookie('stu_torgcode') |
| | | const data = { |
| | | usercode, |
| | | username, |
| | | usertype, |
| | | userid |
| | | userid, |
| | | stu_torgcode |
| | | } |
| | | |
| | | logout(data).then(res => { |
| | |
| | | removeCookie('userid') |
| | | removeCookie('rediskey') |
| | | removeCookie('code') |
| | | removeCookie('stu_torgcode') |
| | | removeCookie('description') |
| | | |
| | | removeCookie('guid') |
| | | |
| | |
| | | @close="handleClose" |
| | | > |
| | | <el-form ref="dialogForm" :rules="dialogFormRules" :model="dialogForm" label-width="80px"> |
| | | <el-form-item label="组织类型" prop="OrgType"> |
| | | <el-form-item v-if="$store.state.settings.orgType===''" label="组织类型" prop="OrgType"> |
| | | <el-radio-group |
| | | v-model="dialogForm.OrgType" |
| | | :disabled="operation==='edit'" |
| | | @change="changeRadio" |
| | | > |
| | | <el-radio |
| | | v-for="item in OrgTypeArr" |
| | |
| | | <el-option |
| | | v-for="item in SupUnitArr" |
| | | :key="item.id" |
| | | :label="item.org_name" |
| | | :label="item.org_name+' / '+item.org_code" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | |
| | | // } |
| | | // }, |
| | | created() { |
| | | this.getOrganizationSearch() |
| | | this.handleRequest() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | |
| | | this.tableTimeStampKey = new Date().getTime() |
| | | this.$refs.tableDataRef.doLayout() |
| | | }, |
| | | |
| | | handleRequest() { |
| | | this.getOrganizationSearch().then(res => { |
| | | if (res.code === '200') { |
| | | this.getPrentOrganization() |
| | | } |
| | | }) |
| | | }, |
| | | async getOrganizationSearch() { |
| | | const res = await OrganizationSearch(this.form) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | |
| | | return { code: res.code } |
| | | }, |
| | | async getPrentOrganization() { |
| | | const { data: res } = await PrentOrganization({ orgcode: 'W' }) |
| | | this.SupUnitArr = res |
| | | }, |
| | | // 排序改变时 |
| | | sortChange({ column, prop, order }) { |
| | |
| | | this.form.UserName = '' |
| | | this.getOrganizationSearch() |
| | | }, |
| | | // 单选框改变时 |
| | | async changeRadio(val) { |
| | | if (this.dialogForm.OrgType !== '部门') { |
| | | const { data: res } = await PrentOrganization({ orgcode: this.OrgTypeArr.find(item => item.label === this.dialogForm.OrgType).value }) |
| | | this.SupUnitArr = res |
| | | } |
| | | }, |
| | | |
| | | // 新增按钮 |
| | | async add(operation) { |
| | | console.log(this.$store.state.settings.orgType, 987) |
| | | if (this.$store.state.settings.orgType === 'W') { |
| | | return this.$message.info('当前用户无新增权限!') |
| | | } |
| | | |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | |
| | |
| | | }, |
| | | // 修改按钮 |
| | | edit(operation, row) { |
| | | if (this.$store.state.settings.orgType === 'W') { |
| | | return this.$message.info('当前用户无修改权限!') |
| | | } |
| | | |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | // if (row.description === 'F') { |
| | |
| | | }, |
| | | // 删除按钮 |
| | | async del(id) { |
| | | if (this.$store.state.settings.orgType === 'W') { |
| | | return this.$message.info('当前用户无删除权限!') |
| | | } |
| | | |
| | | this.$confirm('是否确认删除?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | |
| | | if (valid) { |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | const data = { |
| | | OrganType: this.dialogForm.OrgType === '部门' ? 'D' : 'W', |
| | | OrganType: this.$store.state.settings.orgType !== '' ? 'W' : (this.dialogForm.OrgType === '部门' ? 'D' : 'W'), |
| | | OrganCode: this.dialogForm.OrgCode, |
| | | OrganName: this.dialogForm.OrgName, |
| | | RightCode: '', |
| | | numvalue: '', |
| | | // RightCode: this.operation === 'add' ? getCookie('ruleCode') : '', |
| | | // numvalue: this.operation === 'add' ? this.numvalue : '', |
| | | SupUnit: this.dialogForm.OrgType === '部门' ? '0' : this.dialogForm.SupUnit, |
| | | SupUnit: this.$store.state.settings.orgType !== '' ? this.SupUnitArr.find(i => i.org_code === getCookie('stu_torgcode')).id : (this.dialogForm.OrgType === '部门' ? '0' : this.dialogForm.SupUnit), |
| | | OperType: this.operation === 'add' ? 'Add' : 'Update', |
| | | Operator: getCookie('admin') |
| | | } |
| | |
| | | prop: 'is_user', |
| | | label: '关联用户', |
| | | id: 8, |
| | | show: true, |
| | | show: false, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | |
| | | <el-form-item label="所属组织" style=" display: flex;"> |
| | | <el-cascader |
| | | ref="cascader" |
| | | v-model="form.StuOrg" |
| | | filterable |
| | | popper-class="elCascader" |
| | | :options="StuOrgArr" |
| | | :props="defaultProps" |
| | | @change="cascaderChange" |
| | | /> |
| | | <!-- @change="cascaderChange"--> |
| | | <!-- @focus="getUserOrganization"--> |
| | | |
| | | </el-form-item> |
| | |
| | | <el-cascader |
| | | ref="dialogCascader" |
| | | key="cascaderKey" |
| | | v-model="dialogForm.StuOrg" |
| | | filterable |
| | | popper-class="elCascader" |
| | | :options="StuOrgArr2" |
| | |
| | | style="width: 200px;" |
| | | @change="dialogCascaderChange" |
| | | /> |
| | | |
| | | </el-form-item> |
| | | <el-form-item label="所属班组" prop="groupcode"> |
| | | <el-select |
| | |
| | | v-el-drag-dialog |
| | | title="生产班组" |
| | | :visible.sync="workingDialogVisible" |
| | | width="800px" |
| | | width="1000px" |
| | | top="15vh" |
| | | :close-on-click-modal="false" |
| | | class="workingDialogVisible" |
| | |
| | | label="序号" |
| | | prop="RowNum" |
| | | /> |
| | | <el-table-column |
| | | v-if="$store.state.settings.orgType!=='W'" |
| | | prop="stu_torgcode" |
| | | label="车间名称" |
| | | |
| | | sortable="custom" |
| | | show-tooltip-when-overflow |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <!-- <el-input--> |
| | | <!-- v-if="row.isVisible===1"--> |
| | | <!-- v-model="row.group_code"--> |
| | | <!-- oninput="value=value.replace(/[^0-9a-zA-Z]/g,'')"--> |
| | | <!-- placeholder="请输入"--> |
| | | <!-- />--> |
| | | <el-cascader |
| | | v-if="row.isVisible===1" |
| | | ref="dialogCascader" |
| | | key="cascaderKey" |
| | | v-model="row.storg_code" |
| | | filterable |
| | | popper-class="elCascader" |
| | | :options="StuOrgArr2" |
| | | :props="defaultProps" |
| | | style="width: 200px;" |
| | | /> |
| | | <div v-else> {{ row.org_name }}</div> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="group_code" |
| | | label="班组编码" |
| | |
| | | import { MesOrderStepReportSelectUserGroup } from '@/api/produceManager' |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | | import TableColumnSettings from '@/components/TableColumnSettings' |
| | | import { StorgGroupSelect } from '@/api/basicInfo' |
| | | |
| | | export default { |
| | | name: 'YYQD', |
| | |
| | | form: { |
| | | UserCode: '', // 用户编码 |
| | | UserName: '', // 用户名称 |
| | | StuOrg: '', // 所属组织 |
| | | StuOrg: getCookie('stu_torgcode'), // 所属组织 |
| | | wagetype: '', // 工资类型 |
| | | Enable: '', // 在职状态 |
| | | prop: 'lm_date', // 排序字段 |
| | |
| | | checkStrictly: true, |
| | | value: 'code', |
| | | label: 'name', |
| | | children: 'children' |
| | | children: 'children', |
| | | emitPath: false |
| | | }, |
| | | EnableArr: [ |
| | | { value: 'Y', label: '在职' }, |
| | |
| | | UserName: '', |
| | | Password: '123456', |
| | | Enable: 'Y', |
| | | StuOrg: '', |
| | | StuOrg: getCookie('stu_torgcode'), |
| | | Mobile: '', |
| | | Email: '', |
| | | groupcode: '', |
| | |
| | | // 获取所属组织 |
| | | async getUserOrganization() { |
| | | const { data: res } = await UserOrganization() |
| | | |
| | | this.StuOrgArr = clearAllChildren(res) |
| | | }, |
| | | // 获取所属组织对话框 |
| | |
| | | reset() { |
| | | this.form.UserCode = '' |
| | | this.form.UserName = '' |
| | | this.form.StuOrg = '' |
| | | this.form.Enable = 'Y' |
| | | this.form.Enable = '' |
| | | this.form.wagetype = '' |
| | | this.form.StuOrg = getCookie('stu_torgcode') |
| | | this.$refs.cascader.checkedValue = ''// 级联选择器的清空 |
| | | this.getUserSearch() |
| | | }, |
| | | // 级联选择器改变事件 |
| | | cascaderChange(val) { |
| | | console.log(val) |
| | | this.form.StuOrg = val[val.length - 1] |
| | | // this.$refs.cascader.checkValue |
| | | }, |
| | | dialogCascaderChange(val) { |
| | | this.dialogForm.StuOrg = val[val.length - 1] |
| | | console.log(val) |
| | | this.dialogForm.groupcode = '' |
| | | this.getStorgGroupSelect(val) |
| | | }, |
| | | // 获取下拉生产班组 |
| | | async getMesOrderStepReportSelectUserGroup() { |
| | | const { data: res } = await MesOrderStepReportSelectUserGroup() |
| | | async getStorgGroupSelect(stu_torgcode) { |
| | | const data = { |
| | | stu_torgcode, |
| | | description: this.StuOrgArr2.find(i => i.code === stu_torgcode) ? 'D' : 'W' |
| | | } |
| | | const { data: res } = await StorgGroupSelect(data) |
| | | this.usergroupArr = res |
| | | }, |
| | | // 新增按钮 |
| | | add(operation) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | |
| | | // this.dialogForm.StuOrg = getCookie('stu_torgcode') |
| | | // this.$refs.dialogCascader.checkedValue = [getCookie('stu_torgcode')] |
| | | |
| | | this.getUserOrganization2() |
| | | this.getMesOrderStepReportSelectUserGroup() |
| | | |
| | | if (this.$store.state.settings.orgType !== '') { |
| | | this.getStorgGroupSelect(getCookie('stu_torgcode'), this.StuOrgArr2.find(i => i.code === getCookie('stu_torgcode')) ? 'D' : 'W') |
| | | } |
| | | }, |
| | | // 修改按钮 |
| | | edit(operation, row) { |
| | |
| | | this.dialogForm.Email = row.email |
| | | this.dialogForm.wagetype = row.wagetype |
| | | }) |
| | | this.getMesOrderStepReportSelectUserGroup() |
| | | this.getStorgGroupSelect() |
| | | this.getUserOrganization2() |
| | | }, |
| | | // 删除按钮 |
| | |
| | | this.dialogForm.UserName = '' |
| | | this.dialogForm.Password = '123456' |
| | | this.dialogForm.Enable = 'Y' |
| | | this.$refs.dialogCascader.checkedValue = '' |
| | | this.dialogForm.StuOrg = '' |
| | | this.$refs.dialogCascader.checkedValue = getCookie('stu_torgcode') |
| | | this.dialogForm.StuOrg = getCookie('stu_torgcode') |
| | | this.dialogForm.Mobile = '' |
| | | this.dialogForm.Email = '' |
| | | this.dialogForm.groupcode = '' |
| | | this.dialogForm.wagetype = '2' |
| | | this.usergroupArr = [] |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |
| | | // 对话框取消 |
| | |
| | | workingTramClick() { |
| | | this.workingDialogVisible = true |
| | | this.getUserGroupSearch() |
| | | this.getUserOrganization2() |
| | | // 页面加载完后重新渲染表格 |
| | | this.$nextTick(() => { |
| | | this.$refs.workingTableData.doLayout() |
| | |
| | | this.workingTableData.splice(index, 1) |
| | | } |
| | | }) |
| | | this.getMesOrderStepReportSelectUserGroup() |
| | | // this.getStorgGroupSelect() |
| | | }, |
| | | // 生产班组排序 |
| | | sortChangeOfWorking({ column, prop, order }) { |
| | |
| | | |
| | | let number = Math.random() * Math.random()// 作为删除时的标识符 |
| | | number = number === 0 ? (10 + Math.random()) : number |
| | | const data = { group_code: '', group_name: '', description: '', isVisible: 1, number: number } |
| | | const data = { storg_code: getCookie('stu_torgcode'), group_code: '', group_name: '', description: '', isVisible: 1, number: number } |
| | | this.workingTableData.unshift(data) |
| | | }, |
| | | // 删除 |
| | |
| | | }, |
| | | // 保存 |
| | | async saveWorking(row) { |
| | | if (row.storg_code.trim().length < 1) { |
| | | return this.$message.info('车间不能为空!') |
| | | } |
| | | if (row.group_code.trim().length < 1) { |
| | | return this.$message.info('班组编码不能为空!') |
| | | } |
| | |
| | | // return this.$message.info('班组描述不能为空!') |
| | | // } |
| | | const data = { |
| | | storg_code: row.storg_code, |
| | | code: row.group_code, |
| | | name: row.group_name, |
| | | flag: row.description |
| | |
| | | if (getCookie('code') === '302') { |
| | | this.dialogVisible = true |
| | | } else { |
| | | // console.log(typeof getCookie('description')) |
| | | // console.log(getCookie('description') === '') |
| | | // this.$store.state.settings.orgType = getCookie('description')// 组织类型 |
| | | // console.log(this.$store.state.settings.orgType, 88) |
| | | this.$router.push({ path: this.redirect || '/' }) |
| | | } |
| | | this.loading = false |
| | |
| | | removeCookie('usertype') |
| | | removeCookie('userid') |
| | | removeCookie('code') |
| | | removeCookie('stu_torgcode') |
| | | removeCookie('description') |
| | | this.dialogVisible = false |
| | | }, |
| | | async dialogVisibleConfirm() { |
| | |
| | | const username = getCookie('admin') |
| | | const usertype = getCookie('usertype') |
| | | const userid = getCookie('userid') |
| | | const stu_torgcode = getCookie('stu_torgcode') |
| | | const data = { |
| | | usercode, |
| | | username, |
| | | usertype, |
| | | userid, |
| | | rid: '' |
| | | rid: '', |
| | | stu_torgcode |
| | | } |
| | | const res = await ForcedOffline(data) |
| | | if (res.code === '200') { |