添加货架,货位相关代码
main
zxf 2 weeks ago
parent f71a108641
commit 60f392e1e8

@ -0,0 +1,63 @@
import request from '@/utils/request'
/**
* 新增cmshelf
* @param pram
*/
export function cmshelfCreateApi(data) {
return request({
url: `autogencode/cmshelf/save`,
method: 'POST',
data
})
}
/**
* cmshelf更新
* @param pram
*/
export function cmshelfUpdateApi(data) {
return request({
url: `autogencode/cmshelf/update`,
method: 'POST',
data
})
}
/**
* cmshelf详情
* @param pram
*/
export function cmshelfDetailApi(id) {
return request({
url: `autogencode/cmshelf/info/${id}`,
method: 'GET'
})
}
/**
* cmshelf批量删除
* @param ids
*/
export function cmshelfDeleteApi(ids) {
return request({
url: `autogencode/cmshelf/delete`,
method: 'POST',
data: ids
})
}
/**
* cmshelf列表
* @param pram
*/
export function cmshelfListApi(params) {
return request({
url: `autogencode/cmshelf/list`,
method: 'GET',
params
})
}

@ -0,0 +1,63 @@
import request from '@/utils/request'
/**
* 新增cmstoragelocation
* @param pram
*/
export function cmstoragelocationCreateApi(data) {
return request({
url: `autogencode/cmstoragelocation/save`,
method: 'POST',
data
})
}
/**
* cmstoragelocation更新
* @param pram
*/
export function cmstoragelocationUpdateApi(data) {
return request({
url: `autogencode/cmstoragelocation/update`,
method: 'POST',
data
})
}
/**
* cmstoragelocation详情
* @param pram
*/
export function cmstoragelocationDetailApi(id) {
return request({
url: `autogencode/cmstoragelocation/info/${id}`,
method: 'GET'
})
}
/**
* cmstoragelocation批量删除
* @param ids
*/
export function cmstoragelocationDeleteApi(ids) {
return request({
url: `autogencode/cmstoragelocation/delete`,
method: 'POST',
data: ids
})
}
/**
* cmstoragelocation列表
* @param pram
*/
export function cmstoragelocationListApi(params) {
return request({
url: `autogencode/cmstoragelocation/list`,
method: 'GET',
params
})
}

@ -291,7 +291,10 @@ export default {
},
created() {
listWarehouse({}).then(response => {
this.warehouses = response.data;
this.warehouses = response.data || [];
}).catch(error => {
console.error('获取仓库列表失败:', error);
this.warehouses = [];
});
},
methods: {

@ -34,7 +34,7 @@
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button @click="resetForm()"></el-button>
<el-button v-hasPermi="['autogencode:cmcustqualify:save']" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-hasPermi="['autogencode:cmcustqualify:save']" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-hasPermi="['autogencode:cmcustqualify:delete']" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>

@ -0,0 +1,87 @@
<template>
<!-- 基于 Element UI 新增和修改弹窗 -->
<el-dialog
:title="!dataForm.id ? '添加' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<!-- 新增和修改表单 -->
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataSubmit()" label-width="80px">
<el-form-item label="货架代码" prop="shelfCode">
<el-input v-model="dataForm.shelfCode" placeholder="货架代码"></el-input>
</el-form-item>
<el-form-item label="货架名称" prop="shelfName">
<el-input v-model="dataForm.shelfName" placeholder="货架名称"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注" type="textarea" :rows="3"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
import * as api from '@/api/cmshelf.js'
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
shelfCode: '' ,
shelfName: '' ,
warehouseId: '' ,
remark: '' ,
},
dataRule: {
shelfCode: [
{ required: true, message: '货架代码 为必填项', trigger: 'blur' }
],
shelfName: [
{ required: true, message: '货架名称 为必填项', trigger: 'blur' }
],
}
}
},
methods: {
init (id, warehouseId) { //
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(function() {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
api.cmshelfDetailApi(id).then(function(res) {
this.dataForm = res;
}.bind(this))
} else if (warehouseId) {
// ID
this.dataForm.warehouseId = warehouseId
}
}.bind(this))
},
//
dataSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
if (this.dataForm.id) {
api.cmshelfUpdateApi(this.dataForm).then(function(res) {
this.$message.success('保存成功')
this.visible = false
this.$emit('refreshDataList')
}.bind(this));
} else {
api.cmshelfCreateApi(this.dataForm).then(function(res) {
this.$message.success('新增成功')
this.visible = false
this.$emit('refreshDataList')
}.bind(this));
}
}
})
}
}
}
</script>

@ -0,0 +1,204 @@
<template>
<div class="divBox">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label="货架代码">
<el-input v-model="dataForm.shelfCode" placeholder="请输入货架代码" clearable></el-input>
</el-form-item>
<el-form-item label="货架名称">
<el-input v-model="dataForm.shelfName" placeholder="请输入货架名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button @click="resetForm()"></el-button>
<el-button v-hasPermi="['autogencode:cmshelf:save']" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-hasPermi="['autogencode:cmshelf:delete']" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="货架ID">
</el-table-column>
<el-table-column
prop="shelfCode"
header-align="center"
align="center"
label="货架代码">
</el-table-column>
<el-table-column
prop="shelfName"
header-align="center"
align="center"
label="货架名称">
</el-table-column>
<el-table-column
prop="warehouseId"
header-align="center"
align="center"
label="归属仓库ID">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ '' }}</el-button>
<el-button v-hasPermi="['autogencode:cmshelf:delete']" type="text" size="small" @click="deleteHandle(scope.row.id)" style="color: #f56c6c;"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 表单弹窗, 新增数据和修改数据 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './cmshelf-add-and-update'
import * as api from '@/api/cmshelf.js'
export default {
data () {
return {
dataForm: {
shelfCode: '',
shelfName: '',
warehouseId: '',
remark: '',
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
mounted() {
//
this.getDataList()
},
methods: {
//
resetForm() {
this.dataForm = {
shelfCode: '',
shelfName: '',
warehouseId: '',
remark: '',
}
this.getDataList()
},
//
getDataList () {
this.dataListLoading = true
// CmShelfControllerPageParamRequest
const params = {
page: this.pageIndex,
limit: this.pageSize
}
//
if (this.dataForm.shelfCode) params.shelfCode = this.dataForm.shelfCode;
if (this.dataForm.shelfName) params.shelfName = this.dataForm.shelfName;
if (this.dataForm.warehouseId) params.warehouseId = this.dataForm.warehouseId;
if (this.dataForm.remark) params.remark = this.dataForm.remark;
api.cmshelfListApi(params).then(res => {
this.dataListLoading = false
this.dataList = res.list || [];
this.totalPage = res.total;
}).catch(e => {
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
let ids = []
let idText = ''
// id
if (id) {
ids = [id]
idText = id
} else {
//
ids = this.dataListSelections.map(item => {
return item.id
})
idText = ids.join(',')
}
this.$confirm(`确定进行删除操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// API
api.cmshelfDeleteApi(ids).then(res => {
this.$message.success('删除成功')
this.getDataList()
})
})
},
}
}
</script>

@ -0,0 +1,88 @@
<template>
<!-- 基于 Element UI 新增和修改弹窗 -->
<el-dialog
:title="!dataForm.id ? '添加' : '修改'"
:close-on-click-modal="false"
:append-to-body="true"
:visible.sync="visible">
<!-- 新增和修改表单 -->
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataSubmit()" label-width="80px">
<el-form-item label="货位代码" prop="storageLocationCode">
<el-input v-model="dataForm.storageLocationCode" placeholder="货位代码"></el-input>
</el-form-item>
<el-form-item label="货位名称" prop="storageLocationName">
<el-input v-model="dataForm.storageLocationName" placeholder="货位名称"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注" type="textarea" :rows="3"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
import * as api from '@/api/cmstoragelocation.js'
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
storageLocationCode: '' ,
storageLocationName: '' ,
shelfId: '' ,
remark: '' ,
},
dataRule: {
storageLocationCode: [
{ required: true, message: '货位代码 为必填项', trigger: 'blur' }
],
storageLocationName: [
{ required: true, message: '货位名称 为必填项', trigger: 'blur' }
],
}
}
},
methods: {
init (id, shelfId) { //
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(function() {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
api.cmstoragelocationDetailApi(id).then(function(res) {
this.dataForm = res;
}.bind(this))
} else if (shelfId) {
// ID
this.dataForm.shelfId = shelfId
}
}.bind(this))
},
//
dataSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
if (this.dataForm.id) {
api.cmstoragelocationUpdateApi(this.dataForm).then(function(res) {
this.$message.success('保存成功')
this.visible = false
this.$emit('refreshDataList')
}.bind(this));
} else {
api.cmstoragelocationCreateApi(this.dataForm).then(function(res) {
this.$message.success('新增成功')
this.visible = false
this.$emit('refreshDataList')
}.bind(this));
}
}
})
}
}
}
</script>

@ -0,0 +1,204 @@
<template>
<div class="divBox">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label="货位代码">
<el-input v-model="dataForm.storageLocationCode" placeholder="请输入货位代码" clearable></el-input>
</el-form-item>
<el-form-item label="货位名称">
<el-input v-model="dataForm.storageLocationName" placeholder="请输入货位名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button @click="resetForm()"></el-button>
<el-button v-hasPermi="['autogencode:cmstoragelocation:save']" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-hasPermi="['autogencode:cmstoragelocation:delete']" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="货位ID">
</el-table-column>
<el-table-column
prop="storageLocationCode"
header-align="center"
align="center"
label="货位代码">
</el-table-column>
<el-table-column
prop="storageLocationName"
header-align="center"
align="center"
label="货位名称">
</el-table-column>
<el-table-column
prop="shelfId"
header-align="center"
align="center"
label="归属货架ID">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ '' }}</el-button>
<el-button v-hasPermi="['autogencode:cmstoragelocation:delete']" type="text" size="small" @click="deleteHandle(scope.row.id)" style="color: #f56c6c;"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 表单弹窗, 新增数据和修改数据 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './cmstoragelocation-add-and-update'
import * as api from '@/api/cmstoragelocation.js'
export default {
data () {
return {
dataForm: {
storageLocationCode: '',
storageLocationName: '',
shelfId: '',
remark: '',
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
mounted() {
//
this.getDataList()
},
methods: {
//
resetForm() {
this.dataForm = {
storageLocationCode: '',
storageLocationName: '',
shelfId: '',
remark: '',
}
this.getDataList()
},
//
getDataList () {
this.dataListLoading = true
// CmStorageLocationControllerPageParamRequest
const params = {
page: this.pageIndex,
limit: this.pageSize
}
//
if (this.dataForm.storageLocationCode) params.storageLocationCode = this.dataForm.storageLocationCode;
if (this.dataForm.storageLocationName) params.storageLocationName = this.dataForm.storageLocationName;
if (this.dataForm.shelfId) params.shelfId = this.dataForm.shelfId;
if (this.dataForm.remark) params.remark = this.dataForm.remark;
api.cmstoragelocationListApi(params).then(res => {
this.dataListLoading = false
this.dataList = res.list || [];
this.totalPage = res.total;
}).catch(e => {
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
let ids = []
let idText = ''
// id
if (id) {
ids = [id]
idText = id
} else {
//
ids = this.dataListSelections.map(item => {
return item.id
})
idText = ids.join(',')
}
this.$confirm(`确定进行删除操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// API
api.cmstoragelocationDeleteApi(ids).then(res => {
this.$message.success('删除成功')
this.getDataList()
})
})
},
}
}
</script>

@ -0,0 +1,359 @@
<template>
<div>
<div style="margin-bottom: 10px;">
<el-button type="primary" size="small" @click="addShelf"></el-button>
</div>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
:row-key="'id'"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="shelfCode"
header-align="center"
align="center"
label="货架代码">
</el-table-column>
<el-table-column
prop="shelfName"
header-align="center"
align="center"
label="货架名称">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column header-align="center" fixed="right" align="center" width="200" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="editShelf(scope.row.id)">{{ '' }}</el-button>
<el-button type="text" size="small" @click="viewLocations(scope.row.id, scope.row.shelfName)">{{ '查看货位' }}</el-button>
<el-button type="text" size="small" @click="deleteShelf(scope.row.id)" style="color: #f56c6c;">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
v-if="showSearch"
hide-on-single-page
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 货架弹窗 -->
<ShelfAddOrUpdate
ref="shelfAddOrUpdate"
@refreshDataList="getDataList"
></ShelfAddOrUpdate>
<!-- 货位管理弹窗 -->
<el-dialog
:title="'货位管理 - ' + selectedShelfName"
:close-on-click-modal="false"
:visible.sync="locationDialogVisible"
width="80%"
:append-to-body="true"
:before-close="handleLocationDialogClose">
<div>
<div style="margin-bottom: 10px;">
<el-button type="primary" size="small" @click="addLocation"></el-button>
</div>
<el-table
:data="locationDataList"
border
v-loading="locationDataListLoading"
:row-key="'id'"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="storageLocationCode"
header-align="center"
align="center"
label="货位代码">
</el-table-column>
<el-table-column
prop="storageLocationName"
header-align="center"
align="center"
label="货位名称">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column header-align="center" fixed="right" align="center" width="150" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="editLocation(scope.row.id)">{{ '' }}</el-button>
<el-button type="text" size="small" @click="deleteLocation(scope.row.id)" style="color: #f56c6c;">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
v-if="showSearch"
hide-on-single-page
@size-change="locationSizeChangeHandle"
@current-change="locationCurrentChangeHandle"
:current-page="locationPageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="locationPageSize"
:total="locationTotalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</div>
<!-- 货位表单弹窗, 新增数据和修改数据 -->
<LocationAddOrUpdate
ref="locationAddOrUpdate"
@refreshDataList="getLocationDataList"
></LocationAddOrUpdate>
</el-dialog>
</div>
</template>
<script>
import * as api from '@/api/cmshelf.js'
import * as locationApi from '@/api/cmstoragelocation.js'
import ShelfAddOrUpdate from '../shelf/cmshelf-add-and-update.vue'
import LocationAddOrUpdate from '../storage/location/cmstoragelocation-add-and-update.vue'
export default {
components: {
ShelfAddOrUpdate,
LocationAddOrUpdate
},
props: {
warehouseId: {
type: [Number, String],
required: true
},
showSearch: {
type: Boolean,
default: true
}
},
data() {
return {
dataForm: {
shelfCode: '',
shelfName: '',
warehouseId: '',
remark: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
//
locationDialogVisible: false,
selectedShelfId: null,
selectedShelfName: '',
locationDataList: [],
locationPageIndex: 1,
locationPageSize: 10,
locationTotalPage: 0,
locationDataListLoading: false
}
},
watch: {
// ID
warehouseId(newVal) {
this.getDataList()
}
},
mounted() {
this.getDataList()
},
methods: {
//
addShelf() {
this.$emit('addShelf')
if (this.$refs.shelfAddOrUpdate) {
this.$refs.shelfAddOrUpdate.init(0, this.warehouseId)
}
},
//
editShelf(id) {
this.$emit('editShelf', id)
if (this.$refs.shelfAddOrUpdate) {
this.$refs.shelfAddOrUpdate.init(id, this.warehouseId)
}
},
//
deleteShelf(id) {
this.$confirm('确定要删除这条货架记录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
api.cmshelfDeleteApi([id]).then(() => {
this.$message.success('删除成功')
this.getDataList()
}).catch(() => {
// this.$message.error('')
})
}).catch(() => {})
},
//
resetForm() {
this.dataForm = {
shelfCode: '',
shelfName: '',
warehouseId: '',
remark: ''
}
this.pageIndex = 1
this.getDataList()
},
//
getDataList() {
this.dataListLoading = true
const params = {
page: this.pageIndex,
limit: this.pageSize,
warehouseId: this.warehouseId
}
//
if (this.dataForm.shelfCode) params.shelfCode = this.dataForm.shelfCode
if (this.dataForm.shelfName) params.shelfName = this.dataForm.shelfName
if (this.dataForm.remark) params.remark = this.dataForm.remark
api.cmshelfListApi(params).then((res) => {
this.dataListLoading = false
if (res.data && 'list' in res.data) {
this.dataList = res.data.list || []
this.totalPage = res.data.total || 0
} else if ('list' in res) {
this.dataList = res.list || []
this.totalPage = res.total || 0
} else {
//
this.dataList = []
this.totalPage = 0
}
}).catch((error) => {
this.dataListLoading = false
this.dataList = []
this.totalPage = 0
})
},
//
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle(val) {
this.pageIndex = val
this.getDataList()
},
//
viewLocations(shelfId, shelfName) {
this.selectedShelfId = shelfId
this.selectedShelfName = shelfName
this.locationDialogVisible = true
this.locationPageIndex = 1
this.getLocationDataList()
},
//
handleLocationDialogClose(done) {
this.locationDialogVisible = false
},
//
addLocation() {
if (this.$refs.locationAddOrUpdate) {
this.$refs.locationAddOrUpdate.init(0, this.selectedShelfId)
}
},
//
editLocation(id) {
if (this.$refs.locationAddOrUpdate) {
this.$refs.locationAddOrUpdate.init(id, this.selectedShelfId)
}
},
//
deleteLocation(id) {
this.$confirm('确定要删除这条货位记录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
locationApi.cmstoragelocationDeleteApi([id]).then(() => {
this.$message.success('删除成功')
this.getLocationDataList()
}).catch(() => {
this.$message.error('删除失败')
})
}).catch(() => {})
},
//
getLocationDataList() {
this.locationDataListLoading = true
const params = {
page: this.locationPageIndex,
limit: this.locationPageSize,
shelfId: this.selectedShelfId
}
locationApi.cmstoragelocationListApi(params).then((res) => {
this.locationDataListLoading = false
if (res.data && 'list' in res.data) {
this.locationDataList = res.data.list || []
this.locationTotalPage = res.data.total || 0
} else if ('list' in res) {
this.locationDataList = res.list || []
this.locationTotalPage = res.total || 0
} else {
//
this.locationDataList = []
this.locationTotalPage = 0
}
}).catch((error) => {
this.locationDataListLoading = false
this.locationDataList = []
this.locationTotalPage = 0
})
},
//
locationSizeChangeHandle(val) {
this.locationPageSize = val
this.locationPageIndex = 1
this.getLocationDataList()
},
//
locationCurrentChangeHandle(val) {
this.locationPageIndex = val
this.getLocationDataList()
}
}
}
</script>
<style lang="scss" scoped>
</style>

@ -3,9 +3,10 @@
<el-dialog
:title="!dataForm.id ? '添加' : '修改'"
:close-on-click-modal="false"
:append-to-body="true"
:visible.sync="visible">
<!-- 新增和修改表单 -->
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataSubmit()" label-width="80px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataSubmit()" label-width="120px">
<el-form-item label="仓库代码" prop="stockCode">
<el-input v-model="dataForm.stockCode" placeholder="仓库代码"></el-input>
</el-form-item>
@ -13,13 +14,27 @@
<el-input v-model="dataForm.stockName" placeholder="仓库名称"></el-input>
</el-form-item>
<el-form-item label="仓库有效期起" prop="validityStart">
<el-input v-model="dataForm.validityStart" placeholder="仓库有效期起"></el-input>
<el-date-picker
v-model="dataForm.validityStart"
type="date"
placeholder="选择仓库有效期起"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
style="width: 100%;"
></el-date-picker>
</el-form-item>
<el-form-item label="仓库有效期止" prop="validityEnd">
<el-input v-model="dataForm.validityEnd" placeholder="仓库有效期止"></el-input>
<el-date-picker
v-model="dataForm.validityEnd"
type="date"
placeholder="选择仓库有效期止"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
style="width: 100%;"
></el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
<el-input v-model="dataForm.remark" placeholder="备注" type="textarea" :rows="3"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@ -50,15 +65,6 @@
stockName: [
{ required: true, message: '仓库名称 为必填项', trigger: 'blur' }
],
validityStart: [
{ required: true, message: '仓库有效期起 为必填项', trigger: 'blur' }
],
validityEnd: [
{ required: true, message: '仓库有效期止 为必填项', trigger: 'blur' }
],
remark: [
{ required: true, message: '备注 为必填项', trigger: 'blur' }
],
}
}
},
@ -70,6 +76,13 @@
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
api.cmwarehouseDetailApi(id).then(function(res) {
//
if (res.validityStart) {
res.validityStart = res.validityStart.substring(0, 10)
}
if (res.validityEnd) {
res.validityEnd = res.validityEnd.substring(0, 10)
}
this.dataForm = res;
}.bind(this))
}
@ -79,14 +92,23 @@
dataSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
const submitData = { ...this.dataForm }
if (submitData.validityStart) {
submitData.validityStart = submitData.validityStart + ' 00:00:00'
}
if (submitData.validityEnd) {
submitData.validityEnd = submitData.validityEnd + ' 23:59:59'
}
if (this.dataForm.id) {
api.cmwarehouseUpdateApi(this.dataForm).then(function(res) {
api.cmwarehouseUpdateApi(submitData).then(function(res) {
this.$message.success('保存成功')
this.visible = false
this.$emit('refreshDataList')
}.bind(this));
} else {
api.cmwarehouseCreateApi(this.dataForm).then(function(res) {
api.cmwarehouseCreateApi(submitData).then(function(res) {
this.$message.success('新增成功')
this.visible = false
this.$emit('refreshDataList')

@ -7,19 +7,10 @@
<el-form-item label="仓库名称">
<el-input v-model="dataForm.stockName" placeholder="请输入仓库名称" clearable></el-input>
</el-form-item>
<el-form-item label="仓库有效期起">
<el-input v-model="dataForm.validityStart" placeholder="请输入仓库有效期起" clearable></el-input>
</el-form-item>
<el-form-item label="仓库有效期止">
<el-input v-model="dataForm.validityEnd" placeholder="请输入仓库有效期止" clearable></el-input>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="dataForm.remark" placeholder="请输入备注" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button @click="resetForm()"></el-button>
<el-button v-hasPermi="['autogencode:cmwarehouse:save']" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-hasPermi="['autogencode:cmwarehouse:save']" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-hasPermi="['autogencode:cmwarehouse:delete']" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
@ -28,6 +19,8 @@
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
@expand-change="handleExpandChange"
:expand-row-keys="expandedRowKeys"
style="width: 100%;">
<el-table-column
type="selection"
@ -36,10 +29,16 @@
width="50">
</el-table-column>
<el-table-column
prop="id"
type="expand"
header-align="center"
align="center"
label="仓库ID">
align="center">
<template slot-scope="scope">
<DispatchList
:warehouseId="scope.row.id"
@addShelf="addShelf"
@editShelf="editShelf"
/>
</template>
</el-table-column>
<el-table-column
prop="stockCode"
@ -54,16 +53,20 @@
label="仓库名称">
</el-table-column>
<el-table-column
prop="validityStart"
header-align="center"
align="center"
label="仓库有效期起">
<template slot-scope="scope">
{{ scope.row.validityStart ? scope.row.validityStart.substring(0, 10) : '' }}
</template>
</el-table-column>
<el-table-column
prop="validityEnd"
header-align="center"
align="center"
label="仓库有效期止">
<template slot-scope="scope">
{{ scope.row.validityEnd ? scope.row.validityEnd.substring(0, 10) : '' }}
</template>
</el-table-column>
<el-table-column
prop="remark"
@ -72,55 +75,12 @@
label="备注">
</el-table-column>
<el-table-column
prop="delFlag"
header-align="center"
align="center"
label="删除标志0代表存在 2代表删除">
</el-table-column>
<el-table-column
prop="createDept"
header-align="center"
align="center"
label="创建部门">
</el-table-column>
<el-table-column
prop="createBy"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updateBy"
header-align="center"
align="center"
label="修改人">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="修改时间">
</el-table-column>
<el-table-column
prop="tenantId"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ '' }}</el-button>
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button v-hasPermi="['autogencode:cmwarehouse:delete']" type="text" size="small" @click="deleteHandle(scope.row.id)" style="color: #f56c6c;"></el-button>
</template>
</el-table-column>
@ -141,6 +101,7 @@
<script>
import AddOrUpdate from './cmwarehouse-add-and-update'
import DispatchList from './DispatchList'
import * as api from '@/api/cmwarehouse.js'
export default {
data () {
@ -159,11 +120,13 @@
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
addOrUpdateVisible: false,
expandedRowKeys: [] // ID
}
},
components: {
AddOrUpdate
AddOrUpdate,
DispatchList,
},
activated () {
this.getDataList()
@ -259,6 +222,32 @@
})
})
},
//
handleExpandChange(row, expandedRows) {
if (expandedRows.includes(row)) {
// ID expandedRowKeys
if (!this.expandedRowKeys.includes(row.id)) {
this.expandedRowKeys.push(row.id)
}
} else {
// ID expandedRowKeys
const index = this.expandedRowKeys.indexOf(row.id)
if (index !== -1) {
this.expandedRowKeys.splice(index, 1)
}
}
},
//
addShelf() {
console.log('Add shelf clicked')
},
//
editShelf(id) {
console.log('Edit shelf clicked:', id)
}
}
}
</script>

@ -45,7 +45,7 @@
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button @click="resetForm()"></el-button>
<el-button v-hasPermi="['autogencode:ebuser:save']" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-hasPermi="['autogencode:ebuser:save']" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-hasPermi="['autogencode:ebuser:delete']" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>

@ -45,7 +45,7 @@
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button @click="resetForm()"></el-button>
<el-button v-hasPermi="['autogencode:ebuser:save']" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-hasPermi="['autogencode:ebuser:save']" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-hasPermi="['autogencode:ebuser:delete']" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>

@ -41,12 +41,6 @@
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="chargeId"
header-align="center"
@ -89,48 +83,6 @@
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="delFlag"
header-align="center"
align="center"
label="删除标志0代表存在 2代表删除">
</el-table-column>
<el-table-column
prop="createDept"
header-align="center"
align="center"
label="创建部门">
</el-table-column>
<el-table-column
prop="createBy"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updateBy"
header-align="center"
align="center"
label="修改人">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="修改时间">
</el-table-column>
<el-table-column
prop="tenantId"
header-align="center"
align="center"
label="租户ID">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"

@ -71,12 +71,26 @@
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<div class="house-pagination-container">
<el-pagination
background
layout="prev, pager, next, sizes, jumper, total"
:current-page="housePageIndex"
:page-size="housePageSize"
:page-sizes="[10, 20, 50, 100]"
:total="houseTotal"
@size-change="handleHouseSizeChange"
@current-change="handleHouseCurrentChange"
style="margin-top: 10px;"
/>
</div>
</div>
<span slot="footer" class="dialog-footer">
<!-- 如果是编辑状态显示房屋管理相关按钮 -->
<el-button type="info" @click="addHouseHandle"></el-button>
<el-button @click="visible = false">取消</el-button>
<!-- <el-button type="info" @click="addHouseHandle"></el-button>-->
<el-button @click="$emit('close')"></el-button>
<el-button type="primary" @click="dataSubmit()"></el-button>
</span>
</el-dialog>
@ -126,6 +140,10 @@
},
//
houseList: [],
//
housePageIndex: 1,
housePageSize: 10,
houseTotal: 0,
// /
houseVisible: false,
dataRule: {
@ -216,9 +234,14 @@
loadHouseList (buildingId) {
if (!buildingId) return
// API
houseApi.pmhouseListApi({ buildingId: buildingId }).then(res => {
// API
houseApi.pmhouseListApi({
buildingId: buildingId,
page: this.housePageIndex,
limit: this.housePageSize
}).then(res => {
this.houseList = res.list || []
this.houseTotal = res.count || 0
}).catch(err => {
this.$message.error('加载房屋列表失败')
console.error(err)
@ -274,6 +297,19 @@
this.$emit('refreshHouseList')
},
//
handleHouseSizeChange (size) {
this.housePageSize = size
this.housePageIndex = 1
this.loadHouseList(this.dataForm.id)
},
//
handleHouseCurrentChange (current) {
this.housePageIndex = current
this.loadHouseList(this.dataForm.id)
},
//
addHouseToList (houseData) {
//
@ -300,10 +336,30 @@
return house.id === null
})
//
this.$emit('addBuildingToList', buildingData)
this.$message.success(buildingData.id ? '修改成功' : '添加成功')
// API
if (buildingData.id) {
//
api.pmbuildingUpdateApi(buildingData).then(() => {
this.$message.success('修改成功')
this.$emit('refreshDataList')
this.$emit('close')
}).catch(err => {
this.$message.error('修改失败')
this.$emit('refreshDataList')
console.error(err)
})
} else {
//
api.pmbuildingCreateApi(buildingData).then(() => {
this.$message.success('添加成功')
this.$emit('refreshDataList')
this.$emit('close')
}).catch(err => {
this.$message.error('添加失败')
this.$emit('refreshDataList')
console.error(err)
})
}
}
})
}

@ -34,7 +34,7 @@
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button @click="resetForm()"></el-button>
<el-button v-hasPermi="['autogencode:pmcomplaintsuggestion:save']" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-hasPermi="['autogencode:pmcomplaintsuggestion:save']" type="primary" @click="addOrUpdateHandle()">/</el-button>
<el-button v-hasPermi="['autogencode:pmcomplaintsuggestion:delete']" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>

@ -3,6 +3,7 @@
<el-dialog
:title="!dataForm.id ? '添加' : '修改'"
:close-on-click-modal="false"
:append-to-body="true"
:visible.sync="visible">
<!-- 新增和修改表单 -->
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataSubmit()" label-width="80px">
@ -124,18 +125,15 @@
floorNo: [
{ required: true, message: '楼层号 为必填项', trigger: 'blur' }
],
houseNo: [
{ required: true, message: '房号 为必填项', trigger: 'blur' }
],
// houseNo: [
// { required: true, message: ' ', trigger: 'blur' }
// ],
propertyType: [
{ required: true, message: '产权类型 为必填项', trigger: 'blur' }
],
houseStatus: [
{ required: true, message: '房屋状态 为必填项', trigger: 'blur' }
],
propertyCertNo: [
{ required: true, message: '房产证号 为必填项', trigger: 'blur' }
],
}
}
},

@ -13,7 +13,7 @@
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button @click="resetForm()"></el-button>
<el-button v-hasPermi="['autogencode:pmmaintenanceorder:save']" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-hasPermi="['autogencode:pmmaintenanceorder:save']" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-hasPermi="['autogencode:pmmaintenanceorder:delete']" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>

@ -0,0 +1,415 @@
<template>
<div>
<div style="margin-bottom: 10px;">
<el-button type="primary" size="small" @click="addBuilding"></el-button>
</div>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
:row-key="'id'"
style="width: 100%;">
<el-table-column
prop="buildingNo"
header-align="center"
align="center"
label="楼栋编号"
width="120">
</el-table-column>
<el-table-column
prop="totalFloors"
header-align="center"
align="center"
label="总层数"
width="100">
</el-table-column>
<el-table-column
prop="unitCount"
header-align="center"
align="center"
label="单元数"
width="100">
</el-table-column>
<el-table-column
prop="buildingType"
header-align="center"
align="center"
label="楼栋类型">
<template slot-scope="scope">
<dict-tag v-if="dict.type.building_type && dict.type.building_type.length > 0" :options="dict.type.building_type" :value="scope.row.buildingType"/>
<span v-else>{{ scope.row.buildingType }}</span>
</template>
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="180"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="editBuilding(scope.row.id)">{{ '' }}</el-button>
<el-button type="text" size="small" @click="viewHouses(scope.row.id, scope.row.buildingNo)">{{ '查看房屋' }}</el-button>
<el-button type="text" size="small" @click="deleteBuilding(scope.row.id)" style="color: #f56c6c;">{{ '删除' }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
v-if="showSearch"
hide-on-single-page
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 房屋管理弹窗 -->
<el-dialog
:title="'房屋管理 - ' + selectedBuildingNo"
:close-on-click-modal="false"
:visible.sync="houseDialogVisible"
width="80%"
:append-to-body="true"
:before-close="handleHouseDialogClose">
<div>
<div style="margin-bottom: 10px;">
<el-button type="primary" size="small" @click="addHouse"></el-button>
</div>
<el-table
:data="houseDataList"
border
v-loading="houseDataListLoading"
:row-key="'id'"
style="width: 100%;">
<el-table-column
prop="unitNo"
header-align="center"
align="center"
label="单元号"
width="100">
</el-table-column>
<el-table-column
prop="floorNo"
header-align="center"
align="center"
label="楼层号"
width="100">
</el-table-column>
<el-table-column
prop="houseNo"
header-align="center"
align="center"
label="房号"
width="120">
</el-table-column>
<el-table-column
prop="houseType"
header-align="center"
align="center"
label="户型"
width="120">
</el-table-column>
<el-table-column
prop="usableArea"
header-align="center"
align="center"
label="实用面积"
width="100">
</el-table-column>
<el-table-column
prop="propertyType"
header-align="center"
align="center"
label="产权类型">
<template slot-scope="scope">
<dict-tag v-if="dict.type.property_type && dict.type.property_type.length > 0" :options="dict.type.property_type" :value="scope.row.propertyType"/>
<span v-else>{{ scope.row.propertyType }}</span>
</template>
</el-table-column>
<el-table-column
prop="houseStatus"
header-align="center"
align="center"
label="房屋状态">
<template slot-scope="scope">
<dict-tag v-if="dict.type.house_status && dict.type.house_status.length > 0" :options="dict.type.house_status" :value="scope.row.houseStatus"/>
<span v-else>{{ scope.row.houseStatus }}</span>
</template>
</el-table-column>
<el-table-column
prop="propertyCertNo"
header-align="center"
align="center"
label="房产证号"
width="150">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="editHouse(scope.row.id)">{{ '' }}</el-button>
<el-button type="text" size="small" @click="deleteHouse(scope.row.id)" style="color: #f56c6c;">{{ '删除' }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
v-if="showSearch"
hide-on-single-page
@size-change="houseSizeChangeHandle"
@current-change="houseCurrentChangeHandle"
:current-page="housePageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="housePageSize"
:total="houseTotalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</div>
<!-- 房屋表单弹窗, 新增数据和修改数据 -->
<PmhouseAddOrUpdate
ref="pmhouseAddOrUpdate"
:visible="houseFormVisible"
:defaultBuildingId="selectedBuildingId"
@close="houseFormVisible = false"
@refreshDataList="getHouseDataList"
></PmhouseAddOrUpdate>
</el-dialog>
<!-- 楼栋管理弹窗 -->
<PmbuildingAddOrUpdate
ref="pmbuildingAddOrUpdate"
:visible="buildingFormVisible"
:defaultProjectId="projectId"
@close="buildingFormVisible = false"
@refreshDataList="getDataList"
></PmbuildingAddOrUpdate>
</div>
</template>
<script>
import * as api from '@/api/pmbuilding.js'
import * as houseApi from '@/api/pmhouse.js'
import PmhouseAddOrUpdate from '../houser/pmhouse-add-and-update.vue'
import PmbuildingAddOrUpdate from '../building/pmbuilding-add-and-update.vue'
export default {
components: {
PmhouseAddOrUpdate,
PmbuildingAddOrUpdate
},
dicts: ['building_type', 'property_type', 'house_status'],
props: {
projectId: {
type: [String, Number],
default: ''
}
},
data () {
return {
showSearch: true,
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataForm: {
buildingNo: '',
buildingType: ''
},
addOrUpdateVisible: false,
buildingVisible: false,
//
houseDialogVisible: false,
selectedBuildingId: null,
selectedBuildingNo: '',
houseDataList: [],
housePageIndex: 1,
housePageSize: 10,
houseTotalPage: 0,
houseDataListLoading: false,
houseFormVisible: false,
//
buildingFormVisible: false
}
},
mounted () {
this.getDataList()
},
methods: {
getDataList () {
this.dataListLoading = true
const params = {
page: this.pageIndex,
limit: this.pageSize,
projectId: this.projectId
}
api.pmbuildingListApi(params).then(res => {
this.dataListLoading = false
this.dataList = res.list || []
this.totalPage = res.count || 0
//
if (this.houseDialogVisible && this.selectedBuildingId) {
this.getHouseDataList()
}
}).catch(e => {
this.dataListLoading = false
})
},
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
addBuilding () {
this.buildingFormVisible = true
if (this.$refs.pmbuildingAddOrUpdate) {
this.$refs.pmbuildingAddOrUpdate.init(0)
}
},
editBuilding (id) {
this.buildingFormVisible = true
if (this.$refs.pmbuildingAddOrUpdate) {
this.$refs.pmbuildingAddOrUpdate.init(id)
}
},
deleteBuilding (id) {
this.$confirm(`确定要删除该楼栋吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
api.pmbuildingDeleteApi([id]).then(() => {
this.$message.success('删除成功')
this.getDataList()
}).catch(err => {
// this.$message.error('')
// console.error(err)
})
}).catch(() => {
//
})
},
viewHouses (buildingId, buildingNo) {
this.selectedBuildingId = buildingId
this.selectedBuildingNo = buildingNo
this.houseDialogVisible = true
this.housePageIndex = 1
this.getHouseDataList()
},
//
handleHouseDialogClose(done) {
this.houseDialogVisible = false
},
//
addHouse() {
this.houseFormVisible = true
if (this.$refs.pmhouseAddOrUpdate) {
this.$refs.pmhouseAddOrUpdate.init(0)
}
},
//
editHouse(id) {
this.houseFormVisible = true
if (this.$refs.pmhouseAddOrUpdate) {
this.$refs.pmhouseAddOrUpdate.init(id)
}
},
//
deleteHouse(id) {
this.$confirm('确定要删除这条房屋记录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
houseApi.pmhouseDeleteApi([id]).then(() => {
this.$message.success('删除成功')
this.getHouseDataList()
}).catch(() => {
// this.$message.error('')
})
}).catch(() => {})
},
//
getHouseDataList() {
this.houseDataListLoading = true
const params = {
page: this.housePageIndex,
limit: this.housePageSize,
buildingId: this.selectedBuildingId
}
houseApi.pmhouseListApi(params).then((res) => {
this.houseDataListLoading = false
if (res.data && 'list' in res.data) {
this.houseDataList = res.data.list || []
this.houseTotalPage = res.data.total || 0
} else if ('list' in res) {
this.houseDataList = res.list || []
this.houseTotalPage = res.total || 0
} else {
//
this.houseDataList = []
this.houseTotalPage = 0
}
}).catch((error) => {
this.houseDataListLoading = false
this.houseDataList = []
this.houseTotalPage = 0
})
},
//
houseSizeChangeHandle(val) {
this.housePageSize = val
this.housePageIndex = 1
this.getHouseDataList()
},
//
houseCurrentChangeHandle(val) {
this.housePageIndex = val
this.getHouseDataList()
}
}
}
</script>
<style scoped>
.house-list-container {
margin: 10px 0;
padding: 10px;
border: 1px solid #e4e7ed;
border-radius: 4px;
background-color: #f9fafc;
}
.house-list-title {
padding: 8px 0;
font-weight: bold;
color: #303133;
border-bottom: 1px solid #e4e7ed;
margin-bottom: 10px;
}
</style>

@ -22,8 +22,8 @@
<el-button @click="resetForm()"></el-button>
<el-button v-hasPermi="['autogencode:pmproject:save']" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-hasPermi="['autogencode:pmproject:delete']" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
<el-button type="success" @click="handleImport"></el-button>
<el-button type="info" @click="handleExport"></el-button>
<!-- <el-button type="success" @click="handleImport"></el-button>-->
<!-- <el-button type="info" @click="handleExport"></el-button>-->
</el-form-item>
</el-form>
<el-table
@ -31,6 +31,8 @@
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
@expand-change="handleExpandChange"
:expand-row-keys="expandedRowKeys"
style="width: 100%;">
<el-table-column
type="selection"
@ -38,6 +40,19 @@
align="center"
width="50">
</el-table-column>
<el-table-column
type="expand"
header-align="center"
align="center">
<template slot-scope="scope">
<DispatchList
:projectId="scope.row.id"
@addBuilding="addBuilding"
@editBuilding="editBuilding"
@viewHouses="viewHouses"
/>
</template>
</el-table-column>
<el-table-column
prop="projectName"
header-align="center"
@ -102,14 +117,13 @@
label="备注">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ '' }}</el-button>
<el-button v-hasPermi="['autogencode:pmproject:delete']" type="text" size="small" @click="deleteHandle(scope.row.id)" style="color: #f56c6c;"></el-button>
<el-button v-hasPermi="['autogencode:pmproject:delete']" type="text" size="small" @click="deleteHandle(scope.row.id)" style="color: #f56c6c;">{{ '' }}</el-button>
</template>
</el-table-column>
</el-table>
@ -148,12 +162,23 @@
<el-button type="primary" @click="handleImportSubmit" :loading="importLoading"> </el-button>
</span>
</el-dialog>
<!-- 楼栋新增/修改弹窗 -->
<PmbuildingAddOrUpdate
ref="pmbuildingAddOrUpdate"
:visible.sync="buildingAddOrUpdateVisible"
:defaultProjectId="selectedProjectId"
@close="buildingAddOrUpdateVisible = false"
@refreshDataList="getDataList"
></PmbuildingAddOrUpdate>
</div>
</template>
<script>
import AddOrUpdate from './pmproject-add-and-update'
import DispatchList from './DispatchList'
import PmbuildingAddOrUpdate from '../building/pmbuilding-add-and-update'
import * as api from '@/api/pmproject.js'
import * as buildingApi from '@/api/pmbuilding.js'
export default {
dicts: ['project_status','building_type','property_type','house_status'],
@ -181,11 +206,17 @@
addOrUpdateVisible: false,
importDialogVisible: false,
importFile: null,
importLoading: false
importLoading: false,
expandedRowKeys: [], // ID
buildingVisible: false,
buildingAddOrUpdateVisible: false,
selectedProjectId: ''
}
},
components: {
AddOrUpdate
AddOrUpdate,
DispatchList,
PmbuildingAddOrUpdate
},
activated () {
this.getDataList()
@ -337,6 +368,42 @@
this.download('autogencode/pmproject/export', {
...this.queryParams
}, `房产管理报表_${new Date().getTime()}.xlsx`)
},
//
handleExpandChange(row, expandedRows) {
if (expandedRows.includes(row)) {
// ID expandedRowKeys
if (!this.expandedRowKeys.includes(row.id)) {
this.expandedRowKeys.push(row.id)
}
} else {
// ID expandedRowKeys
const index = this.expandedRowKeys.indexOf(row.id)
if (index !== -1) {
this.expandedRowKeys.splice(index, 1)
}
}
},
//
addBuilding(projectId) {
this.selectedProjectId = projectId
this.buildingAddOrUpdateVisible = true
},
//
editBuilding(buildingId) {
this.buildingAddOrUpdateVisible = true
if (this.$refs.pmbuildingAddOrUpdate) {
this.$refs.pmbuildingAddOrUpdate.init(buildingId)
}
},
//
viewHouses(buildingId, buildingNo) {
// DispatchList
//
}
}
}

@ -67,33 +67,33 @@
<el-input v-model="dataForm.remark" placeholder="备注" type="textarea"></el-input>
</el-form-item>
<!-- 显示添加楼栋按钮 -->
<el-form-item>
<el-button type="success" @click="showBuildingAddDialog"></el-button>
</el-form-item>
<!-- <el-form-item>-->
<!-- <el-button type="success" @click="showBuildingAddDialog"></el-button>-->
<!-- </el-form-item>-->
</el-form>
<!-- 楼栋列表 -->
<div v-if="buildingList.length > 0" class="building-list-container">
<el-table :data="buildingList" style="width: 100%">
<el-table-column prop="buildingNo" label="楼栋编号" width="120"></el-table-column>
<el-table-column prop="totalFloors" label="总层数" width="100"></el-table-column>
<el-table-column prop="unitCount" label="单元数" width="100"></el-table-column>
<el-table-column label="楼栋类型">
<template slot-scope="scope">
<dict-tag v-if="dict.type.building_type && dict.type.building_type.length > 0"
:options="dict.type.building_type" :value="scope.row.buildingType"/>
<span v-else>{{ scope.row.buildingType }}</span>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注"></el-table-column>
<el-table-column label="操作" width="180" fixed="right">
<template slot-scope="scope">
<el-button type="text" size="small" @click="editBuilding(scope.row, scope.$index)">修改</el-button>
<el-button type="text" size="small" @click="deleteBuilding([scope.row.id], scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- <div v-if="buildingList.length > 0" class="building-list-container">-->
<!-- <el-table :data="buildingList" style="width: 100%">-->
<!-- <el-table-column prop="buildingNo" label="楼栋编号" width="120"></el-table-column>-->
<!-- <el-table-column prop="totalFloors" label="总层数" width="100"></el-table-column>-->
<!-- <el-table-column prop="unitCount" label="单元数" width="100"></el-table-column>-->
<!-- <el-table-column label="楼栋类型">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag v-if="dict.type.building_type && dict.type.building_type.length > 0"-->
<!-- :options="dict.type.building_type" :value="scope.row.buildingType"/>-->
<!-- <span v-else>{{ scope.row.buildingType }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="remark" label="备注"></el-table-column>-->
<!-- <el-table-column label="操作" width="180" fixed="right">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button type="text" size="small" @click="editBuilding(scope.row, scope.$index)">修改</el-button>-->
<!-- <el-button type="text" size="small" @click="deleteBuilding([scope.row.id], scope.$index)">删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- </div>-->
<el-form>
</el-form>

@ -22,7 +22,7 @@
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button @click="resetForm()"></el-button>
<el-button v-hasPermi="['autogencode:pubnotice:save']" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-hasPermi="['autogencode:pubnotice:save']" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-hasPermi="['autogencode:pubnotice:delete']" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>

@ -0,0 +1,189 @@
package com.zbkj.modules.autogencode.controller;
import java.util.Arrays;
import java.util.Map;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zbkj.common.request.PageParamRequest;
import com.zbkj.common.response.CommonResult;
import com.zbkj.common.page.CommonPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zbkj.modules.autogencode.entity.CmShelf;
import com.zbkj.modules.autogencode.service.CmShelfService;
import com.zbkj.modules.autogencode.entity.CmStorageLocation;
import com.zbkj.modules.autogencode.service.CmStorageLocationService;
/**
*
*/
@RestController
@RequestMapping("api/autogencode/cmshelf")
public class CmShelfController {
@Autowired
private CmShelfService cmShelfService;
@Autowired
private CmStorageLocationService cmStorageLocationService;
/**
*
*
*/
private void condition(LambdaQueryWrapper<CmShelf> queryWrapper, CmShelf request) {
if (request == null) {
return;
}
// 根据实体类字段自动生成查询条件
// 货架ID
if (request.getId() != null) {
queryWrapper.eq(CmShelf::getId, request.getId());
}
// 货架代码
if (StrUtil.isNotBlank(request.getShelfCode())) {
queryWrapper.eq(CmShelf::getShelfCode, request.getShelfCode());
}
// 货架名称
if (StrUtil.isNotBlank(request.getShelfName())) {
queryWrapper.eq(CmShelf::getShelfName, request.getShelfName());
}
// 归属仓库ID
if (request.getWarehouseId() != null) {
queryWrapper.eq(CmShelf::getWarehouseId, request.getWarehouseId());
}
// 备注
if (StrUtil.isNotBlank(request.getRemark())) {
queryWrapper.eq(CmShelf::getRemark, request.getRemark());
}
// 删除标志0代表存在 2代表删除
if (StrUtil.isNotBlank(request.getDelFlag())) {
queryWrapper.eq(CmShelf::getDelFlag, request.getDelFlag());
}
// 创建部门
if (request.getCreateDept() != null) {
queryWrapper.eq(CmShelf::getCreateDept, request.getCreateDept());
}
// 创建人
if (request.getCreateBy() != null) {
queryWrapper.eq(CmShelf::getCreateBy, request.getCreateBy());
}
// 创建时间
if (request.getCreateTime() != null) {
queryWrapper.eq(CmShelf::getCreateTime, request.getCreateTime());
}
// 修改人
if (request.getUpdateBy() != null) {
queryWrapper.eq(CmShelf::getUpdateBy, request.getUpdateBy());
}
// 修改时间
if (request.getUpdateTime() != null) {
queryWrapper.eq(CmShelf::getUpdateTime, request.getUpdateTime());
}
// 租户ID
if (StrUtil.isNotBlank(request.getTenantId())) {
queryWrapper.eq(CmShelf::getTenantId, request.getTenantId());
}
}
/**
*
* @param request
* @param pageParamRequest
*/
@ApiOperation(value = "分页列表")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public CommonResult<CommonPage<CmShelf>> getList(@Validated CmShelf request, @Validated PageParamRequest pageParamRequest) {
LambdaQueryWrapper<CmShelf> queryWrapper = new LambdaQueryWrapper();
// 应用搜索条件
condition(queryWrapper, request);
CommonPage<CmShelf> page = CommonPage.restPage(cmShelfService.pageList(queryWrapper, pageParamRequest));
return CommonResult.success(page);
}
/**
*
*/
@RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
public CommonResult<CmShelf> info(@PathVariable("id") Long id){
CmShelf cmShelf = cmShelfService.getById(id);
return CommonResult.success(cmShelf);
}
/**
*
*/
@RequestMapping(value = "/save", method = RequestMethod.POST)
public CommonResult<String> save(@RequestBody CmShelf cmShelf){
if (cmShelfService.save(cmShelf)) {
return CommonResult.success();
}
return CommonResult.failed();
}
/**
*
*/
@RequestMapping(value = "/update", method = RequestMethod.POST)
public CommonResult<String> update(@RequestBody CmShelf cmShelf){
if (cmShelfService.updateById(cmShelf)) {
return CommonResult.success();
}
return CommonResult.failed();
}
/**
* :id
*/
@RequestMapping(value = "/delete", method = RequestMethod.POST)
public CommonResult<String> delete(@RequestBody Long[] ids){
// 检查是否有关联的货位
for (Long id : ids) {
LambdaQueryWrapper<CmStorageLocation> locationQueryWrapper = new LambdaQueryWrapper<>();
locationQueryWrapper.eq(CmStorageLocation::getShelfId, id);
locationQueryWrapper.eq(CmStorageLocation::getDelFlag, "0"); // 只检查未删除的货位
int locationCount = cmStorageLocationService.count(locationQueryWrapper);
if (locationCount > 0) {
return CommonResult.failed("删除失败,该货架下存在关联的货位");
}
}
if (cmShelfService.removeByIds(Arrays.asList(ids))) {
return CommonResult.success();
}
return CommonResult.failed();
}
}

@ -0,0 +1,173 @@
package com.zbkj.modules.autogencode.controller;
import java.util.Arrays;
import java.util.Map;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zbkj.common.request.PageParamRequest;
import com.zbkj.common.response.CommonResult;
import com.zbkj.common.page.CommonPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zbkj.modules.autogencode.entity.CmStorageLocation;
import com.zbkj.modules.autogencode.service.CmStorageLocationService;
/**
*
*/
@RestController
@RequestMapping("api/autogencode/cmstoragelocation")
public class CmStorageLocationController {
@Autowired
private CmStorageLocationService cmStorageLocationService;
/**
*
*
*/
private void condition(LambdaQueryWrapper<CmStorageLocation> queryWrapper, CmStorageLocation request) {
if (request == null) {
return;
}
// 根据实体类字段自动生成查询条件
// 货位ID
if (request.getId() != null) {
queryWrapper.eq(CmStorageLocation::getId, request.getId());
}
// 货位代码
if (StrUtil.isNotBlank(request.getStorageLocationCode())) {
queryWrapper.eq(CmStorageLocation::getStorageLocationCode, request.getStorageLocationCode());
}
// 货位名称
if (StrUtil.isNotBlank(request.getStorageLocationName())) {
queryWrapper.eq(CmStorageLocation::getStorageLocationName, request.getStorageLocationName());
}
// 归属货架ID
if (request.getShelfId() != null) {
queryWrapper.eq(CmStorageLocation::getShelfId, request.getShelfId());
}
// 备注
if (StrUtil.isNotBlank(request.getRemark())) {
queryWrapper.eq(CmStorageLocation::getRemark, request.getRemark());
}
// 删除标志0代表存在 2代表删除
if (StrUtil.isNotBlank(request.getDelFlag())) {
queryWrapper.eq(CmStorageLocation::getDelFlag, request.getDelFlag());
}
// 创建部门
if (request.getCreateDept() != null) {
queryWrapper.eq(CmStorageLocation::getCreateDept, request.getCreateDept());
}
// 创建人
if (request.getCreateBy() != null) {
queryWrapper.eq(CmStorageLocation::getCreateBy, request.getCreateBy());
}
// 创建时间
if (request.getCreateTime() != null) {
queryWrapper.eq(CmStorageLocation::getCreateTime, request.getCreateTime());
}
// 修改人
if (request.getUpdateBy() != null) {
queryWrapper.eq(CmStorageLocation::getUpdateBy, request.getUpdateBy());
}
// 修改时间
if (request.getUpdateTime() != null) {
queryWrapper.eq(CmStorageLocation::getUpdateTime, request.getUpdateTime());
}
// 租户ID
if (StrUtil.isNotBlank(request.getTenantId())) {
queryWrapper.eq(CmStorageLocation::getTenantId, request.getTenantId());
}
}
/**
*
* @param request
* @param pageParamRequest
*/
@ApiOperation(value = "分页列表")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public CommonResult<CommonPage<CmStorageLocation>> getList(@Validated CmStorageLocation request, @Validated PageParamRequest pageParamRequest) {
LambdaQueryWrapper<CmStorageLocation> queryWrapper = new LambdaQueryWrapper();
// 应用搜索条件
condition(queryWrapper, request);
CommonPage<CmStorageLocation> page = CommonPage.restPage(cmStorageLocationService.pageList(queryWrapper, pageParamRequest));
return CommonResult.success(page);
}
/**
*
*/
@RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
public CommonResult<CmStorageLocation> info(@PathVariable("id") Long id){
CmStorageLocation cmStorageLocation = cmStorageLocationService.getById(id);
return CommonResult.success(cmStorageLocation);
}
/**
*
*/
@RequestMapping(value = "/save", method = RequestMethod.POST)
public CommonResult<String> save(@RequestBody CmStorageLocation cmStorageLocation){
if (cmStorageLocationService.save(cmStorageLocation)) {
return CommonResult.success();
}
return CommonResult.failed();
}
/**
*
*/
@RequestMapping(value = "/update", method = RequestMethod.POST)
public CommonResult<String> update(@RequestBody CmStorageLocation cmStorageLocation){
if (cmStorageLocationService.updateById(cmStorageLocation)) {
return CommonResult.success();
}
return CommonResult.failed();
}
/**
* :id
*/
@RequestMapping(value = "/delete", method = RequestMethod.POST)
public CommonResult<String> delete(@RequestBody Long[] ids){
if (cmStorageLocationService.removeByIds(Arrays.asList(ids))) {
return CommonResult.success();
}
return CommonResult.failed();
}
}

@ -21,6 +21,8 @@ import org.springframework.security.access.prepost.PreAuthorize;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zbkj.modules.autogencode.entity.CmWarehouse;
import com.zbkj.modules.autogencode.service.CmWarehouseService;
import com.zbkj.modules.autogencode.entity.CmShelf;
import com.zbkj.modules.autogencode.service.CmShelfService;
@ -34,6 +36,9 @@ public class CmWarehouseController {
@Autowired
private CmWarehouseService cmWarehouseService;
@Autowired
private CmShelfService cmShelfService;
/**
@ -133,18 +138,17 @@ public class CmWarehouseController {
}
/**
*
*
* @param request
* @param pageParamRequest
*/
@ApiOperation(value = "分页列表")
@ApiOperation(value = "获取所有仓库")
@RequestMapping(value = "/listByAll", method = RequestMethod.GET)
public List<CmWarehouse> listByAll(@Validated CmWarehouse request, @Validated PageParamRequest pageParamRequest) {
public CommonResult<List<CmWarehouse>> listByAll(CmWarehouse request) {
LambdaQueryWrapper<CmWarehouse> queryWrapper = new LambdaQueryWrapper();
// 应用搜索条件
condition(queryWrapper, request);
List<CmWarehouse> cmWarehouses = cmWarehouseService.list(queryWrapper);
return cmWarehouses;
return CommonResult.success(cmWarehouses);
}
@ -185,6 +189,17 @@ public class CmWarehouseController {
*/
@RequestMapping(value = "/delete", method = RequestMethod.POST)
public CommonResult<String> delete(@RequestBody Long[] ids){
// 检查是否有关联的货架
for (Long id : ids) {
LambdaQueryWrapper<CmShelf> shelfQueryWrapper = new LambdaQueryWrapper<>();
shelfQueryWrapper.eq(CmShelf::getWarehouseId, id);
shelfQueryWrapper.eq(CmShelf::getDelFlag, "0"); // 只检查未删除的货架
int shelfCount = cmShelfService.count(shelfQueryWrapper);
if (shelfCount > 0) {
return CommonResult.failed("删除失败,该仓库下存在关联的货架");
}
}
if (cmWarehouseService.removeByIds(Arrays.asList(ids))) {
return CommonResult.success();
}

@ -22,6 +22,8 @@ import org.springframework.security.access.prepost.PreAuthorize;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zbkj.modules.autogencode.entity.PmCanteenDemand;
import com.zbkj.modules.autogencode.service.PmCanteenDemandService;
import com.zbkj.modules.autogencode.entity.PmCanteenDemandDetail;
import com.zbkj.modules.autogencode.service.PmCanteenDemandDetailService;
import com.zbkj.service.service.UserService;
import com.zbkj.common.model.user.User;
@ -40,6 +42,9 @@ public class PmCanteenDemandController {
@Autowired
private UserService ebUserService;
@Autowired
private PmCanteenDemandDetailService pmCanteenDemandDetailService;
/**
@ -211,6 +216,17 @@ public class PmCanteenDemandController {
*/
@RequestMapping(value = "/delete", method = RequestMethod.POST)
public CommonResult<String> delete(@RequestBody Long[] ids){
// 检查是否有关联的明细
for (Long id : ids) {
LambdaQueryWrapper<PmCanteenDemandDetail> detailQueryWrapper = new LambdaQueryWrapper<>();
detailQueryWrapper.eq(PmCanteenDemandDetail::getDemandId, id);
detailQueryWrapper.eq(PmCanteenDemandDetail::getDelFlag, "0"); // 只检查未删除的明细
int detailCount = pmCanteenDemandDetailService.count(detailQueryWrapper);
if (detailCount > 0) {
return CommonResult.failed("删除失败,该需求下存在关联的明细");
}
}
if (pmCanteenDemandService.removeByIds(Arrays.asList(ids))) {
return CommonResult.success();
}

@ -386,6 +386,17 @@ public class PmCanteenPurchasePlanController {
*/
@RequestMapping(value = "/delete", method = RequestMethod.POST)
public CommonResult<String> delete(@RequestBody Long[] ids){
// 检查是否有关联的明细
for (Long id : ids) {
LambdaQueryWrapper<PmCanteenPurchaseDetail> detailQueryWrapper = new LambdaQueryWrapper<>();
detailQueryWrapper.eq(PmCanteenPurchaseDetail::getPlanId, id);
detailQueryWrapper.eq(PmCanteenPurchaseDetail::getDelFlag, "0"); // 只检查未删除的明细
int detailCount = pmCanteenPurchaseDetailService.count(detailQueryWrapper);
if (detailCount > 0) {
return CommonResult.failed("删除失败,该采购计划下存在关联的明细");
}
}
if (pmCanteenPurchasePlanService.removeByIds(Arrays.asList(ids))) {
return CommonResult.success();
}
@ -463,3 +474,10 @@ public class PmCanteenPurchasePlanController {
}
}

@ -0,0 +1,13 @@
package com.zbkj.modules.autogencode.dao;
import com.zbkj.modules.autogencode.entity.CmShelf;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* DAO
*/
@Mapper
public interface CmShelfDao extends BaseMapper<CmShelf> {
}

@ -0,0 +1,13 @@
package com.zbkj.modules.autogencode.dao;
import com.zbkj.modules.autogencode.entity.CmStorageLocation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* DAO
*/
@Mapper
public interface CmStorageLocationDao extends BaseMapper<CmStorageLocation> {
}

@ -0,0 +1,79 @@
package com.zbkj.modules.autogencode.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
@Data
@TableName("cm_shelf")
public class CmShelf implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
@ApiModelProperty(value = "货架ID")
@TableId
private Long id;
/**
*
*/
@ApiModelProperty(value = "货架代码")
private String shelfCode;
/**
*
*/
@ApiModelProperty(value = "货架名称")
private String shelfName;
/**
* ID
*/
@ApiModelProperty(value = "归属仓库ID")
private Long warehouseId;
/**
*
*/
@ApiModelProperty(value = "备注")
private String remark;
/**
* 0 2
*/
@ApiModelProperty(value = "删除标志0代表存在 2代表删除")
private String delFlag;
/**
*
*/
@ApiModelProperty(value = "创建部门")
private Long createDept;
/**
*
*/
@ApiModelProperty(value = "创建人")
private Long createBy;
/**
*
*/
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
*
*/
@ApiModelProperty(value = "修改人")
private Long updateBy;
/**
*
*/
@ApiModelProperty(value = "修改时间")
private Date updateTime;
/**
* ID
*/
@ApiModelProperty(value = "租户ID")
private String tenantId;
}

@ -0,0 +1,79 @@
package com.zbkj.modules.autogencode.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
@Data
@TableName("cm_storage_location")
public class CmStorageLocation implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
@ApiModelProperty(value = "货位ID")
@TableId
private Long id;
/**
*
*/
@ApiModelProperty(value = "货位代码")
private String storageLocationCode;
/**
*
*/
@ApiModelProperty(value = "货位名称")
private String storageLocationName;
/**
* ID
*/
@ApiModelProperty(value = "归属货架ID")
private Long shelfId;
/**
*
*/
@ApiModelProperty(value = "备注")
private String remark;
/**
* 0 2
*/
@ApiModelProperty(value = "删除标志0代表存在 2代表删除")
private String delFlag;
/**
*
*/
@ApiModelProperty(value = "创建部门")
private Long createDept;
/**
*
*/
@ApiModelProperty(value = "创建人")
private Long createBy;
/**
*
*/
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
*
*/
@ApiModelProperty(value = "修改人")
private Long updateBy;
/**
*
*/
@ApiModelProperty(value = "修改时间")
private Date updateTime;
/**
* ID
*/
@ApiModelProperty(value = "租户ID")
private String tenantId;
}

@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
@ -22,6 +23,11 @@ public class PmFoodTraceability implements Serializable {
@ApiModelProperty(value = "id")
@TableId(type = IdType.AUTO)
private Long id;
/**
* id
*/
@ApiModelProperty(value = "库存id")
private Long cargoStockId;
/**
* id
*/

@ -0,0 +1,25 @@
package com.zbkj.modules.autogencode.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zbkj.modules.autogencode.entity.CmShelf;
import com.zbkj.common.request.PageParamRequest;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import java.util.List;
import java.util.Map;
/**
*
* +----------------------------------------------------------------------
*/
public interface CmShelfService extends IService<CmShelf> {
/**
* CmShelf
* @param pageParamRequest
* @return
*/
List<CmShelf> pageList(LambdaQueryWrapper<CmShelf> queryWrapper, PageParamRequest pageParamRequest);
}

@ -0,0 +1,25 @@
package com.zbkj.modules.autogencode.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zbkj.modules.autogencode.entity.CmStorageLocation;
import com.zbkj.common.request.PageParamRequest;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import java.util.List;
import java.util.Map;
/**
*
* +----------------------------------------------------------------------
*/
public interface CmStorageLocationService extends IService<CmStorageLocation> {
/**
* CmStorageLocation
* @param pageParamRequest
* @return
*/
List<CmStorageLocation> pageList(LambdaQueryWrapper<CmStorageLocation> queryWrapper, PageParamRequest pageParamRequest);
}

@ -0,0 +1,42 @@
package com.zbkj.modules.autogencode.service.impl;
import com.github.pagehelper.PageHelper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.zbkj.modules.autogencode.dao.CmShelfDao;
import com.zbkj.modules.autogencode.entity.CmShelf;
import com.zbkj.modules.autogencode.service.CmShelfService;
import com.zbkj.common.page.CommonPage;
import com.zbkj.common.request.PageParamRequest;
import javax.annotation.Resource;
import java.util.Map;
import java.util.Arrays;
import java.util.List;
@Service("cmShelfService")
public class CmShelfServiceImpl extends ServiceImpl<CmShelfDao, CmShelf> implements CmShelfService {
@Resource
private CmShelfDao dao;
/**
*
*/
@Override
public List<CmShelf> pageList(LambdaQueryWrapper<CmShelf> queryWrapper, PageParamRequest pageParamRequest) {
PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());
return dao.selectList(queryWrapper);
}
}

@ -0,0 +1,42 @@
package com.zbkj.modules.autogencode.service.impl;
import com.github.pagehelper.PageHelper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.zbkj.modules.autogencode.dao.CmStorageLocationDao;
import com.zbkj.modules.autogencode.entity.CmStorageLocation;
import com.zbkj.modules.autogencode.service.CmStorageLocationService;
import com.zbkj.common.page.CommonPage;
import com.zbkj.common.request.PageParamRequest;
import javax.annotation.Resource;
import java.util.Map;
import java.util.Arrays;
import java.util.List;
@Service("cmStorageLocationService")
public class CmStorageLocationServiceImpl extends ServiceImpl<CmStorageLocationDao, CmStorageLocation> implements CmStorageLocationService {
@Resource
private CmStorageLocationDao dao;
/**
*
*/
@Override
public List<CmStorageLocation> pageList(LambdaQueryWrapper<CmStorageLocation> queryWrapper, PageParamRequest pageParamRequest) {
PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());
return dao.selectList(queryWrapper);
}
}

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zbkj.modules.autogencode.dao.CmShelfDao">
<!-- 根据包名 模块名 以及类名 生成Mapper XML 配置文件 -->
<resultMap type="com.zbkj.modules.autogencode.entity.CmShelf" id="cmShelfMap">
<result property="id" column="id"/>
<result property="shelfCode" column="shelf_code"/>
<result property="shelfName" column="shelf_name"/>
<result property="warehouseId" column="warehouse_id"/>
<result property="remark" column="remark"/>
<result property="delFlag" column="del_flag"/>
<result property="createDept" column="create_dept"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="tenantId" column="tenant_id"/>
</resultMap>
</mapper>

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zbkj.modules.autogencode.dao.CmStorageLocationDao">
<!-- 根据包名 模块名 以及类名 生成Mapper XML 配置文件 -->
<resultMap type="com.zbkj.modules.autogencode.entity.CmStorageLocation" id="cmStorageLocationMap">
<result property="id" column="id"/>
<result property="storageLocationCode" column="storage_location_code"/>
<result property="storageLocationName" column="storage_location_name"/>
<result property="shelfId" column="shelf_id"/>
<result property="remark" column="remark"/>
<result property="delFlag" column="del_flag"/>
<result property="createDept" column="create_dept"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="tenantId" column="tenant_id"/>
</resultMap>
</mapper>
Loading…
Cancel
Save