|
|
@@ -31,49 +31,6 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item prop="loginPwd">
|
|
|
- <el-input
|
|
|
- show-password
|
|
|
- v-model="form.factory"
|
|
|
- disabled
|
|
|
- placeholder="所属工厂"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item prop="loginPwd">
|
|
|
- <el-input
|
|
|
- show-password
|
|
|
- v-model="form.workCenter"
|
|
|
- disabled
|
|
|
- placeholder="所属工作中心"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item prop="loginPwd">
|
|
|
- <el-input
|
|
|
- show-password
|
|
|
- v-model="form.team"
|
|
|
- disabled
|
|
|
- placeholder="所属班组"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item prop="loginPwd">
|
|
|
- <el-input
|
|
|
- show-password
|
|
|
- v-model="form.desk"
|
|
|
- disabled
|
|
|
- placeholder="工位"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item prop="loginPwd">
|
|
|
- <el-input
|
|
|
- show-password
|
|
|
- v-model="form.device"
|
|
|
- disabled
|
|
|
- placeholder="设备"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
<el-form-item prop="captcha">
|
|
|
<div class="login-input-group">
|
|
|
<el-input
|
|
|
@@ -147,13 +104,125 @@
|
|
|
<el-radio-button label="1">居右</el-radio-button>
|
|
|
</el-radio-group>
|
|
|
</div> -->
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ title="用户信息"
|
|
|
+ :visible.sync="isInfo"
|
|
|
+ append-to-body
|
|
|
+ width="30%"
|
|
|
+ center
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ @close="closeInfo"
|
|
|
+ >
|
|
|
+ <el-form :model="infoForm" label-position="right" label-width="100px">
|
|
|
+ <el-form-item prop="factory" label="所属工厂">
|
|
|
+ <el-input
|
|
|
+ v-model="infoForm.factoryName"
|
|
|
+ disabled
|
|
|
+ placeholder="所属工厂"
|
|
|
+ style="width: 240px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item prop="team" label="班组">
|
|
|
+ <el-select
|
|
|
+ style="width: 240px"
|
|
|
+ clearable
|
|
|
+ v-model="infoForm.teamId"
|
|
|
+ filterable
|
|
|
+ placeholder="请选择班组"
|
|
|
+ @change="changeTeam(infoForm.teamId)"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in teamList"
|
|
|
+ :label="item.teamName"
|
|
|
+ :value="item.teamId"
|
|
|
+ :key="item.teamId"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item prop="workCenter" label="工作中心">
|
|
|
+ <el-select
|
|
|
+ style="width: 240px"
|
|
|
+ clearable
|
|
|
+ v-model="infoForm.centerId"
|
|
|
+ filterable
|
|
|
+ placeholder="请选择工作中心"
|
|
|
+ @change="changeWorlCenter(infoForm.centerId)"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in workCenterList"
|
|
|
+ :label="item.centerName"
|
|
|
+ :value="item.centerId"
|
|
|
+ :key="item.centerId"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ <!-- <el-input
|
|
|
+ v-model="infoForm.workCenter"
|
|
|
+ disabled
|
|
|
+ placeholder="所属工作中心"
|
|
|
+ style="width: 240px"
|
|
|
+ /> -->
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="desk" label="工位">
|
|
|
+ <!-- <el-input
|
|
|
+ v-model="infoForm.desk"
|
|
|
+ disabled
|
|
|
+ placeholder="工位"
|
|
|
+ style="width: 240px"
|
|
|
+ /> -->
|
|
|
+ <el-select
|
|
|
+ style="width: 240px"
|
|
|
+ clearable
|
|
|
+ v-model="infoForm.workStationId"
|
|
|
+ filterable
|
|
|
+ placeholder="请选择工位"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in workStationList"
|
|
|
+ :label="item.workStationName"
|
|
|
+ :value="item.workStationId"
|
|
|
+ :key="item.workStationId"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item prop="device" label="设备">
|
|
|
+ <!-- <el-input
|
|
|
+ v-model="infoForm.device"
|
|
|
+ disabled
|
|
|
+ placeholder="设备"
|
|
|
+ style="width: 240px"
|
|
|
+ /> -->
|
|
|
+ <el-select
|
|
|
+ style="width: 240px"
|
|
|
+ clearable
|
|
|
+ v-model="infoForm.deviceId"
|
|
|
+ filterable
|
|
|
+ placeholder="请选择设备"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in deviceList"
|
|
|
+ :label="item.deviceName"
|
|
|
+ :value="item.deviceId"
|
|
|
+ :key="item.deviceId"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="isInfo = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="infoClick">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import I18nIcon from '@/layout/components/i18n-icon.vue';
|
|
|
import { getToken } from '@/utils/token-util';
|
|
|
- import { login, getCaptcha } from '@/api/login';
|
|
|
+ import { login, getCaptcha, getUserInfo } from '@/api/login';
|
|
|
import xyy from '@/assets/xyy.jpg';
|
|
|
import { getPathAddress } from '@/api/system/file';
|
|
|
import { setCurrentUser } from '@/utils/token-util';
|
|
|
@@ -189,10 +258,25 @@
|
|
|
workCenter: '',
|
|
|
desk: ''
|
|
|
},
|
|
|
+ infoForm: {
|
|
|
+ factoryId: '',
|
|
|
+ centerId: '',
|
|
|
+ teamId: '',
|
|
|
+ workStationId: '',
|
|
|
+ deviceId: '',
|
|
|
+ factoryName: ''
|
|
|
+ },
|
|
|
// 验证码base64数据
|
|
|
captcha: '',
|
|
|
// 验证码内容, 实际项目去掉
|
|
|
- text: ''
|
|
|
+ text: '',
|
|
|
+ isInfo: false,
|
|
|
+ factoryList: [],
|
|
|
+ workCenterList: [],
|
|
|
+ teamList: [],
|
|
|
+ deviceList: [],
|
|
|
+ workStationList: [],
|
|
|
+ userData: null
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -294,8 +378,80 @@
|
|
|
/* 跳转到首页 */
|
|
|
goHome() {
|
|
|
localStorage.setItem('singleUserInfo', '1');
|
|
|
+ this.isInfo = true;
|
|
|
+ // this.getFactoryList();
|
|
|
+
|
|
|
+ this.getUserAllInfo();
|
|
|
+ // this.$router.push(this.$route?.query?.from ?? '/').catch(() => {});
|
|
|
+ },
|
|
|
+
|
|
|
+ async getUserAllInfo() {
|
|
|
+ this.infoForm.factoryId = '';
|
|
|
+ this.infoForm.centerId = '';
|
|
|
+ this.infoForm.teamId = '';
|
|
|
+ this.infoForm.workStationId = '';
|
|
|
+ this.infoForm.deviceId = '';
|
|
|
+ this.infoForm.factoryName = '';
|
|
|
+
|
|
|
+ await getUserInfo(this.$store.state.user.info.userId).then((res) => {
|
|
|
+ this.infoForm.factoryName = res.factoryName;
|
|
|
+ this.infoForm.factoryId = res.factoryId;
|
|
|
+ this.teamList = res.teamList;
|
|
|
+ this.userData = res;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ changeWorlCenter(centerId) {
|
|
|
+ this.infoForm.centerId = centerId;
|
|
|
+ this.infoForm.workStationId = '';
|
|
|
+
|
|
|
+ const workCenterData = this.workCenterList.find(
|
|
|
+ (item) => item.centerId == centerId
|
|
|
+ );
|
|
|
+ if (workCenterData) {
|
|
|
+ if (this.userData.workStationList.length != 0) {
|
|
|
+ this.workStationList = this.userData.workStationList.filter(
|
|
|
+ (item) => item.centerId == centerId
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ changeTeam(teamId) {
|
|
|
+ this.infoForm.teamId = teamId;
|
|
|
+ this.infoForm.deviceId = '';
|
|
|
+ this.infoForm.centerId = '';
|
|
|
+
|
|
|
+ const teamData = this.teamList.find((item) => item.teamId == teamId);
|
|
|
+
|
|
|
+ if (teamData) {
|
|
|
+ this.teamList = this.userData.deviceList.filter(
|
|
|
+ (it) => it.teamId == teamData.teamId
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.userData.deviceList.length != 0) {
|
|
|
+ this.deviceList = this.userData.deviceList.filter(
|
|
|
+ (it) => it.teamId == teamId
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ infoClick() {
|
|
|
+ if (!this.infoForm.centerId) {
|
|
|
+ return this.$message.warning('请选择工作中心');
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!this.infoForm.teamId) {
|
|
|
+ return this.$message.warning('请选择班组');
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$store.commit('user/setAllUserInfo', this.infoForm);
|
|
|
this.$router.push(this.$route?.query?.from ?? '/').catch(() => {});
|
|
|
},
|
|
|
+
|
|
|
+ closeInfo() {},
|
|
|
+
|
|
|
/* 更换图形验证码 */
|
|
|
changeCaptcha() {
|
|
|
this.form.uuid = this.generateUUID();
|
|
|
@@ -438,7 +594,7 @@
|
|
|
@media screen and (min-height: 550px) {
|
|
|
.login-form {
|
|
|
position: absolute;
|
|
|
- top: 30%;
|
|
|
+ top: 50%;
|
|
|
left: 50%;
|
|
|
transform: translateX(-50%);
|
|
|
margin-top: -220px;
|