master
xqu 3 years ago
parent 716fddb087
commit dd38f39824
  1. 203
      src/views/wcs/location/index.vue

@ -67,7 +67,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['wcs:location:add']" v-hasPermi="['wcs:location:add']"
>新增</el-button> >新增
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -78,7 +79,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['wcs:location:edit']" v-hasPermi="['wcs:location:edit']"
>修改</el-button> >修改
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -89,7 +91,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['wcs:location:remove']" v-hasPermi="['wcs:location:remove']"
>删除</el-button> >删除
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -101,7 +104,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleLock" @click="handleLock"
v-hasPermi="['wcs:location:lock']" v-hasPermi="['wcs:location:lock']"
>锁定</el-button> >锁定
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -113,37 +117,38 @@
:disabled="multiple" :disabled="multiple"
@click="handleUnLock" @click="handleUnLock"
v-hasPermi="['wcs:location:lock']" v-hasPermi="['wcs:location:lock']"
>解锁</el-button> >解锁
</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="locationList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="locationList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center"/>
<!-- <el-table-column label="主键" align="center" prop="id" />--> <!-- <el-table-column label="主键" align="center" prop="id" />-->
<el-table-column label="货位编码" align="center" prop="locationCode" /> <el-table-column label="货位编码" align="center" prop="locationCode"/>
<el-table-column label="货位名称" align="center" prop="locationName" /> <el-table-column label="货位名称" align="center" prop="locationName"/>
<el-table-column label="所在区域" align="center" prop="locationAreaNo"> <el-table-column label="所在区域" align="center" prop="locationAreaNo">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.location_group_dict" :value="scope.row.locationAreaNo"/> <dict-tag :options="dict.type.location_group_dict" :value="scope.row.locationAreaNo"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="货位类型" align="center" prop="locationType" > <el-table-column label="货位类型" align="center" prop="locationType">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.location_type" :value="scope.row.locationType"/> <dict-tag :options="dict.type.location_type" :value="scope.row.locationType"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="货位状态" align="center" prop="locationStatus" > <el-table-column label="货位状态" align="center" prop="locationStatus">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.location_status" :value="scope.row.locationStatus"/> <dict-tag :options="dict.type.location_status" :value="scope.row.locationStatus"/>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="巷道" align="center" prop="tunnel" />--> <!-- <el-table-column label="巷道" align="center" prop="tunnel" />-->
<el-table-column label="排" align="center" prop="locationRow" /> <el-table-column label="排" align="center" prop="locationRow"/>
<el-table-column label="层" align="center" prop="locationLayer" /> <el-table-column label="层" align="center" prop="locationLayer"/>
<el-table-column label="列" align="center" prop="locationColumn" /> <el-table-column label="列" align="center" prop="locationColumn"/>
<el-table-column label="BoxId" align="center" prop="boxId" /> <el-table-column label="BoxId" align="center" prop="boxId"/>
<el-table-column label="锁定标识" align="center" prop="lockFlag"> <el-table-column label="锁定标识" align="center" prop="lockFlag">
<template slot-scope="scope"> <template slot-scope="scope">
@ -159,28 +164,32 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['wcs:location:edit']" v-hasPermi="['wcs:location:edit']"
>修改</el-button> >修改
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['wcs:location:remove']" v-hasPermi="['wcs:location:remove']"
>删除</el-button> >删除
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-circle-check" icon="el-icon-circle-check"
@click="handleVerify(scope.row)" @click="handleVerify(scope.row)"
v-hasPermi="['wcs:location:verify']" v-hasPermi="['wcs:location:verify']"
>验证</el-button> >验证
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-refresh" icon="el-icon-refresh"
@click="handleRescan(scope.row)" @click="handleRescan(scope.row)"
v-hasPermi="['wcs:location:rescan']" v-hasPermi="['wcs:location:rescan']"
>重扫</el-button> >重扫
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -197,10 +206,10 @@
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="货位编码" prop="locationCode"> <el-form-item label="货位编码" prop="locationCode">
<el-input v-model="form.locationCode" placeholder="请输入货位编码" /> <el-input v-model="form.locationCode" placeholder="请输入货位编码"/>
</el-form-item> </el-form-item>
<el-form-item label="货位名称" prop="locationName"> <el-form-item label="货位名称" prop="locationName">
<el-input v-model="form.locationName" placeholder="请输入货位名称" /> <el-input v-model="form.locationName" placeholder="请输入货位名称"/>
</el-form-item> </el-form-item>
<el-form-item label="货位分组" prop="locationAreaNo"> <el-form-item label="货位分组" prop="locationAreaNo">
<el-select <el-select
@ -250,17 +259,17 @@
</el-form-item> </el-form-item>
<!-- <el-form-item label="巷道" prop="tunnel">--> <!-- <el-form-item label="巷道" prop="tunnel">-->
<!-- <el-input v-model="form.tunnel" placeholder="请输入巷道" />--> <!-- <el-input v-model="form.tunnel" placeholder="请输入巷道" />-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item label="排" prop="locationRow"> <el-form-item label="排" prop="locationRow">
<el-input v-model="form.locationRow" placeholder="请输入排" /> <el-input v-model="form.locationRow" placeholder="请输入排"/>
</el-form-item> </el-form-item>
<el-form-item label="层" prop="locationLayer"> <el-form-item label="层" prop="locationLayer">
<el-input v-model="form.locationLayer" placeholder="请输入层" /> <el-input v-model="form.locationLayer" placeholder="请输入层"/>
</el-form-item> </el-form-item>
<el-form-item label="列" prop="locationColumn"> <el-form-item label="列" prop="locationColumn">
<el-input v-model="form.locationColumn" placeholder="请输入列" /> <el-input v-model="form.locationColumn" placeholder="请输入列"/>
</el-form-item> </el-form-item>
<el-form-item label="锁定标识" prop="lockFlag"> <el-form-item label="锁定标识" prop="lockFlag">
<el-select <el-select
@ -287,11 +296,19 @@
</template> </template>
<script> <script>
import { listLocation, getLocation, delLocation, addLocation, updateLocation,lockLocation,unlockLocation } from "@/api/wcs/location"; import {
listLocation,
getLocation,
delLocation,
addLocation,
updateLocation,
lockLocation,
unlockLocation
} from '@/api/wcs/location'
export default { export default {
name: "Location", name: 'Location',
dicts: ['number_yes_no','location_group_dict','lock_flag_dict','location_type','location_status'], dicts: ['number_yes_no', 'location_group_dict', 'lock_flag_dict', 'location_type', 'location_status'],
data() { data() {
return { return {
// //
@ -309,7 +326,7 @@ export default {
// //
locationList: [], locationList: [],
// //
title: "", title: '',
// //
open: false, open: false,
// //
@ -319,48 +336,48 @@ export default {
locationName: null, locationName: null,
boxId: null, boxId: null,
locationAreaNo: null, locationAreaNo: null,
locationType:null, locationType: null,
locationStatus:null, locationStatus: null
}, },
// //
form: {}, form: {},
// //
rules: { rules: {
locationCode: [ locationCode: [
{ required: true, message: "货位编码不能为空", trigger: "blur" } { required: true, message: '货位编码不能为空', trigger: 'blur' }
], ],
locationName: [ locationName: [
{ required: true, message: "货位名称不能为空", trigger: "blur" } { required: true, message: '货位名称不能为空', trigger: 'blur' }
], ],
boxId: [ boxId: [
{ required: true, message: "boxId不能为空", trigger: "blur" } { required: true, message: 'boxId不能为空', trigger: 'blur' }
], ],
locationAreaNo: [ locationAreaNo: [
{ required: true, message: "货位分组不能为空", trigger: "blur" } { required: true, message: '货位分组不能为空', trigger: 'blur' }
], ]
// tunnel: [ // tunnel: [
// { required: true, message: "", trigger: "blur" } // { required: true, message: "", trigger: "blur" }
// ], // ],
} }
}; }
}, },
created() { created() {
this.getList(); this.getList()
}, },
methods: { methods: {
/** 查询货位信息列表 */ /** 查询货位信息列表 */
getList() { getList() {
this.loading = true; this.loading = true
listLocation(this.queryParams).then(response => { listLocation(this.queryParams).then(response => {
this.locationList = response.rows; this.locationList = response.rows
this.total = response.total; this.total = response.total
this.loading = false; this.loading = false
}); })
}, },
// //
cancel() { cancel() {
this.open = false; this.open = false
this.reset(); this.reset()
}, },
// //
reset() { reset() {
@ -372,99 +389,101 @@ export default {
locationAreaNo: null, locationAreaNo: null,
// tunnel: null, // tunnel: null,
locationRow: null, locationRow: null,
locationStatus:null, locationStatus: null,
locationLayer: null, locationLayer: null,
locationColumn: null, locationColumn: null,
createTime: null, createTime: null,
updateTime: null, updateTime: null,
lockFlag:null lockFlag: null
}; }
this.resetForm("form"); this.resetForm('form')
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1
this.getList(); this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm('queryForm')
this.handleQuery(); this.handleQuery()
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)
this.single = selection.length!==1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset()
this.open = true; this.open = true
this.title = "添加货位信息"; this.title = '添加货位信息'
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset()
const id = row.id || this.ids const id = row.id || this.ids
getLocation(id).then(response => { getLocation(id).then(response => {
this.form = response.data; this.form = response.data
this.open = true; this.open = true
this.title = "修改货位信息"; this.title = '修改货位信息'
}); })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
updateLocation(this.form).then(response => { updateLocation(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess('修改成功')
this.open = false; this.open = false
this.getList(); this.getList()
}); })
} else { } else {
addLocation(this.form).then(response => { addLocation(this.form).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess('新增成功')
this.open = false; this.open = false
this.getList(); this.getList()
}); })
} }
} }
}); })
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids
this.$modal.confirm('是否确认删除货位信息编号为"' + ids + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除货位信息编号为"' + ids + '"的数据项?').then(function() {
return delLocation(ids); return delLocation(ids)
}).then(() => { }).then(() => {
this.getList(); this.getList()
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess('删除成功')
}).catch(() => {}); }).catch(() => {
})
}, },
handleLock(row) { handleLock(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids
this.$modal.confirm('是否确认锁定货位信息编号为"' + ids + '"的数据项?').then(function() { this.$modal.confirm('是否确认锁定货位信息编号为"' + ids + '"的数据项?').then(function() {
return lockLocation(ids); return lockLocation(ids)
}).then(() => { }).then(() => {
this.getList(); this.getList()
this.$modal.msgSuccess("锁定成功"); this.$modal.msgSuccess('锁定成功')
}).catch(() => {}); }).catch(() => {
})
}, },
handleUnLock(row) { handleUnLock(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids
this.$modal.confirm('是否确认解锁货位信息编号为"' + ids + '"的数据项?').then(function() { this.$modal.confirm('是否确认解锁货位信息编号为"' + ids + '"的数据项?').then(function() {
return unlockLocation(ids); return unlockLocation(ids)
}).then(() => { }).then(() => {
this.getList(); this.getList()
this.$modal.msgSuccess("解锁成功"); this.$modal.msgSuccess('解锁成功')
}).catch(() => {}); }).catch(() => {
})
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('wcs/location/export', { this.download('wcs/location/export', {
@ -472,5 +491,5 @@ export default {
}, `location_${new Date().getTime()}.xlsx`) }, `location_${new Date().getTime()}.xlsx`)
} }
} }
}; }
</script> </script>

Loading…
Cancel
Save