master
xqu 3 years ago
parent 716fddb087
commit dd38f39824
  1. 155
      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,7 +117,8 @@
: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>
@ -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>
@ -287,10 +296,18 @@
</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,
// //
@ -320,47 +337,47 @@ export default {
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() {
@ -378,18 +395,18 @@ export default {
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) {
@ -399,72 +416,74 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
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