|
|
|
|
@ -22,104 +22,233 @@ |
|
|
|
|
</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"; |
|
|
|
|
// 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, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
warehouseOption: { |
|
|
|
|
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: false, |
|
|
|
|
viewBtn: false, |
|
|
|
|
addBtn: true, |
|
|
|
|
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', |
|
|
|
|
searchLabelWidth: 'auto', |
|
|
|
|
searchGutter: 24, |
|
|
|
|
searchSpan: 6, |
|
|
|
|
menuAlign: 'left', |
|
|
|
|
gridBtn: false, |
|
|
|
|
searchMenuPosition: 'right', |
|
|
|
|
addBtnIcon: ' ', |
|
|
|
|
viewBtnIcon: ' ', |
|
|
|
|
delBtnIcon: ' ', |
|
|
|
|
editBtnIcon: ' ', |
|
|
|
|
column: [ |
|
|
|
|
{ |
|
|
|
|
label: '库房编码', |
|
|
|
|
prop: 'shCode', |
|
|
|
|
span: 12, |
|
|
|
|
overflow: true, |
|
|
|
|
search: true, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请输入库房编码', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '库房名称', |
|
|
|
|
prop: 'shName', |
|
|
|
|
span: 12, |
|
|
|
|
overflow: true, |
|
|
|
|
search: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '类别说明', |
|
|
|
|
prop: 'memo', |
|
|
|
|
span: 12, |
|
|
|
|
overflow: true, |
|
|
|
|
search: false, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '所属工装类型', |
|
|
|
|
prop: 'toolingType', |
|
|
|
|
span: 12, |
|
|
|
|
type: 'select', |
|
|
|
|
overflow: true, |
|
|
|
|
search: true, |
|
|
|
|
dicUrl: '/api/blade-system/dict/dictionary?code=workwear_type', |
|
|
|
|
props: { label: 'dictValue', value: 'dictKey' }, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '所属类别', |
|
|
|
|
prop: 'type', |
|
|
|
|
span: 12, |
|
|
|
|
overflow: true, |
|
|
|
|
search: true, |
|
|
|
|
type: 'select', |
|
|
|
|
dicUrl: '/blade-system/dict/dictionary?code=warehouse_category', |
|
|
|
|
props: { label: 'dictValue', value: 'dictKey' }, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '库房层级', |
|
|
|
|
prop: 'shLevel', |
|
|
|
|
span: 12, |
|
|
|
|
overflow: true, |
|
|
|
|
search: false, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '保管员', |
|
|
|
|
prop: 'saveUser', |
|
|
|
|
span: 12, |
|
|
|
|
overflow: true, |
|
|
|
|
search: true, |
|
|
|
|
filterable: true, |
|
|
|
|
type: 'select', |
|
|
|
|
dicUrl: '/api/blade-system/user/list-all-by-role-alias?roleAlias=保管员', |
|
|
|
|
props: { |
|
|
|
|
label: 'codeRealName', |
|
|
|
|
value: 'id', |
|
|
|
|
// res: 'data', |
|
|
|
|
}, |
|
|
|
|
query:{}, |
|
|
|
|
loading: false, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
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(); |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
searchReset() { |
|
|
|
|
this.query = {}; |
|
|
|
|
this.onLoad(); |
|
|
|
|
}, |
|
|
|
|
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; |
|
|
|
|
}) |
|
|
|
|
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> |
|
|
|
|
|
|
|
|
|
|