parent
5507398dfb
commit
1d136843d9
7 changed files with 636 additions and 517 deletions
@ -0,0 +1,313 @@ |
||||
<template> |
||||
<div> |
||||
<avue-crud |
||||
:option="storageOption" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
v-model="form" |
||||
v-model:page="page" |
||||
ref="crud" |
||||
@row-del="rowDel" |
||||
@row-update="rowUpdate" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@selection-change="selectionChange" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
> |
||||
<template #menu-left> |
||||
<el-button type="primary" @click="handleAdd">新增</el-button> |
||||
</template> |
||||
</avue-crud> |
||||
<add-edit-dialog v-if="showDialog" :showDialog="showDialog" :title="dialogTitle" |
||||
@closeDialog="closeDialog"></add-edit-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import {storageOption} from "../js/warehouseMain.js" |
||||
import addEditDialog from "../components/addEditDialog.vue" |
||||
import {getWareList,addWare,editWare,deleteWare,getLocationList,delLocation, |
||||
editLocation,getUserByRoleAlias,getWareByUser,getWareSelect,getUserByWare,saveUserWare,getAllUser, |
||||
saveWareUser,getMaterialSelect} from "@/api/storeManagement/warehouseMaintenance"; |
||||
export default { |
||||
components:{addEditDialog}, |
||||
data(){ |
||||
return{ |
||||
storageOption:{ |
||||
columnSort: true, |
||||
tip: false, |
||||
height: "auto", |
||||
align: "center", |
||||
calcHeight: 32, |
||||
simplePage: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
searchIcon: true, |
||||
searchIndex: 3, |
||||
tree: false, |
||||
border: true, |
||||
index: true, |
||||
selection: true, |
||||
viewBtn: false, |
||||
addBtn: false, |
||||
delBtn: true, |
||||
editBtn: true, |
||||
editBtnIcon: " ", |
||||
delBtnIcon: " ", |
||||
labelWidth: 120, |
||||
menu: true, |
||||
menuWidth: 120, |
||||
dialogWidth: 920, |
||||
dialogClickModal: false, |
||||
searchEnter: true, |
||||
excelBtn: true, |
||||
gridBtn: false, |
||||
searchShowBtn: false, |
||||
showOverflowTooltip: true, |
||||
searchLabelPosition: "left", |
||||
searchLabelPosition: "left", |
||||
searchGutter: 24, |
||||
searchSpan: 6, |
||||
menuAlign: "left", |
||||
gridBtn: false, |
||||
searchMenuPosition: "right", |
||||
addBtnIcon: " ", |
||||
viewBtnIcon: " ", |
||||
delBtnIcon: " ", |
||||
editBtnIcon: " ", |
||||
column: [ |
||||
{ |
||||
label: '所属库房', |
||||
prop: 'shId', |
||||
span: 12, |
||||
overflow: true, |
||||
search: true, |
||||
type: 'select', |
||||
filterable: true, |
||||
remote: true, |
||||
dicUrl:`/api/blade-wms/stStorehouse/page?shName={{key}}`, |
||||
props:{ |
||||
label: 'shName', |
||||
value: 'id', |
||||
res: 'data.records', |
||||
}, |
||||
// dicData: [ |
||||
// { |
||||
// label: '库房一', |
||||
// value: 1 |
||||
// }, |
||||
// { |
||||
// label: '库房二', |
||||
// value: 2 |
||||
// }, |
||||
// { |
||||
// label: '库房三', |
||||
// value: 3 |
||||
// }, |
||||
// ], |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: '请输入所属库房', |
||||
trigger: 'blur', |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: '库位号', |
||||
prop: 'location', |
||||
span: 12, |
||||
overflow: true, |
||||
search: true, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: '请输入库位号', |
||||
trigger: 'blur', |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: '物料编号', |
||||
prop: 'goodsCode', |
||||
span: 12, |
||||
overflow: true, |
||||
search: true, |
||||
type: 'select', |
||||
filterable: true, |
||||
remote: true, |
||||
dicUrl:`/api/blade-wms/stGoods/page?goodsCode={{key}}`, |
||||
props:{ |
||||
label: 'goodsCode', |
||||
value: 'id', |
||||
res: 'data.records', |
||||
}, |
||||
change:(val)=>{ |
||||
console.log('val========',val) |
||||
this.form.goodsName = val && val.item && val.item.goodsName |
||||
this.form.specifications = val && val.item && val.item.specifications |
||||
this.form.mtltmrk = val && val.item && val.item.mtltmrk |
||||
} |
||||
// dicData: [ |
||||
// { |
||||
// label: '物料一', |
||||
// value: 1 |
||||
// }, |
||||
// { |
||||
// label: '物料二', |
||||
// value: 2 |
||||
// }, |
||||
// { |
||||
// label: '物料三', |
||||
// value: 3 |
||||
// }, |
||||
// ], |
||||
// rules: [ |
||||
// { |
||||
// required: true, |
||||
// message: '请输入物料编号', |
||||
// trigger: 'blur', |
||||
// }, |
||||
// ], |
||||
}, |
||||
{ |
||||
label: '物料名称', |
||||
prop: 'goodsName', |
||||
span: 12, |
||||
overflow: true, |
||||
search: false, |
||||
disabled: true, |
||||
// rules: [ |
||||
// { |
||||
// required: true, |
||||
// message: '请输入物料名称', |
||||
// trigger: 'blur', |
||||
// }, |
||||
// ], |
||||
}, |
||||
{ |
||||
label: '物料规格', |
||||
prop: 'specifications', |
||||
span: 12, |
||||
overflow: true, |
||||
search: false, |
||||
disabled: true, |
||||
// rules: [ |
||||
// { |
||||
// required: true, |
||||
// message: '请输入物料规格', |
||||
// trigger: 'blur', |
||||
// }, |
||||
// ], |
||||
}, |
||||
{ |
||||
label: '型号/牌号', |
||||
prop: 'mtltmrk', |
||||
span: 12, |
||||
overflow: true, |
||||
search: false, |
||||
disabled: true, |
||||
// rules: [ |
||||
// { |
||||
// required: true, |
||||
// message: '请输入型号/牌号', |
||||
// trigger: 'blur', |
||||
// }, |
||||
// ], |
||||
}, |
||||
] |
||||
}, |
||||
data: [], |
||||
form: {}, |
||||
query:{}, |
||||
page: { |
||||
total: 0, |
||||
current: 1, |
||||
size: 10, |
||||
}, |
||||
showDialog:false, |
||||
dialogTitle:'', |
||||
loading: false, |
||||
} |
||||
}, |
||||
mounted(){ |
||||
|
||||
}, |
||||
methods:{ |
||||
searchChange(params, done){ |
||||
this.query = params |
||||
this.page.currentPage = 1; |
||||
this.onLoad() |
||||
done() |
||||
}, |
||||
searchReset(){ |
||||
this.query = {} |
||||
this.onLoad() |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
this.onLoad() |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
this.onLoad() |
||||
}, |
||||
refreshChange(){ |
||||
this.onLoad() |
||||
}, |
||||
handleAdd() { |
||||
this.dialogTitle = '新增' |
||||
this.showDialog = true |
||||
}, |
||||
rowDel(row) { |
||||
this.$confirm("确定删除此条数据?", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning", |
||||
}).then(() => { |
||||
delLocation({ |
||||
ids:row.id |
||||
}).then(res =>{ |
||||
if(res.data.code == 200){ |
||||
this.$message.success('删除成功') |
||||
this.onLoad() |
||||
} |
||||
}) |
||||
}) |
||||
}, |
||||
rowUpdate(row, index, done, loading) { |
||||
console.log('row',row) |
||||
editLocation(row).then(res =>{ |
||||
if(res.data.code == 200){ |
||||
this.$message.success('修改成功') |
||||
done() |
||||
this.onLoad() |
||||
} |
||||
}) |
||||
}, |
||||
closeDialog(val){ |
||||
this.showDialog = false |
||||
if(val){ |
||||
this.getLocation() |
||||
} |
||||
}, |
||||
onLoad(){ |
||||
getLocationList({ |
||||
current:this.page.currentPage, |
||||
size:this.page.pageSize, |
||||
...this.query |
||||
}).then(res =>{ |
||||
this.data = res.data.data.records |
||||
this.page.total = res.data.data.total; |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style> |
||||
|
||||
</style> |
||||
@ -0,0 +1,127 @@ |
||||
<template> |
||||
<div> |
||||
<avue-crud |
||||
:option="warehouseOption" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
v-model="form" |
||||
v-model:page="page" |
||||
ref="crud" |
||||
@row-del="rowDel" |
||||
@row-save="rowSave" |
||||
@row-update="rowUpdate" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@selection-change="selectionChange" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
></avue-crud> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import {warehouseOption} from "../js/warehouseMain.js" |
||||
import {getWareList,addWare,editWare,deleteWare,getLocationList,delLocation, |
||||
editLocation,getUserByRoleAlias,getWareByUser,getWareSelect,getUserByWare,saveUserWare,getAllUser, |
||||
saveWareUser,getMaterialSelect} from "@/api/storeManagement/warehouseMaintenance"; |
||||
|
||||
export default { |
||||
data() { |
||||
return { |
||||
warehouseOption, |
||||
data: [], |
||||
form: {}, |
||||
page: { |
||||
total: 0, |
||||
current: 1, |
||||
size: 10, |
||||
}, |
||||
query:{}, |
||||
loading: false, |
||||
}; |
||||
}, |
||||
mounted() { |
||||
}, |
||||
methods:{ |
||||
searchChange(params, done){ |
||||
this.query = params |
||||
this.page.currentPage = 1; |
||||
this.onLoad() |
||||
done() |
||||
}, |
||||
searchReset(){ |
||||
this.query = {} |
||||
this.onLoad() |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
this.onLoad() |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
this.onLoad() |
||||
}, |
||||
refreshChange(){ |
||||
this.onLoad() |
||||
}, |
||||
rowDel(row) { |
||||
this.$confirm("确定删除此条数据?", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning", |
||||
}).then(() => { |
||||
deleteWare({ |
||||
ids:row.id |
||||
}).then(res =>{ |
||||
if(res.data.code == 200){ |
||||
this.$message.success('删除成功') |
||||
this.onLoad() |
||||
} |
||||
}) |
||||
}) |
||||
}, |
||||
rowSave(row, done, loading){ |
||||
addWare(row).then(res =>{ |
||||
if(res.data.code == 200){ |
||||
this.$message.success('新增成功') |
||||
done() |
||||
this.onLoad() |
||||
} |
||||
}).catch(() =>{ |
||||
// loading() |
||||
done() |
||||
}) |
||||
}, |
||||
rowUpdate(row, index, done, loading) { |
||||
console.log('row',row) |
||||
editWare(row).then(res =>{ |
||||
if(res.data.code == 200){ |
||||
this.$message.success('修改成功') |
||||
done() |
||||
this.onLoad() |
||||
} |
||||
}) |
||||
}, |
||||
onLoad(){ |
||||
getWareList({ |
||||
current:this.page.currentPage, |
||||
size:this.page.pageSize, |
||||
...this.query |
||||
}).then(res =>{ |
||||
res.data.data.records.map(item =>{ |
||||
item.type = (item.type || item.type == 0) ? item.type + '' : item.type |
||||
item.toolingType = (item.toolingType || item.toolingType == 0) ? item.toolingType + '' : item.toolingType |
||||
}) |
||||
this.data = res.data.data.records |
||||
this.page.total = res.data.data.total; |
||||
}) |
||||
} |
||||
} |
||||
|
||||
}; |
||||
</script> |
||||
|
||||
<style> |
||||
</style> |
||||
Loading…
Reference in new issue