Commit dea225b1 authored by Marcus's avatar Marcus

入仓新增货物 去掉订单项id

parent c0651547
<template>
<div>
<el-dialog
title="入仓-货物入仓"
:visible.sync="opened"
width="960px"
>
<el-descriptions border :column="2">
<el-descriptions-item label="中文品名">{{ warehousing.prodTitleZh }}</el-descriptions-item>
<el-descriptions-item label="英文品名">{{ warehousing.prodTitleEn }}</el-descriptions-item>
<el-descriptions-item label="品牌">
<span v-if="warehousing.orderWarehouseInBackItemDoList && warehousing.orderWarehouseInBackItemDoList.length">{{ form.brand ? brand : '' }}</span>
<el-select
v-else v-model="form.brand"
placeholder="可修改"
filterable
@change="handleBrandChange"
allow-create>
<el-option
v-for="item in brandList"
:key="item.id"
:label="item.titleZh"
:value="item.id">
</el-option>
</el-select>
</el-descriptions-item>
<el-descriptions-item label="是否备案">{{ isBeian }}</el-descriptions-item>
<el-descriptions-item label="收费模式">{{ feeType }}</el-descriptions-item>
<el-descriptions-item label="填单参数">
箱数:{{ warehousing.num }}<br>
体积:{{ warehousing.volume }}<br>
重量:{{ warehousing.weight }}Kg
</el-descriptions-item>
</el-descriptions>
<el-form ref="form" :model="form" label-width="80px" style="margin-top: 20px">
<el-form-item label="材质">
<dict-selector :type="DICT_TYPE.ECW_PRODUCT_MATERIAL" v-model="form.material"></dict-selector>
</el-form-item>
<el-form-item label="入仓时间">
<el-date-picker v-model="form.inTime" type="datetime" placeholder="请选择入仓时间" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</el-form>
<el-tabs v-model="activeName" type="card" @tab-click="handleTabs">
<el-tab-pane label="货物入仓" name="first">
<el-descriptions border :column="2">
<el-descriptions-item label="中文品名">{{ warehousing.prodTitleZh }}</el-descriptions-item>
<el-descriptions-item label="英文品名">{{ warehousing.prodTitleEn }}</el-descriptions-item>
<el-descriptions-item label="品牌">
<span v-if="warehousing.orderWarehouseInBackItemDoList && warehousing.orderWarehouseInBackItemDoList.length">{{ form.brand ? brand : '' }}</span>
<el-select
v-else v-model="form.brand"
placeholder="可修改"
filterable
@change="handleBrandChange"
allow-create>
<el-option
v-for="item in brandList"
:key="item.id"
:label="item.titleZh"
:value="item.id">
</el-option>
</el-select>
</el-descriptions-item>
<el-descriptions-item label="是否备案">{{ isBeian }}</el-descriptions-item>
<el-descriptions-item label="收费模式">{{ feeType }}</el-descriptions-item>
<el-descriptions-item label="填单参数">
箱数:{{ warehousing.num }}<br>
体积:{{ warehousing.volume }}<br>
重量:{{ warehousing.weight }}Kg
</el-descriptions-item>
</el-descriptions>
<el-form ref="form" :model="form" label-width="80px" style="margin-top: 20px">
<el-form-item label="材质">
<dict-selector :type="DICT_TYPE.ECW_PRODUCT_MATERIAL" v-model="form.material"></dict-selector>
</el-form-item>
<el-form-item label="入仓时间">
<el-date-picker v-model="form.inTime" type="datetime" placeholder="请选择入仓时间" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</el-form>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>入仓记录</span>
<el-button style="float: right;margin-left: 15px" size="mini" type="primary" icon="el-icon-minus" circle @click="handleDelete"></el-button>
<el-button style="float: right" size="mini" type="primary" icon="el-icon-plus" circle @click="handleAdd()"></el-button>
</div>
<el-table
:data="tableData"
style="width: 100%">
<el-table-column label="箱数">
<template v-slot="{r,c,$index}">
<span v-if="tableData[$index].id">{{ tableData[$index].cartonsNum }}</span>
<el-input v-else v-model="tableData[$index].cartonsNum" placeholder=""></el-input>
<span>{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData[$index].unit) }}</span>
</template>
</el-table-column>
<el-table-column label="包装类型">
<template v-slot="{r,c,$index}">
<span v-if="tableData[$index].id">{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData[$index].unit) }}</span>
<dict-selector v-else :type="DICT_TYPE.ECW_PACKAGE_TYPE" v-model="tableData[$index].unit"></dict-selector>
</template>
</el-table-column>
<el-table-column label="长(cm)">
<template v-slot="{r,c,$index}">
<span v-if="tableData[$index].id">{{ tableData[$index].boxGauge ? tableData[$index].boxGauge.split('*')[0] : '' }}</span>
<el-input v-else v-model.number="tableData[$index].boxGauge1" placeholder="" @blur="handleVolume($index)"></el-input>
</template>
</el-table-column>
<el-table-column label="宽(cm)">
<template v-slot="{r,c,$index}">
<span v-if="tableData[$index].id">{{ tableData[$index].boxGauge ? tableData[$index].boxGauge.split('*')[1] : '' }}</span>
<el-input v-else v-model.number="tableData[$index].boxGauge2" placeholder="" @blur="handleVolume($index)"></el-input>
</template>
</el-table-column>
<el-table-column label="高(cm)">
<template v-slot="{r,c,$index}">
<span v-if="tableData[$index].id">{{ tableData[$index].boxGauge ? tableData[$index].boxGauge.split('*')[2] : '' }}</span>
<el-input v-else v-model.number="tableData[$index].boxGauge3" placeholder="" @blur="handleVolume($index)"></el-input>
</template>
</el-table-column>
<el-table-column label="体积(m³)">
<template v-slot="{r,c,$index}">
<span v-if="tableData[$index].id">{{ tableData[$index].volume }}</span>
<el-input v-else v-model.number="tableData[$index].volume" placeholder=""></el-input>
</template>
</el-table-column>
<el-table-column label="重量(Kg)">
<template v-slot="{r,c,$index}">
<span v-if="tableData[$index].id">{{ tableData[$index].weight }}</span>
<el-input v-else v-model.number="tableData[$index].weight" placeholder=""></el-input>
</template>
</el-table-column>
<el-table-column label="数量" width="130px">
<template v-slot="{r,c,$index}">
<span v-if="tableData[$index].id">{{ tableData[$index].quantityAll }}</span>
<el-input v-else v-model.number="tableData[$index].quantityAll" placeholder="">
<template slot="append"></template>
</el-input>
</template>
</el-table-column>
<el-table-column label="快递单号">
<template v-slot="{r,c,$index}">
<span v-if="tableData[$index].id">{{ tableData[$index].expressNo }}</span>
<el-input v-else v-model="tableData[$index].expressNo" placeholder=""></el-input>
</template>
</el-table-column>
</el-table>
</el-card>
</el-tab-pane>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>入仓记录</span>
<el-button style="float: right;margin-left: 15px" size="mini" type="primary" icon="el-icon-minus" circle @click="handleDelete"></el-button>
<el-button style="float: right" size="mini" type="primary" icon="el-icon-plus" circle @click="handleAdd()"></el-button>
</div>
<el-table
:data="tableData"
style="width: 100%">
<el-table-column label="箱数">
<template v-slot="{r,c,$index}">
<span v-if="tableData[$index].id">{{ tableData[$index].cartonsNum }}</span>
<el-input v-else v-model="tableData[$index].cartonsNum" placeholder=""></el-input>
<span>{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData[$index].unit) }}</span>
</template>
</el-table-column>
<el-table-column label="包装类型">
<template v-slot="{r,c,$index}">
<span v-if="tableData[$index].id">{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData[$index].unit) }}</span>
<dict-selector v-else :type="DICT_TYPE.ECW_PACKAGE_TYPE" v-model="tableData[$index].unit"></dict-selector>
</template>
</el-table-column>
<el-table-column label="长(cm)">
<template v-slot="{r,c,$index}">
<span v-if="tableData[$index].id">{{ tableData[$index].boxGauge ? tableData[$index].boxGauge.split('*')[0] : '' }}</span>
<el-input v-else v-model.number="tableData[$index].boxGauge1" placeholder="" @blur="handleVolume($index)"></el-input>
</template>
</el-table-column>
<el-table-column label="宽(cm)">
<template v-slot="{r,c,$index}">
<span v-if="tableData[$index].id">{{ tableData[$index].boxGauge ? tableData[$index].boxGauge.split('*')[1] : '' }}</span>
<el-input v-else v-model.number="tableData[$index].boxGauge2" placeholder="" @blur="handleVolume($index)"></el-input>
</template>
</el-table-column>
<el-table-column label="高(cm)">
<template v-slot="{r,c,$index}">
<span v-if="tableData[$index].id">{{ tableData[$index].boxGauge ? tableData[$index].boxGauge.split('*')[2] : '' }}</span>
<el-input v-else v-model.number="tableData[$index].boxGauge3" placeholder="" @blur="handleVolume($index)"></el-input>
</template>
</el-table-column>
<el-table-column label="体积(m³)">
<template v-slot="{r,c,$index}">
<span v-if="tableData[$index].id">{{ tableData[$index].volume }}</span>
<el-input v-else v-model.number="tableData[$index].volume" placeholder=""></el-input>
</template>
</el-table-column>
<el-table-column label="重量(Kg)">
<template v-slot="{r,c,$index}">
<span v-if="tableData[$index].id">{{ tableData[$index].weight }}</span>
<el-input v-else v-model.number="tableData[$index].weight" placeholder=""></el-input>
</template>
</el-table-column>
<el-table-column label="数量" width="130px">
<template v-slot="{r,c,$index}">
<span v-if="tableData[$index].id">{{ tableData[$index].quantityAll }}</span>
<el-input v-else v-model.number="tableData[$index].quantityAll" placeholder="">
<template slot="append"></template>
</el-input>
</template>
</el-table-column>
<el-table-column label="快递单号">
<template v-slot="{r,c,$index}">
<span v-if="tableData[$index].id">{{ tableData[$index].expressNo }}</span>
<el-input v-else v-model="tableData[$index].expressNo" placeholder=""></el-input>
</template>
</el-table-column>
</el-table>
</el-card>
<el-tab-pane label="添加新品名" name="second">
<el-descriptions border :column="2">
<el-descriptions-item label="中文品名">
<product-selector v-model="form1.prodId" @change="onProductChange"/>
</el-descriptions-item>
<el-descriptions-item label="英文品名">
<product-selector lang="En" v-model="form1.prodId" @change="onProductChange"/>
</el-descriptions-item>
<el-descriptions-item label="品牌">
<span v-if="warehousing.orderWarehouseInBackItemDoList && warehousing.orderWarehouseInBackItemDoList.length">{{ form1.brand ? brand1 : '无' }}</span>
<el-select
v-else v-model="form1.brand"
placeholder="可修改"
filterable
@change="handleBrandChange"
allow-create>
<el-option
v-for="item in brandList"
:key="item.id"
:label="item.titleZh"
:value="item.id">
</el-option>
</el-select>
</el-descriptions-item>
<el-descriptions-item label="是否备案">{{ isBeian1 }}</el-descriptions-item>
<el-descriptions-item label="收费模式">{{ feeType1 }}</el-descriptions-item>
<el-descriptions-item label="填单参数">非填单货物</el-descriptions-item>
</el-descriptions>
<el-form ref="form" :model="form" label-width="80px" style="margin-top: 20px">
<el-form-item label="材质">
<dict-selector :type="DICT_TYPE.ECW_PRODUCT_MATERIAL" v-model="form1.material"></dict-selector>
</el-form-item>
<el-form-item label="入仓时间">
<el-date-picker v-model="form1.inTime" type="datetime" placeholder="请选择入仓时间" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</el-form>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>入仓记录</span>
<el-button style="float: right;margin-left: 15px" size="mini" type="primary" icon="el-icon-minus" circle @click="handleDelete(1)"></el-button>
<el-button style="float: right" size="mini" type="primary" icon="el-icon-plus" circle @click="handleAdd(1)"></el-button>
</div>
<el-table
:data="tableData1"
style="width: 100%">
<el-table-column label="箱数">
<template v-slot="{r,c,$index}">
<span v-if="tableData1[$index].id">{{ tableData1[$index].cartonsNum }}</span>
<el-input v-else v-model="tableData1[$index].cartonsNum" placeholder=""></el-input>
<span>{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData1[$index].unit) }}</span>
</template>
</el-table-column>
<el-table-column label="包装类型">
<template v-slot="{r,c,$index}">
<span v-if="tableData1[$index].id">{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData1[$index].unit) }}</span>
<dict-selector v-else :type="DICT_TYPE.ECW_PACKAGE_TYPE" v-model="tableData1[$index].unit"></dict-selector>
</template>
</el-table-column>
<el-table-column label="长(cm)">
<template v-slot="{r,c,$index}">
<span v-if="tableData1[$index].id">{{ tableData1[$index].boxGauge ? tableData1[$index].boxGauge.split('*')[0] : '' }}</span>
<el-input v-else v-model.number="tableData1[$index].boxGauge1" placeholder="" @blur="handleVolume($index, 1)"></el-input>
</template>
</el-table-column>
<el-table-column label="宽(cm)">
<template v-slot="{r,c,$index}">
<span v-if="tableData1[$index].id">{{ tableData1[$index].boxGauge ? tableData1[$index].boxGauge.split('*')[1] : '' }}</span>
<el-input v-else v-model.number="tableData1[$index].boxGauge2" placeholder="" @blur="handleVolume($index, 1)"></el-input>
</template>
</el-table-column>
<el-table-column label="高(cm)">
<template v-slot="{r,c,$index}">
<span v-if="tableData1[$index].id">{{ tableData1[$index].boxGauge ? tableData1[$index].boxGauge.split('*')[2] : '' }}</span>
<el-input v-else v-model.number="tableData1[$index].boxGauge3" placeholder="" @blur="handleVolume($index, 1)"></el-input>
</template>
</el-table-column>
<el-table-column label="体积(m³)">
<template v-slot="{r,c,$index}">
<span v-if="tableData1[$index].id">{{ tableData1[$index].volume }}</span>
<el-input v-else v-model.number="tableData1[$index].volume" placeholder=""></el-input>
</template>
</el-table-column>
<el-table-column label="重量(Kg)">
<template v-slot="{r,c,$index}">
<span v-if="tableData1[$index].id">{{ tableData1[$index].weight }}</span>
<el-input v-else v-model.number="tableData1[$index].weight" placeholder=""></el-input>
</template>
</el-table-column>
<el-table-column label="数量" width="130px">
<template v-slot="{r,c,$index}">
<span v-if="tableData1[$index].id">{{ tableData1[$index].quantityAll }}</span>
<el-input v-else v-model.number="tableData1[$index].quantityAll" placeholder="">
<template slot="append"></template>
</el-input>
</template>
</el-table-column>
<el-table-column label="快递单号">
<template v-slot="{r,c,$index}">
<span v-if="tableData1[$index].id">{{ tableData1[$index].expressNo }}</span>
<el-input v-else v-model="tableData1[$index].expressNo" placeholder=""></el-input>
</template>
</el-table-column>
</el-table>
</el-card>
</el-tab-pane>
</el-tabs>
<div v-if="edit">
<h2>审批流程</h2>
......@@ -133,13 +243,15 @@ import { orderWarehouseIn, orderWarehouseInUpdateApply } from '@/api/ecw/order'
import { getFeeTypeByCustomerProduct, getProductBrankPage } from '@/api/ecw/productBrank'
import WorkFlow from "@/components/WorkFlow"
import elSelect from '@/components/render/slots/el-select'
import ProductSelector from "@/components/ProductSelector"
export default {
name: 'editDialog',
components: {
dictSelector,
WorkFlow
WorkFlow,
ProductSelector
},
props: {
......@@ -216,9 +328,29 @@ export default {
feeType: 0,
recordMode: undefined
},
form1: {
"brand": "",
"brandType": 0,
"inTime": "",
"material": "",
"orderId": 0,
"orderItemId": 0,
"orderNo": "",
"orderWarehouseInItemDoList": [],
"prodAttrIds": "",
"prodId": 0,
"prodTitleEn": "",
"prodTitleZh": "",
"prodType": 0,
"type": 1,
feeType: 0,
recordMode: undefined
},
// orderItem: {},
selectedUsers: undefined
selectedUsers: undefined,
activeName: 'first'
};
},
......@@ -245,6 +377,12 @@ export default {
},
methods: {
onProductChange(product){
console.log(product)
this.form1.prodTitleZh = product.titleZh
this.form1.prodTitleEn = product.titleEn
},
handleTabs(){},
handleBrandChange(v){
getFeeTypeByCustomerProduct({
brandId: parseInt(v),
......@@ -257,12 +395,12 @@ export default {
}
})
},
handleVolume(index){
const {boxGauge1, boxGauge2, boxGauge3} = this.tableData[index]
handleVolume(index, val){
const {boxGauge1, boxGauge2, boxGauge3} = (val === 1 ? this.tableData1 : this.tableData)[index]
if (boxGauge1 && boxGauge2 && boxGauge3) {
this.tableData[index].volume = ((boxGauge1 * boxGauge2 * boxGauge3) / 1000000).toFixed(2)
(val === 1 ? this.tableData1 : this.tableData)[index].volume = ((boxGauge1 * boxGauge2 * boxGauge3) / 1000000).toFixed(2)
} else {
this.tableData[index].volume = 0
(val === 1 ? this.tableData1 : this.tableData)[index].volume = 0
}
},
handleSubmit() {
......@@ -275,7 +413,29 @@ export default {
}
})
]
if (this.edit)
if (this.activeName !== "first"){
return orderWarehouseIn({
...this.form1,
brandType: this.form1.brand ? 1 : 0,
orderId: this.warehousing.orderId,
orderItemId: undefined,
orderNo: this.warehousing.orderNo,
orderWarehouseInItemDoList: this.form.orderWarehouseInItemDoList.map(e => {
return {
...e,
boxGauge: e.boxGauge1 + '*' + e.boxGauge2 + '*' + e.boxGauge3
}
})
}).then(r => {
if (r.data){
this.$message.success('新增入仓成功')
this.handleClose()
}else {
this.$message.success('新增入仓失败')
}
})
}
else if (this.edit)
return orderWarehouseInUpdateApply({
...this.form,
brandType: this.form.brand ? 1 : 0,
......@@ -313,18 +473,18 @@ export default {
this.form.orderWarehouseInItemDoList = []
this.opened = false
},
handleDelete() {
this.form.orderWarehouseInItemDoList.pop()
handleDelete(val) {
(val === 1 ? this.form1 : this.form).orderWarehouseInItemDoList.pop()
},
handleAdd() {
this.form.orderWarehouseInItemDoList.push({
handleAdd(val) {
(val === 1 ? this.form1 : this.form).orderWarehouseInItemDoList.push({
"boxGauge1": "",
"boxGauge2": "",
"boxGauge3": "",
"cartonsNum": "",
"expressNo": "",
"quantityAll": "",
"unit": "",
"unit": "package",
"volume": '',
"weight": ''
})
......@@ -335,9 +495,15 @@ export default {
brandObject(){
return this.brandList.find(e => e.id === this.form.brand) || ''
},
brandObject1(){
return this.brandList.find(e => e.id === this.form1.brand) || ''
},
tableData() {
return [...this.warehousing.orderWarehouseInBackItemDoList, ...this.form.orderWarehouseInItemDoList]
},
tableData1() {
return this.form1.orderWarehouseInItemDoList
},
isBeian(){
if (this.form.recordMode !== undefined){
return ['无备案', '有备案', '中性'][this.form.recordMode]
......@@ -348,18 +514,34 @@ export default {
return ''
}
},
isBeian1(){
if (this.form1.recordMode !== undefined){
return ['无备案', '有备案', '中性'][this.form1.recordMode]
}
if (this.brandObject1.filing){
return ['无备案', '有备案', '中性'][this.brandObject1.filing]
} else {
return ''
}
},
/**
* 收费模式
* @returns {string}
* @returns {string} 无牌价0,有牌价1,中性品牌价2
*/
feeType(){
// 无牌价0,有牌价1,中性品牌价2
const feeType = parseInt(this.form.feeType)
if (feeType >= 0 && feeType < 3) {
return ['无牌价', '有牌价', '中性品牌价'][feeType]
}
return ''
},
feeType1(){
const feeType = parseInt(this.form1.feeType)
if (feeType >= 0 && feeType < 3) {
return ['无牌价', '有牌价', '中性品牌价'][feeType]
}
return ''
},
brand(){
if (!!this.form.brand){
const brand = this.brandList.find(e => e.id === this.form.brand)
......@@ -368,6 +550,15 @@ export default {
}
}
return ''
},
brand1(){
if (!!this.form1.brand){
const brand = this.brandList.find(e => e.id === this.form1.brand)
if (brand) {
return brand.titleZh
}
}
return ''
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment