|
|
|
@ -3,52 +3,52 @@
|
|
|
|
|
<div class="avue-crud"> |
|
|
|
|
<el-row v-if="!search"> |
|
|
|
|
<!-- 查询模块 --> |
|
|
|
|
<el-form :inline="true" :model="query" style='width:100%'> |
|
|
|
|
<el-form :inline="true" :model="query" style="width: 100%"> |
|
|
|
|
<!-- 查询按钮 --> |
|
|
|
|
|
|
|
|
|
<el-form-item class='fr-fo'> |
|
|
|
|
<el-col class='el-sl'> |
|
|
|
|
|
|
|
|
|
<el-form-item class="fr-fo"> |
|
|
|
|
<el-col class="el-sl"> |
|
|
|
|
<div> |
|
|
|
|
<el-form-item label="启用状态:" prop="areaStatus"> |
|
|
|
|
<!-- <el-input v-model="form.areaStatus" placeholder="请输入货区状态;1-启用,2-禁用"/>--> |
|
|
|
|
<el-select |
|
|
|
|
v-model="query.enableStatus" |
|
|
|
|
clearable |
|
|
|
|
placeholder="请选择启用状态" |
|
|
|
|
style="width: 88%" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in enableStatus" |
|
|
|
|
:key="item.dictKey" |
|
|
|
|
:label="item.dictValue" |
|
|
|
|
:value="item.dictKey" |
|
|
|
|
<el-form-item label="启用状态:" prop="areaStatus"> |
|
|
|
|
<!-- <el-input v-model="form.areaStatus" placeholder="请输入货区状态;1-启用,2-禁用"/>--> |
|
|
|
|
<el-select |
|
|
|
|
v-model="query.enableStatus" |
|
|
|
|
clearable |
|
|
|
|
placeholder="请选择启用状态" |
|
|
|
|
style="width: 88%" |
|
|
|
|
> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="货区类型:" prop="areaStatus"> |
|
|
|
|
<el-select |
|
|
|
|
v-model="query.areaType" |
|
|
|
|
clearable |
|
|
|
|
placeholder="请选择货区类型" |
|
|
|
|
style="width: 88%" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in areaTypeData" |
|
|
|
|
:key="item.dictKey" |
|
|
|
|
:label="item.dictValue" |
|
|
|
|
:value="item.dictKey" |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in enableStatus" |
|
|
|
|
:key="item.dictKey" |
|
|
|
|
:label="item.dictValue" |
|
|
|
|
:value="item.dictKey" |
|
|
|
|
> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="货区类型:" prop="areaStatus"> |
|
|
|
|
<el-select |
|
|
|
|
v-model="query.areaType" |
|
|
|
|
clearable |
|
|
|
|
placeholder="请选择货区类型" |
|
|
|
|
style="width: 88%" |
|
|
|
|
> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="searchChange" |
|
|
|
|
>搜 索</el-button |
|
|
|
|
> |
|
|
|
|
<el-button icon="el-icon-delete" @click="searchReset()">清 空</el-button> |
|
|
|
|
</div> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in areaTypeData" |
|
|
|
|
:key="item.dictKey" |
|
|
|
|
:label="item.dictValue" |
|
|
|
|
:value="item.dictKey" |
|
|
|
|
> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="searchChange" |
|
|
|
|
>搜 索</el-button |
|
|
|
|
> |
|
|
|
|
<el-button icon="el-icon-delete" @click="searchReset()">清 空</el-button> |
|
|
|
|
</div> |
|
|
|
|
</el-col> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
@ -61,7 +61,12 @@
|
|
|
|
|
<el-button type="danger" icon="el-icon-delete" @click="handleDelete" plain |
|
|
|
|
>删 除</el-button |
|
|
|
|
> |
|
|
|
|
<el-button type="danger" icon="el-icon-download" @click="handleExport" plain |
|
|
|
|
<el-button |
|
|
|
|
type="danger" |
|
|
|
|
icon="el-icon-download" |
|
|
|
|
:loading="buttonLoadingList.handleExportBtn" |
|
|
|
|
@click="handleExport" |
|
|
|
|
plain |
|
|
|
|
>导 出 货 区</el-button |
|
|
|
|
> |
|
|
|
|
<el-button type="danger" icon="el-icon-upload" plain @click="handleImport" |
|
|
|
@ -73,7 +78,7 @@
|
|
|
|
|
<el-button type="danger" icon="el-icon-check" @click="handleEnable" plain |
|
|
|
|
>启 用</el-button |
|
|
|
|
> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<!-- 头部右侧按钮模块 --> |
|
|
|
|
<div class="avue-crud__right"> |
|
|
|
|
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button> |
|
|
|
@ -229,7 +234,11 @@
|
|
|
|
|
<!-- 表单按钮 --> |
|
|
|
|
<template #footer> |
|
|
|
|
<span v-if="!view" class="dialog-footer"> |
|
|
|
|
<el-button type="primary" icon="el-icon-circle-check" @click="handleSubmit" |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
icon="el-icon-circle-check" |
|
|
|
|
:loading="buttonLoadingList.handleSubmitBtn" |
|
|
|
|
@click="handleSubmit" |
|
|
|
|
>提 交</el-button |
|
|
|
|
> |
|
|
|
|
<el-button icon="el-icon-circle-close" @click="handleClose">取 消</el-button> |
|
|
|
@ -470,6 +479,7 @@ export default {
|
|
|
|
|
areaType: [{ required: true, message: '请选择货区类型!', trigger: 'change' }], |
|
|
|
|
}, |
|
|
|
|
aaa: false, |
|
|
|
|
buttonLoadingList: { handleSubmitBtn: false, handleExportBtn: false }, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
@ -571,52 +581,62 @@ export default {
|
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleExport(row) { |
|
|
|
|
let downloadUrl = `/api/logpm-basicdata/goodsArea/export-warehouseGoodsArea?${ |
|
|
|
|
this.website.tokenHeader |
|
|
|
|
}=${getToken()}`; |
|
|
|
|
const {} = this.query; |
|
|
|
|
let values = null; |
|
|
|
|
if (!!row) { |
|
|
|
|
values = { ids: this.ids }; |
|
|
|
|
} else { |
|
|
|
|
values = { id: row.id }; |
|
|
|
|
} |
|
|
|
|
this.$confirm('是否导出数据?', '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() => { |
|
|
|
|
NProgress.start(); |
|
|
|
|
exportBlob(downloadUrl, values).then(res => { |
|
|
|
|
console.log('导出>>>>>>>>>>{}', res); |
|
|
|
|
downloadXls(res.data, `货区信息` + `${dateNow()}.xlsx`); |
|
|
|
|
NProgress.done(); |
|
|
|
|
try { |
|
|
|
|
this.buttonLoadingList.handleExportBtn = true; |
|
|
|
|
let downloadUrl = `/api/logpm-basicdata/goodsArea/export-warehouseGoodsArea?${ |
|
|
|
|
this.website.tokenHeader |
|
|
|
|
}=${getToken()}`; |
|
|
|
|
const {} = this.query; |
|
|
|
|
let values = null; |
|
|
|
|
if (!!row) { |
|
|
|
|
values = { ids: this.ids }; |
|
|
|
|
} else { |
|
|
|
|
values = { id: row.id }; |
|
|
|
|
} |
|
|
|
|
this.$confirm('是否导出数据?', '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() => { |
|
|
|
|
NProgress.start(); |
|
|
|
|
exportBlob(downloadUrl, values).then(res => { |
|
|
|
|
console.log('导出>>>>>>>>>>{}', res); |
|
|
|
|
downloadXls(res.data, `货区信息` + `${dateNow()}.xlsx`); |
|
|
|
|
NProgress.done(); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} finally { |
|
|
|
|
this.buttonLoadingList.handleExportBtn = false; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
handleSubmit() { |
|
|
|
|
//表单校验 |
|
|
|
|
this.$refs.form.validate(valid => { |
|
|
|
|
if (valid) { |
|
|
|
|
if (!this.form.id) { |
|
|
|
|
add(this.form).then(() => { |
|
|
|
|
this.box = false; |
|
|
|
|
this.isShow = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: 'success', |
|
|
|
|
message: '操作成功!', |
|
|
|
|
this.buttonLoadingList.handleSubmitBtn = true; |
|
|
|
|
try { |
|
|
|
|
if (!this.form.id) { |
|
|
|
|
add(this.form).then(() => { |
|
|
|
|
this.box = false; |
|
|
|
|
this.isShow = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: 'success', |
|
|
|
|
message: '操作成功!', |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
update(this.form).then(() => { |
|
|
|
|
this.box = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: 'success', |
|
|
|
|
message: '操作成功!', |
|
|
|
|
} else { |
|
|
|
|
update(this.form).then(() => { |
|
|
|
|
this.box = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: 'success', |
|
|
|
|
message: '操作成功!', |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} finally { |
|
|
|
|
this.buttonLoadingList.handleSubmitBtn = false; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
console.log('error submit!!'); |
|
|
|
@ -853,12 +873,12 @@ export default {
|
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style scoped lang='scss'> |
|
|
|
|
.fr-fo{ |
|
|
|
|
width:100%; |
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|
.fr-fo { |
|
|
|
|
width: 100%; |
|
|
|
|
} |
|
|
|
|
.el-sl{ |
|
|
|
|
display:flex; |
|
|
|
|
.el-sl { |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: space-between; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|