Compare commits
No commits in common. "5293f68ae44e13f986511d5726f9b0637b7979da" and "c7eebdab59536547372b7bdb4d9cd90ea845ce93" have entirely different histories.
5293f68ae4
...
c7eebdab59
|
|
@ -27,14 +27,6 @@ export const editDate = (params) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const batchEditDate = (params) => {
|
|
||||||
return request({
|
|
||||||
url: '/taskQuery/batchEditDate',
|
|
||||||
method: 'post',
|
|
||||||
data: params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据物料id查询物料信息
|
* 根据物料id查询物料信息
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -156,21 +156,3 @@ export function changePasswordInfo(params) {
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setUserPermission(params) {
|
|
||||||
return request({
|
|
||||||
url: '/user/setUserPermission',
|
|
||||||
method: 'post',
|
|
||||||
data: params,
|
|
||||||
timeout: 5000
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取用户权限 API
|
|
||||||
export function getUserPermission(data) {
|
|
||||||
return request({
|
|
||||||
url: '/user/getUserPermission',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
const request = axios.create({
|
const request = axios.create({
|
||||||
//baseURL: 'http://172.18.222.253:12315/wms',
|
baseURL: 'http://172.18.222.253:12315/wms',
|
||||||
baseURL: 'http://localhost:12315/wms',
|
//baseURL: 'http://localhost:12315/wms',
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
})
|
})
|
||||||
// 172.18.222.253
|
// 172.18.222.253
|
||||||
|
|
|
||||||
|
|
@ -43,21 +43,8 @@
|
||||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||||
@sort-change="handleSortChange">
|
@sort-change="handleSortChange">
|
||||||
<el-table-column width="65px" fixed="left">
|
<el-table-column width="65px" fixed="left">
|
||||||
<template #header>
|
|
||||||
<el-checkbox
|
|
||||||
v-model="isSelectAll"
|
|
||||||
@change="handleSelectAllChange">
|
|
||||||
|
|
||||||
</el-checkbox>
|
|
||||||
</template>
|
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<!-- 单选改为多选 -->
|
<el-radio :label="scope.row.goodsId" v-model="goodsId"> </el-radio>
|
||||||
<el-checkbox
|
|
||||||
:label="scope.row.goodsId"
|
|
||||||
v-model="scope.row.checked"
|
|
||||||
@change="handleSelectionChange(scope.row)">
|
|
||||||
|
|
||||||
</el-checkbox>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="workOrder" label="工单详情" fixed="left" min-width="120px" sortable="custom"
|
<el-table-column prop="workOrder" label="工单详情" fixed="left" min-width="120px" sortable="custom"
|
||||||
|
|
@ -100,19 +87,6 @@
|
||||||
<el-button size="default" type="warning" @click.stop="handleDelete(scope.row)">加急</el-button>
|
<el-button size="default" type="warning" @click.stop="handleDelete(scope.row)">加急</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #header>
|
|
||||||
<div style="display: flex; flex-direction: column; align-items: center;">
|
|
||||||
<span>操作</span>
|
|
||||||
<el-button
|
|
||||||
size="small"
|
|
||||||
type="primary"
|
|
||||||
@click="handleBatchEdit"
|
|
||||||
:disabled="selectedRows.length === 0"
|
|
||||||
style="margin-top: 5px;">
|
|
||||||
批量修改时间({{ selectedRows.length }})
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -143,25 +117,7 @@
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog v-model="showBatchEditDialog" title="批量修改执行日期" width="30%" draggable>
|
|
||||||
<el-form ref="batchEditFormRef" :model="batchEditForm" label-width="100px">
|
|
||||||
<el-form-item label="执行时间">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="batchEditForm.pickingDate"
|
|
||||||
type="date"
|
|
||||||
placeholder="请选择执行时间"
|
|
||||||
format="YYYY-MM-DD"
|
|
||||||
value-format="YYYY-MM-DD" style="width: 100%">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<span class="dialog-footer">
|
|
||||||
<el-button @click="showBatchEditDialog = false">取消</el-button>
|
|
||||||
<el-button type="primary" @click="saveBatchEdit(batchEditForm)">确定</el-button>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</el-container>
|
</el-container>
|
||||||
</el-config-provider>
|
</el-config-provider>
|
||||||
|
|
@ -170,7 +126,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import {batchEditDate, editDate, getGoodsInfoByPage, upOutsType} from '@/api/goods.js'
|
import {editDate, getGoodsInfoByPage, upOutsType} from '@/api/goods.js'
|
||||||
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
||||||
import {ElMessage} from 'element-plus'
|
import {ElMessage} from 'element-plus'
|
||||||
import {genTableRequest} from '@/utils/generator.js'
|
import {genTableRequest} from '@/utils/generator.js'
|
||||||
|
|
@ -204,11 +160,6 @@ let searchQueryFormEntity = reactive({
|
||||||
goodsDesc: '',
|
goodsDesc: '',
|
||||||
workOrder: '',
|
workOrder: '',
|
||||||
})
|
})
|
||||||
let selectedRows = ref([]) // 新增:存储选中的行
|
|
||||||
let showBatchEditDialog = ref(false) // 新增:控制批量编辑对话框显示
|
|
||||||
const batchEditForm = reactive({
|
|
||||||
pickingDate: ''
|
|
||||||
}) // 新增:批量编辑表单
|
|
||||||
let searchQueryFormRef = ref()
|
let searchQueryFormRef = ref()
|
||||||
let rowEditFlag = ref(false)
|
let rowEditFlag = ref(false)
|
||||||
let goodsId = ''
|
let goodsId = ''
|
||||||
|
|
@ -233,75 +184,6 @@ const resizeHeight = () => {
|
||||||
maxHeight.value = window.innerHeight * 0.55
|
maxHeight.value = window.innerHeight * 0.55
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理选择变化
|
|
||||||
const handleSelectionChange = (row) => {
|
|
||||||
if (row.checked) {
|
|
||||||
// 如果选中且不在列表中,则添加
|
|
||||||
if (!selectedRows.value.some(item => item.goodsId === row.goodsId)) {
|
|
||||||
selectedRows.value.push(row)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 如果取消选中,则从列表中移除
|
|
||||||
selectedRows.value = selectedRows.value.filter(item => item.goodsId !== row.goodsId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 批量编辑处理
|
|
||||||
const handleBatchEdit = () => {
|
|
||||||
if (selectedRows.value.length === 0) {
|
|
||||||
ElMessage.warning('请至少选择一条记录')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
batchEditForm.pickingDate = ''
|
|
||||||
showBatchEditDialog.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleSelectAllChange = (val) => {
|
|
||||||
tableData.value.forEach(row => {
|
|
||||||
row.checked = val
|
|
||||||
})
|
|
||||||
|
|
||||||
if (val) {
|
|
||||||
// 全选
|
|
||||||
selectedRows.value = [...tableData.value]
|
|
||||||
} else {
|
|
||||||
// 取消全选
|
|
||||||
selectedRows.value = []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 保存批量编辑
|
|
||||||
const saveBatchEdit = (form) => {
|
|
||||||
if (!form.pickingDate) {
|
|
||||||
ElMessage.warning('请选择执行时间')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const taskIds = selectedRows.value.map(row => row.taskId)
|
|
||||||
const request = {
|
|
||||||
taskIds: taskIds,
|
|
||||||
pickingDate: form.pickingDate
|
|
||||||
}
|
|
||||||
|
|
||||||
// 需要在API中实现批量更新接口
|
|
||||||
batchEditDate(request).then((res) => {
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
ElMessage.success('批量修改成功')
|
|
||||||
showBatchEditDialog.value = false
|
|
||||||
search()
|
|
||||||
// 清空选择
|
|
||||||
selectedRows.value.forEach(row => {
|
|
||||||
row.checked = false
|
|
||||||
})
|
|
||||||
selectedRows.value = []
|
|
||||||
} else {
|
|
||||||
ElMessage.error(res.data.message)
|
|
||||||
}
|
|
||||||
}).catch(() => {
|
|
||||||
ElMessage.error('批量修改失败')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 保存编辑
|
// 保存编辑
|
||||||
const saveEdit = (editForm) => {
|
const saveEdit = (editForm) => {
|
||||||
let request = {
|
let request = {
|
||||||
|
|
|
||||||
|
|
@ -28,12 +28,11 @@
|
||||||
<el-table-column prop="updateTime" label="更新时间" :formatter="timeFormat" min-width="120px"
|
<el-table-column prop="updateTime" label="更新时间" :formatter="timeFormat" min-width="120px"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="addUser" label="添加用户" min-width="120px" show-overflow-tooltip/>
|
<el-table-column prop="addUser" label="添加用户" min-width="120px" show-overflow-tooltip/>
|
||||||
<el-table-column fixed="right" label="操作" min-width="220px">
|
<el-table-column fixed="right" label="操作" min-width="140px">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div style="display: flex;justify-content: space-between;">
|
<div style="display: flex;justify-content: space-between;">
|
||||||
<el-button style="width: 80px" plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
|
<el-button style="width: 80px" plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
|
||||||
<el-button style="width: 80px" plain type="warning" @click="changePassword(scope.row)">改密</el-button>
|
<el-button style="width: 80px" plain type="warning" @click="changePassword(scope.row)">改密</el-button>
|
||||||
<el-button v-if="store.getters.getUser?.roleId == 0" style="width: 80px" plain type="success" @click="openPermissionDialog(scope.row)">权限</el-button>
|
|
||||||
<el-button style="width: 80px" plain type="danger" @click="deleteCurrentRow(scope.row)">删除</el-button>
|
<el-button style="width: 80px" plain type="danger" @click="deleteCurrentRow(scope.row)">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -150,75 +149,13 @@
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 替换原有的权限弹窗代码 -->
|
|
||||||
<el-dialog v-model="permissionDialogVisible" title="设置权限" width="500px" draggable :show-close="false">
|
|
||||||
<div style="padding: 20px;">
|
|
||||||
<el-card shadow="never" style="margin-bottom: 20px;">
|
|
||||||
<template #header>
|
|
||||||
<div class="card-header">
|
|
||||||
<span>用户信息</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<el-descriptions :column="1" size="small" border>
|
|
||||||
<el-descriptions-item label="登录账户">{{ currentEditUser?.loginAccount }}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="用户名">{{ currentEditUser?.userName }}</el-descriptions-item>
|
|
||||||
</el-descriptions>
|
|
||||||
</el-card>
|
|
||||||
|
|
||||||
<el-card shadow="never">
|
|
||||||
<template #header>
|
|
||||||
<div class="card-header">
|
|
||||||
<span>权限配置</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<div class="permission-section">
|
|
||||||
<div class="section-title">
|
|
||||||
<i class="el-icon-setting"></i>
|
|
||||||
<span>WMS权限</span>
|
|
||||||
</div>
|
|
||||||
<el-checkbox-group v-model="wmsPermissions" class="permission-checkbox-group">
|
|
||||||
<el-row :gutter="15">
|
|
||||||
<el-col :span="12" v-for="perm in wmsPermissionOptions" :key="perm.value">
|
|
||||||
<el-checkbox :label="perm.value" :border="true" style="width: 100%; margin-bottom: 10px;">
|
|
||||||
{{ perm.label }}
|
|
||||||
</el-checkbox>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-checkbox-group>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="permission-section" style="margin-top: 20px;">
|
|
||||||
<div class="section-title">
|
|
||||||
<i class="el-icon-mobile"></i>
|
|
||||||
<span>PDA权限</span>
|
|
||||||
</div>
|
|
||||||
<el-checkbox
|
|
||||||
v-model="hasPdaPermission"
|
|
||||||
label="E"
|
|
||||||
border
|
|
||||||
style="width: 100%; margin-top: 10px;">
|
|
||||||
PDA操作权限
|
|
||||||
</el-checkbox>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<template #footer>
|
|
||||||
<span class="dialog-footer">
|
|
||||||
<el-button @click="permissionDialogVisible = false">取 消</el-button>
|
|
||||||
<el-button type="primary" @click="submitPermissionChange()">确 定</el-button>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
</el-config-provider>
|
</el-config-provider>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import {setUserPermission, getUserPermission, getUserList, getRoleOptions, updateUserInfo, addUserInfo, deleteUserInfo, changePasswordInfo} from '@/api/user.js'
|
import {getUserList, getRoleOptions, updateUserInfo, addUserInfo, deleteUserInfo, changePasswordInfo} from '@/api/user.js'
|
||||||
import {errorBox} from '@/utils/myMessageBox.js'
|
import {errorBox} from '@/utils/myMessageBox.js'
|
||||||
import {ElMessageBox, ElMessage} from 'element-plus'
|
import {ElMessageBox, ElMessage} from 'element-plus'
|
||||||
import {ref, reactive} from 'vue'
|
import {ref, reactive} from 'vue'
|
||||||
|
|
@ -260,20 +197,6 @@ export default {
|
||||||
addUserFormRef: ref(),
|
addUserFormRef: ref(),
|
||||||
|
|
||||||
|
|
||||||
// 在 data 的 return 中添加以下内容
|
|
||||||
permissionDialogVisible: false,
|
|
||||||
permissionFormEntity: reactive({}),
|
|
||||||
permissionFormRef: ref(),
|
|
||||||
currentEditUser: null,
|
|
||||||
wmsPermissions: [],
|
|
||||||
hasPdaPermission: false,
|
|
||||||
wmsPermissionOptions: [
|
|
||||||
{ value: 'A', label: '下发盘点' },
|
|
||||||
{ value: 'B', label: '出库单编排' },
|
|
||||||
{ value: 'C', label: '出空箱' },
|
|
||||||
{ value: 'D', label: '拣选任务状态编辑' }
|
|
||||||
],
|
|
||||||
|
|
||||||
passwordDialogVisible: false,
|
passwordDialogVisible: false,
|
||||||
passwordFormEntity: reactive({
|
passwordFormEntity: reactive({
|
||||||
loginAccount: '',
|
loginAccount: '',
|
||||||
|
|
@ -300,8 +223,6 @@ export default {
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.search()
|
this.search()
|
||||||
console.log('当前用户信息:', store.getters.getUser)
|
|
||||||
console.log('当前用户roleId:', store.getters.getUser?.roleId)
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 添加修改密码相关方法
|
// 添加修改密码相关方法
|
||||||
|
|
@ -490,86 +411,6 @@ export default {
|
||||||
errorBox('添加用户信息失败。')
|
errorBox('添加用户信息失败。')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 在 methods 中添加以下方法
|
|
||||||
openPermissionDialog(row) {
|
|
||||||
this.currentEditUser = row;
|
|
||||||
|
|
||||||
// 调用后端接口获取用户权限
|
|
||||||
const params = {
|
|
||||||
loginAccountUpdate: row.loginAccount,
|
|
||||||
roleIdOp: store.getters.getUser.roleId,
|
|
||||||
userName: store.getters.getUserName
|
|
||||||
};
|
|
||||||
|
|
||||||
getUserPermission(params).then(res => {
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
// 解析后端返回的权限字符串
|
|
||||||
const permissionStr = res.data.message || '';
|
|
||||||
this.wmsPermissions = [];
|
|
||||||
this.hasPdaPermission = false;
|
|
||||||
|
|
||||||
console.log(permissionStr);
|
|
||||||
if (permissionStr.includes('A')) this.wmsPermissions.push('A');
|
|
||||||
if (permissionStr.includes('B')) this.wmsPermissions.push('B');
|
|
||||||
if (permissionStr.includes('C')) this.wmsPermissions.push('C');
|
|
||||||
if (permissionStr.includes('D')) this.wmsPermissions.push('D');
|
|
||||||
if (permissionStr.includes('E')) this.hasPdaPermission = true;
|
|
||||||
} else {
|
|
||||||
// 如果获取失败,使用默认空值
|
|
||||||
this.wmsPermissions = [];
|
|
||||||
this.hasPdaPermission = false;
|
|
||||||
errorBox(res.data.message);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.permissionDialogVisible = true;
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err);
|
|
||||||
// 如果请求失败,使用默认空值
|
|
||||||
this.wmsPermissions = [];
|
|
||||||
this.hasPdaPermission = false;
|
|
||||||
this.permissionDialogVisible = true;
|
|
||||||
errorBox('获取用户权限失败');
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
submitPermissionChange() {
|
|
||||||
// 构建权限字符串
|
|
||||||
let permissionStr = '';
|
|
||||||
permissionStr += this.wmsPermissions.join('');
|
|
||||||
if (this.hasPdaPermission) permissionStr += 'E';
|
|
||||||
|
|
||||||
// 这里调用设置权限的API
|
|
||||||
// 示例:
|
|
||||||
const params = {
|
|
||||||
loginAccountUpdate: this.currentEditUser.loginAccount,
|
|
||||||
userPermission: permissionStr,
|
|
||||||
roleIdOp: store.getters.getUser.roleId,
|
|
||||||
userName: store.getters.getUserName
|
|
||||||
};
|
|
||||||
|
|
||||||
setUserPermission(params).then(res => {
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
this.permissionDialogVisible = false;
|
|
||||||
ElMessage.success('权限设置成功。');
|
|
||||||
this.search(); // 刷新列表
|
|
||||||
} else {
|
|
||||||
errorBox(res.data.message);
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err);
|
|
||||||
errorBox('权限设置失败。');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// 暂时只是演示逻辑,实际需要调用后端API
|
|
||||||
ElMessage.success('权限设置成功。');
|
|
||||||
console.log(permissionStr)
|
|
||||||
this.permissionDialogVisible = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
getCurrentRow(row) {
|
getCurrentRow(row) {
|
||||||
this.userId = row.userId
|
this.userId = row.userId
|
||||||
},
|
},
|
||||||
|
|
@ -623,56 +464,3 @@ export default {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style scoped>/* 在原有样式基础上添加以下内容 */
|
|
||||||
.card-header {
|
|
||||||
font-weight: bold;
|
|
||||||
color: #303133;
|
|
||||||
}
|
|
||||||
|
|
||||||
.permission-section {
|
|
||||||
padding: 10px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-title {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 500;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
color: #606266;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-title i {
|
|
||||||
margin-right: 8px;
|
|
||||||
font-size: 18px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.permission-checkbox-group {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.permission-checkbox-group .el-checkbox {
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-card__header) {
|
|
||||||
background-color: #f5f7fa;
|
|
||||||
padding: 10px 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-descriptions__label) {
|
|
||||||
width: 100px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-checkbox.is-bordered) {
|
|
||||||
padding: 8px 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-checkbox.is-bordered:hover) {
|
|
||||||
border-color: #409eff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dialog-footer {
|
|
||||||
padding: 15px 20px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -121,17 +121,4 @@ public class TaskQueryController {
|
||||||
{
|
{
|
||||||
return taskQueryControllerService.queryInventoryRecordByPage(inventoryQuery);
|
return taskQueryControllerService.queryInventoryRecordByPage(inventoryQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量修改出库任务的执行时间
|
|
||||||
*
|
|
||||||
* @param batchEditDateVo 包含任务ID列表和统一设置的执行时间
|
|
||||||
* @return 操作结果
|
|
||||||
*/
|
|
||||||
@PostMapping("/batchEditDate")
|
|
||||||
public WmsApiResponse<String> batchEditDate(@RequestBody OutsBatchEditDateVo batchEditDateVo) {
|
|
||||||
return taskQueryControllerService.batchEditDate(batchEditDateVo);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,26 +73,4 @@ public class UserController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置用户权限
|
|
||||||
* @param userUpdateRequest 获取权限参数
|
|
||||||
* @return 获取权限结果
|
|
||||||
*/
|
|
||||||
@PostMapping("/setUserPermission")
|
|
||||||
BaseWmsApiResponse setUserPermission(@RequestBody UserUpdateRequest userUpdateRequest) {
|
|
||||||
return userControllerService.setUserPermission(userUpdateRequest);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取用户权限
|
|
||||||
* @param userUpdateRequest 获取权限参数
|
|
||||||
* @return 获取权限结果
|
|
||||||
*/
|
|
||||||
@PostMapping("/getUserPermission")
|
|
||||||
BaseWmsApiResponse getUserPermission(@RequestBody UserUpdateRequest userUpdateRequest) {
|
|
||||||
return userControllerService.getUserPermission(userUpdateRequest);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.wms_main.model.dto.query;
|
package com.wms_main.model.dto.query;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.wms_main.model.dto.request.wms.BaseWmsRequest;
|
import com.wms_main.model.dto.request.wms.BaseWmsRequest;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|
@ -53,10 +52,4 @@ public class UserUpdateRequest extends BaseWmsRequest {
|
||||||
*/
|
*/
|
||||||
@JsonProperty("newPassword")
|
@JsonProperty("newPassword")
|
||||||
private String newPassword;
|
private String newPassword;
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户权限
|
|
||||||
*/
|
|
||||||
@JsonProperty("userPermission")
|
|
||||||
private String userPermission;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,10 +77,4 @@ public class TSysUser {
|
||||||
*/
|
*/
|
||||||
@TableField(value = "last_update_time")
|
@TableField(value = "last_update_time")
|
||||||
private LocalDateTime lastUpdateTime;
|
private LocalDateTime lastUpdateTime;
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户权限
|
|
||||||
*/
|
|
||||||
@TableField(value = "user_permission")
|
|
||||||
private String userPermission;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
package com.wms_main.model.vo.wms;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class OutsBatchEditDateVo {
|
|
||||||
private List<String> taskIds; // 任务ID列表
|
|
||||||
private Date pickingDate; // 统一设置的执行时间
|
|
||||||
}
|
|
||||||
|
|
@ -62,11 +62,6 @@ public interface ITaskQueryControllerService {
|
||||||
|
|
||||||
WmsApiResponse<String> editDate(OutsVo outsVo);
|
WmsApiResponse<String> editDate(OutsVo outsVo);
|
||||||
|
|
||||||
|
|
||||||
// ITaskQueryControllerService.java
|
|
||||||
WmsApiResponse<String> batchEditDate(OutsBatchEditDateVo batchEditDateVo);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新出库单信息
|
* 更新出库单信息
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,4 @@ public interface IUserControllerService {
|
||||||
*/
|
*/
|
||||||
BaseWmsApiResponse changePassword(UserUpdateRequest userUpdateRequest);
|
BaseWmsApiResponse changePassword(UserUpdateRequest userUpdateRequest);
|
||||||
|
|
||||||
|
|
||||||
BaseWmsApiResponse setUserPermission(UserUpdateRequest userUpdateRequest);
|
|
||||||
BaseWmsApiResponse getUserPermission(UserUpdateRequest userUpdateRequest);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -297,76 +297,6 @@ public class TaskQueryControllerServiceImpl implements ITaskQueryControllerServi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public WmsApiResponse<String> batchEditDate(OutsBatchEditDateVo batchEditDateVo) {
|
|
||||||
// 1. 参数校验
|
|
||||||
if (batchEditDateVo == null || batchEditDateVo.getTaskIds() == null || batchEditDateVo.getTaskIds().isEmpty()) {
|
|
||||||
return WmsApiResponse.error("任务ID列表不能为空", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StringUtils.isEmpty(String.valueOf(batchEditDateVo.getPickingDate()))) {
|
|
||||||
return WmsApiResponse.error("请选择执行时间", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
int successCount = 0;
|
|
||||||
int failCount = 0;
|
|
||||||
StringBuilder errorMsg = new StringBuilder();
|
|
||||||
|
|
||||||
// 2. 遍历任务ID列表,逐个更新
|
|
||||||
for (String taskId : batchEditDateVo.getTaskIds()) {
|
|
||||||
try {
|
|
||||||
// 查询原任务
|
|
||||||
TAppOuts existingOuts = appOutsService.getOne(new LambdaQueryWrapper<TAppOuts>()
|
|
||||||
.eq(TAppOuts::getTaskId, taskId));
|
|
||||||
|
|
||||||
if (existingOuts == null) {
|
|
||||||
errorMsg.append("任务ID: ").append(taskId).append(" 未找到对应的任务; ");
|
|
||||||
failCount++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (existingOuts.getDistributeNum() > 0) {
|
|
||||||
errorMsg.append("任务ID: ").append(taskId).append(" 已经开始执行; ");
|
|
||||||
failCount++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 检查是否重复修改
|
|
||||||
if (existingOuts.getPickingDate() != null && existingOuts.getPickingDate().equals(batchEditDateVo.getPickingDate())) {
|
|
||||||
errorMsg.append("任务ID: ").append(taskId).append(" 请勿重复修改; ");
|
|
||||||
failCount++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 更新执行时间
|
|
||||||
existingOuts.setPickingDate(batchEditDateVo.getPickingDate());
|
|
||||||
|
|
||||||
// 执行更新操作
|
|
||||||
boolean updateSuccess = appOutsService.updateById(existingOuts);
|
|
||||||
|
|
||||||
if (updateSuccess) {
|
|
||||||
successCount++;
|
|
||||||
} else {
|
|
||||||
errorMsg.append("任务ID: ").append(taskId).append(" 更新失败; ");
|
|
||||||
failCount++;
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
errorMsg.append("任务ID: ").append(taskId).append(" 更新异常: ").append(e.getMessage()).append("; ");
|
|
||||||
failCount++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3. 返回结果
|
|
||||||
if (successCount > 0 && failCount == 0) {
|
|
||||||
return WmsApiResponse.success("全部执行时间更新成功,共更新" + successCount + "条记录", null);
|
|
||||||
} else if (successCount > 0 && failCount > 0) {
|
|
||||||
return WmsApiResponse.success("部分执行时间更新成功,成功" + successCount + "条,失败" + failCount + "条。失败原因:" + errorMsg.toString(), null);
|
|
||||||
} else {
|
|
||||||
return WmsApiResponse.error("执行时间更新全部失败。失败原因:" + errorMsg.toString(), null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WmsApiResponse<String> updateOutsInfo(TAppPickTask appTask) {
|
public WmsApiResponse<String> updateOutsInfo(TAppPickTask appTask) {
|
||||||
if (appTask == null || StringUtils.isEmpty(appTask.getPickId())) {
|
if (appTask == null || StringUtils.isEmpty(appTask.getPickId())) {
|
||||||
|
|
|
||||||
|
|
@ -180,52 +180,6 @@ public class UserControllerServiceImpl implements IUserControllerService {
|
||||||
return updateResult ? BaseWmsApiResponse.success("密码修改成功") : BaseWmsApiResponse.error("密码修改失败");
|
return updateResult ? BaseWmsApiResponse.success("密码修改成功") : BaseWmsApiResponse.error("密码修改失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public BaseWmsApiResponse setUserPermission(UserUpdateRequest userUpdateRequest) {
|
|
||||||
// 参数校验
|
|
||||||
if (userUpdateRequest == null ||
|
|
||||||
StringUtils.isEmpty(userUpdateRequest.getLoginAccountUpdate())) {
|
|
||||||
return BaseWmsApiResponse.error("请求参数不完整,必须包含登录账号和权限信息。");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询用户是否存在
|
|
||||||
TSysUser user = sysUserService.getById(userUpdateRequest.getLoginAccountUpdate());
|
|
||||||
if (user == null) {
|
|
||||||
return BaseWmsApiResponse.error("用户不存在。");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 更新用户权限
|
|
||||||
user.setUserPermission(userUpdateRequest.getUserPermission());
|
|
||||||
user.setLastUpdateTime(LocalDateTime.now());
|
|
||||||
user.setLastUpdateUser(userUpdateRequest.getUserName());
|
|
||||||
|
|
||||||
boolean updateResult = sysUserService.updateById(user);
|
|
||||||
|
|
||||||
return updateResult ?
|
|
||||||
BaseWmsApiResponse.success("用户权限设置成功") :
|
|
||||||
BaseWmsApiResponse.error("用户权限设置失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BaseWmsApiResponse getUserPermission(UserUpdateRequest userUpdateRequest) {
|
|
||||||
// 参数校验
|
|
||||||
if (userUpdateRequest == null ||
|
|
||||||
StringUtils.isEmpty(userUpdateRequest.getLoginAccountUpdate())) {
|
|
||||||
return BaseWmsApiResponse.error("请求参数不完整,必须包含登录账号。");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询用户信息
|
|
||||||
TSysUser user = sysUserService.getById(userUpdateRequest.getLoginAccountUpdate());
|
|
||||||
if (user == null) {
|
|
||||||
return BaseWmsApiResponse.error("用户不存在。");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 返回用户权限信息
|
|
||||||
return BaseWmsApiResponse.success(user.getUserPermission());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user