
20 changed files with 1401 additions and 625 deletions
@ -0,0 +1,212 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
|
||||
|
<div class="tab-header webtop"> |
||||
|
<!-- 标题 --> |
||||
|
<div>{{ viewTitle }}</div> |
||||
|
<!-- start 添加修改按钮 --> |
||||
|
<div> |
||||
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> |
||||
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
||||
|
</div> |
||||
|
<!-- end 添加修改按钮 --> |
||||
|
<!-- end 详情按钮 --> |
||||
|
</div> |
||||
|
|
||||
|
<div class="listconadd"> |
||||
|
|
||||
|
<el-card class="box-card"> |
||||
|
<div class="item"> |
||||
|
<span class="item_text">货位名称:</span> |
||||
|
<el-input v-model="locationForm.name" placeholder="" class="item_input" clearable /> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<span class="item_text">货位编号:</span> |
||||
|
<el-input v-model="locationForm.locationId" placeholder="" class="item_input" clearable /> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<span class="item_text">货位类型:</span> |
||||
|
<el-select v-model="locationForm.type" class="item_input" placeholder="请选择" > |
||||
|
<el-option |
||||
|
v-for="(type,i) in typeList" |
||||
|
:key="i" |
||||
|
:label="type.type" |
||||
|
:value="type.type" |
||||
|
> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<span class="item_text">所属仓库:</span> |
||||
|
<el-select v-model="locationForm.storehouse" class="item_input" placeholder="请选择" > |
||||
|
<el-option |
||||
|
v-for="(storehouse,i) in storehouseList" |
||||
|
:key="i" |
||||
|
:label="storehouse.name" |
||||
|
:value="storehouse.name"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</div> |
||||
|
</el-card> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
submitdisabled: false, |
||||
|
locationForm: { |
||||
|
name: "", |
||||
|
locationId: "", |
||||
|
type: "", |
||||
|
status: "", |
||||
|
storehouse: "" |
||||
|
}, |
||||
|
viewTitle: "【新增】仓库信息", |
||||
|
storehouseList: [], |
||||
|
typeList: [], |
||||
|
queryInfo: { |
||||
|
total: 0, |
||||
|
size: 10, |
||||
|
current: 1, |
||||
|
params: { |
||||
|
simpleName:'' |
||||
|
}, |
||||
|
}, |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.getStorehouse() |
||||
|
this.geType() |
||||
|
}, |
||||
|
methods: { |
||||
|
saveOrUpdate() { |
||||
|
if (this.viewTitle === "【新增】仓库信息") return this.addLocation() |
||||
|
if (this.viewTitle === "【修改】仓库信息") { |
||||
|
this.updataLocation() |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
handleReturn(isreload) { |
||||
|
if (isreload === 'true') this.$emit('reloadlist') |
||||
|
this.clearList() |
||||
|
this.$emit('doback') |
||||
|
}, |
||||
|
|
||||
|
showAdd() { |
||||
|
this.viewTitle = "【新增】仓库信息"; |
||||
|
this.clearList() |
||||
|
}, |
||||
|
clearList(){ |
||||
|
this.locationForm = { |
||||
|
name: "", |
||||
|
number: "", |
||||
|
code: "", |
||||
|
tankNumber:"", |
||||
|
tankSid:"", |
||||
|
} |
||||
|
}, |
||||
|
async getStorehouse () { |
||||
|
const { data: result } = await this.$http.get('/v1/shstorehouse/listAll') |
||||
|
if (result.code == 200){ |
||||
|
this.storehouseList = result.data |
||||
|
} |
||||
|
// const { data: result } = await this.$http.post( |
||||
|
// "/v1/shstorehouse/listPage", |
||||
|
// { params: this.queryInfo } |
||||
|
// ); |
||||
|
// if (result.code == 200) this.total = result.data.total; |
||||
|
// this.storehouseList = result.data.records; |
||||
|
}, |
||||
|
async geType () { |
||||
|
const { data: result } = await this.$http.get('/location/getType') |
||||
|
if (result.status !== 200) return this.$message.error('获取类型列表失败') |
||||
|
this.typeList = result.data |
||||
|
}, |
||||
|
showEdit(row) { |
||||
|
this.viewTitle = "【修改】仓库信息"; |
||||
|
this.locationForm=row |
||||
|
}, |
||||
|
async addLocation () { |
||||
|
this.locationForm.status = '空闲' |
||||
|
const { data: result } = await this.$http.post('/location/addLocation', this.locationForm) |
||||
|
if (result.status !== 200) return this.$message.error('添加货位失败') |
||||
|
this.$message.success('成功添加货位') |
||||
|
this.handleReturn('true') |
||||
|
}, |
||||
|
async updataLocation () { |
||||
|
const { data: result } = await this.$http.put('/location/updataLocation', this.locationForm) |
||||
|
if (result.status !== 200) return this.$message.error('修改货位失败') |
||||
|
this.$message.success('更新成功') |
||||
|
this.handleReturn('true') |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style lang="scss"> |
||||
|
.box-card { |
||||
|
margin-left: 60px; |
||||
|
margin-right: 60px; |
||||
|
min-width: 70%; |
||||
|
margin-top: 20px; |
||||
|
|
||||
|
.item { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
margin-top: 15px; |
||||
|
height: 40px; |
||||
|
line-height: 40px; |
||||
|
|
||||
|
.item_text { |
||||
|
flex: 0.8; |
||||
|
font-size: 18px; |
||||
|
text-align: right; |
||||
|
} |
||||
|
|
||||
|
.item_input { |
||||
|
flex: 4; |
||||
|
font-size: 16px; |
||||
|
margin-left: 10px; |
||||
|
margin-right: 80px; |
||||
|
} |
||||
|
|
||||
|
.item_left_input { |
||||
|
width: 20%; |
||||
|
} |
||||
|
|
||||
|
.item_left_text { |
||||
|
height: 30px; |
||||
|
margin-left: 20px; |
||||
|
line-height: 30px; |
||||
|
color: #018AD2; |
||||
|
padding: 0px 15px; |
||||
|
border: 1.5px solid #018AD2; |
||||
|
border-radius: 5px; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.item_right { |
||||
|
flex: 1; |
||||
|
justify-items: center; |
||||
|
|
||||
|
.item_right_list_text { |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
|
||||
|
.item_right_list_delect { |
||||
|
color: #5E94FF; |
||||
|
margin-left: 20px; |
||||
|
font-size: 16px; |
||||
|
text-decoration: underline; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
|
</style> |
||||
|
|
@ -0,0 +1,163 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
|
||||
|
<div class="tab-header webtop"> |
||||
|
<!-- 标题 --> |
||||
|
<div>{{ viewTitle }}</div> |
||||
|
<!-- start 添加修改按钮 --> |
||||
|
<div> |
||||
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> |
||||
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
||||
|
</div> |
||||
|
<!-- end 添加修改按钮 --> |
||||
|
<!-- end 详情按钮 --> |
||||
|
</div> |
||||
|
<div class="listconadd"> |
||||
|
|
||||
|
<el-card class="box-card"> |
||||
|
<div class="item"> |
||||
|
<span class="item_text">价值:</span> |
||||
|
<el-input v-model="locationForm.value" class="item_input" clearable></el-input> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<span class="item_text">净重:</span> |
||||
|
<el-input v-model="locationForm.netWeight" class="item_input" clearable></el-input> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<span class="item_text">毛重:</span> |
||||
|
<el-input v-model="locationForm.roughWeight" class="item_input" clearable></el-input> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<span class="item_text">有效天数:</span> |
||||
|
<el-input v-model="locationForm.effectiveDays" class="item_input" clearable></el-input> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<span class="item_text">备注:</span> |
||||
|
<el-input v-model="locationForm.remarks" class="item_input" clearable></el-input> |
||||
|
</div> |
||||
|
</el-card> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
submitdisabled: false, |
||||
|
disabledCode: false, |
||||
|
locationForm: { |
||||
|
barCode: "", |
||||
|
value: "", |
||||
|
netWeight: "", |
||||
|
roughWeight: "", |
||||
|
effectiveDays: "", |
||||
|
remarks: "", |
||||
|
}, |
||||
|
viewTitle: "【修改】产品信息", |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
saveOrUpdate() { |
||||
|
if (this.viewTitle === "【新增】产品信息") return this.addProduct() |
||||
|
if (this.viewTitle === "【修改】产品信息") { |
||||
|
this.updataProduct() |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
handleReturn(isreload) { |
||||
|
if (isreload === 'true') this.$emit('reloadlist') |
||||
|
this.clearList() |
||||
|
this.$emit('doback') |
||||
|
}, |
||||
|
clearList(){ |
||||
|
this.locationForm = { |
||||
|
barCode: "", |
||||
|
value: "", |
||||
|
netWeight: "", |
||||
|
roughWeight: "", |
||||
|
effectiveDays: "", |
||||
|
remarks: "", |
||||
|
} |
||||
|
}, |
||||
|
showEdit(row) { |
||||
|
this.viewTitle = "【修改】产品信息"; |
||||
|
this.locationForm=row |
||||
|
}, |
||||
|
async updataProduct () { |
||||
|
const { data: result } = await this.$http.put('/product/updataProduct', this.locationForm) |
||||
|
if (result.status !== 200) return this.$message.error('更新数据失败') |
||||
|
this.$message.success('更新成功') |
||||
|
this.handleReturn('true') |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style lang="scss"> |
||||
|
.box-card { |
||||
|
margin-left: 60px; |
||||
|
margin-right: 60px; |
||||
|
min-width: 70%; |
||||
|
margin-top: 20px; |
||||
|
|
||||
|
.item { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
margin-top: 15px; |
||||
|
height: 40px; |
||||
|
line-height: 40px; |
||||
|
|
||||
|
.item_text { |
||||
|
flex: 0.8; |
||||
|
font-size: 18px; |
||||
|
text-align: right; |
||||
|
} |
||||
|
|
||||
|
.item_input { |
||||
|
flex: 4; |
||||
|
font-size: 16px; |
||||
|
margin-left: 10px; |
||||
|
margin-right: 80px; |
||||
|
} |
||||
|
|
||||
|
.item_left_input { |
||||
|
width: 20%; |
||||
|
} |
||||
|
|
||||
|
.item_left_text { |
||||
|
height: 30px; |
||||
|
margin-left: 20px; |
||||
|
line-height: 30px; |
||||
|
color: #018AD2; |
||||
|
padding: 0px 15px; |
||||
|
border: 1.5px solid #018AD2; |
||||
|
border-radius: 5px; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.item_right { |
||||
|
flex: 1; |
||||
|
justify-items: center; |
||||
|
|
||||
|
.item_right_list_text { |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
|
||||
|
.item_right_list_delect { |
||||
|
color: #5E94FF; |
||||
|
margin-left: 20px; |
||||
|
font-size: 16px; |
||||
|
text-decoration: underline; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
|
</style> |
||||
|
|
@ -0,0 +1,208 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
|
||||
|
<div class="tab-header webtop"> |
||||
|
<!-- 标题 --> |
||||
|
<div>{{ viewTitle }}</div> |
||||
|
<!-- start 添加修改按钮 --> |
||||
|
<div> |
||||
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> |
||||
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
||||
|
</div> |
||||
|
<!-- end 添加修改按钮 --> |
||||
|
<!-- end 详情按钮 --> |
||||
|
</div> |
||||
|
<div class="listconadd"> |
||||
|
|
||||
|
<el-card class="box-card"> |
||||
|
<div class="item"> |
||||
|
<span class="item_text">条码:</span> |
||||
|
<el-input v-model="locationForm.barCode" :disabled="disabledCode" placeholder="" class="item_inputs" clearable /> |
||||
|
<el-button type="primary" size="small" @click="createBarCode" :disabled="disabledCode">自动</el-button> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<span class="item_text">商品名:</span> |
||||
|
<el-input v-model="locationForm.name" :disabled="disabledCode" placeholder="" class="item_input" clearable /> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<span class="item_text">别名:</span> |
||||
|
<el-input v-model="locationForm.anotherName" class="item_input" clearable></el-input> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<span class="item_text">价值:</span> |
||||
|
<el-input v-model="locationForm.value" class="item_input" clearable></el-input> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<span class="item_text">净重:</span> |
||||
|
<el-input v-model="locationForm.netWeight" class="item_input" clearable></el-input> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<span class="item_text">毛重:</span> |
||||
|
<el-input v-model="locationForm.roughWeight" class="item_input" clearable></el-input> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<span class="item_text">有效天数:</span> |
||||
|
<el-input v-model="locationForm.effectiveDays" class="item_input" clearable></el-input> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<span class="item_text">备注:</span> |
||||
|
<el-input v-model="locationForm.remarks" class="item_input" clearable></el-input> |
||||
|
</div> |
||||
|
</el-card> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
submitdisabled: false, |
||||
|
disabledCode: false, |
||||
|
locationForm: { |
||||
|
barCode: "", |
||||
|
name: "", |
||||
|
anotherName: "", |
||||
|
value: "", |
||||
|
netWeight: "", |
||||
|
roughWeight: "", |
||||
|
effectiveDays: "", |
||||
|
remarks: "", |
||||
|
}, |
||||
|
viewTitle: "【新增】产品信息", |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
saveOrUpdate() { |
||||
|
if (this.viewTitle === "【新增】产品信息") return this.addProduct() |
||||
|
if (this.viewTitle === "【修改】产品信息") { |
||||
|
this.updataProduct() |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
handleReturn(isreload) { |
||||
|
if (isreload === 'true') this.$emit('reloadlist') |
||||
|
this.clearList() |
||||
|
this.$emit('doback') |
||||
|
}, |
||||
|
|
||||
|
showAdd() { |
||||
|
this.viewTitle = "【新增】产品信息"; |
||||
|
this.disabledCode=false |
||||
|
this.clearList() |
||||
|
}, |
||||
|
clearList(){ |
||||
|
this.locationForm = { |
||||
|
barCode: "", |
||||
|
name: "", |
||||
|
anotherName: "", |
||||
|
value: "", |
||||
|
netWeight: "", |
||||
|
roughWeight: "", |
||||
|
effectiveDays: "", |
||||
|
remarks: "", |
||||
|
} |
||||
|
}, |
||||
|
showEdit(row) { |
||||
|
this.viewTitle = "【修改】产品信息"; |
||||
|
this.disabledCode=true |
||||
|
this.locationForm=row |
||||
|
}, |
||||
|
async updataProduct () { |
||||
|
this.locationForm = { |
||||
|
name: "", |
||||
|
anotherName: "", |
||||
|
} |
||||
|
const { data: result } = await this.$http.put('/product/updataProduct', this.locationForm) |
||||
|
if (result.status !== 200) return this.$message.error('更新数据失败') |
||||
|
this.$message.success('更新成功') |
||||
|
this.handleReturn('true') |
||||
|
}, |
||||
|
async addProduct () { |
||||
|
const { data: result } = await this.$http.post('/product/addProduct', this.addProductForm) |
||||
|
if (result.status !== 200) return this.$message.error('添加产品失败') |
||||
|
this.$message.success('添加产品成功') |
||||
|
this.handleReturn('true') |
||||
|
}, |
||||
|
createBarCode () { |
||||
|
var now = new Date() |
||||
|
var nowstr = now.getTime() |
||||
|
this.locationForm.barCode = 'P' + now.getTime() |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style lang="scss"> |
||||
|
.box-card { |
||||
|
margin-left: 60px; |
||||
|
margin-right: 60px; |
||||
|
min-width: 70%; |
||||
|
margin-top: 20px; |
||||
|
|
||||
|
.item { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
margin-top: 15px; |
||||
|
height: 40px; |
||||
|
line-height: 40px; |
||||
|
|
||||
|
.item_text { |
||||
|
flex: 0.8; |
||||
|
font-size: 18px; |
||||
|
text-align: right; |
||||
|
} |
||||
|
|
||||
|
.item_input { |
||||
|
flex: 4; |
||||
|
font-size: 16px; |
||||
|
margin-left: 10px; |
||||
|
margin-right: 80px; |
||||
|
} |
||||
|
.item_inputs { |
||||
|
flex: 4; |
||||
|
font-size: 16px; |
||||
|
margin-left: 10px; |
||||
|
margin-right: 28px; |
||||
|
} |
||||
|
|
||||
|
.item_left_input { |
||||
|
width: 20%; |
||||
|
} |
||||
|
|
||||
|
.item_left_text { |
||||
|
height: 30px; |
||||
|
margin-left: 20px; |
||||
|
line-height: 30px; |
||||
|
color: #018AD2; |
||||
|
padding: 0px 15px; |
||||
|
border: 1.5px solid #018AD2; |
||||
|
border-radius: 5px; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.item_right { |
||||
|
flex: 1; |
||||
|
justify-items: center; |
||||
|
|
||||
|
.item_right_list_text { |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
|
||||
|
.item_right_list_delect { |
||||
|
color: #5E94FF; |
||||
|
margin-left: 20px; |
||||
|
font-size: 16px; |
||||
|
text-decoration: underline; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
|
</style> |
||||
|
|
Loading…
Reference in new issue