
12 changed files with 782 additions and 694 deletions
@ -1,212 +1,211 @@ |
|||||
<template> |
<template> |
||||
<div> |
<div> |
||||
|
|
||||
<div class="tab-header webtop"> |
<div class="tab-header webtop"> |
||||
<!-- 标题 --> |
<!-- 标题 --> |
||||
<div>{{ viewTitle }}</div> |
<div>{{ viewTitle }}</div> |
||||
<!-- start 添加修改按钮 --> |
<!-- start 添加修改按钮 --> |
||||
<div> |
<div> |
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> |
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> |
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
||||
</div> |
</div> |
||||
<!-- end 添加修改按钮 --> |
<!-- end 添加修改按钮 --> |
||||
<!-- end 详情按钮 --> |
<!-- end 详情按钮 --> |
||||
</div> |
</div> |
||||
|
|
||||
<div class="listconadd"> |
<div class="listconadd"> |
||||
|
|
||||
<el-card class="box-card"> |
<el-card class="box-card"> |
||||
<div class="item"> |
<div class="item"> |
||||
<span class="item_text">货位名称:</span> |
<span class="item_text">货位名称:</span> |
||||
<el-input v-model="locationForm.name" placeholder="" class="item_input" clearable /> |
<el-input v-model="locationForm.name" placeholder="" class="item_input" clearable /> |
||||
</div> |
</div> |
||||
<div class="item"> |
<div class="item"> |
||||
<span class="item_text">货位编号:</span> |
<span class="item_text">货位编号:</span> |
||||
<el-input v-model="locationForm.locationId" placeholder="" class="item_input" clearable /> |
<el-input v-model="locationForm.locationId" placeholder="" class="item_input" clearable /> |
||||
</div> |
</div> |
||||
<div class="item"> |
<div class="item"> |
||||
<span class="item_text">货位类型:</span> |
<span class="item_text">货位类型:</span> |
||||
<el-select v-model="locationForm.type" class="item_input" placeholder="请选择" > |
<el-select v-model="locationForm.type" class="item_input" placeholder="请选择" > |
||||
<el-option |
<el-option |
||||
v-for="(type,i) in typeList" |
v-for="(type,i) in typeList" |
||||
:key="i" |
:key="i" |
||||
:label="type.type" |
:label="type.type" |
||||
:value="type.type" |
:value="type.type" |
||||
> |
> |
||||
</el-option> |
</el-option> |
||||
</el-select> |
</el-select> |
||||
</div> |
</div> |
||||
<div class="item"> |
<div class="item"> |
||||
<span class="item_text">所属仓库:</span> |
<span class="item_text">所属仓库:</span> |
||||
<el-select v-model="locationForm.storehouse" class="item_input" placeholder="请选择" > |
<el-select v-model="locationForm.storehouseid" class="item_input" placeholder="请选择" > |
||||
<el-option |
<el-option |
||||
v-for="(storehouse,i) in storehouseList" |
v-for="(storehouse,i) in storehouseList" |
||||
:key="i" |
:key="i" |
||||
:label="storehouse.name" |
:label="storehouse.name" |
||||
:value="storehouse.name"> |
:value="storehouse.sid"> |
||||
</el-option> |
</el-option> |
||||
</el-select> |
</el-select> |
||||
</div> |
</div> |
||||
</el-card> |
</el-card> |
||||
</div> |
</div> |
||||
|
|
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
export default { |
export default { |
||||
data() { |
data() { |
||||
return { |
return { |
||||
submitdisabled: false, |
submitdisabled: false, |
||||
locationForm: { |
locationForm: { |
||||
name: "", |
name: "", |
||||
locationId: "", |
locationId: "", |
||||
type: "", |
type: "", |
||||
status: "", |
status: "", |
||||
storehouse: "" |
storehouse: "" |
||||
}, |
}, |
||||
viewTitle: "【新增】仓库信息", |
viewTitle: "【新增】仓库信息", |
||||
storehouseList: [], |
storehouseList: [], |
||||
typeList: [], |
typeList: [], |
||||
queryInfo: { |
queryInfo: { |
||||
total: 0, |
total: 0, |
||||
size: 10, |
size: 10, |
||||
current: 1, |
current: 1, |
||||
params: { |
params: { |
||||
simpleName:'' |
simpleName:'' |
||||
}, |
}, |
||||
}, |
}, |
||||
} |
} |
||||
}, |
}, |
||||
created() { |
created() { |
||||
this.getStorehouse() |
this.getStorehouse() |
||||
this.geType() |
this.geType() |
||||
}, |
}, |
||||
methods: { |
methods: { |
||||
saveOrUpdate() { |
saveOrUpdate() { |
||||
if (this.viewTitle === "【新增】仓库信息") return this.addLocation() |
if (this.viewTitle === "【新增】仓库信息") return this.addLocation() |
||||
if (this.viewTitle === "【修改】仓库信息") { |
if (this.viewTitle === "【修改】仓库信息") { |
||||
this.updataLocation() |
this.updataLocation() |
||||
} |
} |
||||
|
|
||||
}, |
}, |
||||
handleReturn(isreload) { |
handleReturn(isreload) { |
||||
if (isreload === 'true') this.$emit('reloadlist') |
if (isreload === 'true') this.$emit('reloadlist') |
||||
this.clearList() |
this.clearList() |
||||
this.$emit('doback') |
this.$emit('doback') |
||||
}, |
}, |
||||
|
|
||||
showAdd() { |
showAdd() { |
||||
this.viewTitle = "【新增】仓库信息"; |
this.viewTitle = "【新增】仓库信息"; |
||||
this.clearList() |
this.clearList() |
||||
}, |
}, |
||||
clearList(){ |
clearList(){ |
||||
this.locationForm = { |
this.locationForm = { |
||||
name: "", |
name: "", |
||||
number: "", |
number: "", |
||||
code: "", |
code: "", |
||||
tankNumber:"", |
tankNumber:"", |
||||
tankSid:"", |
tankSid:"", |
||||
} |
} |
||||
}, |
}, |
||||
async getStorehouse () { |
async getStorehouse () { |
||||
const { data: result } = await this.$http.get('/v1/shstorehouse/listAll') |
const { data: result } = await this.$http.get('/v1/shstorehouse/listAll') |
||||
if (result.code == 200){ |
if (result.code == 200){ |
||||
this.storehouseList = result.data |
this.storehouseList = result.data |
||||
} |
} |
||||
// const { data: result } = await this.$http.post( |
// const { data: result } = await this.$http.post( |
||||
// "/v1/shstorehouse/listPage", |
// "/v1/shstorehouse/listPage", |
||||
// { params: this.queryInfo } |
// { params: this.queryInfo } |
||||
// ); |
// ); |
||||
// if (result.code == 200) this.total = result.data.total; |
// if (result.code == 200) this.total = result.data.total; |
||||
// this.storehouseList = result.data.records; |
// this.storehouseList = result.data.records; |
||||
}, |
}, |
||||
async geType () { |
async geType () { |
||||
const { data: result } = await this.$http.get('/location/getType') |
const { data: result } = await this.$http.get('/location/getType') |
||||
if (result.status !== 200) return this.$message.error('获取类型列表失败') |
if (result.status !== 200) return this.$message.error('获取类型列表失败') |
||||
this.typeList = result.data |
this.typeList = result.data |
||||
}, |
}, |
||||
showEdit(row) { |
showEdit(row) { |
||||
this.viewTitle = "【修改】仓库信息"; |
this.viewTitle = "【修改】仓库信息"; |
||||
this.locationForm=row |
this.locationForm=row |
||||
}, |
}, |
||||
async addLocation () { |
async addLocation () { |
||||
this.locationForm.status = '空闲' |
this.locationForm.status = '空闲' |
||||
const { data: result } = await this.$http.post('/location/addLocation', this.locationForm) |
const { data: result } = await this.$http.post('/location/addLocation', this.locationForm) |
||||
if (result.status !== 200) return this.$message.error('添加货位失败') |
if (result.status !== 200) return this.$message.error('添加货位失败') |
||||
this.$message.success('成功添加货位') |
this.$message.success('成功添加货位') |
||||
this.handleReturn('true') |
this.handleReturn('true') |
||||
}, |
}, |
||||
async updataLocation () { |
async updataLocation () { |
||||
const { data: result } = await this.$http.put('/location/updataLocation', this.locationForm) |
const { data: result } = await this.$http.put('/location/updataLocation', this.locationForm) |
||||
if (result.status !== 200) return this.$message.error('修改货位失败') |
if (result.status !== 200) return this.$message.error('修改货位失败') |
||||
this.$message.success('更新成功') |
this.$message.success('更新成功') |
||||
this.handleReturn('true') |
this.handleReturn('true') |
||||
}, |
}, |
||||
} |
} |
||||
} |
} |
||||
</script> |
</script> |
||||
<style lang="scss"> |
<style lang="scss"> |
||||
.box-card { |
.box-card { |
||||
margin-left: 60px; |
margin-left: 60px; |
||||
margin-right: 60px; |
margin-right: 60px; |
||||
min-width: 70%; |
min-width: 70%; |
||||
margin-top: 20px; |
margin-top: 20px; |
||||
|
|
||||
.item { |
.item { |
||||
display: flex; |
display: flex; |
||||
flex-direction: row; |
flex-direction: row; |
||||
align-items: center; |
align-items: center; |
||||
margin-top: 15px; |
margin-top: 15px; |
||||
height: 40px; |
height: 40px; |
||||
line-height: 40px; |
line-height: 40px; |
||||
|
|
||||
.item_text { |
.item_text { |
||||
flex: 0.8; |
flex: 0.8; |
||||
font-size: 18px; |
font-size: 18px; |
||||
text-align: right; |
text-align: right; |
||||
} |
} |
||||
|
|
||||
.item_input { |
.item_input { |
||||
flex: 4; |
flex: 4; |
||||
font-size: 16px; |
font-size: 16px; |
||||
margin-left: 10px; |
margin-left: 10px; |
||||
margin-right: 80px; |
margin-right: 80px; |
||||
} |
} |
||||
|
|
||||
.item_left_input { |
.item_left_input { |
||||
width: 20%; |
width: 20%; |
||||
} |
} |
||||
|
|
||||
.item_left_text { |
.item_left_text { |
||||
height: 30px; |
height: 30px; |
||||
margin-left: 20px; |
margin-left: 20px; |
||||
line-height: 30px; |
line-height: 30px; |
||||
color: #018AD2; |
color: #018AD2; |
||||
padding: 0px 15px; |
padding: 0px 15px; |
||||
border: 1.5px solid #018AD2; |
border: 1.5px solid #018AD2; |
||||
border-radius: 5px; |
border-radius: 5px; |
||||
|
|
||||
} |
} |
||||
|
|
||||
.item_right { |
.item_right { |
||||
flex: 1; |
flex: 1; |
||||
justify-items: center; |
justify-items: center; |
||||
|
|
||||
.item_right_list_text { |
.item_right_list_text { |
||||
font-size: 16px; |
font-size: 16px; |
||||
} |
} |
||||
|
|
||||
.item_right_list_delect { |
.item_right_list_delect { |
||||
color: #5E94FF; |
color: #5E94FF; |
||||
margin-left: 20px; |
margin-left: 20px; |
||||
font-size: 16px; |
font-size: 16px; |
||||
text-decoration: underline; |
text-decoration: underline; |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
} |
} |
||||
|
|
||||
} |
} |
||||
</style> |
</style> |
||||
|
|
||||
|
@ -1,468 +1,480 @@ |
|||||
<template> |
<template> |
||||
<div> |
<div> |
||||
<div class="tab-header webtop"> |
<div class="tab-header webtop"> |
||||
<div>{{ viewTitle }}</div> |
<div>{{ viewTitle }}</div> |
||||
<div> |
<div> |
||||
<el-button type="primary" size="small" @click="saveOrUpdate" |
<el-button type="primary" size="small" @click="saveOrUpdate" |
||||
>保存</el-button |
>保存</el-button |
||||
> |
> |
||||
<el-button type="info" size="small" @click="handleReturn()" |
<el-button type="info" size="small" @click="handleReturn()" |
||||
>返回</el-button |
>返回</el-button |
||||
> |
> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
<div class="listconadd"> |
<div class="listconadd"> |
||||
<el-form ref="dataForm" :model="purchaseForm" label-position="top" label-width="190px" class="formadd"> |
<el-form ref="dataForm" :model="purchaseForm" label-position="top" label-width="190px" class="formadd"> |
||||
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px"> |
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px"> |
||||
<div style="margin-left: 15px;">主体信息</div> |
<div style="margin-left: 15px;">主体信息</div> |
||||
</div> |
</div> |
||||
<el-row> |
<el-row> |
||||
<el-col :span="3" class="trightb"> |
<el-col :span="3" class="trightb"> |
||||
<el-form-item class="trightb_item"> |
<el-form-item class="trightb_item"> |
||||
<span slot="label">订单日期:</span> |
<span slot="label">订单日期:</span> |
||||
</el-form-item> |
</el-form-item> |
||||
</el-col> |
</el-col> |
||||
<el-col :span="4"> |
<el-col :span="4"> |
||||
<el-form-item class="trightb_item"> |
<el-form-item class="trightb_item"> |
||||
<!-- <span>{{temp.bankName}}</span> --> |
<!-- <span>{{temp.bankName}}</span> --> |
||||
<el-date-picker v-model="purchaseForm.purchaseDate" type="date" style="width: 100%;" |
<el-date-picker v-model="purchaseForm.purchaseDate" type="date" style="width: 100%;" |
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="请选择" /> |
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="请选择" /> |
||||
</el-form-item> |
</el-form-item> |
||||
</el-col> |
</el-col> |
||||
<el-col :span="3" class="trightb"> |
<el-col :span="3" class="trightb"> |
||||
<el-form-item class="trightb_item"> |
<el-form-item class="trightb_item"> |
||||
<span slot="label">订单编号:</span> |
<span slot="label">订单编号:</span> |
||||
</el-form-item> |
</el-form-item> |
||||
</el-col> |
</el-col> |
||||
<el-col :span="6"> |
<el-col :span="6"> |
||||
<el-form-item class="trightb_item" prop="purchaseNo"> |
<el-form-item class="trightb_item" prop="purchaseNo"> |
||||
<el-input :disabled="true" v-model="purchaseForm.purchaseNo"></el-input> |
<el-input :disabled="true" v-model="purchaseForm.purchaseNo"></el-input> |
||||
</el-form-item> |
</el-form-item> |
||||
</el-col> |
</el-col> |
||||
<el-col :span="3" class="trightb"> |
<el-col :span="3" class="trightb"> |
||||
<el-form-item class="trightb_item"> |
<el-form-item class="trightb_item"> |
||||
<span slot="label">供货商名称:</span> |
<span slot="label">供货商名称:</span> |
||||
</el-form-item> |
</el-form-item> |
||||
</el-col> |
</el-col> |
||||
<el-col :span="5"> |
<el-col :span="5"> |
||||
<el-form-item prop="supplier" class="trightb_item"> |
<el-form-item prop="supplier" class="trightb_item"> |
||||
<el-select v-model="purchaseForm.supplierName" placeholder="请选择" > |
<el-select v-model="purchaseForm.supplierId" placeholder="请选择" > |
||||
<el-option |
<el-option |
||||
v-for="(supplier,i) in supplierList" |
v-for="(supplier,i) in supplierList" |
||||
:key="i" |
:key="i" |
||||
:label="supplier.name" |
:label="supplier.name" |
||||
:value="supplier.name"> |
:value="supplier.id"> |
||||
</el-option> |
</el-option> |
||||
</el-select> |
</el-select> |
||||
</el-form-item> |
</el-form-item> |
||||
</el-col> |
</el-col> |
||||
</el-row> |
</el-row> |
||||
<el-row> |
<el-row> |
||||
<el-col :span="3" class="trightb"> |
<el-col :span="3" class="trightb"> |
||||
<el-form-item class="trightb_item"> |
<el-form-item class="trightb_item"> |
||||
<span slot="label">采购申请人:</span> |
<span slot="label">采购申请人:</span> |
||||
</el-form-item> |
</el-form-item> |
||||
</el-col> |
</el-col> |
||||
<el-col :span="4"> |
<el-col :span="4"> |
||||
<el-form-item class="trightb_item"> |
<el-form-item class="trightb_item"> |
||||
<el-input v-model="purchaseForm.purchasePerson" placeholder="采购申请人" clearable /> |
<el-input v-model="purchaseForm.purchasePerson" placeholder="采购申请人" clearable /> |
||||
</el-form-item> |
</el-form-item> |
||||
</el-col> |
</el-col> |
||||
|
|
||||
<el-col :span="3" class="trightb"> |
<el-col :span="3" class="trightb"> |
||||
<el-form-item class="trightb_item"> |
<el-form-item class="trightb_item"> |
||||
<span slot="label">客户名称:</span> |
<span slot="label">客户名称:</span> |
||||
</el-form-item> |
</el-form-item> |
||||
</el-col> |
</el-col> |
||||
<el-col :span="6"> |
<el-col :span="6"> |
||||
<el-form-item class="trightb_item"> |
<el-form-item class="trightb_item"> |
||||
<el-select v-model="purchaseForm.custName" placeholder="请选择" > |
<el-select v-model="purchaseForm.custId" placeholder="请选择" > |
||||
<el-option |
<el-option |
||||
v-for="(custName,i) in custList" |
v-for="(custName,i) in custList" |
||||
:key="i" |
:key="i" |
||||
:label="custName.enterpriseName" |
:label="custName.enterpriseName" |
||||
:value="custName.enterpriseName"> |
:value="custName.sid"> |
||||
</el-option> |
</el-option> |
||||
</el-select> |
</el-select> |
||||
</el-form-item> |
</el-form-item> |
||||
</el-col> |
</el-col> |
||||
|
|
||||
<el-col :span="3" class="trightb"> |
<el-col :span="3" class="trightb"> |
||||
<el-form-item class="trightb_item"> |
<el-form-item class="trightb_item"> |
||||
<span slot="label">仓库名称:</span> |
<span slot="label">仓库名称:</span> |
||||
</el-form-item> |
</el-form-item> |
||||
</el-col> |
</el-col> |
||||
<el-col :span="5"> |
<el-col :span="5"> |
||||
<el-form-item class="trightb_item"> |
<el-form-item class="trightb_item"> |
||||
<el-select v-model="purchaseForm.storehouseName" placeholder="请选择" > |
<el-select v-model="purchaseForm.storehouseId" placeholder="请选择" > |
||||
<el-option |
<el-option |
||||
v-for="(storehouse,i) in storehouseList" |
v-for="(storehouse,i) in storehouseList" |
||||
:key="i" |
:key="i" |
||||
:label="storehouse.name" |
:label="storehouse.name" |
||||
:value="storehouse.name"> |
:value="storehouse.sid"> |
||||
</el-option> |
</el-option> |
||||
</el-select> |
</el-select> |
||||
</el-form-item> |
</el-form-item> |
||||
</el-col> |
</el-col> |
||||
</el-row> |
</el-row> |
||||
|
|
||||
<el-collapse v-model="activeNames"> |
<el-collapse v-model="activeNames"> |
||||
<el-collapse-item name="1"> |
<el-collapse-item name="1"> |
||||
<template slot="title" > |
<template slot="title" > |
||||
<span style="margin-left: 15px;">商品信息</span><span class="span" @click.stop="add()">添加</span> |
<span style="margin-left: 15px;">商品信息</span><span class="span" @click.stop="add()">添加</span> |
||||
</template> |
</template> |
||||
<el-table :data="purchaseForm.products" border style="width: 100%;" |
<el-table :data="purchaseForm.products" border style="width: 100%;" |
||||
:row-style="{height: '40px'}"> |
:row-style="{height: '40px'}"> |
||||
<!-- <el-table-column type="selection" align="center" width="50"/> --> |
<!-- <el-table-column type="selection" align="center" width="50"/> --> |
||||
<el-table-column label="序号" type="index" width="60" align="center" /> |
<el-table-column label="序号" type="index" width="60" align="center" /> |
||||
<el-table-column label="商品名称" width="120" prop="proName" align="center"> |
<el-table-column label="商品名称" width="120" prop="proName" align="center"> |
||||
<template slot-scope="scope"> |
<template slot-scope="scope"> |
||||
<el-select v-model="scope.row.proName" placeholder="请选择" > |
<el-select v-model="scope.row.proName" placeholder="请选择" > |
||||
<el-option |
<el-option |
||||
v-for="product in productList" |
v-for="product in productList" |
||||
:key="product.name" |
:key="product.name" |
||||
:label="product.name" |
:label="product.name" |
||||
:value="product.name"> |
:value="product.name"> |
||||
</el-option> |
</el-option> |
||||
</el-select> |
</el-select> |
||||
</template> |
</template> |
||||
</el-table-column> |
</el-table-column> |
||||
<el-table-column label="商品品类" width="120" prop="productTypeName" align="center"> |
<el-table-column label="商品品类" width="120" prop="productTypeName" align="center"> |
||||
<template slot-scope="scope"> |
<template slot-scope="scope"> |
||||
<el-input v-model="scope.row.productTypeName" placeholder="商品品类" clearable></el-input> |
<el-input v-model="scope.row.productTypeName" placeholder="商品品类" clearable></el-input> |
||||
</template> |
</template> |
||||
</el-table-column> |
</el-table-column> |
||||
<el-table-column label="商品品牌" width="120" prop="brandInfoName" align="center"> |
<el-table-column label="商品品牌" width="120" prop="brandInfoName" align="center"> |
||||
<template slot-scope="scope"> |
<template slot-scope="scope"> |
||||
<el-input v-model="scope.row.brandInfoName" placeholder="商品品牌" clearable></el-input> |
<el-input v-model="scope.row.brandInfoName" placeholder="商品品牌" clearable></el-input> |
||||
</template> |
</template> |
||||
</el-table-column> |
</el-table-column> |
||||
<el-table-column label="规格(型号)" width="150" prop="proModel" align="center"> |
<el-table-column label="规格(型号)" width="150" prop="proModel" align="center"> |
||||
<template slot-scope="scope"> |
<template slot-scope="scope"> |
||||
<el-input v-model="scope.row.proModel" placeholder="" clearable></el-input> |
<el-input v-model="scope.row.proModel" placeholder="" clearable></el-input> |
||||
</template> |
</template> |
||||
</el-table-column> |
</el-table-column> |
||||
<el-table-column label="单价" width="140" prop="estimateConfirmedPrice" align="center"> |
<el-table-column label="单价" width="140" prop="estimateConfirmedPrice" align="center"> |
||||
<template slot-scope="scope"> |
<template slot-scope="scope"> |
||||
<el-input v-model="scope.row.estimateConfirmedPrice" @input="limitInput1($event,scope.$index)" placeholder="" clearable></el-input> |
<el-input v-model="scope.row.estimateConfirmedPrice" @input="limitInput1($event,scope.$index)" placeholder="" clearable></el-input> |
||||
</template> |
</template> |
||||
</el-table-column> |
</el-table-column> |
||||
<el-table-column label="数量" width="140" prop="estimateNum" align="center"> |
<el-table-column label="数量" width="140" prop="estimateNum" align="center"> |
||||
<template slot-scope="scope"> |
<template slot-scope="scope"> |
||||
<el-input v-model="scope.row.estimateNum" @input="limitInput2($event,scope.$index)" placeholder="" clearable></el-input> |
<el-input v-model="scope.row.estimateNum" @input="limitInput2($event,scope.$index)" placeholder="" clearable></el-input> |
||||
</template> |
</template> |
||||
</el-table-column> |
</el-table-column> |
||||
<el-table-column label="总价值" width="150px" prop="estimateCalculatedValue" align="center"> |
<el-table-column label="总价值" width="150px" prop="estimateCalculatedValue" align="center"> |
||||
<template slot-scope="scope"> |
<template slot-scope="scope"> |
||||
<el-input v-model="scope.row.estimateCalculatedValue" :readonly="true" placeholder="" clearable></el-input> |
<el-input v-model="scope.row.estimateCalculatedValue" :readonly="true" placeholder="" clearable></el-input> |
||||
</template> |
</template> |
||||
</el-table-column> |
</el-table-column> |
||||
<el-table-column label="规格单位" width="130" prop="proUnit" align="center"> |
<el-table-column label="规格单位" width="130" prop="proUnit" align="center"> |
||||
<template slot-scope="scope"> |
<template slot-scope="scope"> |
||||
<el-input v-model="scope.row.proUnit" placeholder="" clearable></el-input> |
<el-input v-model="scope.row.proUnit" placeholder="" clearable></el-input> |
||||
</template> |
</template> |
||||
</el-table-column> |
</el-table-column> |
||||
<el-table-column label="生成厂家" width="150" prop="manufacturer" align="center"> |
<el-table-column label="生成厂家" width="150" prop="manufacturer" align="center"> |
||||
<template slot-scope="scope"> |
<template slot-scope="scope"> |
||||
<el-input v-model="scope.row.manufacturer" placeholder="" clearable></el-input> |
<el-input v-model="scope.row.manufacturer" placeholder="" clearable></el-input> |
||||
</template> |
</template> |
||||
</el-table-column> |
</el-table-column> |
||||
<el-table-column label="实际数量" width="100px" prop="realityNum" align="center"> |
<el-table-column label="实际数量" width="100px" prop="realityNum" align="center"> |
||||
<template slot-scope="scope"> |
<template slot-scope="scope"> |
||||
<el-input v-model="scope.row.realityNum" placeholder="" clearable></el-input> |
<el-input v-model="scope.row.realityNum" placeholder="" clearable></el-input> |
||||
</template> |
</template> |
||||
</el-table-column> |
</el-table-column> |
||||
<el-table-column label="实际重量" width="100px" prop="realityWeight" align="center"> |
<el-table-column label="实际重量" width="100px" prop="realityWeight" align="center"> |
||||
<template slot-scope="scope"> |
<template slot-scope="scope"> |
||||
<el-input v-model="scope.row.realityWeight" placeholder="" clearable></el-input> |
<el-input v-model="scope.row.realityWeight" placeholder="" clearable></el-input> |
||||
</template> |
</template> |
||||
</el-table-column> |
</el-table-column> |
||||
<el-table-column label="实际质权人确认的单价" width="150px" prop="realityConfirmedPrice" align="center"> |
<el-table-column label="实际质权人确认的单价" width="150px" prop="realityConfirmedPrice" align="center"> |
||||
<template slot-scope="scope"> |
<template slot-scope="scope"> |
||||
<el-input v-model="scope.row.realityConfirmedPrice" placeholder="" clearable></el-input> |
<el-input v-model="scope.row.realityConfirmedPrice" placeholder="" clearable></el-input> |
||||
</template> |
</template> |
||||
</el-table-column> |
</el-table-column> |
||||
<el-table-column label="实际核算的价值" width="150px" prop="realityCalculatedValue" align="center"> |
<el-table-column label="实际核算的价值" width="150px" prop="realityCalculatedValue" align="center"> |
||||
<template slot-scope="scope"> |
<template slot-scope="scope"> |
||||
<el-input v-model="scope.row.realityCalculatedValue" placeholder="" clearable></el-input> |
<el-input v-model="scope.row.realityCalculatedValue" placeholder="" clearable></el-input> |
||||
</template> |
</template> |
||||
</el-table-column> |
</el-table-column> |
||||
<el-table-column label="货位号" width="150px" prop="locationNumber" align="center"> |
<el-table-column label="货位号" width="150px" prop="locationNumber" align="center"> |
||||
<template slot-scope="scope"> |
<template slot-scope="scope"> |
||||
<el-input v-model="scope.row.locationNumber" placeholder="" clearable></el-input> |
<el-input v-model="scope.row.locationNumber" placeholder="" clearable></el-input> |
||||
</template> |
</template> |
||||
</el-table-column> |
</el-table-column> |
||||
<el-table-column label="操作" fixed="right" align="center" width="150"> |
<el-table-column label="操作" fixed="right" align="center" width="150"> |
||||
<template slot-scope="scope"> |
<template slot-scope="scope"> |
||||
<el-button type="primary" size="mini" @click="doCommoditylDel(scope.$index)">删除</el-button> |
<el-button type="primary" size="mini" @click="doCommoditylDel(scope.$index)">删除</el-button> |
||||
</template> |
</template> |
||||
</el-table-column> |
</el-table-column> |
||||
</el-table> |
</el-table> |
||||
|
|
||||
</el-collapse-item> |
</el-collapse-item> |
||||
</el-collapse> |
</el-collapse> |
||||
</el-form> |
</el-form> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
|
|
||||
export default { |
export default { |
||||
name: "storehouseAdd", |
name: "storehouseAdd", |
||||
components: { |
components: { |
||||
|
|
||||
}, |
}, |
||||
data() { |
data() { |
||||
return { |
return { |
||||
viewTitle: "【新增】采购订单", |
viewTitle: "【新增】采购订单", |
||||
purchaseForm: { |
purchaseForm: { |
||||
purchaseId: '', |
purchaseId: '', |
||||
product: '', |
product: '', |
||||
barCode: '', |
barCode: '', |
||||
purchaseDate:'', |
purchaseDate:'', |
||||
purchaseNo:'', |
purchaseNo:'', |
||||
supplier: '', |
supplier: '', |
||||
storehouseName:'', |
storehouseName:'', |
||||
supplierName:'', |
storehouseId:"", |
||||
count: '', |
supplierName:'', |
||||
storehouse: '', |
supplierId:'', |
||||
status: '', |
count: '', |
||||
products:[] |
storehouse: '', |
||||
}, |
status: '', |
||||
supplierList: [], |
products:[] |
||||
storehouseList: [], |
}, |
||||
productList: [], |
supplierList: [], |
||||
productList2: [], |
storehouseList: [], |
||||
supplierList: [], |
productList: [], |
||||
custList: [], |
productList2: [], |
||||
selectPurchaseList: [], |
custList: [], |
||||
activeNames: ['1'], |
selectPurchaseList: [], |
||||
rules: { |
activeNames: ['1'], |
||||
product: [ |
rules: { |
||||
{ required: true, message: '请输入商品名', trigger: 'blur' } |
product: [ |
||||
], |
{ required: true, message: '请输入商品名', trigger: 'blur' } |
||||
supplier: [ |
], |
||||
{ required: true, message: '请输入供应商', trigger: 'blur' } |
supplier: [ |
||||
], |
{ required: true, message: '请输入供应商', trigger: 'blur' } |
||||
count: [ |
], |
||||
{ required: true, message: '请输入商品数量', trigger: 'blur' } |
count: [ |
||||
], |
{ required: true, message: '请输入商品数量', trigger: 'blur' } |
||||
storehouse: [ |
], |
||||
{ required: true, message: '请输入所属仓库', trigger: 'blur' } |
storehouse: [ |
||||
] |
{ required: true, message: '请输入所属仓库', trigger: 'blur' } |
||||
} |
] |
||||
}; |
} |
||||
}, |
}; |
||||
mounted() { |
}, |
||||
|
mounted() { |
||||
}, |
|
||||
created() { |
}, |
||||
this.getProductList() |
created() { |
||||
this.getSupplierList() |
this.getProductList() |
||||
this.getStorehouseList() |
this.getSupplierList() |
||||
this.getcustListList() |
this.getStorehouseList() |
||||
this.openAddPurchaseDialog() |
this.getcustListList() |
||||
}, |
this.openAddPurchaseDialog() |
||||
methods: { |
}, |
||||
handleReturn(isreload) { |
methods: { |
||||
if (isreload === "true") this.$emit("reloadlist"); |
handleReturn(isreload) { |
||||
this.clearList() |
if (isreload === "true") this.$emit("reloadlist"); |
||||
this.$emit("doback"); |
this.clearList() |
||||
}, |
this.$emit("doback"); |
||||
clearList() { |
}, |
||||
this.purchaseForm={ |
clearList() { |
||||
purchaseId: '', |
this.purchaseForm={ |
||||
product: '', |
purchaseId: '', |
||||
barCode: '', |
product: '', |
||||
purchaseDate:'', |
barCode: '', |
||||
purchaseNo:'', |
purchaseDate:'', |
||||
supplier: '', |
purchaseNo:'', |
||||
storehouseName:'', |
supplier: '', |
||||
supplierName:'', |
storehouseName:'', |
||||
count: '', |
storehouseId:"", |
||||
storehouse: '', |
supplierName:'', |
||||
status: '', |
supplierId:'', |
||||
products:[] |
count: '', |
||||
|
storehouse: '', |
||||
} |
status: '', |
||||
}, |
products:[] |
||||
saveOrUpdate(){ |
|
||||
if (this.viewTitle === "【新增】采购订单") return this.addStorehouse(); |
} |
||||
if (this.viewTitle === "【修改】采购订单") { |
}, |
||||
this.addStorehouse(); |
saveOrUpdate(){ |
||||
} |
this.storehouseList.forEach((v, i) => { |
||||
}, |
if(v.sid == this.purchaseForm.storehouseId){ |
||||
showAdd() { |
this.purchaseForm.storehouseName = v.name |
||||
this.viewTitle = "【新增】采购订单"; |
} |
||||
this.clearList() |
}) |
||||
this.openAddPurchaseDialog() |
this.supplierList.forEach((v, i) => { |
||||
}, |
if(v.id == this.purchaseForm.supplierId){ |
||||
async showEdit(row) { |
this.purchaseForm.supplierName = v.name |
||||
this.viewTitle = "【修改】采购订单"; |
} |
||||
const _this = this |
}) |
||||
const { data: result } = await this.$http.get(`/purchasenew/fetchDetailsBySid/${row.sid}`) |
if (this.viewTitle === "【新增】采购订单") return this.addStorehouse(); |
||||
if (result.code==200) { |
if (this.viewTitle === "【修改】采购订单") { |
||||
_this.purchaseForm=result.data |
this.addStorehouse(); |
||||
} |
} |
||||
}, |
}, |
||||
addStorehouse(){ |
showAdd() { |
||||
this.$refs.dataForm.validate(async validate => { |
this.viewTitle = "【新增】采购订单"; |
||||
if (!validate) return this.$message.error('请填写必填项') |
this.clearList() |
||||
this.purchaseForm.status = '待审核' |
this.openAddPurchaseDialog() |
||||
const { data: result } = await this.$http.post('/purchasenew/save', this.purchaseForm) |
}, |
||||
if (result.code == 200) { |
async showEdit(row) { |
||||
this.$message({ type: 'success', message: result.msg, showClose: true }) |
this.viewTitle = "【修改】采购订单"; |
||||
this.handleReturn('true') |
const _this = this |
||||
this.clearList() |
const { data: result } = await this.$http.get(`/purchasenew/fetchDetailsBySid/${row.sid}`) |
||||
} |
if (result.code==200) { |
||||
}) |
_this.purchaseForm=result.data |
||||
}, |
} |
||||
async getSupplierList () { |
}, |
||||
const { data: result } = await this.$http.get('/purchase/getSupplier') |
addStorehouse(){ |
||||
if (result.status !== 200) return this.$message.error('获取列表失败') |
this.$refs.dataForm.validate(async validate => { |
||||
this.supplierList = result.data |
if (!validate) return this.$message.error('请填写必填项') |
||||
}, |
this.purchaseForm.status = '待审核' |
||||
async getStorehouseList () { |
const { data: result } = await this.$http.post('/purchasenew/save', this.purchaseForm) |
||||
const { data: result } = await this.$http.get("/v1/shstorehouse/listAll") |
if (result.code == 200) { |
||||
if (result.code == 200){ |
this.$message({ type: 'success', message: result.msg, showClose: true }) |
||||
this.storehouseList = result.data |
this.handleReturn('true') |
||||
} |
this.clearList() |
||||
}, |
} |
||||
async getProductList () { |
}) |
||||
const { data: result } = await this.$http.get('/purchase/getProductList', { params: { name: this.purchaseForm.product } }) |
}, |
||||
if (result.status !== 200) return this.$message.error('获取商品列表失败') |
async getSupplierList () { |
||||
this.productList = result.data |
const { data: result } = await this.$http.get('/purchase/getSupplier') |
||||
this.purchaseForm.barCode = this.productList[0].barCode |
if (result.status !== 200) return this.$message.error('获取列表失败') |
||||
}, |
this.supplierList = result.data |
||||
async getcustListList () { |
}, |
||||
const { data: result } = await this.$http.get('/v1/shstorehouse/fetchEntList') |
async getStorehouseList () { |
||||
if (result.code == 200){ |
const { data: result } = await this.$http.get("/v1/shstorehouse/listAll") |
||||
this.custList = result.data |
if (result.code == 200){ |
||||
} |
this.storehouseList = result.data |
||||
}, |
} |
||||
openAddPurchaseDialog () { |
}, |
||||
var now = new Date() |
async getProductList () { |
||||
this.purchaseForm.purchaseNo = 'IP' + now.getTime() |
const { data: result } = await this.$http.get('/purchase/getProductList', { params: { name: this.purchaseForm.product } }) |
||||
if (this.productList2.length == 0) this.productList2 = this.productList |
if (result.status !== 200) return this.$message.error('获取商品列表失败') |
||||
this.add() |
this.productList = result.data |
||||
}, |
this.purchaseForm.barCode = this.productList[0].barCode |
||||
add(){ |
}, |
||||
this.purchaseForm.products.push({ |
async getcustListList () { |
||||
|
const { data: result } = await this.$http.get('/v1/shstorehouse/fetchEntList') |
||||
}) |
if (result.code == 200){ |
||||
}, |
this.custList = result.data |
||||
doCommoditylDel(index) { |
} |
||||
|
}, |
||||
const tip = '请确认是否删除所选记录?' |
openAddPurchaseDialog () { |
||||
this.$confirm(tip, '提示', { |
var now = new Date() |
||||
confirmButtonText: '确定', |
this.purchaseForm.purchaseNo = 'IP' + now.getTime() |
||||
cancelButtonText: '取消', |
if (this.productList2.length == 0) this.productList2 = this.productList |
||||
type: 'warning' |
this.add() |
||||
}).then(() => { |
}, |
||||
this.purchaseForm.products.splice(index, 1); |
add(){ |
||||
}) |
this.purchaseForm.products.push({ |
||||
}, |
|
||||
getLists(){ |
}) |
||||
let arrList=this.purchaseForm.products |
}, |
||||
for(let i=0;i<arrList.length;i++){ |
doCommoditylDel(index) { |
||||
if(arrList[i].estimateNum && arrList[i].estimateConfirmedPrice){ |
|
||||
let newValue=parseFloat(arrList[i].estimateNum) * parseFloat(arrList[i].estimateConfirmedPrice) || 0 |
const tip = '请确认是否删除所选记录?' |
||||
let getValue=Math.floor(newValue*100)/100 |
this.$confirm(tip, '提示', { |
||||
this.$set(arrList[i], 'estimateCalculatedValue', getValue) |
confirmButtonText: '确定', |
||||
}else{ |
cancelButtonText: '取消', |
||||
this.$set(arrList[i], 'estimateCalculatedValue', '') |
type: 'warning' |
||||
} |
}).then(() => { |
||||
} |
this.purchaseForm.products.splice(index, 1); |
||||
}, |
}) |
||||
limitInput1(value, index) { |
}, |
||||
this.purchaseForm.products[index].estimateConfirmedPrice = |
getLists(){ |
||||
("" + value) // 第一步:转成字符串 |
let arrList=this.purchaseForm.products |
||||
.replace(/[^\d^\.]+/g, "") // 第二步:把不是数字,不是小数点的过滤掉 |
for(let i=0;i<arrList.length;i++){ |
||||
.replace(/^0+(\d)/, "$1") // 第三步:第一位0开头,0后面为数字,则过滤掉,取后面的数字 |
if(arrList[i].estimateNum && arrList[i].estimateConfirmedPrice){ |
||||
.replace(/^\./, "0.") // 第四步:如果输入的第一位为小数点,则替换成 0. 实现自动补全 |
let newValue=parseFloat(arrList[i].estimateNum) * parseFloat(arrList[i].estimateConfirmedPrice) || 0 |
||||
.match(/^\d*(\.?\d{0,2})/g)[0] || ""; // 第五步:最终匹配得到结果 以数字开头,只有一个小数点,而且小数点后面只能有0到2位小数 |
let getValue=Math.floor(newValue*100)/100 |
||||
this.getLists() |
this.$set(arrList[i], 'estimateCalculatedValue', getValue) |
||||
}, |
}else{ |
||||
limitInput2(value, index) { |
this.$set(arrList[i], 'estimateCalculatedValue', '') |
||||
this.purchaseForm.products[index].estimateNum = |
} |
||||
("" + value) // 第一步:转成字符串 |
} |
||||
.replace(/[^\d^\.]+/g, "") // 第二步:把不是数字,不是小数点的过滤掉 |
}, |
||||
.replace(/^0+(\d)/, "$1") // 第三步:第一位0开头,0后面为数字,则过滤掉,取后面的数字 |
limitInput1(value, index) { |
||||
.replace(/^\./, "0.") // 第四步:如果输入的第一位为小数点,则替换成 0. 实现自动补全 |
this.purchaseForm.products[index].estimateConfirmedPrice = |
||||
.match(/^\d*(\.?\d{0,2})/g)[0] || ""; // 第五步:最终匹配得到结果 以数字开头,只有一个小数点,而且小数点后面只能有0到2位小数 |
("" + value) // 第一步:转成字符串 |
||||
this.getLists() |
.replace(/[^\d^\.]+/g, "") // 第二步:把不是数字,不是小数点的过滤掉 |
||||
}, |
.replace(/^0+(\d)/, "$1") // 第三步:第一位0开头,0后面为数字,则过滤掉,取后面的数字 |
||||
}, |
.replace(/^\./, "0.") // 第四步:如果输入的第一位为小数点,则替换成 0. 实现自动补全 |
||||
}; |
.match(/^\d*(\.?\d{0,2})/g)[0] || ""; // 第五步:最终匹配得到结果 以数字开头,只有一个小数点,而且小数点后面只能有0到2位小数 |
||||
</script> |
this.getLists() |
||||
|
}, |
||||
<style scoped> |
limitInput2(value, index) { |
||||
/deep/ .el-collapse-item__header { |
this.purchaseForm.products[index].estimateNum = |
||||
height: 40px; |
("" + value) // 第一步:转成字符串 |
||||
font-weight: bold; |
.replace(/[^\d^\.]+/g, "") // 第二步:把不是数字,不是小数点的过滤掉 |
||||
font-size: 16px; |
.replace(/^0+(\d)/, "$1") // 第三步:第一位0开头,0后面为数字,则过滤掉,取后面的数字 |
||||
text-align: left; |
.replace(/^\./, "0.") // 第四步:如果输入的第一位为小数点,则替换成 0. 实现自动补全 |
||||
color: #ffffff; |
.match(/^\d*(\.?\d{0,2})/g)[0] || ""; // 第五步:最终匹配得到结果 以数字开头,只有一个小数点,而且小数点后面只能有0到2位小数 |
||||
background-color: #0294d7; |
this.getLists() |
||||
} |
}, |
||||
|
}, |
||||
/deep/ .el-collapse-item__content { |
}; |
||||
padding-bottom: 0; |
</script> |
||||
} |
|
||||
.trightb { |
<style scoped> |
||||
display: flex; |
/deep/ .el-collapse-item__header { |
||||
align-items: center; |
height: 40px; |
||||
text-align: center; |
font-weight: bold; |
||||
justify-content: center; |
font-size: 16px; |
||||
} |
text-align: left; |
||||
|
color: #ffffff; |
||||
.trightb_item { |
background-color: #0294d7; |
||||
padding-top: 5px; |
} |
||||
} |
|
||||
|
/deep/ .el-collapse-item__content { |
||||
.span { |
padding-bottom: 0; |
||||
margin-left: 50px; |
} |
||||
font-size: 15px; |
.trightb { |
||||
font-weight: 400; |
display: flex; |
||||
} |
align-items: center; |
||||
.formadd { |
text-align: center; |
||||
padding: 10px 40px 0 40px; |
justify-content: center; |
||||
font-size: 16px; |
} |
||||
} |
|
||||
.formadd .title { |
.trightb_item { |
||||
font-weight: bold; |
padding-top: 5px; |
||||
font-size: 16px; |
} |
||||
background-color: #0294d7; |
|
||||
text-align: left; |
.span { |
||||
color: #ffffff; |
margin-left: 50px; |
||||
} |
font-size: 15px; |
||||
.first_row{ |
font-weight: 400; |
||||
border-top: 1px solid #e0e3eb; |
} |
||||
} |
.formadd { |
||||
.formadd .el-row { |
padding: 10px 40px 0 40px; |
||||
display: flex; |
font-size: 16px; |
||||
flex-wrap: wrap; |
} |
||||
border-left: 1px solid #e0e3eb; |
.formadd .title { |
||||
} |
font-weight: bold; |
||||
.formadd .el-row .el-col { |
font-size: 16px; |
||||
border-right: 1px solid #e0e3eb; |
background-color: #0294d7; |
||||
border-bottom: 1px solid #e0e3eb; |
text-align: left; |
||||
padding: 0 15px; |
color: #ffffff; |
||||
min-height: 42px; |
} |
||||
line-height: 1; |
.first_row{ |
||||
} |
border-top: 1px solid #e0e3eb; |
||||
.formadd .el-row .el-col .el-form-item { |
} |
||||
margin-bottom: 0; |
.formadd .el-row { |
||||
line-height: 42px; |
display: flex; |
||||
} |
flex-wrap: wrap; |
||||
.addinputw { |
border-left: 1px solid #e0e3eb; |
||||
width: 80%; |
} |
||||
line-height: 42px; |
.formadd .el-row .el-col { |
||||
} |
border-right: 1px solid #e0e3eb; |
||||
.el-input__inner { |
border-bottom: 1px solid #e0e3eb; |
||||
height: 36px; |
padding: 0 15px; |
||||
} |
min-height: 42px; |
||||
</style> |
line-height: 1; |
||||
|
} |
||||
|
.formadd .el-row .el-col .el-form-item { |
||||
|
margin-bottom: 0; |
||||
|
line-height: 42px; |
||||
|
} |
||||
|
.addinputw { |
||||
|
width: 80%; |
||||
|
line-height: 42px; |
||||
|
} |
||||
|
.el-input__inner { |
||||
|
height: 36px; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
Loading…
Reference in new issue